ProxyAdmin
contract ProxyAdmin
This contract is the admin of a proxy, and is in charge of upgrading it as well as transferring it to another admin.
Reference
Functions
changeProxyAdmin
function changeProxyAdmin(AdminUpgradeabilityProxy proxy, address newAdmin) public
Changes the admin of a proxy.
- Modifiers:
- onlyOwner
- Parameters:
proxy
- Proxy to change admin.newAdmin
- Address to transfer proxy administration to.
getProxyAdmin
function getProxyAdmin(AdminUpgradeabilityProxy proxy) public view returns (address)
Returns the admin of a proxy. Only the admin can query it.
- Parameters:
proxy
- AdminUpgradeabilityProxy- Returns:
- The address of the current admin of the proxy.
getProxyImplementation
function getProxyImplementation(AdminUpgradeabilityProxy proxy) public view returns (address)
Returns the current implementation of a proxy. This is needed because only the proxy admin can query it.
- Parameters:
proxy
- AdminUpgradeabilityProxy- Returns:
- The address of the current implementation of the proxy.
upgrade
function upgrade(AdminUpgradeabilityProxy proxy, address implementation) public
Upgrades a proxy to the newest implementation of a contract.
- Modifiers:
- onlyOwner
- Parameters:
proxy
- Proxy to be upgraded.implementation
- the address of the Implementation.
upgradeAndCall
function upgradeAndCall(AdminUpgradeabilityProxy proxy, address implementation, bytes data) public payable
Upgrades a proxy to the newest implementation of a contract and forwards a function call to it. This is useful to initialize the proxied contract.
- Modifiers:
- onlyOwner
- Parameters:
proxy
- Proxy to be upgraded.implementation
- Address of the 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.