Testing mumbai network deployment, Oracles fail

This commit is contained in:
Zer0dot 2021-02-19 18:50:24 -05:00
parent 51ea7364e1
commit 379761b56f
7 changed files with 74 additions and 7 deletions

View File

@ -9,6 +9,7 @@ import {
import { getParamPerPool } from './contracts-helpers'; import { getParamPerPool } from './contracts-helpers';
import AaveConfig from '../markets/aave'; import AaveConfig from '../markets/aave';
import LpConfig from '../markets/lp'; import LpConfig from '../markets/lp';
import MaticConfig from '../markets/matic'
import { CommonsConfig } from '../markets/aave/commons'; import { CommonsConfig } from '../markets/aave/commons';
import { DRE, filterMapBy } from './misc-utils'; import { DRE, filterMapBy } from './misc-utils';
import { tEthereumAddress } from './types'; import { tEthereumAddress } from './types';
@ -19,6 +20,7 @@ export enum ConfigNames {
Commons = 'Commons', Commons = 'Commons',
Aave = 'Aave', Aave = 'Aave',
Lp = 'Lp', Lp = 'Lp',
Matic = 'Matic',
} }
export const loadPoolConfig = (configName: ConfigNames): PoolConfiguration => { export const loadPoolConfig = (configName: ConfigNames): PoolConfiguration => {
@ -27,6 +29,8 @@ export const loadPoolConfig = (configName: ConfigNames): PoolConfiguration => {
return AaveConfig; return AaveConfig;
case ConfigNames.Lp: case ConfigNames.Lp:
return LpConfig; return LpConfig;
case ConfigNames.Matic:
return MaticConfig;
case ConfigNames.Commons: case ConfigNames.Commons:
return CommonsConfig; return CommonsConfig;
default: default:
@ -47,6 +51,9 @@ export const getReservesConfigByPool = (pool: AavePools): iMultiPoolsAssets<IRes
[AavePools.lp]: { [AavePools.lp]: {
...LpConfig.ReservesConfig, ...LpConfig.ReservesConfig,
}, },
[AavePools.matic] : {
...MaticConfig.ReservesConfig,
},
}, },
pool pool
); );

View File

