mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Removed dev task
This commit is contained in:
parent
84d95038a0
commit
36e5642f24
|
@ -1,241 +1,241 @@
|
||||||
import { Contract } from 'ethers';
|
// import { Contract } from 'ethers';
|
||||||
import { DRE } from './misc-utils';
|
// import { DRE } from './misc-utils';
|
||||||
import {
|
// import {
|
||||||
tEthereumAddress,
|
// tEthereumAddress,
|
||||||
eContractid,
|
// eContractid,
|
||||||
tStringTokenSmallUnits,
|
// tStringTokenSmallUnits,
|
||||||
AavePools,
|
// AavePools,
|
||||||
TokenContractId,
|
// TokenContractId,
|
||||||
iMultiPoolsAssets,
|
// iMultiPoolsAssets,
|
||||||
IReserveParams,
|
// IReserveParams,
|
||||||
PoolConfiguration,
|
// PoolConfiguration,
|
||||||
eEthereumNetwork,
|
// eEthereumNetwork,
|
||||||
} from './types';
|
// } from './types';
|
||||||
|
|
||||||
import { MintableERC20 } from '../types/MintableERC20';
|
// import { MintableERC20 } from '../types/MintableERC20';
|
||||||
import { MockContract } from 'ethereum-waffle';
|
// import { MockContract } from 'ethereum-waffle';
|
||||||
import { getReservesConfigByPool } from './configuration';
|
// import { getReservesConfigByPool } from './configuration';
|
||||||
import { getFirstSigner } from './contracts-getters';
|
// import { getFirstSigner } from './contracts-getters';
|
||||||
import { ZERO_ADDRESS } from './constants';
|
// import { ZERO_ADDRESS } from './constants';
|
||||||
import {
|
// import {
|
||||||
AaveProtocolDataProviderFactory,
|
// AaveProtocolDataProviderFactory,
|
||||||
ATokenFactory,
|
// ATokenFactory,
|
||||||
ATokensAndRatesHelperFactory,
|
// ATokensAndRatesHelperFactory,
|
||||||
AaveOracleFactory,
|
// AaveOracleFactory,
|
||||||
DefaultReserveInterestRateStrategyFactory,
|
// DefaultReserveInterestRateStrategyFactory,
|
||||||
DelegationAwareATokenFactory,
|
// DelegationAwareATokenFactory,
|
||||||
InitializableAdminUpgradeabilityProxyFactory,
|
// InitializableAdminUpgradeabilityProxyFactory,
|
||||||
LendingPoolAddressesProviderFactory,
|
// LendingPoolAddressesProviderFactory,
|
||||||
LendingPoolAddressesProviderRegistryFactory,
|
// LendingPoolAddressesProviderRegistryFactory,
|
||||||
LendingPoolCollateralManagerFactory,
|
// LendingPoolCollateralManagerFactory,
|
||||||
LendingPoolConfiguratorFactory,
|
// LendingPoolConfiguratorFactory,
|
||||||
LendingPoolFactory,
|
// LendingPoolFactory,
|
||||||
LendingRateOracleFactory,
|
// LendingRateOracleFactory,
|
||||||
MintableDelegationERC20Factory,
|
// MintableDelegationERC20Factory,
|
||||||
MintableERC20Factory,
|
// MintableERC20Factory,
|
||||||
MockAggregatorFactory,
|
// MockAggregatorFactory,
|
||||||
MockATokenFactory,
|
// MockATokenFactory,
|
||||||
MockFlashLoanReceiverFactory,
|
// MockFlashLoanReceiverFactory,
|
||||||
MockStableDebtTokenFactory,
|
// MockStableDebtTokenFactory,
|
||||||
MockVariableDebtTokenFactory,
|
// MockVariableDebtTokenFactory,
|
||||||
PriceOracleFactory,
|
// PriceOracleFactory,
|
||||||
ReserveLogicFactory,
|
// ReserveLogicFactory,
|
||||||
SelfdestructTransferFactory,
|
// SelfdestructTransferFactory,
|
||||||
StableDebtTokenFactory,
|
// StableDebtTokenFactory,
|
||||||
VariableDebtTokenFactory,
|
// VariableDebtTokenFactory,
|
||||||
WalletBalanceProviderFactory,
|
// WalletBalanceProviderFactory,
|
||||||
WETH9MockedFactory,
|
// WETH9MockedFactory,
|
||||||
WETHGatewayFactory,
|
// WETHGatewayFactory,
|
||||||
} from '../types';
|
// } from '../types';
|
||||||
import {
|
// import {
|
||||||
withSaveAndVerify,
|
// withSaveAndVerify,
|
||||||
registerContractInJsonDb,
|
// registerContractInJsonDb,
|
||||||
linkBytecode,
|
// linkBytecode,
|
||||||
insertContractAddressInDb,
|
// insertContractAddressInDb,
|
||||||
} from './contracts-helpers';
|
// } from './contracts-helpers';
|
||||||
import { StableAndVariableTokensHelperFactory } from '../types/StableAndVariableTokensHelperFactory';
|
// import { StableAndVariableTokensHelperFactory } from '../types/StableAndVariableTokensHelperFactory';
|
||||||
import { MintableDelegationERC20 } from '../types/MintableDelegationERC20';
|
// import { MintableDelegationERC20 } from '../types/MintableDelegationERC20';
|
||||||
import { readArtifact as buidlerReadArtifact } from '@nomiclabs/buidler/plugins';
|
// import { readArtifact as buidlerReadArtifact } from '@nomiclabs/buidler/plugins';
|
||||||
import { HardhatRuntimeEnvironment } from 'hardhat/types';
|
// import { HardhatRuntimeEnvironment } from 'hardhat/types';
|
||||||
import { LendingPoolLibraryAddresses } from '../types/LendingPoolFactory';
|
// import { LendingPoolLibraryAddresses } from '../types/LendingPoolFactory';
|
||||||
|
|
||||||
const readArtifact = async (id: string) => {
|
// const readArtifact = async (id: string) => {
|
||||||
if (DRE.network.name === eEthereumNetwork.buidlerevm) {
|
// if (DRE.network.name === eEthereumNetwork.buidlerevm) {
|
||||||
return buidlerReadArtifact(DRE.config.paths.artifacts, id);
|
// return buidlerReadArtifact(DRE.config.paths.artifacts, id);
|
||||||
}
|
// }
|
||||||
return (DRE as HardhatRuntimeEnvironment).artifacts.readArtifact(id);
|
// return (DRE as HardhatRuntimeEnvironment).artifacts.readArtifact(id);
|
||||||
};
|
// };
|
||||||
|
|
||||||
export const deployUniswapLendingPoolAddressesProvider = async (marketId: string, verify?: boolean) =>
|
// export const deployUniswapLendingPoolAddressesProvider = async (marketId: string, verify?: boolean) =>
|
||||||
withSaveAndVerify(
|
// withSaveAndVerify(
|
||||||
await new LendingPoolAddressesProviderFactory(await getFirstSigner()).deploy(marketId),
|
// await new LendingPoolAddressesProviderFactory(await getFirstSigner()).deploy(marketId),
|
||||||
eContractid.UniswapLendingPoolAddressesProvider,
|
// eContractid.UniswapLendingPoolAddressesProvider,
|
||||||
[marketId],
|
// [marketId],
|
||||||
verify
|
// verify
|
||||||
);
|
// );
|
||||||
|
|
||||||
export const deployUniswapLendingPoolConfigurator = async (verify?: boolean) => {
|
// export const deployUniswapLendingPoolConfigurator = async (verify?: boolean) => {
|
||||||
const lendingPoolConfiguratorImpl = await new LendingPoolConfiguratorFactory(
|
// const lendingPoolConfiguratorImpl = await new LendingPoolConfiguratorFactory(
|
||||||
await getFirstSigner()
|
// await getFirstSigner()
|
||||||
).deploy();
|
// ).deploy();
|
||||||
await insertContractAddressInDb(
|
// await insertContractAddressInDb(
|
||||||
eContractid.UniswapLendingPoolConfiguratorImpl,
|
// eContractid.UniswapLendingPoolConfiguratorImpl,
|
||||||
lendingPoolConfiguratorImpl.address
|
// lendingPoolConfiguratorImpl.address
|
||||||
);
|
// );
|
||||||
return withSaveAndVerify(
|
// return withSaveAndVerify(
|
||||||
lendingPoolConfiguratorImpl,
|
// lendingPoolConfiguratorImpl,
|
||||||
eContractid.UniswapLendingPoolConfigurator,
|
// eContractid.UniswapLendingPoolConfigurator,
|
||||||
[],
|
// [],
|
||||||
verify
|
// verify
|
||||||
);
|
// );
|
||||||
};
|
// };
|
||||||
|
|
||||||
export const deployUniswapLendingPool = async (verify?: boolean) => {
|
// export const deployUniswapLendingPool = async (verify?: boolean) => {
|
||||||
const libraries = await deployAaveLibraries(verify);
|
// const libraries = await deployAaveLibraries(verify);
|
||||||
const lendingPoolImpl = await new LendingPoolFactory(libraries, await getFirstSigner()).deploy();
|
// const lendingPoolImpl = await new LendingPoolFactory(libraries, await getFirstSigner()).deploy();
|
||||||
await insertContractAddressInDb(eContractid.UniswapLendingPoolImpl, lendingPoolImpl.address);
|
// await insertContractAddressInDb(eContractid.UniswapLendingPoolImpl, lendingPoolImpl.address);
|
||||||
return withSaveAndVerify(lendingPoolImpl, eContractid.LendingPool, [], verify);
|
// return withSaveAndVerify(lendingPoolImpl, eContractid.LendingPool, [], verify);
|
||||||
};
|
// };
|
||||||
|
|
||||||
export const deployReserveLogicLibrary = async (verify?: boolean) =>
|
// export const deployReserveLogicLibrary = async (verify?: boolean) =>
|
||||||
withSaveAndVerify(
|
// withSaveAndVerify(
|
||||||
await new ReserveLogicFactory(await getFirstSigner()).deploy(),
|
// await new ReserveLogicFactory(await getFirstSigner()).deploy(),
|
||||||
eContractid.ReserveLogic,
|
// eContractid.ReserveLogic,
|
||||||
[],
|
// [],
|
||||||
verify
|
// verify
|
||||||
);
|
// );
|
||||||
|
|
||||||
export const deployGenericLogic = async (reserveLogic: Contract, verify?: boolean) => {
|
// export const deployGenericLogic = async (reserveLogic: Contract, verify?: boolean) => {
|
||||||
const genericLogicArtifact = await readArtifact(eContractid.GenericLogic);
|
// const genericLogicArtifact = await readArtifact(eContractid.GenericLogic);
|
||||||
|
|
||||||
const linkedGenericLogicByteCode = linkBytecode(genericLogicArtifact, {
|
// const linkedGenericLogicByteCode = linkBytecode(genericLogicArtifact, {
|
||||||
[eContractid.ReserveLogic]: reserveLogic.address,
|
// [eContractid.ReserveLogic]: reserveLogic.address,
|
||||||
});
|
// });
|
||||||
|
|
||||||
const genericLogicFactory = await DRE.ethers.getContractFactory(
|
// const genericLogicFactory = await DRE.ethers.getContractFactory(
|
||||||
genericLogicArtifact.abi,
|
// genericLogicArtifact.abi,
|
||||||
linkedGenericLogicByteCode
|
// linkedGenericLogicByteCode
|
||||||
);
|
// );
|
||||||
|
|
||||||
const genericLogic = await (await genericLogicFactory.deploy()).deployed();
|
// const genericLogic = await (await genericLogicFactory.deploy()).deployed();
|
||||||
return withSaveAndVerify(genericLogic, eContractid.GenericLogic, [], verify);
|
// return withSaveAndVerify(genericLogic, eContractid.GenericLogic, [], verify);
|
||||||
};
|
// };
|
||||||
|
|
||||||
export const deployValidationLogic = async (
|
// export const deployValidationLogic = async (
|
||||||
reserveLogic: Contract,
|
// reserveLogic: Contract,
|
||||||
genericLogic: Contract,
|
// genericLogic: Contract,
|
||||||
verify?: boolean
|
// verify?: boolean
|
||||||
) => {
|
// ) => {
|
||||||
const validationLogicArtifact = await readArtifact(eContractid.ValidationLogic);
|
// const validationLogicArtifact = await readArtifact(eContractid.ValidationLogic);
|
||||||
|
|
||||||
const linkedValidationLogicByteCode = linkBytecode(validationLogicArtifact, {
|
// const linkedValidationLogicByteCode = linkBytecode(validationLogicArtifact, {
|
||||||
[eContractid.ReserveLogic]: reserveLogic.address,
|
// [eContractid.ReserveLogic]: reserveLogic.address,
|
||||||
[eContractid.GenericLogic]: genericLogic.address,
|
// [eContractid.GenericLogic]: genericLogic.address,
|
||||||
});
|
// });
|
||||||
|
|
||||||
const validationLogicFactory = await DRE.ethers.getContractFactory(
|
// const validationLogicFactory = await DRE.ethers.getContractFactory(
|
||||||
validationLogicArtifact.abi,
|
// validationLogicArtifact.abi,
|
||||||
linkedValidationLogicByteCode
|
// linkedValidationLogicByteCode
|
||||||
);
|
// );
|
||||||
|
|
||||||
const validationLogic = await (await validationLogicFactory.deploy()).deployed();
|
// const validationLogic = await (await validationLogicFactory.deploy()).deployed();
|
||||||
|
|
||||||
return withSaveAndVerify(validationLogic, eContractid.ValidationLogic, [], verify);
|
// return withSaveAndVerify(validationLogic, eContractid.ValidationLogic, [], verify);
|
||||||
};
|
// };
|
||||||
|
|
||||||
export const deployAaveLibraries = async (
|
// export const deployAaveLibraries = async (
|
||||||
verify?: boolean
|
// verify?: boolean
|
||||||
): Promise<LendingPoolLibraryAddresses> => {
|
// ): Promise<LendingPoolLibraryAddresses> => {
|
||||||
const reserveLogic = await deployReserveLogicLibrary(verify);
|
// const reserveLogic = await deployReserveLogicLibrary(verify);
|
||||||
const genericLogic = await deployGenericLogic(reserveLogic, verify);
|
// const genericLogic = await deployGenericLogic(reserveLogic, verify);
|
||||||
const validationLogic = await deployValidationLogic(reserveLogic, genericLogic, verify);
|
// const validationLogic = await deployValidationLogic(reserveLogic, genericLogic, verify);
|
||||||
|
|
||||||
// Hardcoded solidity placeholders, if any library changes path this will fail.
|
// // Hardcoded solidity placeholders, if any library changes path this will fail.
|
||||||
// The '__$PLACEHOLDER$__ can be calculated via solidity keccak, but the LendingPoolLibraryAddresses Type seems to
|
// // The '__$PLACEHOLDER$__ can be calculated via solidity keccak, but the LendingPoolLibraryAddresses Type seems to
|
||||||
// require a hardcoded string.
|
// // require a hardcoded string.
|
||||||
//
|
// //
|
||||||
// how-to:
|
// // how-to:
|
||||||
// 1. PLACEHOLDER = solidityKeccak256(['string'], `${libPath}:${libName}`).slice(2, 36)
|
// // 1. PLACEHOLDER = solidityKeccak256(['string'], `${libPath}:${libName}`).slice(2, 36)
|
||||||
// 2. LIB_PLACEHOLDER = `__$${PLACEHOLDER}$__`
|
// // 2. LIB_PLACEHOLDER = `__$${PLACEHOLDER}$__`
|
||||||
// or grab placeholdes from LendingPoolLibraryAddresses at Typechain generation.
|
// // or grab placeholdes from LendingPoolLibraryAddresses at Typechain generation.
|
||||||
//
|
// //
|
||||||
// libPath example: contracts/libraries/logic/GenericLogic.sol
|
// // libPath example: contracts/libraries/logic/GenericLogic.sol
|
||||||
// libName example: GenericLogic
|
// // libName example: GenericLogic
|
||||||
return {
|
// return {
|
||||||
['__$de8c0cf1a7d7c36c802af9a64fb9d86036$__']: validationLogic.address,
|
// ['__$de8c0cf1a7d7c36c802af9a64fb9d86036$__']: validationLogic.address,
|
||||||
['__$22cd43a9dda9ce44e9b92ba393b88fb9ac$__']: reserveLogic.address,
|
// ['__$22cd43a9dda9ce44e9b92ba393b88fb9ac$__']: reserveLogic.address,
|
||||||
};
|
// };
|
||||||
};
|
// };
|
||||||
|
|
||||||
export const deployUniswapPriceOracle = async (verify?: boolean) =>
|
// export const deployUniswapPriceOracle = async (verify?: boolean) =>
|
||||||
withSaveAndVerify(
|
// withSaveAndVerify(
|
||||||
await new PriceOracleFactory(await getFirstSigner()).deploy(),
|
// await new PriceOracleFactory(await getFirstSigner()).deploy(),
|
||||||
eContractid.UniswapPriceOracle,
|
// eContractid.UniswapPriceOracle,
|
||||||
[],
|
// [],
|
||||||
verify
|
// verify
|
||||||
);
|
// );
|
||||||
|
|
||||||
export const deployUniswapLendingRateOracle = async (verify?: boolean) =>
|
// export const deployUniswapLendingRateOracle = async (verify?: boolean) =>
|
||||||
withSaveAndVerify(
|
// withSaveAndVerify(
|
||||||
await new LendingRateOracleFactory(await getFirstSigner()).deploy(),
|
// await new LendingRateOracleFactory(await getFirstSigner()).deploy(),
|
||||||
eContractid.UniswapLendingRateOracle,
|
// eContractid.UniswapLendingRateOracle,
|
||||||
[],
|
// [],
|
||||||
verify
|
// verify
|
||||||
);
|
// );
|
||||||
|
|
||||||
export const deployUniswapAaveOracle = async (
|
// export const deployUniswapAaveOracle = async (
|
||||||
args: [tEthereumAddress[], tEthereumAddress[], tEthereumAddress, tEthereumAddress],
|
// args: [tEthereumAddress[], tEthereumAddress[], tEthereumAddress, tEthereumAddress],
|
||||||
verify?: boolean
|
// verify?: boolean
|
||||||
) =>
|
// ) =>
|
||||||
withSaveAndVerify(
|
// withSaveAndVerify(
|
||||||
await new AaveOracleFactory(await getFirstSigner()).deploy(...args),
|
// await new AaveOracleFactory(await getFirstSigner()).deploy(...args),
|
||||||
eContractid.UniswapAaveOracle,
|
// eContractid.UniswapAaveOracle,
|
||||||
args,
|
// args,
|
||||||
verify
|
// verify
|
||||||
);
|
// );
|
||||||
|
|
||||||
export const deployUniswapLendingPoolCollateralManager = async (verify?: boolean) => {
|
// export const deployUniswapLendingPoolCollateralManager = async (verify?: boolean) => {
|
||||||
const collateralManagerImpl = await new LendingPoolCollateralManagerFactory(
|
// const collateralManagerImpl = await new LendingPoolCollateralManagerFactory(
|
||||||
await getFirstSigner()
|
// await getFirstSigner()
|
||||||
).deploy();
|
// ).deploy();
|
||||||
await insertContractAddressInDb(
|
// await insertContractAddressInDb(
|
||||||
eContractid.UniswapLendingPoolCollateralManagerImpl,
|
// eContractid.UniswapLendingPoolCollateralManagerImpl,
|
||||||
collateralManagerImpl.address
|
// collateralManagerImpl.address
|
||||||
);
|
// );
|
||||||
return withSaveAndVerify(
|
// return withSaveAndVerify(
|
||||||
collateralManagerImpl,
|
// collateralManagerImpl,
|
||||||
eContractid.UniswapLendingPoolCollateralManager,
|
// eContractid.UniswapLendingPoolCollateralManager,
|
||||||
[],
|
// [],
|
||||||
verify
|
// verify
|
||||||
);
|
// );
|
||||||
};
|
// };
|
||||||
|
|
||||||
export const deployUniswapMockFlashLoanReceiver = async (
|
// export const deployUniswapMockFlashLoanReceiver = async (
|
||||||
addressesProvider: tEthereumAddress,
|
// addressesProvider: tEthereumAddress,
|
||||||
verify?: boolean
|
// verify?: boolean
|
||||||
) =>
|
// ) =>
|
||||||
withSaveAndVerify(
|
// withSaveAndVerify(
|
||||||
await new MockFlashLoanReceiverFactory(await getFirstSigner()).deploy(addressesProvider),
|
// await new MockFlashLoanReceiverFactory(await getFirstSigner()).deploy(addressesProvider),
|
||||||
eContractid.UniswapMockFlashLoanReceiver,
|
// eContractid.UniswapMockFlashLoanReceiver,
|
||||||
[addressesProvider],
|
// [addressesProvider],
|
||||||
verify
|
// verify
|
||||||
);
|
// );
|
||||||
|
|
||||||
export const deployUniswapWalletBalancerProvider = async (verify?: boolean) =>
|
// export const deployUniswapWalletBalancerProvider = async (verify?: boolean) =>
|
||||||
withSaveAndVerify(
|
// withSaveAndVerify(
|
||||||
await new WalletBalanceProviderFactory(await getFirstSigner()).deploy(),
|
// await new WalletBalanceProviderFactory(await getFirstSigner()).deploy(),
|
||||||
eContractid.UniswapWalletBalanceProvider,
|
// eContractid.UniswapWalletBalanceProvider,
|
||||||
[],
|
// [],
|
||||||
verify
|
// verify
|
||||||
);
|
// );
|
||||||
|
|
||||||
export const deployUniswapWETHGateway = async (
|
// export const deployUniswapWETHGateway = async (
|
||||||
args: [tEthereumAddress, tEthereumAddress],
|
// args: [tEthereumAddress, tEthereumAddress],
|
||||||
verify?: boolean
|
// verify?: boolean
|
||||||
) =>
|
// ) =>
|
||||||
withSaveAndVerify(
|
// withSaveAndVerify(
|
||||||
await new WETHGatewayFactory(await getFirstSigner()).deploy(...args),
|
// await new WETHGatewayFactory(await getFirstSigner()).deploy(...args),
|
||||||
eContractid.UniswapWETHGateway,
|
// eContractid.UniswapWETHGateway,
|
||||||
args,
|
// args,
|
||||||
verify
|
// verify
|
||||||
);
|
// );
|
||||||
|
|
|
@ -1,323 +1,323 @@
|
||||||
import { task } from 'hardhat/config';
|
// import { task } from 'hardhat/config';
|
||||||
import {
|
// import {
|
||||||
deployATokensAndRatesHelper,
|
// deployATokensAndRatesHelper,
|
||||||
deployStableAndVariableTokensHelper,
|
// deployStableAndVariableTokensHelper,
|
||||||
deployAaveProtocolDataProvider,
|
// deployAaveProtocolDataProvider,
|
||||||
deployLendingPoolAddressesProvider, //Test
|
// deployLendingPoolAddressesProvider, //Test
|
||||||
} from '../../helpers/contracts-deployments';
|
// } from '../../helpers/contracts-deployments';
|
||||||
import {
|
// import {
|
||||||
deployUniswapLendingPoolAddressesProvider,
|
// deployUniswapLendingPoolAddressesProvider,
|
||||||
deployUniswapLendingPool,
|
// deployUniswapLendingPool,
|
||||||
deployUniswapLendingPoolConfigurator,
|
// deployUniswapLendingPoolConfigurator,
|
||||||
deployUniswapPriceOracle,
|
// deployUniswapPriceOracle,
|
||||||
deployUniswapAaveOracle,
|
// deployUniswapAaveOracle,
|
||||||
deployUniswapLendingRateOracle,
|
// deployUniswapLendingRateOracle,
|
||||||
deployUniswapLendingPoolCollateralManager,
|
// deployUniswapLendingPoolCollateralManager,
|
||||||
deployUniswapMockFlashLoanReceiver,
|
// deployUniswapMockFlashLoanReceiver,
|
||||||
deployUniswapWETHGateway,
|
// deployUniswapWETHGateway,
|
||||||
deployUniswapWalletBalancerProvider,
|
// deployUniswapWalletBalancerProvider,
|
||||||
} from '../../helpers/uniswap-contracts-deployments';
|
// } from '../../helpers/uniswap-contracts-deployments';
|
||||||
import { tEthereumAddress,
|
// import { tEthereumAddress,
|
||||||
eContractid,
|
// eContractid,
|
||||||
AavePools,
|
// AavePools,
|
||||||
ICommonConfiguration,
|
// ICommonConfiguration,
|
||||||
iAssetBase,
|
// iAssetBase,
|
||||||
TokenContractId,
|
// TokenContractId,
|
||||||
IMarketRates,
|
// IMarketRates,
|
||||||
} from '../../helpers/types';
|
// } from '../../helpers/types';
|
||||||
import {
|
// import {
|
||||||
getLendingPoolAddressesProviderRegistry,
|
// getLendingPoolAddressesProviderRegistry,
|
||||||
getLendingPoolAddressesProvider, //Test
|
// getLendingPoolAddressesProvider, //Test
|
||||||
getLendingPool,
|
// getLendingPool,
|
||||||
getLendingPoolConfiguratorProxy,
|
// getLendingPoolConfiguratorProxy,
|
||||||
getAllMockedTokens,
|
// getAllMockedTokens,
|
||||||
getPairsTokenAggregator,
|
// getPairsTokenAggregator,
|
||||||
} from '../../helpers/contracts-getters';
|
// } from '../../helpers/contracts-getters';
|
||||||
import { waitForTx, filterMapBy } from '../../helpers/misc-utils';
|
// import { waitForTx, filterMapBy } from '../../helpers/misc-utils';
|
||||||
import { UniswapConfig } from '../../markets/uniswap';
|
// import { UniswapConfig } from '../../markets/uniswap';
|
||||||
import { insertContractAddressInDb } from '../../helpers/contracts-helpers';
|
// import { insertContractAddressInDb } from '../../helpers/contracts-helpers';
|
||||||
import {
|
// import {
|
||||||
setInitialAssetPricesInOracle,
|
// setInitialAssetPricesInOracle,
|
||||||
deployAllMockAggregators,
|
// deployAllMockAggregators,
|
||||||
setInitialMarketRatesInRatesOracleByHelper,
|
// setInitialMarketRatesInRatesOracleByHelper,
|
||||||
} from '../../helpers/oracles-helpers';
|
// } from '../../helpers/oracles-helpers';
|
||||||
import {getAllAggregatorsAddresses, getAllTokenAddresses} from '../../helpers/mock-helpers';
|
// import {getAllAggregatorsAddresses, getAllTokenAddresses} from '../../helpers/mock-helpers';
|
||||||
import {
|
// import {
|
||||||
ConfigNames,
|
// ConfigNames,
|
||||||
getReservesConfigByPool,
|
// getReservesConfigByPool,
|
||||||
getTreasuryAddress,
|
// getTreasuryAddress,
|
||||||
loadPoolConfig,
|
// loadPoolConfig,
|
||||||
getWethAddress,
|
// getWethAddress,
|
||||||
} from '../../helpers/configuration';
|
// } from '../../helpers/configuration';
|
||||||
import {
|
// import {
|
||||||
configureReservesByHelper,
|
// configureReservesByHelper,
|
||||||
initReservesByHelper,
|
// initReservesByHelper,
|
||||||
} from '../../helpers/init-helpers';
|
// } from '../../helpers/init-helpers';
|
||||||
import { ZERO_ADDRESS } from '../../helpers/constants';
|
// import { ZERO_ADDRESS } from '../../helpers/constants';
|
||||||
|
|
||||||
|
|
||||||
const pool = ConfigNames.Uniswap;
|
// const pool = ConfigNames.Uniswap;
|
||||||
/**
|
// /**
|
||||||
* @dev addressesProvider is actually created here, so we don't need to use getAddressesProvider
|
// * @dev addressesProvider is actually created here, so we don't need to use getAddressesProvider
|
||||||
*/
|
// */
|
||||||
task(
|
// task(
|
||||||
'dev:deploy-uniswap-market',
|
// 'dev:deploy-uniswap-market',
|
||||||
'Deploy uniswap market'
|
// 'Deploy uniswap market'
|
||||||
)
|
// )
|
||||||
.addFlag('verify', 'Verify contracts at Etherscan')
|
// .addFlag('verify', 'Verify contracts at Etherscan')
|
||||||
.setAction(async ({ verify }, localBRE) => {
|
// .setAction(async ({ verify }, localBRE) => {
|
||||||
await localBRE.run('set-DRE');
|
// await localBRE.run('set-DRE');
|
||||||
|
|
||||||
const admin = await (await localBRE.ethers.getSigners())[0].getAddress();
|
// const admin = await (await localBRE.ethers.getSigners())[0].getAddress();
|
||||||
|
|
||||||
const testProvider = await getLendingPoolAddressesProvider();
|
// const testProvider = await getLendingPoolAddressesProvider();
|
||||||
console.log("Addresses provider from function (pre re-deploy):", testProvider.address);
|
// console.log("Addresses provider from function (pre re-deploy):", testProvider.address);
|
||||||
const addressesProvider = await deployLendingPoolAddressesProvider(UniswapConfig.MarketId, verify);
|
// const addressesProvider = await deployLendingPoolAddressesProvider(UniswapConfig.MarketId, verify);
|
||||||
console.log("Addresses provider in execution::", addressesProvider.address)
|
// console.log("Addresses provider in execution::", addressesProvider.address)
|
||||||
|
|
||||||
const testProviderPost = await getLendingPoolAddressesProvider();
|
// const testProviderPost = await getLendingPoolAddressesProvider();
|
||||||
console.log("Addresses provider from function (pre re-deploy):", testProviderPost.address);
|
// console.log("Addresses provider from function (pre re-deploy):", testProviderPost.address);
|
||||||
console.log("Addresses provider from function (post re-deploy) should be different:")
|
// console.log("Addresses provider from function (post re-deploy) should be different:")
|
||||||
await waitForTx(await addressesProvider.setPoolAdmin(admin));
|
// await waitForTx(await addressesProvider.setPoolAdmin(admin));
|
||||||
|
|
||||||
|
|
||||||
const addressesProviderRegistry = await getLendingPoolAddressesProviderRegistry();
|
// const addressesProviderRegistry = await getLendingPoolAddressesProviderRegistry();
|
||||||
await waitForTx(
|
// await waitForTx(
|
||||||
await addressesProviderRegistry.registerAddressesProvider(addressesProvider.address, 1)
|
// await addressesProviderRegistry.registerAddressesProvider(addressesProvider.address, 1)
|
||||||
);
|
// );
|
||||||
console.log(addressesProvider.address);
|
// console.log(addressesProvider.address);
|
||||||
|
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* LENDING POOL DEPLOYMENT
|
// * LENDING POOL DEPLOYMENT
|
||||||
*/
|
// */
|
||||||
const lendingPoolImpl = await deployUniswapLendingPool(verify);
|
// const lendingPoolImpl = await deployUniswapLendingPool(verify);
|
||||||
|
|
||||||
await waitForTx(await addressesProvider.setLendingPoolImpl(lendingPoolImpl.address));
|
// await waitForTx(await addressesProvider.setLendingPoolImpl(lendingPoolImpl.address));
|
||||||
|
|
||||||
const address = await addressesProvider.getLendingPool();
|
// const address = await addressesProvider.getLendingPool();
|
||||||
console.log("UNISWAP MARKET LENDING POOL:", address);
|
// console.log("UNISWAP MARKET LENDING POOL:", address);
|
||||||
const lendingPoolProxy = await getLendingPool(address);
|
// const lendingPoolProxy = await getLendingPool(address);
|
||||||
await insertContractAddressInDb(eContractid.UniswapLendingPool, lendingPoolProxy.address);
|
// await insertContractAddressInDb(eContractid.UniswapLendingPool, lendingPoolProxy.address);
|
||||||
|
|
||||||
const lendingPoolConfiguratorImpl = await deployUniswapLendingPoolConfigurator(verify);
|
// const lendingPoolConfiguratorImpl = await deployUniswapLendingPoolConfigurator(verify);
|
||||||
|
|
||||||
// Set lending pool conf impl to Address Provider
|
// // Set lending pool conf impl to Address Provider
|
||||||
await waitForTx(
|
// await waitForTx(
|
||||||
await addressesProvider.setLendingPoolConfiguratorImpl(lendingPoolConfiguratorImpl.address)
|
// await addressesProvider.setLendingPoolConfiguratorImpl(lendingPoolConfiguratorImpl.address)
|
||||||
);
|
// );
|
||||||
|
|
||||||
const lendingPoolConfiguratorProxy = await getLendingPoolConfiguratorProxy(
|
// const lendingPoolConfiguratorProxy = await getLendingPoolConfiguratorProxy(
|
||||||
await addressesProvider.getLendingPoolConfigurator()
|
// await addressesProvider.getLendingPoolConfigurator()
|
||||||
);
|
// );
|
||||||
|
|
||||||
await insertContractAddressInDb(
|
// await insertContractAddressInDb(
|
||||||
eContractid.UniswapLendingPoolConfigurator,
|
// eContractid.UniswapLendingPoolConfigurator,
|
||||||
lendingPoolConfiguratorProxy.address
|
// lendingPoolConfiguratorProxy.address
|
||||||
);
|
// );
|
||||||
|
|
||||||
// Deploy deployment helpers
|
// // Deploy deployment helpers
|
||||||
await deployStableAndVariableTokensHelper(
|
// await deployStableAndVariableTokensHelper(
|
||||||
[lendingPoolProxy.address, addressesProvider.address],
|
// [lendingPoolProxy.address, addressesProvider.address],
|
||||||
verify
|
// verify
|
||||||
);
|
// );
|
||||||
await deployATokensAndRatesHelper(
|
// await deployATokensAndRatesHelper(
|
||||||
[lendingPoolProxy.address, addressesProvider.address, lendingPoolConfiguratorProxy.address],
|
// [lendingPoolProxy.address, addressesProvider.address, lendingPoolConfiguratorProxy.address],
|
||||||
verify
|
// verify
|
||||||
);
|
// );
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* @dev Oracle deployment section
|
// * @dev Oracle deployment section
|
||||||
*/
|
// */
|
||||||
|
|
||||||
console.log("Uniswap oracle deployment beginning.")
|
// console.log("Uniswap oracle deployment beginning.")
|
||||||
const poolConfig = loadPoolConfig(pool);
|
// const poolConfig = loadPoolConfig(pool);
|
||||||
console.log("Initialized pool config...");
|
// console.log("Initialized pool config...");
|
||||||
|
|
||||||
const {
|
// const {
|
||||||
Mocks: {AllAssetsInitialPrices},
|
// Mocks: {AllAssetsInitialPrices},
|
||||||
ProtocolGlobalParams: {UsdAddress, MockUsdPriceInWei},
|
// ProtocolGlobalParams: {UsdAddress, MockUsdPriceInWei},
|
||||||
LendingRateOracleRatesCommon,
|
// LendingRateOracleRatesCommon,
|
||||||
} = poolConfig as ICommonConfiguration;
|
// } = poolConfig as ICommonConfiguration;
|
||||||
|
|
||||||
console.log("Initialized mocks, global params and lending rate oracle rates");
|
// console.log("Initialized mocks, global params and lending rate oracle rates");
|
||||||
|
|
||||||
const defaultTokenList = {
|
// const defaultTokenList = {
|
||||||
...Object.fromEntries(Object.keys(TokenContractId).map((symbol) => [symbol, ''])),
|
// ...Object.fromEntries(Object.keys(TokenContractId).map((symbol) => [symbol, ''])),
|
||||||
USD: UsdAddress,
|
// USD: UsdAddress,
|
||||||
} as iAssetBase<string>;
|
// } as iAssetBase<string>;
|
||||||
|
|
||||||
console.log("Initialized defaultTokenList");
|
// console.log("Initialized defaultTokenList");
|
||||||
|
|
||||||
const mockTokens = await getAllMockedTokens();
|
// const mockTokens = await getAllMockedTokens();
|
||||||
|
|
||||||
console.log("Initialized mock tokens");
|
// console.log("Initialized mock tokens");
|
||||||
|
|
||||||
const mockTokensAddress = Object.keys(mockTokens).reduce<iAssetBase<string>>((prev, curr) => {
|
// const mockTokensAddress = Object.keys(mockTokens).reduce<iAssetBase<string>>((prev, curr) => {
|
||||||
prev[curr as keyof iAssetBase<string>] = mockTokens[curr].address;
|
// prev[curr as keyof iAssetBase<string>] = mockTokens[curr].address;
|
||||||
return prev;
|
// return prev;
|
||||||
}, defaultTokenList);
|
// }, defaultTokenList);
|
||||||
console.log(mockTokensAddress);
|
// console.log(mockTokensAddress);
|
||||||
console.log("Initialized mock tokens addresses");
|
// console.log("Initialized mock tokens addresses");
|
||||||
|
|
||||||
// No need to re-initialize addressesProvider and admin
|
// // No need to re-initialize addressesProvider and admin
|
||||||
|
|
||||||
const fallbackOracle = await deployUniswapPriceOracle(verify);
|
// const fallbackOracle = await deployUniswapPriceOracle(verify);
|
||||||
console.log("Deployed fallback price oracle");
|
// console.log("Deployed fallback price oracle");
|
||||||
|
|
||||||
await waitForTx(await fallbackOracle.setEthUsdPrice(MockUsdPriceInWei));
|
// await waitForTx(await fallbackOracle.setEthUsdPrice(MockUsdPriceInWei));
|
||||||
console.log("set fallback ETH USD price");
|
// console.log("set fallback ETH USD price");
|
||||||
|
|
||||||
await setInitialAssetPricesInOracle(AllAssetsInitialPrices, mockTokensAddress, fallbackOracle);
|
// await setInitialAssetPricesInOracle(AllAssetsInitialPrices, mockTokensAddress, fallbackOracle);
|
||||||
console.log("Set initial asset prices in oracle");
|
// console.log("Set initial asset prices in oracle");
|
||||||
|
|
||||||
const mockAggregators = await deployAllMockAggregators(AllAssetsInitialPrices, verify);
|
// const mockAggregators = await deployAllMockAggregators(AllAssetsInitialPrices, verify);
|
||||||
console.log("Deployed mock aggregators");
|
// console.log("Deployed mock aggregators");
|
||||||
|
|
||||||
const allTokenAddresses = getAllTokenAddresses(mockTokens);
|
// const allTokenAddresses = getAllTokenAddresses(mockTokens);
|
||||||
console.log("Got all mock token addresses");
|
// console.log("Got all mock token addresses");
|
||||||
|
|
||||||
const allAggregatorsAddresses = getAllAggregatorsAddresses(mockAggregators);
|
// const allAggregatorsAddresses = getAllAggregatorsAddresses(mockAggregators);
|
||||||
console.log("Got all aggregator addresses");
|
// console.log("Got all aggregator addresses");
|
||||||
console.log("allTokenAddresses object: \n", allTokenAddresses);
|
// console.log("allTokenAddresses object: \n", allTokenAddresses);
|
||||||
//Should modify this to potentially contain only the tokens in the Uniswap market
|
// //Should modify this to potentially contain only the tokens in the Uniswap market
|
||||||
// const [tokens, aggregators] = getPairsTokenAggregator(
|
// // const [tokens, aggregators] = getPairsTokenAggregator(
|
||||||
// allTokenAddresses,
|
// // allTokenAddresses,
|
||||||
// allAggregatorsAddresses
|
// // allAggregatorsAddresses
|
||||||
// );
|
// // );
|
||||||
// console.log("Got \"pairsToken aggregator\"");
|
// // console.log("Got \"pairsToken aggregator\"");
|
||||||
// console.log("Tokens: \n", tokens);
|
// // console.log("Tokens: \n", tokens);
|
||||||
|
|
||||||
// const assetAddressIndex = Object.keys(allReservesAddresses).findIndex(
|
// // const assetAddressIndex = Object.keys(allReservesAddresses).findIndex(
|
||||||
// (value) => value === assetSymbol
|
// // (value) => value === assetSymbol
|
||||||
// );
|
// // );
|
||||||
// const [, assetAddress] = (Object.entries(assetsAddresses) as [string, string][])[
|
// // const [, assetAddress] = (Object.entries(assetsAddresses) as [string, string][])[
|
||||||
// assetAddressIndex
|
// // assetAddressIndex
|
||||||
// ];
|
// // ];
|
||||||
// assetAddresses.push(assetAddress);
|
// // assetAddresses.push(assetAddress);
|
||||||
|
|
||||||
// await deployUniswapAaveOracle(
|
// // await deployUniswapAaveOracle(
|
||||||
// [tokens, aggregators, fallbackOracle.address, await getWethAddress(poolConfig)],
|
// // [tokens, aggregators, fallbackOracle.address, await getWethAddress(poolConfig)],
|
||||||
// verify
|
// // verify
|
||||||
// );
|
// // );
|
||||||
console.log("Deployed Uniswap Aave oracle");
|
// console.log("Deployed Uniswap Aave oracle");
|
||||||
|
|
||||||
await waitForTx(await addressesProvider.setPriceOracle(fallbackOracle.address));
|
// await waitForTx(await addressesProvider.setPriceOracle(fallbackOracle.address));
|
||||||
console.log("Set price oracle in addresses provider");
|
// console.log("Set price oracle in addresses provider");
|
||||||
|
|
||||||
const lendingRateOracle = await deployUniswapLendingRateOracle(verify);
|
// const lendingRateOracle = await deployUniswapLendingRateOracle(verify);
|
||||||
console.log("Deployed lendingRateOracle");
|
// console.log("Deployed lendingRateOracle");
|
||||||
|
|
||||||
await waitForTx(await addressesProvider.setLendingRateOracle(lendingRateOracle.address));
|
// await waitForTx(await addressesProvider.setLendingRateOracle(lendingRateOracle.address));
|
||||||
console.log("Set lending rate oracle in addresses provider");
|
// console.log("Set lending rate oracle in addresses provider");
|
||||||
|
|
||||||
const {USD, ...tokensAddressesWithoutUsd} = allTokenAddresses;
|
// const {USD, ...tokensAddressesWithoutUsd} = allTokenAddresses;
|
||||||
console.log("Initialized object with token addresses & usd")
|
// console.log("Initialized object with token addresses & usd")
|
||||||
|
|
||||||
const allReservesAddresses = {
|
// const allReservesAddresses = {
|
||||||
...tokensAddressesWithoutUsd,
|
// ...tokensAddressesWithoutUsd,
|
||||||
};
|
// };
|
||||||
console.log("Initialized object with all reserve addresses, allReservesAddresses:");
|
// console.log("Initialized object with all reserve addresses, allReservesAddresses:");
|
||||||
console.log(allReservesAddresses);
|
// console.log(allReservesAddresses);
|
||||||
|
|
||||||
console.log("LendingRateOracleRatesCommon: \n", LendingRateOracleRatesCommon);
|
// console.log("LendingRateOracleRatesCommon: \n", LendingRateOracleRatesCommon);
|
||||||
//
|
// //
|
||||||
// -- test
|
// // -- test
|
||||||
//
|
// //
|
||||||
const [tokens, aggregators] = getPairsTokenAggregator(
|
// const [tokens, aggregators] = getPairsTokenAggregator(
|
||||||
allTokenAddresses,
|
// allTokenAddresses,
|
||||||
allAggregatorsAddresses
|
// allAggregatorsAddresses
|
||||||
);
|
// );
|
||||||
console.log("Got \"pairsToken aggregator\"");
|
// console.log("Got \"pairsToken aggregator\"");
|
||||||
console.log("Tokens: \n", tokens);
|
// console.log("Tokens: \n", tokens);
|
||||||
const assetAddresses: string[] = [];
|
// const assetAddresses: string[] = [];
|
||||||
const aggregatorAddresses: string[] = [];
|
// const aggregatorAddresses: string[] = [];
|
||||||
for (const [assetSymbol, {borrowRate}] of Object.entries(LendingRateOracleRatesCommon) as [
|
// for (const [assetSymbol, {borrowRate}] of Object.entries(LendingRateOracleRatesCommon) as [
|
||||||
string,
|
// string,
|
||||||
IMarketRates
|
// IMarketRates
|
||||||
][]) {
|
// ][]) {
|
||||||
const assetAddressIndex = Object.keys(allReservesAddresses).findIndex(
|
// const assetAddressIndex = Object.keys(allReservesAddresses).findIndex(
|
||||||
(value) => value === assetSymbol
|
// (value) => value === assetSymbol
|
||||||
);
|
// );
|
||||||
const [, assetAddress] = (Object.entries(allReservesAddresses) as [string, string][])[
|
// const [, assetAddress] = (Object.entries(allReservesAddresses) as [string, string][])[
|
||||||
assetAddressIndex
|
// assetAddressIndex
|
||||||
];
|
// ];
|
||||||
|
|
||||||
const [, aggregatorAddress] = (Object.entries(allAggregatorsAddresses) as [string, string][])[
|
// const [, aggregatorAddress] = (Object.entries(allAggregatorsAddresses) as [string, string][])[
|
||||||
assetAddressIndex
|
// assetAddressIndex
|
||||||
];
|
// ];
|
||||||
aggregatorAddresses.push(aggregatorAddress);
|
// aggregatorAddresses.push(aggregatorAddress);
|
||||||
assetAddresses.push(assetAddress);
|
// assetAddresses.push(assetAddress);
|
||||||
}
|
// }
|
||||||
console.log("\nPRICE ORACLE PARAMS:\nassetAddresses: %s\naggregatorAddresses: %s", assetAddresses, aggregatorAddresses);
|
// console.log("\nPRICE ORACLE PARAMS:\nassetAddresses: %s\naggregatorAddresses: %s", assetAddresses, aggregatorAddresses);
|
||||||
await deployUniswapAaveOracle(
|
// await deployUniswapAaveOracle(
|
||||||
[assetAddresses, aggregatorAddresses, fallbackOracle.address, await getWethAddress(poolConfig)],
|
// [assetAddresses, aggregatorAddresses, fallbackOracle.address, await getWethAddress(poolConfig)],
|
||||||
verify
|
// verify
|
||||||
);
|
// );
|
||||||
//
|
// //
|
||||||
// -- test end
|
// // -- test end
|
||||||
//
|
// //
|
||||||
console.log("TEST END-----------------------------------------------------------------------");
|
// console.log("TEST END-----------------------------------------------------------------------");
|
||||||
await setInitialMarketRatesInRatesOracleByHelper(
|
// await setInitialMarketRatesInRatesOracleByHelper(
|
||||||
LendingRateOracleRatesCommon,
|
// LendingRateOracleRatesCommon,
|
||||||
allReservesAddresses,
|
// allReservesAddresses,
|
||||||
lendingRateOracle,
|
// lendingRateOracle,
|
||||||
admin
|
// admin
|
||||||
);
|
// );
|
||||||
|
|
||||||
console.log("Task complete");
|
// console.log("Task complete");
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* @dev Initialization
|
// * @dev Initialization
|
||||||
*/
|
// */
|
||||||
|
|
||||||
// No need to initialize poolConfig, mockTokens, allTokenAddresses, admin and
|
// // No need to initialize poolConfig, mockTokens, allTokenAddresses, admin and
|
||||||
// addressesProvider and protoReservesAddresses (we use allReserveAddresses)
|
// // addressesProvider and protoReservesAddresses (we use allReserveAddresses)
|
||||||
|
|
||||||
const testHelpers = await deployAaveProtocolDataProvider(addressesProvider.address, verify);
|
// const testHelpers = await deployAaveProtocolDataProvider(addressesProvider.address, verify);
|
||||||
|
|
||||||
const reservesParams = getReservesConfigByPool(AavePools.uniswap);
|
// const reservesParams = getReservesConfigByPool(AavePools.uniswap);
|
||||||
|
|
||||||
const treasuryAddress = await getTreasuryAddress(poolConfig);
|
// const treasuryAddress = await getTreasuryAddress(poolConfig);
|
||||||
|
|
||||||
await initReservesByHelper(
|
// await initReservesByHelper(
|
||||||
addressesProvider,
|
// addressesProvider,
|
||||||
reservesParams,
|
// reservesParams,
|
||||||
allReservesAddresses,
|
// allReservesAddresses,
|
||||||
admin,
|
// admin,
|
||||||
treasuryAddress,
|
// treasuryAddress,
|
||||||
ZERO_ADDRESS,
|
// ZERO_ADDRESS,
|
||||||
verify
|
// verify
|
||||||
);
|
// );
|
||||||
|
|
||||||
await configureReservesByHelper(
|
// await configureReservesByHelper(
|
||||||
addressesProvider,
|
// addressesProvider,
|
||||||
reservesParams,
|
// reservesParams,
|
||||||
allReservesAddresses,
|
// allReservesAddresses,
|
||||||
testHelpers,
|
// testHelpers,
|
||||||
admin
|
// admin
|
||||||
);
|
// );
|
||||||
|
|
||||||
const collateralManager = await deployUniswapLendingPoolCollateralManager(verify);
|
// const collateralManager = await deployUniswapLendingPoolCollateralManager(verify);
|
||||||
await waitForTx(
|
// await waitForTx(
|
||||||
await addressesProvider.setLendingPoolCollateralManager(collateralManager.address)
|
// await addressesProvider.setLendingPoolCollateralManager(collateralManager.address)
|
||||||
);
|
// );
|
||||||
|
|
||||||
const mockFlashLoanReceiver = await deployUniswapMockFlashLoanReceiver(
|
// const mockFlashLoanReceiver = await deployUniswapMockFlashLoanReceiver(
|
||||||
addressesProvider.address,
|
// addressesProvider.address,
|
||||||
verify
|
// verify
|
||||||
);
|
// );
|
||||||
|
|
||||||
await insertContractAddressInDb(
|
// await insertContractAddressInDb(
|
||||||
eContractid.UniswapMockFlashLoanReceiver,
|
// eContractid.UniswapMockFlashLoanReceiver,
|
||||||
mockFlashLoanReceiver.address
|
// mockFlashLoanReceiver.address
|
||||||
);
|
// );
|
||||||
|
|
||||||
await deployUniswapWalletBalancerProvider(verify);
|
// await deployUniswapWalletBalancerProvider(verify);
|
||||||
|
|
||||||
await insertContractAddressInDb(eContractid.AaveProtocolDataProvider, testHelpers.address);
|
// await insertContractAddressInDb(eContractid.AaveProtocolDataProvider, testHelpers.address);
|
||||||
|
|
||||||
const lendingPoolAddress = await addressesProvider.getLendingPool();
|
// const lendingPoolAddress = await addressesProvider.getLendingPool();
|
||||||
const wethAddress = await getWethAddress(poolConfig);
|
// const wethAddress = await getWethAddress(poolConfig);
|
||||||
await deployUniswapWETHGateway([wethAddress, lendingPoolAddress]);
|
// await deployUniswapWETHGateway([wethAddress, lendingPoolAddress]);
|
||||||
});
|
// });
|
||||||
|
|
|
@ -35,8 +35,8 @@ task('aave:dev', 'Deploy development enviroment')
|
||||||
console.log('5. Initialize lending pool');
|
console.log('5. Initialize lending pool');
|
||||||
await localBRE.run('dev:initialize-lending-pool', {verify, pool: POOL_NAME});
|
await localBRE.run('dev:initialize-lending-pool', {verify, pool: POOL_NAME});
|
||||||
|
|
||||||
console.log('6. Deploy Uniswap market');
|
// console.log('6. Deploy Uniswap market');
|
||||||
await localBRE.run('dev:deploy-uniswap-market', {verify});
|
// await localBRE.run('dev:deploy-uniswap-market', {verify});
|
||||||
|
|
||||||
console.log('\nFinished migration');
|
console.log('\nFinished migration');
|
||||||
printContracts();
|
printContracts();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user