2020-08-20 15:35:05 +00:00
|
|
|
import {task} from '@nomiclabs/buidler/config';
|
|
|
|
import {checkVerification} from '../../helpers/etherscan-verification';
|
2020-08-25 15:15:27 +00:00
|
|
|
import {ConfigNames} from '../../helpers/configuration';
|
2020-08-20 15:35:05 +00:00
|
|
|
|
2020-08-25 12:15:35 +00:00
|
|
|
task('aave:dev', 'Deploy development enviroment')
|
2020-08-20 15:35:05 +00:00
|
|
|
.addOptionalParam('verify', 'Verify contracts at Etherscan')
|
|
|
|
.setAction(async ({verify}, localBRE) => {
|
|
|
|
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 mock tokens');
|
2020-08-25 12:15:35 +00:00
|
|
|
await localBRE.run('deploy-mock-tokens', {verify});
|
2020-08-20 15:35:05 +00:00
|
|
|
|
|
|
|
console.log('2. Deploy address provider');
|
2020-08-25 12:15:35 +00:00
|
|
|
await localBRE.run('deploy-address-provider', {verify});
|
2020-08-20 15:35:05 +00:00
|
|
|
|
|
|
|
console.log('3. Deploy lending pool');
|
2020-08-25 12:15:35 +00:00
|
|
|
await localBRE.run('deploy-lending-pool', {verify});
|
2020-08-20 15:35:05 +00:00
|
|
|
|
|
|
|
console.log('4. Deploy oracles');
|
2020-08-25 15:15:27 +00:00
|
|
|
await localBRE.run('deploy-oracles', {verify, pool: ConfigNames.Aave});
|
2020-08-20 15:35:05 +00:00
|
|
|
|
2020-08-21 11:07:32 +00:00
|
|
|
console.log('5. Initialize lending pool');
|
2020-08-25 12:15:35 +00:00
|
|
|
await localBRE.run('initialize-lending-pool', {verify});
|
2020-08-20 15:35:05 +00:00
|
|
|
|
|
|
|
console.log('\nFinished migration');
|
|
|
|
});
|