Support marketId argument

This commit is contained in:
David Racero 2020-11-26 16:11:40 +01:00
parent fa11327b59
commit 43712d8a2b
7 changed files with 23 additions and 22 deletions

View File

@ -65,11 +65,11 @@ const readArtifact = async (id: string) => {
} }
return (DRE as HardhatRuntimeEnvironment).artifacts.readArtifact(id); return (DRE as HardhatRuntimeEnvironment).artifacts.readArtifact(id);
}; };
export const deployLendingPoolAddressesProvider = async (verify?: boolean) => export const deployLendingPoolAddressesProvider = async (marketId: string, verify?: boolean) =>
withSaveAndVerify( withSaveAndVerify(
await new LendingPoolAddressesProviderFactory(await getFirstSigner()).deploy(), await new LendingPoolAddressesProviderFactory(await getFirstSigner()).deploy(marketId),
eContractid.LendingPoolAddressesProvider, eContractid.LendingPoolAddressesProvider,
[], [marketId],
verify verify
); );

View File

@ -345,7 +345,7 @@ export interface ILendingRate {
} }
export interface ICommonConfiguration { export interface ICommonConfiguration {
ConfigName: string; MarketId: string;
ProviderId: number; ProviderId: number;
ProtocolGlobalParams: IProtocolGlobalConfig; ProtocolGlobalParams: IProtocolGlobalConfig;
Mocks: IMocksConfig; Mocks: IMocksConfig;

View File

@ -30,7 +30,7 @@ const MOCK_CHAINLINK_AGGREGATORS_PRICES = {
// ---------------- // ----------------
export const CommonsConfig: ICommonConfiguration = { export const CommonsConfig: ICommonConfiguration = {
ConfigName: 'Commons', MarketId: 'Commons',
ProviderId: 0, ProviderId: 0,
ProtocolGlobalParams: { ProtocolGlobalParams: {
TokenDistributorPercentageBase: '10000', TokenDistributorPercentageBase: '10000',

View File

@ -29,7 +29,7 @@ import {
export const AaveConfig: IAaveConfiguration = { export const AaveConfig: IAaveConfiguration = {
...CommonsConfig, ...CommonsConfig,
ConfigName: 'Aave', MarketId: 'Aave genesis market',
ProviderId: 1, ProviderId: 1,
ReservesConfig: { ReservesConfig: {
AAVE: strategyAAVE, AAVE: strategyAAVE,

View File

@ -4,6 +4,7 @@ import {
deployLendingPoolAddressesProviderRegistry, deployLendingPoolAddressesProviderRegistry,
} from '../../helpers/contracts-deployments'; } from '../../helpers/contracts-deployments';
import { waitForTx } from '../../helpers/misc-utils'; import { waitForTx } from '../../helpers/misc-utils';
import { AaveConfig } from '../../markets/aave';
task( task(
'dev:deploy-address-provider', 'dev:deploy-address-provider',
@ -15,7 +16,7 @@ task(
const admin = await (await localBRE.ethers.getSigners())[0].getAddress(); const admin = await (await localBRE.ethers.getSigners())[0].getAddress();
const addressesProvider = await deployLendingPoolAddressesProvider(verify); const addressesProvider = await deployLendingPoolAddressesProvider(AaveConfig.MarketId, verify);
await waitForTx(await addressesProvider.setPoolAdmin(admin)); await waitForTx(await addressesProvider.setPoolAdmin(admin));
const addressesProviderRegistry = await deployLendingPoolAddressesProviderRegistry(verify); const addressesProviderRegistry = await deployLendingPoolAddressesProviderRegistry(verify);

View File

@ -25,11 +25,11 @@ task(
const network = <eEthereumNetwork>DRE.network.name; const network = <eEthereumNetwork>DRE.network.name;
const poolConfig = loadPoolConfig(pool); const poolConfig = loadPoolConfig(pool);
const {ProviderId} = poolConfig; const { ProviderId, MarketId } = poolConfig;
const providerRegistryAddress = getParamPerNetwork(poolConfig.ProviderRegistry, network); const providerRegistryAddress = getParamPerNetwork(poolConfig.ProviderRegistry, network);
// Deploy address provider and set genesis manager // Deploy address provider and set genesis manager
const addressesProvider = await deployLendingPoolAddressesProvider(verify); const addressesProvider = await deployLendingPoolAddressesProvider(MarketId, verify);
await waitForTx(await addressesProvider.setPoolAdmin(await getGenesisPoolAdmin(poolConfig))); await waitForTx(await addressesProvider.setPoolAdmin(await getGenesisPoolAdmin(poolConfig)));
await waitForTx(await addressesProvider.setEmergencyAdmin(await getEmergencyAdmin(poolConfig))); await waitForTx(await addressesProvider.setEmergencyAdmin(await getEmergencyAdmin(poolConfig)));

View File

@ -91,7 +91,7 @@ const buildTestEnv = async (deployer: Signer, secondaryWallet: Signer) => {
const mockTokens = await deployAllMockTokens(deployer); const mockTokens = await deployAllMockTokens(deployer);
const addressesProvider = await deployLendingPoolAddressesProvider(); const addressesProvider = await deployLendingPoolAddressesProvider(AaveConfig.MarketId);
await waitForTx(await addressesProvider.setPoolAdmin(aaveAdmin)); await waitForTx(await addressesProvider.setPoolAdmin(aaveAdmin));
//setting users[1] as emergency admin, which is in position 2 in the DRE addresses list //setting users[1] as emergency admin, which is in position 2 in the DRE addresses list