mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Added full script and config for kovan
This commit is contained in:
parent
da2ade5d3b
commit
18aac08061
|
@ -169,7 +169,7 @@ export const CommonsConfig: ICommonConfiguration = {
|
||||||
[eEthereumNetwork.coverage]: '',
|
[eEthereumNetwork.coverage]: '',
|
||||||
[eEthereumNetwork.hardhat]: '',
|
[eEthereumNetwork.hardhat]: '',
|
||||||
[eEthereumNetwork.buidlerevm]: '',
|
[eEthereumNetwork.buidlerevm]: '',
|
||||||
[eEthereumNetwork.kovan]: '',
|
[eEthereumNetwork.kovan]: '0xf99b8E67a0E044734B01EC4586D1c88C9a869718',
|
||||||
[eEthereumNetwork.ropsten]: '',
|
[eEthereumNetwork.ropsten]: '',
|
||||||
[eEthereumNetwork.main]: '',
|
[eEthereumNetwork.main]: '',
|
||||||
[eEthereumNetwork.tenderlyMain]: '',
|
[eEthereumNetwork.tenderlyMain]: '',
|
||||||
|
|
25493
package-lock.json
generated
25493
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
|
@ -1,21 +0,0 @@
|
||||||
import { task } from 'hardhat/config';
|
|
||||||
|
|
||||||
import { deployWETHGateway } from '../../helpers/contracts-deployments';
|
|
||||||
|
|
||||||
const CONTRACT_NAME = 'WETHGateway';
|
|
||||||
|
|
||||||
task(`deploy-${CONTRACT_NAME}`, `Deploys the ${CONTRACT_NAME} contract`)
|
|
||||||
.addParam('weth', 'Address of the weth token')
|
|
||||||
.addFlag('verify', `Verify ${CONTRACT_NAME} contract via Etherscan API.`)
|
|
||||||
.setAction(async ({ weth, verify }, localBRE) => {
|
|
||||||
await localBRE.run('set-DRE');
|
|
||||||
|
|
||||||
if (!localBRE.network.config.chainId) {
|
|
||||||
throw new Error('INVALID_CHAIN_ID');
|
|
||||||
}
|
|
||||||
|
|
||||||
const wethGateWay = await deployWETHGateway([weth], verify);
|
|
||||||
console.log(`${CONTRACT_NAME}.address`, wethGateWay.address);
|
|
||||||
|
|
||||||
console.log(`\tFinished ${CONTRACT_NAME} deployment`);
|
|
||||||
});
|
|
32
tasks/full/5-deploy-wethGateWay.ts
Normal file
32
tasks/full/5-deploy-wethGateWay.ts
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
import { task } from 'hardhat/config';
|
||||||
|
import { AaveConfig } from '../../markets/aave/index';
|
||||||
|
import { getParamPerNetwork } from '../../helpers/contracts-helpers';
|
||||||
|
import { loadPoolConfig, ConfigNames } from '../../helpers/configuration';
|
||||||
|
import { deployWETHGateway } from '../../helpers/contracts-deployments';
|
||||||
|
import { DRE } from '../../helpers/misc-utils';
|
||||||
|
import { eEthereumNetwork } from '../../helpers/types';
|
||||||
|
|
||||||
|
const CONTRACT_NAME = 'WETHGateway';
|
||||||
|
|
||||||
|
task(`full-deploy-weth-gateway`, `Deploys the ${CONTRACT_NAME} contract`)
|
||||||
|
.addParam('pool', `Pool name to retrieve configuration, supported: ${Object.values(ConfigNames)}`)
|
||||||
|
.addFlag('verify', `Verify ${CONTRACT_NAME} contract via Etherscan API.`)
|
||||||
|
.setAction(async ({ verify, pool }, localBRE) => {
|
||||||
|
await localBRE.run('set-DRE');
|
||||||
|
const network = <eEthereumNetwork>localBRE.network.name;
|
||||||
|
const Weth = AaveConfig.ReserveAssets[DRE.network.name].WETH;
|
||||||
|
const poolConfig = loadPoolConfig(pool);
|
||||||
|
const { WethGateway } = poolConfig;
|
||||||
|
|
||||||
|
if (!localBRE.network.config.chainId) {
|
||||||
|
throw new Error('INVALID_CHAIN_ID');
|
||||||
|
}
|
||||||
|
let gateWay = getParamPerNetwork(WethGateway, network);
|
||||||
|
if (gateWay === '') {
|
||||||
|
const wethGateWay = await deployWETHGateway([Weth], verify);
|
||||||
|
console.log(`${CONTRACT_NAME}.address`, wethGateWay.address);
|
||||||
|
console.log(`\tFinished ${CONTRACT_NAME} deployment`);
|
||||||
|
} else {
|
||||||
|
console.log(`Weth gateway already deployed. Address: ${gateWay}`);
|
||||||
|
}
|
||||||
|
});
|
|
@ -12,6 +12,7 @@ import {
|
||||||
getWethAddress,
|
getWethAddress,
|
||||||
getTreasuryAddress,
|
getTreasuryAddress,
|
||||||
} from '../../helpers/configuration';
|
} from '../../helpers/configuration';
|
||||||
|
import { getWETHGateway } from '../../helpers/contracts-getters';
|
||||||
import { eEthereumNetwork, ICommonConfiguration } from '../../helpers/types';
|
import { eEthereumNetwork, ICommonConfiguration } from '../../helpers/types';
|
||||||
import { waitForTx } from '../../helpers/misc-utils';
|
import { waitForTx } from '../../helpers/misc-utils';
|
||||||
import { initReservesByHelper, configureReservesByHelper } from '../../helpers/init-helpers';
|
import { initReservesByHelper, configureReservesByHelper } from '../../helpers/init-helpers';
|
||||||
|
@ -85,7 +86,11 @@ task('full:initialize-lending-pool', 'Initialize lending pool configuration.')
|
||||||
await deployWalletBalancerProvider(verify);
|
await deployWalletBalancerProvider(verify);
|
||||||
|
|
||||||
const lendingPoolAddress = await addressesProvider.getLendingPool();
|
const lendingPoolAddress = await addressesProvider.getLendingPool();
|
||||||
const gateWay = await getParamPerNetwork(WethGateway, network);
|
|
||||||
|
let gateWay = getParamPerNetwork(WethGateway, network);
|
||||||
|
if (gateWay == '') {
|
||||||
|
gateWay = (await getWETHGateway()).address;
|
||||||
|
}
|
||||||
await authorizeWETHGateway(gateWay, lendingPoolAddress);
|
await authorizeWETHGateway(gateWay, lendingPoolAddress);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
|
@ -29,15 +29,18 @@ task('aave:mainnet', 'Deploy development enviroment')
|
||||||
console.log('4. Deploy Data Provider');
|
console.log('4. Deploy Data Provider');
|
||||||
await DRE.run('full:data-provider', { pool: POOL_NAME });
|
await DRE.run('full:data-provider', { pool: POOL_NAME });
|
||||||
|
|
||||||
console.log('5. Initialize lending pool');
|
console.log('5. Deploy weth Gethway provider');
|
||||||
|
await DRE.run('full-deploy-weth-gateway', { pool: POOL_NAME });
|
||||||
|
|
||||||
|
console.log('6. Initialize lending pool');
|
||||||
await DRE.run('full:initialize-lending-pool', { pool: POOL_NAME });
|
await DRE.run('full:initialize-lending-pool', { pool: POOL_NAME });
|
||||||
|
|
||||||
if (verify) {
|
if (verify) {
|
||||||
printContracts();
|
printContracts();
|
||||||
console.log('4. Veryfing contracts');
|
console.log('7. Veryfing contracts');
|
||||||
await DRE.run('verify:general', { all: true, pool: POOL_NAME });
|
await DRE.run('verify:general', { all: true, pool: POOL_NAME });
|
||||||
|
|
||||||
console.log('5. Veryfing aTokens and debtTokens');
|
console.log('8. Veryfing aTokens and debtTokens');
|
||||||
await DRE.run('verify:tokens', { pool: POOL_NAME });
|
await DRE.run('verify:tokens', { pool: POOL_NAME });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,10 +89,7 @@ task('verify:general', 'Deploy oracles for dev enviroment')
|
||||||
|
|
||||||
// WETHGateway
|
// WETHGateway
|
||||||
console.log('\n- Verifying WETHGateway...\n');
|
console.log('\n- Verifying WETHGateway...\n');
|
||||||
await verifyContract(wethGateway.address, [
|
await verifyContract(wethGateway.address, [await getWethAddress(poolConfig)]);
|
||||||
await getWethAddress(poolConfig),
|
|
||||||
lendingPoolProxy.address,
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
// Lending Pool proxy
|
// Lending Pool proxy
|
||||||
console.log('\n- Verifying Lending Pool Proxy...\n');
|
console.log('\n- Verifying Lending Pool Proxy...\n');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user