2021-01-27 14:43:34 +00:00
|
|
|
import { task } from 'hardhat/config';
|
|
|
|
import { checkVerification } from '../../helpers/etherscan-verification';
|
|
|
|
import { ConfigNames } from '../../helpers/configuration';
|
|
|
|
import { printContracts } from '../../helpers/misc-utils';
|
2020-08-20 15:35:05 +00:00
|
|
|
|
2020-08-25 12:15:35 +00:00
|
|
|
task('aave:dev', 'Deploy development enviroment')
|
2021-03-16 21:57:58 +00:00
|
|
|
.addFlag('verify', 'Verify contracts at Etherscan')
|
2021-01-27 14:43:34 +00:00
|
|
|
.setAction(async ({ verify }, localBRE) => {
|
2020-08-31 10:10:40 +00:00
|
|
|
const POOL_NAME = ConfigNames.Aave;
|
|
|
|
|
2020-11-05 12:44:20 +00:00
|
|
|
await localBRE.run('set-DRE');
|
2020-08-20 15:35:05 +00:00
|
|
|
|
|
|
|
// 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');
|
2021-01-27 14:43:34 +00:00
|
|
|
await localBRE.run('dev:deploy-mock-tokens', { verify });
|
2020-08-20 15:35:05 +00:00
|
|
|
|
|
|
|
console.log('2. Deploy address provider');
|
2021-01-27 14:43:34 +00:00
|
|
|
await localBRE.run('dev:deploy-address-provider', { verify });
|
2020-08-20 15:35:05 +00:00
|
|
|
|
|
|
|
console.log('3. Deploy lending pool');
|
2021-07-20 09:32:22 +00:00
|
|
|
await localBRE.run('dev:deploy-lending-pool', { verify, pool: POOL_NAME });
|
2020-08-20 15:35:05 +00:00
|
|
|
|
|
|
|
console.log('4. Deploy oracles');
|
2021-01-27 14:43:34 +00:00
|
|
|
await localBRE.run('dev:deploy-oracles', { verify, pool: POOL_NAME });
|
2020-08-20 15:35:05 +00:00
|
|
|
|
2021-05-10 08:47:24 +00:00
|
|
|
console.log('5. Deploy WETH Gateway');
|
|
|
|
await localBRE.run('full-deploy-weth-gateway', { verify, pool: POOL_NAME });
|
|
|
|
|
|
|
|
console.log('6. Initialize lending pool');
|
2021-01-27 14:43:34 +00:00
|
|
|
await localBRE.run('dev:initialize-lending-pool', { verify, pool: POOL_NAME });
|
2020-08-20 15:35:05 +00:00
|
|
|
|
|
|
|
console.log('\nFinished migration');
|
2020-11-02 13:45:00 +00:00
|
|
|
printContracts();
|
2020-08-20 15:35:05 +00:00
|
|
|
});
|