Skip to content

Commit

Permalink
Set treasury governor to use the same timelock as the protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
elenadimitrova committed Feb 21, 2023
1 parent b8f9e46 commit 602fb8c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions contracts/governance/src/ZeroExTreasuryGovernor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ contract ZeroExTreasuryGovernor is
GovernorVotes,
GovernorTimelockControl
{
TimelockController public protocolTimelock;
//TimelockController public protocolTimelock;

constructor(
IVotes votes,
TimelockController _timelock,
//TimelockController _timelock,
TimelockController _protocolTimelock
)
Governor("ZeroExTreasuryGovernor")
GovernorSettings(14400 /* 2 days */, 50400 /* 7 days */, 5e11)
GovernorVotes(votes)
GovernorTimelockControl(_timelock)
GovernorTimelockControl(_protocolTimelock)
{
protocolTimelock = _protocolTimelock;
//protocolTimelock = _protocolTimelock;
}

function quorum(uint256 blockNumber) public pure override returns (uint256) {
Expand Down Expand Up @@ -111,7 +111,7 @@ contract ZeroExTreasuryGovernor is
}

function _executor() internal view override(Governor, GovernorTimelockControl) returns (address) {
return address(protocolTimelock);
return super._executor();
}

function supportsInterface(
Expand Down
10 changes: 5 additions & 5 deletions contracts/governance/test/BaseTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,17 @@ contract BaseTest is Test {
protocolTimelock.grantRole(protocolTimelock.PROPOSER_ROLE(), address(protocolGovernor));
protocolTimelock.grantRole(protocolTimelock.EXECUTOR_ROLE(), address(protocolGovernor));

ZeroExTimelock treasuryTimelock = new ZeroExTimelock(2 days, proposers, executors, account1);
// ZeroExTimelock treasuryTimelock = new ZeroExTimelock(2 days, proposers, executors, account1);
ZeroExTreasuryGovernor treasuryGovernor = new ZeroExTreasuryGovernor(
IVotes(address(votes)),
treasuryTimelock,
//treasuryTimelock,
protocolTimelock
);

treasuryTimelock.grantRole(treasuryTimelock.PROPOSER_ROLE(), address(treasuryGovernor));
treasuryTimelock.grantRole(treasuryTimelock.EXECUTOR_ROLE(), address(treasuryGovernor));
protocolTimelock.grantRole(protocolTimelock.PROPOSER_ROLE(), address(treasuryGovernor));
protocolTimelock.grantRole(protocolTimelock.EXECUTOR_ROLE(), address(treasuryGovernor));

return (zrxToken, token, votes, protocolTimelock, treasuryTimelock, protocolGovernor, treasuryGovernor);
return (zrxToken, token, votes, protocolTimelock, protocolTimelock, protocolGovernor, treasuryGovernor);
}

function setupZRXWrappedToken() internal returns (IERC20, ZRXWrappedToken, ZeroExVotes) {
Expand Down

0 comments on commit 602fb8c

Please sign in to comment.