This contract combines an upgradeability proxy with an authorization mechanism for administrative tasks. All external functions in this contract must be guarded by the `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity feature proposal that would enable this to be done automatically.
event AdminChanged(address previousAdmin, address newAdmin)
Emitted when the administration has been transferred.
previousAdmin- Address of the previous admin.
newAdmin- Address of the new admin.
Modifier to check whether the `msg.sender` is the admin. If it is, it will run the function. Otherwise, it will delegate the call to the implementation.
function AdminUpgradeabilityProxy(address _implementation) public
Contract constructor. It sets the `msg.sender` as the proxy administrator.
_implementation- address of the initial implementation.
function _admin() internal returns (address)
- The admin slot.
function _setAdmin(address newAdmin) internal
Sets the address of the proxy admin.
newAdmin- Address of the new proxy admin.
function _willFallback() internal
Only fall back when the sender is not the admin.
function admin() external view returns (address)
- The address of the proxy admin.
function changeAdmin(address newAdmin) external
Changes the admin of the proxy. Only the current admin can call this function.
newAdmin- Address to transfer proxy administration to.
function implementation() external view returns (address)
- The address of the implementation.
function upgradeTo(address newImplementation) external
Upgrade the backing implementation of the proxy. Only the admin can call this function.
newImplementation- Address of the new implementation.
function upgradeToAndCall(address implementation, bytes data) external payable
Upgrade the backing implementation of the proxy and call a function on the new implementation. This is useful to initialize the proxied contract.
implementation- Address of the new implementation.
data- Data to send as msg.data in the low level call. It should include the signature and the parameters of the function to be called, as described in https://solidity.readthedocs.io/en/develop/abi-spec.html#function-selector-and-argument-encoding.