Skip to content

Commit

Permalink
fix: set timelock delays to time units
Browse files Browse the repository at this point in the history
  • Loading branch information
kkirka committed Jan 23, 2023
1 parent e13c0d7 commit 4a29128
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions contracts/Governance/Timelock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ contract Timelock {
);

uint public constant GRACE_PERIOD = 14 days;
uint public constant MINIMUM_DELAY = 800; // About 1 hour, 3 secs per block (20 * 60)
uint public constant MAXIMUM_DELAY = 28800; // About 24 hours, 3 secs per block (20 * 60 * 24)
uint public constant MINIMUM_DELAY = 1 hours;
uint public constant MAXIMUM_DELAY = 30 days;

address public admin;
address public pendingAdmin;
Expand Down
21 changes: 11 additions & 10 deletions script/hardhat/fork/govUpdateTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ import { Comptroller, GovernorBravoDelegate, IAccessControlManager } from "../..
import { TimelockInterface } from "../../../typechain/contracts/Governance/GovernorAlpha2.sol";
import { getCalldatas, setForkBlock } from "./utils";

const ONE_HOUR = 800; // About 1 hour, 3 secs per block (20 * 60)
const SIX_HOURS = 7200; // About 6 hours, 3 secs per block (20 * 60 * 6)
const ONE_DAY = 28800; // About 24 hours, 3 secs per block (20 * 60 * 24)
const ONE_HOUR_IN_BLOCKS = 800;
const SIX_HOURS_IN_BLOCKS = 6 * ONE_HOUR_IN_BLOCKS;
const ONE_DAY_IN_BLOCKS = 24 * ONE_HOUR_IN_BLOCKS;
const ONE_HOUR_IN_SECONDS = 3600;
const SIX_HOURS_IN_SECONDS = 6 * ONE_HOUR_IN_SECONDS;

const ACL_MAINNET = "0x4788629ABc6cFCA10F9f969efdEAa1cF70c23555";
const COMPTROLLER_PROXY_MAINNET = "0xfD36E2c2a6789Db23113685031d7F16329158384";
const XVS_VAULT_MAINNET = "0x051100480289e704d20e9db4804837068f3f9204";
const NORMAL_VIP_TIMELOCK = "0x939bD8d64c0A9583A7Dcea9933f7b21697ab6396";
Expand All @@ -21,27 +22,27 @@ const PROPOSAL_TYPE_CONFIGS = [
// ProposalType.NORMAL
{
votingDelay: 1,
votingPeriod: ONE_DAY,
votingPeriod: ONE_DAY_IN_BLOCKS,
proposalThreshold: parseUnits("300000", 18),
},
// ProposalType.FASTTRACK
{
votingDelay: 1,
votingPeriod: ONE_DAY,
votingPeriod: ONE_DAY_IN_BLOCKS,
proposalThreshold: parseUnits("300000", 18),
},
// ProposalType.CRITICAL
{
votingDelay: 1,
votingPeriod: SIX_HOURS,
votingPeriod: SIX_HOURS_IN_BLOCKS,
proposalThreshold: parseUnits("300000", 18),
},
];

const TIMELOCK_DELAYS_MAINNET = {
NORMAL: 172800,
FAST_TRACK: SIX_HOURS,
CRITICAL: ONE_HOUR,
FAST_TRACK: SIX_HOURS_IN_SECONDS,
CRITICAL: ONE_HOUR_IN_SECONDS,
};

const PROPOSAL_TYPES = {
Expand All @@ -66,7 +67,7 @@ const initMainnetUser = async (user: string, balance: number) => {
return ethers.getSigner(user);
};
const governanceFixture = async (): Promise<void> => {
//Mandatory when creating forked tests. One must specify form which block the fork should be
// Mandatory when creating forked tests. One must specify form which block the fork should be
await setForkBlock(22629546);
proposer = await initMainnetUser("0x55A9f5374Af30E3045FB491f1da3C2E8a74d168D", ethers.utils.parseEther("1.0"));
supporter = await initMainnetUser("0xc444949e0054a23c44fc45789738bdf64aed2391", ethers.utils.parseEther("1.0"));
Expand Down

0 comments on commit 4a29128

Please sign in to comment.