Skip to content

Commit

Permalink
Update OETH harvester CRV config (#1546)
Browse files Browse the repository at this point in the history
* initial commit

* add the other gov proposal and add a fork test

* minor fix

* lint

* add migration data

* add migrations

* update oeth harvester CRV config to have 4000 max CRV per swap and caller gets 2% of proceeds
  • Loading branch information
sparrowDom authored May 29, 2023
1 parent 75ff573 commit e3123f0
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 4 deletions.
55 changes: 55 additions & 0 deletions contracts/deploy/063_oeth_harvest_crv_limit.js
Original file line number Diff line number Diff line change
@@ -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,
],
},
],
};
}
);
3 changes: 2 additions & 1 deletion contracts/deployments/mainnet/.migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
6 changes: 3 additions & 3 deletions contracts/test/_fixture.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e3123f0

Please sign in to comment.