BaseAdminUpgradeabilityProxy
contract BaseAdminUpgradeabilityProxy
is UpgradeabilityAdmin, BaseUpgradeabilityProxy
This contract combines an upgradeability proxy with an authorization mechanism for administrative tasks.
Reference
Events
AdminChanged
event AdminChanged(address previousAdmin, address newAdmin)
Emitted when the administration has been transferred.
- Parameters:
previousAdmin
- Address of the previous admin.newAdmin
- Address of the new admin.
Modifiers
ifAdmin
modifier ifAdmin()
Modifier to check whether the `msg.sender` is the admin.
Functions
_setAdmin
function _setAdmin(address newAdmin) internal
Sets the address of the proxy admin.
- Parameters:
newAdmin
- Address of the new proxy admin.
admin
function admin() external view returns (address)
- Returns:
- The address of the proxy admin.
changeAdmin
function changeAdmin(address newAdmin) external
Changes the admin of the proxy. Only the current admin can call this function.
- Modifiers:
- ifAdmin
- Parameters:
newAdmin
- Address to transfer proxy administration to.
implementation
function implementation() external view returns (address)
- Returns:
- The address of the implementation.
upgradeTo
function upgradeTo(address newImplementation) external
Upgrade the backing implementation of the proxy. Only the admin can call this function.
- Modifiers:
- ifAdmin
- Parameters:
newImplementation
- Address of the new implementation.
upgradeToAndCall
function upgradeToAndCall(address newImplementation, 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.
- Modifiers:
- ifAdmin
- Parameters:
newImplementation
- 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/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.