2020-10-15 18:28:12 +00:00
|
|
|
import {Contract} from 'ethers';
|
|
|
|
import {BRE} from './misc-utils';
|
|
|
|
import {
|
|
|
|
tEthereumAddress,
|
|
|
|
eContractid,
|
|
|
|
tStringTokenSmallUnits,
|
|
|
|
AavePools,
|
|
|
|
TokenContractId,
|
|
|
|
iMultiPoolsAssets,
|
|
|
|
IReserveParams,
|
|
|
|
PoolConfiguration,
|
|
|
|
} from './types';
|
|
|
|
|
|
|
|
import {MintableErc20 as MintableERC20} from '../types/MintableErc20';
|
|
|
|
import {readArtifact} from '@nomiclabs/buidler/plugins';
|
|
|
|
import {MockContract} from 'ethereum-waffle';
|
|
|
|
import {getReservesConfigByPool} from './configuration';
|
2020-10-22 16:14:56 +00:00
|
|
|
import {getFirstSigner} from './contracts-getters';
|
2020-10-15 18:28:12 +00:00
|
|
|
import {ZERO_ADDRESS} from './constants';
|
|
|
|
import {
|
|
|
|
AaveProtocolTestHelpersFactory,
|
|
|
|
ATokenFactory,
|
2020-10-26 16:43:10 +00:00
|
|
|
ATokensAndRatesHelperFactory,
|
2020-10-15 18:28:12 +00:00
|
|
|
ChainlinkProxyPriceProviderFactory,
|
|
|
|
DefaultReserveInterestRateStrategyFactory,
|
2020-11-02 12:22:26 +00:00
|
|
|
DelegationAwareATokenFactory,
|
2020-10-15 18:28:12 +00:00
|
|
|
InitializableAdminUpgradeabilityProxyFactory,
|
|
|
|
LendingPoolAddressesProviderFactory,
|
|
|
|
LendingPoolAddressesProviderRegistryFactory,
|
|
|
|
LendingPoolCollateralManagerFactory,
|
|
|
|
LendingPoolConfiguratorFactory,
|
|
|
|
LendingPoolFactory,
|
|
|
|
LendingPoolLibraryAddresses,
|
|
|
|
LendingRateOracleFactory,
|
2020-11-02 13:44:11 +00:00
|
|
|
MintableDelegationErc20Factory,
|
2020-10-15 18:28:12 +00:00
|
|
|
MintableErc20Factory,
|
|
|
|
MockAggregatorFactory,
|
2020-10-30 12:40:06 +00:00
|
|
|
MockATokenFactory,
|
2020-10-15 18:28:12 +00:00
|
|
|
MockFlashLoanReceiverFactory,
|
2020-10-30 12:40:06 +00:00
|
|
|
MockStableDebtTokenFactory,
|
|
|
|
MockVariableDebtTokenFactory,
|
2020-10-15 18:28:12 +00:00
|
|
|
PriceOracleFactory,
|
|
|
|
ReserveLogicFactory,
|
2020-11-03 16:23:35 +00:00
|
|
|
SelfdestructTransferFactory,
|
2020-10-15 18:28:12 +00:00
|
|
|
StableDebtTokenFactory,
|
|
|
|
VariableDebtTokenFactory,
|
|
|
|
WalletBalanceProviderFactory,
|
2020-10-28 17:06:24 +00:00
|
|
|
Weth9Factory,
|
2020-10-29 11:44:21 +00:00
|
|
|
Weth9MockedFactory,
|
2020-10-28 17:06:24 +00:00
|
|
|
WethGatewayFactory,
|
2020-10-15 18:28:12 +00:00
|
|
|
} from '../types';
|
|
|
|
import {withSaveAndVerify, registerContractInJsonDb, linkBytecode} from './contracts-helpers';
|
2020-10-26 16:43:10 +00:00
|
|
|
import {StableAndVariableTokensHelperFactory} from '../types/StableAndVariableTokensHelperFactory';
|
2020-10-30 12:40:06 +00:00
|
|
|
import {MockStableDebtToken} from '../types/MockStableDebtToken';
|
|
|
|
import {MockVariableDebtToken} from '../types/MockVariableDebtToken';
|
2020-11-02 13:44:11 +00:00
|
|
|
import {MintableDelegationErc20} from '../types/MintableDelegationErc20';
|
2020-11-03 16:23:35 +00:00
|
|
|
import {SelfdestructTransfer} from '../types/SelfdestructTransfer';
|
2020-10-15 18:28:12 +00:00
|
|
|
|
|
|
|
export const deployLendingPoolAddressesProvider = async (verify?: boolean) =>
|
|
|
|
withSaveAndVerify(
|
|
|
|
await new LendingPoolAddressesProviderFactory(await getFirstSigner()).deploy(),
|
|
|
|
eContractid.LendingPoolAddressesProvider,
|
|
|
|
[],
|
|
|
|
verify
|
|
|
|
);
|
|
|
|
|
|
|
|
export const deployLendingPoolAddressesProviderRegistry = async (verify?: boolean) =>
|
|
|
|
withSaveAndVerify(
|
|
|
|
await new LendingPoolAddressesProviderRegistryFactory(await getFirstSigner()).deploy(),
|
|
|
|
eContractid.LendingPoolAddressesProviderRegistry,
|
|
|
|
[],
|
|
|
|
verify
|
|
|
|
);
|
|
|
|
|
|
|
|
export const deployLendingPoolConfigurator = async (verify?: boolean) =>
|
|
|
|
withSaveAndVerify(
|
|
|
|
await new LendingPoolConfiguratorFactory(await getFirstSigner()).deploy(),
|
|
|
|
eContractid.LendingPoolConfigurator,
|
|
|
|
[],
|
|
|
|
verify
|
|
|
|
);
|
|
|
|
|
|
|
|
export const deployReserveLogicLibrary = async (verify?: boolean) =>
|
|
|
|
withSaveAndVerify(
|
|
|
|
await new ReserveLogicFactory(await getFirstSigner()).deploy(),
|
|
|
|
eContractid.ReserveLogic,
|
|
|
|
[],
|
|
|
|
verify
|
|
|
|
);
|
|
|
|
|
2020-10-22 15:32:50 +00:00
|
|
|
export const deployGenericLogic = async (reserveLogic: Contract, verify?: boolean) => {
|
|
|
|
const genericLogicArtifact = await readArtifact(
|
|
|
|
BRE.config.paths.artifacts,
|
|
|
|
eContractid.GenericLogic
|
|
|
|
);
|
|
|
|
|
|
|
|
const linkedGenericLogicByteCode = linkBytecode(genericLogicArtifact, {
|
|
|
|
[eContractid.ReserveLogic]: reserveLogic.address,
|
|
|
|
});
|
|
|
|
|
|
|
|
const genericLogicFactory = await BRE.ethers.getContractFactory(
|
|
|
|
genericLogicArtifact.abi,
|
|
|
|
linkedGenericLogicByteCode
|
2020-10-15 18:28:12 +00:00
|
|
|
);
|
|
|
|
|
2020-10-22 15:32:50 +00:00
|
|
|
const genericLogic = await (await genericLogicFactory.deploy()).deployed();
|
|
|
|
return withSaveAndVerify(genericLogic, eContractid.GenericLogic, [], verify);
|
|
|
|
};
|
|
|
|
|
2020-10-15 18:28:12 +00:00
|
|
|
export const deployValidationLogic = async (
|
|
|
|
reserveLogic: Contract,
|
|
|
|
genericLogic: Contract,
|
|
|
|
verify?: boolean
|
|
|
|
) => {
|
|
|
|
const validationLogicArtifact = await readArtifact(
|
|
|
|
BRE.config.paths.artifacts,
|
|
|
|
eContractid.ValidationLogic
|
|
|
|
);
|
|
|
|
|
|
|
|
const linkedValidationLogicByteCode = linkBytecode(validationLogicArtifact, {
|
|
|
|
[eContractid.ReserveLogic]: reserveLogic.address,
|
|
|
|
[eContractid.GenericLogic]: genericLogic.address,
|
|
|
|
});
|
|
|
|
|
|
|
|
const validationLogicFactory = await BRE.ethers.getContractFactory(
|
|
|
|
validationLogicArtifact.abi,
|
|
|
|
linkedValidationLogicByteCode
|
|
|
|
);
|
|
|
|
|
|
|
|
const validationLogic = await (await validationLogicFactory.deploy()).deployed();
|
|
|
|
|
|
|
|
return withSaveAndVerify(validationLogic, eContractid.ValidationLogic, [], verify);
|
|
|
|
};
|
|
|
|
|
|
|
|
export const deployAaveLibraries = async (
|
|
|
|
verify?: boolean
|
|
|
|
): Promise<LendingPoolLibraryAddresses> => {
|
|
|
|
const reserveLogic = await deployReserveLogicLibrary(verify);
|
2020-10-22 15:32:50 +00:00
|
|
|
const genericLogic = await deployGenericLogic(reserveLogic, verify);
|
2020-10-15 18:28:12 +00:00
|
|
|
const validationLogic = await deployValidationLogic(reserveLogic, genericLogic, verify);
|
|
|
|
|
|
|
|
// Hardcoded solidity placeholders, if any library changes path this will fail.
|
2020-10-16 09:27:09 +00:00
|
|
|
// The '__$PLACEHOLDER$__ can be calculated via solidity keccak, but the LendingPoolLibraryAddresses Type seems to
|
2020-10-15 18:28:12 +00:00
|
|
|
// require a hardcoded string.
|
|
|
|
//
|
2020-10-16 09:27:09 +00:00
|
|
|
// how-to:
|
|
|
|
// 1. PLACEHOLDER = solidityKeccak256(['string'], `${libPath}:${libName}`).slice(2, 36)
|
|
|
|
// 2. LIB_PLACEHOLDER = `__$${PLACEHOLDER}$__`
|
2020-10-15 18:28:12 +00:00
|
|
|
// or grab placeholdes from LendingPoolLibraryAddresses at Typechain generation.
|
2020-10-16 09:27:09 +00:00
|
|
|
//
|
|
|
|
// libPath example: contracts/libraries/logic/GenericLogic.sol
|
|
|
|
// libName example: GenericLogic
|
2020-10-15 18:28:12 +00:00
|
|
|
return {
|
2020-10-16 09:27:09 +00:00
|
|
|
['__$5201a97c05ba6aa659e2f36a933dd51801$__']: validationLogic.address,
|
|
|
|
['__$d3b4366daeb9cadc7528af6145b50b2183$__']: reserveLogic.address,
|
2020-10-15 18:28:12 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-10-22 16:14:56 +00:00
|
|
|
export const deployLendingPool = async (verify?: boolean) => {
|
2020-10-15 18:28:12 +00:00
|
|
|
const libraries = await deployAaveLibraries(verify);
|
|
|
|
return withSaveAndVerify(
|
|
|
|
await new LendingPoolFactory(libraries, await getFirstSigner()).deploy(),
|
|
|
|
eContractid.LendingPool,
|
|
|
|
[],
|
|
|
|
verify
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export const deployPriceOracle = async (verify?: boolean) =>
|
|
|
|
withSaveAndVerify(
|
|
|
|
await new PriceOracleFactory(await getFirstSigner()).deploy(),
|
|
|
|
eContractid.PriceOracle,
|
|
|
|
[],
|
|
|
|
verify
|
|
|
|
);
|
|
|
|
|
|
|
|
export const deployLendingRateOracle = async (verify?: boolean) =>
|
|
|
|
withSaveAndVerify(
|
|
|
|
await new LendingRateOracleFactory(await getFirstSigner()).deploy(),
|
|
|
|
eContractid.LendingRateOracle,
|
|
|
|
[],
|
|
|
|
verify
|
|
|
|
);
|
|
|
|
|
|
|
|
export const deployMockAggregator = async (price: tStringTokenSmallUnits, verify?: boolean) =>
|
|
|
|
withSaveAndVerify(
|
|
|
|
await new MockAggregatorFactory(await getFirstSigner()).deploy(price),
|
|
|
|
eContractid.MockAggregator,
|
|
|
|
[price],
|
|
|
|
verify
|
|
|
|
);
|
|
|
|
|
|
|
|
export const deployChainlinkProxyPriceProvider = async (
|
|
|
|
args: [tEthereumAddress[], tEthereumAddress[], tEthereumAddress],
|
|
|
|
verify?: boolean
|
|
|
|
) =>
|
|
|
|
withSaveAndVerify(
|
|
|
|
await new ChainlinkProxyPriceProviderFactory(await getFirstSigner()).deploy(...args),
|
|
|
|
eContractid.ChainlinkProxyPriceProvider,
|
|
|
|
args,
|
|
|
|
verify
|
|
|
|
);
|
|
|
|
|
|
|
|
export const deployLendingPoolCollateralManager = async (verify?: boolean) => {
|
|
|
|
return withSaveAndVerify(
|
2020-10-22 16:14:56 +00:00
|
|
|
await new LendingPoolCollateralManagerFactory(await getFirstSigner()).deploy(),
|
2020-10-15 18:28:12 +00:00
|
|
|
eContractid.LendingPoolCollateralManager,
|
|
|
|
[],
|
|
|
|
verify
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export const deployInitializableAdminUpgradeabilityProxy = async (verify?: boolean) =>
|
|
|
|
withSaveAndVerify(
|
|
|
|
await new InitializableAdminUpgradeabilityProxyFactory(await getFirstSigner()).deploy(),
|
|
|
|
eContractid.InitializableAdminUpgradeabilityProxy,
|
|
|
|
[],
|
|
|
|
verify
|
|
|
|
);
|
|
|
|
|
|
|
|
export const deployMockFlashLoanReceiver = async (
|
|
|
|
addressesProvider: tEthereumAddress,
|
|
|
|
verify?: boolean
|
|
|
|
) =>
|
|
|
|
withSaveAndVerify(
|
|
|
|
await new MockFlashLoanReceiverFactory(await getFirstSigner()).deploy(addressesProvider),
|
|
|
|
eContractid.MockFlashLoanReceiver,
|
|
|
|
[addressesProvider],
|
|
|
|
verify
|
|
|
|
);
|
|
|
|
|
|
|
|
export const deployWalletBalancerProvider = async (
|
|
|
|
addressesProvider: tEthereumAddress,
|
|
|
|
verify?: boolean
|
|
|
|
) =>
|
|
|
|
withSaveAndVerify(
|
|
|
|
await new WalletBalanceProviderFactory(await getFirstSigner()).deploy(addressesProvider),
|
|
|
|
eContractid.WalletBalanceProvider,
|
|
|
|
[addressesProvider],
|
|
|
|
verify
|
|
|
|
);
|
|
|
|
|
|
|
|
export const deployAaveProtocolTestHelpers = async (
|
|
|
|
addressesProvider: tEthereumAddress,
|
|
|
|
verify?: boolean
|
|
|
|
) =>
|
|
|
|
withSaveAndVerify(
|
|
|
|
await new AaveProtocolTestHelpersFactory(await getFirstSigner()).deploy(addressesProvider),
|
|
|
|
eContractid.AaveProtocolTestHelpers,
|
|
|
|
[addressesProvider],
|
|
|
|
verify
|
|
|
|
);
|
|
|
|
|
|
|
|
export const deployMintableERC20 = async (
|
|
|
|
args: [string, string, string],
|
|
|
|
verify?: boolean
|
|
|
|
): Promise<MintableERC20> =>
|
|
|
|
withSaveAndVerify(
|
|
|
|
await new MintableErc20Factory(await getFirstSigner()).deploy(...args),
|
|
|
|
eContractid.MintableERC20,
|
|
|
|
args,
|
|
|
|
verify
|
|
|
|
);
|
|
|
|
|
2020-11-02 13:44:11 +00:00
|
|
|
export const deployMintableDelegationERC20 = async (
|
|
|
|
args: [string, string, string],
|
|
|
|
verify?: boolean
|
|
|
|
): Promise<MintableDelegationErc20> =>
|
|
|
|
withSaveAndVerify(
|
|
|
|
await new MintableDelegationErc20Factory(await getFirstSigner()).deploy(...args),
|
|
|
|
eContractid.MintableDelegationERC20,
|
|
|
|
args,
|
|
|
|
verify
|
|
|
|
);
|
2020-10-15 18:28:12 +00:00
|
|
|
export const deployDefaultReserveInterestRateStrategy = async (
|
|
|
|
args: [tEthereumAddress, string, string, string, string, string],
|
|
|
|
verify: boolean
|
|
|
|
) =>
|
|
|
|
withSaveAndVerify(
|
|
|
|
await new DefaultReserveInterestRateStrategyFactory(await getFirstSigner()).deploy(...args),
|
|
|
|
eContractid.DefaultReserveInterestRateStrategy,
|
|
|
|
args,
|
|
|
|
verify
|
|
|
|
);
|
|
|
|
|
|
|
|
export const deployStableDebtToken = async (
|
2020-10-16 09:27:09 +00:00
|
|
|
args: [tEthereumAddress, tEthereumAddress, string, string, tEthereumAddress],
|
2020-10-15 18:28:12 +00:00
|
|
|
verify: boolean
|
|
|
|
) =>
|
|
|
|
withSaveAndVerify(
|
|
|
|
await new StableDebtTokenFactory(await getFirstSigner()).deploy(...args),
|
|
|
|
eContractid.StableDebtToken,
|
|
|
|
args,
|
|
|
|
verify
|
|
|
|
);
|
|
|
|
|
|
|
|
export const deployVariableDebtToken = async (
|
2020-10-16 09:27:09 +00:00
|
|
|
args: [tEthereumAddress, tEthereumAddress, string, string, tEthereumAddress],
|
2020-10-15 18:28:12 +00:00
|
|
|
verify: boolean
|
|
|
|
) =>
|
|
|
|
withSaveAndVerify(
|
|
|
|
await new VariableDebtTokenFactory(await getFirstSigner()).deploy(...args),
|
|
|
|
eContractid.VariableDebtToken,
|
|
|
|
args,
|
|
|
|
verify
|
|
|
|
);
|
|
|
|
|
|
|
|
export const deployGenericAToken = async (
|
|
|
|
[poolAddress, underlyingAssetAddress, name, symbol, incentivesController]: [
|
|
|
|
tEthereumAddress,
|
|
|
|
tEthereumAddress,
|
|
|
|
string,
|
|
|
|
string,
|
|
|
|
tEthereumAddress
|
|
|
|
],
|
|
|
|
verify: boolean
|
|
|
|
) => {
|
|
|
|
const args: [
|
|
|
|
tEthereumAddress,
|
|
|
|
tEthereumAddress,
|
|
|
|
tEthereumAddress,
|
|
|
|
string,
|
|
|
|
string,
|
|
|
|
tEthereumAddress
|
|
|
|
] = [poolAddress, underlyingAssetAddress, ZERO_ADDRESS, name, symbol, incentivesController];
|
2020-10-16 09:27:09 +00:00
|
|
|
return withSaveAndVerify(
|
2020-10-15 18:28:12 +00:00
|
|
|
await new ATokenFactory(await getFirstSigner()).deploy(...args),
|
2020-10-22 15:32:50 +00:00
|
|
|
eContractid.AToken,
|
2020-10-15 18:28:12 +00:00
|
|
|
args,
|
|
|
|
verify
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2020-11-02 12:22:26 +00:00
|
|
|
export const deployDelegationAwareAToken = async (
|
|
|
|
[poolAddress, underlyingAssetAddress, name, symbol, incentivesController]: [
|
|
|
|
tEthereumAddress,
|
|
|
|
tEthereumAddress,
|
|
|
|
string,
|
|
|
|
string,
|
|
|
|
tEthereumAddress
|
|
|
|
],
|
|
|
|
verify: boolean
|
|
|
|
) => {
|
|
|
|
const args: [
|
|
|
|
tEthereumAddress,
|
|
|
|
tEthereumAddress,
|
|
|
|
tEthereumAddress,
|
|
|
|
string,
|
|
|
|
string,
|
|
|
|
tEthereumAddress
|
|
|
|
] = [poolAddress, underlyingAssetAddress, ZERO_ADDRESS, name, symbol, incentivesController];
|
|
|
|
return withSaveAndVerify(
|
|
|
|
await new DelegationAwareATokenFactory(await getFirstSigner()).deploy(...args),
|
2020-10-22 15:32:50 +00:00
|
|
|
eContractid.AToken,
|
2020-10-15 18:28:12 +00:00
|
|
|
args,
|
|
|
|
verify
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export const deployAllMockTokens = async (verify?: boolean) => {
|
|
|
|
const tokens: {[symbol: string]: MockContract | MintableERC20} = {};
|
|
|
|
|
|
|
|
const protoConfigData = getReservesConfigByPool(AavePools.proto);
|
|
|
|
const secondaryConfigData = getReservesConfigByPool(AavePools.secondary);
|
|
|
|
|
|
|
|
for (const tokenSymbol of Object.keys(TokenContractId)) {
|
|
|
|
let decimals = '18';
|
|
|
|
|
|
|
|
let configData = (<any>protoConfigData)[tokenSymbol];
|
|
|
|
|
|
|
|
if (!configData) {
|
|
|
|
configData = (<any>secondaryConfigData)[tokenSymbol];
|
|
|
|
}
|
|
|
|
|
|
|
|
tokens[tokenSymbol] = await deployMintableERC20(
|
|
|
|
[tokenSymbol, tokenSymbol, configData ? configData.reserveDecimals : decimals],
|
|
|
|
verify
|
|
|
|
);
|
|
|
|
}
|
|
|
|
return tokens;
|
|
|
|
};
|
|
|
|
|
|
|
|
export const deployMockTokens = async (config: PoolConfiguration, verify?: boolean) => {
|
|
|
|
const tokens: {[symbol: string]: MockContract | MintableERC20} = {};
|
|
|
|
const defaultDecimals = 18;
|
|
|
|
|
|
|
|
const configData = config.ReservesConfig;
|
|
|
|
|
2020-11-04 10:47:06 +00:00
|
|
|
for (const tokenSymbol of Object.keys(configData)) {
|
2020-10-15 18:28:12 +00:00
|
|
|
tokens[tokenSymbol] = await deployMintableERC20(
|
|
|
|
[
|
|
|
|
tokenSymbol,
|
|
|
|
tokenSymbol,
|
|
|
|
configData[tokenSymbol as keyof iMultiPoolsAssets<IReserveParams>].reserveDecimals ||
|
|
|
|
defaultDecimals.toString(),
|
|
|
|
],
|
|
|
|
verify
|
|
|
|
);
|
|
|
|
await registerContractInJsonDb(tokenSymbol.toUpperCase(), tokens[tokenSymbol]);
|
|
|
|
}
|
|
|
|
return tokens;
|
|
|
|
};
|
2020-10-26 16:43:10 +00:00
|
|
|
|
|
|
|
export const deployStableAndVariableTokensHelper = async (
|
|
|
|
args: [tEthereumAddress, tEthereumAddress],
|
|
|
|
verify?: boolean
|
|
|
|
) =>
|
|
|
|
withSaveAndVerify(
|
|
|
|
await new StableAndVariableTokensHelperFactory(await getFirstSigner()).deploy(...args),
|
|
|
|
eContractid.StableAndVariableTokensHelper,
|
|
|
|
args,
|
|
|
|
verify
|
|
|
|
);
|
|
|
|
|
|
|
|
export const deployATokensAndRatesHelper = async (
|
|
|
|
args: [tEthereumAddress, tEthereumAddress, tEthereumAddress],
|
|
|
|
verify?: boolean
|
|
|
|
) =>
|
|
|
|
withSaveAndVerify(
|
|
|
|
await new ATokensAndRatesHelperFactory(await getFirstSigner()).deploy(...args),
|
|
|
|
eContractid.ATokensAndRatesHelper,
|
|
|
|
args,
|
|
|
|
verify
|
|
|
|
);
|
2020-10-30 12:40:06 +00:00
|
|
|
|
2020-11-02 17:43:50 +00:00
|
|
|
export const deployWETHGateway = async (
|
|
|
|
args: [tEthereumAddress, tEthereumAddress],
|
|
|
|
verify?: boolean
|
|
|
|
) =>
|
2020-10-28 17:06:24 +00:00
|
|
|
withSaveAndVerify(
|
|
|
|
await new WethGatewayFactory(await getFirstSigner()).deploy(...args),
|
|
|
|
eContractid.WETHGateway,
|
|
|
|
args,
|
|
|
|
verify
|
|
|
|
);
|
|
|
|
|
2020-10-30 12:40:06 +00:00
|
|
|
export const deployMockStableDebtToken = async (
|
|
|
|
args: [tEthereumAddress, tEthereumAddress, string, string, tEthereumAddress],
|
|
|
|
verify?: boolean
|
|
|
|
) =>
|
|
|
|
withSaveAndVerify(
|
|
|
|
await new MockStableDebtTokenFactory(await getFirstSigner()).deploy(...args),
|
2020-11-02 13:45:00 +00:00
|
|
|
eContractid.MockStableDebtToken,
|
2020-10-30 12:40:06 +00:00
|
|
|
args,
|
|
|
|
verify
|
|
|
|
);
|
|
|
|
|
2020-10-29 11:44:21 +00:00
|
|
|
export const deployWETHMocked = async (verify?: boolean) =>
|
|
|
|
withSaveAndVerify(
|
|
|
|
await new Weth9MockedFactory(await getFirstSigner()).deploy(),
|
|
|
|
eContractid.WETHMocked,
|
|
|
|
[],
|
|
|
|
verify
|
|
|
|
);
|
2020-11-02 09:20:59 +00:00
|
|
|
|
2020-10-30 12:40:06 +00:00
|
|
|
export const deployMockVariableDebtToken = async (
|
|
|
|
args: [tEthereumAddress, tEthereumAddress, string, string, tEthereumAddress],
|
|
|
|
verify?: boolean
|
|
|
|
) =>
|
|
|
|
withSaveAndVerify(
|
|
|
|
await new MockVariableDebtTokenFactory(await getFirstSigner()).deploy(...args),
|
2020-11-02 13:45:00 +00:00
|
|
|
eContractid.MockVariableDebtToken,
|
2020-10-30 12:40:06 +00:00
|
|
|
args,
|
|
|
|
verify
|
|
|
|
);
|
|
|
|
|
|
|
|
export const deployMockAToken = async (
|
|
|
|
args: [tEthereumAddress, tEthereumAddress, tEthereumAddress, string, string, tEthereumAddress],
|
|
|
|
verify?: boolean
|
|
|
|
) =>
|
|
|
|
withSaveAndVerify(
|
|
|
|
await new MockATokenFactory(await getFirstSigner()).deploy(...args),
|
2020-11-02 13:45:00 +00:00
|
|
|
eContractid.MockAToken,
|
2020-10-30 12:40:06 +00:00
|
|
|
args,
|
|
|
|
verify
|
|
|
|
);
|
2020-11-03 16:23:35 +00:00
|
|
|
|
|
|
|
export const deploySelfdestructTransferMock = async (verify?: boolean) =>
|
|
|
|
withSaveAndVerify(
|
|
|
|
await new SelfdestructTransferFactory(await getFirstSigner()).deploy(),
|
|
|
|
eContractid.SelfdestructTransferMock,
|
|
|
|
[],
|
|
|
|
verify
|
|
|
|
);
|