@ -133,7 +133,7 @@ export const linkBytecode = (artifact: BuidlerArtifact | Artifact, libraries: an
}; };
export const getParamPerNetwork = <T>( export const getParamPerNetwork = <T>(
{ kovan, ropsten, main, buidlerevm, coverage, tenderlyMain }: iParamsPerNetwork<T>, { kovan, ropsten, main, buidlerevm, coverage, tenderlyMain, matic, mumbai }: iParamsPerNetwork<T>,
network: eEthereumNetwork network: eEthereumNetwork
) => { ) => {
const MAINNET_FORK = process.env.MAINNET_FORK === 'true'; const MAINNET_FORK = process.env.MAINNET_FORK === 'true';
@ -154,6 +154,10 @@ export const getParamPerNetwork = <T>(
return ropsten; return ropsten;
case eEthereumNetwork.main: case eEthereumNetwork.main:
return main; return main;
case eEthereumNetwork.matic:
return matic;
case eEthereumNetwork.mumbai:
return mumbai;
case eEthereumNetwork.tenderlyMain: case eEthereumNetwork.tenderlyMain:
return tenderlyMain; return tenderlyMain;
} }

View File

@ -20,11 +20,14 @@ export enum EthereumNetworkNames {
kovan = 'kovan', kovan = 'kovan',
ropsten = 'ropsten', ropsten = 'ropsten',
main = 'main', main = 'main',
matic = 'matic',
mumbai = 'mumbai',
} }
export enum AavePools { export enum AavePools {
proto = 'proto', proto = 'proto',
lp = 'lp', lp = 'lp',
matic = 'matic',
} }
export enum eContractid { export enum eContractid {
@ -394,6 +397,7 @@ export interface iParamsPerNetwork<T> {
export interface iParamsPerPool<T> { export interface iParamsPerPool<T> {
[AavePools.proto]: T; [AavePools.proto]: T;
[AavePools.lp]: T; [AavePools.lp]: T;
[AavePools.matic]: T;
} }
export interface iBasicDistributionParams { export interface iBasicDistributionParams {

View File

@ -134,7 +134,7 @@ export const CommonsConfig: ICommonConfiguration = {
[eEthereumNetwork.hardhat]: '', [eEthereumNetwork.hardhat]: '',
[eEthereumNetwork.buidlerevm]: '', [eEthereumNetwork.buidlerevm]: '',
[eEthereumNetwork.tenderlyMain]: '0x52D306e36E3B6B02c153d0266ff0f85d18BCD413', [eEthereumNetwork.tenderlyMain]: '0x52D306e36E3B6B02c153d0266ff0f85d18BCD413',
[eEthereumNetwork.mumbai]: '', [eEthereumNetwork.mumbai]: '0x569859d41499B4dDC28bfaA43915051FF0A38a6F', // TEMP
[eEthereumNetwork.matic]: '', [eEthereumNetwork.matic]: '',
}, },
ProviderRegistryOwner: { ProviderRegistryOwner: {
@ -145,7 +145,7 @@ export const CommonsConfig: ICommonConfiguration = {
[eEthereumNetwork.hardhat]: '', [eEthereumNetwork.hardhat]: '',
[eEthereumNetwork.buidlerevm]: '', [eEthereumNetwork.buidlerevm]: '',
[eEthereumNetwork.tenderlyMain]: '0xbd723fc4f1d737dcfc48a07fe7336766d34cad5f', [eEthereumNetwork.tenderlyMain]: '0xbd723fc4f1d737dcfc48a07fe7336766d34cad5f',
[eEthereumNetwork.mumbai]: '', [eEthereumNetwork.mumbai]: '0x18d9bA2baEfBdE0FF137C4ad031427EF205f1Fd9', // TEMP
[eEthereumNetwork.matic]: '', [eEthereumNetwork.matic]: '',
}, },
LendingRateOracle: { LendingRateOracle: {
@ -271,7 +271,7 @@ export const CommonsConfig: ICommonConfiguration = {
[eEthereumNetwork.ropsten]: '0x464c71f6c2f760dda6093dcb91c24c39e5d6e18c', [eEthereumNetwork.ropsten]: '0x464c71f6c2f760dda6093dcb91c24c39e5d6e18c',
[eEthereumNetwork.main]: '0x464c71f6c2f760dda6093dcb91c24c39e5d6e18c', [eEthereumNetwork.main]: '0x464c71f6c2f760dda6093dcb91c24c39e5d6e18c',
[eEthereumNetwork.tenderlyMain]: '0x464c71f6c2f760dda6093dcb91c24c39e5d6e18c', [eEthereumNetwork.tenderlyMain]: '0x464c71f6c2f760dda6093dcb91c24c39e5d6e18c',
[EthereumNetwork.mumbai]: ZERO_ADDRESS, // TEMP [EthereumNetwork.mumbai]: '0x464c71f6c2f760dda6093dcb91c24c39e5d6e18c', // TEMP
[EthereumNetwork.matic]: ZERO_ADDRESS, // TEMP [EthereumNetwork.matic]: '0x464c71f6c2f760dda6093dcb91c24c39e5d6e18c', // TEMP
}, },
}; };

View File

@ -15,7 +15,7 @@ import {
// POOL--SPECIFIC PARAMS // POOL--SPECIFIC PARAMS
// ---------------- // ----------------
export const AaveConfig: IMaticConfiguration = { export const MaticConfig: IMaticConfiguration = {
...CommonsConfig, ...CommonsConfig,
MarketId: 'Matic Market', MarketId: 'Matic Market',
ProviderId: 3, // Unknown? ProviderId: 3, // Unknown?
@ -68,4 +68,4 @@ export const AaveConfig: IMaticConfiguration = {
}, },
}; };
export default AaveConfig; export default MaticConfig;

View File

@ -14,6 +14,7 @@
"hardhat:ropsten": "hardhat--network ropsten", "hardhat:ropsten": "hardhat--network ropsten",
"hardhat:main": "hardhat --network main", "hardhat:main": "hardhat --network main",
"hardhat:docker": "hardhat --network hardhatevm_docker", "hardhat:docker": "hardhat --network hardhatevm_docker",
"hardhat:mumbai": "hardhat --network mumbai",
"compile": "SKIP_LOAD=true hardhat compile", "compile": "SKIP_LOAD=true hardhat compile",
"console:fork": "MAINNET_FORK=true hardhat console", "console:fork": "MAINNET_FORK=true hardhat console",
"test": "TS_NODE_TRANSPILE_ONLY=1 hardhat test ./test-suites/test-aave/*.spec.ts", "test": "TS_NODE_TRANSPILE_ONLY=1 hardhat test ./test-suites/test-aave/*.spec.ts",
@ -40,6 +41,7 @@
"aave:docker:full:migration": "npm run compile && npm run hardhat:docker -- aave:mainnet", "aave:docker:full:migration": "npm run compile && npm run hardhat:docker -- aave:mainnet",
"aave:kovan:full:migration": "npm run compile && npm run hardhat:kovan -- aave:mainnet --verify", "aave:kovan:full:migration": "npm run compile && npm run hardhat:kovan -- aave:mainnet --verify",
"lp:kovan:full:migration": "npm run compile && npm run hardhat:kovan -- lp:mainnet --verify", "lp:kovan:full:migration": "npm run compile && npm run hardhat:kovan -- lp:mainnet --verify",
"matic:mumbai:full:migration": "npm run compile && npm run hardhat:mumbai matic:mainnet",
"aave:kovan:full:initialize": "npm run hardhat:kovan -- full:initialize-lending-pool --verify --pool Aave", "aave:kovan:full:initialize": "npm run hardhat:kovan -- full:initialize-lending-pool --verify --pool Aave",
"aave:ropsten:full:migration": "npm run compile && npm run hardhat:ropsten -- aave:mainnet --verify", "aave:ropsten:full:migration": "npm run compile && npm run hardhat:ropsten -- aave:mainnet --verify",
"aave:fork:main:tenderly": "npm run compile && npm run hardhat:tenderly-main -- aave:mainnet", "aave:fork:main:tenderly": "npm run compile && npm run hardhat:tenderly-main -- aave:mainnet",

View File

@ -0,0 +1,50 @@
import { task } from 'hardhat/config';
import { checkVerification } from '../../helpers/etherscan-verification';
import { ConfigNames } from '../../helpers/configuration';
import { printContracts } from '../../helpers/misc-utils';
import { usingTenderly } from '../../helpers/tenderly-utils';
task('matic:mainnet', 'Deploy development enviroment')
.addFlag('verify', 'Verify contracts at Etherscan')
.setAction(async ({ verify }, DRE) => {
const POOL_NAME = ConfigNames.Matic;
await DRE.run('set-DRE');
// Prevent loss of gas verifying all the needed ENVs for Etherscan verification
if (verify) {
checkVerification();
}
console.log('Migration started\n');
console.log('1. Deploy address provider');
await DRE.run('full:deploy-address-provider', { pool: POOL_NAME });
console.log('2. Deploy lending pool');
await DRE.run('full:deploy-lending-pool');
console.log('3. Deploy oracles');
await DRE.run('full:deploy-oracles', { pool: POOL_NAME });
console.log('4. Deploy Data Provider');
await DRE.run('full:data-provider', { pool: POOL_NAME });
console.log('5. Initialize lending pool');
await DRE.run('full:initialize-lending-pool', { pool: POOL_NAME });
if (verify) {
printContracts();
console.log('4. Veryfing contracts');
await DRE.run('verify:general', { all: true, pool: POOL_NAME });
console.log('5. Veryfing aTokens and debtTokens');
await DRE.run('verify:tokens', { pool: POOL_NAME });
}
if (usingTenderly()) {
const postDeployHead = DRE.tenderlyRPC.getHead();
console.log('Tenderly UUID', postDeployHead);
}
console.log('\nFinished migrations');
printContracts();
});