diff --git a/contracts/deploy/048_deposit_withdraw_tooling.js b/contracts/deploy/048_deposit_withdraw_tooling.js index 16fc73f04d..3e75458537 100644 --- a/contracts/deploy/048_deposit_withdraw_tooling.js +++ b/contracts/deploy/048_deposit_withdraw_tooling.js @@ -2,7 +2,7 @@ const { deploymentWithGovernanceProposal } = require("../utils/deploy"); const addresses = require("../utils/addresses"); const { isMainnet } = require("../test/helpers.js"); -module.exports = deploymentWithProposal( +module.exports = deploymentWithGovernanceProposal( { deployName: "048_deposit_withdraw_tooling", forceDeploy: false, diff --git a/contracts/test/_fixture.js b/contracts/test/_fixture.js index 30a75cbd73..a3b7136d73 100644 --- a/contracts/test/_fixture.js +++ b/contracts/test/_fixture.js @@ -33,7 +33,7 @@ async function defaultFixture() { keepExistingDeployments: Boolean(isForkWithLocalNode), }); - const { governorAddr } = await getNamedAccounts(); + const { governorAddr, timelockAddr } = await getNamedAccounts(); const ousdProxy = await ethers.getContract("OUSDProxy"); const vaultProxy = await ethers.getContract("VaultProxy"); @@ -315,11 +315,13 @@ async function defaultFixture() { let governor = signers[1]; const strategist = signers[0]; const adjuster = signers[0]; + let timelock; const [matt, josh, anna, domen, daniel, franck] = signers.slice(4); if (isFork) { governor = await impersonateAndFundContract(governorAddr); + timelock = await impersonateAndFundContract(timelockAddr); } await fundAccounts(); if (isFork) { @@ -351,6 +353,7 @@ async function defaultFixture() { domen, daniel, franck, + timelock, // Contracts ousd, vault, @@ -664,8 +667,8 @@ async function convexMetaVaultFixture() { async function morphoCompoundFixture() { const fixture = await loadFixture(defaultFixture); - const { governorAddr } = await getNamedAccounts(); - const sGovernor = await ethers.provider.getSigner(governorAddr); + const { timelockAddr } = await getNamedAccounts(); + const sGovernor = await ethers.provider.getSigner(timelockAddr); if (isFork) { await fixture.vault @@ -703,10 +706,12 @@ async function morphoCompoundFixture() { async function morphoAaveFixture() { const fixture = await loadFixture(defaultFixture); - const { governorAddr } = await getNamedAccounts(); - const sGovernor = await ethers.provider.getSigner(governorAddr); + const { governorAddr, timelockAddr } = await getNamedAccounts(); + let sGovernor = await ethers.provider.getSigner(governorAddr); if (isFork) { + sGovernor = await ethers.provider.getSigner(timelockAddr); + await fixture.vault .connect(sGovernor) .setAssetDefaultStrategy( @@ -751,8 +756,8 @@ async function convexGeneralizedMetaForkedFixture( ) { return async () => { const fixture = await loadFixture(defaultFixture); - const { governorAddr } = await getNamedAccounts(); - const sGovernor = await ethers.provider.getSigner(governorAddr); + const { timelockAddr } = await getNamedAccounts(); + const sGovernor = await ethers.provider.getSigner(timelockAddr); const { josh, matt, anna, domen, daniel, franck } = fixture; const threepoolLP = await ethers.getContractAt( diff --git a/contracts/test/_metastrategies-fixtures.js b/contracts/test/_metastrategies-fixtures.js index 615e9fbea6..e153698263 100644 --- a/contracts/test/_metastrategies-fixtures.js +++ b/contracts/test/_metastrategies-fixtures.js @@ -16,14 +16,14 @@ const erc20Abi = require("./abi/erc20.json"); async function withDefaultOUSDMetapoolStrategiesSet() { const fixture = await loadFixture(convexMetaVaultFixture); - const { vault, governor, usdt, usdc, OUSDmetaStrategy } = fixture; + const { vault, timelock, usdt, usdc, OUSDmetaStrategy } = fixture; await vault - .connect(governor) + .connect(timelock) .setAssetDefaultStrategy(usdt.address, OUSDmetaStrategy.address); await vault - .connect(governor) + .connect(timelock) .setAssetDefaultStrategy(usdc.address, OUSDmetaStrategy.address); return fixture; diff --git a/contracts/test/strategies/generalized-meta.fork-test.js b/contracts/test/strategies/generalized-meta.fork-test.js index 287b361d83..006015ab8d 100644 --- a/contracts/test/strategies/generalized-meta.fork-test.js +++ b/contracts/test/strategies/generalized-meta.fork-test.js @@ -172,8 +172,8 @@ metastrategies.forEach( this.skip(); return; } - const { governorAddr } = await getNamedAccounts(); - const sGovernor = await ethers.provider.getSigner(governorAddr); + const { timelockAddr } = await getNamedAccounts(); + const sGovernor = await ethers.provider.getSigner(timelockAddr); const { vault, usdt, anna } = fixture; @@ -236,8 +236,8 @@ metastrategies.forEach( this.skip(); return; } - const { governorAddr } = await getNamedAccounts(); - const sGovernor = await ethers.provider.getSigner(governorAddr); + const { timelockAddr } = await getNamedAccounts(); + const sGovernor = await ethers.provider.getSigner(timelockAddr); const { vault, usdt, anna } = fixture; diff --git a/contracts/test/vault/harvester.fork-test.js b/contracts/test/vault/harvester.fork-test.js index 629145964b..b8d217ea01 100644 --- a/contracts/test/vault/harvester.fork-test.js +++ b/contracts/test/vault/harvester.fork-test.js @@ -76,38 +76,38 @@ forkOnlyDescribe("ForkTest: Harvester", function () { describe("Harvest", () => { it("Should harvest from all strategies", async () => { - const { harvester, governor } = fixture; - await harvester.connect(governor)["harvest()"](); + const { harvester, timelock } = fixture; + await harvester.connect(timelock)["harvest()"](); }); it("Should swap all coins", async () => { - const { harvester, governor } = fixture; - await harvester.connect(governor).swap(); + const { harvester, timelock } = fixture; + await harvester.connect(timelock).swap(); }); it("Should harvest and swap from all strategies", async () => { - const { harvester, governor } = fixture; - await harvester.connect(governor)["harvestAndSwap()"](); + const { harvester, timelock } = fixture; + await harvester.connect(timelock)["harvestAndSwap()"](); }); it("Should swap CRV", async () => { - const { harvester, governor, crv } = fixture; - await harvester.connect(governor).swapRewardToken(crv.address); + const { harvester, timelock, crv } = fixture; + await harvester.connect(timelock).swapRewardToken(crv.address); }); it("Should swap CVX", async () => { - const { harvester, governor, cvx } = fixture; - await harvester.connect(governor).swapRewardToken(cvx.address); + const { harvester, timelock, cvx } = fixture; + await harvester.connect(timelock).swapRewardToken(cvx.address); }); it("Should swap COMP", async () => { - const { harvester, governor, comp } = fixture; - await harvester.connect(governor).swapRewardToken(comp.address); + const { harvester, timelock, comp } = fixture; + await harvester.connect(timelock).swapRewardToken(comp.address); }); it("Should swap AAVE", async () => { - const { harvester, governor, aave } = fixture; - await harvester.connect(governor).swapRewardToken(aave.address); + const { harvester, timelock, aave } = fixture; + await harvester.connect(timelock).swapRewardToken(aave.address); }); // TODO: Tests for `harvest(address)` for each strategy diff --git a/contracts/test/vault/vault.fork-test.js b/contracts/test/vault/vault.fork-test.js index e9ec7e4330..80dc6bdc6f 100644 --- a/contracts/test/vault/vault.fork-test.js +++ b/contracts/test/vault/vault.fork-test.js @@ -42,7 +42,7 @@ forkOnlyDescribe("ForkTest: Vault", function () { it("Should have the correct governor address set", async () => { const { vault } = fixture; expect(await vault.governor()).to.equal( - "0x72426BA137DEC62657306b12B1E869d43FeC6eC7" + "0x35918cDE7233F2dD33fA41ae3Cb6aE0e42E0e69F" ); }); @@ -355,8 +355,8 @@ forkOnlyDescribe("ForkTest: Vault", function () { }); it("Should be able to withdraw from all strategies", async () => { - const { vault, governor } = fixture; - await vault.connect(governor).withdrawAllFromStrategies(); + const { vault, timelock } = fixture; + await vault.connect(timelock).withdrawAllFromStrategies(); }); }); }); diff --git a/contracts/utils/deploy.js b/contracts/utils/deploy.js index 9b16910635..b5147c1978 100644 --- a/contracts/utils/deploy.js +++ b/contracts/utils/deploy.js @@ -53,7 +53,10 @@ const deployWithConfirmation = async ( ) => { // check that upgrade doesn't corrupt the storage slots if (!skipUpgradeSafety) { - await assertUpgradeIsSafe(hre, contractName); + await assertUpgradeIsSafe( + hre, + typeof contract == "string" ? contract : contractName + ); } const { deploy } = deployments; @@ -791,7 +794,7 @@ function deploymentWithProposal(opts, fn) { return; } - await sanityCheck(); + await sanityCheckOgvGovernance(); const proposal = await fn(tools); const propDescription = proposal.name; const propArgs = await proposeArgs(proposal.actions); diff --git a/contracts/utils/governor.js b/contracts/utils/governor.js index ab07160728..df2d47cfae 100644 --- a/contracts/utils/governor.js +++ b/contracts/utils/governor.js @@ -36,13 +36,13 @@ async function proposeArgs(governorArgsArray) { * @returns {Promise<*[]>} */ async function proposeGovernanceArgs(governorArgsArray) { - const args = await proposeArgs(governorArgsArray); + const [targets, sigs, calldata] = await proposeArgs(governorArgsArray); return [ - args[0], - Array(governorArgsArray).fill(BigNumber.from(0)), - args[1], - args[2], + targets, + Array(governorArgsArray.length).fill(BigNumber.from(0)), + sigs, + calldata, ]; } diff --git a/dapp/pages/_app.js b/dapp/pages/_app.js index 3a3e34390f..85c6989092 100644 --- a/dapp/pages/_app.js +++ b/dapp/pages/_app.js @@ -35,10 +35,7 @@ const queryClient = new QueryClient() function App({ Component, pageProps, err }) { const [locale, setLocale] = useState('en_US') - const { - account, - active, - } = useWeb3React() + const { account, active } = useWeb3React() const [cookies, setCookie, removeCookie] = useCookies(['loggedIn']) const router = useRouter() const tried = useEagerConnect()