aave-protocol-v2/tasks/deployments/deploy-UiPoolDataProvider.ts

45 lines
1.7 KiB
TypeScript
Raw Normal View History

2020-11-30 13:14:29 +00:00
import { task } from 'hardhat/config';
2021-03-30 11:17:08 +00:00
import { eContractid, eEthereumNetwork, ePolygonNetwork } from '../../helpers/types';
import { deployUiPoolDataProvider } from '../../helpers/contracts-deployments';
task(`deploy-${eContractid.UiPoolDataProvider}`, `Deploys the UiPoolDataProvider contract`)
.addFlag('verify', 'Verify UiPoolDataProvider contract via Etherscan API.')
2020-11-30 13:14:29 +00:00
.setAction(async ({ verify }, localBRE) => {
await localBRE.run('set-DRE');
if (!localBRE.network.config.chainId) {
throw new Error('INVALID_CHAIN_ID');
}
2021-03-30 11:17:08 +00:00
const addressesByNetwork = {
// [eEthereumNetwork.kovan]: {
// incentivesController: '',
// aaveOracle: '',
// },
[eEthereumNetwork.main]: {
2021-04-21 17:16:11 +00:00
incentivesController: '0xd784927Ff2f95ba542BfC824c8a8a98F3495f6b5',
aaveOracle: '0xa50ba011c48153de246e5192c8f9258a2ba79ca9',
},
2021-03-30 11:17:08 +00:00
[ePolygonNetwork.matic]: {
incentivesController: '0x357D51124f59836DeD84c8a1730D72B749d8BC23',
aaveOracle: '0x21451bD7b528896B4AB2b9764b521D6ed641708d',
},
2021-04-09 08:57:01 +00:00
[ePolygonNetwork.mumbai]: {
2021-04-12 19:36:34 +00:00
incentivesController: '0xd41aE58e803Edf4304334acCE4DC4Ec34a63C644',
aaveOracle: '0xC365C653f7229894F93994CD0b30947Ab69Ff1D5',
2021-04-09 08:57:01 +00:00
},
2021-03-30 11:17:08 +00:00
};
console.log(`\n- UiPoolDataProvider deployment`);
console.log(`\tDeploying UiPoolDataProvider implementation ...`);
2021-03-30 11:17:08 +00:00
const UiPoolDataProvider = await deployUiPoolDataProvider(
[
addressesByNetwork[localBRE.network.name].incentivesController,
addressesByNetwork[localBRE.network.name].aaveOracle,
],
verify
);
2021-03-30 11:17:08 +00:00
console.log(`\tFinished UiPoolDataProvider deployment: ${UiPoolDataProvider.address}`);
});