From 51ea7364e1b45c66d8fb7b32c1cc97d18a0d77ad Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Fri, 19 Feb 2021 18:31:04 -0500 Subject: [PATCH] (Same functionality) Updated LP mainnet --- tasks/migrations/lp.mainnet.ts | 37 +++++++++++++--------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/tasks/migrations/lp.mainnet.ts b/tasks/migrations/lp.mainnet.ts index 70121c03..912f48b4 100644 --- a/tasks/migrations/lp.mainnet.ts +++ b/tasks/migrations/lp.mainnet.ts @@ -1,15 +1,13 @@ -import {task} from 'hardhat/config'; -import {ExternalProvider} from '@ethersproject/providers'; -import {checkVerification} from '../../helpers/etherscan-verification'; -import {ConfigNames} from '../../helpers/configuration'; -import {EthereumNetworkNames} from '../../helpers/types'; -import {printContracts} from '../../helpers/misc-utils'; +import { task } from 'hardhat/config'; +import { checkVerification } from '../../helpers/etherscan-verification'; +import { ConfigNames } from '../../helpers/configuration'; +import { printContracts } from '../../helpers/misc-utils'; +import { usingTenderly } from '../../helpers/tenderly-utils'; task('lp:mainnet', 'Deploy development enviroment') .addFlag('verify', 'Verify contracts at Etherscan') - .setAction(async ({verify}, DRE) => { + .setAction(async ({ verify }, DRE) => { const POOL_NAME = ConfigNames.Lp; - const network = DRE.network.name; await DRE.run('set-DRE'); // Prevent loss of gas verifying all the needed ENVs for Etherscan verification @@ -17,40 +15,33 @@ task('lp:mainnet', 'Deploy development enviroment') checkVerification(); } - if (network.includes('tenderly')) { - console.log('- Setting up Tenderly provider'); - await DRE.tenderlyRPC.initializeFork(); - const provider = new DRE.ethers.providers.Web3Provider(DRE.tenderlyRPC as any); - DRE.ethers.provider = provider; - } - console.log('Migration started\n'); console.log('1. Deploy address provider'); - await DRE.run('full:deploy-address-provider', {pool: POOL_NAME}); - + await DRE.run('full:deploy-address-provider', { pool: POOL_NAME }); + console.log('2. Deploy lending pool'); await DRE.run('full:deploy-lending-pool'); console.log('3. Deploy oracles'); - await DRE.run('full:deploy-oracles', {pool: POOL_NAME}); + await DRE.run('full:deploy-oracles', { pool: POOL_NAME }); console.log('4. Deploy Data Provider'); - await DRE.run('full:data-provider', {pool: POOL_NAME}); + await DRE.run('full:data-provider', { pool: POOL_NAME }); console.log('5. Initialize lending pool'); - await DRE.run('full:initialize-lending-pool', {pool: POOL_NAME}); + await DRE.run('full:initialize-lending-pool', { pool: POOL_NAME }); if (verify) { printContracts(); console.log('4. Veryfing contracts'); - await DRE.run('verify:general', {all: true, pool: POOL_NAME}); + await DRE.run('verify:general', { all: true, pool: POOL_NAME }); console.log('5. Veryfing aTokens and debtTokens'); - await DRE.run('verify:tokens', {pool: POOL_NAME}); + await DRE.run('verify:tokens', { pool: POOL_NAME }); } - if (network.includes('tenderly')) { + if (usingTenderly()) { const postDeployHead = DRE.tenderlyRPC.getHead(); console.log('Tenderly UUID', postDeployHead); }