mirror of
https://github.com/Instadapp/dsa-governance.git
synced 2024-07-29 22:27:52 +00:00
Added _acceptAdminOnTimelock()
This commit is contained in:
parent
60bf8a6e0e
commit
fff960e85f
|
@ -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;
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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_;
|
||||
|
|
Loading…
Reference in New Issue
Block a user