From b7ad0cffa4183854b2be665d29ddc9e5328891fa Mon Sep 17 00:00:00 2001 From: Joey Santoro Date: Sun, 26 Sep 2021 22:30:02 -0700 Subject: [PATCH] deploy type --- proposals/dao/upgrade.ts | 76 -------------- scripts/deploy/upgrade.ts | 108 -------------------- scripts/deploy/v2Phase1.ts | 170 ++++++++++++++++---------------- test/integration/setup/index.ts | 2 +- test/integration/setup/types.ts | 2 +- 5 files changed, 87 insertions(+), 271 deletions(-) delete mode 100644 proposals/dao/upgrade.ts delete mode 100644 scripts/deploy/upgrade.ts diff --git a/proposals/dao/upgrade.ts b/proposals/dao/upgrade.ts deleted file mode 100644 index 09c01715f..000000000 --- a/proposals/dao/upgrade.ts +++ /dev/null @@ -1,76 +0,0 @@ -import hre, { ethers } from 'hardhat'; -import { RunUpgradeFunc, SetupUpgradeFunc, TeardownUpgradeFunc } from '../../test/integration/setup/types'; - -const setup: SetupUpgradeFunc = async (addresses, oldContracts, contracts, logging) => { - console.log('No actions to complete in setup.'); -}; - -const run: RunUpgradeFunc = async (addresses, oldContracts, contracts, logging = false) => { - const timelockAddress = addresses.timelockAddress; - - const { - uniswapPCVDeposit, - uniswapPCVController, - bondingCurve, - tribeReserveStabilizer, - ratioPCVController, - core, - tribe - } = contracts; - - const oldRatioPCVController = oldContracts.ratioPCVController; - - logging ? console.log('Granting Burner to new UniswapPCVController') : undefined; - await core.grantBurner(uniswapPCVController.address); - - logging ? console.log('Granting Minter to new UniswapPCVController') : undefined; - await core.grantMinter(uniswapPCVController.address); - - logging ? console.log('Granting Minter to new BondingCurve') : undefined; - await core.grantMinter(bondingCurve.address); - - logging ? console.log('Granting Minter to new UniswapPCVDeposit') : undefined; - await core.grantMinter(uniswapPCVDeposit.address); - - logging ? console.log('Granting Burner to new TribeReserveStabilizer') : undefined; - await core.grantBurner(tribeReserveStabilizer.address); - - // special role - // check via tribe contract - await hre.network.provider.request({ - method: 'hardhat_impersonateAccount', - params: [timelockAddress] - }); - - const timelockSigner = await ethers.getSigner(timelockAddress); - - logging ? console.log('Transferring TRIBE Minter role to TribeReserveStabilizer') : undefined; - await tribe.connect(timelockSigner).setMinter(tribeReserveStabilizer.address); - - await hre.network.provider.request({ - method: 'hardhat_stopImpersonatingAccount', - params: [timelockAddress] - }); - - logging ? console.log('Granting PCVController to new RatioPCVController') : undefined; - await core.grantPCVController(ratioPCVController.address); - - await oldRatioPCVController.withdrawRatio(oldContracts.uniswapPCVDeposit.address, uniswapPCVDeposit.address, '10000'); // move 100% of PCV from old -> new -}; - -/// / --------------------- NOT RUN ON CHAIN ---------------------- -const teardown: TeardownUpgradeFunc = async (addresses, oldContracts, contracts) => { - const core = contracts.core; - - const { uniswapPCVDeposit, uniswapPCVController, ratioPCVController, bondingCurve } = oldContracts; - - // Revoke controller permissions - await core.revokeMinter(uniswapPCVController.address); - await core.revokeMinter(uniswapPCVDeposit.address); - await core.revokeMinter(bondingCurve.address); - await core.revokeBurner(uniswapPCVController.address); - await core.revokePCVController(ratioPCVController.address); - await core.revokePCVController(uniswapPCVController.address); -}; - -module.exports = { setup, run, teardown }; diff --git a/scripts/deploy/upgrade.ts b/scripts/deploy/upgrade.ts deleted file mode 100644 index 26b5445ca..000000000 --- a/scripts/deploy/upgrade.ts +++ /dev/null @@ -1,108 +0,0 @@ -import hre, { ethers, artifacts } from 'hardhat'; -import { BN, ether } from '@openzeppelin/test-helpers'; - -const UniswapPCVDeposit = artifacts.readArtifactSync('UniswapPCVDeposit'); -const UniswapPCVController = artifacts.readArtifactSync('UniswapPCVController'); -const EthBondingCurve = artifacts.readArtifactSync('EthBondingCurve'); -const TribeReserveStabilizer = artifacts.readArtifactSync('TribeReserveStabilizer'); -const PCVDripController = artifacts.readArtifactSync('PCVDripController'); -const RatioPCVController = artifacts.readArtifactSync('RatioPCVController'); - -async function deploy(deployAddress, addresses, logging = false) { - const { - coreAddress, - feiEthPairAddress, - wethAddress, - uniswapRouterAddress, - chainlinkEthUsdOracleWrapperAddress, - compositeOracleAddress, - aaveEthPCVDepositAddress, - compoundEthPCVDepositAddress, - ethReserveStabilizerAddress - } = addresses; - - if ( - !coreAddress || - !feiEthPairAddress || - !wethAddress || - !uniswapRouterAddress || - !chainlinkEthUsdOracleWrapperAddress || - !compositeOracleAddress - ) { - throw new Error('An environment variable contract address is not set'); - } - - await hre.network.provider.request({ method: 'hardhat_impersonateAccount', params: [deployAddress] }); - const deploySigner = await ethers.getSigner(deployAddress); - - const uniswapPCVDeposit = await ( - await ethers.getContractFactory('UniswapPCVDeposit', deploySigner) - ).deploy( - coreAddress, - feiEthPairAddress, - uniswapRouterAddress, - chainlinkEthUsdOracleWrapperAddress, - ZERO_ADDRESS, - '100' - ); - - logging ? console.log('UniswapPCVDeposit deployed to: ', uniswapPCVDeposit.address) : undefined; - - const tenPow18 = ether('1'); - - const uniswapPCVController = await ( - await ethers.getContractFactory('UniswapPCVController', deploySigner) - ).deploy( - coreAddress, - uniswapPCVDeposit.address, - chainlinkEthUsdOracleWrapperAddress, - ZERO_ADDRESS, - tenPow18.mul(new BN('500')), - new BN('100'), - feiEthPairAddress, - 14400 - ); - - logging ? console.log('Uniswap PCV controller deployed to: ', uniswapPCVController.address) : undefined; - - const bondingCurve = await ( - await ethers.getContractFactory('EthBondingCurve', deploySigner) - ).deploy(coreAddress, chainlinkEthUsdOracleWrapperAddress, ZERO_ADDRESS, { - scale: tenPow18.mul(new BN('10000000')).toString(), - buffer: '100', - discount: '100', - pcvDeposits: [aaveEthPCVDepositAddress, compoundEthPCVDepositAddress], - ratios: [5000, 5000], - duration: '86400', - incentive: tenPow18.mul(new BN('100')).toString() - }); - - logging ? console.log('Bonding curve deployed to: ', bondingCurve.address) : undefined; - - const tribeReserveStabilizer = await ( - await ethers.getContractFactory('TribeReserveStabilizer') - ).deploy( - coreAddress, - chainlinkEthUsdOracleWrapperAddress, - ZERO_ADDRESS, - 9900, // $.99 redemption - 1% fee - compositeOracleAddress, - 9700 // $.97 FEI threshold - ); - - logging ? console.log('TRIBE Reserve Stabilizer: ', tribeReserveStabilizer.address) : undefined; - - const ratioPCVController = await (await ethers.getContractFactory('RatioPCVController')).deploy(coreAddress); - - logging ? console.log('Ratio PCV controller', ratioPCVController.address) : undefined; - - return { - uniswapPCVDeposit, - uniswapPCVController, - bondingCurve, - ratioPCVController, - tribeReserveStabilizer - }; -} - -module.exports = { deploy }; diff --git a/scripts/deploy/v2Phase1.ts b/scripts/deploy/v2Phase1.ts index 522640d3e..0c69d9127 100644 --- a/scripts/deploy/v2Phase1.ts +++ b/scripts/deploy/v2Phase1.ts @@ -116,12 +116,12 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal } = getAllContractAddresses(); if (!core || !feiEthPair || !weth || !uniswapRouterAddress || !chainlinkEthUsdOracleWrapper || !compositeOracle) { - console.log(`core: ${core.address}`); - console.log(`feiEtiPair: ${feiEthPair.address}`); - console.log(`weth: ${weth.address}`); + console.log(`core: ${core}`); + console.log(`feiEtiPair: ${feiEthPair}`); + console.log(`weth: ${weth}`); console.log(`uniswapRouter: ${uniswapRouterAddress}`); - console.log(`chainlinkEthUsdOracleWrapper: ${chainlinkEthUsdOracleWrapper.address}`); - console.log(`compositeOracle: ${compositeOracle.address}`); + console.log(`chainlinkEthUsdOracleWrapper: ${chainlinkEthUsdOracleWrapper}`); + console.log(`compositeOracle: ${compositeOracle}`); throw new Error('An environment variable contract address is not set'); } @@ -129,10 +129,10 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal // ----------- Replacement Contracts --------------- const uniswapPCVDepositFactory = await ethers.getContractFactory(UniswapPCVDeposit.abi, UniswapPCVDeposit.bytecode); const uniswapPCVDeposit = await uniswapPCVDepositFactory.deploy( - core.address, - feiEthPair.address, + core, + feiEthPair, uniswapRouterAddress, - chainlinkEthUsdOracleWrapper.address, + chainlinkEthUsdOracleWrapper, ZERO_ADDRESS, '100' ); @@ -144,10 +144,10 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal UniswapPCVDeposit.bytecode ); const dpiUniswapPCVDeposit = await dpiUniswapPCVDepositFactory.deploy( - core.address, - sushiswapDpiFei.address, + core, + sushiswapDpiFei, sushiswapRouterAddress, - chainlinkDpiUsdOracleWrapper.address, + chainlinkDpiUsdOracleWrapper, ZERO_ADDRESS, '100' ); @@ -155,14 +155,14 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal const bondingCurveFactory = await ethers.getContractFactory(EthBondingCurve.abi, EthBondingCurve.bytecode); const bondingCurve = await bondingCurveFactory.deploy( - core.address, - chainlinkEthUsdOracleWrapper.address, + core, + chainlinkEthUsdOracleWrapper, ZERO_ADDRESS, { scale: SCALE, buffer: BUFFER, discount: DISCOUNT, - pcvDeposits: [aaveEthPCVDeposit.address, compoundEthPCVDeposit.address], + pcvDeposits: [aaveEthPCVDeposit, compoundEthPCVDeposit], ratios: [5000, 5000], duration: BC_DURATION, incentive: BC_INCENTIVE @@ -174,7 +174,7 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal RatioPCVController.abi, RatioPCVController.bytecode ); - const ratioPCVController = await ratioPCVControllerFactory.deploy(core.address); + const ratioPCVController = await ratioPCVControllerFactory.deploy(core); logging && console.log('Ratio PCV controller', ratioPCVController.address); @@ -185,8 +185,8 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal PCVDepositWrapper.bytecode ); const daiBondingCurveWrapper = await daiBondingCurveWrapperFactory.deploy( - daiBondingCurve.address, - dai.address, + daiBondingCurve, + dai, false ); @@ -197,8 +197,8 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal PCVDepositWrapper.bytecode ); const compoundDaiPCVDepositWrapper = await compoundDaiPCVDepositWrapperFactory.deploy( - compoundDaiPCVDeposit.address, - dai.address, + compoundDaiPCVDeposit, + dai, false ); @@ -209,8 +209,8 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal PCVDepositWrapper.bytecode ); const raiBondingCurveWrapper = await raiBondingCurveWrapperFactory.deploy( - raiBondingCurve.address, - rai.address, + raiBondingCurve, + rai, false ); @@ -221,8 +221,8 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal PCVDepositWrapper.bytecode ); const aaveRaiPCVDepositWrapper = await aaveRaiPCVDepositWrapperFactory.deploy( - aaveRaiPCVDeposit.address, - rai.address, + aaveRaiPCVDeposit, + rai, false ); @@ -233,8 +233,8 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal PCVDepositWrapper.bytecode ); const rariPool9RaiPCVDepositWrapper = await rariPool9RaiPCVDepositWrapperFactory.deploy( - rariPool9RaiPCVDeposit.address, - rai.address, + rariPool9RaiPCVDeposit, + rai, false ); @@ -245,8 +245,8 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal PCVDepositWrapper.bytecode ); const dpiBondingCurveWrapper = await dpiBondingCurveWrapperFactory.deploy( - dpiBondingCurve.address, - dpi.address, + dpiBondingCurve, + dpi, false ); @@ -257,8 +257,8 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal PCVDepositWrapper.bytecode ); const rariPool19DpiPCVDepositWrapper = await rariPool19DpiPCVDepositWrapperFactory.deploy( - rariPool19DpiPCVDeposit.address, - dpi.address, + rariPool19DpiPCVDeposit, + dpi, false ); @@ -269,8 +269,8 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal PCVDepositWrapper.bytecode ); const ethReserveStabilizerWrapper = await ethReserveStabilizerWrapperFactory.deploy( - ethReserveStabilizer.address, - weth.address, + ethReserveStabilizer, + weth, false ); @@ -281,8 +281,8 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal PCVDepositWrapper.bytecode ); const ethLidoPCVDepositWrapper = await ethLidoPCVDepositWrapperFactory.deploy( - ethLidoPCVDeposit.address, - weth.address, + ethLidoPCVDeposit, + weth, false ); @@ -293,8 +293,8 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal PCVDepositWrapper.bytecode ); const aaveEthPCVDepositWrapper = await aaveEthPCVDepositWrapperFactory.deploy( - aaveEthPCVDeposit.address, - weth.address, + aaveEthPCVDeposit, + weth, false ); @@ -305,8 +305,8 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal PCVDepositWrapper.bytecode ); const compoundEthPCVDepositWrapper = await compoundEthPCVDepositWrapperFactory.deploy( - compoundEthPCVDeposit.address, - weth.address, + compoundEthPCVDeposit, + weth, false ); @@ -319,8 +319,8 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal PCVDepositWrapper.bytecode ); const rariPool8FeiPCVDepositWrapper = await rariPool8FeiPCVDepositWrapperFactory.deploy( - rariPool8FeiPCVDeposit.address, - fei.address, + rariPool8FeiPCVDeposit, + fei, true ); @@ -331,8 +331,8 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal PCVDepositWrapper.bytecode ); const rariPool9FeiPCVDepositWrapper = await rariPool9FeiPCVDepositWrapperFactory.deploy( - rariPool9FeiPCVDeposit.address, - fei.address, + rariPool9FeiPCVDeposit, + fei, true ); @@ -343,8 +343,8 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal PCVDepositWrapper.bytecode ); const rariPool7FeiPCVDepositWrapper = await rariPool7FeiPCVDepositWrapperFactory.deploy( - rariPool7FeiPCVDeposit.address, - fei.address, + rariPool7FeiPCVDeposit, + fei, true ); @@ -355,8 +355,8 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal PCVDepositWrapper.bytecode ); const rariPool6FeiPCVDepositWrapper = await rariPool6FeiPCVDepositWrapperFactory.deploy( - rariPool6FeiPCVDeposit.address, - fei.address, + rariPool6FeiPCVDeposit, + fei, true ); @@ -367,8 +367,8 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal PCVDepositWrapper.bytecode ); const rariPool19FeiPCVDepositWrapper = await rariPool19FeiPCVDepositWrapperFactory.deploy( - rariPool19FeiPCVDeposit.address, - fei.address, + rariPool19FeiPCVDeposit, + fei, true ); @@ -379,8 +379,8 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal PCVDepositWrapper.bytecode ); const rariPool24FeiPCVDepositWrapper = await rariPool24FeiPCVDepositWrapperFactory.deploy( - rariPool24FeiPCVDeposit.address, - fei.address, + rariPool24FeiPCVDeposit, + fei, true ); @@ -391,8 +391,8 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal PCVDepositWrapper.bytecode ); const rariPool25FeiPCVDepositWrapper = await rariPool25FeiPCVDepositWrapperFactory.deploy( - rariPool25FeiPCVDeposit.address, - fei.address, + rariPool25FeiPCVDeposit, + fei, true ); @@ -403,8 +403,8 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal PCVDepositWrapper.bytecode ); const rariPool26FeiPCVDepositWrapper = await rariPool26FeiPCVDepositWrapperFactory.deploy( - rariPool26FeiPCVDeposit.address, - fei.address, + rariPool26FeiPCVDeposit, + fei, true ); @@ -415,8 +415,8 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal PCVDepositWrapper.bytecode ); const rariPool27FeiPCVDepositWrapper = await rariPool27FeiPCVDepositWrapperFactory.deploy( - rariPool27FeiPCVDeposit.address, - fei.address, + rariPool27FeiPCVDeposit, + fei, true ); @@ -427,8 +427,8 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal PCVDepositWrapper.bytecode ); const rariPool18FeiPCVDepositWrapper = await rariPool18FeiPCVDepositWrapperFactory.deploy( - rariPool18FeiPCVDeposit.address, - fei.address, + rariPool18FeiPCVDeposit, + fei, true ); @@ -439,8 +439,8 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal PCVDepositWrapper.bytecode ); const creamFeiPCVDepositWrapper = await creamFeiPCVDepositWrapperFactory.deploy( - creamFeiPCVDeposit.address, - fei.address, + creamFeiPCVDeposit, + fei, true ); @@ -451,7 +451,7 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal StaticPCVDepositWrapper.bytecode ); const staticPcvDepositWrapper = await staticPcvDepositWrapperFactory.deploy( - core.address, + core, `4000000${e18}`, // 4M PCV for 100k INDEX @ ~$40 `8500000${e18}` // 8.5M FEI in Kashi ); @@ -462,10 +462,10 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal const constantOracleFactory = await ethers.getContractFactory(ConstantOracle.abi, ConstantOracle.bytecode); - const zeroConstantOracle = await constantOracleFactory.deploy(core.address, 0); + const zeroConstantOracle = await constantOracleFactory.deploy(core, 0); logging && console.log('zeroConstantOracle: ', zeroConstantOracle.address); - const oneConstantOracle = await constantOracleFactory.deploy(core.address, 10000); + const oneConstantOracle = await constantOracleFactory.deploy(core, 10000); logging && console.log('oneConstantOracle: ', oneConstantOracle.address); const collateralizationOracleFactory = await ethers.getContractFactory( @@ -473,7 +473,7 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal CollateralizationOracle.bytecode ); const collateralizationOracle = await collateralizationOracleFactory.deploy( - core.address, + core, [ rariPool19DpiPCVDepositWrapper.address, dpiBondingCurveWrapper.address, @@ -502,12 +502,12 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal creamFeiPCVDepositWrapper.address, staticPcvDepositWrapper.address ], - [dai.address, dpi.address, weth.address, rai.address, fei.address, USD_ADDRESS], + [dai, dpi, weth, rai, fei, USD_ADDRESS], [ - chainlinkDaiUsdOracleWrapper.address, - chainlinkDpiUsdOracleWrapper.address, - chainlinkEthUsdOracleWrapper.address, - chainlinkRaiUsdCompositOracle.address, + chainlinkDaiUsdOracleWrapper, + chainlinkDpiUsdOracleWrapper, + chainlinkEthUsdOracleWrapper, + chainlinkRaiUsdCompositOracle, zeroConstantOracle.address, oneConstantOracle.address ] @@ -520,7 +520,7 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal CollateralizationOracleWrapper.bytecode ); const collateralizationOracleWrapperImpl = await collateralizationOracleWrapperImplFactory.deploy( - core.address, + core, 1 // not used ); @@ -551,14 +551,14 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal } ] }, - [core.address, collateralizationOracle.address, CR_WRAPPER_DURATION, CR_WRAPPER_DEVIATION_BPS] + [core, collateralizationOracle.address, CR_WRAPPER_DURATION, CR_WRAPPER_DEVIATION_BPS] ); const ProxyFactory = await ethers.getContractFactory( TransparentUpgradeableProxy.abi, TransparentUpgradeableProxy.bytecode ); - const proxy = await ProxyFactory.deploy(collateralizationOracleWrapperImpl.address, proxyAdmin.address, calldata); + const proxy = await ProxyFactory.deploy(collateralizationOracleWrapperImpl.address, proxyAdmin, calldata); const collateralizationOracleWrapper = await ethers.getContractAt(CollateralizationOracleWrapper.abi, proxy.address); @@ -569,7 +569,7 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal CollateralizationOracleKeeper.bytecode ); const collateralizationOracleKeeper = await collateralizationOracleKeeperFactory.deploy( - core.address, + core, CR_KEEPER_INCENTIVE, collateralizationOracleWrapper.address ); @@ -583,7 +583,7 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal ChainlinkOracleWrapper.bytecode ); const chainlinkTribeEthOracleWrapper = await chainlinkTribeEthOracleWrapperFactory.deploy( - core.address, + core, chainlinkTribeEthOracleAddress ); @@ -594,9 +594,9 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal CompositeOracle.bytecode ); const chainlinkTribeUsdCompositeOracle = await chainlinkTribeUsdCompositeOracleFactory.deploy( - core.address, + core, chainlinkTribeEthOracleWrapper.address, - chainlinkEthUsdOracleWrapper.address + chainlinkEthUsdOracleWrapper ); logging && console.log('TRIBE/USD Composite Oracle deployed to: ', chainlinkTribeUsdCompositeOracle.address); @@ -606,7 +606,7 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal TribeReserveStabilizer.bytecode ); const tribeReserveStabilizer = await tribeReserveStabilizerFactory.deploy( - core.address, + core, chainlinkTribeUsdCompositeOracle.address, ZERO_ADDRESS, USD_PER_FEI_BPS, @@ -622,9 +622,9 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal // ERC20Splitter const tribeSplitterFactory = await ethers.getContractFactory(ERC20Splitter.abi, ERC20Splitter.bytecode); const tribeSplitter = await tribeSplitterFactory.deploy( - core.address, - tribe.address, - [tribeReserveStabilizer.address, core.address, erc20Dripper.address], + core, + tribe, + [tribeReserveStabilizer.address, core, erc20Dripper], [SPLIT_BURN_BPS, SPLIT_DAO_BPS, SPLIT_LM_BPS] ); logging && console.log('TRIBE Splitter: ', tribeSplitter.address); @@ -634,7 +634,7 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal BalancerLBPSwapper.bytecode ); const feiTribeLBPSwapper = await feiTribeLBPSwapperFactory.deploy( - core.address, + core, { _oracle: chainlinkTribeUsdCompositeOracle.address, _backupOracle: ZERO_ADDRESS, @@ -642,19 +642,19 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal _decimalsNormalizer: 0 }, LBP_FREQUENCY, - fei.address, - tribe.address, + fei, + tribe, tribeSplitter.address, MIN_LBP_SIZE ); logging && console.log('FEI->TRIBE LBP Swapper: ', feiTribeLBPSwapper.address); - const lbpFactory = await ethers.getContractAt(ILiquidityBootstrappingPoolFactory.abi, balancerLBPoolFactory.address); + const lbpFactory = await ethers.getContractAt(ILiquidityBootstrappingPoolFactory.abi, balancerLBPoolFactory); const tx: TransactionResponse = await lbpFactory.create( 'FEI->TRIBE Auction Pool', 'apFEI-TRIBE', - [fei.address, tribe.address], + [fei, tribe], [`99${e16}`, `1${e16}`], `30${e14}`, feiTribeLBPSwapper.address, @@ -671,7 +671,7 @@ const deploy: DeployUpgradeFunc = async (deployAddress, addresses, logging = fal const pcvEquityMinterFactory = await ethers.getContractFactory(PCVEquityMinter.abi, PCVEquityMinter.bytecode); const pcvEquityMinter = await pcvEquityMinterFactory.deploy( - core.address, + core, feiTribeLBPSwapper.address, PCV_EQUITY_MINTER_INCENTIVE, PCV_EQUITY_MINTER_FREQUENCY, diff --git a/test/integration/setup/index.ts b/test/integration/setup/index.ts index 690dd86a2..433a9e538 100644 --- a/test/integration/setup/index.ts +++ b/test/integration/setup/index.ts @@ -90,7 +90,7 @@ export class TestEndtoEndCoordinator implements TestCoordinator { const deployTyped = deploy as DeployUpgradeFunc; deployedUpgradedContracts = await deployTyped( this.config.deployAddress, - this.mainnetContracts, + namedContractsToNamedAddresses(this.mainnetContracts), this.config.logging ); } diff --git a/test/integration/setup/types.ts b/test/integration/setup/types.ts index 0eccb4f0d..66b67ef7c 100644 --- a/test/integration/setup/types.ts +++ b/test/integration/setup/types.ts @@ -23,7 +23,7 @@ export type NamedContracts = { [key: string]: ethers.Contract }; export type NamedAddresses = { [key: string]: string }; export type DeployUpgradeFunc = ( deployAddress: string, - contracts: NamedContracts, + address: NamedAddresses, logging: boolean ) => Promise; export type SetupUpgradeFunc = (