Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple governance actions #2368

Merged
merged 7 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions contracts/contracts/interfaces/ITimelockController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,6 @@ interface ITimelockController {
function getMinDelay() external view returns (uint256);

function updateDelay(uint256 newDelay) external;

function CANCELLER_ROLE() external view returns (bytes32);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { getTxOpts } = require("../../utils/tx");

module.exports = deployOnArb(
{
deployName: "084_deploy_woeth_on_arb",
deployName: "001_deploy_woeth_on_arb",
},
async ({ ethers }) => {
const { deployerAddr } = await getNamedAccounts();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { impersonateAndFund } = require("../../utils/signers");

module.exports = deployOnArb(
{
deployName: "088_upgrade_woeth_on_arb",
deployName: "002_upgrade_woeth_on_arb",
},
async ({ ethers }) => {
const cWOETHProxy = await ethers.getContract("BridgedWOETHProxy");
Expand Down
27 changes: 27 additions & 0 deletions contracts/deploy/base/024_multisig_as_canceller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const { deployOnBaseWithGuardian } = require("../../utils/deploy-l2");
const addresses = require("../../utils/addresses");

module.exports = deployOnBaseWithGuardian(
{
deployName: "024_multisig_as_canceller",
},
async ({ ethers }) => {
const cTimelock = await ethers.getContractAt(
"ITimelockController",
addresses.base.timelock
);

const timelockCancellerRole = await cTimelock.CANCELLER_ROLE();

return {
name: "Grant canceller role to 5/8 Multisig",
actions: [
{
contract: cTimelock,
signature: "grantRole(bytes32,address)",
args: [timelockCancellerRole, addresses.base.governor],
},
],
};
}
);
37 changes: 37 additions & 0 deletions contracts/deploy/mainnet/119_multisig_as_canceller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const { deploymentWithGovernanceProposal } = require("../../utils/deploy");
const addresses = require("../../utils/addresses");

module.exports = deploymentWithGovernanceProposal(
{
deployName: "119_multisig_as_canceller",
forceDeploy: false,
//forceSkip: true,
reduceQueueTime: true,
deployerIsProposer: false,
proposalId:
"68528526132026080998168122859635399048147530736160306492805070199180314362200",
},
async () => {
const { timelockAddr } = await getNamedAccounts();

const cTimelock = await ethers.getContractAt(
"ITimelockController",
timelockAddr
);

const timelockCancellerRole = await cTimelock.CANCELLER_ROLE();

// Governance Actions
// ----------------
return {
name: "Grant canceller role to 5/8 Multisig",
actions: [
{
contract: cTimelock,
signature: "grantRole(bytes32,address)",
args: [timelockCancellerRole, addresses.mainnet.Guardian],
},
],
};
}
);
43 changes: 43 additions & 0 deletions contracts/deploy/mainnet/120_remove_ousd_amo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
const { deploymentWithGovernanceProposal } = require("../../utils/deploy");
const addresses = require("../../utils/addresses");

module.exports = deploymentWithGovernanceProposal(
{
deployName: "120_remove_ousd_amo",
forceDeploy: false,
//forceSkip: true,
reduceQueueTime: true,
deployerIsProposer: false,
proposalId:
"47377301530901645877668147419124102540503539821842750844128770769774878595548",
},
async () => {
const cOUSDVaultProxy = await ethers.getContract("VaultProxy");
const cOUSDVault = await ethers.getContractAt(
"IVault",
cOUSDVaultProxy.address
);

const cOUSDMetaStrategyProxy = await ethers.getContract(
"ConvexOUSDMetaStrategyProxy"
);

// Governance Actions
// ----------------
return {
name: "Remove OUSD AMO Strategy",
actions: [
{
contract: cOUSDVault,
signature: "removeStrategy(address)",
args: [cOUSDMetaStrategyProxy.address],
},
{
contract: cOUSDVault,
signature: "setOusdMetaStrategy(address)",
args: [addresses.zero],
},
],
};
}
);
27 changes: 27 additions & 0 deletions contracts/deploy/sonic/005_multisig_as_canceller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const { deployOnSonic } = require("../../utils/deploy-l2");
const addresses = require("../../utils/addresses");

module.exports = deployOnSonic(
{
deployName: "005_multisig_as_canceller",
},
async ({ ethers }) => {
const cTimelock = await ethers.getContractAt(
"ITimelockController",
addresses.sonic.timelock
);

const timelockCancellerRole = await cTimelock.CANCELLER_ROLE();

return {
actions: [
{
// 1. Grant canceller role to 5/8 Multisig
contract: cTimelock,
signature: "grantRole(bytes32,address)",
args: [timelockCancellerRole, addresses.sonic.admin],
},
],
};
}
);
4 changes: 2 additions & 2 deletions contracts/deployments/arbitrumOne/.migrations.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"084_deploy_woeth_on_arb": 1707820141,
"088_upgrade_woeth_on_arb": 1710959437
"001_deploy_woeth_on_arb": 1707820141,
"002_upgrade_woeth_on_arb": 1710959437
}
3 changes: 2 additions & 1 deletion contracts/deployments/base/.migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
"018_strategist_as_executor": 1729078818,
"019_async_withdrawals": 1730100488,
"020_upgrade_amo": 1730157451,
"021_multichain_strategist": 1736267102
"021_multichain_strategist": 1736267102,
"024_multisig_as_canceller": 1737993822
}
5 changes: 4 additions & 1 deletion contracts/deployments/mainnet/.migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,8 @@
"112_ousd_morpho_gauntlet_usdc": 1734483227,
"113_ousd_morpho_gauntlet_usdt": 1734560711,
"114_simple_harvester": 1736329331,
"117_oeth_fixed_rate_dripper": 1736875175
"117_oeth_fixed_rate_dripper": 1736875175,
"118_multichain_strategist": 1736875175,
"119_multisig_as_canceller": 1737991984,
"120_remove_ousd_amo": 1737992146
}
5 changes: 3 additions & 2 deletions contracts/deployments/sonic/.migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"001_vault_and_token": 1736867284,
"002_oracle_router": 1737018791,
"003_sonic_staking_strategy": 1737523080,
"004_timelock_1d_delay": 1737667104
}
"004_timelock_1d_delay": 1737667104,
"005_multisig_as_canceller": 1737993969
}
4 changes: 4 additions & 0 deletions contracts/hardhat.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const ethers = require("ethers");
const { task } = require("hardhat/config");
const {
isArbitrum,
isArbitrumFork,
isArbForkTest,
isHoleskyFork,
isHolesky,
isForkTest,
Expand Down Expand Up @@ -91,6 +93,8 @@ if (isHolesky || isHoleskyForkTest || isHoleskyFork) {
paths.deploy = "deploy/base";
} else if (isSonic || isSonicFork || isSonicForkTest || isSonicUnitTest) {
paths.deploy = "deploy/sonic";
} else if (isArbitrum || isArbitrumFork || isArbForkTest) {
paths.deploy = "deploy/arbitrumOne";
} else {
// holesky deployment files are in contracts/deploy/mainnet
paths.deploy = "deploy/mainnet";
Expand Down
5 changes: 1 addition & 4 deletions contracts/test/vault/vault.mainnet.fork-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ describe("ForkTest: Vault", function () {

it("Should have the correct OUSD MetaStrategy address set", async () => {
const { vault } = fixture;
expect(await vault.ousdMetaStrategy()).to.equal(
addresses.mainnet.ConvexOUSDAMOStrategy
);
expect(await vault.ousdMetaStrategy()).to.equal(addresses.zero);
});

it("Should have supported assets", async () => {
Expand Down Expand Up @@ -345,7 +343,6 @@ describe("ForkTest: Vault", function () {
const knownStrategies = [
// Update this every time a new strategy is added. Below are mainnet addresses
"0x5e3646A1Db86993f73E6b74A57D8640B69F7e259", // Aave
"0x89Eb88fEdc50FC77ae8a18aAD1cA0ac27f777a90", // OUSD MetaStrategy
"0x79F2188EF9350A1dC11A062cca0abE90684b0197", // MorphoAaveStrategy
"0x6b69B755C629590eD59618A2712d8a2957CA98FC", // Maker DSR Strategy
"0x603CDEAEC82A60E3C4A10dA6ab546459E5f64Fa0", // Meta Morpho USDC
Expand Down
2 changes: 2 additions & 0 deletions contracts/utils/hardhat-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const fetch = require("sync-fetch");
require("dotenv").config();

const isFork = process.env.FORK === "true";
const isArbitrum = process.env.NETWORK_NAME === "arbitrumOne";
const isArbitrumFork = process.env.FORK_NETWORK_NAME === "arbitrumOne";
const isHoleskyFork = process.env.FORK_NETWORK_NAME === "holesky";
const isHolesky = process.env.NETWORK_NAME === "holesky";
Expand Down Expand Up @@ -151,6 +152,7 @@ const networkMap = {

module.exports = {
isFork,
isArbitrum,
isArbitrumFork,
isBase,
isBaseFork,
Expand Down
Loading