2020-08-20 15:35:05 +00:00
|
|
|
import {task} from '@nomiclabs/buidler/config';
|
|
|
|
import {
|
|
|
|
deployLendingPoolAddressesProvider,
|
|
|
|
deployLendingPoolAddressesProviderRegistry,
|
2020-10-16 09:27:09 +00:00
|
|
|
} from '../../helpers/contracts-deployments';
|
2020-08-20 15:35:05 +00:00
|
|
|
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(
|
2020-10-26 09:41:24 +00:00
|
|
|
await addressesProviderRegistry.registerAddressesProvider(addressesProvider.address, 1)
|
2020-08-20 15:35:05 +00:00
|
|
|
);
|
|
|
|
});
|