-
Notifications
You must be signed in to change notification settings - Fork 112
Create Pool booster central registry and Merkl pool booster on Mainnet #2676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,95 @@ | ||
| const addresses = require("../../utils/addresses"); | ||
| const { deploymentWithGovernanceProposal } = require("../../utils/deploy"); | ||
|
|
||
| module.exports = deploymentWithGovernanceProposal( | ||
| { | ||
| deployName: "152_pool_booster_setup", | ||
| forceDeploy: false, | ||
| reduceQueueTime: true, | ||
| deployerIsProposer: false, | ||
| proposalId: "", | ||
| }, | ||
| async ({ deployWithConfirmation, withConfirmation }) => { | ||
| const { deployerAddr } = await getNamedAccounts(); | ||
| const sDeployer = await ethers.provider.getSigner(deployerAddr); | ||
|
|
||
| const oethProxy = await ethers.getContract("OETHProxy"); | ||
| const oeth = await ethers.getContractAt("OETH", oethProxy.address); | ||
|
|
||
| // --------------------------------------------------------------------------------------------------------- | ||
| // --- | ||
| // --- Deploy PoolBoostCentralRegistry | ||
| // --- | ||
| // --------------------------------------------------------------------------------------------------------- | ||
|
|
||
| await deployWithConfirmation("PoolBoostCentralRegistryProxy"); | ||
| const cPoolBoostCentralRegistryProxy = await ethers.getContract( | ||
| "PoolBoostCentralRegistryProxy" | ||
| ); | ||
|
|
||
| console.log( | ||
| `Pool boost central registry proxy deployed: ${cPoolBoostCentralRegistryProxy.address}` | ||
| ); | ||
|
|
||
| const dPoolBoostCentralRegistry = await deployWithConfirmation( | ||
| "PoolBoostCentralRegistry", | ||
| [] | ||
| ); | ||
| console.log( | ||
| `Deployed Pool Boost Central Registry to ${dPoolBoostCentralRegistry.address}` | ||
| ); | ||
|
|
||
| const cPoolBoostCentralRegistry = await ethers.getContractAt( | ||
| "PoolBoostCentralRegistry", | ||
| cPoolBoostCentralRegistryProxy.address | ||
| ); | ||
|
|
||
| // prettier-ignore | ||
| await withConfirmation( | ||
| cPoolBoostCentralRegistryProxy | ||
| .connect(sDeployer)["initialize(address,address,bytes)"]( | ||
| dPoolBoostCentralRegistry.address, | ||
| addresses.mainnet.Timelock, | ||
| "0x" | ||
| ) | ||
| ); | ||
| console.log( | ||
| "Initialized PoolBoostCentralRegistry proxy and implementation" | ||
| ); | ||
|
|
||
| // --------------------------------------------------------------------------------------------------------- | ||
| // --- | ||
| // --- Deploy PoolBoosterFactoryMerkl | ||
| // --- | ||
| // --------------------------------------------------------------------------------------------------------- | ||
| const dPoolBoosterFactoryMerkl = await deployWithConfirmation( | ||
| "PoolBoosterFactoryMerkl", | ||
| [ | ||
| oeth.address, | ||
| // so we can create a Merkl pool booster fast via a multichain strategist and kick off yield forwarding | ||
| addresses.multichainStrategist, | ||
| cPoolBoostCentralRegistryProxy.address, | ||
| addresses.mainnet.CampaignCreator, | ||
| ] | ||
| ); | ||
| const cPoolBoosterMerklFactory = await ethers.getContract( | ||
| "PoolBoosterFactoryMerkl" | ||
| ); | ||
|
|
||
| console.log( | ||
| `Pool Booster Merkl Factory deployed to ${cPoolBoosterMerklFactory.address}` | ||
| ); | ||
|
|
||
| return { | ||
| name: "Upgrade PoolBoosterCentralRegistry and deploy PoolBoosterFactoryMerkl", | ||
| actions: [ | ||
| { | ||
| // set the factory as an approved one | ||
| contract: cPoolBoostCentralRegistry, | ||
| signature: "approveFactory(address)", | ||
| args: [dPoolBoosterFactoryMerkl.address], | ||
| }, | ||
| ], | ||
| }; | ||
| } | ||
| ); | ||
This file contains hidden or 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
49 changes: 49 additions & 0 deletions
49
contracts/test/poolBooster/poolBooster.mainnet.fork-test.js
This file contains hidden or 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,49 @@ | ||
| const { createFixtureLoader, defaultFixture } = require("../_fixture"); | ||
| const { expect } = require("chai"); | ||
| const { oethUnits } = require("../helpers"); | ||
| const addresses = require("../../utils/addresses"); | ||
|
|
||
| const sonicFixture = createFixtureLoader(defaultFixture); | ||
|
|
||
| describe("ForkTest: Merkl Pool Booster", function () { | ||
| //const INCENTIVISE_BORROWING_TYPE = 45; | ||
| //const DEFAULT_DURATION = 86400 * 7; // a week | ||
| //const MOPRHO_CAMPAIGN_DATA = "0xb8fef900b383db2dbbf4458c7f46acf5b140f26d603a6d1829963f241b82510e00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; | ||
|
|
||
| let fixture, poolBoosterMerklFactory, merklDistributor, oeth; | ||
| beforeEach(async () => { | ||
| fixture = await sonicFixture(); | ||
| oeth = fixture.oeth; | ||
| poolBoosterMerklFactory = fixture.poolBoosterMerklFactory; | ||
| merklDistributor = fixture.merklDistributor; | ||
| }); | ||
|
|
||
| it("Should have correct deployment params", async () => { | ||
| expect(await poolBoosterMerklFactory.merklDistributor()).to.equal( | ||
| addresses.mainnet.CampaignCreator | ||
| ); | ||
|
|
||
| // Uncomment once the pool booster is deployed | ||
| // const poolBooster = await poolBoosterMerklFactory.poolBoosters(0) | ||
| // expect(await poolBooster.campaignType()).to.equal( | ||
| // INCENTIVISE_BORROWING_TYPE | ||
| // ); | ||
|
|
||
| // expect(await poolBooster.duration()).to.equal( | ||
| // DEFAULT_DURATION | ||
| // ); | ||
|
|
||
| // expect(await poolBooster.campaignData()).to.equal( | ||
| // MOPRHO_CAMPAIGN_DATA | ||
| // ); | ||
|
|
||
| // expect(await poolBooster.rewardToken()).to.equal(oeth.address); | ||
| // expect(await poolBooster.merklDistributor()).to.equal(merklDistributor.address); | ||
| }); | ||
|
|
||
| it("Should have OETH token supported by Merkl Distributor", async () => { | ||
| expect(await merklDistributor.rewardTokenMinAmounts(oeth.address)).to.equal( | ||
| oethUnits("0.00001") | ||
| ); | ||
| }); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should start the strategist as governor and change it later, when we are ready
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only to approve and remove factories. Is there any benefit to going initially with the strategist?