-
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.
* OGN Buyback * Fix unit test deployment * Move deployment file * Make tests less flaky
- Loading branch information
1 parent
a7457ec
commit bbbd918
Showing
5 changed files
with
184 additions
and
104 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
const { isFork } = require("../../test/helpers"); | ||
const addresses = require("../../utils/addresses"); | ||
const { | ||
deploymentWithGovernanceProposal, | ||
deployWithConfirmation, | ||
} = require("../../utils/deploy"); | ||
|
||
module.exports = deploymentWithGovernanceProposal( | ||
{ | ||
deployName: "095_ogn_buyback", | ||
// forceSkip: true, | ||
// onlyOnFork: true, // this is only executed in forked environment | ||
reduceQueueTime: true, // just to solve the issue of later active proposals failing | ||
proposalId: "", | ||
}, | ||
async ({ ethers }) => { | ||
const cOETHBuybackProxy = await ethers.getContract("OETHBuybackProxy"); | ||
const cOUSDBuybackProxy = await ethers.getContract("BuybackProxy"); | ||
|
||
const cSwapper = await ethers.getContract("Swapper1InchV5"); | ||
|
||
// Deploy new OETHBuyback implementation | ||
const dOETHBuybackImpl = await deployWithConfirmation( | ||
"OETHBuyback", | ||
[ | ||
addresses.mainnet.OETHProxy, | ||
addresses.mainnet.OGN, | ||
addresses.mainnet.CVX, | ||
addresses.mainnet.CVXLocker, | ||
], | ||
undefined, | ||
true | ||
); | ||
|
||
// Deploy new OUSDBuyback implementation | ||
const dOUSDBuybackImpl = await deployWithConfirmation( | ||
"OUSDBuyback", | ||
[ | ||
addresses.mainnet.OUSDProxy, | ||
addresses.mainnet.OGN, | ||
addresses.mainnet.CVX, | ||
addresses.mainnet.CVXLocker, | ||
], | ||
undefined, | ||
true | ||
); | ||
|
||
await cSwapper.approveAssets([addresses.mainnet.OGN]); | ||
|
||
if (!isFork) { | ||
// No Governance action on mainnet | ||
// To be upgraded with the proposal from `ousd-governance` repo | ||
return { | ||
actions: [], | ||
}; | ||
} | ||
|
||
return { | ||
name: "Upgrade contracts for OGN Buyback", | ||
actions: [ | ||
// 1. Upgrade OUSD Buyback to new implementation | ||
{ | ||
contract: cOUSDBuybackProxy, | ||
signature: "upgradeTo(address)", | ||
args: [dOUSDBuybackImpl.address], | ||
}, | ||
// 2. Upgrade OETH Buyback to new implementation | ||
{ | ||
contract: cOETHBuybackProxy, | ||
signature: "upgradeTo(address)", | ||
args: [dOETHBuybackImpl.address], | ||
}, | ||
], | ||
}; | ||
} | ||
); |
Oops, something went wrong.