Added full script and config for kovan

This commit is contained in:
Hadrien Charlanes 2021-02-22 14:58:16 +01:00
parent da2ade5d3b
commit 18aac08061
7 changed files with 25414 additions and 155 deletions

View File

@ -169,7 +169,7 @@ export const CommonsConfig: ICommonConfiguration = {
[eEthereumNetwork.coverage]: '',
[eEthereumNetwork.hardhat]: '',
[eEthereumNetwork.buidlerevm]: '',
[eEthereumNetwork.kovan]: '',
[eEthereumNetwork.kovan]: '0xf99b8E67a0E044734B01EC4586D1c88C9a869718',
[eEthereumNetwork.ropsten]: '',
[eEthereumNetwork.main]: '',
[eEthereumNetwork.tenderlyMain]: '',

25493
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -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`);
});

View 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}`);
}
});

View File

@ -12,6 +12,7 @@ import {
getWethAddress,
getTreasuryAddress,
} from '../../helpers/configuration';
import { getWETHGateway } from '../../helpers/contracts-getters';
import { eEthereumNetwork, ICommonConfiguration } from '../../helpers/types';
import { waitForTx } from '../../helpers/misc-utils';
import { initReservesByHelper, configureReservesByHelper } from '../../helpers/init-helpers';
@ -85,7 +86,11 @@ task('full:initialize-lending-pool', 'Initialize lending pool configuration.')
await deployWalletBalancerProvider(verify);
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);
} catch (err) {
console.error(err);

View File

@ -29,15 +29,18 @@ task('aave:mainnet', 'Deploy development enviroment')
console.log('4. Deploy Data Provider');
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 });
if (verify) {
printContracts();
console.log('4. Veryfing contracts');
console.log('7. Veryfing contracts');
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 });
}

View File

@ -89,10 +89,7 @@ task('verify:general', 'Deploy oracles for dev enviroment')
// WETHGateway
console.log('\n- Verifying WETHGateway...\n');
await verifyContract(wethGateway.address, [
await getWethAddress(poolConfig),
lendingPoolProxy.address,
]);
await verifyContract(wethGateway.address, [await getWethAddress(poolConfig)]);
}
// Lending Pool proxy
console.log('\n- Verifying Lending Pool Proxy...\n');