aave-protocol-v2/tasks/dev/2_address_provider_registry.ts

26 lines
945 B
TypeScript
Raw Normal View History

import {task} from '@nomiclabs/buidler/config';
import {
deployLendingPoolAddressesProvider,
deployLendingPoolAddressesProviderRegistry,
} from '../../helpers/contracts-helpers';
import {waitForTx} from '../../helpers/misc-utils';
task(
'dev:deploy-address-provider',
'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();
const addressesProvider = await deployLendingPoolAddressesProvider(verify);
2020-09-24 15:48:29 +00:00
await waitForTx(await addressesProvider.setAaveAdmin(admin));
const addressesProviderRegistry = await deployLendingPoolAddressesProviderRegistry(verify);
await waitForTx(
await addressesProviderRegistry.registerAddressesProvider(addressesProvider.address, 0)
);
});