diff --git a/contracts/GovernorBravoDelegate.sol b/contracts/GovernorBravoDelegate.sol index 93c085b..a3263ef 100644 --- a/contracts/GovernorBravoDelegate.sol +++ b/contracts/GovernorBravoDelegate.sol @@ -370,6 +370,16 @@ contract InstaGovernorBravoDelegate is GovernorBravoDelegateStorageV1, GovernorB emit NewPendingAdmin(oldPendingAdmin, pendingAdmin); } + /** + * @notice Accepts transfer of admin rights on timelock contract. msg.sender must be admin of this contract + * @dev Admin function for pending admin to accept role and update admin on timelock contract + */ + function _acceptAdminOnTimelock() external { + // Check caller is pendingAdmin and pendingAdmin ≠ address(0) + require(msg.sender == admin && msg.sender != address(0), "GovernorBravo:_acceptAdmin: pending admin only"); + timelock.acceptAdmin(); + } + function getChainIdInternal() internal pure returns (uint) { uint chainId; diff --git a/contracts/GovernorBravoInterfaces.sol b/contracts/GovernorBravoInterfaces.sol index 4b9b337..af89a68 100644 --- a/contracts/GovernorBravoInterfaces.sol +++ b/contracts/GovernorBravoInterfaces.sol @@ -63,6 +63,9 @@ contract GovernorBravoEvents { /// @notice Emitted when pendingAdmin is accepted, which means admin is updated event NewAdmin(address oldAdmin, address newAdmin); + + /// @notice Emitted when pendingAdmin is accepted, which means timelock is updated + event NewTimelock(address oldTimelock, address newTimelock); } contract GovernorBravoDelegatorStorage { diff --git a/contracts/Timelock.sol b/contracts/Timelock.sol index 9771a39..ce48d30 100644 --- a/contracts/Timelock.sol +++ b/contracts/Timelock.sol @@ -19,7 +19,7 @@ contract InstaTimelockV2 { address public admin; address public pendingAdmin; - address pubic guardian; + address public guardian; uint public delay; mapping (bytes32 => bool) public queuedTransactions; @@ -27,7 +27,7 @@ contract InstaTimelockV2 { constructor(address admin_, uint delay_, address guardian_) { require(delay_ >= MINIMUM_DELAY, "Timelock::constructor: Delay must exceed minimum delay."); - require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay."); + require(delay_ <= MAXIMUM_DELAY, "Timelock::constructor: Delay must not exceed maximum delay."); admin = admin_; delay = delay_;