Skip to content

Commit

Permalink
fix(framework): use correct timelock address for each proposal type
Browse files Browse the repository at this point in the history
  • Loading branch information
kkirka committed Aug 19, 2024
1 parent 02e3a28 commit c6b4ea0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/networkAddresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export const NETWORK_ADDRESSES = {
DEFAULT_PROPOSER_ADDRESS: "0x97a32D4506F6A35De68e0680859cDF41D077a9a9",
GOVERNOR_PROXY: govBscmainnetContracts.addresses.GovernorBravoDelegator,
NORMAL_TIMELOCK: govBscmainnetContracts.addresses.NormalTimelock,
GUARDIAN: "0x1C2CAc6ec528c20800B2fe734820D87b581eAA6B ",
FAST_TRACK_TIMELOCK: govBscmainnetContracts.addresses.FastTrackTimelock,
CRITICAL_TIMELOCK: govBscmainnetContracts.addresses.CriticalTimelock,
GUARDIAN: "0x1C2CAc6ec528c20800B2fe734820D87b581eAA6B",
ETH_CHAINLINK_FEED: "0x9ef1B8c0E4F7dc8bF5719Ea496883DC6401d5b2e",
USDT_CHAINLINK_FEED: "0xB97Ad0E74fa7d920791E90258A6E2085088b4320",
CHAINLINK_ORACLE: oracleBscmainnetContracts.addresses.ChainlinkOracle,
Expand All @@ -49,6 +51,8 @@ export const NETWORK_ADDRESSES = {
GUARDIAN: "0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706",
GOVERNOR_PROXY: govBsctestnetContracts.addresses.GovernorBravoDelegator,
NORMAL_TIMELOCK: govBsctestnetContracts.addresses.NormalTimelock,
FAST_TRACK_TIMELOCK: govBsctestnetContracts.addresses.FastTrackTimelock,
CRITICAL_TIMELOCK: govBsctestnetContracts.addresses.CriticalTimelock,
ETH_CHAINLINK_FEED: "0x143db3CEEfbdfe5631aDD3E50f7614B6ba708BA7",
USDT_CHAINLINK_FEED: "0xEca2605f0BCF2BA5966372C99837b1F182d3D620",
CHAINLINK_ORACLE: oracleBsctestnetContracts.addresses.ChainlinkOracle,
Expand Down
17 changes: 14 additions & 3 deletions src/vip-framework/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,14 @@ const OMNICHAIN_GOVERNANCE_EXECUTOR =

const VOTING_PERIOD = 28800;

export const { DEFAULT_PROPOSER_ADDRESS, GOVERNOR_PROXY, NORMAL_TIMELOCK, GUARDIAN } =
NETWORK_ADDRESSES[(FORKED_NETWORK as "bscmainnet") || "bsctestnet"] || {};
export const {
DEFAULT_PROPOSER_ADDRESS,
GOVERNOR_PROXY,
NORMAL_TIMELOCK,
FAST_TRACK_TIMELOCK,
CRITICAL_TIMELOCK,
GUARDIAN,
} = NETWORK_ADDRESSES[(FORKED_NETWORK as "bscmainnet") || "bsctestnet"] || {};
export const { DELAY_BLOCKS } = NETWORK_CONFIG[FORKED_NETWORK as SUPPORTED_NETWORKS];

export const forking = (blockNumber: number, fn: () => Promise<void>) => {
Expand Down Expand Up @@ -105,9 +111,14 @@ export const testVip = (description: string, proposal: Proposal, options: Testin
const governanceFixture = async (): Promise<void> => {
const proposerAddress = options.proposer ?? DEFAULT_PROPOSER_ADDRESS;
const supporterAddress = options.supporter ?? DEFAULT_SUPPORTER_ADDRESS;
const timelockAddress = {
[ProposalType.REGULAR]: NORMAL_TIMELOCK,
[ProposalType.FAST_TRACK]: FAST_TRACK_TIMELOCK,
[ProposalType.CRITICAL]: CRITICAL_TIMELOCK,
}[proposal.type || ProposalType.REGULAR];
proposer = await initMainnetUser(proposerAddress, ethers.utils.parseEther("1.0"));
supporter = await initMainnetUser(supporterAddress, ethers.utils.parseEther("1.0"));
impersonatedTimelock = await initMainnetUser(NORMAL_TIMELOCK, ethers.utils.parseEther("40"));
impersonatedTimelock = await initMainnetUser(timelockAddress, ethers.utils.parseEther("40"));

// Iniitalize impl via Proxy
governorProxy = await ethers.getContractAt(
Expand Down

0 comments on commit c6b4ea0

Please sign in to comment.