-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add deployment script for Timelock governance (#2212)
* Add deployment script for Timelock governance * Add test * Fix base tests * Prettify * Lint * Fix mainnet tests
- Loading branch information
1 parent
99ca92c
commit 9bbe3f9
Showing
15 changed files
with
332 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
const { deployOnBaseWithGuardian } = require("../../utils/deploy-l2"); | ||
const addresses = require("../../utils/addresses"); | ||
|
||
const ADMIN_ROLE = | ||
"0x0000000000000000000000000000000000000000000000000000000000000000"; | ||
|
||
module.exports = deployOnBaseWithGuardian( | ||
{ | ||
deployName: "011_transfer_governance", | ||
}, | ||
async ({ ethers }) => { | ||
const cBridgedWOETHProxy = await ethers.getContract( | ||
"BridgedBaseWOETHProxy" | ||
); | ||
const cBridgedWOETH = await ethers.getContractAt( | ||
"BridgedWOETH", | ||
cBridgedWOETHProxy.address | ||
); | ||
|
||
const cOETHbVaultProxy = await ethers.getContract("OETHBaseVaultProxy"); | ||
const cOETHbProxy = await ethers.getContract("OETHBaseProxy"); | ||
const cWOETHbProxy = await ethers.getContract("WOETHBaseProxy"); | ||
|
||
const cDripperProxy = await ethers.getContract("OETHBaseDripperProxy"); | ||
|
||
const cAMOStrategyProxy = await ethers.getContract( | ||
"AerodromeAMOStrategyProxy" | ||
); | ||
const cWOETHStrategyProxy = await ethers.getContract( | ||
"BridgedWOETHStrategyProxy" | ||
); | ||
|
||
return { | ||
actions: [ | ||
{ | ||
// 1. Grant admin role to Timelock on Bridged wOETH | ||
// TODO: Revoke role later when everything works fine | ||
contract: cBridgedWOETH, | ||
signature: "grantRole(bytes32,address)", | ||
args: [ADMIN_ROLE, addresses.base.timelock], | ||
}, | ||
{ | ||
// 2. Bridged wOETH proxy | ||
contract: cBridgedWOETHProxy, | ||
signature: "transferGovernance(address)", | ||
args: [addresses.base.timelock], | ||
}, | ||
{ | ||
// 3. Vault proxy | ||
contract: cOETHbVaultProxy, | ||
signature: "transferGovernance(address)", | ||
args: [addresses.base.timelock], | ||
}, | ||
{ | ||
// 4. OETHb proxy | ||
contract: cOETHbProxy, | ||
signature: "transferGovernance(address)", | ||
args: [addresses.base.timelock], | ||
}, | ||
{ | ||
// 5. WOETHb proxy | ||
contract: cWOETHbProxy, | ||
signature: "transferGovernance(address)", | ||
args: [addresses.base.timelock], | ||
}, | ||
{ | ||
// 6. Dripper proxy | ||
contract: cDripperProxy, | ||
signature: "transferGovernance(address)", | ||
args: [addresses.base.timelock], | ||
}, | ||
{ | ||
// 7. AMO Strategy proxy | ||
contract: cAMOStrategyProxy, | ||
signature: "transferGovernance(address)", | ||
args: [addresses.base.timelock], | ||
}, | ||
{ | ||
// 8. Bridged WOETH Strategy Proxy | ||
contract: cWOETHStrategyProxy, | ||
signature: "transferGovernance(address)", | ||
args: [addresses.base.timelock], | ||
}, | ||
], | ||
}; | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
const { deployOnBaseWithGuardian } = require("../../utils/deploy-l2"); | ||
|
||
module.exports = deployOnBaseWithGuardian( | ||
{ | ||
deployName: "012_claim_governance", | ||
useTimelock: true, | ||
}, | ||
async ({ ethers }) => { | ||
const cBridgedWOETHProxy = await ethers.getContract( | ||
"BridgedBaseWOETHProxy" | ||
); | ||
|
||
const cOETHbVaultProxy = await ethers.getContract("OETHBaseVaultProxy"); | ||
const cOETHbProxy = await ethers.getContract("OETHBaseProxy"); | ||
const cWOETHbProxy = await ethers.getContract("WOETHBaseProxy"); | ||
|
||
const cDripperProxy = await ethers.getContract("OETHBaseDripperProxy"); | ||
|
||
const cAMOStrategyProxy = await ethers.getContract( | ||
"AerodromeAMOStrategyProxy" | ||
); | ||
const cWOETHStrategyProxy = await ethers.getContract( | ||
"BridgedWOETHStrategyProxy" | ||
); | ||
|
||
return { | ||
name: "Claim Governance on superOETHb contracts", | ||
actions: [ | ||
{ | ||
// 1. Bridged wOETH proxy | ||
contract: cBridgedWOETHProxy, | ||
signature: "claimGovernance()", | ||
args: [], | ||
}, | ||
{ | ||
// 2. Vault proxy | ||
contract: cOETHbVaultProxy, | ||
signature: "claimGovernance()", | ||
args: [], | ||
}, | ||
{ | ||
// 3. OETHb proxy | ||
contract: cOETHbProxy, | ||
signature: "claimGovernance()", | ||
args: [], | ||
}, | ||
{ | ||
// 4. WOETHb proxy | ||
contract: cWOETHbProxy, | ||
signature: "claimGovernance()", | ||
args: [], | ||
}, | ||
{ | ||
// 5. Dripper proxy | ||
contract: cDripperProxy, | ||
signature: "claimGovernance()", | ||
args: [], | ||
}, | ||
{ | ||
// 6. AMO Strategy proxy | ||
contract: cAMOStrategyProxy, | ||
signature: "claimGovernance()", | ||
args: [], | ||
}, | ||
{ | ||
// 7. Bridged WOETH Strategy Proxy | ||
contract: cWOETHStrategyProxy, | ||
signature: "claimGovernance()", | ||
args: [], | ||
}, | ||
], | ||
}; | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
contracts/test/governance/oethb-timelock.base.fork-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
const { createFixtureLoader } = require("../_fixture"); | ||
const { defaultBaseFixture } = require("../_fixture-base"); | ||
const { expect } = require("chai"); | ||
const addresses = require("../../utils/addresses"); | ||
const { advanceTime, advanceBlocks } = require("../helpers"); | ||
|
||
const baseFixture = createFixtureLoader(defaultBaseFixture); | ||
|
||
describe("ForkTest: OETHb Timelock", function () { | ||
let fixture; | ||
beforeEach(async () => { | ||
fixture = await baseFixture(); | ||
}); | ||
|
||
it("Multisig can propose and execute on Timelock", async () => { | ||
const { guardian, timelock, oethbVault } = fixture; | ||
|
||
const calldata = oethbVault.interface.encodeFunctionData( | ||
"setDripper(address)", | ||
[addresses.dead] | ||
); | ||
|
||
const args = [ | ||
[oethbVault.address], // Targets | ||
[0], // Values | ||
[calldata], // Calldata, | ||
"0x0000000000000000000000000000000000000000000000000000000000000000", // Predecessor | ||
"0x0000000000000000000000000000000000000000000000000000000000000001", // Salt | ||
]; | ||
|
||
const minDelay = await timelock.getMinDelay(); | ||
|
||
await timelock.connect(guardian).scheduleBatch( | ||
...args, | ||
minDelay // minDelay | ||
); | ||
|
||
// Wait for timelock | ||
await advanceTime(minDelay.toNumber() + 10); | ||
await advanceBlocks(2); | ||
|
||
await timelock.connect(guardian).executeBatch(...args); | ||
|
||
expect(await oethbVault.dripper()).to.eq(addresses.dead); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.