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

34 lines
1.2 KiB
TypeScript
Raw Normal View History

2020-08-25 12:15:35 +00:00
import {task} from '@nomiclabs/buidler/config';
import {checkVerification} from '../../helpers/etherscan-verification';
2020-08-26 10:38:52 +00:00
import {ConfigNames} from '../../helpers/configuration';
2020-09-15 15:24:50 +00:00
import {EthereumNetworkNames} from '../../helpers/types';
import {printContracts} from '../../helpers/misc-utils';
2020-08-25 12:15:35 +00:00
task('aave:full', 'Deploy development enviroment')
2020-09-15 15:24:50 +00:00
.addFlag('verify', 'Verify contracts at Etherscan')
2020-08-25 12:15:35 +00:00
.setAction(async ({verify}, localBRE) => {
const POOL_NAME = ConfigNames.Aave;
2020-09-15 15:24:50 +00:00
const network = <EthereumNetworkNames>localBRE.network.name;
2020-08-26 10:38:52 +00:00
await localBRE.run('set-bre');
// Prevent loss of gas verifying all the needed ENVs for Etherscan verification
if (verify) {
checkVerification();
}
console.log('Migration started\n');
console.log('1. Deploy address provider');
await localBRE.run('full:deploy-address-provider', {verify, pool: POOL_NAME});
2020-08-26 10:38:52 +00:00
console.log('2. Deploy lending pool');
await localBRE.run('full:deploy-lending-pool', {verify});
2020-08-26 10:38:52 +00:00
2020-10-16 11:49:45 +00:00
console.log('3. Initialize lending pool');
await localBRE.run('full:initialize-lending-pool', {verify, pool: POOL_NAME});
2020-08-26 10:38:52 +00:00
console.log('\nFinished migrations');
printContracts();
2020-08-25 12:15:35 +00:00
});