aave-protocol-v2/tasks/migrations/aave.mainnet.ts

54 lines
1.8 KiB
TypeScript
Raw Normal View History

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('aave:mainnet', 'Deploy development enviroment')
.addFlag('verify', 'Verify contracts at Etherscan')
.setAction(async ({ verify }, DRE) => {
const POOL_NAME = ConfigNames.Aave;
await DRE.run('set-DRE');
// Prevent loss of gas verifying all the needed ENVs for Etherscan verification
if (verify) {
checkVerification();
}
2020-11-16 09:19:14 +00:00
console.log('Migration started\n');
console.log('1. Deploy address provider');
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 });
console.log('4. Deploy Data Provider');
await DRE.run('full:data-provider', { pool: POOL_NAME });
2021-02-22 14:57:48 +00:00
console.log('5. Deploy WETH Gateway');
2021-02-22 13:58:16 +00:00
await DRE.run('full-deploy-weth-gateway', { pool: POOL_NAME });
console.log('6. Initialize lending pool');
await DRE.run('full:initialize-lending-pool', { pool: POOL_NAME });
if (verify) {
printContracts();
2021-02-22 13:58:16 +00:00
console.log('7. Veryfing contracts');
await DRE.run('verify:general', { all: true, pool: POOL_NAME });
2021-02-22 13:58:16 +00:00
console.log('8. Veryfing aTokens and debtTokens');
await DRE.run('verify:tokens', { pool: POOL_NAME });
}
if (usingTenderly()) {
const postDeployHead = DRE.tenderlyRPC.getHead();
console.log('Tenderly UUID', postDeployHead);
}
console.log('\nFinished migrations');
printContracts();
});