2020-08-20 15:35:05 +00:00
|
|
|
import {task} from '@nomiclabs/buidler/config';
|
|
|
|
import {
|
|
|
|
deployLendingPoolAddressesProvider,
|
|
|
|
deployLendingPoolAddressesProviderRegistry,
|
|
|
|
} from '../../helpers/contracts-helpers';
|
|
|
|
import {waitForTx} from '../../helpers/misc-utils';
|
|
|
|
|
|
|
|
task(
|
2020-08-31 10:10:40 +00:00
|
|
|
'dev:deploy-address-provider',
|
2020-08-20 15:35:05 +00:00
|
|
|
'Deploy address provider, registry and fee provider for dev enviroment'
|
|
|
|
)
|
|
|
|
.addOptionalParam('verify', 'Verify contracts at Etherscan')
|
|
|
|
.setAction(async ({verify}, localBRE) => {
|
|
|
|
await localBRE.run('set-bre');
|
|
|
|
|
2020-09-24 15:48:29 +00:00
|
|
|
const admin = await (await localBRE.ethers.getSigners())[0].getAddress();
|
2020-08-20 15:35:05 +00:00
|
|
|
|
|
|
|
const addressesProvider = await deployLendingPoolAddressesProvider(verify);
|
2020-09-24 15:48:29 +00:00
|
|
|
await waitForTx(await addressesProvider.setAaveAdmin(admin));
|
2020-08-20 15:35:05 +00:00
|
|
|
|
|
|
|
const addressesProviderRegistry = await deployLendingPoolAddressesProviderRegistry(verify);
|
|
|
|
await waitForTx(
|
|
|
|
await addressesProviderRegistry.registerAddressesProvider(addressesProvider.address, 0)
|
|
|
|
);
|
|
|
|
});
|