ProxyAdminWithDeputy
ProxyAdminWithDeputy
Based on ProxyAdmin, an auxiliary contract in OpenZeppelin's upgradeability approach meant to act as the admin of a TransparentUpgradeableProxy. This variant allows an additional actor, the "deputy", to perform upgrades, which originally can only be performed by the ProxyAdmin's owner. See OpenZeppelin's documentation for TransparentUpgradeableProxy for more details on why a ProxyAdmin is recommended.
deputy
address deputyDeputyUpdated
event DeputyUpdated(address previousDeputy, address newDeputy)onlyOwnerOrDeputy
modifier onlyOwnerOrDeputy()constructor
constructor(contract StakerGovernor dao, address _deputy) publicsetDeputy
function setDeputy(address newDeputy) externalupgrade
function upgrade(contract TransparentUpgradeableProxy proxy, address implementation) public virtualUpgrades proxy to implementation. This contract must be the admin of proxy, and the caller must be this contract's owner or the deputy.
upgradeAndCall
function upgradeAndCall(contract TransparentUpgradeableProxy proxy, address implementation, bytes data) public payable virtualUpgrades proxy to implementation and calls a function on the new implementation. This contract must be the admin of proxy, and the caller must be this contract's owner or the deputy.
_setDeputy
function _setDeputy(address newDeputy) internal_checkCallerIsOwnerOrDeputy
function _checkCallerIsOwnerOrDeputy() internal viewLast updated
Was this helpful?