2020-08-25 12:15:35 +00:00
|
|
|
import {task} from '@nomiclabs/buidler/config';
|
|
|
|
import {checkVerification} from '../../helpers/etherscan-verification';
|
2020-08-31 10:10:40 +00:00
|
|
|
import {ConfigNames} from '../../helpers/configuration';
|
2020-08-25 12:15:35 +00:00
|
|
|
|
|
|
|
task('uniswap:full', 'Deploy development enviroment')
|
|
|
|
.addOptionalParam('verify', 'Verify contracts at Etherscan')
|
|
|
|
.setAction(async ({verify}, localBRE) => {
|
2020-08-31 10:10:40 +00:00
|
|
|
const POOL_NAME = ConfigNames.Uniswap;
|
|
|
|
|
2020-08-25 12:15:35 +00:00
|
|
|
await localBRE.run('set-bre');
|
2020-08-31 10:10:40 +00:00
|
|
|
|
2020-08-25 12:15:35 +00:00
|
|
|
// Prevent loss of gas verifying all the needed ENVs for Etherscan verification
|
|
|
|
if (verify) {
|
|
|
|
checkVerification();
|
|
|
|
}
|
2020-08-31 10:10:40 +00:00
|
|
|
|
|
|
|
console.log('Migration started\n');
|
|
|
|
|
|
|
|
console.log('1. Deploy address provider');
|
|
|
|
await localBRE.run('full:deploy-address-provider', {verify, pool: POOL_NAME});
|
|
|
|
|
|
|
|
console.log('2. Deploy lending pool');
|
|
|
|
await localBRE.run('full:deploy-lending-pool', {verify});
|
|
|
|
|
|
|
|
console.log('3. Deploy oracles');
|
|
|
|
await localBRE.run('full:deploy-oracles', {verify, pool: POOL_NAME});
|
|
|
|
|
|
|
|
console.log('4. Initialize lending pool');
|
|
|
|
await localBRE.run('full:initialize-lending-pool', {verify, pool: POOL_NAME});
|
|
|
|
|
|
|
|
console.log('\nFinished migrations');
|
2020-08-25 12:15:35 +00:00
|
|
|
});
|