-
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.
Fix bug in convex yield collection (#842)
* Collect convex yield. * Use CRV as the official reward token * Unit tests test harvesting coins * Remove debugging * Better comment * More comment tweaks
- Loading branch information
Showing
9 changed files
with
153 additions
and
61 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
const { deploymentWithProposal } = require("../utils/deploy"); | ||
|
||
module.exports = deploymentWithProposal( | ||
{ deployName: "032_convex_rewards", forceDeploy: true }, | ||
async ({ | ||
assetAddresses, | ||
deployWithConfirmation, | ||
ethers, | ||
getTxOpts, | ||
withConfirmation, | ||
}) => { | ||
const { deployerAddr, governorAddr } = await getNamedAccounts(); | ||
const sDeployer = await ethers.provider.getSigner(deployerAddr); | ||
|
||
// Current contracts | ||
const cVaultProxy = await ethers.getContract("VaultProxy"); | ||
const cVaultAdmin = await ethers.getContractAt( | ||
"VaultAdmin", | ||
cVaultProxy.address | ||
); | ||
|
||
// Deployer Actions | ||
// ---------------- | ||
|
||
// 1. Deploy new implementation | ||
const dConvexStrategyImpl = await deployWithConfirmation( | ||
"ConvexStrategy", | ||
undefined, | ||
undefined, | ||
true // Disable storage slot checking. We are intentionaly renaming a slot. | ||
); | ||
const cConvexStrategyProxy = await ethers.getContract( | ||
"ConvexStrategyProxy" | ||
); | ||
console.log(cConvexStrategyProxy.address); | ||
const cConvexStrategy = await ethers.getContractAt( | ||
"ConvexStrategy", | ||
cConvexStrategyProxy.address | ||
); | ||
console.log("ConvexStrategyProxy ", await cConvexStrategyProxy.governor()); | ||
|
||
// Governance Actions | ||
// ---------------- | ||
return { | ||
name: "Switch to new Convex implementation", | ||
actions: [ | ||
// 1. Upgrade implementation | ||
{ | ||
contract: cConvexStrategyProxy, | ||
signature: "upgradeTo(address)", | ||
args: [dConvexStrategyImpl.address], | ||
}, | ||
// 2. Use CRV as main rewards token | ||
{ | ||
contract: cConvexStrategy, | ||
signature: "setRewardTokenAddress(address)", | ||
args: [assetAddresses.CRV], | ||
}, | ||
// 2. Use correct CVX token addresss | ||
{ | ||
contract: cConvexStrategy, | ||
signature: "setCvxRewardTokenAddress(address)", | ||
args: [assetAddresses.CVX], | ||
}, | ||
], | ||
}; | ||
} | ||
); |
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