|
| 1 | +const { deployOnBase } = require("../../utils/deploy-l2"); |
| 2 | +const addresses = require("../../utils/addresses"); |
| 3 | +const { |
| 4 | + deployWithConfirmation, |
| 5 | + withConfirmation, |
| 6 | +} = require("../../utils/deploy.js"); |
| 7 | + |
| 8 | +module.exports = deployOnBase( |
| 9 | + { |
| 10 | + deployName: "039_pool_booster_factory", |
| 11 | + }, |
| 12 | + async ({ ethers }) => { |
| 13 | + const { deployerAddr } = await getNamedAccounts(); |
| 14 | + const sDeployer = await ethers.provider.getSigner(deployerAddr); |
| 15 | + |
| 16 | + // 1. Fetch contracts |
| 17 | + const cOETHbProxy = await ethers.getContract("OETHBaseProxy"); |
| 18 | + |
| 19 | + // 2. Deploy PoolBooster Central Registry (proxy + implementation) |
| 20 | + await deployWithConfirmation("PoolBoostCentralRegistryProxy", []); |
| 21 | + const cPoolBoostCentralRegistryProxy = await ethers.getContract( |
| 22 | + "PoolBoostCentralRegistryProxy" |
| 23 | + ); |
| 24 | + console.log( |
| 25 | + `Pool boost central registry proxy deployed: ${cPoolBoostCentralRegistryProxy.address}` |
| 26 | + ); |
| 27 | + |
| 28 | + const dPoolBoostCentralRegistry = await deployWithConfirmation( |
| 29 | + "PoolBoostCentralRegistry", |
| 30 | + [] |
| 31 | + ); |
| 32 | + console.log( |
| 33 | + `Deployed Pool Boost Central Registry to ${dPoolBoostCentralRegistry.address}` |
| 34 | + ); |
| 35 | + const cPoolBoostCentralRegistry = await ethers.getContractAt( |
| 36 | + "PoolBoostCentralRegistry", |
| 37 | + cPoolBoostCentralRegistryProxy.address |
| 38 | + ); |
| 39 | + |
| 40 | + // prettier-ignore |
| 41 | + await withConfirmation( |
| 42 | + cPoolBoostCentralRegistryProxy |
| 43 | + .connect(sDeployer)["initialize(address,address,bytes)"]( |
| 44 | + dPoolBoostCentralRegistry.address, |
| 45 | + addresses.base.timelock, |
| 46 | + "0x" |
| 47 | + ) |
| 48 | + ); |
| 49 | + console.log( |
| 50 | + "Initialized PoolBoostCentralRegistry proxy and implementation" |
| 51 | + ); |
| 52 | + |
| 53 | + // 3. Deploy PoolBoosterFactory for Merkl |
| 54 | + const dPoolBoosterFactory = await deployWithConfirmation( |
| 55 | + "PoolBoosterFactoryMerkl_v1", |
| 56 | + [ |
| 57 | + cOETHbProxy.address, |
| 58 | + addresses.base.multichainStrategist, |
| 59 | + cPoolBoostCentralRegistryProxy.address, |
| 60 | + addresses.base.MerklDistributor, |
| 61 | + ], |
| 62 | + "PoolBoosterFactoryMerkl" |
| 63 | + ); |
| 64 | + console.log( |
| 65 | + `Pool Booster Merkl Factory deployed to ${dPoolBoosterFactory.address}` |
| 66 | + ); |
| 67 | + |
| 68 | + return { |
| 69 | + actions: [ |
| 70 | + { |
| 71 | + // set the factory as an approved one |
| 72 | + contract: cPoolBoostCentralRegistry, |
| 73 | + signature: "approveFactory(address)", |
| 74 | + args: [dPoolBoosterFactory.address], |
| 75 | + }, |
| 76 | + ], |
| 77 | + }; |
| 78 | + } |
| 79 | +); |
0 commit comments