mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
20 lines
688 B
TypeScript
20 lines
688 B
TypeScript
|
import {BRE} from './misc-utils';
|
||
|
import {ICommonConfiguration, eEthereumNetwork} from './types';
|
||
|
import {getParamPerNetwork} from './contracts-helpers';
|
||
|
|
||
|
export const getGenesisLendingPoolManagerAddress = async (config: ICommonConfiguration) => {
|
||
|
const currentNetwork = BRE.network.name;
|
||
|
const targetAddress = getParamPerNetwork(
|
||
|
config.LendingPoolManagerAddress,
|
||
|
<eEthereumNetwork>currentNetwork
|
||
|
);
|
||
|
if (targetAddress) {
|
||
|
return targetAddress;
|
||
|
}
|
||
|
const addressList = await Promise.all(
|
||
|
(await BRE.ethers.getSigners()).map((signer) => signer.getAddress())
|
||
|
);
|
||
|
const addressIndex = config.LendingPoolManagerAddressIndex;
|
||
|
return addressList[addressIndex];
|
||
|
};
|