|
| 1 | +const { deployOnBaseWithEOA } = require("../../utils/deploy-l2"); |
| 2 | +const { deployWithConfirmation } = require("../../utils/deploy"); |
| 3 | +const addresses = require("../../utils/addresses"); |
| 4 | + |
| 5 | +module.exports = deployOnBaseWithEOA( |
| 6 | + { |
| 7 | + deployName: "045_deploy_pool_booster_merkl_factory", |
| 8 | + }, |
| 9 | + async ({ ethers }) => { |
| 10 | + const { deployerAddr } = await getNamedAccounts(); |
| 11 | + |
| 12 | + const cPoolBoostCentralRegistryProxy = await ethers.getContract( |
| 13 | + "PoolBoostCentralRegistryProxy" |
| 14 | + ); |
| 15 | + const oethBaseProxy = await ethers.getContract("OETHBaseProxy"); |
| 16 | + |
| 17 | + // --------------------------------------------------------------------------------------------------------- |
| 18 | + // --- 1. Deploy PoolBoosterMerklV2 (implementation for beacon proxies) |
| 19 | + // --------------------------------------------------------------------------------------------------------- |
| 20 | + const dPoolBoosterMerklV2 = await deployWithConfirmation( |
| 21 | + "PoolBoosterMerklV2", |
| 22 | + [] |
| 23 | + ); |
| 24 | + console.log( |
| 25 | + `PoolBoosterMerklV2 deployed to ${dPoolBoosterMerklV2.address}` |
| 26 | + ); |
| 27 | + |
| 28 | + // --------------------------------------------------------------------------------------------------------- |
| 29 | + // --- 2. Deploy UpgradeableBeacon pointing to PoolBoosterMerklV2 |
| 30 | + // --------------------------------------------------------------------------------------------------------- |
| 31 | + const dUpgradeableBeacon = await deployWithConfirmation( |
| 32 | + "UpgradeableBeacon", |
| 33 | + [dPoolBoosterMerklV2.address] |
| 34 | + ); |
| 35 | + // Transfer beacon ownership from deployer to multichainStrategist |
| 36 | + const cBeacon = await ethers.getContractAt( |
| 37 | + "UpgradeableBeacon", |
| 38 | + dUpgradeableBeacon.address |
| 39 | + ); |
| 40 | + const sDeployer = ethers.provider.getSigner(deployerAddr); |
| 41 | + await cBeacon |
| 42 | + .connect(sDeployer) |
| 43 | + .transferOwnership(addresses.multichainStrategist); |
| 44 | + console.log(`UpgradeableBeacon deployed to ${dUpgradeableBeacon.address}`); |
| 45 | + |
| 46 | + // --------------------------------------------------------------------------------------------------------- |
| 47 | + // --- 3. Deploy PoolBoosterFactoryMerkl |
| 48 | + // --------------------------------------------------------------------------------------------------------- |
| 49 | + const dFactory = await deployWithConfirmation( |
| 50 | + "PoolBoosterFactoryMerkl", |
| 51 | + [ |
| 52 | + oethBaseProxy.address, |
| 53 | + addresses.multichainStrategist, |
| 54 | + cPoolBoostCentralRegistryProxy.address, |
| 55 | + dUpgradeableBeacon.address, |
| 56 | + ], |
| 57 | + "PoolBoosterFactoryMerkl", |
| 58 | + true |
| 59 | + ); |
| 60 | + console.log(`PoolBoosterFactoryMerkl deployed to ${dFactory.address}`); |
| 61 | + |
| 62 | + // NOTE: Registry approveFactory/removeFactory must be called by the |
| 63 | + // multichain strategist safe (registry governance was transferred). |
| 64 | + } |
| 65 | +); |
0 commit comments