dsa-governance/contracts/payloads/PayloadIGP6.sol

63 lines
2.3 KiB
Solidity
Raw Normal View History

2024-02-05 22:17:23 +00:00
pragma solidity ^0.7.0;
import "../SafeMath.sol";
interface IGovernorBravo {
function _acceptAdmin() external;
function _setVotingDelay(uint newVotingDelay) external;
function _setVotingPeriod(uint newVotingPeriod) external;
function _acceptAdminOnTimelock() external;
}
interface ITimelock {
function acceptAdmin() external;
function setDelay(uint delay_) external;
function setPendingAdmin(address pendingAdmin_) external;
}
interface IInstaIndex {
function updateMaster() external;
}
contract PayloadIGP {
uint256 public constant PROPOSAL_ID = 6;
IGovernorBravo public constant GOVERNOR = IGovernorBravo(0x0204Cd037B2ec03605CFdFe482D8e257C765fA1B);
ITimelock public constant OLD_TIMELOCK = ITimelock(0xC7Cb1dE2721BFC0E0DA1b9D526bCdC54eF1C0eFC);
ITimelock public constant TIMELOCK = ITimelock(0xC7Cb1dE2721BFC0E0DA1b9D526bCdC54eF1C0eFC);
IInstaIndex public constant INSTAINDEX = IInstaIndex(0xC7Cb1dE2721BFC0E0DA1b9D526bCdC54eF1C0eFC);
2024-02-05 22:20:38 +00:00
uint256 public constant ONE_DAY_TIME_IN_SECONDS = 1 days; // 1 day in seconds. 86400s
uint256 public constant ONE_DAY_TIME_IN_BLOCKS = 7_200; // 1 day in blocks. 12s per block
uint256 public constant TWO_DAY_TIME_IN_BLOCKS = 14_400; // 2 day in blocks. 12s per block
2024-02-05 22:17:23 +00:00
function execute() external {
// Action 1: _acceptAdmin() function on governor contract
GOVERNOR._acceptAdmin();
// Action 2: acceptAdmin() function on old time contract
OLD_TIMELOCK.acceptAdmin();
// Action 2: updateMaster() function on DSA instaIndex
INSTAINDEX.updateMaster();
// Action 4: setDelay() on new timelock contract with 1 day
2024-02-05 22:20:38 +00:00
TIMELOCK.setDelay(ONE_DAY_TIME_IN_SECONDS);
2024-02-05 22:17:23 +00:00
// Action 5: setPendingAdmin() on new timelock contract
TIMELOCK.setPendingAdmin(address(GOVERNOR));
// Action 6: _acceptAdminOnTimelock() on governor contract
GOVERNOR._acceptAdminOnTimelock();
// Action 7: _setVotingDelay() function on governor contract with 1 days
2024-02-05 22:20:38 +00:00
GOVERNOR._setVotingDelay(ONE_DAY_TIME_IN_BLOCKS);
2024-02-05 22:17:23 +00:00
// Action 8: _setVotingPeriod() function on governor contract with 2 days
2024-02-05 22:20:38 +00:00
GOVERNOR._setVotingPeriod(TWO_DAY_TIME_IN_BLOCKS);
2024-02-05 22:17:23 +00:00
}
function verifyProposal() external {
2024-02-05 22:20:38 +00:00
2024-02-05 22:17:23 +00:00
}
}