mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Cleaned up more conf, getParanetwork working now. Added weth Gateway Matic
This commit is contained in:
parent
029a349d90
commit
e3846332db
|
@ -3,7 +3,7 @@ import fs from 'fs';
|
|||
import { HardhatUserConfig } from 'hardhat/types';
|
||||
// @ts-ignore
|
||||
import { accounts } from './test-wallets.js';
|
||||
import { eEthereumNetwork, ePolygonNetwork, eXDaiNetwork } from './helpers/types';
|
||||
import { eEthereumNetwork, eNetwork, ePolygonNetwork, eXDaiNetwork } from './helpers/types';
|
||||
import { BUIDLEREVM_CHAINID, COVERAGE_CHAINID } from './helpers/buidler-constants';
|
||||
import { NETWORKS_RPC_URL, NETWORKS_DEFAULT_GAS } from './helper-hardhat-config';
|
||||
|
||||
|
@ -41,7 +41,7 @@ if (!SKIP_LOAD) {
|
|||
|
||||
require(`${path.join(__dirname, 'tasks/misc')}/set-bre.ts`);
|
||||
|
||||
const getCommonNetworkConfig = (networkName: eEthereumNetwork | ePolygonNetwork | eXDaiNetwork, networkId: number) => ({
|
||||
const getCommonNetworkConfig = (networkName: eNetwork, networkId: number) => ({
|
||||
url: NETWORKS_RPC_URL[networkName],
|
||||
hardfork: HARDFORK,
|
||||
blockGasLimit: DEFAULT_BLOCK_GAS_LIMIT,
|
||||
|
|
|
@ -4,12 +4,12 @@ import {
|
|||
IReserveParams,
|
||||
PoolConfiguration,
|
||||
ICommonConfiguration,
|
||||
eEthereumNetwork,
|
||||
eNetwork,
|
||||
} from './types';
|
||||
import { getParamPerPool } from './contracts-helpers';
|
||||
import AaveConfig from '../markets/aave';
|
||||
import LpConfig from '../markets/lp';
|
||||
import MaticConfig from '../markets/matic'
|
||||
import MaticConfig from '../markets/matic';
|
||||
import { CommonsConfig } from '../markets/aave/commons';
|
||||
import { DRE, filterMapBy } from './misc-utils';
|
||||
import { tEthereumAddress } from './types';
|
||||
|
@ -28,9 +28,9 @@ export const loadPoolConfig = (configName: ConfigNames): PoolConfiguration => {
|
|||
case ConfigNames.Aave:
|
||||
return AaveConfig;
|
||||
case ConfigNames.Lp:
|
||||
return LpConfig;
|
||||
return LpConfig;
|
||||
case ConfigNames.Matic:
|
||||
return MaticConfig;
|
||||
return MaticConfig;
|
||||
case ConfigNames.Commons:
|
||||
return CommonsConfig;
|
||||
default:
|
||||
|
@ -51,7 +51,7 @@ export const getReservesConfigByPool = (pool: AavePools): iMultiPoolsAssets<IRes
|
|||
[AavePools.lp]: {
|
||||
...LpConfig.ReservesConfig,
|
||||
},
|
||||
[AavePools.matic] : {
|
||||
[AavePools.matic]: {
|
||||
...MaticConfig.ReservesConfig,
|
||||
},
|
||||
},
|
||||
|
@ -62,7 +62,7 @@ export const getGenesisPoolAdmin = async (
|
|||
config: ICommonConfiguration
|
||||
): Promise<tEthereumAddress> => {
|
||||
const currentNetwork = process.env.MAINNET_FORK === 'true' ? 'main' : DRE.network.name;
|
||||
const targetAddress = getParamPerNetwork(config.PoolAdmin, <eEthereumNetwork>currentNetwork);
|
||||
const targetAddress = getParamPerNetwork(config.PoolAdmin, <eNetwork>currentNetwork);
|
||||
if (targetAddress) {
|
||||
return targetAddress;
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ export const getEmergencyAdmin = async (
|
|||
config: ICommonConfiguration
|
||||
): Promise<tEthereumAddress> => {
|
||||
const currentNetwork = process.env.MAINNET_FORK === 'true' ? 'main' : DRE.network.name;
|
||||
const targetAddress = getParamPerNetwork(config.EmergencyAdmin, <eEthereumNetwork>currentNetwork);
|
||||
const targetAddress = getParamPerNetwork(config.EmergencyAdmin, <eNetwork>currentNetwork);
|
||||
if (targetAddress) {
|
||||
return targetAddress;
|
||||
}
|
||||
|
@ -92,17 +92,17 @@ export const getTreasuryAddress = async (
|
|||
config: ICommonConfiguration
|
||||
): Promise<tEthereumAddress> => {
|
||||
const currentNetwork = process.env.MAINNET_FORK === 'true' ? 'main' : DRE.network.name;
|
||||
return getParamPerNetwork(config.ReserveFactorTreasuryAddress, <eEthereumNetwork>currentNetwork);
|
||||
return getParamPerNetwork(config.ReserveFactorTreasuryAddress, <eNetwork>currentNetwork);
|
||||
};
|
||||
|
||||
export const getATokenDomainSeparatorPerNetwork = (
|
||||
network: eEthereumNetwork,
|
||||
network: eNetwork,
|
||||
config: ICommonConfiguration
|
||||
): tEthereumAddress => getParamPerNetwork<tEthereumAddress>(config.ATokenDomainSeparator, network);
|
||||
|
||||
export const getWethAddress = async (config: ICommonConfiguration) => {
|
||||
const currentNetwork = process.env.MAINNET_FORK === 'true' ? 'main' : DRE.network.name;
|
||||
const wethAddress = getParamPerNetwork(config.WETH, <eEthereumNetwork>currentNetwork);
|
||||
const wethAddress = getParamPerNetwork(config.WETH, <eNetwork>currentNetwork);
|
||||
if (wethAddress) {
|
||||
return wethAddress;
|
||||
}
|
||||
|
|
|
@ -11,6 +11,13 @@ import {
|
|||
AavePools,
|
||||
iParamsPerNetwork,
|
||||
iParamsPerPool,
|
||||
ePolygonNetwork,
|
||||
eXDaiNetwork,
|
||||
eNetwork,
|
||||
iParamsPerNetworkAll,
|
||||
iEthereumParamsPerNetwork,
|
||||
iPolygonParamsPerNetwork,
|
||||
iXDaiParamsPerNetwork,
|
||||
} from './types';
|
||||
import { MintableERC20 } from '../types/MintableERC20';
|
||||
import { Artifact } from 'hardhat/types';
|
||||
|
@ -132,10 +139,17 @@ export const linkBytecode = (artifact: BuidlerArtifact | Artifact, libraries: an
|
|||
return bytecode;
|
||||
};
|
||||
|
||||
export const getParamPerNetwork = <T>(
|
||||
{ kovan, ropsten, main, buidlerevm, coverage, tenderlyMain, matic, mumbai }: iParamsPerNetwork<T>,
|
||||
network: eEthereumNetwork
|
||||
) => {
|
||||
export const getParamPerNetwork = <T>(param: iParamsPerNetwork<T>, network: eNetwork) => {
|
||||
const {
|
||||
main,
|
||||
ropsten,
|
||||
kovan,
|
||||
coverage,
|
||||
buidlerevm,
|
||||
tenderlyMain,
|
||||
} = param as iEthereumParamsPerNetwork<T>;
|
||||
const { matic, mumbai } = param as iPolygonParamsPerNetwork<T>;
|
||||
const { xdai } = param as iXDaiParamsPerNetwork<T>;
|
||||
const MAINNET_FORK = process.env.MAINNET_FORK === 'true';
|
||||
if (MAINNET_FORK) {
|
||||
return main;
|
||||
|
@ -153,13 +167,15 @@ export const getParamPerNetwork = <T>(
|
|||
case eEthereumNetwork.ropsten:
|
||||
return ropsten;
|
||||
case eEthereumNetwork.main:
|
||||
return main;
|
||||
case eEthereumNetwork.matic:
|
||||
return matic;
|
||||
case eEthereumNetwork.mumbai:
|
||||
return mumbai;
|
||||
case eEthereumNetwork.tenderlyMain:
|
||||
return tenderlyMain;
|
||||
case ePolygonNetwork.matic:
|
||||
return matic;
|
||||
case ePolygonNetwork.mumbai:
|
||||
return mumbai;
|
||||
case eXDaiNetwork.xdai:
|
||||
return xdai;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -167,8 +183,8 @@ export const getParamPerPool = <T>({ proto, lp }: iParamsPerPool<T>, pool: AaveP
|
|||
switch (pool) {
|
||||
case AavePools.proto:
|
||||
return proto;
|
||||
case AavePools.lp:
|
||||
return lp;
|
||||
case AavePools.lp:
|
||||
return lp;
|
||||
default:
|
||||
return proto;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import {
|
||||
eContractid,
|
||||
eEthereumNetwork,
|
||||
eNetwork,
|
||||
iMultiPoolsAssets,
|
||||
IReserveParams,
|
||||
tEthereumAddress,
|
||||
|
@ -69,21 +70,21 @@ export const initReservesByHelper = async (
|
|||
let reserveSymbols: string[] = [];
|
||||
|
||||
let initInputParams: {
|
||||
aTokenImpl: string,
|
||||
stableDebtTokenImpl: string,
|
||||
variableDebtTokenImpl: string,
|
||||
underlyingAssetDecimals: BigNumberish,
|
||||
interestRateStrategyAddress: string,
|
||||
underlyingAsset: string,
|
||||
treasury: string,
|
||||
incentivesController: string,
|
||||
underlyingAssetName: string,
|
||||
aTokenName: string,
|
||||
aTokenSymbol: string,
|
||||
variableDebtTokenName: string,
|
||||
variableDebtTokenSymbol: string,
|
||||
stableDebtTokenName: string,
|
||||
stableDebtTokenSymbol: string,
|
||||
aTokenImpl: string;
|
||||
stableDebtTokenImpl: string;
|
||||
variableDebtTokenImpl: string;
|
||||
underlyingAssetDecimals: BigNumberish;
|
||||
interestRateStrategyAddress: string;
|
||||
underlyingAsset: string;
|
||||
treasury: string;
|
||||
incentivesController: string;
|
||||
underlyingAssetName: string;
|
||||
aTokenName: string;
|
||||
aTokenSymbol: string;
|
||||
variableDebtTokenName: string;
|
||||
variableDebtTokenSymbol: string;
|
||||
stableDebtTokenName: string;
|
||||
stableDebtTokenSymbol: string;
|
||||
}[] = [];
|
||||
|
||||
let strategyRates: [
|
||||
|
@ -99,10 +100,10 @@ export const initReservesByHelper = async (
|
|||
let strategyAddresses: Record<string, tEthereumAddress> = {};
|
||||
let strategyAddressPerAsset: Record<string, string> = {};
|
||||
let aTokenType: Record<string, string> = {};
|
||||
let delegationAwareATokenImplementationAddress = "";
|
||||
let aTokenImplementationAddress = "";
|
||||
let stableDebtTokenImplementationAddress = "";
|
||||
let variableDebtTokenImplementationAddress = "";
|
||||
let delegationAwareATokenImplementationAddress = '';
|
||||
let aTokenImplementationAddress = '';
|
||||
let stableDebtTokenImplementationAddress = '';
|
||||
let variableDebtTokenImplementationAddress = '';
|
||||
|
||||
// NOT WORKING ON MATIC
|
||||
// const tx1 = await waitForTx(
|
||||
|
@ -130,21 +131,20 @@ export const initReservesByHelper = async (
|
|||
if (delegatedAwareReserves.length > 0) {
|
||||
const delegationAwareATokenImplementation = await deployDelegationAwareATokenImpl(verify);
|
||||
delegationAwareATokenImplementationAddress = delegationAwareATokenImplementation.address;
|
||||
rawInsertContractAddressInDb(`delegationAwareATokenImpl`, delegationAwareATokenImplementationAddress);
|
||||
rawInsertContractAddressInDb(
|
||||
`delegationAwareATokenImpl`,
|
||||
delegationAwareATokenImplementationAddress
|
||||
);
|
||||
}
|
||||
|
||||
const reserves = Object.entries(reservesParams).filter(
|
||||
([_, { aTokenImpl }]) => aTokenImpl === eContractid.DelegationAwareAToken ||
|
||||
aTokenImpl === eContractid.AToken
|
||||
([_, { aTokenImpl }]) =>
|
||||
aTokenImpl === eContractid.DelegationAwareAToken || aTokenImpl === eContractid.AToken
|
||||
) as [string, IReserveParams][];
|
||||
|
||||
for (let [symbol, params] of reserves) {
|
||||
const { strategy, aTokenImpl, reserveDecimals } = params;
|
||||
const {
|
||||
strategy,
|
||||
aTokenImpl,
|
||||
reserveDecimals,
|
||||
} = params;
|
||||
const {
|
||||
optimalUtilizationRate,
|
||||
baseVariableBorrowRate,
|
||||
variableRateSlope1,
|
||||
|
@ -152,7 +152,7 @@ export const initReservesByHelper = async (
|
|||
stableRateSlope1,
|
||||
stableRateSlope2,
|
||||
} = strategy;
|
||||
if (!strategyAddresses[strategy.name]) {
|
||||
if (!strategyAddresses[strategy.name]) {
|
||||
// Strategy does not exist, create a new one
|
||||
rateStrategies[strategy.name] = [
|
||||
addressProvider.address,
|
||||
|
@ -163,21 +163,20 @@ export const initReservesByHelper = async (
|
|||
stableRateSlope1,
|
||||
stableRateSlope2,
|
||||
];
|
||||
strategyAddresses[strategy.name] = (await deployDefaultReserveInterestRateStrategy(
|
||||
rateStrategies[strategy.name],
|
||||
verify
|
||||
)).address;
|
||||
strategyAddresses[strategy.name] = (
|
||||
await deployDefaultReserveInterestRateStrategy(rateStrategies[strategy.name], verify)
|
||||
).address;
|
||||
// This causes the last strategy to be printed twice, once under "DefaultReserveInterestRateStrategy"
|
||||
// and once under the actual `strategyASSET` key.
|
||||
rawInsertContractAddressInDb(strategy.name, strategyAddresses[strategy.name]);
|
||||
}
|
||||
strategyAddressPerAsset[symbol] = strategyAddresses[strategy.name];
|
||||
console.log("Strategy address for asset %s: %s", symbol, strategyAddressPerAsset[symbol])
|
||||
console.log('Strategy address for asset %s: %s', symbol, strategyAddressPerAsset[symbol]);
|
||||
|
||||
if (aTokenImpl === eContractid.AToken) {
|
||||
aTokenType[symbol] = "generic";
|
||||
aTokenType[symbol] = 'generic';
|
||||
} else if (aTokenImpl === eContractid.DelegationAwareAToken) {
|
||||
aTokenType[symbol] = "delegation aware";
|
||||
aTokenType[symbol] = 'delegation aware';
|
||||
}
|
||||
|
||||
reserveInitDecimals.push(reserveDecimals);
|
||||
|
@ -185,7 +184,7 @@ export const initReservesByHelper = async (
|
|||
reserveSymbols.push(symbol);
|
||||
}
|
||||
|
||||
for (let i = 0; i < reserveSymbols.length; i ++) {
|
||||
for (let i = 0; i < reserveSymbols.length; i++) {
|
||||
let aTokenToUse: string;
|
||||
if (aTokenType[reserveSymbols[i]] === 'generic') {
|
||||
aTokenToUse = aTokenImplementationAddress;
|
||||
|
@ -195,7 +194,7 @@ export const initReservesByHelper = async (
|
|||
|
||||
initInputParams.push({
|
||||
aTokenImpl: aTokenToUse,
|
||||
stableDebtTokenImpl: stableDebtTokenImplementationAddress,
|
||||
stableDebtTokenImpl: stableDebtTokenImplementationAddress,
|
||||
variableDebtTokenImpl: variableDebtTokenImplementationAddress,
|
||||
underlyingAssetDecimals: reserveInitDecimals[i],
|
||||
interestRateStrategyAddress: strategyAddressPerAsset[reserveSymbols[i]],
|
||||
|
@ -208,7 +207,7 @@ export const initReservesByHelper = async (
|
|||
variableDebtTokenName: `${variableDebtTokenNamePrefix} ${symbolPrefix}${reserveSymbols[i]}`,
|
||||
variableDebtTokenSymbol: `variableDebt${symbolPrefix}${reserveSymbols[i]}`,
|
||||
stableDebtTokenName: `${stableDebtTokenNamePrefix} ${reserveSymbols[i]}`,
|
||||
stableDebtTokenSymbol: `stableDebt${symbolPrefix}${reserveSymbols[i]}`
|
||||
stableDebtTokenSymbol: `stableDebt${symbolPrefix}${reserveSymbols[i]}`,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -230,7 +229,7 @@ export const initReservesByHelper = async (
|
|||
//gasUsage = gasUsage.add(tx3.gasUsed);
|
||||
}
|
||||
|
||||
return gasUsage; // Deprecated
|
||||
return gasUsage; // Deprecated
|
||||
};
|
||||
|
||||
export const getPairsTokenAggregator = (
|
||||
|
@ -276,7 +275,7 @@ export const configureReservesByHelper = async (
|
|||
const reserveFactors: string[] = [];
|
||||
const stableRatesEnabled: boolean[] = [];
|
||||
|
||||
const inputParams : {
|
||||
const inputParams: {
|
||||
asset: string;
|
||||
baseLTV: BigNumberish;
|
||||
liquidationThreshold: BigNumberish;
|
||||
|
@ -319,7 +318,7 @@ export const configureReservesByHelper = async (
|
|||
liquidationThreshold: liquidationThreshold,
|
||||
liquidationBonus: liquidationBonus,
|
||||
reserveFactor: reserveFactor,
|
||||
stableBorrowingEnabled: stableBorrowRateEnabled
|
||||
stableBorrowingEnabled: stableBorrowRateEnabled,
|
||||
});
|
||||
|
||||
tokens.push(tokenAddress);
|
||||
|
@ -342,10 +341,9 @@ export const configureReservesByHelper = async (
|
|||
console.log(`- Configure reserves in ${chunkedInputParams.length} txs`);
|
||||
for (let chunkIndex = 0; chunkIndex < chunkedInputParams.length; chunkIndex++) {
|
||||
await waitForTx(
|
||||
await atokenAndRatesDeployer.configureReserves(
|
||||
chunkedInputParams[chunkIndex],
|
||||
{ gasLimit: 12000000 }
|
||||
)
|
||||
await atokenAndRatesDeployer.configureReserves(chunkedInputParams[chunkIndex], {
|
||||
gasLimit: 12000000,
|
||||
})
|
||||
);
|
||||
console.log(` - Init for: ${chunkedSymbols[chunkIndex].join(', ')}`);
|
||||
}
|
||||
|
@ -356,7 +354,7 @@ export const configureReservesByHelper = async (
|
|||
|
||||
const getAddressById = async (
|
||||
id: string,
|
||||
network: eEthereumNetwork
|
||||
network: eNetwork
|
||||
): Promise<tEthereumAddress | undefined> =>
|
||||
(await getDb().get(`${id}.${network}`).value())?.address || undefined;
|
||||
|
||||
|
@ -403,27 +401,25 @@ export const initTokenReservesByHelper = async (
|
|||
let reserveSymbols: string[] = [];
|
||||
|
||||
let initInputParams: {
|
||||
aTokenImpl: string,
|
||||
stableDebtTokenImpl: string,
|
||||
variableDebtTokenImpl: string,
|
||||
underlyingAssetDecimals: BigNumberish,
|
||||
interestRateStrategyAddress: string,
|
||||
underlyingAsset: string,
|
||||
treasury: string,
|
||||
incentivesController: string,
|
||||
underlyingAssetName: string,
|
||||
aTokenName: string,
|
||||
aTokenSymbol: string,
|
||||
variableDebtTokenName: string,
|
||||
variableDebtTokenSymbol: string,
|
||||
stableDebtTokenName: string,
|
||||
stableDebtTokenSymbol: string,
|
||||
aTokenImpl: string;
|
||||
stableDebtTokenImpl: string;
|
||||
variableDebtTokenImpl: string;
|
||||
underlyingAssetDecimals: BigNumberish;
|
||||
interestRateStrategyAddress: string;
|
||||
underlyingAsset: string;
|
||||
treasury: string;
|
||||
incentivesController: string;
|
||||
underlyingAssetName: string;
|
||||
aTokenName: string;
|
||||
aTokenSymbol: string;
|
||||
variableDebtTokenName: string;
|
||||
variableDebtTokenSymbol: string;
|
||||
stableDebtTokenName: string;
|
||||
stableDebtTokenSymbol: string;
|
||||
}[] = [];
|
||||
|
||||
const network =
|
||||
process.env.MAINNET_FORK === 'true'
|
||||
? eEthereumNetwork.main
|
||||
: (DRE.network.name as eEthereumNetwork);
|
||||
process.env.MAINNET_FORK === 'true' ? eEthereumNetwork.main : (DRE.network.name as eNetwork);
|
||||
// Grab config from DB
|
||||
for (const [symbol, address] of Object.entries(tokenAddresses)) {
|
||||
const { aTokenAddress } = await protocolDataProvider.getReserveTokensAddresses(address);
|
||||
|
@ -439,10 +435,11 @@ export const initTokenReservesByHelper = async (
|
|||
}
|
||||
let stableTokenImpl = await getAddressById(`stableDebtTokenImpl`, network);
|
||||
let variableTokenImpl = await getAddressById(`variableDebtTokenImpl`, network);
|
||||
let aTokenImplementation: string | undefined = "";
|
||||
const [, { aTokenImpl, strategy }] = (Object.entries(reservesParams) as [string, IReserveParams][])[
|
||||
reserveParamIndex
|
||||
];
|
||||
let aTokenImplementation: string | undefined = '';
|
||||
const [, { aTokenImpl, strategy }] = (Object.entries(reservesParams) as [
|
||||
string,
|
||||
IReserveParams
|
||||
][])[reserveParamIndex];
|
||||
if (aTokenImpl === eContractid.AToken) {
|
||||
aTokenImplementation = await getAddressById(`aTokenImpl`, network);
|
||||
} else if (aTokenImpl === eContractid.DelegationAwareAToken) {
|
||||
|
@ -458,7 +455,7 @@ export const initTokenReservesByHelper = async (
|
|||
tokenAddresses[symbol],
|
||||
ZERO_ADDRESS, // Incentives controller
|
||||
`Aave stable debt bearing ${symbol}`,
|
||||
`stableDebt${symbol}`
|
||||
`stableDebt${symbol}`,
|
||||
],
|
||||
verify
|
||||
);
|
||||
|
@ -471,7 +468,7 @@ export const initTokenReservesByHelper = async (
|
|||
tokenAddresses[symbol],
|
||||
ZERO_ADDRESS, // Incentives Controller
|
||||
`Aave variable debt bearing ${symbol}`,
|
||||
`variableDebt${symbol}`
|
||||
`variableDebt${symbol}`,
|
||||
],
|
||||
verify
|
||||
);
|
||||
|
@ -489,19 +486,16 @@ export const initTokenReservesByHelper = async (
|
|||
treasuryAddress,
|
||||
ZERO_ADDRESS,
|
||||
`Aave interest bearing ${symbol}`,
|
||||
`a${symbol}`
|
||||
`a${symbol}`,
|
||||
],
|
||||
verify
|
||||
);
|
||||
aTokenImplementation = aToken.address;
|
||||
}
|
||||
if (!strategyImpl) {
|
||||
const [
|
||||
,
|
||||
{
|
||||
strategy
|
||||
},
|
||||
] = (Object.entries(reservesParams) as [string, IReserveParams][])[reserveParamIndex];
|
||||
const [, { strategy }] = (Object.entries(reservesParams) as [string, IReserveParams][])[
|
||||
reserveParamIndex
|
||||
];
|
||||
const {
|
||||
optimalUtilizationRate,
|
||||
baseVariableBorrowRate,
|
||||
|
@ -543,10 +537,10 @@ export const initTokenReservesByHelper = async (
|
|||
reserveSymbols.push(symbol);
|
||||
}
|
||||
|
||||
for (let i = 0; i < deployedATokens.length; i ++) {
|
||||
for (let i = 0; i < deployedATokens.length; i++) {
|
||||
initInputParams.push({
|
||||
aTokenImpl: deployedATokens[i],
|
||||
stableDebtTokenImpl: deployedStableTokens[i],
|
||||
stableDebtTokenImpl: deployedStableTokens[i],
|
||||
variableDebtTokenImpl: deployedVariableTokens[i],
|
||||
underlyingAssetDecimals: reserveInitDecimals[i],
|
||||
interestRateStrategyAddress: deployedRates[i],
|
||||
|
@ -559,7 +553,7 @@ export const initTokenReservesByHelper = async (
|
|||
variableDebtTokenName: `Aave variable debt bearing ${reserveSymbols[i]}`,
|
||||
variableDebtTokenSymbol: `variableDebt${reserveSymbols[i]}`,
|
||||
stableDebtTokenName: `Aave stable debt bearing ${reserveSymbols[i]}`,
|
||||
stableDebtTokenSymbol: `stableDebt${reserveSymbols[i]}`
|
||||
stableDebtTokenSymbol: `stableDebt${reserveSymbols[i]}`,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -582,7 +576,7 @@ export const initTokenReservesByHelper = async (
|
|||
|
||||
// Set deployer back as admin
|
||||
await waitForTx(await addressProvider.setPoolAdmin(admin));
|
||||
return gasUsage; // No longer relevant
|
||||
return gasUsage; // No longer relevant
|
||||
};
|
||||
|
||||
// Function deprecated
|
||||
|
|
|
@ -4,6 +4,8 @@ export interface SymbolMap<T> {
|
|||
[symbol: string]: T;
|
||||
}
|
||||
|
||||
export type eNetwork = eEthereumNetwork | ePolygonNetwork | eXDaiNetwork;
|
||||
|
||||
export enum eEthereumNetwork {
|
||||
buidlerevm = 'buidlerevm',
|
||||
kovan = 'kovan',
|
||||
|
@ -16,7 +18,7 @@ export enum eEthereumNetwork {
|
|||
|
||||
export enum ePolygonNetwork {
|
||||
matic = 'matic',
|
||||
mumbai = 'mumbail',
|
||||
mumbai = 'mumbai',
|
||||
}
|
||||
|
||||
export enum eXDaiNetwork {
|
||||
|
@ -398,6 +400,11 @@ export type iParamsPerNetwork<T> =
|
|||
| iPolygonParamsPerNetwork<T>
|
||||
| iXDaiParamsPerNetwork<T>;
|
||||
|
||||
export interface iParamsPerNetworkAll<T>
|
||||
extends iEthereumParamsPerNetwork<T>,
|
||||
iPolygonParamsPerNetwork<T>,
|
||||
iXDaiParamsPerNetwork<T> {}
|
||||
|
||||
export interface iEthereumParamsPerNetwork<T> {
|
||||
[eEthereumNetwork.coverage]: T;
|
||||
[eEthereumNetwork.buidlerevm]: T;
|
||||
|
|
|
@ -97,7 +97,7 @@ export const CommonsConfig: ICommonConfiguration = {
|
|||
},
|
||||
WethGateway: {
|
||||
[ePolygonNetwork.mumbai]: '',
|
||||
[ePolygonNetwork.matic]: '',
|
||||
[ePolygonNetwork.matic]: '0x4fAfE6704a78e21Fc43C01bEb153607604F6768a',
|
||||
},
|
||||
AaveOracle: {
|
||||
[ePolygonNetwork.mumbai]: '',
|
||||
|
|
|
@ -8,7 +8,7 @@ import {
|
|||
authorizeWETHGateway,
|
||||
} from '../../helpers/contracts-deployments';
|
||||
import { getParamPerNetwork } from '../../helpers/contracts-helpers';
|
||||
import { eEthereumNetwork } from '../../helpers/types';
|
||||
import { eNetwork } from '../../helpers/types';
|
||||
import {
|
||||
ConfigNames,
|
||||
getReservesConfigByPool,
|
||||
|
@ -33,7 +33,7 @@ task('dev:initialize-lending-pool', 'Initialize lending pool configuration.')
|
|||
.addParam('pool', `Pool name to retrieve configuration, supported: ${Object.values(ConfigNames)}`)
|
||||
.setAction(async ({ verify, pool }, localBRE) => {
|
||||
await localBRE.run('set-DRE');
|
||||
const network = <eEthereumNetwork>localBRE.network.name;
|
||||
const network = <eNetwork>localBRE.network.name;
|
||||
const poolConfig = loadPoolConfig(pool);
|
||||
const {
|
||||
ATokenNamePrefix,
|
||||
|
|
|
@ -11,7 +11,7 @@ import {
|
|||
getGenesisPoolAdmin,
|
||||
getEmergencyAdmin,
|
||||
} from '../../helpers/configuration';
|
||||
import { eEthereumNetwork } from '../../helpers/types';
|
||||
import { eNetwork } from '../../helpers/types';
|
||||
import {
|
||||
getFirstSigner,
|
||||
getLendingPoolAddressesProviderRegistry,
|
||||
|
@ -31,7 +31,7 @@ task(
|
|||
.setAction(async ({ verify, pool }, DRE) => {
|
||||
await DRE.run('set-DRE');
|
||||
let signer: Signer;
|
||||
const network = <eEthereumNetwork>DRE.network.name;
|
||||
const network = <eNetwork>DRE.network.name;
|
||||
const poolConfig = loadPoolConfig(pool);
|
||||
const { ProviderId, MarketId } = poolConfig;
|
||||
|
||||
|
@ -81,7 +81,7 @@ task(
|
|||
|
||||
// 2. Deploy address provider and set genesis manager
|
||||
const addressesProvider = await deployLendingPoolAddressesProvider(MarketId, verify);
|
||||
|
||||
|
||||
// DISABLE SEC. 3 FOR GOVERNANCE USE!
|
||||
// 3. Set the provider at the Registry
|
||||
await waitForTx(
|
||||
|
@ -92,7 +92,7 @@ task(
|
|||
);
|
||||
|
||||
// 4. Set pool admins
|
||||
|
||||
|
||||
await waitForTx(await addressesProvider.setPoolAdmin(await getGenesisPoolAdmin(poolConfig)));
|
||||
await waitForTx(await addressesProvider.setEmergencyAdmin(await getEmergencyAdmin(poolConfig)));
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import {
|
|||
deployLendingPoolConfigurator,
|
||||
deployStableAndVariableTokensHelper,
|
||||
} from '../../helpers/contracts-deployments';
|
||||
import { eContractid, eEthereumNetwork } from '../../helpers/types';
|
||||
import { eContractid, eNetwork } from '../../helpers/types';
|
||||
import { notFalsyOrZeroAddress, waitForTx } from '../../helpers/misc-utils';
|
||||
import {
|
||||
getLendingPoolAddressesProvider,
|
||||
|
@ -22,20 +22,20 @@ task('full:deploy-lending-pool', 'Deploy lending pool for dev enviroment')
|
|||
.setAction(async ({ verify, pool }, DRE: HardhatRuntimeEnvironment) => {
|
||||
try {
|
||||
await DRE.run('set-DRE');
|
||||
const network = <eEthereumNetwork>DRE.network.name;
|
||||
const poolConfig = loadPoolConfig(pool)
|
||||
const network = <eNetwork>DRE.network.name;
|
||||
const poolConfig = loadPoolConfig(pool);
|
||||
const addressesProvider = await getLendingPoolAddressesProvider();
|
||||
|
||||
|
||||
const { LendingPool, LendingPoolConfigurator } = poolConfig;
|
||||
|
||||
// Reuse/deploy lending pool implementation
|
||||
let lendingPoolImplAddress = getParamPerNetwork(LendingPool, network)
|
||||
let lendingPoolImplAddress = getParamPerNetwork(LendingPool, network);
|
||||
if (!notFalsyOrZeroAddress(lendingPoolImplAddress)) {
|
||||
console.log("\tDeploying new lending pool implementation & libraries...");
|
||||
console.log('\tDeploying new lending pool implementation & libraries...');
|
||||
const lendingPoolImpl = await deployLendingPool(verify);
|
||||
lendingPoolImplAddress = lendingPoolImpl.address;
|
||||
}
|
||||
console.log("\tSetting lending pool implementation with address:" , lendingPoolImplAddress);
|
||||
console.log('\tSetting lending pool implementation with address:', lendingPoolImplAddress);
|
||||
// Set lending pool impl to Address provider
|
||||
await waitForTx(await addressesProvider.setLendingPoolImpl(lendingPoolImplAddress));
|
||||
|
||||
|
@ -47,11 +47,14 @@ task('full:deploy-lending-pool', 'Deploy lending pool for dev enviroment')
|
|||
// Reuse/deploy lending pool configurator
|
||||
let lendingPoolConfiguratorImplAddress = getParamPerNetwork(LendingPoolConfigurator, network); //await deployLendingPoolConfigurator(verify);
|
||||
if (!notFalsyOrZeroAddress(lendingPoolConfiguratorImplAddress)) {
|
||||
console.log("\tDeploying new configurator implementation...");
|
||||
console.log('\tDeploying new configurator implementation...');
|
||||
const lendingPoolConfiguratorImpl = await deployLendingPoolConfigurator(verify);
|
||||
lendingPoolConfiguratorImplAddress = lendingPoolConfiguratorImpl.address;
|
||||
}
|
||||
console.log("\tSetting lending pool configurator implementation with address:" , lendingPoolConfiguratorImplAddress);
|
||||
console.log(
|
||||
'\tSetting lending pool configurator implementation with address:',
|
||||
lendingPoolConfiguratorImplAddress
|
||||
);
|
||||
// Set lending pool conf impl to Address Provider
|
||||
await waitForTx(
|
||||
await addressesProvider.setLendingPoolConfiguratorImpl(lendingPoolConfiguratorImplAddress)
|
||||
|
|
|
@ -2,7 +2,7 @@ import { task } from 'hardhat/config';
|
|||
import { getParamPerNetwork } from '../../helpers/contracts-helpers';
|
||||
import { deployAaveOracle, deployLendingRateOracle } from '../../helpers/contracts-deployments';
|
||||
import { setInitialMarketRatesInRatesOracleByHelper } from '../../helpers/oracles-helpers';
|
||||
import { ICommonConfiguration, eEthereumNetwork, SymbolMap } from '../../helpers/types';
|
||||
import { ICommonConfiguration, eNetwork, SymbolMap } from '../../helpers/types';
|
||||
import { waitForTx, notFalsyOrZeroAddress } from '../../helpers/misc-utils';
|
||||
import {
|
||||
ConfigNames,
|
||||
|
@ -25,7 +25,7 @@ task('full:deploy-oracles', 'Deploy oracles for dev enviroment')
|
|||
.setAction(async ({ verify, pool }, DRE) => {
|
||||
try {
|
||||
await DRE.run('set-DRE');
|
||||
const network = <eEthereumNetwork>DRE.network.name;
|
||||
const network = <eNetwork>DRE.network.name;
|
||||
const poolConfig = loadPoolConfig(pool);
|
||||
const {
|
||||
ProtocolGlobalParams: { UsdAddress },
|
||||
|
@ -56,7 +56,7 @@ task('full:deploy-oracles', 'Deploy oracles for dev enviroment')
|
|||
aaveOracle = await deployAaveOracle(
|
||||
[tokens, aggregators, fallbackOracleAddress, await getWethAddress(poolConfig)],
|
||||
verify
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
const lendingRateOracle = notFalsyOrZeroAddress(lendingRateOracleAddress)
|
||||
|
@ -73,7 +73,7 @@ task('full:deploy-oracles', 'Deploy oracles for dev enviroment')
|
|||
admin
|
||||
);
|
||||
//}
|
||||
console.log("ORACLES: %s and %s", aaveOracle.address, lendingRateOracle.address);
|
||||
console.log('ORACLES: %s and %s', aaveOracle.address, lendingRateOracle.address);
|
||||
// Register the proxy price provider on the addressesProvider
|
||||
await waitForTx(await addressesProvider.setPriceOracle(aaveOracle.address));
|
||||
await waitForTx(await addressesProvider.setLendingRateOracle(lendingRateOracle.address));
|
||||
|
|
|
@ -4,7 +4,7 @@ import { getParamPerNetwork } from '../../helpers/contracts-helpers';
|
|||
import { loadPoolConfig, ConfigNames, getWethAddress } from '../../helpers/configuration';
|
||||
import { deployWETHGateway } from '../../helpers/contracts-deployments';
|
||||
import { DRE } from '../../helpers/misc-utils';
|
||||
import { eEthereumNetwork } from '../../helpers/types';
|
||||
import { eNetwork } from '../../helpers/types';
|
||||
|
||||
const CONTRACT_NAME = 'WETHGateway';
|
||||
|
||||
|
@ -13,7 +13,7 @@ task(`full-deploy-weth-gateway`, `Deploys the ${CONTRACT_NAME} contract`)
|
|||
.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 network = <eNetwork>localBRE.network.name;
|
||||
const poolConfig = loadPoolConfig(pool);
|
||||
const Weth = await getWethAddress(poolConfig);
|
||||
const { WethGateway } = poolConfig;
|
||||
|
|
|
@ -13,7 +13,7 @@ import {
|
|||
getTreasuryAddress,
|
||||
} from '../../helpers/configuration';
|
||||
import { getWETHGateway } from '../../helpers/contracts-getters';
|
||||
import { eEthereumNetwork, ICommonConfiguration } from '../../helpers/types';
|
||||
import { eNetwork, ICommonConfiguration } from '../../helpers/types';
|
||||
import { notFalsyOrZeroAddress, waitForTx } from '../../helpers/misc-utils';
|
||||
import { initReservesByHelper, configureReservesByHelper } from '../../helpers/init-helpers';
|
||||
import { exit } from 'process';
|
||||
|
@ -29,7 +29,7 @@ task('full:initialize-lending-pool', 'Initialize lending pool configuration.')
|
|||
.setAction(async ({ verify, pool }, localBRE) => {
|
||||
try {
|
||||
await localBRE.run('set-DRE');
|
||||
const network = <eEthereumNetwork>localBRE.network.name;
|
||||
const network = <eNetwork>localBRE.network.name;
|
||||
const poolConfig = loadPoolConfig(pool);
|
||||
const {
|
||||
ATokenNamePrefix,
|
||||
|
@ -79,7 +79,10 @@ task('full:initialize-lending-pool', 'Initialize lending pool configuration.')
|
|||
}
|
||||
// Seems unnecessary to register the collateral manager in the JSON db
|
||||
|
||||
console.log("\tSetting lending pool collateral manager implementation with address", collateralManagerAddress);
|
||||
console.log(
|
||||
'\tSetting lending pool collateral manager implementation with address',
|
||||
collateralManagerAddress
|
||||
);
|
||||
await waitForTx(
|
||||
await addressesProvider.setLendingPoolCollateralManager(collateralManagerAddress)
|
||||
);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { task } from 'hardhat/config';
|
||||
import { EthereumNetwork } from '../../helpers/types';
|
||||
import { eEthereumNetwork } from '../../helpers/types';
|
||||
import { getTreasuryAddress } from '../../helpers/configuration';
|
||||
import * as marketConfigs from '../../markets/aave';
|
||||
import * as reserveConfigs from '../../markets/aave/reservesConfigs';
|
||||
|
@ -18,7 +18,7 @@ const LENDING_POOL_ADDRESS_PROVIDER = {
|
|||
kovan: '0x652B2937Efd0B5beA1c8d54293FC1289672AFC6b',
|
||||
};
|
||||
|
||||
const isSymbolValid = (symbol: string, network: EthereumNetwork) =>
|
||||
const isSymbolValid = (symbol: string, network: eEthereumNetwork) =>
|
||||
Object.keys(reserveConfigs).includes('strategy' + symbol) &&
|
||||
marketConfigs.AaveConfig.ReserveAssets[network][symbol] &&
|
||||
marketConfigs.AaveConfig.ReservesConfig[symbol] === reserveConfigs['strategy' + symbol];
|
||||
|
@ -28,7 +28,7 @@ task('external:deploy-new-asset', 'Deploy A token, Debt Tokens, Risk Parameters'
|
|||
.addFlag('verify', 'Verify contracts at Etherscan')
|
||||
.setAction(async ({ verify, symbol }, localBRE) => {
|
||||
const network = localBRE.network.name;
|
||||
if (!isSymbolValid(symbol, network as EthereumNetwork)) {
|
||||
if (!isSymbolValid(symbol, network as eEthereumNetwork)) {
|
||||
throw new Error(
|
||||
`
|
||||
WRONG RESERVE ASSET SETUP:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { task } from 'hardhat/config';
|
||||
import { getParamPerNetwork } from '../../helpers/contracts-helpers';
|
||||
import { loadPoolConfig, ConfigNames, getTreasuryAddress } from '../../helpers/configuration';
|
||||
import { eEthereumNetwork, ICommonConfiguration } from '../../helpers/types';
|
||||
import { eEthereumNetwork, eNetwork, ICommonConfiguration } from '../../helpers/types';
|
||||
import { waitForTx } from '../../helpers/misc-utils';
|
||||
import { initTokenReservesByHelper } from '../../helpers/init-helpers';
|
||||
import { exit } from 'process';
|
||||
|
@ -23,9 +23,7 @@ task('full:initialize-tokens', 'Initialize lending pool configuration.')
|
|||
await DRE.run('set-DRE');
|
||||
let signer: Signer;
|
||||
const network =
|
||||
process.env.MAINNET_FORK === 'true'
|
||||
? eEthereumNetwork.main
|
||||
: <eEthereumNetwork>DRE.network.name;
|
||||
process.env.MAINNET_FORK === 'true' ? eEthereumNetwork.main : <eNetwork>DRE.network.name;
|
||||
const poolConfig = loadPoolConfig(pool);
|
||||
const { ReserveAssets, ReservesConfig } = poolConfig as ICommonConfiguration;
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import {
|
|||
} from '../../helpers/contracts-getters';
|
||||
import { getParamPerNetwork } from '../../helpers/contracts-helpers';
|
||||
import { DRE } from '../../helpers/misc-utils';
|
||||
import { eEthereumNetwork } from '../../helpers/types';
|
||||
import { eEthereumNetwork, eNetwork, ePolygonNetwork, eXDaiNetwork } from '../../helpers/types';
|
||||
|
||||
task('print-config', 'Inits the DRE, to have access to all the plugins')
|
||||
.addParam('dataProvider', 'Address of AaveProtocolDataProvider')
|
||||
|
@ -17,7 +17,7 @@ task('print-config', 'Inits the DRE, to have access to all the plugins')
|
|||
const network =
|
||||
process.env.MAINNET_FORK === 'true'
|
||||
? eEthereumNetwork.main
|
||||
: (localBRE.network.name as eEthereumNetwork);
|
||||
: (localBRE.network.name as eNetwork);
|
||||
const poolConfig = loadPoolConfig(pool);
|
||||
|
||||
const providerRegistryAddress = getParamPerNetwork(poolConfig.ProviderRegistry, network);
|
||||
|
|
|
@ -25,14 +25,14 @@ import {
|
|||
import { getParamPerNetwork } from '../../helpers/contracts-helpers';
|
||||
import { verifyContract } from '../../helpers/etherscan-verification';
|
||||
import { notFalsyOrZeroAddress } from '../../helpers/misc-utils';
|
||||
import { eEthereumNetwork, ICommonConfiguration } from '../../helpers/types';
|
||||
import { eNetwork, ICommonConfiguration } from '../../helpers/types';
|
||||
|
||||
task('verify:general', 'Verify contracts at Etherscan')
|
||||
.addFlag('all', 'Verify all contracts at Etherscan')
|
||||
.addParam('pool', `Pool name to retrieve configuration, supported: ${Object.values(ConfigNames)}`)
|
||||
.setAction(async ({ all, pool }, localDRE) => {
|
||||
await localDRE.run('set-DRE');
|
||||
const network = localDRE.network.name as eEthereumNetwork;
|
||||
const network = localDRE.network.name as eNetwork;
|
||||
const poolConfig = loadPoolConfig(pool);
|
||||
const {
|
||||
ReserveAssets,
|
||||
|
@ -52,7 +52,7 @@ task('verify:general', 'Verify contracts at Etherscan')
|
|||
? await getLendingPoolAddressesProviderRegistry(registryAddress)
|
||||
: await getLendingPoolAddressesProviderRegistry();
|
||||
const lendingPoolAddress = await addressesProvider.getLendingPool();
|
||||
const lendingPoolConfiguratorAddress = await addressesProvider.getLendingPoolConfigurator();//getLendingPoolConfiguratorProxy();
|
||||
const lendingPoolConfiguratorAddress = await addressesProvider.getLendingPoolConfigurator(); //getLendingPoolConfiguratorProxy();
|
||||
const lendingPoolCollateralManagerAddress = await addressesProvider.getLendingPoolCollateralManager();
|
||||
|
||||
if (all) {
|
||||
|
@ -61,13 +61,21 @@ task('verify:general', 'Verify contracts at Etherscan')
|
|||
? await getLendingPoolImpl(lendingPoolImplAddress)
|
||||
: await getLendingPoolImpl();
|
||||
|
||||
const lendingPoolConfiguratorImplAddress = getParamPerNetwork(LendingPoolConfigurator, network);
|
||||
const lendingPoolConfiguratorImplAddress = getParamPerNetwork(
|
||||
LendingPoolConfigurator,
|
||||
network
|
||||
);
|
||||
const lendingPoolConfiguratorImpl = notFalsyOrZeroAddress(lendingPoolConfiguratorImplAddress)
|
||||
? await getLendingPoolConfiguratorImpl(lendingPoolConfiguratorImplAddress)
|
||||
: await getLendingPoolConfiguratorImpl();
|
||||
|
||||
const lendingPoolCollateralManagerImplAddress = getParamPerNetwork(LendingPoolCollateralManager, network);
|
||||
const lendingPoolCollateralManagerImpl = notFalsyOrZeroAddress(lendingPoolCollateralManagerImplAddress)
|
||||
const lendingPoolCollateralManagerImplAddress = getParamPerNetwork(
|
||||
LendingPoolCollateralManager,
|
||||
network
|
||||
);
|
||||
const lendingPoolCollateralManagerImpl = notFalsyOrZeroAddress(
|
||||
lendingPoolCollateralManagerImplAddress
|
||||
)
|
||||
? await getLendingPoolCollateralManagerImpl(lendingPoolCollateralManagerImplAddress)
|
||||
: await getLendingPoolCollateralManagerImpl();
|
||||
|
||||
|
|
|
@ -15,24 +15,24 @@ import {
|
|||
} from '../../helpers/contracts-getters';
|
||||
import { getParamPerNetwork } from '../../helpers/contracts-helpers';
|
||||
import { verifyContract } from '../../helpers/etherscan-verification';
|
||||
import { eEthereumNetwork, ICommonConfiguration, IReserveParams } from '../../helpers/types';
|
||||
import { eNetwork, ICommonConfiguration, IReserveParams } from '../../helpers/types';
|
||||
import { LendingPoolConfiguratorFactory, LendingPoolFactory } from '../../types';
|
||||
|
||||
task('verify:tokens', 'Deploy oracles for dev enviroment')
|
||||
.addParam('pool', `Pool name to retrieve configuration, supported: ${Object.values(ConfigNames)}`)
|
||||
.setAction(async ({ verify, all, pool }, localDRE) => {
|
||||
await localDRE.run('set-DRE');
|
||||
const network = localDRE.network.name as eEthereumNetwork;
|
||||
const network = localDRE.network.name as eNetwork;
|
||||
const poolConfig = loadPoolConfig(pool);
|
||||
const { ReserveAssets, ReservesConfig } = poolConfig as ICommonConfiguration;
|
||||
const treasuryAddress = await getTreasuryAddress(poolConfig);
|
||||
|
||||
const addressesProvider = await getLendingPoolAddressesProvider();
|
||||
const lendingPoolProxy = LendingPoolFactory.connect(
|
||||
await addressesProvider.getLendingPool(),
|
||||
await addressesProvider.getLendingPool(),
|
||||
await getFirstSigner()
|
||||
);
|
||||
|
||||
|
||||
const lendingPoolConfigurator = LendingPoolConfiguratorFactory.connect(
|
||||
await addressesProvider.getLendingPoolConfigurator(),
|
||||
await getFirstSigner()
|
||||
|
|
|
@ -28,7 +28,6 @@ import {
|
|||
deployFlashLiquidationAdapter,
|
||||
authorizeWETHGateway,
|
||||
} from '../../helpers/contracts-deployments';
|
||||
import { eEthereumNetwork } from '../../helpers/types';
|
||||
import { Signer } from 'ethers';
|
||||
import { TokenContractId, eContractid, tEthereumAddress, AavePools } from '../../helpers/types';
|
||||
import { MintableERC20 } from '../../types/MintableERC20';
|
||||
|
|
|
@ -3,7 +3,7 @@ import { BUIDLEREVM_CHAINID } from '../../helpers/buidler-constants';
|
|||
import { buildPermitParams, getSignatureFromTypedData } from '../../helpers/contracts-helpers';
|
||||
import { expect } from 'chai';
|
||||
import { ethers } from 'ethers';
|
||||
import { eEthereumNetwork, ProtocolErrors } from '../../helpers/types';
|
||||
import { ProtocolErrors } from '../../helpers/types';
|
||||
import { makeSuite, TestEnv } from './helpers/make-suite';
|
||||
import { DRE } from '../../helpers/misc-utils';
|
||||
import {
|
||||
|
@ -35,10 +35,17 @@ makeSuite('AToken: underlying delegation', (testEnv: TestEnv) => {
|
|||
delegationERC20 = await deployMintableDelegationERC20(['DEL', 'DEL', '18']);
|
||||
|
||||
delegationAToken = await deployDelegationAwareAToken(
|
||||
[pool.address, delegationERC20.address, await getTreasuryAddress(AaveConfig), ZERO_ADDRESS, 'aDEL', 'aDEL'],
|
||||
[
|
||||
pool.address,
|
||||
delegationERC20.address,
|
||||
await getTreasuryAddress(AaveConfig),
|
||||
ZERO_ADDRESS,
|
||||
'aDEL',
|
||||
'aDEL',
|
||||
],
|
||||
false
|
||||
);
|
||||
|
||||
|
||||
//await delegationAToken.initialize(pool.address, ZERO_ADDRESS, delegationERC20.address, ZERO_ADDRESS, '18', 'aDEL', 'aDEL');
|
||||
|
||||
console.log((await delegationAToken.decimals()).toString());
|
||||
|
|
Loading…
Reference in New Issue
Block a user