diff --git a/contracts/deploy/063_oeth_harvest_crv_limit.js b/contracts/deploy/063_oeth_harvest_crv_limit.js new file mode 100644 index 0000000000..1607af1f86 --- /dev/null +++ b/contracts/deploy/063_oeth_harvest_crv_limit.js @@ -0,0 +1,55 @@ +const { parseUnits, formatUnits } = require("ethers").utils; +const { deploymentWithProposal, log } = require("../utils/deploy"); + +/* The 059 harvest change proposal has timed out. This just re-submits it. + */ +module.exports = deploymentWithProposal( + { + deployName: "063_oeth_harvest_crv_limit", + forceDeploy: false, + }, + async ({ assetAddresses, ethers }) => { + // Current contracts + const cOETHHarvesterProxy = await ethers.getContract("OETHHarvesterProxy"); + const cOETHHarvester = await ethers.getContractAt( + "OETHHarvester", + cOETHHarvesterProxy.address + ); + + const oldCrvTokenConfig = await cOETHHarvester.rewardTokenConfigs( + assetAddresses.CRV + ); + log( + `Old CRV swap limit: ${formatUnits( + oldCrvTokenConfig.liquidationLimit, + 18 + )} CRV` + ); + + const crvSwapLimit = "4000"; + const newCrvSwapLimit = parseUnits(crvSwapLimit, 18); + log(`New CRV swap limit: ${crvSwapLimit} CRV`); + + // Governance Actions + // ---------------- + return { + name: "Update OETH Harvester config for CRV", + actions: [ + // 1. Update CRV config with new 4k CRV limit + { + contract: cOETHHarvester, + signature: + "setRewardTokenConfig(address,uint16,uint16,address,uint256,bool)", + args: [ + assetAddresses.CRV, + oldCrvTokenConfig.allowedSlippageBps, + 200, // harvestRewardBps - increased from 1% to 2% + oldCrvTokenConfig.uniswapV2CompatibleAddr, + newCrvSwapLimit, + oldCrvTokenConfig.doSwapRewardToken, + ], + }, + ], + }; + } +); diff --git a/contracts/deployments/mainnet/.migrations.json b/contracts/deployments/mainnet/.migrations.json index 120ae0ac8c..a00cbfb72c 100644 --- a/contracts/deployments/mainnet/.migrations.json +++ b/contracts/deployments/mainnet/.migrations.json @@ -53,5 +53,6 @@ "055_curve_amo": 1683966879, "056_harvest_crv_limit": 17287144, "061_oeth_timelock_part_1": 1685054965, - "062_oeth_timelock_part_2": 1685054965 + "062_oeth_timelock_part_2": 1685054965, + "063_oeth_harvest_crv_limit": 1685178827 } \ No newline at end of file diff --git a/contracts/test/_fixture.js b/contracts/test/_fixture.js index 2c8ff2a8da..fc6461013c 100644 --- a/contracts/test/_fixture.js +++ b/contracts/test/_fixture.js @@ -1069,8 +1069,8 @@ async function convexLUSDMetaVaultFixture() { */ async function convexOETHMetaVaultFixture() { const fixture = await loadFixture(defaultFixture); - const { guardianAddr } = await getNamedAccounts(); - const sGuardian = await ethers.provider.getSigner(guardianAddr); + const { governorAddr } = await getNamedAccounts(); + const sGovernor = await ethers.provider.getSigner(governorAddr); await impersonateAndFundAddress( fixture.weth.address, @@ -1100,7 +1100,7 @@ async function convexOETHMetaVaultFixture() { // Add Convex Meta strategy await fixture.oethVault - .connect(sGuardian) + .connect(sGovernor) .setAssetDefaultStrategy( fixture.weth.address, fixture.ConvexEthMetaStrategy.address