|
| 1 | +const addresses = require("../../utils/addresses"); |
| 2 | +const { deploymentWithGovernanceProposal } = require("../../utils/deploy"); |
| 3 | + |
| 4 | +module.exports = deploymentWithGovernanceProposal( |
| 5 | + { |
| 6 | + deployName: "152_pool_booster_setup", |
| 7 | + forceDeploy: false, |
| 8 | + reduceQueueTime: true, |
| 9 | + deployerIsProposer: false, |
| 10 | + proposalId: "", |
| 11 | + }, |
| 12 | + async ({ deployWithConfirmation, withConfirmation }) => { |
| 13 | + const { deployerAddr } = await getNamedAccounts(); |
| 14 | + const sDeployer = await ethers.provider.getSigner(deployerAddr); |
| 15 | + |
| 16 | + const oethProxy = await ethers.getContract("OETHProxy"); |
| 17 | + const oeth = await ethers.getContractAt("OETH", oethProxy.address); |
| 18 | + |
| 19 | + // --------------------------------------------------------------------------------------------------------- |
| 20 | + // --- |
| 21 | + // --- Deploy PoolBoostCentralRegistry |
| 22 | + // --- |
| 23 | + // --------------------------------------------------------------------------------------------------------- |
| 24 | + |
| 25 | + await deployWithConfirmation("PoolBoostCentralRegistryProxy"); |
| 26 | + const cPoolBoostCentralRegistryProxy = await ethers.getContract( |
| 27 | + "PoolBoostCentralRegistryProxy" |
| 28 | + ); |
| 29 | + |
| 30 | + console.log( |
| 31 | + `Pool boost central registry proxy deployed: ${cPoolBoostCentralRegistryProxy.address}` |
| 32 | + ); |
| 33 | + |
| 34 | + const dPoolBoostCentralRegistry = await deployWithConfirmation( |
| 35 | + "PoolBoostCentralRegistry", |
| 36 | + [] |
| 37 | + ); |
| 38 | + console.log( |
| 39 | + `Deployed Pool Boost Central Registry to ${dPoolBoostCentralRegistry.address}` |
| 40 | + ); |
| 41 | + |
| 42 | + const cPoolBoostCentralRegistry = await ethers.getContractAt( |
| 43 | + "PoolBoostCentralRegistry", |
| 44 | + cPoolBoostCentralRegistryProxy.address |
| 45 | + ); |
| 46 | + |
| 47 | + // prettier-ignore |
| 48 | + await withConfirmation( |
| 49 | + cPoolBoostCentralRegistryProxy |
| 50 | + .connect(sDeployer)["initialize(address,address,bytes)"]( |
| 51 | + dPoolBoostCentralRegistry.address, |
| 52 | + addresses.mainnet.Timelock, |
| 53 | + "0x" |
| 54 | + ) |
| 55 | + ); |
| 56 | + console.log( |
| 57 | + "Initialized PoolBoostCentralRegistry proxy and implementation" |
| 58 | + ); |
| 59 | + |
| 60 | + // --------------------------------------------------------------------------------------------------------- |
| 61 | + // --- |
| 62 | + // --- Deploy PoolBoosterFactoryMerkl |
| 63 | + // --- |
| 64 | + // --------------------------------------------------------------------------------------------------------- |
| 65 | + const dPoolBoosterFactoryMerkl = await deployWithConfirmation( |
| 66 | + "PoolBoosterFactoryMerkl", |
| 67 | + [ |
| 68 | + oeth.address, |
| 69 | + // so we can create a Merkl pool booster fast via a multichain strategist and kick off yield forwarding |
| 70 | + addresses.multichainStrategist, |
| 71 | + cPoolBoostCentralRegistryProxy.address, |
| 72 | + addresses.mainnet.CampaignCreator, |
| 73 | + ] |
| 74 | + ); |
| 75 | + const cPoolBoosterMerklFactory = await ethers.getContract( |
| 76 | + "PoolBoosterFactoryMerkl" |
| 77 | + ); |
| 78 | + |
| 79 | + console.log( |
| 80 | + `Pool Booster Merkl Factory deployed to ${cPoolBoosterMerklFactory.address}` |
| 81 | + ); |
| 82 | + |
| 83 | + return { |
| 84 | + name: "Upgrade PoolBoosterCentralRegistry and deploy PoolBoosterFactoryMerkl", |
| 85 | + actions: [ |
| 86 | + { |
| 87 | + // set the factory as an approved one |
| 88 | + contract: cPoolBoostCentralRegistry, |
| 89 | + signature: "approveFactory(address)", |
| 90 | + args: [dPoolBoosterFactoryMerkl.address], |
| 91 | + }, |
| 92 | + ], |
| 93 | + }; |
| 94 | + } |
| 95 | +); |
0 commit comments