From 15076ea7c03b68f0e011ecdbb51cf3f95e7a80ce Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Mon, 21 Dec 2020 16:14:07 -0500 Subject: [PATCH 01/31] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ae2e7b69..8e4b0049 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +### Uniswap V2 Market Aave Fork ``` .///. .///. //. .// `/////////////- `++:++` .++:++` :++` `++: `++:......---.` From 9e001ec0b6c522ed888b3328ac473505e73f0f5e Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Tue, 22 Dec 2020 18:48:02 -0500 Subject: [PATCH 02/31] Initial testing --- helpers/configuration.ts | 3 + helpers/contracts-deployments.ts | 1 + helpers/contracts-getters.ts | 2 + helpers/oracles-helpers.ts | 6 + helpers/types.ts | 19 + markets/aave/commons.ts | 2 + markets/uniswap/commons.ts | 334 ++ markets/uniswap/index.ts | 88 + markets/uniswap/reservesConfigs.ts | 122 + package-lock.json | 4802 ++++++----------- tasks/dev/3_uniswap_address_provider.ts | 28 + .../{3_lending_pool.ts => 4_lending_pool.ts} | 0 tasks/dev/{4_oracles.ts => 5_oracles.ts} | 58 +- .../dev/{5_initialize.ts => 6_initialize.ts} | 0 ...ovider.ts => 7_wallet_balance_provider.ts} | 0 tasks/migrations/aave.dev.ts | 14 +- 16 files changed, 2234 insertions(+), 3245 deletions(-) create mode 100644 markets/uniswap/commons.ts create mode 100644 markets/uniswap/index.ts create mode 100644 markets/uniswap/reservesConfigs.ts create mode 100644 tasks/dev/3_uniswap_address_provider.ts rename tasks/dev/{3_lending_pool.ts => 4_lending_pool.ts} (100%) rename tasks/dev/{4_oracles.ts => 5_oracles.ts} (72%) rename tasks/dev/{5_initialize.ts => 6_initialize.ts} (100%) rename tasks/dev/{6_wallet_balance_provider.ts => 7_wallet_balance_provider.ts} (100%) diff --git a/helpers/configuration.ts b/helpers/configuration.ts index a06ce3b3..925f9365 100644 --- a/helpers/configuration.ts +++ b/helpers/configuration.ts @@ -8,6 +8,7 @@ import { } from './types'; import { getParamPerPool } from './contracts-helpers'; import AaveConfig from '../markets/aave'; +import UniswapConfig from '../markets/uniswap'; import { CommonsConfig } from '../markets/aave/commons'; import { DRE, filterMapBy } from './misc-utils'; import { tEthereumAddress } from './types'; @@ -26,6 +27,8 @@ export const loadPoolConfig = (configName: ConfigNames): PoolConfiguration => { return AaveConfig; case ConfigNames.Commons: return CommonsConfig; + case ConfigNames.Uniswap: + return UniswapConfig; default: throw new Error(`Unsupported pool configuration: ${Object.values(ConfigNames)}`); } diff --git a/helpers/contracts-deployments.ts b/helpers/contracts-deployments.ts index 322e4f18..0cb00122 100644 --- a/helpers/contracts-deployments.ts +++ b/helpers/contracts-deployments.ts @@ -387,6 +387,7 @@ export const deployAllMockTokens = async (verify?: boolean) => { [tokenSymbol, tokenSymbol, configData ? configData.reserveDecimals : decimals], verify ); + console.log("deployAllMockTokens: deployed", tokenSymbol); } return tokens; }; diff --git a/helpers/contracts-getters.ts b/helpers/contracts-getters.ts index 65834cc6..22c1784b 100644 --- a/helpers/contracts-getters.ts +++ b/helpers/contracts-getters.ts @@ -153,7 +153,9 @@ export const getAllMockedTokens = async () => { const tokens: MockTokenMap = await Object.keys(TokenContractId).reduce>( async (acc, tokenSymbol) => { const accumulator = await acc; + console.log("getAllMockedTokens: got accumulator"); const address = db.get(`${tokenSymbol.toUpperCase()}.${DRE.network.name}`).value().address; + console.log("getAllMockedTokens: Initialized address for %s, address: %s", tokenSymbol, address); accumulator[tokenSymbol] = await getMintableERC20(address); return Promise.resolve(acc); }, diff --git a/helpers/oracles-helpers.ts b/helpers/oracles-helpers.ts index 45cec5e2..242161e4 100644 --- a/helpers/oracles-helpers.ts +++ b/helpers/oracles-helpers.ts @@ -38,6 +38,12 @@ export const setInitialMarketRatesInRatesOracleByHelper = async ( borrowRates.push(borrowRate); symbols.push(assetSymbol); } + + console.log("---setInitialMarketRatesInRatesOracleByHelper---"); + console.log(assetAddresses); + console.log(symbols); + console.log(borrowRates); + // Set borrow rates per chunks const ratesChunks = 20; const chunkedTokens = chunk(assetAddresses, ratesChunks); diff --git a/helpers/types.ts b/helpers/types.ts index 35211dd1..30c628e6 100644 --- a/helpers/types.ts +++ b/helpers/types.ts @@ -200,6 +200,8 @@ export interface iAssetBase { USD: T; REN: T; ENJ: T; + WETHDAI: T; + WETHWBTC: T; } export type iAssetsWithoutETH = Omit, 'ETH'>; @@ -230,6 +232,17 @@ export type iAavePoolAssets = Pick< | 'ENJ' >; +export type iUniswapPoolAssets = Pick< + iAssetsWithoutUSD, + | 'DAI' + | 'USDC' + | 'USDT' + | 'WBTC' + | 'WETH' + | 'WETHDAI' + | 'WETHWBTC' +>; + export type iMultiPoolsAssets = iAssetCommon | iAavePoolAssets; export type iAavePoolTokens = Omit, 'ETH'>; @@ -258,6 +271,8 @@ export enum TokenContractId { YFI = 'YFI', UNI = 'UNI', ENJ = 'ENJ', + WETHDAI = 'WETHDAI', + WETHWBTC = 'WETHWBTC', } export interface IReserveParams extends IReserveBorrowParams, IReserveCollateralParams { @@ -372,6 +387,10 @@ export interface ICommonConfiguration { export interface IAaveConfiguration extends ICommonConfiguration { ReservesConfig: iAavePoolAssets; } + +export interface IUniswapConfiguration extends ICommonConfiguration { + ReservesConfig: iUniswapPoolAssets; +} export interface ITokenAddress { [token: string]: tEthereumAddress; } diff --git a/markets/aave/commons.ts b/markets/aave/commons.ts index f2fdb6f3..fecd714f 100644 --- a/markets/aave/commons.ts +++ b/markets/aave/commons.ts @@ -23,6 +23,8 @@ const MOCK_CHAINLINK_AGGREGATORS_PRICES = { WBTC: oneEther.multipliedBy('47.332685').toFixed(), YFI: oneEther.multipliedBy('22.407436').toFixed(), ZRX: oneEther.multipliedBy('0.001151').toFixed(), + WETHDAI: oneEther.multipliedBy('22.407436').toFixed(), + WETHWBTC: oneEther.multipliedBy('22.407436').toFixed(), USD: '5848466240000000', }; // ---------------- diff --git a/markets/uniswap/commons.ts b/markets/uniswap/commons.ts new file mode 100644 index 00000000..939b32ee --- /dev/null +++ b/markets/uniswap/commons.ts @@ -0,0 +1,334 @@ +import BigNumber from 'bignumber.js'; +import { oneEther, oneRay, RAY, ZERO_ADDRESS } from '../../helpers/constants'; +import { ICommonConfiguration, EthereumNetwork, eEthereumNetwork } from '../../helpers/types'; + +const MOCK_CHAINLINK_AGGREGATORS_PRICES = { + AAVE: oneEther.multipliedBy('0.003620948469').toFixed(), + BAT: oneEther.multipliedBy('0.00137893825230').toFixed(), + BUSD: oneEther.multipliedBy('0.00736484').toFixed(), + DAI: oneEther.multipliedBy('0.00369068412860').toFixed(), + ENJ: oneEther.multipliedBy('0.00029560').toFixed(), + KNC: oneEther.multipliedBy('0.001072').toFixed(), + LINK: oneEther.multipliedBy('0.009955').toFixed(), + MANA: oneEther.multipliedBy('0.000158').toFixed(), + MKR: oneEther.multipliedBy('2.508581').toFixed(), + REN: oneEther.multipliedBy('0.00065133').toFixed(), + SNX: oneEther.multipliedBy('0.00442616').toFixed(), + SUSD: oneEther.multipliedBy('0.00364714136416').toFixed(), + TUSD: oneEther.multipliedBy('0.00364714136416').toFixed(), + UNI: oneEther.multipliedBy('0.00536479').toFixed(), + USDC: oneEther.multipliedBy('0.00367714136416').toFixed(), + USDT: oneEther.multipliedBy('0.00369068412860').toFixed(), + WETH: oneEther.toFixed(), + WBTC: oneEther.multipliedBy('47.332685').toFixed(), + YFI: oneEther.multipliedBy('22.407436').toFixed(), + ZRX: oneEther.multipliedBy('0.001151').toFixed(), + WETHDAI: oneEther.multipliedBy('22.407436').toFixed(), + WETHWBTC: oneEther.multipliedBy('22.407436').toFixed(), + USD: '5848466240000000', +}; +// ---------------- +// PROTOCOL GLOBAL PARAMS +// ---------------- + +export const CommonsConfig: ICommonConfiguration = { + MarketId: 'Commons', + ProviderId: 0, + ProtocolGlobalParams: { + TokenDistributorPercentageBase: '10000', + MockUsdPriceInWei: '5848466240000000', + UsdAddress: '0x10F7Fc1F91Ba351f9C629c5947AD69bD03C05b96', + NilAddress: '0x0000000000000000000000000000000000000000', + OneAddress: '0x0000000000000000000000000000000000000001', + AaveReferral: '0', + }, + + // ---------------- + // COMMON PROTOCOL PARAMS ACROSS POOLS AND NETWORKS + // ---------------- + + Mocks: { + AllAssetsInitialPrices: { + ...MOCK_CHAINLINK_AGGREGATORS_PRICES, + }, + }, + // TODO: reorg alphabetically, checking the reason of tests failing + LendingRateOracleRatesCommon: { + WETH: { + borrowRate: oneRay.multipliedBy(0.03).toFixed(), + }, + DAI: { + borrowRate: oneRay.multipliedBy(0.039).toFixed(), + }, + TUSD: { + borrowRate: oneRay.multipliedBy(0.035).toFixed(), + }, + USDC: { + borrowRate: oneRay.multipliedBy(0.039).toFixed(), + }, + SUSD: { + borrowRate: oneRay.multipliedBy(0.035).toFixed(), + }, + USDT: { + borrowRate: oneRay.multipliedBy(0.035).toFixed(), + }, + BAT: { + borrowRate: oneRay.multipliedBy(0.03).toFixed(), + }, + AAVE: { + borrowRate: oneRay.multipliedBy(0.03).toFixed(), + }, + LINK: { + borrowRate: oneRay.multipliedBy(0.03).toFixed(), + }, + KNC: { + borrowRate: oneRay.multipliedBy(0.03).toFixed(), + }, + MKR: { + borrowRate: oneRay.multipliedBy(0.03).toFixed(), + }, + MANA: { + borrowRate: oneRay.multipliedBy(0.03).toFixed(), + }, + WBTC: { + borrowRate: oneRay.multipliedBy(0.03).toFixed(), + }, + ZRX: { + borrowRate: oneRay.multipliedBy(0.03).toFixed(), + }, + SNX: { + borrowRate: oneRay.multipliedBy(0.03).toFixed(), + }, + YFI: { + borrowRate: oneRay.multipliedBy(0.03).toFixed(), + }, + REN: { + borrowRate: oneRay.multipliedBy(0.03).toFixed(), + }, + UNI: { + borrowRate: oneRay.multipliedBy(0.03).toFixed(), + }, + BUSD: { + borrowRate: oneRay.multipliedBy(0.05).toFixed(), + }, + WETHDAI: { + borrowRate: oneRay.multipliedBy(0.05).toFixed(), + }, + WETHWBTC: { + borrowRate: oneRay.multipliedBy(0.05).toFixed(), + }, + }, + // ---------------- + // COMMON PROTOCOL ADDRESSES ACROSS POOLS + // ---------------- + + // If PoolAdmin/emergencyAdmin is set, will take priority over PoolAdminIndex/emergencyAdminIndex + PoolAdmin: { + [eEthereumNetwork.coverage]: undefined, + [eEthereumNetwork.buidlerevm]: undefined, + [eEthereumNetwork.coverage]: undefined, + [eEthereumNetwork.hardhat]: undefined, + [eEthereumNetwork.kovan]: undefined, + [eEthereumNetwork.ropsten]: undefined, + [eEthereumNetwork.main]: undefined, + [eEthereumNetwork.tenderlyMain]: undefined, + }, + PoolAdminIndex: 0, + EmergencyAdmin: { + [eEthereumNetwork.hardhat]: undefined, + [eEthereumNetwork.coverage]: undefined, + [eEthereumNetwork.buidlerevm]: undefined, + [eEthereumNetwork.kovan]: undefined, + [eEthereumNetwork.ropsten]: undefined, + [eEthereumNetwork.main]: undefined, + [eEthereumNetwork.tenderlyMain]: undefined, + }, + EmergencyAdminIndex: 1, + ProviderRegistry: { + [eEthereumNetwork.kovan]: '0x1E40B561EC587036f9789aF83236f057D1ed2A90', + [eEthereumNetwork.ropsten]: '', + [eEthereumNetwork.main]: '0x52D306e36E3B6B02c153d0266ff0f85d18BCD413', + [eEthereumNetwork.coverage]: '', + [eEthereumNetwork.hardhat]: '', + [eEthereumNetwork.buidlerevm]: '', + [eEthereumNetwork.tenderlyMain]: '0x52D306e36E3B6B02c153d0266ff0f85d18BCD413', + }, + ProviderRegistryOwner: { + [eEthereumNetwork.kovan]: '0x85e4A467343c0dc4aDAB74Af84448D9c45D8ae6F', + [eEthereumNetwork.ropsten]: '', + [eEthereumNetwork.main]: '0xbd723fc4f1d737dcfc48a07fe7336766d34cad5f', + [eEthereumNetwork.coverage]: '', + [eEthereumNetwork.hardhat]: '', + [eEthereumNetwork.buidlerevm]: '', + [eEthereumNetwork.tenderlyMain]: '0xbd723fc4f1d737dcfc48a07fe7336766d34cad5f', + }, + LendingRateOracle: { + [eEthereumNetwork.coverage]: '', + [eEthereumNetwork.hardhat]: '', + [eEthereumNetwork.buidlerevm]: '', + [eEthereumNetwork.kovan]: '0xdCde9Bb6a49e37fA433990832AB541AE2d4FEB4a', + [eEthereumNetwork.ropsten]: '0x05dcca805a6562c1bdd0423768754acb6993241b', + [eEthereumNetwork.main]: '0x8A32f49FFbA88aba6EFF96F45D8BD1D4b3f35c7D', + [eEthereumNetwork.tenderlyMain]: '0x8A32f49FFbA88aba6EFF96F45D8BD1D4b3f35c7D', + }, + TokenDistributor: { + [eEthereumNetwork.coverage]: '', + [eEthereumNetwork.buidlerevm]: '', + [eEthereumNetwork.hardhat]: '', + [EthereumNetwork.kovan]: '0x971efe90088f21dc6a36f610ffed77fc19710708', + [EthereumNetwork.ropsten]: '0xeba2ea67942b8250d870b12750b594696d02fc9c', + [EthereumNetwork.main]: '0xe3d9988f676457123c5fd01297605efdd0cba1ae', + [EthereumNetwork.tenderlyMain]: '0xe3d9988f676457123c5fd01297605efdd0cba1ae', + }, + AaveOracle: { + [eEthereumNetwork.coverage]: '', + [eEthereumNetwork.hardhat]: '', + [eEthereumNetwork.buidlerevm]: '', + [EthereumNetwork.kovan]: '0xB8bE51E6563BB312Cbb2aa26e352516c25c26ac1', + [EthereumNetwork.ropsten]: ZERO_ADDRESS, + [EthereumNetwork.main]: '0xA50ba011c48153De246E5192C8f9258A2ba79Ca9', + [EthereumNetwork.tenderlyMain]: '0xA50ba011c48153De246E5192C8f9258A2ba79Ca9', + }, + FallbackOracle: { + [eEthereumNetwork.coverage]: '', + [eEthereumNetwork.hardhat]: '', + [eEthereumNetwork.buidlerevm]: '', + [EthereumNetwork.kovan]: '0x50913E8E1c650E790F8a1E741FF9B1B1bB251dfe', + [EthereumNetwork.ropsten]: '0xAD1a978cdbb8175b2eaeC47B01404f8AEC5f4F0d', + [EthereumNetwork.main]: ZERO_ADDRESS, + [EthereumNetwork.tenderlyMain]: ZERO_ADDRESS, + }, + ChainlinkAggregator: { + [eEthereumNetwork.coverage]: {}, + [eEthereumNetwork.hardhat]: {}, + [eEthereumNetwork.buidlerevm]: {}, + [EthereumNetwork.kovan]: { + AAVE: '0xd04647B7CB523bb9f26730E9B6dE1174db7591Ad', + BAT: '0x0e4fcEC26c9f85c3D714370c98f43C4E02Fc35Ae', + BUSD: '0xbF7A18ea5DE0501f7559144e702b29c55b055CcB', + DAI: '0x22B58f1EbEDfCA50feF632bD73368b2FdA96D541', + ENJ: '0xfaDbe2ee798889F02d1d39eDaD98Eff4c7fe95D4', + KNC: '0xb8E8130d244CFd13a75D6B9Aee029B1C33c808A7', + LINK: '0x3Af8C569ab77af5230596Acf0E8c2F9351d24C38', + MANA: '0x1b93D8E109cfeDcBb3Cc74eD761DE286d5771511', + MKR: '0x0B156192e04bAD92B6C1C13cf8739d14D78D5701', + REN: '0xF1939BECE7708382b5fb5e559f630CB8B39a10ee', + SNX: '0xF9A76ae7a1075Fe7d646b06fF05Bd48b9FA5582e', + SUSD: '0xb343e7a1aF578FA35632435243D814e7497622f7', + TUSD: '0x7aeCF1c19661d12E962b69eBC8f6b2E63a55C660', + UNI: '0x17756515f112429471F86f98D5052aCB6C47f6ee', + USDC: '0x64EaC61A2DFda2c3Fa04eED49AA33D021AeC8838', + USDT: '0x0bF499444525a23E7Bb61997539725cA2e928138', + WBTC: '0xF7904a295A029a3aBDFFB6F12755974a958C7C25', + YFI: '0xC5d1B1DEb2992738C0273408ac43e1e906086B6C', + ZRX: '0xBc3f28Ccc21E9b5856E81E6372aFf57307E2E883', + USD: '0x9326BFA02ADD2366b30bacB125260Af641031331', + }, + [EthereumNetwork.ropsten]: { + AAVE: ZERO_ADDRESS, + BAT: '0xafd8186c962daf599f171b8600f3e19af7b52c92', + BUSD: '0x0A32D96Ff131cd5c3E0E5AAB645BF009Eda61564', + DAI: '0x64b8e49baded7bfb2fd5a9235b2440c0ee02971b', + ENJ: ZERO_ADDRESS, + KNC: '0x19d97ceb36624a31d827032d8216dd2eb15e9845', + LINK: '0xb8c99b98913bE2ca4899CdcaF33a3e519C20EeEc', + MANA: '0xDab909dedB72573c626481fC98CEE1152b81DEC2', + MKR: '0x811B1f727F8F4aE899774B568d2e72916D91F392', + REN: ZERO_ADDRESS, + SNX: '0xA95674a8Ed9aa9D2E445eb0024a9aa05ab44f6bf', + SUSD: '0xe054b4aee7ac7645642dd52f1c892ff0128c98f0', + TUSD: '0x523ac85618df56e940534443125ef16daf785620', + UNI: ZERO_ADDRESS, + USDC: '0xe1480303dde539e2c241bdc527649f37c9cbef7d', + USDT: '0xc08fe0c4d97ccda6b40649c6da621761b628c288', + WBTC: '0x5b8B87A0abA4be247e660B0e0143bB30Cdf566AF', + YFI: ZERO_ADDRESS, + ZRX: '0x1d0052e4ae5b4ae4563cbac50edc3627ca0460d7', + USD: '0x8468b2bDCE073A157E560AA4D9CcF6dB1DB98507', + }, + [EthereumNetwork.main]: { + AAVE: '0x6Df09E975c830ECae5bd4eD9d90f3A95a4f88012', + BAT: '0x0d16d4528239e9ee52fa531af613AcdB23D88c94', + BUSD: '0x614715d2Af89E6EC99A233818275142cE88d1Cfd', + DAI: '0x773616E4d11A78F511299002da57A0a94577F1f4', + ENJ: '0x24D9aB51950F3d62E9144fdC2f3135DAA6Ce8D1B', + KNC: '0x656c0544eF4C98A6a98491833A89204Abb045d6b', + LINK: '0xDC530D9457755926550b59e8ECcdaE7624181557', + MANA: '0x82A44D92D6c329826dc557c5E1Be6ebeC5D5FeB9', + MKR: '0x24551a8Fb2A7211A25a17B1481f043A8a8adC7f2', + REN: '0x3147D7203354Dc06D9fd350c7a2437bcA92387a4', + SNX: '0x79291A9d692Df95334B1a0B3B4AE6bC606782f8c', + SUSD: '0x8e0b7e6062272B5eF4524250bFFF8e5Bd3497757', + TUSD: '0x3886BA987236181D98F2401c507Fb8BeA7871dF2', + UNI: '0xD6aA3D25116d8dA79Ea0246c4826EB951872e02e', + USDC: '0x986b5E1e1755e3C2440e960477f25201B0a8bbD4', + USDT: '0xEe9F2375b4bdF6387aa8265dD4FB8F16512A1d46', + WBTC: '0xdeb288F737066589598e9214E782fa5A8eD689e8', + YFI: '0x7c5d4F8345e66f68099581Db340cd65B078C41f4', + ZRX: '0x2Da4983a622a8498bb1a21FaE9D8F6C664939962', + USD: '0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419', + }, + [EthereumNetwork.tenderlyMain]: { + AAVE: '0x6Df09E975c830ECae5bd4eD9d90f3A95a4f88012', + BAT: '0x0d16d4528239e9ee52fa531af613AcdB23D88c94', + BUSD: '0x614715d2Af89E6EC99A233818275142cE88d1Cfd', + DAI: '0x773616E4d11A78F511299002da57A0a94577F1f4', + ENJ: '0x24D9aB51950F3d62E9144fdC2f3135DAA6Ce8D1B', + KNC: '0x656c0544eF4C98A6a98491833A89204Abb045d6b', + LINK: '0xDC530D9457755926550b59e8ECcdaE7624181557', + MANA: '0x82A44D92D6c329826dc557c5E1Be6ebeC5D5FeB9', + MKR: '0x24551a8Fb2A7211A25a17B1481f043A8a8adC7f2', + REN: '0x3147D7203354Dc06D9fd350c7a2437bcA92387a4', + SNX: '0x79291A9d692Df95334B1a0B3B4AE6bC606782f8c', + SUSD: '0x8e0b7e6062272B5eF4524250bFFF8e5Bd3497757', + TUSD: '0x3886BA987236181D98F2401c507Fb8BeA7871dF2', + UNI: '0xD6aA3D25116d8dA79Ea0246c4826EB951872e02e', + USDC: '0x986b5E1e1755e3C2440e960477f25201B0a8bbD4', + USDT: '0xEe9F2375b4bdF6387aa8265dD4FB8F16512A1d46', + WBTC: '0xdeb288F737066589598e9214E782fa5A8eD689e8', + YFI: '0x7c5d4F8345e66f68099581Db340cd65B078C41f4', + ZRX: '0x2Da4983a622a8498bb1a21FaE9D8F6C664939962', + USD: '0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419', + }, + }, + ReserveAssets: { + [eEthereumNetwork.coverage]: {}, + [eEthereumNetwork.hardhat]: {}, + [eEthereumNetwork.buidlerevm]: {}, + [EthereumNetwork.main]: {}, + [EthereumNetwork.kovan]: {}, + [EthereumNetwork.ropsten]: {}, + [EthereumNetwork.tenderlyMain]: {}, + }, + ReservesConfig: {}, + ATokenDomainSeparator: { + [eEthereumNetwork.coverage]: + '0x95b73a72c6ecf4ccbbba5178800023260bad8e75cdccdb8e4827a2977a37c820', + [eEthereumNetwork.hardhat]: + '0xbae024d959c6a022dc5ed37294cd39c141034b2ae5f02a955cce75c930a81bf5', + [eEthereumNetwork.buidlerevm]: + '0xbae024d959c6a022dc5ed37294cd39c141034b2ae5f02a955cce75c930a81bf5', + [eEthereumNetwork.kovan]: '', + [eEthereumNetwork.ropsten]: '', + [eEthereumNetwork.main]: '', + [eEthereumNetwork.tenderlyMain]: '', + }, + WETH: { + [eEthereumNetwork.coverage]: '', // deployed in local evm + [eEthereumNetwork.hardhat]: '', // deployed in local evm + [eEthereumNetwork.buidlerevm]: '', // deployed in local evm + [eEthereumNetwork.kovan]: '0xd0a1e359811322d97991e03f863a0c30c2cf029c', + [eEthereumNetwork.ropsten]: '0xc778417e063141139fce010982780140aa0cd5ab', + [eEthereumNetwork.main]: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', + [eEthereumNetwork.tenderlyMain]: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', + }, + ReserveFactorTreasuryAddress: { + [eEthereumNetwork.coverage]: '0x464c71f6c2f760dda6093dcb91c24c39e5d6e18c', + [eEthereumNetwork.hardhat]: '0x464c71f6c2f760dda6093dcb91c24c39e5d6e18c', + [eEthereumNetwork.buidlerevm]: '0x464c71f6c2f760dda6093dcb91c24c39e5d6e18c', + [eEthereumNetwork.kovan]: '0x464c71f6c2f760dda6093dcb91c24c39e5d6e18c', + [eEthereumNetwork.ropsten]: '0x464c71f6c2f760dda6093dcb91c24c39e5d6e18c', + [eEthereumNetwork.main]: '0x464c71f6c2f760dda6093dcb91c24c39e5d6e18c', + [eEthereumNetwork.tenderlyMain]: '0x464c71f6c2f760dda6093dcb91c24c39e5d6e18c', + }, +}; diff --git a/markets/uniswap/index.ts b/markets/uniswap/index.ts new file mode 100644 index 00000000..37daa4af --- /dev/null +++ b/markets/uniswap/index.ts @@ -0,0 +1,88 @@ +import { oneRay, ZERO_ADDRESS } from '../../helpers/constants'; +import { IUniswapConfiguration, EthereumNetwork, eEthereumNetwork } from '../../helpers/types'; + +import { CommonsConfig } from './commons'; +import { + strategyDAI, + strategyUSDC, + strategyUSDT, + strategyWETH, + strategyWBTC, + strategyWETHWBTC, + strategyWETHDAI +} from './reservesConfigs'; + +// ---------------- +// POOL--SPECIFIC PARAMS +// ---------------- + +export const UniswapConfig: IUniswapConfiguration = { + ...CommonsConfig, + MarketId: 'Uniswap V2 market', + ProviderId: 2, + ReservesConfig: { + DAI: strategyDAI, + USDC: strategyUSDC, + USDT: strategyUSDT, + WBTC: strategyWBTC, + WETH: strategyWETH, + WETHDAI: strategyWETHDAI, + WETHWBTC: strategyWETHWBTC + }, + ReserveAssets: { + [eEthereumNetwork.buidlerevm]: {}, + [eEthereumNetwork.hardhat]: {}, + [eEthereumNetwork.coverage]: {}, + [EthereumNetwork.kovan]: { + DAI: '0xFf795577d9AC8bD7D90Ee22b6C1703490b6512FD', + USDC: '0xe22da380ee6B445bb8273C81944ADEB6E8450422', + USDT: '0x13512979ADE267AB5100878E2e0f485B568328a4', + WBTC: '0xD1B98B6607330172f1D991521145A22BCe793277', + WETH: '0xd0a1e359811322d97991e03f863a0c30c2cf029c', + WETHDAI: '', + WETHWBTC: '', + }, + [EthereumNetwork.ropsten]: { + // AAVE: '', + // BAT: '0x85B24b3517E3aC7bf72a14516160541A60cFF19d', + // BUSD: '0xFA6adcFf6A90c11f31Bc9bb59eC0a6efB38381C6', + // DAI: '0xf80A32A835F79D7787E8a8ee5721D0fEaFd78108', + // ENJ: ZERO_ADDRESS, + // KNC: '0xCe4aA1dE3091033Ba74FA2Ad951f6adc5E5cF361', + // LINK: '0x1a906E71FF9e28d8E01460639EB8CF0a6f0e2486', + // MANA: '0x78b1F763857C8645E46eAdD9540882905ff32Db7', + // MKR: '0x2eA9df3bABe04451c9C3B06a2c844587c59d9C37', + // REN: ZERO_ADDRESS, + // SNX: '0xF80Aa7e2Fda4DA065C55B8061767F729dA1476c7', + // SUSD: '0xc374eB17f665914c714Ac4cdC8AF3a3474228cc5', + // TUSD: '0xa2EA00Df6d8594DBc76b79beFe22db9043b8896F', + // UNI: ZERO_ADDRESS, + // USDC: '0x851dEf71f0e6A903375C1e536Bd9ff1684BAD802', + // USDT: '0xB404c51BBC10dcBE948077F18a4B8E553D160084', + // WBTC: '0xa0E54Ab6AA5f0bf1D62EC3526436F3c05b3348A0', + // WETH: '0xc778417e063141139fce010982780140aa0cd5ab', + // YFI: ZERO_ADDRESS, + // ZRX: '0x02d7055704EfF050323A2E5ee4ba05DB2A588959', + }, + [EthereumNetwork.main]: { + DAI: '0x6B175474E89094C44Da98b954EedeAC495271d0F', + USDC: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', + USDT: '0xdAC17F958D2ee523a2206206994597C13D831ec7', + WBTC: '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', + WETH: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', + WETHDAI: '0xA478c2975Ab1Ea89e8196811F51A7B7Ade33eB11', + WETHWBTC: '0xBb2b8038a1640196FbE3e38816F3e67Cba72D940', + }, + [EthereumNetwork.tenderlyMain]: { + DAI: '0x6B175474E89094C44Da98b954EedeAC495271d0F', + USDC: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', + USDT: '0xdAC17F958D2ee523a2206206994597C13D831ec7', + WBTC: '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', + WETH: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', + WETHDAI: '0xA478c2975Ab1Ea89e8196811F51A7B7Ade33eB11', + WETHWBTC: '0xBb2b8038a1640196FbE3e38816F3e67Cba72D940', + }, + }, +}; + +export default UniswapConfig; diff --git a/markets/uniswap/reservesConfigs.ts b/markets/uniswap/reservesConfigs.ts new file mode 100644 index 00000000..caeaba46 --- /dev/null +++ b/markets/uniswap/reservesConfigs.ts @@ -0,0 +1,122 @@ +import BigNumber from 'bignumber.js'; +import { oneRay } from '../../helpers/constants'; +import { eContractid, IReserveParams } from '../../helpers/types'; + +export const strategyWETH: IReserveParams = { + optimalUtilizationRate: new BigNumber(0.65).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(), + variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(), + variableRateSlope2: new BigNumber(1).multipliedBy(oneRay).toFixed(), + stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(), + stableRateSlope2: new BigNumber(1).multipliedBy(oneRay).toFixed(), + baseLTVAsCollateral: '8000', + liquidationThreshold: '8250', + liquidationBonus: '10500', + borrowingEnabled: true, + stableBorrowRateEnabled: true, + reserveDecimals: '18', + aTokenImpl: eContractid.AToken, + reserveFactor: '1000' +}; + +export const strategyWBTC: IReserveParams = { + optimalUtilizationRate: new BigNumber(0.65).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: '0', + variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(), + variableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(), + stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(), + stableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(), + baseLTVAsCollateral: '7000', + liquidationThreshold: '7500', + liquidationBonus: '11000', + borrowingEnabled: true, + stableBorrowRateEnabled: true, + reserveDecimals: '8', + aTokenImpl: eContractid.AToken, + reserveFactor: '2000' +}; + +export const strategyDAI: IReserveParams = { + optimalUtilizationRate: new BigNumber(0.8).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(), + variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(), + variableRateSlope2: new BigNumber(0.75).multipliedBy(oneRay).toFixed(), + stableRateSlope1: new BigNumber(0.02).multipliedBy(oneRay).toFixed(), + stableRateSlope2: new BigNumber(0.75).multipliedBy(oneRay).toFixed(), + baseLTVAsCollateral: '7500', + liquidationThreshold: '8000', + liquidationBonus: '10500', + borrowingEnabled: true, + stableBorrowRateEnabled: true, + reserveDecimals: '18', + aTokenImpl: eContractid.AToken, + reserveFactor: '1000' +}; + +export const strategyUSDC: IReserveParams = { + optimalUtilizationRate: new BigNumber(0.9).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(), + variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(), + variableRateSlope2: new BigNumber(0.60).multipliedBy(oneRay).toFixed(), + stableRateSlope1: new BigNumber(0.02).multipliedBy(oneRay).toFixed(), + stableRateSlope2: new BigNumber(0.60).multipliedBy(oneRay).toFixed(), + baseLTVAsCollateral: '8000', + liquidationThreshold: '8500', + liquidationBonus: '10500', + borrowingEnabled: true, + stableBorrowRateEnabled: true, + reserveDecimals: '6', + aTokenImpl: eContractid.AToken, + reserveFactor: '1000' +}; + +export const strategyUSDT: IReserveParams = { + optimalUtilizationRate: new BigNumber(0.9).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(), + variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(), + variableRateSlope2: new BigNumber(0.60).multipliedBy(oneRay).toFixed(), + stableRateSlope1: new BigNumber(0.02).multipliedBy(oneRay).toFixed(), + stableRateSlope2: new BigNumber(0.60).multipliedBy(oneRay).toFixed(), + baseLTVAsCollateral: '8000', + liquidationThreshold: '8500', + liquidationBonus: '10500', + borrowingEnabled: true, + stableBorrowRateEnabled: true, + reserveDecimals: '6', + aTokenImpl: eContractid.AToken, + reserveFactor: '1000' +}; + +export const strategyWETHDAI: IReserveParams = { + optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: '0', + variableRateSlope1: '0', + variableRateSlope2: '0', + stableRateSlope1: '0', + stableRateSlope2: '0', + baseLTVAsCollateral: '5000', + liquidationThreshold: '6500', + liquidationBonus: '11000', + borrowingEnabled: true, + stableBorrowRateEnabled: true, + reserveDecimals: '18', + aTokenImpl: eContractid.AToken, + reserveFactor: '1000' +}; + +export const strategyWETHWBTC: IReserveParams = { + optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: '0', + variableRateSlope1: '0', + variableRateSlope2: '0', + stableRateSlope1: '0', + stableRateSlope2: '0', + baseLTVAsCollateral: '5000', + liquidationThreshold: '6500', + liquidationBonus: '11000', + borrowingEnabled: true, + stableBorrowRateEnabled: true, + reserveDecimals: '18', + aTokenImpl: eContractid.AToken, + reserveFactor: '1000' +}; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 32738e30..dfdeb1a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2908,15 +2908,6 @@ "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", "dev": true }, - "bufferutil": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.2.tgz", - "integrity": "sha512-AtnG3W6M8B2n4xDQ5R+70EXvOpnXsFYg/AK2yTZd+HQ/oxAdz+GI+DvjmhBw3L0ole+LJ0ngqY4JMbDzkfNzhA==", - "dev": true, - "requires": { - "node-gyp-build": "^4.2.0" - } - }, "buidler-typechain": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/buidler-typechain/-/buidler-typechain-0.1.1.tgz", @@ -3111,33 +3102,6 @@ "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", "dev": true }, - "cids": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/cids/-/cids-0.7.5.tgz", - "integrity": "sha512-zT7mPeghoWAu+ppn8+BS1tQ5qGmbMfB4AregnQjA/qHY3GC1m1ptI9GkWNlgeu38r7CuRdXB47uY2XgAYt6QVA==", - "dev": true, - "optional": true, - "requires": { - "buffer": "^5.5.0", - "class-is": "^1.1.0", - "multibase": "~0.6.0", - "multicodec": "^1.0.0", - "multihashes": "~0.4.15" - }, - "dependencies": { - "multicodec": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-1.0.4.tgz", - "integrity": "sha512-NDd7FeS3QamVtbgfvu5h7fd1IlbaC4EQ0/pgU4zqE2vdHCmBGsUa0TiM8/TdSeG6BMPC92OOCf8F1ocE/Wkrrg==", - "dev": true, - "optional": true, - "requires": { - "buffer": "^5.6.0", - "varint": "^5.0.0" - } - } - } - }, "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", @@ -3148,13 +3112,6 @@ "safe-buffer": "^5.0.1" } }, - "class-is": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/class-is/-/class-is-1.1.0.tgz", - "integrity": "sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw==", - "dev": true, - "optional": true - }, "class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", @@ -3257,6 +3214,7 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, "requires": { "color-name": "1.1.3" } @@ -3264,7 +3222,8 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true }, "colors": { "version": "1.4.0", @@ -3398,18 +3357,6 @@ } } }, - "content-hash": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/content-hash/-/content-hash-2.5.2.tgz", - "integrity": "sha512-FvIQKy0S1JaWV10sMsA7TRx8bpU+pqPkhbsfvOJAdjRXvYxEckAwQWGwtRjiaJfh+E0DvcWUGqcdjwMGFjsSdw==", - "dev": true, - "optional": true, - "requires": { - "cids": "^0.7.1", - "multicodec": "^0.5.5", - "multihashes": "^0.4.15" - } - }, "content-type": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", @@ -6352,6 +6299,148 @@ "@ethersproject/strings": ">=5.0.0-beta.130" } }, + "@ethersproject/address": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.0.5.tgz", + "integrity": "sha512-DpkQ6rwk9jTefrRsJzEm6nhRiJd9pvhn1xN0rw5N/jswXG5r7BLk/GVA0mMAVWAsYfvi2xSc5L41FMox43RYEA==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/bignumber": "^5.0.7", + "@ethersproject/bytes": "^5.0.4", + "@ethersproject/keccak256": "^5.0.3", + "@ethersproject/logger": "^5.0.5", + "@ethersproject/rlp": "^5.0.3", + "bn.js": "^4.4.0" + } + }, + "@ethersproject/bignumber": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.0.8.tgz", + "integrity": "sha512-KXFVAFKS1jdTXYN8BE5Oj+ZfPMh28iRdFeNGBVT6cUFdtiPVqeXqc0ggvBqA3A1VoFFGgM7oAeaagA393aORHA==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/bytes": "^5.0.4", + "@ethersproject/logger": "^5.0.5", + "bn.js": "^4.4.0" + } + }, + "@ethersproject/bytes": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.0.5.tgz", + "integrity": "sha512-IEj9HpZB+ACS6cZ+QQMTqmu/cnUK2fYNE6ms/PVxjoBjoxc6HCraLpam1KuRvreMy0i523PLmjN8OYeikRdcUQ==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/logger": "^5.0.5" + } + }, + "@ethersproject/constants": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.0.5.tgz", + "integrity": "sha512-foaQVmxp2+ik9FrLUCtVrLZCj4M3Ibgkqvh+Xw/vFRSerkjVSYePApaVE5essxhoSlF1U9oXfWY09QI2AXtgKA==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/bignumber": "^5.0.7" + } + }, + "@ethersproject/hash": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.0.5.tgz", + "integrity": "sha512-GpI80/h2HDpfNKpCZoxQJCjOQloGnlD5hM1G+tZe8FQDJhEvFjJoPDuWv+NaYjJfOciKS2Axqc4Q4WamdLoUgg==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/bytes": "^5.0.4", + "@ethersproject/keccak256": "^5.0.3", + "@ethersproject/logger": "^5.0.5", + "@ethersproject/strings": "^5.0.4" + } + }, + "@ethersproject/keccak256": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.0.4.tgz", + "integrity": "sha512-GNpiOUm9PGUxFNqOxYKDQBM0u68bG9XC9iOulEQ8I0tOx/4qUpgVzvgXL6ugxr0RY554Gz/NQsVqknqPzUcxpQ==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/bytes": "^5.0.4", + "js-sha3": "0.5.7" + } + }, + "@ethersproject/logger": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.0.6.tgz", + "integrity": "sha512-FrX0Vnb3JZ1md/7GIZfmJ06XOAA8r3q9Uqt9O5orr4ZiksnbpXKlyDzQtlZ5Yv18RS8CAUbiKH9vwidJg1BPmQ==", + "dev": true, + "optional": true + }, + "@ethersproject/properties": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.0.4.tgz", + "integrity": "sha512-UdyX3GqBxFt15B0uSESdDNmhvEbK3ACdDXl2soshoPcneXuTswHDeA0LoPlnaZzhbgk4p6jqb4GMms5C26Qu6A==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/logger": "^5.0.5" + } + }, + "@ethersproject/rlp": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.0.4.tgz", + "integrity": "sha512-5qrrZad7VTjofxSsm7Zg/7Dr4ZOln4S2CqiDdOuTv6MBKnXj0CiBojXyuDy52M8O3wxH0CyE924hXWTDV1PQWQ==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/bytes": "^5.0.4", + "@ethersproject/logger": "^5.0.5" + } + }, + "@ethersproject/signing-key": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.0.5.tgz", + "integrity": "sha512-Z1wY7JC1HVO4CvQWY2TyTTuAr8xK3bJijZw1a9G92JEmKdv1j255R/0YLBBcFTl2J65LUjtXynNJ2GbArPGi5g==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/bytes": "^5.0.4", + "@ethersproject/logger": "^5.0.5", + "@ethersproject/properties": "^5.0.3", + "elliptic": "6.5.3" + } + }, + "@ethersproject/strings": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.0.5.tgz", + "integrity": "sha512-JED6WaIV00xM/gvj8vSnd+0VWtDYdidTmavFRCTQakqfz+4tDo6Jz5LHgG+dd45h7ah7ykCHW0C7ZXWEDROCXQ==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/bytes": "^5.0.4", + "@ethersproject/constants": "^5.0.4", + "@ethersproject/logger": "^5.0.5" + } + }, + "@ethersproject/transactions": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.0.6.tgz", + "integrity": "sha512-htsFhOD+NMBxx676A8ehSuwVV49iqpSB+CkjPZ02tpNew0K6p8g0CZ46Z1ZP946gIHAU80xQ0NACHYrjIUaCFA==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/address": "^5.0.4", + "@ethersproject/bignumber": "^5.0.7", + "@ethersproject/bytes": "^5.0.4", + "@ethersproject/constants": "^5.0.4", + "@ethersproject/keccak256": "^5.0.3", + "@ethersproject/logger": "^5.0.5", + "@ethersproject/properties": "^5.0.3", + "@ethersproject/rlp": "^5.0.3", + "@ethersproject/signing-key": "^5.0.4" + } + }, "@sindresorhus/is": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", @@ -6369,14 +6458,6 @@ "defer-to-connect": "^1.0.1" } }, - "@types/bignumber.js": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@types/bignumber.js/-/bignumber.js-5.0.0.tgz", - "integrity": "sha512-0DH7aPGCClywOFaxxjE6UwpN2kQYe9LwuDQMv+zYA97j5GkOMo8e66LYT+a8JYU7jfmUFRZLa9KycxHDsKXJCA==", - "requires": { - "bignumber.js": "*" - } - }, "@types/bn.js": { "version": "4.11.6", "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", @@ -6410,53 +6491,11 @@ "@types/node": "*" } }, - "@web3-js/scrypt-shim": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@web3-js/scrypt-shim/-/scrypt-shim-0.1.0.tgz", - "integrity": "sha512-ZtZeWCc/s0nMcdx/+rZwY1EcuRdemOK9ag21ty9UsHkFxsNb/AaoucUz0iPuyGe0Ku+PFuRmWZG7Z7462p9xPw==", - "requires": { - "scryptsy": "^2.1.0", - "semver": "^6.3.0" - }, - "dependencies": { - "scryptsy": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-2.1.0.tgz", - "integrity": "sha512-1CdSqHQowJBnMAFyPEBRfqag/YP9OF394FV+4YREIJX4ljD7OxvQRDayyoyyCk+senRjSkP6VnUNQmVQqB6g7w==" - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" - } - } - }, - "@web3-js/websocket": { - "version": "1.0.30", - "resolved": "https://registry.npmjs.org/@web3-js/websocket/-/websocket-1.0.30.tgz", - "integrity": "sha512-fDwrD47MiDrzcJdSeTLF75aCcxVVt8B1N74rA+vh2XCAvFy4tEWJjtnUtj2QG7/zlQ6g9cQ88bZFBxwd9/FmtA==", - "requires": { - "debug": "^2.2.0", - "es5-ext": "^0.10.50", - "nan": "^2.14.0", - "typedarray-to-buffer": "^3.1.5", - "yaeti": "^0.0.6" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - } - } + "@yarnpkg/lockfile": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", + "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", + "dev": true }, "abstract-leveldown": { "version": "3.0.0", @@ -6497,112 +6536,32 @@ "uri-js": "^4.2.2" } }, - "ansi-colors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz", - "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==", - "requires": { - "ansi-wrap": "^0.1.0" - } - }, - "ansi-gray": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz", - "integrity": "sha1-KWLPVOyXksSFEKPetSRDaGHvclE=", - "requires": { - "ansi-wrap": "0.1.0" - } - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, "requires": { "color-convert": "^1.9.0" } }, - "ansi-wrap": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz", - "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=" - }, - "any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" - }, - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - }, - "dependencies": { - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "requires": { - "remove-trailing-separator": "^1.0.1" - } - } - } - }, - "append-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz", - "integrity": "sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE=", - "requires": { - "buffer-equal": "^1.0.0" - } - }, - "archy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=" - }, "arr-diff": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=" - }, - "arr-filter": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/arr-filter/-/arr-filter-1.1.2.tgz", - "integrity": "sha1-Q/3d0JHo7xGqTEXZzcGOLf8XEe4=", - "requires": { - "make-iterator": "^1.0.0" - } + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true }, "arr-flatten": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" - }, - "arr-map": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/arr-map/-/arr-map-2.0.2.tgz", - "integrity": "sha1-Onc0X/wc814qkYJWAfnljy4kysQ=", - "requires": { - "make-iterator": "^1.0.0" - } + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true }, "arr-union": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" - }, - "array-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", - "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=" + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true }, "array-flatten": { "version": "1.1.1", @@ -6611,63 +6570,11 @@ "dev": true, "optional": true }, - "array-initial": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/array-initial/-/array-initial-1.1.0.tgz", - "integrity": "sha1-L6dLJnOTccOUe9enrcc74zSz15U=", - "requires": { - "array-slice": "^1.0.0", - "is-number": "^4.0.0" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==" - } - } - }, - "array-last": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/array-last/-/array-last-1.3.0.tgz", - "integrity": "sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg==", - "requires": { - "is-number": "^4.0.0" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==" - } - } - }, - "array-slice": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", - "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==" - }, - "array-sort": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-sort/-/array-sort-1.0.0.tgz", - "integrity": "sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg==", - "requires": { - "default-compare": "^1.0.0", - "get-value": "^2.0.6", - "kind-of": "^5.0.2" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" - } - } - }, "array-unique": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true }, "asn1": { "version": "0.2.4", @@ -6700,7 +6607,8 @@ "assign-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=" + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true }, "async": { "version": "2.6.2", @@ -6711,22 +6619,6 @@ "lodash": "^4.17.11" } }, - "async-done": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.2.tgz", - "integrity": "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==", - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.2", - "process-nextick-args": "^2.0.0", - "stream-exhaust": "^1.0.1" - } - }, - "async-each": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", - "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==" - }, "async-eventemitter": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz", @@ -6742,14 +6634,6 @@ "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", "dev": true }, - "async-settle": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async-settle/-/async-settle-1.0.0.tgz", - "integrity": "sha1-HQqRS7Aldb7IqPOnTlCA9yssDGs=", - "requires": { - "async-done": "^1.2.2" - } - }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -6759,7 +6643,8 @@ "atob": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true }, "aws-sign2": { "version": "0.7.0", @@ -6784,6 +6669,12 @@ "js-tokens": "^3.0.2" }, "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", @@ -6809,6 +6700,15 @@ "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", "dev": true }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", @@ -6853,16 +6753,22 @@ "ms": "2.0.0" } }, + "json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", "dev": true } } @@ -6888,12 +6794,6 @@ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", "dev": true - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true } } }, @@ -7406,21 +7306,6 @@ "source-map-support": "^0.4.15" }, "dependencies": { - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - }, "source-map-support": { "version": "0.4.18", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", @@ -7481,6 +7366,12 @@ "ms": "2.0.0" } }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -7499,6 +7390,14 @@ "esutils": "^2.0.2", "lodash": "^4.17.4", "to-fast-properties": "^1.0.3" + }, + "dependencies": { + "to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", + "dev": true + } } }, "babelify": { @@ -7517,22 +7416,6 @@ "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", "dev": true }, - "bach": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/bach/-/bach-1.2.0.tgz", - "integrity": "sha1-Szzpa/JxNPeaG0FKUcFONMO9mIA=", - "requires": { - "arr-filter": "^1.1.1", - "arr-flatten": "^1.0.1", - "arr-map": "^2.0.0", - "array-each": "^1.0.0", - "array-initial": "^1.0.0", - "array-last": "^1.1.1", - "async-done": "^1.2.2", - "async-settle": "^1.0.0", - "now-and-later": "^2.0.0" - } - }, "backoff": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/backoff/-/backoff-2.5.0.tgz", @@ -7545,12 +7428,14 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true }, "base": { "version": "0.11.2", "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, "requires": { "cache-base": "^1.0.1", "class-utils": "^0.3.5", @@ -7565,35 +7450,10 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, "requires": { "is-descriptor": "^1.0.0" } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } } } }, @@ -7601,6 +7461,7 @@ "version": "3.0.8", "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", "integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==", + "dev": true, "requires": { "safe-buffer": "^5.0.1" } @@ -7608,7 +7469,8 @@ "base64-js": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", - "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" + "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==", + "dev": true }, "bcrypt-pbkdf": { "version": "1.0.2", @@ -7630,20 +7492,9 @@ "bignumber.js": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz", - "integrity": "sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA==" - }, - "binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==" - }, - "bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "requires": { - "file-uri-to-path": "1.0.0" - } + "integrity": "sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA==", + "dev": true, + "optional": true }, "bip39": { "version": "2.5.0", @@ -7658,66 +7509,6 @@ "unorm": "^1.3.3" } }, - "bip66": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", - "integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "bl": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", - "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", - "requires": { - "readable-stream": "^2.3.5", - "safe-buffer": "^5.1.1" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - } - } - }, "blakejs": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.0.tgz", @@ -7734,7 +7525,8 @@ "bn.js": { "version": "4.11.9", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==" + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true }, "body-parser": { "version": "1.19.0", @@ -7785,44 +7577,23 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=" - } - } - }, "brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true }, "browserify-aes": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, "requires": { "buffer-xor": "^1.0.3", "cipher-base": "^1.0.0", @@ -7921,6 +7692,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", + "dev": true, "requires": { "base-x": "^3.0.2" } @@ -7929,6 +7701,7 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", + "dev": true, "requires": { "bs58": "^4.0.0", "create-hash": "^1.1.0", @@ -7939,44 +7712,17 @@ "version": "5.6.0", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz", "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==", + "dev": true, "requires": { "base64-js": "^1.0.2", "ieee754": "^1.1.4" } }, - "buffer-alloc": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", - "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", - "requires": { - "buffer-alloc-unsafe": "^1.1.0", - "buffer-fill": "^1.0.0" - } - }, - "buffer-alloc-unsafe": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", - "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==" - }, - "buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=" - }, - "buffer-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz", - "integrity": "sha1-WWFrSYME1Var1GaWayLu2j7KX74=" - }, - "buffer-fill": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", - "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=" - }, "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true }, "buffer-to-arraybuffer": { "version": "0.0.5", @@ -7988,7 +7734,25 @@ "buffer-xor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "bufferutil": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.1.tgz", + "integrity": "sha512-xowrxvpxojqkagPcWRQVXZl0YXhRhAtBEIq3VoER1NH5Mw1n1o0ojdspp+GS2J//2gCVyrzQDApQ4unGF+QOoA==", + "dev": true, + "requires": { + "node-gyp-build": "~3.7.0" + }, + "dependencies": { + "node-gyp-build": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.7.0.tgz", + "integrity": "sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w==", + "dev": true + } + } }, "bytes": { "version": "3.1.0", @@ -8020,6 +7784,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, "requires": { "collection-visit": "^1.0.0", "component-emitter": "^1.2.1", @@ -8048,16 +7813,6 @@ "responselike": "^1.0.2" }, "dependencies": { - "get-stream": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz", - "integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==", - "dev": true, - "optional": true, - "requires": { - "pump": "^3.0.0" - } - }, "lowercase-keys": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", @@ -8097,11 +7852,6 @@ } } }, - "camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=" - }, "caniuse-lite": { "version": "1.0.30001146", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001146.tgz", @@ -8118,6 +7868,7 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, "requires": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -8133,24 +7884,6 @@ "functional-red-black-tree": "^1.0.1" } }, - "chokidar": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", - "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", - "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - } - }, "chownr": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", @@ -8158,19 +7891,61 @@ "dev": true, "optional": true }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "cids": { + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/cids/-/cids-0.7.5.tgz", + "integrity": "sha512-zT7mPeghoWAu+ppn8+BS1tQ5qGmbMfB4AregnQjA/qHY3GC1m1ptI9GkWNlgeu38r7CuRdXB47uY2XgAYt6QVA==", + "dev": true, + "optional": true, + "requires": { + "buffer": "^5.5.0", + "class-is": "^1.1.0", + "multibase": "~0.6.0", + "multicodec": "^1.0.0", + "multihashes": "~0.4.15" + }, + "dependencies": { + "multicodec": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-1.0.4.tgz", + "integrity": "sha512-NDd7FeS3QamVtbgfvu5h7fd1IlbaC4EQ0/pgU4zqE2vdHCmBGsUa0TiM8/TdSeG6BMPC92OOCf8F1ocE/Wkrrg==", + "dev": true, + "optional": true, + "requires": { + "buffer": "^5.6.0", + "varint": "^5.0.0" + } + } + } + }, "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, "requires": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" } }, + "class-is": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/class-is/-/class-is-1.1.0.tgz", + "integrity": "sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw==", + "dev": true, + "optional": true + }, "class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, "requires": { "arr-union": "^3.1.0", "define-property": "^0.2.5", @@ -8181,29 +7956,82 @@ "define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=" + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true } } }, - "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" - } - }, "clone": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=" - }, - "clone-buffer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", - "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=" + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true }, "clone-response": { "version": "1.0.2", @@ -8215,83 +8043,30 @@ "mimic-response": "^1.0.0" } }, - "clone-stats": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", - "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=" - }, - "cloneable-readable": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.3.tgz", - "integrity": "sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ==", - "requires": { - "inherits": "^2.0.1", - "process-nextick-args": "^2.0.0", - "readable-stream": "^2.3.5" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" - }, - "collection-map": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-map/-/collection-map-1.0.0.tgz", - "integrity": "sha1-rqDwb40mx4DCt1SUOFVEsiVa8Yw=", - "requires": { - "arr-map": "^2.0.2", - "for-own": "^1.0.0", - "make-iterator": "^1.0.0" - } - }, "collection-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, "requires": { "map-visit": "^1.0.0", "object-visit": "^1.0.0" } }, - "color-support": { + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==" + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true }, "combined-stream": { "version": "1.0.8", @@ -8302,64 +8077,28 @@ "delayed-stream": "~1.0.0" } }, - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" - }, "component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, "concat-stream": { "version": "1.6.2", "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, "requires": { "buffer-from": "^1.0.0", "inherits": "^2.0.3", "readable-stream": "^2.2.2", "typedarray": "^0.0.6" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } } }, "content-disposition": { @@ -8381,6 +8120,18 @@ } } }, + "content-hash": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/content-hash/-/content-hash-2.5.2.tgz", + "integrity": "sha512-FvIQKy0S1JaWV10sMsA7TRx8bpU+pqPkhbsfvOJAdjRXvYxEckAwQWGwtRjiaJfh+E0DvcWUGqcdjwMGFjsSdw==", + "dev": true, + "optional": true, + "requires": { + "cids": "^0.7.1", + "multicodec": "^0.5.5", + "multihashes": "^0.4.15" + } + }, "content-type": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", @@ -8392,6 +8143,7 @@ "version": "1.7.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, "requires": { "safe-buffer": "~5.1.1" }, @@ -8399,7 +8151,8 @@ "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true } } }, @@ -8427,16 +8180,8 @@ "copy-descriptor": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" - }, - "copy-props": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.4.tgz", - "integrity": "sha512-7cjuUME+p+S3HZlbllgsn2CDwS+5eCCX16qBgNC4jgSTf49qR1VKy/Zhl400m0IQXl/bPGEVqncgUUMjrr4s8A==", - "requires": { - "each-props": "^1.3.0", - "is-plain-object": "^2.0.1" - } + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true }, "core-js": { "version": "2.6.11", @@ -8453,7 +8198,8 @@ "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true }, "cors": { "version": "2.8.5", @@ -8481,6 +8227,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, "requires": { "cipher-base": "^1.0.1", "inherits": "^2.0.1", @@ -8493,6 +8240,7 @@ "version": "1.1.7", "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, "requires": { "cipher-base": "^1.0.3", "create-hash": "^1.1.0", @@ -8536,6 +8284,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "dev": true, "requires": { "es5-ext": "^0.10.50", "type": "^1.0.1" @@ -8559,37 +8308,11 @@ "ms": "^2.1.1" } }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" - }, "decode-uri-component": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" - }, - "decompress": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/decompress/-/decompress-4.2.1.tgz", - "integrity": "sha512-e48kc2IjU+2Zw8cTb6VZcJQ3lgVbS4uuB1TfCHbiZIP/haNXm+SVyhu+87jts5/3ROpd82GSVCoNs/z8l4ZOaQ==", - "requires": { - "decompress-tar": "^4.0.0", - "decompress-tarbz2": "^4.0.0", - "decompress-targz": "^4.0.0", - "decompress-unzip": "^4.0.1", - "graceful-fs": "^4.1.10", - "make-dir": "^1.0.0", - "pify": "^2.3.0", - "strip-dirs": "^2.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" - } - } + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true }, "decompress-response": { "version": "3.3.0", @@ -8601,77 +8324,6 @@ "mimic-response": "^1.0.0" } }, - "decompress-tar": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/decompress-tar/-/decompress-tar-4.1.1.tgz", - "integrity": "sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==", - "requires": { - "file-type": "^5.2.0", - "is-stream": "^1.1.0", - "tar-stream": "^1.5.2" - } - }, - "decompress-tarbz2": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz", - "integrity": "sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A==", - "requires": { - "decompress-tar": "^4.1.0", - "file-type": "^6.1.0", - "is-stream": "^1.1.0", - "seek-bzip": "^1.0.5", - "unbzip2-stream": "^1.0.9" - }, - "dependencies": { - "file-type": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-6.2.0.tgz", - "integrity": "sha512-YPcTBDV+2Tm0VqjybVd32MHdlEGAtuxS3VAYsumFokDSMG+ROT5wawGlnHDoz7bfMcMDt9hxuXvXwoKUx2fkOg==" - } - } - }, - "decompress-targz": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/decompress-targz/-/decompress-targz-4.1.1.tgz", - "integrity": "sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w==", - "requires": { - "decompress-tar": "^4.1.1", - "file-type": "^5.2.0", - "is-stream": "^1.1.0" - } - }, - "decompress-unzip": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/decompress-unzip/-/decompress-unzip-4.0.1.tgz", - "integrity": "sha1-3qrM39FK6vhVePczroIQ+bSEj2k=", - "requires": { - "file-type": "^3.8.0", - "get-stream": "^2.2.0", - "pify": "^2.3.0", - "yauzl": "^2.4.2" - }, - "dependencies": { - "file-type": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz", - "integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek=" - }, - "get-stream": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz", - "integrity": "sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4=", - "requires": { - "object-assign": "^4.0.1", - "pinkie-promise": "^2.0.0" - } - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" - } - } - }, "deep-equal": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", @@ -8684,36 +8336,8 @@ "object-is": "^1.0.1", "object-keys": "^1.1.1", "regexp.prototype.flags": "^1.2.0" - }, - "dependencies": { - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true - } } }, - "default-compare": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/default-compare/-/default-compare-1.0.0.tgz", - "integrity": "sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ==", - "requires": { - "kind-of": "^5.0.2" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" - } - } - }, - "default-resolution": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/default-resolution/-/default-resolution-2.0.0.tgz", - "integrity": "sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ=" - }, "defer-to-connect": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", @@ -8725,6 +8349,7 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-4.0.2.tgz", "integrity": "sha512-5fMC8ek8alH16QiV0lTCis610D1Zt1+LA4MS4d63JgS32lrCjTFDUFz2ao09/j2I4Bqb5jL4FZYwu7Jz0XO1ww==", + "dev": true, "requires": { "abstract-leveldown": "~5.0.0", "inherits": "^2.0.3" @@ -8734,6 +8359,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", + "dev": true, "requires": { "xtend": "~4.0.0" } @@ -8744,52 +8370,19 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, "requires": { "object-keys": "^1.0.12" - }, - "dependencies": { - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" - } } }, "define-property": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, "requires": { "is-descriptor": "^1.0.2", "isobject": "^3.0.1" - }, - "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } } }, "defined": { @@ -8829,11 +8422,6 @@ "dev": true, "optional": true }, - "detect-file": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", - "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=" - }, "detect-indent": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", @@ -8870,16 +8458,6 @@ "minimatch": "^3.0.4" } }, - "drbg.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", - "integrity": "sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs=", - "requires": { - "browserify-aes": "^1.0.6", - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4" - } - }, "duplexer3": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", @@ -8887,60 +8465,6 @@ "dev": true, "optional": true }, - "duplexify": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", - "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", - "requires": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "each-props": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/each-props/-/each-props-1.3.2.tgz", - "integrity": "sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA==", - "requires": { - "is-plain-object": "^2.0.1", - "object.defaults": "^1.1.0" - } - }, "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -8968,6 +8492,7 @@ "version": "6.5.3", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", + "dev": true, "requires": { "bn.js": "^4.4.0", "brorand": "^1.0.1", @@ -9033,6 +8558,7 @@ "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, "requires": { "once": "^1.4.0" } @@ -9041,22 +8567,16 @@ "version": "0.1.7", "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", + "dev": true, "requires": { "prr": "~1.0.1" } }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "requires": { - "is-arrayish": "^0.2.1" - } - }, "es-abstract": { "version": "1.17.7", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", + "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", @@ -9069,19 +8589,13 @@ "object.assign": "^4.1.1", "string.prototype.trimend": "^1.0.1", "string.prototype.trimstart": "^1.0.1" - }, - "dependencies": { - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" - } } }, "es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, "requires": { "is-callable": "^1.1.4", "is-date-object": "^1.0.1", @@ -9092,6 +8606,7 @@ "version": "0.10.53", "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "dev": true, "requires": { "es6-iterator": "~2.0.3", "es6-symbol": "~3.1.3", @@ -9102,6 +8617,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "dev": true, "requires": { "d": "1", "es5-ext": "^0.10.35", @@ -9112,22 +8628,12 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "dev": true, "requires": { "d": "^1.0.1", "ext": "^1.1.2" } }, - "es6-weak-map": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", - "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", - "requires": { - "d": "1", - "es5-ext": "^0.10.46", - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.1" - } - }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -9138,7 +8644,8 @@ "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true }, "esutils": { "version": "2.0.3", @@ -9210,15 +8717,6 @@ "requires": { "idna-uts46-hx": "^2.3.1", "js-sha3": "^0.5.7" - }, - "dependencies": { - "js-sha3": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=", - "dev": true, - "optional": true - } } }, "eth-json-rpc-infura": { @@ -9272,12 +8770,6 @@ "abstract-leveldown": "~2.6.0" } }, - "ethereum-common": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.2.0.tgz", - "integrity": "sha512-XOnAR/3rntJgbCdGhqdaLIxDLWKLmsZOGhHdBKadEr6gEnJLH52k93Ou+TUdFaPN3hJc3isBZBal3U/XZ15abA==", - "dev": true - }, "ethereumjs-account": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-2.0.5.tgz", @@ -9300,6 +8792,14 @@ "ethereumjs-tx": "^1.2.2", "ethereumjs-util": "^5.0.0", "merkle-patricia-tree": "^2.1.2" + }, + "dependencies": { + "ethereum-common": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.2.0.tgz", + "integrity": "sha512-XOnAR/3rntJgbCdGhqdaLIxDLWKLmsZOGhHdBKadEr6gEnJLH52k93Ou+TUdFaPN3hJc3isBZBal3U/XZ15abA==", + "dev": true + } } }, "ethereumjs-tx": { @@ -9310,14 +8810,6 @@ "requires": { "ethereum-common": "^0.0.18", "ethereumjs-util": "^5.0.0" - }, - "dependencies": { - "ethereum-common": { - "version": "0.0.18", - "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.0.18.tgz", - "integrity": "sha1-L9w1dvIykDNYl26znaeDIT/5Uj8=", - "dev": true - } } }, "ethereumjs-util": { @@ -9504,13 +8996,36 @@ "prr": "~1.0.1", "semver": "~5.4.1", "xtend": "~4.0.0" + } + }, + "ltgt": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", + "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=", + "dev": true + }, + "memdown": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", + "integrity": "sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=", + "dev": true, + "requires": { + "abstract-leveldown": "~2.7.1", + "functional-red-black-tree": "^1.0.1", + "immediate": "^3.2.3", + "inherits": "~2.0.1", + "ltgt": "~2.2.0", + "safe-buffer": "~5.1.1" }, "dependencies": { - "semver": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", - "dev": true + "abstract-leveldown": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", + "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", + "dev": true, + "requires": { + "xtend": "~4.0.0" + } } } }, @@ -9544,6 +9059,18 @@ "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=", "dev": true }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "dev": true + }, "string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", @@ -9669,12 +9196,6 @@ "abstract-leveldown": "~2.6.0" } }, - "ethereum-common": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.2.0.tgz", - "integrity": "sha512-XOnAR/3rntJgbCdGhqdaLIxDLWKLmsZOGhHdBKadEr6gEnJLH52k93Ou+TUdFaPN3hJc3isBZBal3U/XZ15abA==", - "dev": true - }, "ethereumjs-account": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-2.0.5.tgz", @@ -9697,6 +9218,14 @@ "ethereumjs-tx": "^1.2.2", "ethereumjs-util": "^5.0.0", "merkle-patricia-tree": "^2.1.2" + }, + "dependencies": { + "ethereum-common": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.2.0.tgz", + "integrity": "sha512-XOnAR/3rntJgbCdGhqdaLIxDLWKLmsZOGhHdBKadEr6gEnJLH52k93Ou+TUdFaPN3hJc3isBZBal3U/XZ15abA==", + "dev": true + } } }, "ethereumjs-tx": { @@ -9707,14 +9236,6 @@ "requires": { "ethereum-common": "^0.0.18", "ethereumjs-util": "^5.0.0" - }, - "dependencies": { - "ethereum-common": { - "version": "0.0.18", - "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.0.18.tgz", - "integrity": "sha1-L9w1dvIykDNYl26znaeDIT/5Uj8=", - "dev": true - } } }, "ethereumjs-util": { @@ -9901,13 +9422,36 @@ "prr": "~1.0.1", "semver": "~5.4.1", "xtend": "~4.0.0" + } + }, + "ltgt": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", + "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=", + "dev": true + }, + "memdown": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", + "integrity": "sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=", + "dev": true, + "requires": { + "abstract-leveldown": "~2.7.1", + "functional-red-black-tree": "^1.0.1", + "immediate": "^3.2.3", + "inherits": "~2.0.1", + "ltgt": "~2.2.0", + "safe-buffer": "~5.1.1" }, "dependencies": { - "semver": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", - "dev": true + "abstract-leveldown": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", + "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", + "dev": true, + "requires": { + "xtend": "~4.0.0" + } } } }, @@ -9941,6 +9485,18 @@ "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=", "dev": true }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "dev": true + }, "string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", @@ -10200,13 +9756,36 @@ "prr": "~1.0.1", "semver": "~5.4.1", "xtend": "~4.0.0" + } + }, + "ltgt": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", + "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=", + "dev": true + }, + "memdown": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", + "integrity": "sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=", + "dev": true, + "requires": { + "abstract-leveldown": "~2.7.1", + "functional-red-black-tree": "^1.0.1", + "immediate": "^3.2.3", + "inherits": "~2.0.1", + "ltgt": "~2.2.0", + "safe-buffer": "~5.1.1" }, "dependencies": { - "semver": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", - "dev": true + "abstract-leveldown": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", + "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", + "dev": true, + "requires": { + "xtend": "~4.0.0" + } } } }, @@ -10240,6 +9819,18 @@ "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=", "dev": true }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "dev": true + }, "string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", @@ -10295,34 +9886,6 @@ "ethereum-cryptography": "^0.1.3", "ethjs-util": "0.1.6", "rlp": "^2.2.3" - }, - "dependencies": { - "keccak": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.1.0.tgz", - "integrity": "sha512-m1wbJRTo+gWbctZWay9i26v5fFnYkOn7D5PCxJ3fZUGUEb49dE1Pm4BREUYCt/aoO6di7jeoGmhvqN9Nzylm3Q==", - "requires": { - "bindings": "^1.5.0", - "inherits": "^2.0.4", - "nan": "^2.14.0", - "safe-buffer": "^5.2.0" - } - }, - "secp256k1": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", - "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", - "requires": { - "bindings": "^1.5.0", - "bip66": "^1.1.5", - "bn.js": "^4.11.8", - "create-hash": "^1.2.0", - "drbg.js": "^1.0.1", - "elliptic": "^6.5.2", - "nan": "^2.14.0", - "safe-buffer": "^5.1.2" - } - } } }, "ethereumjs-vm": { @@ -10459,13 +10022,36 @@ "prr": "~1.0.1", "semver": "~5.4.1", "xtend": "~4.0.0" + } + }, + "ltgt": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", + "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=", + "dev": true + }, + "memdown": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", + "integrity": "sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=", + "dev": true, + "requires": { + "abstract-leveldown": "~2.7.1", + "functional-red-black-tree": "^1.0.1", + "immediate": "^3.2.3", + "inherits": "~2.0.1", + "ltgt": "~2.2.0", + "safe-buffer": "~5.1.1" }, "dependencies": { - "semver": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", - "dev": true + "abstract-leveldown": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", + "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", + "dev": true, + "requires": { + "xtend": "~4.0.0" + } } } }, @@ -10514,6 +10100,18 @@ "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=", "dev": true }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "dev": true + }, "string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", @@ -10587,6 +10185,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, "requires": { "md5.js": "^1.3.4", "safe-buffer": "^5.1.1" @@ -10596,6 +10195,7 @@ "version": "2.1.4", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, "requires": { "debug": "^2.3.3", "define-property": "^0.2.5", @@ -10610,6 +10210,7 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, "requires": { "ms": "2.0.0" } @@ -10617,28 +10218,98 @@ "define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=" + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } }, "extend-shallow": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=" + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true } } }, - "expand-tilde": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", - "requires": { - "homedir-polyfill": "^1.0.1" - } - }, "express": { "version": "4.17.1", "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", @@ -10715,6 +10386,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "dev": true, "requires": { "type": "^2.0.0" }, @@ -10722,38 +10394,32 @@ "type": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/type/-/type-2.1.0.tgz", - "integrity": "sha512-G9absDWvhAWCV2gmF1zKud3OyC61nZDwWvBL2DApaVFogI07CprggiQAOOjvp2NRjYWFzPyu7vwtDrQFq8jeSA==" + "integrity": "sha512-G9absDWvhAWCV2gmF1zKud3OyC61nZDwWvBL2DApaVFogI07CprggiQAOOjvp2NRjYWFzPyu7vwtDrQFq8jeSA==", + "dev": true } } }, "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true }, "extend-shallow": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, "requires": { "assign-symbols": "^1.0.0", "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "requires": { - "is-plain-object": "^2.0.4" - } - } } }, "extglob": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, "requires": { "array-unique": "^0.3.2", "define-property": "^1.0.0", @@ -10769,6 +10435,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, "requires": { "is-descriptor": "^1.0.0" } @@ -10776,33 +10443,17 @@ "extend-shallow": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=" - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, "requires": { - "kind-of": "^6.0.0" + "is-extendable": "^0.1.0" } }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true } } }, @@ -10821,17 +10472,6 @@ "checkpoint-store": "^1.1.0" } }, - "fancy-log": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.3.tgz", - "integrity": "sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw==", - "requires": { - "ansi-gray": "^0.1.1", - "color-support": "^1.1.3", - "parse-node-version": "^1.0.0", - "time-stamp": "^1.0.0" - } - }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -10844,14 +10484,6 @@ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, - "fd-slicer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", - "requires": { - "pend": "~1.2.0" - } - }, "fetch-ponyfill": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/fetch-ponyfill/-/fetch-ponyfill-4.1.0.tgz", @@ -10861,6 +10493,12 @@ "node-fetch": "~1.7.1" }, "dependencies": { + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, "node-fetch": { "version": "1.7.3", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", @@ -10873,34 +10511,6 @@ } } }, - "file-type": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz", - "integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY=" - }, - "file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=" - } - } - }, "finalhandler": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", @@ -10936,92 +10546,150 @@ } } }, - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "find-yarn-workspace-root": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-1.2.1.tgz", + "integrity": "sha512-dVtfb0WuQG+8Ag2uWkbG79hOUzEsRrhBzgfn86g2sJPkzmcpGdghbNTfUKGTxymFrY/tLIodDzLoW9nOJ4FY8Q==", + "dev": true, "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" + "fs-extra": "^4.0.3", + "micromatch": "^3.1.4" + }, + "dependencies": { + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fs-extra": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", + "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } } }, - "findup-sync": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", - "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", - "requires": { - "detect-file": "^1.0.0", - "is-glob": "^4.0.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" - } - }, - "fined": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz", - "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==", - "requires": { - "expand-tilde": "^2.0.2", - "is-plain-object": "^2.0.3", - "object.defaults": "^1.1.0", - "object.pick": "^1.2.0", - "parse-filepath": "^1.0.1" - } - }, - "flagged-respawn": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz", - "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==" - }, "flow-stoplight": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/flow-stoplight/-/flow-stoplight-1.0.0.tgz", "integrity": "sha1-SiksW8/4s5+mzAyxqFPYbyfu/3s=", "dev": true }, - "flush-write-stream": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", - "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", - "requires": { - "inherits": "^2.0.3", - "readable-stream": "^2.3.6" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, "for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", @@ -11034,15 +10702,8 @@ "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" - }, - "for-own": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", - "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", - "requires": { - "for-in": "^1.0.1" - } + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true }, "forever-agent": { "version": "0.6.1", @@ -11072,6 +10733,7 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, "requires": { "map-cache": "^0.2.2" } @@ -11083,64 +10745,41 @@ "dev": true, "optional": true }, - "fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" - }, "fs-extra": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, "requires": { "graceful-fs": "^4.1.2", "jsonfile": "^4.0.0", "universalify": "^0.1.0" } }, - "fs-minipass": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", - "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.6.0" - } - }, - "fs-mkdirp-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz", - "integrity": "sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes=", - "requires": { - "graceful-fs": "^4.1.11", - "through2": "^2.0.3" - } - }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true }, "functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" - }, - "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true }, "get-stream": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "optional": true, "requires": { "pump": "^3.0.0" } @@ -11148,7 +10787,8 @@ "get-value": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=" + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true }, "getpass": { "version": "0.1.7", @@ -11163,6 +10803,7 @@ "version": "7.1.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -11172,90 +10813,6 @@ "path-is-absolute": "^1.0.0" } }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "glob-stream": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz", - "integrity": "sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ=", - "requires": { - "extend": "^3.0.0", - "glob": "^7.1.1", - "glob-parent": "^3.1.0", - "is-negated-glob": "^1.0.0", - "ordered-read-streams": "^1.0.0", - "pumpify": "^1.3.5", - "readable-stream": "^2.1.5", - "remove-trailing-separator": "^1.0.1", - "to-absolute-glob": "^2.0.0", - "unique-stream": "^2.0.2" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "glob-watcher": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-5.0.5.tgz", - "integrity": "sha512-zOZgGGEHPklZNjZQaZ9f41i7F2YwE+tS5ZHrDhbBCk3stwahn5vQxnFmBJZHoYdusR6R1bLSXeGUy/BhctwKzw==", - "requires": { - "anymatch": "^2.0.0", - "async-done": "^1.2.0", - "chokidar": "^2.0.0", - "is-negated-glob": "^1.0.0", - "just-debounce": "^1.0.0", - "normalize-path": "^3.0.0", - "object.defaults": "^1.1.0" - } - }, "global": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/global/-/global-4.3.2.tgz", @@ -11264,42 +10821,14 @@ "requires": { "min-document": "^2.19.0", "process": "~0.5.1" - } - }, - "global-modules": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", - "requires": { - "global-prefix": "^1.0.1", - "is-windows": "^1.0.1", - "resolve-dir": "^1.0.0" - } - }, - "global-prefix": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", - "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", - "requires": { - "expand-tilde": "^2.0.2", - "homedir-polyfill": "^1.0.1", - "ini": "^1.3.4", - "is-windows": "^1.0.1", - "which": "^1.2.14" - } - }, - "globals": { - "version": "9.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", - "dev": true - }, - "glogg": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.2.tgz", - "integrity": "sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA==", - "requires": { - "sparkles": "^1.0.0" + }, + "dependencies": { + "process": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/process/-/process-0.5.2.tgz", + "integrity": "sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8=", + "dev": true + } } }, "got": { @@ -11337,53 +10866,8 @@ "graceful-fs": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==" - }, - "gulp": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz", - "integrity": "sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA==", - "requires": { - "glob-watcher": "^5.0.3", - "gulp-cli": "^2.2.0", - "undertaker": "^1.2.1", - "vinyl-fs": "^3.0.0" - }, - "dependencies": { - "gulp-cli": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.3.0.tgz", - "integrity": "sha512-zzGBl5fHo0EKSXsHzjspp3y5CONegCm8ErO5Qh0UzFzk2y4tMvzLWhoDokADbarfZRL2pGpRp7yt6gfJX4ph7A==", - "requires": { - "ansi-colors": "^1.0.1", - "archy": "^1.0.0", - "array-sort": "^1.0.0", - "color-support": "^1.1.3", - "concat-stream": "^1.6.0", - "copy-props": "^2.0.1", - "fancy-log": "^1.3.2", - "gulplog": "^1.0.0", - "interpret": "^1.4.0", - "isobject": "^3.0.1", - "liftoff": "^3.1.0", - "matchdep": "^2.0.0", - "mute-stdout": "^1.0.0", - "pretty-hrtime": "^1.0.0", - "replace-homedir": "^1.0.0", - "semver-greatest-satisfied-range": "^1.1.0", - "v8flags": "^3.2.0", - "yargs": "^7.1.0" - } - } - } - }, - "gulplog": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", - "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=", - "requires": { - "glogg": "^1.0.0" - } + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true }, "har-schema": { "version": "2.0.0", @@ -11405,6 +10889,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, "requires": { "function-bind": "^1.1.1" } @@ -11416,8 +10901,22 @@ "dev": true, "requires": { "ansi-regex": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + } } }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, "has-symbol-support-x": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz", @@ -11428,7 +10927,8 @@ "has-symbols": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", - "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true }, "has-to-string-tag-x": { "version": "1.4.1", @@ -11444,6 +10944,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, "requires": { "get-value": "^2.0.6", "has-values": "^1.0.0", @@ -11454,15 +10955,43 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, "requires": { "is-number": "^3.0.0", "kind-of": "^4.0.0" }, "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, "kind-of": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, "requires": { "is-buffer": "^1.1.5" } @@ -11473,6 +11002,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dev": true, "requires": { "inherits": "^2.0.4", "readable-stream": "^3.6.0", @@ -11483,6 +11013,7 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -11495,38 +11026,12 @@ "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, "requires": { "inherits": "^2.0.3", "minimalistic-assert": "^1.0.1" } }, - "hdkey": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/hdkey/-/hdkey-1.1.2.tgz", - "integrity": "sha512-PTQ4VKu0oRnCrYfLp04iQZ7T2Cxz0UsEXYauk2j8eh6PJXCpbXuCFhOmtIFtbET0i3PMWmHN9J11gU8LEgUljQ==", - "requires": { - "bs58check": "^2.1.2", - "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" - }, - "dependencies": { - "secp256k1": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", - "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", - "requires": { - "bindings": "^1.5.0", - "bip66": "^1.1.5", - "bn.js": "^4.11.8", - "create-hash": "^1.2.0", - "drbg.js": "^1.0.1", - "elliptic": "^6.5.2", - "nan": "^2.14.0", - "safe-buffer": "^5.1.2" - } - } - } - }, "heap": { "version": "0.2.6", "resolved": "https://registry.npmjs.org/heap/-/heap-0.2.6.tgz", @@ -11537,6 +11042,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, "requires": { "hash.js": "^1.0.3", "minimalistic-assert": "^1.0.0", @@ -11553,19 +11059,6 @@ "os-tmpdir": "^1.0.1" } }, - "homedir-polyfill": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", - "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", - "requires": { - "parse-passwd": "^1.0.0" - } - }, - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==" - }, "http-cache-semantics": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", @@ -11646,17 +11139,20 @@ "ieee754": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", - "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", + "dev": true }, "immediate": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", - "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" + "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=", + "dev": true }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -11665,17 +11161,8 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" - }, - "interpret": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", - "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true }, "invariant": { "version": "2.2.4", @@ -11686,11 +11173,6 @@ "loose-envify": "^1.0.0" } }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" - }, "ipaddr.js": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", @@ -11698,28 +11180,13 @@ "dev": true, "optional": true }, - "is-absolute": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", - "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", - "requires": { - "is-relative": "^1.0.0", - "is-windows": "^1.0.1" - } - }, "is-accessor-descriptor": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } + "dev": true, + "requires": { + "kind-of": "^6.0.0" } }, "is-arguments": { @@ -11728,78 +11195,56 @@ "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", "dev": true }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" - }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "requires": { - "binary-extensions": "^1.0.0" - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" - }, "is-callable": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", - "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==" + "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", + "dev": true + }, + "is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, + "requires": { + "ci-info": "^2.0.0" + } }, "is-data-descriptor": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } + "dev": true, + "requires": { + "kind-of": "^6.0.0" } }, "is-date-object": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", - "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==" + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "dev": true }, "is-descriptor": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" - } + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } }, "is-extendable": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, "requires": { "is-plain-object": "^2.0.4" } }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" - }, "is-finite": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", @@ -11812,61 +11257,23 @@ "integrity": "sha1-lUPV3nvPWwiiLsiiC65uKG1RDYw=", "dev": true }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "requires": { - "number-is-nan": "^1.0.0" - } - }, "is-function": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.2.tgz", "integrity": "sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ==", "dev": true }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "requires": { - "is-extglob": "^2.1.1" - } - }, "is-hex-prefixed": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=", "dev": true }, - "is-natural-number": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-natural-number/-/is-natural-number-4.0.1.tgz", - "integrity": "sha1-q5124dtM7VHjXeDHLr7PCfc0zeg=" - }, - "is-negated-glob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", - "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=" - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } + "is-negative-zero": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz", + "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=", + "dev": true }, "is-object": { "version": "1.0.1", @@ -11886,6 +11293,7 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, "requires": { "isobject": "^3.0.1" } @@ -11894,18 +11302,11 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", + "dev": true, "requires": { "has-symbols": "^1.0.1" } }, - "is-relative": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", - "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", - "requires": { - "is-unc-path": "^1.0.0" - } - }, "is-retry-allowed": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz", @@ -11913,15 +11314,11 @@ "dev": true, "optional": true }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" - }, "is-symbol": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, "requires": { "has-symbols": "^1.0.1" } @@ -11929,30 +11326,14 @@ "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" - }, - "is-unc-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", - "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", - "requires": { - "unc-path-regex": "^0.1.2" - } - }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" - }, - "is-valid-glob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz", - "integrity": "sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao=" + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true }, "isarray": { "version": "1.0.0", @@ -11963,12 +11344,14 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true }, "isobject": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true }, "isstream": { "version": "0.1.2", @@ -11990,7 +11373,9 @@ "js-sha3": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" + "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=", + "dev": true, + "optional": true }, "js-tokens": { "version": "4.0.0", @@ -12004,12 +11389,6 @@ "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", "dev": true }, - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", - "dev": true - }, "json-buffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", @@ -12067,27 +11446,17 @@ "jsonify": "~0.0.0" } }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=" - }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", "dev": true }, - "json5": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", - "dev": true - }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, "requires": { "graceful-fs": "^4.1.6" } @@ -12110,11 +11479,6 @@ "verror": "1.10.0" } }, - "just-debounce": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/just-debounce/-/just-debounce-1.0.0.tgz", - "integrity": "sha1-h/zPrv/AtozRnVX2cilD+SnqNeo=" - }, "keccak": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.1.tgz", @@ -12138,73 +11502,16 @@ "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==" + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true }, - "last-run": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/last-run/-/last-run-1.1.1.tgz", - "integrity": "sha1-RblpQsF7HHnHchmCWbqUO+v4yls=", + "klaw-sync": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", + "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", + "dev": true, "requires": { - "default-resolution": "^2.0.0", - "es6-weak-map": "^2.0.1" - } - }, - "lazystream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", - "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=", - "requires": { - "readable-stream": "^2.0.5" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "requires": { - "invert-kv": "^1.0.0" - } - }, - "lead": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz", - "integrity": "sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI=", - "requires": { - "flush-write-stream": "^1.0.2" + "graceful-fs": "^4.1.11" } }, "level-codec": { @@ -12229,34 +11536,11 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-2.0.3.tgz", "integrity": "sha512-I6Heg70nfF+e5Y3/qfthJFexhRw/Gi3bIymCoXAlijZdAcLaPuWSJs3KXyTYf23ID6g0o2QF62Yh+grOXY3Rig==", + "dev": true, "requires": { "inherits": "^2.0.1", + "readable-stream": "^2.0.5", "xtend": "^4.0.0" - }, - "dependencies": { - "level-errors": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.1.2.tgz", - "integrity": "sha512-Sw/IJwWbPKF5Ai4Wz60B52yj0zYeqzObLh8k1Tk88jVmD51cJSKWSYpRyhVIvFzZdvsPqlH5wfhp/yxdsaQH4w==", - "requires": { - "errno": "~0.1.1" - } - }, - "readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "string_decoder": "~0.10.x" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - } } }, "level-mem": { @@ -12278,12 +11562,6 @@ "xtend": "~4.0.0" } }, - "immediate": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", - "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=", - "dev": true - }, "ltgt": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", @@ -12347,61 +11625,6 @@ "pull-stream": "^3.6.8", "typewiselite": "~1.0.0", "xtend": "~4.0.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "level-iterator-stream": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-2.0.3.tgz", - "integrity": "sha512-I6Heg70nfF+e5Y3/qfthJFexhRw/Gi3bIymCoXAlijZdAcLaPuWSJs3KXyTYf23ID6g0o2QF62Yh+grOXY3Rig==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.5", - "xtend": "^4.0.0" - } - }, - "ltgt": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.1.3.tgz", - "integrity": "sha1-EIUaBtmWS5cReEQcI8nlJpjuzjQ=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } } }, "level-ws": { @@ -12413,35 +11636,6 @@ "inherits": "^2.0.3", "readable-stream": "^2.2.8", "xtend": "^4.0.1" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true - } } }, "levelup": { @@ -12456,31 +11650,6 @@ "xtend": "~4.0.0" }, "dependencies": { - "abstract-leveldown": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", - "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", - "dev": true, - "requires": { - "xtend": "~4.0.0" - } - }, - "deferred-leveldown": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-4.0.2.tgz", - "integrity": "sha512-5fMC8ek8alH16QiV0lTCis610D1Zt1+LA4MS4d63JgS32lrCjTFDUFz2ao09/j2I4Bqb5jL4FZYwu7Jz0XO1ww==", - "dev": true, - "requires": { - "abstract-leveldown": "~5.0.0", - "inherits": "^2.0.3" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, "level-iterator-stream": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-3.0.1.tgz", @@ -12491,70 +11660,6 @@ "readable-stream": "^2.3.6", "xtend": "^4.0.0" } - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "liftoff": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-3.1.0.tgz", - "integrity": "sha512-DlIPlJUkCV0Ips2zf2pJP0unEoT1kwYhiiPUGF3s/jtxTCjziNLoiVVh+jqWOWeFi6mmwQ5fNxvAUyPad4Dfog==", - "requires": { - "extend": "^3.0.0", - "findup-sync": "^3.0.0", - "fined": "^1.0.1", - "flagged-respawn": "^1.0.0", - "is-plain-object": "^2.0.4", - "object.map": "^1.0.0", - "rechoir": "^0.6.2", - "resolve": "^1.1.7" - } - }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" } } }, @@ -12601,78 +11706,26 @@ "integrity": "sha1-EIUaBtmWS5cReEQcI8nlJpjuzjQ=", "dev": true }, - "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", - "requires": { - "pify": "^3.0.0" - }, - "dependencies": { - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" - } - } - }, - "make-iterator": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", - "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", - "requires": { - "kind-of": "^6.0.2" - } - }, "map-cache": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true }, "map-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, "requires": { "object-visit": "^1.0.0" } }, - "matchdep": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz", - "integrity": "sha1-xvNINKDY28OzfCfui7yyfHd1WC4=", - "requires": { - "findup-sync": "^2.0.0", - "micromatch": "^3.0.4", - "resolve": "^1.4.0", - "stack-trace": "0.0.10" - }, - "dependencies": { - "findup-sync": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", - "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", - "requires": { - "detect-file": "^1.0.0", - "is-glob": "^3.1.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" - } - }, - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, "md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, "requires": { "hash-base": "^3.0.0", "inherits": "^2.0.1", @@ -12708,23 +11761,6 @@ "semaphore": ">=1.0.1" }, "dependencies": { - "abstract-leveldown": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", - "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", - "requires": { - "xtend": "~4.0.0" - } - }, - "async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", - "dev": true, - "requires": { - "lodash": "^4.17.14" - } - }, "ethereumjs-util": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", @@ -12740,55 +11776,6 @@ "safe-buffer": "^5.1.1" } }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "level-codec": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", - "integrity": "sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ==" - }, - "level-errors": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", - "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", - "requires": { - "errno": "~0.1.1" - } - }, - "levelup": { - "version": "1.3.9", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", - "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", - "requires": { - "level-codec": "~7.0.0", - "level-errors": "~1.0.3", - "prr": "~1.0.1", - "semver": "~5.4.1", - "xtend": "~4.0.0" - } - }, - "memdown": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", - "integrity": "sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=", - "requires": { - "abstract-leveldown": "~2.7.1", - "functional-red-black-tree": "^1.0.1", - "immediate": "^3.2.3", - "inherits": "~2.0.1", - "safe-buffer": "~5.1.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - }, "readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -12798,35 +11785,6 @@ "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - }, - "semver": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - } } } } @@ -12838,26 +11796,6 @@ "dev": true, "optional": true }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, "miller-rabin": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", @@ -12909,17 +11847,20 @@ "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true }, "minimalistic-crypto-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -12930,17 +11871,6 @@ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, - "minipass": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", - "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, "minizlib": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", @@ -12949,25 +11879,29 @@ "optional": true, "requires": { "minipass": "^2.9.0" + }, + "dependencies": { + "minipass": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", + "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + } } }, "mixin-deep": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, "requires": { "for-in": "^1.0.2", "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "requires": { - "is-plain-object": "^2.0.4" - } - } } }, "mkdirp": { @@ -12975,7 +11909,6 @@ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, - "optional": true, "requires": { "minimist": "^1.2.5" } @@ -13003,15 +11936,51 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "mute-stdout": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.1.tgz", - "integrity": "sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg==" + "multibase": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.6.1.tgz", + "integrity": "sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw==", + "dev": true, + "optional": true, + "requires": { + "base-x": "^3.0.8", + "buffer": "^5.5.0" + } }, - "nan": { - "version": "2.14.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", - "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==" + "multicodec": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-0.5.7.tgz", + "integrity": "sha512-PscoRxm3f+88fAtELwUnZxGDkduE2HD9Q6GHUOywQLjOGT/HAdhjLDYNZ1e7VR0s0TP0EwZ16LNUTFpoBGivOA==", + "dev": true, + "optional": true, + "requires": { + "varint": "^5.0.0" + } + }, + "multihashes": { + "version": "0.4.21", + "resolved": "https://registry.npmjs.org/multihashes/-/multihashes-0.4.21.tgz", + "integrity": "sha512-uVSvmeCWf36pU2nB4/1kzYZjsXD9vofZKpgudqkceYY5g2aZZXJ5r9lxuzoRLl1OAp28XljXsEJ/X/85ZsKmKw==", + "dev": true, + "optional": true, + "requires": { + "buffer": "^5.5.0", + "multibase": "^0.7.0", + "varint": "^5.0.0" + }, + "dependencies": { + "multibase": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.7.0.tgz", + "integrity": "sha512-TW8q03O0f6PNFTQDvh3xxH03c8CjGaaYrjkl9UQPG6rz53TQzzxJVCIWVjzcbN/Q5Y53Zd0IBQBMVktVgNx4Fg==", + "dev": true, + "optional": true, + "requires": { + "base-x": "^3.0.8", + "buffer": "^5.5.0" + } + } + } }, "nano-json-stream-parser": { "version": "0.1.2", @@ -13024,6 +11993,7 @@ "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, "requires": { "arr-diff": "^4.0.0", "array-unique": "^0.3.2", @@ -13048,7 +12018,14 @@ "next-tick": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", - "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true }, "node-addon-api": { "version": "2.0.2", @@ -13068,29 +12045,6 @@ "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==", "dev": true }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" - } - } - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" - }, "normalize-url": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", @@ -13098,19 +12052,6 @@ "dev": true, "optional": true }, - "now-and-later": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.1.tgz", - "integrity": "sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==", - "requires": { - "once": "^1.3.2" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" - }, "number-to-bn": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/number-to-bn/-/number-to-bn-1.7.0.tgz", @@ -13140,12 +12081,14 @@ "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true }, "object-copy": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, "requires": { "copy-descriptor": "^0.1.0", "define-property": "^0.2.5", @@ -13155,12 +12098,60 @@ "define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=" + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "requires": { "is-buffer": "^1.1.5" } @@ -13170,7 +12161,8 @@ "object-inspect": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", - "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==" + "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==", + "dev": true }, "object-is": { "version": "1.1.3", @@ -13214,6 +12206,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, "requires": { "isobject": "^3.0.0" } @@ -13222,6 +12215,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.1.tgz", "integrity": "sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA==", + "dev": true, "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.18.0-next.0", @@ -13233,6 +12227,7 @@ "version": "1.18.0-next.1", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", + "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", @@ -13247,25 +12242,9 @@ "string.prototype.trimend": "^1.0.1", "string.prototype.trimstart": "^1.0.1" } - }, - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" } } }, - "object.defaults": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", - "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", - "requires": { - "array-each": "^1.0.1", - "array-slice": "^1.0.0", - "for-own": "^1.0.0", - "isobject": "^3.0.0" - } - }, "object.getownpropertydescriptors": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", @@ -13276,32 +12255,15 @@ "es-abstract": "^1.17.0-next.1" } }, - "object.map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", - "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=", - "requires": { - "for-own": "^1.0.0", - "make-iterator": "^1.0.0" - } - }, "object.pick": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, "requires": { "isobject": "^3.0.1" } }, - "object.reduce": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object.reduce/-/object.reduce-1.0.1.tgz", - "integrity": "sha1-b+NI8qx/oPlcpiEiZZkJaCW7A60=", - "requires": { - "for-own": "^1.0.0", - "make-iterator": "^1.0.0" - } - }, "oboe": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/oboe/-/oboe-2.1.4.tgz", @@ -13326,66 +12288,17 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, "requires": { "wrappy": "1" } }, - "ordered-read-streams": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz", - "integrity": "sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4=", - "requires": { - "readable-stream": "^2.0.1" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, "os-homedir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, - "os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "requires": { - "lcid": "^1.0.0" - } - }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", @@ -13399,13 +12312,6 @@ "dev": true, "optional": true }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true, - "optional": true - }, "p-timeout": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-1.2.1.tgz", @@ -13414,6 +12320,15 @@ "optional": true, "requires": { "p-finally": "^1.0.0" + }, + "dependencies": { + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true, + "optional": true + } } }, "parse-asn1": { @@ -13430,40 +12345,12 @@ "safe-buffer": "^5.1.1" } }, - "parse-filepath": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", - "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=", - "requires": { - "is-absolute": "^1.0.0", - "map-cache": "^0.2.0", - "path-root": "^0.1.1" - } - }, "parse-headers": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.3.tgz", "integrity": "sha512-QhhZ+DCCit2Coi2vmAKbq5RGTRcQUOE2+REgv8vdyu7MnYx2eZztegqtTx99TZ86GTIwqiy3+4nQTWZ2tgmdCA==", "dev": true }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "requires": { - "error-ex": "^1.2.0" - } - }, - "parse-node-version": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz", - "integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==" - }, - "parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=" - }, "parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -13474,43 +12361,106 @@ "pascalcase": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=" + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=" - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "patch-package": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-6.2.2.tgz", + "integrity": "sha512-YqScVYkVcClUY0v8fF0kWOjDYopzIM8e3bj/RU1DPeEF14+dCGm6UeOYm4jvCyxqIEQ5/eJzmbWfDWnUleFNMg==", + "dev": true, "requires": { - "pinkie-promise": "^2.0.0" + "@yarnpkg/lockfile": "^1.1.0", + "chalk": "^2.4.2", + "cross-spawn": "^6.0.5", + "find-yarn-workspace-root": "^1.2.1", + "fs-extra": "^7.0.1", + "is-ci": "^2.0.0", + "klaw-sync": "^6.0.0", + "minimist": "^1.2.0", + "rimraf": "^2.6.3", + "semver": "^5.6.0", + "slash": "^2.0.0", + "tmp": "^0.0.33" + }, + "dependencies": { + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } } }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true }, "path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" - }, - "path-root": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", - "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", - "requires": { - "path-root-regex": "^0.1.0" - } - }, - "path-root-regex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", - "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=" + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true }, "path-to-regexp": { "version": "0.1.7", @@ -13519,27 +12469,11 @@ "dev": true, "optional": true }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" - } - } - }, "pbkdf2": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", + "dev": true, "requires": { "create-hash": "^1.1.2", "create-hmac": "^1.1.4", @@ -13548,34 +12482,17 @@ "sha.js": "^2.4.8" } }, - "pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=" - }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", "dev": true }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "requires": { - "pinkie": "^2.0.0" - } - }, "posix-character-classes": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true }, "precond": { "version": "0.2.3", @@ -13590,27 +12507,17 @@ "dev": true, "optional": true }, - "pretty-hrtime": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", - "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=" - }, "private": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", "dev": true }, - "process": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/process/-/process-0.5.2.tgz", - "integrity": "sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8=", - "dev": true - }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true }, "promise-to-callback": { "version": "1.0.0", @@ -13636,7 +12543,8 @@ "prr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", - "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", + "dev": true }, "pseudomap": { "version": "1.0.2", @@ -13727,32 +12635,13 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "optional": true, "requires": { "end-of-stream": "^1.1.0", "once": "^1.3.1" } }, - "pumpify": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", - "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", - "requires": { - "duplexify": "^3.6.0", - "inherits": "^2.0.3", - "pump": "^2.0.0" - }, - "dependencies": { - "pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - } - } - }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -13762,7 +12651,8 @@ "qs": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true }, "query-string": { "version": "5.1.1", @@ -13816,25 +12706,6 @@ "unpipe": "1.0.0" } }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - } - }, "readable-stream": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", @@ -13858,58 +12729,6 @@ } } }, - "readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "requires": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", - "requires": { - "resolve": "^1.1.6" - } - }, "regenerate": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.1.tgz", @@ -13937,6 +12756,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, "requires": { "extend-shallow": "^3.0.2", "safe-regex": "^1.1.0" @@ -13976,41 +12796,27 @@ "dev": true, "requires": { "jsesc": "~0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + } } }, - "remove-bom-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz", - "integrity": "sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==", - "requires": { - "is-buffer": "^1.1.5", - "is-utf8": "^0.2.1" - } - }, - "remove-bom-stream": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz", - "integrity": "sha1-BfGlk/FuQuH7kOv1nejlaVJflSM=", - "requires": { - "remove-bom-buffer": "^3.0.0", - "safe-buffer": "^5.1.0", - "through2": "^2.0.3" - } - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=" - }, "repeat-element": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==" + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true }, "repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true }, "repeating": { "version": "2.0.1", @@ -14021,21 +12827,6 @@ "is-finite": "^1.0.0" } }, - "replace-ext": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz", - "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==" - }, - "replace-homedir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/replace-homedir/-/replace-homedir-1.0.0.tgz", - "integrity": "sha1-6H9tUTuSjd6AgmDBK+f+xv9ueYw=", - "requires": { - "homedir-polyfill": "^1.0.1", - "is-absolute": "^1.0.0", - "remove-trailing-separator": "^1.1.0" - } - }, "request": { "version": "2.88.2", "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", @@ -14062,55 +12853,22 @@ "tough-cookie": "~2.5.0", "tunnel-agent": "^0.6.0", "uuid": "^3.3.2" - }, - "dependencies": { - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true - } } }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" - }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" - }, "resolve": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, "requires": { "path-parse": "^1.0.6" } }, - "resolve-dir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", - "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", - "requires": { - "expand-tilde": "^2.0.0", - "global-modules": "^1.0.0" - } - }, - "resolve-options": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/resolve-options/-/resolve-options-1.1.0.tgz", - "integrity": "sha1-MrueOcBtZzONyTeMDW1gdFZq0TE=", - "requires": { - "value-or-function": "^3.0.0" - } - }, "resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true }, "responselike": { "version": "1.0.2", @@ -14134,7 +12892,8 @@ "ret": { "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true }, "rimraf": { "version": "2.6.3", @@ -14149,6 +12908,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, "requires": { "hash-base": "^3.0.0", "inherits": "^2.0.1" @@ -14172,7 +12932,8 @@ "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true }, "safe-event-emitter": { "version": "1.0.1", @@ -14187,6 +12948,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, "requires": { "ret": "~0.1.10" } @@ -14203,18 +12965,12 @@ "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==", "dev": true }, - "scrypt.js": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/scrypt.js/-/scrypt.js-0.3.0.tgz", - "integrity": "sha512-42LTc1nyFsyv/o0gcHtDztrn+aqpkaCNt5Qh7ATBZfhEZU7IC/0oT/qbBH+uRNoAPvs2fwiOId68FDEoSRA8/A==", - "requires": { - "scryptsy": "^1.2.1" - } - }, "scryptsy": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-1.2.1.tgz", "integrity": "sha1-oyJfpLJST4AnAHYeKFW987LZIWM=", + "dev": true, + "optional": true, "requires": { "pbkdf2": "^3.0.3" } @@ -14236,28 +12992,12 @@ "integrity": "sha512-1/02Y/rUeU1CJBAGLebiC5Lbo5FnB22gQbIFFYTLkwvp1xdABZJH1sn4ZT1MzXmPpzv+Rf/Lu2NcsLJiK4rcDg==", "dev": true }, - "seek-bzip": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.6.tgz", - "integrity": "sha512-e1QtP3YL5tWww8uKaOCQ18UxIT2laNBXHjV/S2WYCiK4udiv8lkG89KRIoCjUagnAmCBurjF4zEVX2ByBbnCjQ==", - "requires": { - "commander": "^2.8.1" - } - }, "semaphore": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/semaphore/-/semaphore-1.1.0.tgz", "integrity": "sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA==", "dev": true }, - "semver-greatest-satisfied-range": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz", - "integrity": "sha1-E+jCZYq5aRywzXEJMkAoDTb3els=", - "requires": { - "sver-compat": "^1.5.0" - } - }, "send": { "version": "0.17.1", "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", @@ -14335,11 +13075,6 @@ "xhr": "^2.3.3" } }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" - }, "set-immediate-shim": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", @@ -14350,8 +13085,10 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, "requires": { "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", "is-plain-object": "^2.0.3", "split-string": "^3.0.1" }, @@ -14359,7 +13096,17 @@ "extend-shallow": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=" + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true } } }, @@ -14380,6 +13127,7 @@ "version": "2.4.11", "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, "requires": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -14404,16 +13152,11 @@ "simple-concat": "^1.0.0" } }, - "slash": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", - "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", - "dev": true - }, "snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, "requires": { "base": "^0.11.1", "debug": "^2.2.0", @@ -14429,6 +13172,7 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, "requires": { "ms": "2.0.0" } @@ -14436,22 +13180,95 @@ "define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=" + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } }, "extend-shallow": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=" + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true } } }, @@ -14459,6 +13276,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, "requires": { "define-property": "^1.0.0", "isobject": "^3.0.0", @@ -14469,35 +13287,10 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, "requires": { "is-descriptor": "^1.0.0" } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } } } }, @@ -14505,14 +13298,22 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, "requires": { "kind-of": "^3.2.0" }, "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "requires": { "is-buffer": "^1.1.5" } @@ -14522,12 +13323,14 @@ "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true }, "source-map-resolve": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "dev": true, "requires": { "atob": "^2.1.2", "decode-uri-component": "^0.2.0", @@ -14557,45 +13360,14 @@ "source-map-url": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" - }, - "sparkles": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz", - "integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==" - }, - "spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" - }, - "spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==" + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true }, "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, "requires": { "extend-shallow": "^3.0.0" } @@ -14625,15 +13397,11 @@ } } }, - "stack-trace": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", - "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=" - }, "static-extend": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, "requires": { "define-property": "^0.2.5", "object-copy": "^0.1.0" @@ -14642,7 +13410,74 @@ "define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=" + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true } } }, @@ -14653,16 +13488,6 @@ "dev": true, "optional": true }, - "stream-exhaust": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/stream-exhaust/-/stream-exhaust-1.0.2.tgz", - "integrity": "sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==" - }, - "stream-shift": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", - "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==" - }, "stream-to-pull-stream": { "version": "1.7.3", "resolved": "https://registry.npmjs.org/stream-to-pull-stream/-/stream-to-pull-stream-1.7.3.tgz", @@ -14688,16 +13513,6 @@ "dev": true, "optional": true }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, "string.prototype.trim": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.2.tgz", @@ -14734,6 +13549,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "dev": true, "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.17.5" @@ -14743,6 +13559,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "dev": true, "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.17.5" @@ -14752,6 +13569,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, "requires": { "safe-buffer": "~5.1.0" }, @@ -14759,34 +13577,11 @@ "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true } } }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "requires": { - "is-utf8": "^0.2.0" - } - }, - "strip-dirs": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-2.1.0.tgz", - "integrity": "sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g==", - "requires": { - "is-natural-number": "^4.0.1" - } - }, "strip-hex-prefix": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", @@ -14800,19 +13595,11 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, "requires": { "has-flag": "^3.0.0" } }, - "sver-compat": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/sver-compat/-/sver-compat-1.5.0.tgz", - "integrity": "sha1-PPh9/rTQe0o/FIJ7wYaz/QxkXNg=", - "requires": { - "es6-iterator": "^2.0.1", - "es6-symbol": "^3.1.1" - } - }, "swarm-js": { "version": "0.1.40", "resolved": "https://registry.npmjs.org/swarm-js/-/swarm-js-0.1.40.tgz", @@ -14875,6 +13662,13 @@ "url-to-options": "^1.0.1" } }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true, + "optional": true + }, "p-cancelable": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz", @@ -14971,62 +13765,25 @@ "yallist": "^3.0.3" }, "dependencies": { - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "fs-minipass": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", + "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", "dev": true, "optional": true, "requires": { - "minimist": "^1.2.5" - } - } - } - }, - "tar-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", - "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", - "requires": { - "bl": "^1.0.0", - "buffer-alloc": "^1.2.0", - "end-of-stream": "^1.0.0", - "fs-constants": "^1.0.0", - "readable-stream": "^2.3.0", - "to-buffer": "^1.1.1", - "xtend": "^4.0.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "minipass": "^2.6.0" } }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "minipass": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", + "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", + "dev": true, + "optional": true, "requires": { - "safe-buffer": "~5.1.0" + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" } } } @@ -15034,65 +13791,19 @@ "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true }, "through2": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, "requires": { "readable-stream": "~2.3.6", "xtend": "~4.0.1" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } } }, - "through2-filter": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz", - "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==", - "requires": { - "through2": "~2.0.0", - "xtend": "~4.0.0" - } - }, - "time-stamp": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", - "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=" - }, "timed-out": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", @@ -15109,38 +13820,26 @@ "rimraf": "^2.6.3" } }, - "to-absolute-glob": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", - "integrity": "sha1-GGX0PZ50sIItufFFt4z/fQ98hJs=", - "requires": { - "is-absolute": "^1.0.0", - "is-negated-glob": "^1.0.0" - } - }, - "to-buffer": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz", - "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==" - }, - "to-fast-properties": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", - "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", - "dev": true - }, "to-object-path": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, "requires": { "kind-of": "^3.0.2" }, "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "requires": { "is-buffer": "^1.1.5" } @@ -15158,6 +13857,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, "requires": { "define-property": "^2.0.2", "extend-shallow": "^3.0.2", @@ -15165,23 +13865,6 @@ "safe-regex": "^1.1.0" } }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - }, - "to-through": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-through/-/to-through-2.0.0.tgz", - "integrity": "sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY=", - "requires": { - "through2": "^2.0.3" - } - }, "toidentifier": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", @@ -15229,7 +13912,8 @@ "type": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", - "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", + "dev": true }, "type-is": { "version": "1.6.18", @@ -15245,12 +13929,14 @@ "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true }, "typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, "requires": { "is-typedarray": "^1.0.0" } @@ -15283,20 +13969,6 @@ "dev": true, "optional": true }, - "unbzip2-stream": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz", - "integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==", - "requires": { - "buffer": "^5.2.1", - "through": "^2.3.8" - } - }, - "unc-path-regex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", - "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=" - }, "underscore": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", @@ -15304,50 +13976,31 @@ "dev": true, "optional": true }, - "undertaker": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/undertaker/-/undertaker-1.2.1.tgz", - "integrity": "sha512-71WxIzDkgYk9ZS+spIB8iZXchFhAdEo2YU8xYqBYJ39DIUIqziK78ftm26eecoIY49X0J2MLhG4hr18Yp6/CMA==", - "requires": { - "arr-flatten": "^1.0.1", - "arr-map": "^2.0.0", - "bach": "^1.0.0", - "collection-map": "^1.0.0", - "es6-weak-map": "^2.0.1", - "last-run": "^1.1.0", - "object.defaults": "^1.0.0", - "object.reduce": "^1.0.0", - "undertaker-registry": "^1.0.0" - } - }, - "undertaker-registry": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/undertaker-registry/-/undertaker-registry-1.0.1.tgz", - "integrity": "sha1-XkvaMI5KiirlhPm5pDWaSZglzFA=" - }, "union-value": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, "requires": { "arr-union": "^3.1.0", "get-value": "^2.0.6", + "is-extendable": "^0.1.1", "set-value": "^2.0.1" - } - }, - "unique-stream": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.3.1.tgz", - "integrity": "sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==", - "requires": { - "json-stable-stringify-without-jsonify": "^1.0.1", - "through2-filter": "^3.0.0" + }, + "dependencies": { + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + } } }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true }, "unorm": { "version": "1.6.0", @@ -15366,6 +14019,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, "requires": { "has-value": "^0.3.1", "isobject": "^3.0.0" @@ -15375,6 +14029,7 @@ "version": "0.3.1", "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, "requires": { "get-value": "^2.0.3", "has-values": "^0.1.4", @@ -15385,6 +14040,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, "requires": { "isarray": "1.0.0" } @@ -15394,20 +14050,11 @@ "has-values": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=" - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true } } }, - "upath": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", - "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==" - }, "uri-js": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", @@ -15420,7 +14067,8 @@ "urix": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=" + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true }, "url-parse-lax": { "version": "3.0.0", @@ -15449,7 +14097,25 @@ "use": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==" + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "utf-8-validate": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.2.tgz", + "integrity": "sha512-SwV++i2gTD5qh2XqaPzBnNX88N6HdyhQrNNRykvcS0QKvItV9u3vPEJr+X5Hhfb1JC0r0e1alL0iB09rY8+nmw==", + "dev": true, + "requires": { + "node-gyp-build": "~3.7.0" + }, + "dependencies": { + "node-gyp-build": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.7.0.tgz", + "integrity": "sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w==", + "dev": true + } + } }, "utf8": { "version": "3.0.0", @@ -15461,7 +14127,8 @@ "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true }, "util.promisify": { "version": "1.0.1", @@ -15488,27 +14155,12 @@ "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", "dev": true }, - "v8flags": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz", - "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==", - "requires": { - "homedir-polyfill": "^1.0.1" - } - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "value-or-function": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz", - "integrity": "sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM=" + "varint": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", + "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==", + "dev": true, + "optional": true }, "vary": { "version": "1.1.2", @@ -15528,101 +14180,6 @@ "extsprintf": "^1.2.0" } }, - "vinyl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.0.tgz", - "integrity": "sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg==", - "requires": { - "clone": "^2.1.1", - "clone-buffer": "^1.0.0", - "clone-stats": "^1.0.0", - "cloneable-readable": "^1.0.0", - "remove-trailing-separator": "^1.0.1", - "replace-ext": "^1.0.0" - } - }, - "vinyl-fs": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz", - "integrity": "sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==", - "requires": { - "fs-mkdirp-stream": "^1.0.0", - "glob-stream": "^6.1.0", - "graceful-fs": "^4.0.0", - "is-valid-glob": "^1.0.0", - "lazystream": "^1.0.0", - "lead": "^1.0.0", - "object.assign": "^4.0.4", - "pumpify": "^1.3.5", - "readable-stream": "^2.3.3", - "remove-bom-buffer": "^3.0.0", - "remove-bom-stream": "^1.2.0", - "resolve-options": "^1.1.0", - "through2": "^2.0.0", - "to-through": "^2.0.0", - "value-or-function": "^3.0.0", - "vinyl": "^2.0.0", - "vinyl-sourcemap": "^1.1.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "vinyl-sourcemap": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz", - "integrity": "sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY=", - "requires": { - "append-buffer": "^1.0.2", - "convert-source-map": "^1.5.0", - "graceful-fs": "^4.1.6", - "normalize-path": "^2.1.1", - "now-and-later": "^2.0.0", - "remove-bom-buffer": "^3.0.0", - "vinyl": "^2.0.0" - }, - "dependencies": { - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "requires": { - "remove-trailing-separator": "^1.0.1" - } - } - } - }, "web3": { "version": "1.2.11", "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.11.tgz", @@ -15637,13 +14194,6 @@ "web3-net": "1.2.11", "web3-shh": "1.2.11", "web3-utils": "1.2.11" - }, - "dependencies": { - "@types/node": { - "version": "12.12.53", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.53.tgz", - "integrity": "sha512-51MYTDTyCziHb70wtGNFRwB4l+5JNvdqzFSkbDvpbftEgVUBEE+T5f7pROhWMp/fxp07oNIEQZd5bbfAH22ohQ==" - } } }, "web3-bzz": { @@ -15788,75 +14338,6 @@ "@ethersproject/abi": "5.0.0-beta.153", "underscore": "1.9.1", "web3-utils": "1.2.11" - }, - "dependencies": { - "@types/node": { - "version": "10.17.28", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.28.tgz", - "integrity": "sha512-dzjES1Egb4c1a89C7lKwQh8pwjYmlOAG9dW1pBgxEk57tMrLnssOfEthz8kdkNaBd7lIqQx7APm5+mZ619IiCQ==" - }, - "aes-js": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", - "integrity": "sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0=" - }, - "elliptic": { - "version": "6.3.3", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz", - "integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=", - "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "inherits": "^2.0.1" - } - }, - "ethers": { - "version": "4.0.0-beta.3", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.0-beta.3.tgz", - "integrity": "sha512-YYPogooSknTwvHg3+Mv71gM/3Wcrx+ZpCzarBj3mqs9njjRkrOo2/eufzhHloOCo3JSoNI4TQJJ6yU5ABm3Uog==", - "requires": { - "@types/node": "^10.3.2", - "aes-js": "3.0.0", - "bn.js": "^4.4.0", - "elliptic": "6.3.3", - "hash.js": "1.1.3", - "js-sha3": "0.5.7", - "scrypt-js": "2.0.3", - "setimmediate": "1.0.4", - "uuid": "2.0.1", - "xmlhttprequest": "1.8.0" - } - }, - "hash.js": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", - "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.0" - } - }, - "js-sha3": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" - }, - "scrypt-js": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.3.tgz", - "integrity": "sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q=" - }, - "setimmediate": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", - "integrity": "sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48=" - }, - "uuid": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", - "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=" - } } }, "web3-eth-accounts": { @@ -15945,15 +14426,6 @@ "requires": { "bn.js": "^4.11.9", "web3-utils": "1.2.11" - }, - "dependencies": { - "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true, - "optional": true - } } }, "web3-eth-personal": { @@ -16048,12 +14520,6 @@ "ethereumjs-util": "^5.1.1" } }, - "ethereum-common": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.2.0.tgz", - "integrity": "sha512-XOnAR/3rntJgbCdGhqdaLIxDLWKLmsZOGhHdBKadEr6gEnJLH52k93Ou+TUdFaPN3hJc3isBZBal3U/XZ15abA==", - "dev": true - }, "ethereumjs-abi": { "version": "git+https://git@github.com/ethereumjs/ethereumjs-abi.git#1ce6a1d64235fabe2aaf827fd606def55693508f", "from": "git+https://github.com/ethereumjs/ethereumjs-abi.git", @@ -16102,6 +14568,14 @@ "ethereumjs-tx": "^1.2.2", "ethereumjs-util": "^5.0.0", "merkle-patricia-tree": "^2.1.2" + }, + "dependencies": { + "ethereum-common": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.2.0.tgz", + "integrity": "sha512-XOnAR/3rntJgbCdGhqdaLIxDLWKLmsZOGhHdBKadEr6gEnJLH52k93Ou+TUdFaPN3hJc3isBZBal3U/XZ15abA==", + "dev": true + } } }, "ethereumjs-tx": { @@ -16112,14 +14586,6 @@ "requires": { "ethereum-common": "^0.0.18", "ethereumjs-util": "^5.0.0" - }, - "dependencies": { - "ethereum-common": { - "version": "0.0.18", - "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.0.18.tgz", - "integrity": "sha1-L9w1dvIykDNYl26znaeDIT/5Uj8=", - "dev": true - } } }, "ethereumjs-util": { @@ -16306,13 +14772,36 @@ "prr": "~1.0.1", "semver": "~5.4.1", "xtend": "~4.0.0" + } + }, + "ltgt": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", + "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=", + "dev": true + }, + "memdown": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", + "integrity": "sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=", + "dev": true, + "requires": { + "abstract-leveldown": "~2.7.1", + "functional-red-black-tree": "^1.0.1", + "immediate": "^3.2.3", + "inherits": "~2.0.1", + "ltgt": "~2.2.0", + "safe-buffer": "~5.1.1" }, "dependencies": { - "semver": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", - "dev": true + "abstract-leveldown": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", + "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", + "dev": true, + "requires": { + "xtend": "~4.0.0" + } } } }, @@ -16346,56 +14835,23 @@ "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=", "dev": true }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "dev": true }, "string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } + "dev": true }, "ws": { "version": "5.2.2", @@ -16474,13 +14930,6 @@ "utf8": "3.0.0" }, "dependencies": { - "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true, - "optional": true - }, "eth-lib": { "version": "0.2.8", "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.8.tgz", @@ -16532,32 +14981,11 @@ "integrity": "sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==", "dev": true }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "requires": { - "isexe": "^2.0.0" - } - }, - "which-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=" - }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - } - }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true }, "ws": { "version": "3.3.3", @@ -16628,69 +15056,23 @@ "cookiejar": "^2.1.1" } }, - "xmlhttprequest": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", - "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=" - }, "xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - }, - "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true }, "yaeti": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", - "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=" + "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=", + "dev": true }, "yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true - }, - "yargs": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.1.tgz", - "integrity": "sha512-huO4Fr1f9PmiJJdll5kwoS2e4GqzGSsMT3PPMpOwoVkOK8ckqAewMTZyA6LXVQWflleb/Z8oPBEvNsMft0XE+g==", - "requires": { - "camelcase": "^3.0.0", - "cliui": "^3.2.0", - "decamelize": "^1.1.1", - "get-caller-file": "^1.0.1", - "os-locale": "^1.4.0", - "read-pkg-up": "^1.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^1.0.2", - "which-module": "^1.0.0", - "y18n": "^3.2.1", - "yargs-parser": "5.0.0-security.0" - } - }, - "yargs-parser": { - "version": "5.0.0-security.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0-security.0.tgz", - "integrity": "sha512-T69y4Ps64LNesYxeYGYPvfoMTt/7y1XtfpIslUeK4um+9Hu7hlGoRtaDLvdXb7+/tfq4opVa2HRY5xGip022rQ==", - "requires": { - "camelcase": "^3.0.0", - "object.assign": "^4.1.0" - } - }, - "yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", - "requires": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" - } } } }, @@ -17086,7 +15468,8 @@ "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true }, "has-symbol-support-x": { "version": "1.4.2", @@ -17652,7 +16035,8 @@ "is-negative-zero": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz", - "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=" + "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=", + "dev": true }, "is-number": { "version": "7.0.0", @@ -18963,52 +17347,6 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "multibase": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.6.1.tgz", - "integrity": "sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw==", - "dev": true, - "optional": true, - "requires": { - "base-x": "^3.0.8", - "buffer": "^5.5.0" - } - }, - "multicodec": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-0.5.7.tgz", - "integrity": "sha512-PscoRxm3f+88fAtELwUnZxGDkduE2HD9Q6GHUOywQLjOGT/HAdhjLDYNZ1e7VR0s0TP0EwZ16LNUTFpoBGivOA==", - "dev": true, - "optional": true, - "requires": { - "varint": "^5.0.0" - } - }, - "multihashes": { - "version": "0.4.21", - "resolved": "https://registry.npmjs.org/multihashes/-/multihashes-0.4.21.tgz", - "integrity": "sha512-uVSvmeCWf36pU2nB4/1kzYZjsXD9vofZKpgudqkceYY5g2aZZXJ5r9lxuzoRLl1OAp28XljXsEJ/X/85ZsKmKw==", - "dev": true, - "optional": true, - "requires": { - "buffer": "^5.5.0", - "multibase": "^0.7.0", - "varint": "^5.0.0" - }, - "dependencies": { - "multibase": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.7.0.tgz", - "integrity": "sha512-TW8q03O0f6PNFTQDvh3xxH03c8CjGaaYrjkl9UQPG6rz53TQzzxJVCIWVjzcbN/Q5Y53Zd0IBQBMVktVgNx4Fg==", - "dev": true, - "optional": true, - "requires": { - "base-x": "^3.0.8", - "buffer": "^5.5.0" - } - } - } - }, "multimatch": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz", @@ -22138,15 +20476,6 @@ "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", "dev": true }, - "utf-8-validate": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.3.tgz", - "integrity": "sha512-jtJM6fpGv8C1SoH4PtG22pGto6x+Y8uPprW0tw3//gGFhDDTiuksgradgFN6yRayDP4SyZZa6ZMGHLIa17+M8A==", - "dev": true, - "requires": { - "node-gyp-build": "^4.2.0" - } - }, "utf8": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", @@ -22193,13 +20522,6 @@ "spdx-expression-parse": "^3.0.0" } }, - "varint": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", - "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==", - "dev": true, - "optional": true - }, "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", diff --git a/tasks/dev/3_uniswap_address_provider.ts b/tasks/dev/3_uniswap_address_provider.ts new file mode 100644 index 00000000..5898b4bb --- /dev/null +++ b/tasks/dev/3_uniswap_address_provider.ts @@ -0,0 +1,28 @@ +import { task } from 'hardhat/config'; +import { + deployLendingPoolAddressesProvider, + //deployLendingPoolAddressesProviderRegistry, +} from '../../helpers/contracts-deployments'; +import { getLendingPoolAddressesProviderRegistry } from '../../helpers/contracts-getters' +import { waitForTx } from '../../helpers/misc-utils'; +import { UniswapConfig } from '../../markets/uniswap'; + +task( + 'dev:deploy-uniswap-address-provider', + 'Deploy uniswap market address provider' +) + .addFlag('verify', 'Verify contracts at Etherscan') + .setAction(async ({ verify }, localBRE) => { + await localBRE.run('set-DRE'); + + const admin = await (await localBRE.ethers.getSigners())[0].getAddress(); + + const addressesProvider = await deployLendingPoolAddressesProvider(UniswapConfig.MarketId, verify); + await waitForTx(await addressesProvider.setPoolAdmin(admin)); + + const addressesProviderRegistry = await getLendingPoolAddressesProviderRegistry(); + await waitForTx( + await addressesProviderRegistry.registerAddressesProvider(addressesProvider.address, 1) + ); + console.log(addressesProvider.address); + }); diff --git a/tasks/dev/3_lending_pool.ts b/tasks/dev/4_lending_pool.ts similarity index 100% rename from tasks/dev/3_lending_pool.ts rename to tasks/dev/4_lending_pool.ts diff --git a/tasks/dev/4_oracles.ts b/tasks/dev/5_oracles.ts similarity index 72% rename from tasks/dev/4_oracles.ts rename to tasks/dev/5_oracles.ts index 97f14c8a..d0d2cd08 100644 --- a/tasks/dev/4_oracles.ts +++ b/tasks/dev/5_oracles.ts @@ -24,57 +24,113 @@ task('dev:deploy-oracles', 'Deploy oracles for dev enviroment') .addFlag('verify', 'Verify contracts at Etherscan') .addParam('pool', `Pool name to retrieve configuration, supported: ${Object.values(ConfigNames)}`) .setAction(async ({verify, pool}, localBRE) => { + await localBRE.run('set-DRE'); const poolConfig = loadPoolConfig(pool); + + console.log("Initialized pool config..."); + const { Mocks: {AllAssetsInitialPrices}, ProtocolGlobalParams: {UsdAddress, MockUsdPriceInWei}, LendingRateOracleRatesCommon, } = poolConfig as ICommonConfiguration; + console.log("Initialized mocks, global params and lending rate oracle rates"); + const defaultTokenList = { ...Object.fromEntries(Object.keys(TokenContractId).map((symbol) => [symbol, ''])), USD: UsdAddress, } as iAssetBase; + + console.log("Initialized defaultTokenList"); + const mockTokens = await getAllMockedTokens(); + + console.log("Initialized mock tokens"); + const mockTokensAddress = Object.keys(mockTokens).reduce>((prev, curr) => { prev[curr as keyof iAssetBase] = mockTokens[curr].address; return prev; }, defaultTokenList); + console.log(mockTokensAddress); + console.log("Initialized mock tokens addresses"); + const addressesProvider = await getLendingPoolAddressesProvider(); + + console.log("Got the addresses provider"); + const admin = await addressesProvider.getPoolAdmin(); + console.log("Got the admin"); + const fallbackOracle = await deployPriceOracle(verify); + + console.log("Deployed fallback price oracle"); + await waitForTx(await fallbackOracle.setEthUsdPrice(MockUsdPriceInWei)); + + console.log("set fallback ETH USD price"); + await setInitialAssetPricesInOracle(AllAssetsInitialPrices, mockTokensAddress, fallbackOracle); + console.log("Set initial asset prices in oracle"); + const mockAggregators = await deployAllMockAggregators(AllAssetsInitialPrices, verify); + console.log("Deployed mock aggregators"); + const allTokenAddresses = getAllTokenAddresses(mockTokens); + + console.log("Got all mock token addresses"); + const allAggregatorsAddresses = getAllAggregatorsAddresses(mockAggregators); + console.log("Got all aggregator addresses"); + const [tokens, aggregators] = getPairsTokenAggregator( allTokenAddresses, allAggregatorsAddresses ); + + console.log("Got \"pairsToken aggregator\""); await deployAaveOracle( [tokens, aggregators, fallbackOracle.address, await getWethAddress(poolConfig)], verify ); + + console.log("Deployed Aave oracle"); + await waitForTx(await addressesProvider.setPriceOracle(fallbackOracle.address)); + console.log("Set price oracle in addresses provider"); + const lendingRateOracle = await deployLendingRateOracle(verify); + + console.log("Deployed lendingRateOracle"); + await waitForTx(await addressesProvider.setLendingRateOracle(lendingRateOracle.address)); + console.log("Set lending rate oracle in addresses provider"); + const {USD, ...tokensAddressesWithoutUsd} = allTokenAddresses; + + console.log("Initialized object with token addresses & usd") + const allReservesAddresses = { ...tokensAddressesWithoutUsd, }; + + console.log("Initialized object with all reserve addresses, allReservesAddresses:"); + console.log(allReservesAddresses); + await setInitialMarketRatesInRatesOracleByHelper( LendingRateOracleRatesCommon, allReservesAddresses, lendingRateOracle, admin ); - }); + + console.log("Task complete"); + }); \ No newline at end of file diff --git a/tasks/dev/5_initialize.ts b/tasks/dev/6_initialize.ts similarity index 100% rename from tasks/dev/5_initialize.ts rename to tasks/dev/6_initialize.ts diff --git a/tasks/dev/6_wallet_balance_provider.ts b/tasks/dev/7_wallet_balance_provider.ts similarity index 100% rename from tasks/dev/6_wallet_balance_provider.ts rename to tasks/dev/7_wallet_balance_provider.ts diff --git a/tasks/migrations/aave.dev.ts b/tasks/migrations/aave.dev.ts index 1892cb53..e77e3e11 100644 --- a/tasks/migrations/aave.dev.ts +++ b/tasks/migrations/aave.dev.ts @@ -20,16 +20,22 @@ task('aave:dev', 'Deploy development enviroment') console.log('1. Deploy mock tokens'); await localBRE.run('dev:deploy-mock-tokens', {verify}); - console.log('2. Deploy address provider'); + console.log('2. Deploy Aave market address provider'); await localBRE.run('dev:deploy-address-provider', {verify}); + + console.log('3. Deploy Uniswap market address provider'); + await localBRE.run('dev:deploy-uniswap-address-provider', {verify}); - console.log('3. Deploy lending pool'); + console.log('4. Deploy Aave lending pool'); await localBRE.run('dev:deploy-lending-pool', {verify}); - console.log('4. Deploy oracles'); + console.log('5. Deploy oracles'); await localBRE.run('dev:deploy-oracles', {verify, pool: POOL_NAME}); - console.log('5. Initialize lending pool'); + console.log('6. Deploy Uniswap market oracles'); + await localBRE.run('dev:deploy-oracles', {verify, pool: "Uniswap"}); + + console.log('6. Initialize lending pool'); await localBRE.run('dev:initialize-lending-pool', {verify, pool: POOL_NAME}); console.log('\nFinished migration'); From 57986b76a881a821180f07392b194fac2049ef1c Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Fri, 25 Dec 2020 00:47:30 -0500 Subject: [PATCH 03/31] Testing --- helpers/configuration.ts | 7 +- helpers/contracts-deployments.ts | 1 + helpers/contracts-getters.ts | 4 +- helpers/contracts-helpers.ts | 4 +- helpers/init-helpers.ts | 13 +- helpers/oracles-helpers.ts | 1 + helpers/types.ts | 48 ++- helpers/uniswap-contracts-deployments.ts | 241 +++++++++++++ markets/aave/commons.ts | 9 +- markets/uniswap/commons.ts | 67 +--- markets/uniswap/index.ts | 14 +- package.json | 3 +- .../{4_lending_pool.ts => 3_lending_pool.ts} | 6 +- tasks/dev/3_uniswap_address_provider.ts | 28 -- tasks/dev/{5_oracles.ts => 4_oracles.ts} | 2 +- .../dev/{6_initialize.ts => 5_initialize.ts} | 2 + ...ovider.ts => 6_wallet_balance_provider.ts} | 0 tasks/dev/7_uniswap_market.ts | 322 ++++++++++++++++++ tasks/full/3_oracles.ts | 7 +- tasks/full/5_initialize.ts | 5 +- tasks/migrations/aave.dev.ts | 16 +- tasks/migrations/uniswap.mainnet.ts | 59 ++++ test/__setup.spec.ts | 10 +- test/test | 153 +++++++++ 24 files changed, 899 insertions(+), 123 deletions(-) create mode 100644 helpers/uniswap-contracts-deployments.ts rename tasks/dev/{4_lending_pool.ts => 3_lending_pool.ts} (92%) delete mode 100644 tasks/dev/3_uniswap_address_provider.ts rename tasks/dev/{5_oracles.ts => 4_oracles.ts} (97%) rename tasks/dev/{6_initialize.ts => 5_initialize.ts} (98%) rename tasks/dev/{7_wallet_balance_provider.ts => 6_wallet_balance_provider.ts} (100%) create mode 100644 tasks/dev/7_uniswap_market.ts create mode 100644 tasks/migrations/uniswap.mainnet.ts create mode 100644 test/test diff --git a/helpers/configuration.ts b/helpers/configuration.ts index 925f9365..13baa35a 100644 --- a/helpers/configuration.ts +++ b/helpers/configuration.ts @@ -25,10 +25,10 @@ export const loadPoolConfig = (configName: ConfigNames): PoolConfiguration => { switch (configName) { case ConfigNames.Aave: return AaveConfig; + case ConfigNames.Uniswap: + return UniswapConfig; case ConfigNames.Commons: return CommonsConfig; - case ConfigNames.Uniswap: - return UniswapConfig; default: throw new Error(`Unsupported pool configuration: ${Object.values(ConfigNames)}`); } @@ -44,6 +44,9 @@ export const getReservesConfigByPool = (pool: AavePools): iMultiPoolsAssets { [tokenSymbol, tokenSymbol, configData ? configData.reserveDecimals : decimals], verify ); + await registerContractInJsonDb(tokenSymbol.toUpperCase(), tokens[tokenSymbol]); console.log("deployAllMockTokens: deployed", tokenSymbol); } return tokens; diff --git a/helpers/contracts-getters.ts b/helpers/contracts-getters.ts index 22c1784b..34b0d134 100644 --- a/helpers/contracts-getters.ts +++ b/helpers/contracts-getters.ts @@ -153,7 +153,7 @@ export const getAllMockedTokens = async () => { const tokens: MockTokenMap = await Object.keys(TokenContractId).reduce>( async (acc, tokenSymbol) => { const accumulator = await acc; - console.log("getAllMockedTokens: got accumulator"); + console.log("getAllMockedTokens: got accumulator, next token:", tokenSymbol.toUpperCase()); const address = db.get(`${tokenSymbol.toUpperCase()}.${DRE.network.name}`).value().address; console.log("getAllMockedTokens: Initialized address for %s, address: %s", tokenSymbol, address); accumulator[tokenSymbol] = await getMintableERC20(address); @@ -177,6 +177,8 @@ export const getPairsTokenAggregator = ( const aggregatorAddressIndex = Object.keys(aggregatorsAddresses).findIndex( (value) => value === tokenSymbol ); + //console.log("getPairsTokenAggregator: tokenSymbol:", tokenSymbol); + //console.log("getPairsTokenAggregator: aggregatorsAddresses:\n\n", aggregatorsAddresses); const [, aggregatorAddress] = (Object.entries(aggregatorsAddresses) as [ string, tEthereumAddress diff --git a/helpers/contracts-helpers.ts b/helpers/contracts-helpers.ts index 93f6bb30..df306c2a 100644 --- a/helpers/contracts-helpers.ts +++ b/helpers/contracts-helpers.ts @@ -157,10 +157,12 @@ export const getParamPerNetwork = ( } }; -export const getParamPerPool = ({ proto }: iParamsPerPool, pool: AavePools) => { +export const getParamPerPool = ({ proto, uniswap }: iParamsPerPool, pool: AavePools) => { switch (pool) { case AavePools.proto: return proto; + case AavePools.uniswap: + return uniswap; default: return proto; } diff --git a/helpers/init-helpers.ts b/helpers/init-helpers.ts index e80d2f91..96ec9df7 100644 --- a/helpers/init-helpers.ts +++ b/helpers/init-helpers.ts @@ -25,6 +25,7 @@ import { } from './contracts-deployments'; import { ZERO_ADDRESS } from './constants'; import { isZeroAddress } from 'ethereumjs-util'; +import { LendingPoolAddressesProvider } from '../types'; const chooseATokenDeployment = (id: eContractid) => { switch (id) { @@ -38,6 +39,7 @@ const chooseATokenDeployment = (id: eContractid) => { }; export const initReservesByHelper = async ( + addressProvider: LendingPoolAddressesProvider, reservesParams: iMultiPoolsAssets, tokenAddresses: { [symbol: string]: tEthereumAddress }, admin: tEthereumAddress, @@ -49,7 +51,7 @@ export const initReservesByHelper = async ( const stableAndVariableDeployer = await getStableAndVariableTokensHelper(); const atokenAndRatesDeployer = await getATokensAndRatesHelper(); - const addressProvider = await getLendingPoolAddressesProvider(); + //const addressProvider = await getLendingPoolAddressesProvider(); const poolAddress = await addressProvider.getLendingPool(); // Set aTokenAndRatesDeployer as temporal admin @@ -80,6 +82,7 @@ export const initReservesByHelper = async ( Object.entries(reservesParams).length * 4 } txs` ); + console.log("initReservesByHelper: tokenAddresses:", tokenAddresses); for (let reservesChunk of reservesChunks) { // Prepare data const tokens: string[] = []; @@ -95,13 +98,15 @@ export const initReservesByHelper = async ( const reservesDecimals: string[] = []; for (let [assetSymbol, { reserveDecimals }] of reservesChunk) { + console.log("initReservesByHelper: assetSymbol:\n%s", assetSymbol); const assetAddressIndex = Object.keys(tokenAddresses).findIndex( (value) => value === assetSymbol ); + console.log("initReservesByHelper: assetAddressIndex:\n%s", assetAddressIndex); const [, tokenAddress] = (Object.entries(tokenAddresses) as [string, string][])[ assetAddressIndex ]; - + console.log("initReservesByHelper: tokenAddress:\n%s", assetAddressIndex); const reserveParamIndex = Object.keys(reservesParams).findIndex( (value) => value === assetSymbol ); @@ -131,6 +136,7 @@ export const initReservesByHelper = async ( } // Deploy stable and variable deployers and save implementations + // PARAMS HANG IN LOCALHOST console.log("Hanging params:\ntokens:\n %s\n symbols:\n %s \n incentivesController: \n %s ", tokens, symbols, incentivesController); const tx1 = await waitForTx( await stableAndVariableDeployer.initDeployment(tokens, symbols, incentivesController) ); @@ -300,12 +306,13 @@ export const getPairsTokenAggregator = ( }; export const configureReservesByHelper = async ( + addressProvider: LendingPoolAddressesProvider, reservesParams: iMultiPoolsAssets, tokenAddresses: { [symbol: string]: tEthereumAddress }, helpers: AaveProtocolDataProvider, admin: tEthereumAddress ) => { - const addressProvider = await getLendingPoolAddressesProvider(); + //const addressProvider = await getLendingPoolAddressesProvider(); const atokenAndRatesDeployer = await getATokensAndRatesHelper(); const tokens: string[] = []; const symbols: string[] = []; diff --git a/helpers/oracles-helpers.ts b/helpers/oracles-helpers.ts index 242161e4..aaa19976 100644 --- a/helpers/oracles-helpers.ts +++ b/helpers/oracles-helpers.ts @@ -28,6 +28,7 @@ export const setInitialMarketRatesInRatesOracleByHelper = async ( string, IMarketRates ][]) { + console.log("Current asset symbol:", assetSymbol); const assetAddressIndex = Object.keys(assetsAddresses).findIndex( (value) => value === assetSymbol ); diff --git a/helpers/types.ts b/helpers/types.ts index 30c628e6..9c15dd13 100644 --- a/helpers/types.ts +++ b/helpers/types.ts @@ -22,36 +22,47 @@ export enum EthereumNetworkNames { export enum AavePools { proto = 'proto', + uniswap = 'uniswap', } export enum eContractid { Example = 'Example', LendingPoolAddressesProvider = 'LendingPoolAddressesProvider', + UniswapLendingPoolAddressesProvider = 'UniswapLendingPoolAddressesProvider', MintableERC20 = 'MintableERC20', MintableDelegationERC20 = 'MintableDelegationERC20', LendingPoolAddressesProviderRegistry = 'LendingPoolAddressesProviderRegistry', LendingPoolParametersProvider = 'LendingPoolParametersProvider', LendingPoolConfigurator = 'LendingPoolConfigurator', + UniswapLendingPoolConfigurator = 'UniswapLendingPoolConfigurator', ValidationLogic = 'ValidationLogic', ReserveLogic = 'ReserveLogic', GenericLogic = 'GenericLogic', LendingPool = 'LendingPool', + UniswapLendingPool = 'UniswapLendingPool', PriceOracle = 'PriceOracle', + UniswapPriceOracle = 'UniswapPriceOracle', Proxy = 'Proxy', MockAggregator = 'MockAggregator', LendingRateOracle = 'LendingRateOracle', + UniswapLendingRateOracle = 'UniswapLendingRateOracle', AaveOracle = 'AaveOracle', + UniswapAaveOracle = 'UniswapAaveOracle', DefaultReserveInterestRateStrategy = 'DefaultReserveInterestRateStrategy', LendingPoolCollateralManager = 'LendingPoolCollateralManager', + UniswapLendingPoolCollateralManager = 'UniswapLendingPoolCollateralManager', InitializableAdminUpgradeabilityProxy = 'InitializableAdminUpgradeabilityProxy', MockFlashLoanReceiver = 'MockFlashLoanReceiver', + UniswapMockFlashLoanReceiver = 'UniswapMockFlashLoanReceiver', WalletBalanceProvider = 'WalletBalanceProvider', + UniswapWalletBalanceProvider = 'UniswapWalletBalanceProvider', AToken = 'AToken', MockAToken = 'MockAToken', DelegationAwareAToken = 'DelegationAwareAToken', MockStableDebtToken = 'MockStableDebtToken', MockVariableDebtToken = 'MockVariableDebtToken', AaveProtocolDataProvider = 'AaveProtocolDataProvider', + UniswapAaveProtocolDataProvider = 'UniswapAaveProtocolDataProvider', IERC20Detailed = 'IERC20Detailed', StableDebtToken = 'StableDebtToken', VariableDebtToken = 'VariableDebtToken', @@ -61,12 +72,16 @@ export enum eContractid { ATokensAndRatesHelper = 'ATokensAndRatesHelper', UiPoolDataProvider = 'UiPoolDataProvider', WETHGateway = 'WETHGateway', + UniswapWETHGateway = 'UniswapWETHGateway', WETH = 'WETH', WETHMocked = 'WETHMocked', SelfdestructTransferMock = 'SelfdestructTransferMock', LendingPoolImpl = 'LendingPoolImpl', + UniswapLendingPoolImpl = 'UniswapLendingPoolImpl', LendingPoolConfiguratorImpl = 'LendingPoolConfiguratorImpl', + UniswapLendingPoolConfiguratorImpl = 'UniswapLendingPoolConfiguratorImpl', LendingPoolCollateralManagerImpl = 'LendingPoolCollateralManagerImpl', + UniswapLendingPoolCollateralManagerImpl = 'UniswapLendingPoolCollateralManagerImpl', } /* @@ -200,8 +215,13 @@ export interface iAssetBase { USD: T; REN: T; ENJ: T; - WETHDAI: T; - WETHWBTC: T; + UNI_WETH: T; + UNI_WBTC: T; + UNI_DAI: T; + UNI_USDC: T; + UNI_USDT: T; + UNI_WETHDAI: T; + UNI_WETHWBTC: T; } export type iAssetsWithoutETH = Omit, 'ETH'>; @@ -234,13 +254,13 @@ export type iAavePoolAssets = Pick< export type iUniswapPoolAssets = Pick< iAssetsWithoutUSD, - | 'DAI' - | 'USDC' - | 'USDT' - | 'WBTC' - | 'WETH' - | 'WETHDAI' - | 'WETHWBTC' + | 'UNI_DAI' + | 'UNI_USDC' + | 'UNI_USDT' + | 'UNI_WBTC' + | 'UNI_WETH' + | 'UNI_WETHDAI' + | 'UNI_WETHWBTC' >; export type iMultiPoolsAssets = iAssetCommon | iAavePoolAssets; @@ -271,8 +291,13 @@ export enum TokenContractId { YFI = 'YFI', UNI = 'UNI', ENJ = 'ENJ', - WETHDAI = 'WETHDAI', - WETHWBTC = 'WETHWBTC', + UNI_WETH = 'WETH', + UNI_WBTC = 'WBTC', + UNI_DAI = 'DAI', + UNI_USDC = 'USDC', + UNI_USDT = 'USDT', + UNI_WETHDAI = 'WETHDAI', + UNI_WETHWBTC = 'WETHWBTC', } export interface IReserveParams extends IReserveBorrowParams, IReserveCollateralParams { @@ -313,6 +338,7 @@ export interface iParamsPerNetwork { export interface iParamsPerPool { [AavePools.proto]: T; + [AavePools.uniswap]: T; } export interface iBasicDistributionParams { diff --git a/helpers/uniswap-contracts-deployments.ts b/helpers/uniswap-contracts-deployments.ts new file mode 100644 index 00000000..0c28b324 --- /dev/null +++ b/helpers/uniswap-contracts-deployments.ts @@ -0,0 +1,241 @@ +import { Contract } from 'ethers'; +import { DRE } from './misc-utils'; +import { + tEthereumAddress, + eContractid, + tStringTokenSmallUnits, + AavePools, + TokenContractId, + iMultiPoolsAssets, + IReserveParams, + PoolConfiguration, + eEthereumNetwork, +} from './types'; + +import { MintableERC20 } from '../types/MintableERC20'; +import { MockContract } from 'ethereum-waffle'; +import { getReservesConfigByPool } from './configuration'; +import { getFirstSigner } from './contracts-getters'; +import { ZERO_ADDRESS } from './constants'; +import { + AaveProtocolDataProviderFactory, + ATokenFactory, + ATokensAndRatesHelperFactory, + AaveOracleFactory, + DefaultReserveInterestRateStrategyFactory, + DelegationAwareATokenFactory, + InitializableAdminUpgradeabilityProxyFactory, + LendingPoolAddressesProviderFactory, + LendingPoolAddressesProviderRegistryFactory, + LendingPoolCollateralManagerFactory, + LendingPoolConfiguratorFactory, + LendingPoolFactory, + LendingRateOracleFactory, + MintableDelegationERC20Factory, + MintableERC20Factory, + MockAggregatorFactory, + MockATokenFactory, + MockFlashLoanReceiverFactory, + MockStableDebtTokenFactory, + MockVariableDebtTokenFactory, + PriceOracleFactory, + ReserveLogicFactory, + SelfdestructTransferFactory, + StableDebtTokenFactory, + VariableDebtTokenFactory, + WalletBalanceProviderFactory, + WETH9MockedFactory, + WETHGatewayFactory, +} from '../types'; +import { + withSaveAndVerify, + registerContractInJsonDb, + linkBytecode, + insertContractAddressInDb, +} from './contracts-helpers'; +import { StableAndVariableTokensHelperFactory } from '../types/StableAndVariableTokensHelperFactory'; +import { MintableDelegationERC20 } from '../types/MintableDelegationERC20'; +import { readArtifact as buidlerReadArtifact } from '@nomiclabs/buidler/plugins'; +import { HardhatRuntimeEnvironment } from 'hardhat/types'; +import { LendingPoolLibraryAddresses } from '../types/LendingPoolFactory'; + +const readArtifact = async (id: string) => { + if (DRE.network.name === eEthereumNetwork.buidlerevm) { + return buidlerReadArtifact(DRE.config.paths.artifacts, id); + } + return (DRE as HardhatRuntimeEnvironment).artifacts.readArtifact(id); +}; + +export const deployUniswapLendingPoolAddressesProvider = async (marketId: string, verify?: boolean) => + withSaveAndVerify( + await new LendingPoolAddressesProviderFactory(await getFirstSigner()).deploy(marketId), + eContractid.UniswapLendingPoolAddressesProvider, + [marketId], + verify + ); + +export const deployUniswapLendingPoolConfigurator = async (verify?: boolean) => { + const lendingPoolConfiguratorImpl = await new LendingPoolConfiguratorFactory( + await getFirstSigner() + ).deploy(); + await insertContractAddressInDb( + eContractid.UniswapLendingPoolConfiguratorImpl, + lendingPoolConfiguratorImpl.address + ); + return withSaveAndVerify( + lendingPoolConfiguratorImpl, + eContractid.UniswapLendingPoolConfigurator, + [], + verify + ); +}; + +export const deployUniswapLendingPool = async (verify?: boolean) => { + const libraries = await deployAaveLibraries(verify); + const lendingPoolImpl = await new LendingPoolFactory(libraries, await getFirstSigner()).deploy(); + await insertContractAddressInDb(eContractid.UniswapLendingPoolImpl, lendingPoolImpl.address); + return withSaveAndVerify(lendingPoolImpl, eContractid.LendingPool, [], verify); +}; + +export const deployReserveLogicLibrary = async (verify?: boolean) => + withSaveAndVerify( + await new ReserveLogicFactory(await getFirstSigner()).deploy(), + eContractid.ReserveLogic, + [], + verify + ); + +export const deployGenericLogic = async (reserveLogic: Contract, verify?: boolean) => { + const genericLogicArtifact = await readArtifact(eContractid.GenericLogic); + + const linkedGenericLogicByteCode = linkBytecode(genericLogicArtifact, { + [eContractid.ReserveLogic]: reserveLogic.address, + }); + + const genericLogicFactory = await DRE.ethers.getContractFactory( + genericLogicArtifact.abi, + linkedGenericLogicByteCode + ); + + const genericLogic = await (await genericLogicFactory.deploy()).deployed(); + return withSaveAndVerify(genericLogic, eContractid.GenericLogic, [], verify); +}; + +export const deployValidationLogic = async ( + reserveLogic: Contract, + genericLogic: Contract, + verify?: boolean +) => { + const validationLogicArtifact = await readArtifact(eContractid.ValidationLogic); + + const linkedValidationLogicByteCode = linkBytecode(validationLogicArtifact, { + [eContractid.ReserveLogic]: reserveLogic.address, + [eContractid.GenericLogic]: genericLogic.address, + }); + + const validationLogicFactory = await DRE.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 => { + const reserveLogic = await deployReserveLogicLibrary(verify); + const genericLogic = await deployGenericLogic(reserveLogic, verify); + const validationLogic = await deployValidationLogic(reserveLogic, genericLogic, verify); + + // 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 + // require a hardcoded string. + // + // how-to: + // 1. PLACEHOLDER = solidityKeccak256(['string'], `${libPath}:${libName}`).slice(2, 36) + // 2. LIB_PLACEHOLDER = `__$${PLACEHOLDER}$__` + // or grab placeholdes from LendingPoolLibraryAddresses at Typechain generation. + // + // libPath example: contracts/libraries/logic/GenericLogic.sol + // libName example: GenericLogic + return { + ['__$de8c0cf1a7d7c36c802af9a64fb9d86036$__']: validationLogic.address, + ['__$22cd43a9dda9ce44e9b92ba393b88fb9ac$__']: reserveLogic.address, + }; +}; + +export const deployUniswapPriceOracle = async (verify?: boolean) => + withSaveAndVerify( + await new PriceOracleFactory(await getFirstSigner()).deploy(), + eContractid.UniswapPriceOracle, + [], + verify + ); + +export const deployUniswapLendingRateOracle = async (verify?: boolean) => + withSaveAndVerify( + await new LendingRateOracleFactory(await getFirstSigner()).deploy(), + eContractid.UniswapLendingRateOracle, + [], + verify + ); + +export const deployUniswapAaveOracle = async ( + args: [tEthereumAddress[], tEthereumAddress[], tEthereumAddress, tEthereumAddress], + verify?: boolean +) => + withSaveAndVerify( + await new AaveOracleFactory(await getFirstSigner()).deploy(...args), + eContractid.UniswapAaveOracle, + args, + verify + ); + +export const deployUniswapLendingPoolCollateralManager = async (verify?: boolean) => { + const collateralManagerImpl = await new LendingPoolCollateralManagerFactory( + await getFirstSigner() + ).deploy(); + await insertContractAddressInDb( + eContractid.UniswapLendingPoolCollateralManagerImpl, + collateralManagerImpl.address + ); + return withSaveAndVerify( + collateralManagerImpl, + eContractid.UniswapLendingPoolCollateralManager, + [], + verify + ); +}; + +export const deployUniswapMockFlashLoanReceiver = async ( + addressesProvider: tEthereumAddress, + verify?: boolean +) => + withSaveAndVerify( + await new MockFlashLoanReceiverFactory(await getFirstSigner()).deploy(addressesProvider), + eContractid.UniswapMockFlashLoanReceiver, + [addressesProvider], + verify + ); + +export const deployUniswapWalletBalancerProvider = async (verify?: boolean) => + withSaveAndVerify( + await new WalletBalanceProviderFactory(await getFirstSigner()).deploy(), + eContractid.UniswapWalletBalanceProvider, + [], + verify + ); + +export const deployUniswapWETHGateway = async ( + args: [tEthereumAddress, tEthereumAddress], + verify?: boolean +) => + withSaveAndVerify( + await new WETHGatewayFactory(await getFirstSigner()).deploy(...args), + eContractid.UniswapWETHGateway, + args, + verify + ); diff --git a/markets/aave/commons.ts b/markets/aave/commons.ts index fecd714f..e059c961 100644 --- a/markets/aave/commons.ts +++ b/markets/aave/commons.ts @@ -23,8 +23,13 @@ const MOCK_CHAINLINK_AGGREGATORS_PRICES = { WBTC: oneEther.multipliedBy('47.332685').toFixed(), YFI: oneEther.multipliedBy('22.407436').toFixed(), ZRX: oneEther.multipliedBy('0.001151').toFixed(), - WETHDAI: oneEther.multipliedBy('22.407436').toFixed(), - WETHWBTC: oneEther.multipliedBy('22.407436').toFixed(), + UNI_WETH:oneEther.toFixed(), + UNI_WBTC: oneEther.multipliedBy('47.332685').toFixed(), + UNI_DAI: oneEther.multipliedBy('0.00369068412860').toFixed(), + UNI_USDC: oneEther.multipliedBy('0.00367714136416').toFixed(), + UNI_USDT: oneEther.multipliedBy('0.00369068412860').toFixed(), + UNI_WETHDAI: oneEther.multipliedBy('22.407436').toFixed(), + UNI_WETHWBTC: oneEther.multipliedBy('22.407436').toFixed(), USD: '5848466240000000', }; // ---------------- diff --git a/markets/uniswap/commons.ts b/markets/uniswap/commons.ts index 939b32ee..c12b4570 100644 --- a/markets/uniswap/commons.ts +++ b/markets/uniswap/commons.ts @@ -23,8 +23,13 @@ const MOCK_CHAINLINK_AGGREGATORS_PRICES = { WBTC: oneEther.multipliedBy('47.332685').toFixed(), YFI: oneEther.multipliedBy('22.407436').toFixed(), ZRX: oneEther.multipliedBy('0.001151').toFixed(), - WETHDAI: oneEther.multipliedBy('22.407436').toFixed(), - WETHWBTC: oneEther.multipliedBy('22.407436').toFixed(), + UNI_WETH:oneEther.toFixed(), + UNI_WBTC: oneEther.multipliedBy('47.332685').toFixed(), + UNI_DAI: oneEther.multipliedBy('0.00369068412860').toFixed(), + UNI_USDC: oneEther.multipliedBy('0.00367714136416').toFixed(), + UNI_USDT: oneEther.multipliedBy('0.00369068412860').toFixed(), + UNI_WETHDAI: oneEther.multipliedBy('22.407436').toFixed(), + UNI_WETHWBTC: oneEther.multipliedBy('22.407436').toFixed(), USD: '5848466240000000', }; // ---------------- @@ -54,67 +59,25 @@ export const CommonsConfig: ICommonConfiguration = { }, // TODO: reorg alphabetically, checking the reason of tests failing LendingRateOracleRatesCommon: { - WETH: { + UNI_WETH: { borrowRate: oneRay.multipliedBy(0.03).toFixed(), }, - DAI: { + UNI_DAI: { borrowRate: oneRay.multipliedBy(0.039).toFixed(), }, - TUSD: { - borrowRate: oneRay.multipliedBy(0.035).toFixed(), - }, - USDC: { + UNI_USDC: { borrowRate: oneRay.multipliedBy(0.039).toFixed(), }, - SUSD: { + UNI_USDT: { borrowRate: oneRay.multipliedBy(0.035).toFixed(), }, - USDT: { - borrowRate: oneRay.multipliedBy(0.035).toFixed(), - }, - BAT: { + UNI_WBTC: { borrowRate: oneRay.multipliedBy(0.03).toFixed(), }, - AAVE: { - borrowRate: oneRay.multipliedBy(0.03).toFixed(), - }, - LINK: { - borrowRate: oneRay.multipliedBy(0.03).toFixed(), - }, - KNC: { - borrowRate: oneRay.multipliedBy(0.03).toFixed(), - }, - MKR: { - borrowRate: oneRay.multipliedBy(0.03).toFixed(), - }, - MANA: { - borrowRate: oneRay.multipliedBy(0.03).toFixed(), - }, - WBTC: { - borrowRate: oneRay.multipliedBy(0.03).toFixed(), - }, - ZRX: { - borrowRate: oneRay.multipliedBy(0.03).toFixed(), - }, - SNX: { - borrowRate: oneRay.multipliedBy(0.03).toFixed(), - }, - YFI: { - borrowRate: oneRay.multipliedBy(0.03).toFixed(), - }, - REN: { - borrowRate: oneRay.multipliedBy(0.03).toFixed(), - }, - UNI: { - borrowRate: oneRay.multipliedBy(0.03).toFixed(), - }, - BUSD: { + UNI_WETHDAI: { borrowRate: oneRay.multipliedBy(0.05).toFixed(), }, - WETHDAI: { - borrowRate: oneRay.multipliedBy(0.05).toFixed(), - }, - WETHWBTC: { + UNI_WETHWBTC: { borrowRate: oneRay.multipliedBy(0.05).toFixed(), }, }, @@ -267,6 +230,8 @@ export const CommonsConfig: ICommonConfiguration = { YFI: '0x7c5d4F8345e66f68099581Db340cd65B078C41f4', ZRX: '0x2Da4983a622a8498bb1a21FaE9D8F6C664939962', USD: '0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419', + WETHDAI: ZERO_ADDRESS, + WETHWBTC: ZERO_ADDRESS, }, [EthereumNetwork.tenderlyMain]: { AAVE: '0x6Df09E975c830ECae5bd4eD9d90f3A95a4f88012', diff --git a/markets/uniswap/index.ts b/markets/uniswap/index.ts index 37daa4af..d92518df 100644 --- a/markets/uniswap/index.ts +++ b/markets/uniswap/index.ts @@ -21,13 +21,13 @@ export const UniswapConfig: IUniswapConfiguration = { MarketId: 'Uniswap V2 market', ProviderId: 2, ReservesConfig: { - DAI: strategyDAI, - USDC: strategyUSDC, - USDT: strategyUSDT, - WBTC: strategyWBTC, - WETH: strategyWETH, - WETHDAI: strategyWETHDAI, - WETHWBTC: strategyWETHWBTC + UNI_DAI: strategyDAI, + UNI_USDC: strategyUSDC, + UNI_USDT: strategyUSDT, + UNI_WBTC: strategyWBTC, + UNI_WETH: strategyWETH, + UNI_WETHDAI: strategyWETHDAI, + UNI_WETHWBTC: strategyWETHWBTC }, ReserveAssets: { [eEthereumNetwork.buidlerevm]: {}, diff --git a/package.json b/package.json index d3c73712..cd9c9e3e 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,8 @@ "aave:kovan:full:initialize": "npm run hardhat:kovan -- full:initialize-lending-pool --verify --pool Aave", "aave:ropsten:full:migration": "npm run compile && npm run hardhat:ropsten -- aave:mainnet --verify", "aave:fork:main:tenderly": "npm run compile && npm run hardhat:tenderly-main -- aave:mainnet", - "aave:fork:main": "npm run compile && MAINNET_FORK=true hardhat aave:mainnet", + "aave:fork:main": "npm run compile && MAINNET_FORK=true hardhat aave:mainnet", + "uniswap:fork:main": "npm run compile && MAINNET_FORK=true hardhat uniswap:mainnet", "aave:main:full:migration": "npm run compile && npm run hardhat:main -- aave:mainnet --verify", "aave:main:full:initialize": "npm run compile && MAINNET_FORK=true full:initialize-tokens --pool Aave", "dev:prettier": "prettier --write .", diff --git a/tasks/dev/4_lending_pool.ts b/tasks/dev/3_lending_pool.ts similarity index 92% rename from tasks/dev/4_lending_pool.ts rename to tasks/dev/3_lending_pool.ts index b1aeb58c..692c8386 100644 --- a/tasks/dev/4_lending_pool.ts +++ b/tasks/dev/3_lending_pool.ts @@ -18,15 +18,17 @@ task('dev:deploy-lending-pool', 'Deploy lending pool for dev enviroment') .addFlag('verify', 'Verify contracts at Etherscan') .setAction(async ({verify}, localBRE) => { await localBRE.run('set-DRE'); - + // TEST--- CURRENTLY FAILS BECAUSE ALREADY HAS AN IMPLEMENTATION, SHOULD BE DONE BEFORE UNI MARKET TASK const addressesProvider = await getLendingPoolAddressesProvider(); - + const lendingPoolImpl = await deployLendingPool(verify); // Set lending pool impl to Address Provider await waitForTx(await addressesProvider.setLendingPoolImpl(lendingPoolImpl.address)); const address = await addressesProvider.getLendingPool(); + console.log("AAVE MARKET LENDING POOL:", address); + const lendingPoolProxy = await getLendingPool(address); await insertContractAddressInDb(eContractid.LendingPool, lendingPoolProxy.address); diff --git a/tasks/dev/3_uniswap_address_provider.ts b/tasks/dev/3_uniswap_address_provider.ts deleted file mode 100644 index 5898b4bb..00000000 --- a/tasks/dev/3_uniswap_address_provider.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { task } from 'hardhat/config'; -import { - deployLendingPoolAddressesProvider, - //deployLendingPoolAddressesProviderRegistry, -} from '../../helpers/contracts-deployments'; -import { getLendingPoolAddressesProviderRegistry } from '../../helpers/contracts-getters' -import { waitForTx } from '../../helpers/misc-utils'; -import { UniswapConfig } from '../../markets/uniswap'; - -task( - 'dev:deploy-uniswap-address-provider', - 'Deploy uniswap market address provider' -) - .addFlag('verify', 'Verify contracts at Etherscan') - .setAction(async ({ verify }, localBRE) => { - await localBRE.run('set-DRE'); - - const admin = await (await localBRE.ethers.getSigners())[0].getAddress(); - - const addressesProvider = await deployLendingPoolAddressesProvider(UniswapConfig.MarketId, verify); - await waitForTx(await addressesProvider.setPoolAdmin(admin)); - - const addressesProviderRegistry = await getLendingPoolAddressesProviderRegistry(); - await waitForTx( - await addressesProviderRegistry.registerAddressesProvider(addressesProvider.address, 1) - ); - console.log(addressesProvider.address); - }); diff --git a/tasks/dev/5_oracles.ts b/tasks/dev/4_oracles.ts similarity index 97% rename from tasks/dev/5_oracles.ts rename to tasks/dev/4_oracles.ts index d0d2cd08..b8c29660 100644 --- a/tasks/dev/5_oracles.ts +++ b/tasks/dev/4_oracles.ts @@ -58,7 +58,7 @@ task('dev:deploy-oracles', 'Deploy oracles for dev enviroment') const addressesProvider = await getLendingPoolAddressesProvider(); - console.log("Got the addresses provider"); + console.log("Got the addresses provider (check if different both times):", addressesProvider.address); const admin = await addressesProvider.getPoolAdmin(); diff --git a/tasks/dev/6_initialize.ts b/tasks/dev/5_initialize.ts similarity index 98% rename from tasks/dev/6_initialize.ts rename to tasks/dev/5_initialize.ts index c62f31ce..9a3896a5 100644 --- a/tasks/dev/6_initialize.ts +++ b/tasks/dev/5_initialize.ts @@ -53,6 +53,7 @@ task('dev:initialize-lending-pool', 'Initialize lending pool configuration.') const treasuryAddress = await getTreasuryAddress(poolConfig); await initReservesByHelper( + addressesProvider, reservesParams, protoPoolReservesAddresses, admin, @@ -61,6 +62,7 @@ task('dev:initialize-lending-pool', 'Initialize lending pool configuration.') verify ); await configureReservesByHelper( + addressesProvider, reservesParams, protoPoolReservesAddresses, testHelpers, diff --git a/tasks/dev/7_wallet_balance_provider.ts b/tasks/dev/6_wallet_balance_provider.ts similarity index 100% rename from tasks/dev/7_wallet_balance_provider.ts rename to tasks/dev/6_wallet_balance_provider.ts diff --git a/tasks/dev/7_uniswap_market.ts b/tasks/dev/7_uniswap_market.ts new file mode 100644 index 00000000..aa73fc40 --- /dev/null +++ b/tasks/dev/7_uniswap_market.ts @@ -0,0 +1,322 @@ +import { task } from 'hardhat/config'; +import { + deployATokensAndRatesHelper, + deployStableAndVariableTokensHelper, + deployAaveProtocolDataProvider, + deployLendingPoolAddressesProvider, //Test +} from '../../helpers/contracts-deployments'; +import { + deployUniswapLendingPoolAddressesProvider, + deployUniswapLendingPool, + deployUniswapLendingPoolConfigurator, + deployUniswapPriceOracle, + deployUniswapAaveOracle, + deployUniswapLendingRateOracle, + deployUniswapLendingPoolCollateralManager, + deployUniswapMockFlashLoanReceiver, + deployUniswapWETHGateway, + deployUniswapWalletBalancerProvider, +} from '../../helpers/uniswap-contracts-deployments'; +import { tEthereumAddress, + eContractid, + AavePools, + ICommonConfiguration, + iAssetBase, + TokenContractId, + IMarketRates, +} from '../../helpers/types'; +import { + getLendingPoolAddressesProviderRegistry, + getLendingPoolAddressesProvider, //Test + getLendingPool, + getLendingPoolConfiguratorProxy, + getAllMockedTokens, + getPairsTokenAggregator, +} from '../../helpers/contracts-getters'; +import { waitForTx, filterMapBy } from '../../helpers/misc-utils'; +import { UniswapConfig } from '../../markets/uniswap'; +import { insertContractAddressInDb } from '../../helpers/contracts-helpers'; +import { + setInitialAssetPricesInOracle, + deployAllMockAggregators, + setInitialMarketRatesInRatesOracleByHelper, +} from '../../helpers/oracles-helpers'; +import {getAllAggregatorsAddresses, getAllTokenAddresses} from '../../helpers/mock-helpers'; +import { + ConfigNames, + getReservesConfigByPool, + getTreasuryAddress, + loadPoolConfig, + getWethAddress, +} from '../../helpers/configuration'; +import { + configureReservesByHelper, + initReservesByHelper, +} from '../../helpers/init-helpers'; +import { ZERO_ADDRESS } from '../../helpers/constants'; + + +const pool = ConfigNames.Uniswap; +/** + * @dev addressesProvider is actually created here, so we don't need to use getAddressesProvider + */ +task( + 'dev:deploy-uniswap-market', + 'Deploy uniswap market' +) + .addFlag('verify', 'Verify contracts at Etherscan') + .setAction(async ({ verify }, localBRE) => { + await localBRE.run('set-DRE'); + + const admin = await (await localBRE.ethers.getSigners())[0].getAddress(); + + const testProvider = await getLendingPoolAddressesProvider(); + console.log("Addresses provider from function (pre re-deploy):", testProvider.address); + const addressesProvider = await deployLendingPoolAddressesProvider(UniswapConfig.MarketId, verify); + console.log("Addresses provider in execution::", addressesProvider.address) + + const testProviderPost = await getLendingPoolAddressesProvider(); + console.log("Addresses provider from function (pre re-deploy):", testProviderPost.address); + console.log("Addresses provider from function (post re-deploy) should be different:") + await waitForTx(await addressesProvider.setPoolAdmin(admin)); + + + const addressesProviderRegistry = await getLendingPoolAddressesProviderRegistry(); + await waitForTx( + await addressesProviderRegistry.registerAddressesProvider(addressesProvider.address, 1) + ); + console.log(addressesProvider.address); + + + /** + * LENDING POOL DEPLOYMENT + */ + const lendingPoolImpl = await deployUniswapLendingPool(verify); + + await waitForTx(await addressesProvider.setLendingPoolImpl(lendingPoolImpl.address)); + + const address = await addressesProvider.getLendingPool(); + console.log("UNISWAP MARKET LENDING POOL:", address); + const lendingPoolProxy = await getLendingPool(address); + await insertContractAddressInDb(eContractid.UniswapLendingPool, lendingPoolProxy.address); + + const lendingPoolConfiguratorImpl = await deployUniswapLendingPoolConfigurator(verify); + + // Set lending pool conf impl to Address Provider + await waitForTx( + await addressesProvider.setLendingPoolConfiguratorImpl(lendingPoolConfiguratorImpl.address) + ); + + const lendingPoolConfiguratorProxy = await getLendingPoolConfiguratorProxy( + await addressesProvider.getLendingPoolConfigurator() + ); + + await insertContractAddressInDb( + eContractid.UniswapLendingPoolConfigurator, + lendingPoolConfiguratorProxy.address + ); + + // Deploy deployment helpers + await deployStableAndVariableTokensHelper( + [lendingPoolProxy.address, addressesProvider.address], + verify + ); + await deployATokensAndRatesHelper( + [lendingPoolProxy.address, addressesProvider.address, lendingPoolConfiguratorProxy.address], + verify + ); + + /** + * @dev Oracle deployment section + */ + + console.log("Uniswap oracle deployment beginning.") + const poolConfig = loadPoolConfig(pool); + console.log("Initialized pool config..."); + + const { + Mocks: {AllAssetsInitialPrices}, + ProtocolGlobalParams: {UsdAddress, MockUsdPriceInWei}, + LendingRateOracleRatesCommon, + } = poolConfig as ICommonConfiguration; + console.log("Initialized mocks, global params and lending rate oracle rates"); + + const defaultTokenList = { + ...Object.fromEntries(Object.keys(TokenContractId).map((symbol) => [symbol, ''])), + USD: UsdAddress, + } as iAssetBase; + + console.log("Initialized defaultTokenList"); + + const mockTokens = await getAllMockedTokens(); + + console.log("Initialized mock tokens"); + + const mockTokensAddress = Object.keys(mockTokens).reduce>((prev, curr) => { + prev[curr as keyof iAssetBase] = mockTokens[curr].address; + return prev; + }, defaultTokenList); + console.log(mockTokensAddress); + console.log("Initialized mock tokens addresses"); + + // No need to re-initialize addressesProvider and admin + + const fallbackOracle = await deployUniswapPriceOracle(verify); + console.log("Deployed fallback price oracle"); + + await waitForTx(await fallbackOracle.setEthUsdPrice(MockUsdPriceInWei)); + console.log("set fallback ETH USD price"); + + await setInitialAssetPricesInOracle(AllAssetsInitialPrices, mockTokensAddress, fallbackOracle); + console.log("Set initial asset prices in oracle"); + + const mockAggregators = await deployAllMockAggregators(AllAssetsInitialPrices, verify); + console.log("Deployed mock aggregators"); + + const allTokenAddresses = getAllTokenAddresses(mockTokens); + console.log("Got all mock token addresses"); + + const allAggregatorsAddresses = getAllAggregatorsAddresses(mockAggregators); + console.log("Got all aggregator addresses"); + console.log("allTokenAddresses object: \n", allTokenAddresses); + //Should modify this to potentially contain only the tokens in the Uniswap market + // const [tokens, aggregators] = getPairsTokenAggregator( + // allTokenAddresses, + // allAggregatorsAddresses + // ); + // console.log("Got \"pairsToken aggregator\""); + // console.log("Tokens: \n", tokens); + + // const assetAddressIndex = Object.keys(allReservesAddresses).findIndex( + // (value) => value === assetSymbol + // ); + // const [, assetAddress] = (Object.entries(assetsAddresses) as [string, string][])[ + // assetAddressIndex + // ]; + // assetAddresses.push(assetAddress); + + // await deployUniswapAaveOracle( + // [tokens, aggregators, fallbackOracle.address, await getWethAddress(poolConfig)], + // verify + // ); + console.log("Deployed Uniswap Aave oracle"); + + await waitForTx(await addressesProvider.setPriceOracle(fallbackOracle.address)); + console.log("Set price oracle in addresses provider"); + + const lendingRateOracle = await deployUniswapLendingRateOracle(verify); + console.log("Deployed lendingRateOracle"); + + await waitForTx(await addressesProvider.setLendingRateOracle(lendingRateOracle.address)); + console.log("Set lending rate oracle in addresses provider"); + + const {USD, ...tokensAddressesWithoutUsd} = allTokenAddresses; + console.log("Initialized object with token addresses & usd") + + const allReservesAddresses = { + ...tokensAddressesWithoutUsd, + }; + console.log("Initialized object with all reserve addresses, allReservesAddresses:"); + console.log(allReservesAddresses); + + console.log("LendingRateOracleRatesCommon: \n", LendingRateOracleRatesCommon); + // + // -- test + // + const [tokens, aggregators] = getPairsTokenAggregator( + allTokenAddresses, + allAggregatorsAddresses + ); + console.log("Got \"pairsToken aggregator\""); + console.log("Tokens: \n", tokens); + const assetAddresses: string[] = []; + const aggregatorAddresses: string[] = []; + for (const [assetSymbol, {borrowRate}] of Object.entries(LendingRateOracleRatesCommon) as [ + string, + IMarketRates + ][]) { + const assetAddressIndex = Object.keys(allReservesAddresses).findIndex( + (value) => value === assetSymbol + ); + const [, assetAddress] = (Object.entries(allReservesAddresses) as [string, string][])[ + assetAddressIndex + ]; + + const [, aggregatorAddress] = (Object.entries(allAggregatorsAddresses) as [string, string][])[ + assetAddressIndex + ]; + aggregatorAddresses.push(aggregatorAddress); + assetAddresses.push(assetAddress); + } + console.log("\nPRICE ORACLE PARAMS:\nassetAddresses: %s\naggregatorAddresses: %s", assetAddresses, aggregatorAddresses); + await deployUniswapAaveOracle( + [assetAddresses, aggregatorAddresses, fallbackOracle.address, await getWethAddress(poolConfig)], + verify + ); + // + // -- test end + // + console.log("TEST END-----------------------------------------------------------------------"); + await setInitialMarketRatesInRatesOracleByHelper( + LendingRateOracleRatesCommon, + allReservesAddresses, + lendingRateOracle, + admin + ); + + console.log("Task complete"); + + /** + * @dev Initialization + */ + + // No need to initialize poolConfig, mockTokens, allTokenAddresses, admin and + // addressesProvider and protoReservesAddresses (we use allReserveAddresses) + + const testHelpers = await deployAaveProtocolDataProvider(addressesProvider.address, verify); + + const reservesParams = getReservesConfigByPool(AavePools.uniswap); + + const treasuryAddress = await getTreasuryAddress(poolConfig); + + await initReservesByHelper( + addressesProvider, + reservesParams, + allReservesAddresses, + admin, + treasuryAddress, + ZERO_ADDRESS, + verify + ); + + await configureReservesByHelper( + addressesProvider, + reservesParams, + allReservesAddresses, + testHelpers, + admin + ); + + const collateralManager = await deployUniswapLendingPoolCollateralManager(verify); + await waitForTx( + await addressesProvider.setLendingPoolCollateralManager(collateralManager.address) + ); + + const mockFlashLoanReceiver = await deployUniswapMockFlashLoanReceiver( + addressesProvider.address, + verify + ); + + await insertContractAddressInDb( + eContractid.UniswapMockFlashLoanReceiver, + mockFlashLoanReceiver.address + ); + + await deployUniswapWalletBalancerProvider(verify); + + await insertContractAddressInDb(eContractid.AaveProtocolDataProvider, testHelpers.address); + + const lendingPoolAddress = await addressesProvider.getLendingPool(); + const wethAddress = await getWethAddress(poolConfig); + await deployUniswapWETHGateway([wethAddress, lendingPoolAddress]); + }); diff --git a/tasks/full/3_oracles.ts b/tasks/full/3_oracles.ts index b064328f..093ea43c 100644 --- a/tasks/full/3_oracles.ts +++ b/tasks/full/3_oracles.ts @@ -1,5 +1,5 @@ import { task } from 'hardhat/config'; -import { getParamPerNetwork } from '../../helpers/contracts-helpers'; +import { getParamPerNetwork, getParamPerPool } from '../../helpers/contracts-helpers'; import { deployAaveOracle, deployLendingRateOracle } from '../../helpers/contracts-deployments'; import { setInitialMarketRatesInRatesOracleByHelper } from '../../helpers/oracles-helpers'; import { ICommonConfiguration, eEthereumNetwork, SymbolMap } from '../../helpers/types'; @@ -32,6 +32,8 @@ task('full:deploy-oracles', 'Deploy oracles for dev enviroment') FallbackOracle, ChainlinkAggregator, } = poolConfig as ICommonConfiguration; + + //console.log("------------------------------------------------ReserveAssets:\n", ReserveAssets); const lendingRateOracles = getLendingRateOracles(poolConfig); const addressesProvider = await getLendingPoolAddressesProvider(); const admin = await getGenesisPoolAdmin(poolConfig); @@ -40,13 +42,14 @@ task('full:deploy-oracles', 'Deploy oracles for dev enviroment') const fallbackOracleAddress = await getParamPerNetwork(FallbackOracle, network); const reserveAssets = await getParamPerNetwork(ReserveAssets, network); const chainlinkAggregators = await getParamPerNetwork(ChainlinkAggregator, network); + //console.log("------------------------------------------------reserveAssets:\n", reserveAssets); const tokensToWatch: SymbolMap = { ...reserveAssets, USD: UsdAddress, }; const [tokens, aggregators] = getPairsTokenAggregator(tokensToWatch, chainlinkAggregators); - + console.log("tokens:\n %s \n aggregators: \n %s", tokens, aggregators); const aaveOracle = notFalsyOrZeroAddress(aaveOracleAddress) ? await getAaveOracle(aaveOracleAddress) : await deployAaveOracle( diff --git a/tasks/full/5_initialize.ts b/tasks/full/5_initialize.ts index 444f55d8..77672bdc 100644 --- a/tasks/full/5_initialize.ts +++ b/tasks/full/5_initialize.ts @@ -36,6 +36,7 @@ task('full:initialize-lending-pool', 'Initialize lending pool configuration.') const testHelpers = await getAaveProtocolDataProvider(); + console.log("reserveAssets:\n", reserveAssets); const admin = await addressesProvider.getPoolAdmin(); if (!reserveAssets) { throw 'Reserve assets is undefined. Check ReserveAssets configuration at config directory'; @@ -43,8 +44,8 @@ task('full:initialize-lending-pool', 'Initialize lending pool configuration.') const treasuryAddress = await getTreasuryAddress(poolConfig); - await initReservesByHelper(ReservesConfig, reserveAssets, admin, treasuryAddress, ZERO_ADDRESS, verify); - await configureReservesByHelper(ReservesConfig, reserveAssets, testHelpers, admin); + await initReservesByHelper(addressesProvider, ReservesConfig, reserveAssets, admin, treasuryAddress, ZERO_ADDRESS, verify); + await configureReservesByHelper(addressesProvider, ReservesConfig, reserveAssets, testHelpers, admin); const collateralManager = await deployLendingPoolCollateralManager(verify); await waitForTx( diff --git a/tasks/migrations/aave.dev.ts b/tasks/migrations/aave.dev.ts index e77e3e11..e92d894d 100644 --- a/tasks/migrations/aave.dev.ts +++ b/tasks/migrations/aave.dev.ts @@ -22,22 +22,22 @@ task('aave:dev', 'Deploy development enviroment') console.log('2. Deploy Aave market address provider'); await localBRE.run('dev:deploy-address-provider', {verify}); - - console.log('3. Deploy Uniswap market address provider'); - await localBRE.run('dev:deploy-uniswap-address-provider', {verify}); - console.log('4. Deploy Aave lending pool'); + console.log('3. Deploy Aave lending pool'); await localBRE.run('dev:deploy-lending-pool', {verify}); - console.log('5. Deploy oracles'); + console.log('4. Deploy oracles'); await localBRE.run('dev:deploy-oracles', {verify, pool: POOL_NAME}); - console.log('6. Deploy Uniswap market oracles'); - await localBRE.run('dev:deploy-oracles', {verify, pool: "Uniswap"}); + // console.log('6. Deploy Uniswap market oracles'); + // await localBRE.run('dev:deploy-oracles', {verify, pool: "Uniswap"}); - console.log('6. Initialize lending pool'); + console.log('5. Initialize lending pool'); await localBRE.run('dev:initialize-lending-pool', {verify, pool: POOL_NAME}); + console.log('6. Deploy Uniswap market'); + await localBRE.run('dev:deploy-uniswap-market', {verify}); + console.log('\nFinished migration'); printContracts(); }); diff --git a/tasks/migrations/uniswap.mainnet.ts b/tasks/migrations/uniswap.mainnet.ts new file mode 100644 index 00000000..7945dca6 --- /dev/null +++ b/tasks/migrations/uniswap.mainnet.ts @@ -0,0 +1,59 @@ +import {task} from 'hardhat/config'; +import {ExternalProvider} from '@ethersproject/providers'; +import {checkVerification} from '../../helpers/etherscan-verification'; +import {ConfigNames} from '../../helpers/configuration'; +import {EthereumNetworkNames} from '../../helpers/types'; +import {printContracts} from '../../helpers/misc-utils'; + +task('uniswap:mainnet', 'Deploy development enviroment') + .addFlag('verify', 'Verify contracts at Etherscan') + .setAction(async ({verify}, DRE) => { + const POOL_NAME = ConfigNames.Uniswap; + const network = DRE.network.name; + await DRE.run('set-DRE'); + + // Prevent loss of gas verifying all the needed ENVs for Etherscan verification + if (verify) { + checkVerification(); + } + + if (network.includes('tenderly')) { + console.log('- Setting up Tenderly provider'); + await DRE.tenderlyRPC.initializeFork(); + const provider = new DRE.ethers.providers.Web3Provider(DRE.tenderlyRPC as any); + DRE.ethers.provider = provider; + } + + console.log('Migration started\n'); + + console.log('1. Deploy address provider'); + await DRE.run('full:deploy-address-provider', {pool: POOL_NAME}); + + console.log('2. Deploy lending pool'); + await DRE.run('full:deploy-lending-pool'); + + console.log('3. Deploy oracles'); + await DRE.run('full:deploy-oracles', {pool: POOL_NAME}); + + console.log('4. Deploy Data Provider'); + await DRE.run('full:data-provider', {pool: POOL_NAME}); + + console.log('5. Initialize lending pool'); + await DRE.run('full:initialize-lending-pool', {pool: POOL_NAME}); + + if (verify) { + printContracts(); + console.log('4. Veryfing contracts'); + await DRE.run('verify:general', {all: true, pool: POOL_NAME}); + + console.log('5. Veryfing aTokens and debtTokens'); + await DRE.run('verify:tokens', {pool: POOL_NAME}); + } + + if (network.includes('tenderly')) { + const postDeployHead = DRE.tenderlyRPC.getHead(); + console.log('Tenderly UUID', postDeployHead); + } + console.log('\nFinished migrations'); + printContracts(); + }); diff --git a/test/__setup.spec.ts b/test/__setup.spec.ts index 45479bb7..51542de9 100644 --- a/test/__setup.spec.ts +++ b/test/__setup.spec.ts @@ -159,6 +159,13 @@ const buildTestEnv = async (deployer: Signer, secondaryWallet: Signer) => { REN: mockTokens.REN.address, UNI: mockTokens.UNI.address, ENJ: mockTokens.ENJ.address, + UNI_WETH: mockTokens.WETH.address, + UNI_WBTC: mockTokens.WBTC.address, + UNI_DAI: mockTokens.DAI.address, + UNI_USDC: mockTokens.USDC.address, + UNI_USDT: mockTokens.USDT.address, + UNI_WETHDAI: mockTokens.UNI_WETHDAI.address, + UNI_WETHWBTC: mockTokens.UNI_WETHWBTC.address, USD: USD_ADDRESS, }, fallbackOracle @@ -213,8 +220,9 @@ const buildTestEnv = async (deployer: Signer, secondaryWallet: Signer) => { const treasuryAddress = await getTreasuryAddress(config); - await initReservesByHelper(reservesParams, allReservesAddresses, admin, treasuryAddress, ZERO_ADDRESS, false); + await initReservesByHelper(addressesProvider, reservesParams, allReservesAddresses, admin, treasuryAddress, ZERO_ADDRESS, false); await configureReservesByHelper( + addressesProvider, reservesParams, allReservesAddresses, testHelpers, diff --git a/test/test b/test/test new file mode 100644 index 00000000..6b201f6c --- /dev/null +++ b/test/test @@ -0,0 +1,153 @@ +N# Contracts: 152 +MintableERC20: 0xB00cC45B4a7d3e1FEE684cFc4417998A1c183e6d +LendingPoolAddressesProvider: 0x0459c841b02Aee8730730C737582c53B20a27288 +LendingPoolAddressesProviderRegistry: 0x22474D350EC2dA53D717E30b96e9a2B7628Ede5b +ReserveLogic: 0x7fAeC7791277Ff512c41CA903c177B2Ed952dDAc +GenericLogic: 0x33958cC3535Fc328369EAC2B2Bebd120D67C7fa1 +ValidationLogic: 0x2cBbbBE1B75Ad7848F0844215816F551f429c64f +LendingPoolImpl: 0x8456161947DFc1fC159A0B26c025cD2b4bba0c3e +LendingPool: 0xbAc762e2000b6815268587b081Fd17aC25519aD5 +LendingPoolConfiguratorImpl: 0x5F6CaC05CDF893f029b29F44d368eAeD40e573B6 +LendingPoolConfigurator: 0x2C4603396dE2F08642354A3A102760827FfFe113 +StableAndVariableTokensHelper: 0xadcD6f616fCEEbEd731B2B3F01B8bd51A08b5CbD +ATokensAndRatesHelper: 0x603A373A1571783bD82b708C20a5A4b019BAB78F +DAI: 0x7c2C195CD6D34B8F845992d380aADB2730bB9C6F +AAVE: 0x8858eeB3DfffA017D4BCE9801D340D36Cf895CCf +TUSD: 0x0078371BDeDE8aAc7DeBfFf451B74c5EDB385Af7 +BAT: 0xf4e77E5Da47AC3125140c470c71cBca77B5c638c +WETHMocked: 0x09d728F76D543DB1925f7d1Fd8823e4e82700F99 +WETH: 0xf784709d2317D872237C4bC22f867d1BAe2913AB +USDC: 0x3619DbE27d7c1e7E91aA738697Ae7Bc5FC3eACA5 +USDT: 0x038B86d9d8FAFdd0a02ebd1A476432877b0107C8 +SUSD: 0x1A1FEe7EeD918BD762173e4dc5EfDB8a78C924A8 +ZRX: 0x500D1d6A4c7D8Ae28240b47c8FCde034D827fD5e +MKR: 0xc4905364b78a742ccce7B890A89514061E47068D +WBTC: 0xD6C850aeBFDC46D7F4c207e445cC0d6B0919BDBe +LINK: 0x8B5B7a6055E54a36fF574bbE40cf2eA68d5554b3 +KNC: 0xEcc0a6dbC0bb4D51E4F84A315a9e5B0438cAD4f0 +MANA: 0x20Ce94F404343aD2752A2D01b43fa407db9E0D00 +REN: 0x1d80315fac6aBd3EfeEbE97dEc44461ba7556160 +SNX: 0x2D8553F9ddA85A9B3259F6Bf26911364B85556F5 +BUSD: 0x52d3b94181f8654db2530b0fEe1B19173f519C52 +USD: 0xd15468525c35BDBC1eD8F2e09A00F8a173437f2f +YFI: 0x7e35Eaf7e8FBd7887ad538D4A38Df5BbD073814a +UNI: 0x5bcb88A0d20426e451332eE6C4324b0e663c50E0 +ENJ: 0x3521eF8AaB0323004A6dD8b03CE890F4Ea3A13f5 +WETHDAI: 0x53369fd4680FfE3DfF39Fc6DDa9CfbfD43daeA2E +WETHWBTC: 0xB00cC45B4a7d3e1FEE684cFc4417998A1c183e6d +PriceOracle: 0x06bA8d8af0dF898D0712DffFb0f862cC51AF45c2 +MockAggregator: 0xA0AB1cB92A4AF81f84dCd258155B5c25D247b54E +AaveOracle: 0xD662fb7FDC7526C79AA4417d2A4415416e057ec4 +LendingRateOracle: 0xEC1C93A9f6a9e18E97784c76aC52053587FcDB89 +AaveProtocolDataProvider: 0xf45C720549136d5E2d6a5A2F12573A36E36C3411 +stableDebtAAVE: 0xe3C388495669b8624753a275675AEf9eCc8Eaaa4 +variableDebtAAVE: 0xbdA8106CA657E2bfe1a125f0D0DDE47bA85E92c8 +stableDebtBAT: 0xa8c48Fad16b34bc9BC1203f1784D36CDf61dfD9c +variableDebtBAT: 0x5A7dE46c8176AF8550Df2fEF14464c2cB3B0EE5e +aAAVE: 0x1433d6d0794262c09f19E64177c0dD69A0e4D648 +strategyAAVE: 0x329e6747250B326E5E8029154DFFfE93F4f27016 +aBAT: 0x1A2e1C9d403E9DD6Da5022a14590ec875fBb75ba +strategyBAT: 0x12d5da143C6f7d3322C9b32cdF3a6Cae390A5293 +stableDebtBUSD: 0x453697f5d829556a0373F2b835cF94242B078C9e +variableDebtBUSD: 0x03D049FCA4dE1DA80F9DDF4bf0008115c74C0Da2 +stableDebtDAI: 0x30dDD022BC4df9BB0e6ce94A5535F2137dEA3755 +variableDebtDAI: 0xbfC8B61A3e6eD07C092a74603CeCAe91254745D6 +aBUSD: 0x1BC353ae7758eff98129928631a2D17d69BAb5FA +strategyBUSD: 0x270176D7DB4ec8d2a16b90C78B424AAdbBcFE298 +aDAI: 0x6A61442dBCF10E7168FfcD850CDf7c91Cad3E666 +strategyDAI: 0xA9DD0c06755734f4327F405cd20897D79FaCcFAE +stableDebtENJ: 0x6C0A2d54B37d8Cd321a25328753077D43A387303 +variableDebtENJ: 0x1372E5e41E22BaB997aD453469F0DFB9569dB121 +stableDebtKNC: 0x9bF0208c881906fAC92112320425b403e08Fe44b +variableDebtKNC: 0x6028834D13a4eec68b289E125222e5e5e86a5503 +aENJ: 0x2108E7A4B53516883b60a40ae02600697c8065A2 +strategyENJ: 0x64980e3e653Fe43813A41b9C5AcDB394d7A7320F +aKNC: 0x0f22acabf1Aa485565693B671Fc68B0583f8FEB0 +strategyKNC: 0xC45DA1E746911C76E51CA28b8d8A876735797E3C +stableDebtLINK: 0x3E650a21eAACE6314E98569E8A37FDA1d4cfBE28 +variableDebtLINK: 0xA7430bFB0f7332B1456dCB770D593f1D35bc2B11 +stableDebtMANA: 0x8DB6b6aE3c096E84B9818545974d1577E37Bcb97 +variableDebtMANA: 0x945ea0cf8986724ec075bE09C503c822fF8Ebb75 +aLINK: 0x778c890b128CE3936b744F0c8d7290d1F161D888 +strategyLINK: 0xCD8C6429A2975Db9466fCEFf36020166930a11Cb +aMANA: 0x5fd9aE04361262868d5C33cA1545580fC509b34c +strategyMANA: 0x024CC36954EfDbB9CFdda80a5A8c05Bd8DdF0fc8 +stableDebtMKR: 0xd1bD598200b53FC352483dBe36d9d72C085011A4 +variableDebtMKR: 0x49b81af588031Ecc93E20355E9ADC2d720348347 +stableDebtREN: 0x7367fBfEA2643eCbc0816Cc87B91E82B3Eb307aF +variableDebtREN: 0xAD75a04e5B815558a7E6C84c030e857671875934 +aMKR: 0xbEf21bFD5164eA882d74df73BB0862226C3063E9 +strategyMKR: 0x27a99bef2aF3200c6B7a831C61eF692341C7acEe +aREN: 0xe807dCAB5d5e8c5701c089758aAd34869a4c92Ea +strategyREN: 0xD933d804Dcb597Ac8020623ac32CcE3d4cB81b2a +stableDebtSNX: 0x3F33fb4D89eC6Bd516dCa915A3d85F0374d099d5 +variableDebtSNX: 0xD27B891432c9036E9dC95bc4fE9b8FCb61FBa05e +stableDebtSUSD: 0xFe3C98C3daE2F7562f43D1bBD2021FE127Afec38 +variableDebtSUSD: 0x53070063F0fB13C51C0e2186C0130f29aBe5336b +aSNX: 0x96a8C36C19D2A96642F2738b8E0481f159488EaD +strategySNX: 0xa5eB1859FA97E38C0a4257Af0be9085b3B4B7996 +aSUSD: 0x948Bd60Cba5eB8b7A478aE673145FeA13e2Edbe8 +strategySUSD: 0x7C769501542E694a5Dea6B1FCAf52B9270EADcaf +stableDebtTUSD: 0x6c2E76485dFbaFe2FCC6874e531D71ee82db06f6 +variableDebtTUSD: 0x3FA01122234D545d0247bdDbf4865925A53f6551 +stableDebtUSDC: 0xDD7a535Fb8773EBc4Ae653eCCb22F6561F434a9E +variableDebtUSDC: 0x9d1718D33aE17e54D2aE329b6B51511d4371Bf4a +aTUSD: 0x802881960dCD9457F63c4dbe1E9D081b32b011b9 +strategyTUSD: 0xC1f335a47c45d9F15976A1e11Eb3826590AD2a56 +aUSDC: 0x1CC642F9b88f755C1E7fbB9Acb4A990faddBF608 +strategyUSDC: 0x4272DE39F41085769562b2c17Fd5369097E41492 +stableDebtUSDT: 0x372915a5Bed2B0a5ecEdc96e7133A24aDDFA4Bc4 +variableDebtUSDT: 0x78123523ba15F9847D22a6d3f06bBed70E431114 +stableDebtWBTC: 0x6a3aB96987B70E29bc4203f78D09D0aCB85F219D +variableDebtWBTC: 0xcDD6c3f0dA05129f08DB52380C48A9cf698A8CCA +aUSDT: 0xe88141a1642eD64AE739cd2C896009Be73a43486 +strategyUSDT: 0x881036687070243FC119014c41cdd5e3c22f3E50 +aWBTC: 0xE74801a99A51B89dE670132De7d9c18CC2BBE54A +strategyWBTC: 0x55DFA1D5af234B35D457C13B8a58899848A438F8 +stableDebtWETH: 0xD1220D8A82a26C1396cccb5Ee79d3A42D7D3E3da +variableDebtWETH: 0x4f87eBaac31C3d13C376d52A0FABf5f022660C4c +stableDebtYFI: 0xF2dB8bc0dCd0A6C6F25B7f6ACfB9E026ae0e7494 +variableDebtYFI: 0xce3529624a1f3Ea5DBC1AB130eBeA8211E3b602F +aWETH: 0x7e4b842FFc0598C1f5D8b8A1e2C7AD29E9F233C7 +strategyWETH: 0x52Ac4c1Dbc0263b2FD6AD065B27576d0E7d925B9 +aYFI: 0x895D60248de2edc34C99f1B45d8Dd1731656Df51 +strategyYFI: 0x3cE6D0B4b6dc27C725fA94903Fb33d73bE75e9D7 +stableDebtZRX: 0xF78Fbf3b21aF8Bce2efA3614E507735573c578CC +variableDebtZRX: 0x9Ae60ba71A28a1d738a2FDFC1D0439B33f3f0B1F +aZRX: 0x80aB7B8EfeA24C2D2Ca22315BFa99E03f539C568 +strategyZRX: 0x4D2271CFa5587643B8f5919f3EbF64de7aaa9d5c +DelegationAwareAToken: 0xBAdDA897176B5A94FD4A0eCb59678DDA29181963 +StableDebtToken: 0x64Ea58f488aD445235A0afE9256B066572c6Abc8 +VariableDebtToken: 0x8D0206fEBEB380486729b64bB4cfEDC5b354a6D6 +DefaultReserveInterestRateStrategy: 0x3c5408De7435Dfa3eB2aF2Edf5E39385f68F69b2 +LendingPoolCollateralManagerImpl: 0x6602fca48E95F5068506963E3A8930131108048A +LendingPoolCollateralManager: 0x6602fca48E95F5068506963E3A8930131108048A +MockFlashLoanReceiver: 0x1a66D6103F8BBf9204E1618F095a80b3E4817C95 +WalletBalanceProvider: 0x0EBCa695959e5f138Af772FAa44ce1A9C7aEd921 +WETHGateway: 0x8BFFF31B1757da579Bb5B118489568526F7fb6D4 +MintableDelegationERC20: 0x8BFFF31B1757da579Bb5B118489568526F7fb6D4 +MockAToken: 0x8BFFF31B1757da579Bb5B118489568526F7fb6D4 +MockStableDebtToken: 0x0459c841b02Aee8730730C737582c53B20a27288 +MockVariableDebtToken: 0x2530ce07D254eA185E8e0bCC37a39e2FbA3bE548 +SelfdestructTransferMock: 0x0459c841b02Aee8730730C737582c53B20a27288 +UniswapLendingPool: 0xEC42F4C314dE9492cb3Ef7a860270eCDFE0F851a +UniswapLendingPoolConfigurator: 0x672A68Ff1364E87D8f88ad86410449C117fC97A6 +UniswapLendingPoolAddressesProvider: 0x18b9306737eaf6E8FC8e737F488a1AE077b18053 +UniswapLendingPoolImpl: 0xbAc762e2000b6815268587b081Fd17aC25519aD5 +UniswapLendingPoolConfiguratorImpl: 0xAa7BC1924711B77A0F3Aaebdd550BfeDDDbaf3cd +UniswapPriceOracle: 0xFf130817Aa9863B3D809A2A11617c05646245d80 +UniswapAaveOracle: 0xE91bBe8ee03560E3dda2786f95335F5399813Ca0 +UniswapLendingRateOracle: 0x4977FC58783ceBCC310311C800B786EcAf45F98f +stableDebtWETHDAI: 0x84fF0147dDD2acA72407CfEB7EabCd2b7E49d949 +variableDebtWETHDAI: 0x35A1E1Be236899ab7B63a81127ab522d76A26B3e +aWETHDAI: 0x591D75Ea272E9F22fC4B20Fc4C4E03d8c126b1AB +strategyWETHDAI: 0xF4040B68C37eE6F1324470f48D05cCEC50819b2E +stableDebtWETHWBTC: 0x5a41efF010872DB9a2CA0b47b8b757f37dc35A7f +variableDebtWETHWBTC: 0xee0382a3E9ADeAaA670c425D51ad5F8022c6d9F8 +aWETHWBTC: 0x4dA415c7aDaC37c3d710B5D24b62c6f4a5aF6e5F +strategyWETHWBTC: 0xf0c3F1cd72eA0a1F4e0e98B2e0702fA63a9F9faF +UniswapLendingPoolCollateralManagerImpl: 0x9D2F6Ec881323E78f27d58b996b81EaBCEF8eC58 +UniswapLendingPoolCollateralManager: 0x9D2F6Ec881323E78f27d58b996b81EaBCEF8eC58 +UniswapMockFlashLoanReceiver: 0xad17D0b25259128C968dbCa61CB5864C78004DBE +UniswapWalletBalanceProvider: 0x6Ac05758229c725A6d14F0ae7088985D9B251Fb2 +UniswapWETHGateway: 0xb2B548BE73010C188C083c510d255Aed74843b05 \ No newline at end of file From 4637476bbd547f87a31a94cf70ae74e3a8962b97 Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Wed, 30 Dec 2020 01:04:06 -0500 Subject: [PATCH 04/31] Removed UNI prefix, cleaned up --- helpers/types.ts | 32 +++++++++++--------------------- markets/aave/commons.ts | 9 ++------- markets/uniswap/commons.ts | 23 +++++++++-------------- markets/uniswap/index.ts | 14 +++++++------- 4 files changed, 29 insertions(+), 49 deletions(-) diff --git a/helpers/types.ts b/helpers/types.ts index 9c15dd13..664e3e62 100644 --- a/helpers/types.ts +++ b/helpers/types.ts @@ -215,13 +215,8 @@ export interface iAssetBase { USD: T; REN: T; ENJ: T; - UNI_WETH: T; - UNI_WBTC: T; - UNI_DAI: T; - UNI_USDC: T; - UNI_USDT: T; - UNI_WETHDAI: T; - UNI_WETHWBTC: T; + WETHDAI: T; + WETHWBTC: T; } export type iAssetsWithoutETH = Omit, 'ETH'>; @@ -254,13 +249,13 @@ export type iAavePoolAssets = Pick< export type iUniswapPoolAssets = Pick< iAssetsWithoutUSD, - | 'UNI_DAI' - | 'UNI_USDC' - | 'UNI_USDT' - | 'UNI_WBTC' - | 'UNI_WETH' - | 'UNI_WETHDAI' - | 'UNI_WETHWBTC' + | 'DAI' + | 'USDC' + | 'USDT' + | 'WBTC' + | 'WETH' + | 'WETHDAI' + | 'WETHWBTC' >; export type iMultiPoolsAssets = iAssetCommon | iAavePoolAssets; @@ -291,13 +286,8 @@ export enum TokenContractId { YFI = 'YFI', UNI = 'UNI', ENJ = 'ENJ', - UNI_WETH = 'WETH', - UNI_WBTC = 'WBTC', - UNI_DAI = 'DAI', - UNI_USDC = 'USDC', - UNI_USDT = 'USDT', - UNI_WETHDAI = 'WETHDAI', - UNI_WETHWBTC = 'WETHWBTC', + WETHDAI = 'WETHDAI', + WETHWBTC = 'WETHWBTC', } export interface IReserveParams extends IReserveBorrowParams, IReserveCollateralParams { diff --git a/markets/aave/commons.ts b/markets/aave/commons.ts index e059c961..fecd714f 100644 --- a/markets/aave/commons.ts +++ b/markets/aave/commons.ts @@ -23,13 +23,8 @@ const MOCK_CHAINLINK_AGGREGATORS_PRICES = { WBTC: oneEther.multipliedBy('47.332685').toFixed(), YFI: oneEther.multipliedBy('22.407436').toFixed(), ZRX: oneEther.multipliedBy('0.001151').toFixed(), - UNI_WETH:oneEther.toFixed(), - UNI_WBTC: oneEther.multipliedBy('47.332685').toFixed(), - UNI_DAI: oneEther.multipliedBy('0.00369068412860').toFixed(), - UNI_USDC: oneEther.multipliedBy('0.00367714136416').toFixed(), - UNI_USDT: oneEther.multipliedBy('0.00369068412860').toFixed(), - UNI_WETHDAI: oneEther.multipliedBy('22.407436').toFixed(), - UNI_WETHWBTC: oneEther.multipliedBy('22.407436').toFixed(), + WETHDAI: oneEther.multipliedBy('22.407436').toFixed(), + WETHWBTC: oneEther.multipliedBy('22.407436').toFixed(), USD: '5848466240000000', }; // ---------------- diff --git a/markets/uniswap/commons.ts b/markets/uniswap/commons.ts index c12b4570..660a210a 100644 --- a/markets/uniswap/commons.ts +++ b/markets/uniswap/commons.ts @@ -23,13 +23,8 @@ const MOCK_CHAINLINK_AGGREGATORS_PRICES = { WBTC: oneEther.multipliedBy('47.332685').toFixed(), YFI: oneEther.multipliedBy('22.407436').toFixed(), ZRX: oneEther.multipliedBy('0.001151').toFixed(), - UNI_WETH:oneEther.toFixed(), - UNI_WBTC: oneEther.multipliedBy('47.332685').toFixed(), - UNI_DAI: oneEther.multipliedBy('0.00369068412860').toFixed(), - UNI_USDC: oneEther.multipliedBy('0.00367714136416').toFixed(), - UNI_USDT: oneEther.multipliedBy('0.00369068412860').toFixed(), - UNI_WETHDAI: oneEther.multipliedBy('22.407436').toFixed(), - UNI_WETHWBTC: oneEther.multipliedBy('22.407436').toFixed(), + WETHDAI: oneEther.multipliedBy('22.407436').toFixed(), + WETHWBTC: oneEther.multipliedBy('22.407436').toFixed(), USD: '5848466240000000', }; // ---------------- @@ -59,25 +54,25 @@ export const CommonsConfig: ICommonConfiguration = { }, // TODO: reorg alphabetically, checking the reason of tests failing LendingRateOracleRatesCommon: { - UNI_WETH: { + WETH: { borrowRate: oneRay.multipliedBy(0.03).toFixed(), }, - UNI_DAI: { + DAI: { borrowRate: oneRay.multipliedBy(0.039).toFixed(), }, - UNI_USDC: { + USDC: { borrowRate: oneRay.multipliedBy(0.039).toFixed(), }, - UNI_USDT: { + USDT: { borrowRate: oneRay.multipliedBy(0.035).toFixed(), }, - UNI_WBTC: { + WBTC: { borrowRate: oneRay.multipliedBy(0.03).toFixed(), }, - UNI_WETHDAI: { + WETHDAI: { borrowRate: oneRay.multipliedBy(0.05).toFixed(), }, - UNI_WETHWBTC: { + WETHWBTC: { borrowRate: oneRay.multipliedBy(0.05).toFixed(), }, }, diff --git a/markets/uniswap/index.ts b/markets/uniswap/index.ts index d92518df..37daa4af 100644 --- a/markets/uniswap/index.ts +++ b/markets/uniswap/index.ts @@ -21,13 +21,13 @@ export const UniswapConfig: IUniswapConfiguration = { MarketId: 'Uniswap V2 market', ProviderId: 2, ReservesConfig: { - UNI_DAI: strategyDAI, - UNI_USDC: strategyUSDC, - UNI_USDT: strategyUSDT, - UNI_WBTC: strategyWBTC, - UNI_WETH: strategyWETH, - UNI_WETHDAI: strategyWETHDAI, - UNI_WETHWBTC: strategyWETHWBTC + DAI: strategyDAI, + USDC: strategyUSDC, + USDT: strategyUSDT, + WBTC: strategyWBTC, + WETH: strategyWETH, + WETHDAI: strategyWETHDAI, + WETHWBTC: strategyWETHWBTC }, ReserveAssets: { [eEthereumNetwork.buidlerevm]: {}, From 5f4798f4bd2b9eb5b8fd48a7346abe0c7c570612 Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Fri, 1 Jan 2021 17:43:19 -0500 Subject: [PATCH 05/31] Updated readme for clarity --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8e4b0049..d5d9b6bc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -### Uniswap V2 Market Aave Fork +### Uniswap V2 Liquidity Pool Market Aave Fork ``` .///. .///. //. .// `/////////////- `++:++` .++:++` :++` `++: `++:......---.` From 1669d6587a5d40477e9f75b1924cc24aa6d24307 Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Fri, 1 Jan 2021 21:14:02 -0500 Subject: [PATCH 06/31] Fixed UNI prefix error in setup.spec --- tasks/dev/7_uniswap_market.ts | 1 + test/__setup.spec.ts | 10 +++------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/tasks/dev/7_uniswap_market.ts b/tasks/dev/7_uniswap_market.ts index aa73fc40..3703f9bb 100644 --- a/tasks/dev/7_uniswap_market.ts +++ b/tasks/dev/7_uniswap_market.ts @@ -139,6 +139,7 @@ task( ProtocolGlobalParams: {UsdAddress, MockUsdPriceInWei}, LendingRateOracleRatesCommon, } = poolConfig as ICommonConfiguration; + console.log("Initialized mocks, global params and lending rate oracle rates"); const defaultTokenList = { diff --git a/test/__setup.spec.ts b/test/__setup.spec.ts index 51542de9..e464b47f 100644 --- a/test/__setup.spec.ts +++ b/test/__setup.spec.ts @@ -97,6 +97,7 @@ const buildTestEnv = async (deployer: Signer, secondaryWallet: Signer) => { const addressList = await Promise.all( (await DRE.ethers.getSigners()).map((signer) => signer.getAddress()) ); + console.log(addressList); await waitForTx(await addressesProvider.setEmergencyAdmin(addressList[2])); @@ -159,13 +160,8 @@ const buildTestEnv = async (deployer: Signer, secondaryWallet: Signer) => { REN: mockTokens.REN.address, UNI: mockTokens.UNI.address, ENJ: mockTokens.ENJ.address, - UNI_WETH: mockTokens.WETH.address, - UNI_WBTC: mockTokens.WBTC.address, - UNI_DAI: mockTokens.DAI.address, - UNI_USDC: mockTokens.USDC.address, - UNI_USDT: mockTokens.USDT.address, - UNI_WETHDAI: mockTokens.UNI_WETHDAI.address, - UNI_WETHWBTC: mockTokens.UNI_WETHWBTC.address, + WETHDAI: mockTokens.WETHDAI.address, + WETHWBTC: mockTokens.WETHWBTC.address, USD: USD_ADDRESS, }, fallbackOracle From ced0bc3dfe480129ddf06e95c063fb51a8dbf2de Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Thu, 7 Jan 2021 20:27:39 -0500 Subject: [PATCH 07/31] Setup testing on Kovan. Error on oracle deployment --- markets/uniswap/commons.ts | 6 ++++-- markets/uniswap/index.ts | 4 ++-- package.json | 1 + tasks/full/1_address_provider.ts | 14 ++++++++------ tasks/migrations/aave.dev.ts | 4 ++-- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/markets/uniswap/commons.ts b/markets/uniswap/commons.ts index 660a210a..889b15e3 100644 --- a/markets/uniswap/commons.ts +++ b/markets/uniswap/commons.ts @@ -111,8 +111,8 @@ export const CommonsConfig: ICommonConfiguration = { [eEthereumNetwork.buidlerevm]: '', [eEthereumNetwork.tenderlyMain]: '0x52D306e36E3B6B02c153d0266ff0f85d18BCD413', }, - ProviderRegistryOwner: { - [eEthereumNetwork.kovan]: '0x85e4A467343c0dc4aDAB74Af84448D9c45D8ae6F', + ProviderRegistryOwner: { // TEMPORARILY USING MY DEPLOYER + [eEthereumNetwork.kovan]: '0x18d9bA2baEfBdE0FF137C4ad031427EF205f1Fd9',//'0x85e4A467343c0dc4aDAB74Af84448D9c45D8ae6F', [eEthereumNetwork.ropsten]: '', [eEthereumNetwork.main]: '0xbd723fc4f1d737dcfc48a07fe7336766d34cad5f', [eEthereumNetwork.coverage]: '', @@ -181,6 +181,8 @@ export const CommonsConfig: ICommonConfiguration = { YFI: '0xC5d1B1DEb2992738C0273408ac43e1e906086B6C', ZRX: '0xBc3f28Ccc21E9b5856E81E6372aFf57307E2E883', USD: '0x9326BFA02ADD2366b30bacB125260Af641031331', + WETHDAI: '0x90B86B501BF4d800a7F76E551952E214Cc58Fba3', + WETHWBTC: '0x90B86B501BF4d800a7F76E551952E214Cc58Fba3', }, [EthereumNetwork.ropsten]: { AAVE: ZERO_ADDRESS, diff --git a/markets/uniswap/index.ts b/markets/uniswap/index.ts index 37daa4af..e210c630 100644 --- a/markets/uniswap/index.ts +++ b/markets/uniswap/index.ts @@ -39,8 +39,8 @@ export const UniswapConfig: IUniswapConfiguration = { USDT: '0x13512979ADE267AB5100878E2e0f485B568328a4', WBTC: '0xD1B98B6607330172f1D991521145A22BCe793277', WETH: '0xd0a1e359811322d97991e03f863a0c30c2cf029c', - WETHDAI: '', - WETHWBTC: '', + WETHDAI: '0x7d3A67ab574abD3F9849e5fcDa48c19939d032b4', + WETHWBTC: '0x342e78bf229Cd2a750E80D7D7c2C185455979b91', }, [EthereumNetwork.ropsten]: { // AAVE: '', diff --git a/package.json b/package.json index cd9c9e3e..56c6378e 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "aave:evm:dev:migration": "npm run compile && hardhat aave:dev", "aave:docker:full:migration": "npm run compile && npm run hardhat:docker -- aave:mainnet", "aave:kovan:full:migration": "npm run compile && npm run hardhat:kovan -- aave:mainnet --verify", + "uniswap:kovan:full:migration": "npm run compile && npm run hardhat:kovan -- uniswap:mainnet --verify", "aave:kovan:full:initialize": "npm run hardhat:kovan -- full:initialize-lending-pool --verify --pool Aave", "aave:ropsten:full:migration": "npm run compile && npm run hardhat:ropsten -- aave:mainnet --verify", "aave:fork:main:tenderly": "npm run compile && npm run hardhat:tenderly-main -- aave:mainnet", diff --git a/tasks/full/1_address_provider.ts b/tasks/full/1_address_provider.ts index eddc17f8..94506c27 100644 --- a/tasks/full/1_address_provider.ts +++ b/tasks/full/1_address_provider.ts @@ -80,14 +80,16 @@ task( // 2. Deploy address provider and set genesis manager const addressesProvider = await deployLendingPoolAddressesProvider(MarketId, verify); + + // TEMPORARILY DISABLING SEC. 3 FOR KOVAN DEPLOYMENT // 3. Set the provider at the Registry - await waitForTx( - await addressesProviderRegistry.registerAddressesProvider( - addressesProvider.address, - ProviderId - ) - ); + // await waitForTx( + // await addressesProviderRegistry.registerAddressesProvider( + // addressesProvider.address, + // ProviderId + // ) + // ); // 4. Set pool admins diff --git a/tasks/migrations/aave.dev.ts b/tasks/migrations/aave.dev.ts index e92d894d..1fe841fe 100644 --- a/tasks/migrations/aave.dev.ts +++ b/tasks/migrations/aave.dev.ts @@ -29,8 +29,8 @@ task('aave:dev', 'Deploy development enviroment') console.log('4. Deploy oracles'); await localBRE.run('dev:deploy-oracles', {verify, pool: POOL_NAME}); - // console.log('6. Deploy Uniswap market oracles'); - // await localBRE.run('dev:deploy-oracles', {verify, pool: "Uniswap"}); + console.log('6. Deploy Uniswap market oracles'); + await localBRE.run('dev:deploy-oracles', {verify, pool: "Uniswap"}); console.log('5. Initialize lending pool'); await localBRE.run('dev:initialize-lending-pool', {verify, pool: POOL_NAME}); From 84d95038a0afb60ba9771cf8127a4ea965146c0b Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Thu, 7 Jan 2021 21:55:24 -0500 Subject: [PATCH 08/31] Fixed Kovan deployment. --- markets/uniswap/commons.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/markets/uniswap/commons.ts b/markets/uniswap/commons.ts index 889b15e3..db319e66 100644 --- a/markets/uniswap/commons.ts +++ b/markets/uniswap/commons.ts @@ -124,7 +124,7 @@ export const CommonsConfig: ICommonConfiguration = { [eEthereumNetwork.coverage]: '', [eEthereumNetwork.hardhat]: '', [eEthereumNetwork.buidlerevm]: '', - [eEthereumNetwork.kovan]: '0xdCde9Bb6a49e37fA433990832AB541AE2d4FEB4a', + [eEthereumNetwork.kovan]: '',//'0xdCde9Bb6a49e37fA433990832AB541AE2d4FEB4a', [eEthereumNetwork.ropsten]: '0x05dcca805a6562c1bdd0423768754acb6993241b', [eEthereumNetwork.main]: '0x8A32f49FFbA88aba6EFF96F45D8BD1D4b3f35c7D', [eEthereumNetwork.tenderlyMain]: '0x8A32f49FFbA88aba6EFF96F45D8BD1D4b3f35c7D', @@ -142,7 +142,7 @@ export const CommonsConfig: ICommonConfiguration = { [eEthereumNetwork.coverage]: '', [eEthereumNetwork.hardhat]: '', [eEthereumNetwork.buidlerevm]: '', - [EthereumNetwork.kovan]: '0xB8bE51E6563BB312Cbb2aa26e352516c25c26ac1', + [EthereumNetwork.kovan]: '',//'0xB8bE51E6563BB312Cbb2aa26e352516c25c26ac1', [EthereumNetwork.ropsten]: ZERO_ADDRESS, [EthereumNetwork.main]: '0xA50ba011c48153De246E5192C8f9258A2ba79Ca9', [EthereumNetwork.tenderlyMain]: '0xA50ba011c48153De246E5192C8f9258A2ba79Ca9', From 36e5642f24069588fe6dca530524eaa26ce2065b Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Sun, 10 Jan 2021 19:57:58 -0500 Subject: [PATCH 09/31] Removed dev task --- helpers/uniswap-contracts-deployments.ts | 434 +++++++++--------- tasks/dev/7_uniswap_market.ts | 536 +++++++++++------------ tasks/migrations/aave.dev.ts | 4 +- 3 files changed, 487 insertions(+), 487 deletions(-) diff --git a/helpers/uniswap-contracts-deployments.ts b/helpers/uniswap-contracts-deployments.ts index 0c28b324..18681b1d 100644 --- a/helpers/uniswap-contracts-deployments.ts +++ b/helpers/uniswap-contracts-deployments.ts @@ -1,241 +1,241 @@ -import { Contract } from 'ethers'; -import { DRE } from './misc-utils'; -import { - tEthereumAddress, - eContractid, - tStringTokenSmallUnits, - AavePools, - TokenContractId, - iMultiPoolsAssets, - IReserveParams, - PoolConfiguration, - eEthereumNetwork, -} from './types'; +// import { Contract } from 'ethers'; +// import { DRE } from './misc-utils'; +// import { +// tEthereumAddress, +// eContractid, +// tStringTokenSmallUnits, +// AavePools, +// TokenContractId, +// iMultiPoolsAssets, +// IReserveParams, +// PoolConfiguration, +// eEthereumNetwork, +// } from './types'; -import { MintableERC20 } from '../types/MintableERC20'; -import { MockContract } from 'ethereum-waffle'; -import { getReservesConfigByPool } from './configuration'; -import { getFirstSigner } from './contracts-getters'; -import { ZERO_ADDRESS } from './constants'; -import { - AaveProtocolDataProviderFactory, - ATokenFactory, - ATokensAndRatesHelperFactory, - AaveOracleFactory, - DefaultReserveInterestRateStrategyFactory, - DelegationAwareATokenFactory, - InitializableAdminUpgradeabilityProxyFactory, - LendingPoolAddressesProviderFactory, - LendingPoolAddressesProviderRegistryFactory, - LendingPoolCollateralManagerFactory, - LendingPoolConfiguratorFactory, - LendingPoolFactory, - LendingRateOracleFactory, - MintableDelegationERC20Factory, - MintableERC20Factory, - MockAggregatorFactory, - MockATokenFactory, - MockFlashLoanReceiverFactory, - MockStableDebtTokenFactory, - MockVariableDebtTokenFactory, - PriceOracleFactory, - ReserveLogicFactory, - SelfdestructTransferFactory, - StableDebtTokenFactory, - VariableDebtTokenFactory, - WalletBalanceProviderFactory, - WETH9MockedFactory, - WETHGatewayFactory, -} from '../types'; -import { - withSaveAndVerify, - registerContractInJsonDb, - linkBytecode, - insertContractAddressInDb, -} from './contracts-helpers'; -import { StableAndVariableTokensHelperFactory } from '../types/StableAndVariableTokensHelperFactory'; -import { MintableDelegationERC20 } from '../types/MintableDelegationERC20'; -import { readArtifact as buidlerReadArtifact } from '@nomiclabs/buidler/plugins'; -import { HardhatRuntimeEnvironment } from 'hardhat/types'; -import { LendingPoolLibraryAddresses } from '../types/LendingPoolFactory'; +// import { MintableERC20 } from '../types/MintableERC20'; +// import { MockContract } from 'ethereum-waffle'; +// import { getReservesConfigByPool } from './configuration'; +// import { getFirstSigner } from './contracts-getters'; +// import { ZERO_ADDRESS } from './constants'; +// import { +// AaveProtocolDataProviderFactory, +// ATokenFactory, +// ATokensAndRatesHelperFactory, +// AaveOracleFactory, +// DefaultReserveInterestRateStrategyFactory, +// DelegationAwareATokenFactory, +// InitializableAdminUpgradeabilityProxyFactory, +// LendingPoolAddressesProviderFactory, +// LendingPoolAddressesProviderRegistryFactory, +// LendingPoolCollateralManagerFactory, +// LendingPoolConfiguratorFactory, +// LendingPoolFactory, +// LendingRateOracleFactory, +// MintableDelegationERC20Factory, +// MintableERC20Factory, +// MockAggregatorFactory, +// MockATokenFactory, +// MockFlashLoanReceiverFactory, +// MockStableDebtTokenFactory, +// MockVariableDebtTokenFactory, +// PriceOracleFactory, +// ReserveLogicFactory, +// SelfdestructTransferFactory, +// StableDebtTokenFactory, +// VariableDebtTokenFactory, +// WalletBalanceProviderFactory, +// WETH9MockedFactory, +// WETHGatewayFactory, +// } from '../types'; +// import { +// withSaveAndVerify, +// registerContractInJsonDb, +// linkBytecode, +// insertContractAddressInDb, +// } from './contracts-helpers'; +// import { StableAndVariableTokensHelperFactory } from '../types/StableAndVariableTokensHelperFactory'; +// import { MintableDelegationERC20 } from '../types/MintableDelegationERC20'; +// import { readArtifact as buidlerReadArtifact } from '@nomiclabs/buidler/plugins'; +// import { HardhatRuntimeEnvironment } from 'hardhat/types'; +// import { LendingPoolLibraryAddresses } from '../types/LendingPoolFactory'; -const readArtifact = async (id: string) => { - if (DRE.network.name === eEthereumNetwork.buidlerevm) { - return buidlerReadArtifact(DRE.config.paths.artifacts, id); - } - return (DRE as HardhatRuntimeEnvironment).artifacts.readArtifact(id); -}; +// const readArtifact = async (id: string) => { +// if (DRE.network.name === eEthereumNetwork.buidlerevm) { +// return buidlerReadArtifact(DRE.config.paths.artifacts, id); +// } +// return (DRE as HardhatRuntimeEnvironment).artifacts.readArtifact(id); +// }; -export const deployUniswapLendingPoolAddressesProvider = async (marketId: string, verify?: boolean) => - withSaveAndVerify( - await new LendingPoolAddressesProviderFactory(await getFirstSigner()).deploy(marketId), - eContractid.UniswapLendingPoolAddressesProvider, - [marketId], - verify - ); +// export const deployUniswapLendingPoolAddressesProvider = async (marketId: string, verify?: boolean) => +// withSaveAndVerify( +// await new LendingPoolAddressesProviderFactory(await getFirstSigner()).deploy(marketId), +// eContractid.UniswapLendingPoolAddressesProvider, +// [marketId], +// verify +// ); -export const deployUniswapLendingPoolConfigurator = async (verify?: boolean) => { - const lendingPoolConfiguratorImpl = await new LendingPoolConfiguratorFactory( - await getFirstSigner() - ).deploy(); - await insertContractAddressInDb( - eContractid.UniswapLendingPoolConfiguratorImpl, - lendingPoolConfiguratorImpl.address - ); - return withSaveAndVerify( - lendingPoolConfiguratorImpl, - eContractid.UniswapLendingPoolConfigurator, - [], - verify - ); -}; +// export const deployUniswapLendingPoolConfigurator = async (verify?: boolean) => { +// const lendingPoolConfiguratorImpl = await new LendingPoolConfiguratorFactory( +// await getFirstSigner() +// ).deploy(); +// await insertContractAddressInDb( +// eContractid.UniswapLendingPoolConfiguratorImpl, +// lendingPoolConfiguratorImpl.address +// ); +// return withSaveAndVerify( +// lendingPoolConfiguratorImpl, +// eContractid.UniswapLendingPoolConfigurator, +// [], +// verify +// ); +// }; -export const deployUniswapLendingPool = async (verify?: boolean) => { - const libraries = await deployAaveLibraries(verify); - const lendingPoolImpl = await new LendingPoolFactory(libraries, await getFirstSigner()).deploy(); - await insertContractAddressInDb(eContractid.UniswapLendingPoolImpl, lendingPoolImpl.address); - return withSaveAndVerify(lendingPoolImpl, eContractid.LendingPool, [], verify); -}; +// export const deployUniswapLendingPool = async (verify?: boolean) => { +// const libraries = await deployAaveLibraries(verify); +// const lendingPoolImpl = await new LendingPoolFactory(libraries, await getFirstSigner()).deploy(); +// await insertContractAddressInDb(eContractid.UniswapLendingPoolImpl, lendingPoolImpl.address); +// return withSaveAndVerify(lendingPoolImpl, eContractid.LendingPool, [], verify); +// }; -export const deployReserveLogicLibrary = async (verify?: boolean) => - withSaveAndVerify( - await new ReserveLogicFactory(await getFirstSigner()).deploy(), - eContractid.ReserveLogic, - [], - verify - ); +// export const deployReserveLogicLibrary = async (verify?: boolean) => +// withSaveAndVerify( +// await new ReserveLogicFactory(await getFirstSigner()).deploy(), +// eContractid.ReserveLogic, +// [], +// verify +// ); -export const deployGenericLogic = async (reserveLogic: Contract, verify?: boolean) => { - const genericLogicArtifact = await readArtifact(eContractid.GenericLogic); +// export const deployGenericLogic = async (reserveLogic: Contract, verify?: boolean) => { +// const genericLogicArtifact = await readArtifact(eContractid.GenericLogic); - const linkedGenericLogicByteCode = linkBytecode(genericLogicArtifact, { - [eContractid.ReserveLogic]: reserveLogic.address, - }); +// const linkedGenericLogicByteCode = linkBytecode(genericLogicArtifact, { +// [eContractid.ReserveLogic]: reserveLogic.address, +// }); - const genericLogicFactory = await DRE.ethers.getContractFactory( - genericLogicArtifact.abi, - linkedGenericLogicByteCode - ); +// const genericLogicFactory = await DRE.ethers.getContractFactory( +// genericLogicArtifact.abi, +// linkedGenericLogicByteCode +// ); - const genericLogic = await (await genericLogicFactory.deploy()).deployed(); - return withSaveAndVerify(genericLogic, eContractid.GenericLogic, [], verify); -}; +// const genericLogic = await (await genericLogicFactory.deploy()).deployed(); +// return withSaveAndVerify(genericLogic, eContractid.GenericLogic, [], verify); +// }; -export const deployValidationLogic = async ( - reserveLogic: Contract, - genericLogic: Contract, - verify?: boolean -) => { - const validationLogicArtifact = await readArtifact(eContractid.ValidationLogic); +// export const deployValidationLogic = async ( +// reserveLogic: Contract, +// genericLogic: Contract, +// verify?: boolean +// ) => { +// const validationLogicArtifact = await readArtifact(eContractid.ValidationLogic); - const linkedValidationLogicByteCode = linkBytecode(validationLogicArtifact, { - [eContractid.ReserveLogic]: reserveLogic.address, - [eContractid.GenericLogic]: genericLogic.address, - }); +// const linkedValidationLogicByteCode = linkBytecode(validationLogicArtifact, { +// [eContractid.ReserveLogic]: reserveLogic.address, +// [eContractid.GenericLogic]: genericLogic.address, +// }); - const validationLogicFactory = await DRE.ethers.getContractFactory( - validationLogicArtifact.abi, - linkedValidationLogicByteCode - ); +// const validationLogicFactory = await DRE.ethers.getContractFactory( +// validationLogicArtifact.abi, +// 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 ( - verify?: boolean -): Promise => { - const reserveLogic = await deployReserveLogicLibrary(verify); - const genericLogic = await deployGenericLogic(reserveLogic, verify); - const validationLogic = await deployValidationLogic(reserveLogic, genericLogic, verify); +// export const deployAaveLibraries = async ( +// verify?: boolean +// ): Promise => { +// const reserveLogic = await deployReserveLogicLibrary(verify); +// const genericLogic = await deployGenericLogic(reserveLogic, verify); +// const validationLogic = await deployValidationLogic(reserveLogic, genericLogic, verify); - // 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 - // require a hardcoded string. - // - // how-to: - // 1. PLACEHOLDER = solidityKeccak256(['string'], `${libPath}:${libName}`).slice(2, 36) - // 2. LIB_PLACEHOLDER = `__$${PLACEHOLDER}$__` - // or grab placeholdes from LendingPoolLibraryAddresses at Typechain generation. - // - // libPath example: contracts/libraries/logic/GenericLogic.sol - // libName example: GenericLogic - return { - ['__$de8c0cf1a7d7c36c802af9a64fb9d86036$__']: validationLogic.address, - ['__$22cd43a9dda9ce44e9b92ba393b88fb9ac$__']: reserveLogic.address, - }; -}; +// // 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 +// // require a hardcoded string. +// // +// // how-to: +// // 1. PLACEHOLDER = solidityKeccak256(['string'], `${libPath}:${libName}`).slice(2, 36) +// // 2. LIB_PLACEHOLDER = `__$${PLACEHOLDER}$__` +// // or grab placeholdes from LendingPoolLibraryAddresses at Typechain generation. +// // +// // libPath example: contracts/libraries/logic/GenericLogic.sol +// // libName example: GenericLogic +// return { +// ['__$de8c0cf1a7d7c36c802af9a64fb9d86036$__']: validationLogic.address, +// ['__$22cd43a9dda9ce44e9b92ba393b88fb9ac$__']: reserveLogic.address, +// }; +// }; -export const deployUniswapPriceOracle = async (verify?: boolean) => - withSaveAndVerify( - await new PriceOracleFactory(await getFirstSigner()).deploy(), - eContractid.UniswapPriceOracle, - [], - verify - ); +// export const deployUniswapPriceOracle = async (verify?: boolean) => +// withSaveAndVerify( +// await new PriceOracleFactory(await getFirstSigner()).deploy(), +// eContractid.UniswapPriceOracle, +// [], +// verify +// ); -export const deployUniswapLendingRateOracle = async (verify?: boolean) => - withSaveAndVerify( - await new LendingRateOracleFactory(await getFirstSigner()).deploy(), - eContractid.UniswapLendingRateOracle, - [], - verify - ); +// export const deployUniswapLendingRateOracle = async (verify?: boolean) => +// withSaveAndVerify( +// await new LendingRateOracleFactory(await getFirstSigner()).deploy(), +// eContractid.UniswapLendingRateOracle, +// [], +// verify +// ); -export const deployUniswapAaveOracle = async ( - args: [tEthereumAddress[], tEthereumAddress[], tEthereumAddress, tEthereumAddress], - verify?: boolean -) => - withSaveAndVerify( - await new AaveOracleFactory(await getFirstSigner()).deploy(...args), - eContractid.UniswapAaveOracle, - args, - verify - ); +// export const deployUniswapAaveOracle = async ( +// args: [tEthereumAddress[], tEthereumAddress[], tEthereumAddress, tEthereumAddress], +// verify?: boolean +// ) => +// withSaveAndVerify( +// await new AaveOracleFactory(await getFirstSigner()).deploy(...args), +// eContractid.UniswapAaveOracle, +// args, +// verify +// ); -export const deployUniswapLendingPoolCollateralManager = async (verify?: boolean) => { - const collateralManagerImpl = await new LendingPoolCollateralManagerFactory( - await getFirstSigner() - ).deploy(); - await insertContractAddressInDb( - eContractid.UniswapLendingPoolCollateralManagerImpl, - collateralManagerImpl.address - ); - return withSaveAndVerify( - collateralManagerImpl, - eContractid.UniswapLendingPoolCollateralManager, - [], - verify - ); -}; +// export const deployUniswapLendingPoolCollateralManager = async (verify?: boolean) => { +// const collateralManagerImpl = await new LendingPoolCollateralManagerFactory( +// await getFirstSigner() +// ).deploy(); +// await insertContractAddressInDb( +// eContractid.UniswapLendingPoolCollateralManagerImpl, +// collateralManagerImpl.address +// ); +// return withSaveAndVerify( +// collateralManagerImpl, +// eContractid.UniswapLendingPoolCollateralManager, +// [], +// verify +// ); +// }; -export const deployUniswapMockFlashLoanReceiver = async ( - addressesProvider: tEthereumAddress, - verify?: boolean -) => - withSaveAndVerify( - await new MockFlashLoanReceiverFactory(await getFirstSigner()).deploy(addressesProvider), - eContractid.UniswapMockFlashLoanReceiver, - [addressesProvider], - verify - ); +// export const deployUniswapMockFlashLoanReceiver = async ( +// addressesProvider: tEthereumAddress, +// verify?: boolean +// ) => +// withSaveAndVerify( +// await new MockFlashLoanReceiverFactory(await getFirstSigner()).deploy(addressesProvider), +// eContractid.UniswapMockFlashLoanReceiver, +// [addressesProvider], +// verify +// ); -export const deployUniswapWalletBalancerProvider = async (verify?: boolean) => - withSaveAndVerify( - await new WalletBalanceProviderFactory(await getFirstSigner()).deploy(), - eContractid.UniswapWalletBalanceProvider, - [], - verify - ); +// export const deployUniswapWalletBalancerProvider = async (verify?: boolean) => +// withSaveAndVerify( +// await new WalletBalanceProviderFactory(await getFirstSigner()).deploy(), +// eContractid.UniswapWalletBalanceProvider, +// [], +// verify +// ); -export const deployUniswapWETHGateway = async ( - args: [tEthereumAddress, tEthereumAddress], - verify?: boolean -) => - withSaveAndVerify( - await new WETHGatewayFactory(await getFirstSigner()).deploy(...args), - eContractid.UniswapWETHGateway, - args, - verify - ); +// export const deployUniswapWETHGateway = async ( +// args: [tEthereumAddress, tEthereumAddress], +// verify?: boolean +// ) => +// withSaveAndVerify( +// await new WETHGatewayFactory(await getFirstSigner()).deploy(...args), +// eContractid.UniswapWETHGateway, +// args, +// verify +// ); diff --git a/tasks/dev/7_uniswap_market.ts b/tasks/dev/7_uniswap_market.ts index 3703f9bb..3d7a2705 100644 --- a/tasks/dev/7_uniswap_market.ts +++ b/tasks/dev/7_uniswap_market.ts @@ -1,323 +1,323 @@ -import { task } from 'hardhat/config'; -import { - deployATokensAndRatesHelper, - deployStableAndVariableTokensHelper, - deployAaveProtocolDataProvider, - deployLendingPoolAddressesProvider, //Test -} from '../../helpers/contracts-deployments'; -import { - deployUniswapLendingPoolAddressesProvider, - deployUniswapLendingPool, - deployUniswapLendingPoolConfigurator, - deployUniswapPriceOracle, - deployUniswapAaveOracle, - deployUniswapLendingRateOracle, - deployUniswapLendingPoolCollateralManager, - deployUniswapMockFlashLoanReceiver, - deployUniswapWETHGateway, - deployUniswapWalletBalancerProvider, -} from '../../helpers/uniswap-contracts-deployments'; -import { tEthereumAddress, - eContractid, - AavePools, - ICommonConfiguration, - iAssetBase, - TokenContractId, - IMarketRates, -} from '../../helpers/types'; -import { - getLendingPoolAddressesProviderRegistry, - getLendingPoolAddressesProvider, //Test - getLendingPool, - getLendingPoolConfiguratorProxy, - getAllMockedTokens, - getPairsTokenAggregator, -} from '../../helpers/contracts-getters'; -import { waitForTx, filterMapBy } from '../../helpers/misc-utils'; -import { UniswapConfig } from '../../markets/uniswap'; -import { insertContractAddressInDb } from '../../helpers/contracts-helpers'; -import { - setInitialAssetPricesInOracle, - deployAllMockAggregators, - setInitialMarketRatesInRatesOracleByHelper, -} from '../../helpers/oracles-helpers'; -import {getAllAggregatorsAddresses, getAllTokenAddresses} from '../../helpers/mock-helpers'; -import { - ConfigNames, - getReservesConfigByPool, - getTreasuryAddress, - loadPoolConfig, - getWethAddress, -} from '../../helpers/configuration'; -import { - configureReservesByHelper, - initReservesByHelper, -} from '../../helpers/init-helpers'; -import { ZERO_ADDRESS } from '../../helpers/constants'; +// import { task } from 'hardhat/config'; +// import { +// deployATokensAndRatesHelper, +// deployStableAndVariableTokensHelper, +// deployAaveProtocolDataProvider, +// deployLendingPoolAddressesProvider, //Test +// } from '../../helpers/contracts-deployments'; +// import { +// deployUniswapLendingPoolAddressesProvider, +// deployUniswapLendingPool, +// deployUniswapLendingPoolConfigurator, +// deployUniswapPriceOracle, +// deployUniswapAaveOracle, +// deployUniswapLendingRateOracle, +// deployUniswapLendingPoolCollateralManager, +// deployUniswapMockFlashLoanReceiver, +// deployUniswapWETHGateway, +// deployUniswapWalletBalancerProvider, +// } from '../../helpers/uniswap-contracts-deployments'; +// import { tEthereumAddress, +// eContractid, +// AavePools, +// ICommonConfiguration, +// iAssetBase, +// TokenContractId, +// IMarketRates, +// } from '../../helpers/types'; +// import { +// getLendingPoolAddressesProviderRegistry, +// getLendingPoolAddressesProvider, //Test +// getLendingPool, +// getLendingPoolConfiguratorProxy, +// getAllMockedTokens, +// getPairsTokenAggregator, +// } from '../../helpers/contracts-getters'; +// import { waitForTx, filterMapBy } from '../../helpers/misc-utils'; +// import { UniswapConfig } from '../../markets/uniswap'; +// import { insertContractAddressInDb } from '../../helpers/contracts-helpers'; +// import { +// setInitialAssetPricesInOracle, +// deployAllMockAggregators, +// setInitialMarketRatesInRatesOracleByHelper, +// } from '../../helpers/oracles-helpers'; +// import {getAllAggregatorsAddresses, getAllTokenAddresses} from '../../helpers/mock-helpers'; +// import { +// ConfigNames, +// getReservesConfigByPool, +// getTreasuryAddress, +// loadPoolConfig, +// getWethAddress, +// } from '../../helpers/configuration'; +// import { +// configureReservesByHelper, +// initReservesByHelper, +// } from '../../helpers/init-helpers'; +// import { ZERO_ADDRESS } from '../../helpers/constants'; -const pool = ConfigNames.Uniswap; -/** - * @dev addressesProvider is actually created here, so we don't need to use getAddressesProvider - */ -task( - 'dev:deploy-uniswap-market', - 'Deploy uniswap market' -) - .addFlag('verify', 'Verify contracts at Etherscan') - .setAction(async ({ verify }, localBRE) => { - await localBRE.run('set-DRE'); +// const pool = ConfigNames.Uniswap; +// /** +// * @dev addressesProvider is actually created here, so we don't need to use getAddressesProvider +// */ +// task( +// 'dev:deploy-uniswap-market', +// 'Deploy uniswap market' +// ) +// .addFlag('verify', 'Verify contracts at Etherscan') +// .setAction(async ({ verify }, localBRE) => { +// 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(); - console.log("Addresses provider from function (pre re-deploy):", testProvider.address); - const addressesProvider = await deployLendingPoolAddressesProvider(UniswapConfig.MarketId, verify); - console.log("Addresses provider in execution::", addressesProvider.address) +// const testProvider = await getLendingPoolAddressesProvider(); +// console.log("Addresses provider from function (pre re-deploy):", testProvider.address); +// const addressesProvider = await deployLendingPoolAddressesProvider(UniswapConfig.MarketId, verify); +// console.log("Addresses provider in execution::", addressesProvider.address) - const testProviderPost = await getLendingPoolAddressesProvider(); - console.log("Addresses provider from function (pre re-deploy):", testProviderPost.address); - console.log("Addresses provider from function (post re-deploy) should be different:") - await waitForTx(await addressesProvider.setPoolAdmin(admin)); +// const testProviderPost = await getLendingPoolAddressesProvider(); +// console.log("Addresses provider from function (pre re-deploy):", testProviderPost.address); +// console.log("Addresses provider from function (post re-deploy) should be different:") +// await waitForTx(await addressesProvider.setPoolAdmin(admin)); - const addressesProviderRegistry = await getLendingPoolAddressesProviderRegistry(); - await waitForTx( - await addressesProviderRegistry.registerAddressesProvider(addressesProvider.address, 1) - ); - console.log(addressesProvider.address); +// const addressesProviderRegistry = await getLendingPoolAddressesProviderRegistry(); +// await waitForTx( +// await addressesProviderRegistry.registerAddressesProvider(addressesProvider.address, 1) +// ); +// console.log(addressesProvider.address); - /** - * LENDING POOL DEPLOYMENT - */ - const lendingPoolImpl = await deployUniswapLendingPool(verify); +// /** +// * LENDING POOL DEPLOYMENT +// */ +// const lendingPoolImpl = await deployUniswapLendingPool(verify); - await waitForTx(await addressesProvider.setLendingPoolImpl(lendingPoolImpl.address)); +// await waitForTx(await addressesProvider.setLendingPoolImpl(lendingPoolImpl.address)); - const address = await addressesProvider.getLendingPool(); - console.log("UNISWAP MARKET LENDING POOL:", address); - const lendingPoolProxy = await getLendingPool(address); - await insertContractAddressInDb(eContractid.UniswapLendingPool, lendingPoolProxy.address); +// const address = await addressesProvider.getLendingPool(); +// console.log("UNISWAP MARKET LENDING POOL:", address); +// const lendingPoolProxy = await getLendingPool(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 - await waitForTx( - await addressesProvider.setLendingPoolConfiguratorImpl(lendingPoolConfiguratorImpl.address) - ); +// // Set lending pool conf impl to Address Provider +// await waitForTx( +// await addressesProvider.setLendingPoolConfiguratorImpl(lendingPoolConfiguratorImpl.address) +// ); - const lendingPoolConfiguratorProxy = await getLendingPoolConfiguratorProxy( - await addressesProvider.getLendingPoolConfigurator() - ); +// const lendingPoolConfiguratorProxy = await getLendingPoolConfiguratorProxy( +// await addressesProvider.getLendingPoolConfigurator() +// ); - await insertContractAddressInDb( - eContractid.UniswapLendingPoolConfigurator, - lendingPoolConfiguratorProxy.address - ); +// await insertContractAddressInDb( +// eContractid.UniswapLendingPoolConfigurator, +// lendingPoolConfiguratorProxy.address +// ); - // Deploy deployment helpers - await deployStableAndVariableTokensHelper( - [lendingPoolProxy.address, addressesProvider.address], - verify - ); - await deployATokensAndRatesHelper( - [lendingPoolProxy.address, addressesProvider.address, lendingPoolConfiguratorProxy.address], - verify - ); +// // Deploy deployment helpers +// await deployStableAndVariableTokensHelper( +// [lendingPoolProxy.address, addressesProvider.address], +// verify +// ); +// await deployATokensAndRatesHelper( +// [lendingPoolProxy.address, addressesProvider.address, lendingPoolConfiguratorProxy.address], +// verify +// ); - /** - * @dev Oracle deployment section - */ +// /** +// * @dev Oracle deployment section +// */ - console.log("Uniswap oracle deployment beginning.") - const poolConfig = loadPoolConfig(pool); - console.log("Initialized pool config..."); +// console.log("Uniswap oracle deployment beginning.") +// const poolConfig = loadPoolConfig(pool); +// console.log("Initialized pool config..."); - const { - Mocks: {AllAssetsInitialPrices}, - ProtocolGlobalParams: {UsdAddress, MockUsdPriceInWei}, - LendingRateOracleRatesCommon, - } = poolConfig as ICommonConfiguration; +// const { +// Mocks: {AllAssetsInitialPrices}, +// ProtocolGlobalParams: {UsdAddress, MockUsdPriceInWei}, +// LendingRateOracleRatesCommon, +// } = 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 = { - ...Object.fromEntries(Object.keys(TokenContractId).map((symbol) => [symbol, ''])), - USD: UsdAddress, - } as iAssetBase; +// const defaultTokenList = { +// ...Object.fromEntries(Object.keys(TokenContractId).map((symbol) => [symbol, ''])), +// USD: UsdAddress, +// } as iAssetBase; - 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>((prev, curr) => { - prev[curr as keyof iAssetBase] = mockTokens[curr].address; - return prev; - }, defaultTokenList); - console.log(mockTokensAddress); - console.log("Initialized mock tokens addresses"); +// const mockTokensAddress = Object.keys(mockTokens).reduce>((prev, curr) => { +// prev[curr as keyof iAssetBase] = mockTokens[curr].address; +// return prev; +// }, defaultTokenList); +// console.log(mockTokensAddress); +// 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); - console.log("Deployed fallback price oracle"); +// const fallbackOracle = await deployUniswapPriceOracle(verify); +// console.log("Deployed fallback price oracle"); - await waitForTx(await fallbackOracle.setEthUsdPrice(MockUsdPriceInWei)); - console.log("set fallback ETH USD price"); +// await waitForTx(await fallbackOracle.setEthUsdPrice(MockUsdPriceInWei)); +// console.log("set fallback ETH USD price"); - await setInitialAssetPricesInOracle(AllAssetsInitialPrices, mockTokensAddress, fallbackOracle); - console.log("Set initial asset prices in oracle"); +// await setInitialAssetPricesInOracle(AllAssetsInitialPrices, mockTokensAddress, fallbackOracle); +// console.log("Set initial asset prices in oracle"); - const mockAggregators = await deployAllMockAggregators(AllAssetsInitialPrices, verify); - console.log("Deployed mock aggregators"); +// const mockAggregators = await deployAllMockAggregators(AllAssetsInitialPrices, verify); +// console.log("Deployed mock aggregators"); - const allTokenAddresses = getAllTokenAddresses(mockTokens); - console.log("Got all mock token addresses"); +// const allTokenAddresses = getAllTokenAddresses(mockTokens); +// console.log("Got all mock token addresses"); - const allAggregatorsAddresses = getAllAggregatorsAddresses(mockAggregators); - console.log("Got all aggregator addresses"); - console.log("allTokenAddresses object: \n", allTokenAddresses); - //Should modify this to potentially contain only the tokens in the Uniswap market - // const [tokens, aggregators] = getPairsTokenAggregator( - // allTokenAddresses, - // allAggregatorsAddresses - // ); - // console.log("Got \"pairsToken aggregator\""); - // console.log("Tokens: \n", tokens); +// const allAggregatorsAddresses = getAllAggregatorsAddresses(mockAggregators); +// console.log("Got all aggregator addresses"); +// console.log("allTokenAddresses object: \n", allTokenAddresses); +// //Should modify this to potentially contain only the tokens in the Uniswap market +// // const [tokens, aggregators] = getPairsTokenAggregator( +// // allTokenAddresses, +// // allAggregatorsAddresses +// // ); +// // console.log("Got \"pairsToken aggregator\""); +// // console.log("Tokens: \n", tokens); - // const assetAddressIndex = Object.keys(allReservesAddresses).findIndex( - // (value) => value === assetSymbol - // ); - // const [, assetAddress] = (Object.entries(assetsAddresses) as [string, string][])[ - // assetAddressIndex - // ]; - // assetAddresses.push(assetAddress); +// // const assetAddressIndex = Object.keys(allReservesAddresses).findIndex( +// // (value) => value === assetSymbol +// // ); +// // const [, assetAddress] = (Object.entries(assetsAddresses) as [string, string][])[ +// // assetAddressIndex +// // ]; +// // assetAddresses.push(assetAddress); - // await deployUniswapAaveOracle( - // [tokens, aggregators, fallbackOracle.address, await getWethAddress(poolConfig)], - // verify - // ); - console.log("Deployed Uniswap Aave oracle"); +// // await deployUniswapAaveOracle( +// // [tokens, aggregators, fallbackOracle.address, await getWethAddress(poolConfig)], +// // verify +// // ); +// console.log("Deployed Uniswap Aave oracle"); - await waitForTx(await addressesProvider.setPriceOracle(fallbackOracle.address)); - console.log("Set price oracle in addresses provider"); +// await waitForTx(await addressesProvider.setPriceOracle(fallbackOracle.address)); +// console.log("Set price oracle in addresses provider"); - const lendingRateOracle = await deployUniswapLendingRateOracle(verify); - console.log("Deployed lendingRateOracle"); +// const lendingRateOracle = await deployUniswapLendingRateOracle(verify); +// console.log("Deployed lendingRateOracle"); - await waitForTx(await addressesProvider.setLendingRateOracle(lendingRateOracle.address)); - console.log("Set lending rate oracle in addresses provider"); +// await waitForTx(await addressesProvider.setLendingRateOracle(lendingRateOracle.address)); +// console.log("Set lending rate oracle in addresses provider"); - const {USD, ...tokensAddressesWithoutUsd} = allTokenAddresses; - console.log("Initialized object with token addresses & usd") +// const {USD, ...tokensAddressesWithoutUsd} = allTokenAddresses; +// console.log("Initialized object with token addresses & usd") - const allReservesAddresses = { - ...tokensAddressesWithoutUsd, - }; - console.log("Initialized object with all reserve addresses, allReservesAddresses:"); - console.log(allReservesAddresses); +// const allReservesAddresses = { +// ...tokensAddressesWithoutUsd, +// }; +// console.log("Initialized object with all reserve addresses, allReservesAddresses:"); +// console.log(allReservesAddresses); - console.log("LendingRateOracleRatesCommon: \n", LendingRateOracleRatesCommon); - // - // -- test - // - const [tokens, aggregators] = getPairsTokenAggregator( - allTokenAddresses, - allAggregatorsAddresses - ); - console.log("Got \"pairsToken aggregator\""); - console.log("Tokens: \n", tokens); - const assetAddresses: string[] = []; - const aggregatorAddresses: string[] = []; - for (const [assetSymbol, {borrowRate}] of Object.entries(LendingRateOracleRatesCommon) as [ - string, - IMarketRates - ][]) { - const assetAddressIndex = Object.keys(allReservesAddresses).findIndex( - (value) => value === assetSymbol - ); - const [, assetAddress] = (Object.entries(allReservesAddresses) as [string, string][])[ - assetAddressIndex - ]; +// console.log("LendingRateOracleRatesCommon: \n", LendingRateOracleRatesCommon); +// // +// // -- test +// // +// const [tokens, aggregators] = getPairsTokenAggregator( +// allTokenAddresses, +// allAggregatorsAddresses +// ); +// console.log("Got \"pairsToken aggregator\""); +// console.log("Tokens: \n", tokens); +// const assetAddresses: string[] = []; +// const aggregatorAddresses: string[] = []; +// for (const [assetSymbol, {borrowRate}] of Object.entries(LendingRateOracleRatesCommon) as [ +// string, +// IMarketRates +// ][]) { +// const assetAddressIndex = Object.keys(allReservesAddresses).findIndex( +// (value) => value === assetSymbol +// ); +// const [, assetAddress] = (Object.entries(allReservesAddresses) as [string, string][])[ +// assetAddressIndex +// ]; - const [, aggregatorAddress] = (Object.entries(allAggregatorsAddresses) as [string, string][])[ - assetAddressIndex - ]; - aggregatorAddresses.push(aggregatorAddress); - assetAddresses.push(assetAddress); - } - console.log("\nPRICE ORACLE PARAMS:\nassetAddresses: %s\naggregatorAddresses: %s", assetAddresses, aggregatorAddresses); - await deployUniswapAaveOracle( - [assetAddresses, aggregatorAddresses, fallbackOracle.address, await getWethAddress(poolConfig)], - verify - ); - // - // -- test end - // - console.log("TEST END-----------------------------------------------------------------------"); - await setInitialMarketRatesInRatesOracleByHelper( - LendingRateOracleRatesCommon, - allReservesAddresses, - lendingRateOracle, - admin - ); +// const [, aggregatorAddress] = (Object.entries(allAggregatorsAddresses) as [string, string][])[ +// assetAddressIndex +// ]; +// aggregatorAddresses.push(aggregatorAddress); +// assetAddresses.push(assetAddress); +// } +// console.log("\nPRICE ORACLE PARAMS:\nassetAddresses: %s\naggregatorAddresses: %s", assetAddresses, aggregatorAddresses); +// await deployUniswapAaveOracle( +// [assetAddresses, aggregatorAddresses, fallbackOracle.address, await getWethAddress(poolConfig)], +// verify +// ); +// // +// // -- test end +// // +// console.log("TEST END-----------------------------------------------------------------------"); +// await setInitialMarketRatesInRatesOracleByHelper( +// LendingRateOracleRatesCommon, +// allReservesAddresses, +// lendingRateOracle, +// admin +// ); - console.log("Task complete"); +// console.log("Task complete"); - /** - * @dev Initialization - */ +// /** +// * @dev Initialization +// */ - // No need to initialize poolConfig, mockTokens, allTokenAddresses, admin and - // addressesProvider and protoReservesAddresses (we use allReserveAddresses) +// // No need to initialize poolConfig, mockTokens, allTokenAddresses, admin and +// // 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( - addressesProvider, - reservesParams, - allReservesAddresses, - admin, - treasuryAddress, - ZERO_ADDRESS, - verify - ); +// await initReservesByHelper( +// addressesProvider, +// reservesParams, +// allReservesAddresses, +// admin, +// treasuryAddress, +// ZERO_ADDRESS, +// verify +// ); - await configureReservesByHelper( - addressesProvider, - reservesParams, - allReservesAddresses, - testHelpers, - admin - ); +// await configureReservesByHelper( +// addressesProvider, +// reservesParams, +// allReservesAddresses, +// testHelpers, +// admin +// ); - const collateralManager = await deployUniswapLendingPoolCollateralManager(verify); - await waitForTx( - await addressesProvider.setLendingPoolCollateralManager(collateralManager.address) - ); +// const collateralManager = await deployUniswapLendingPoolCollateralManager(verify); +// await waitForTx( +// await addressesProvider.setLendingPoolCollateralManager(collateralManager.address) +// ); - const mockFlashLoanReceiver = await deployUniswapMockFlashLoanReceiver( - addressesProvider.address, - verify - ); +// const mockFlashLoanReceiver = await deployUniswapMockFlashLoanReceiver( +// addressesProvider.address, +// verify +// ); - await insertContractAddressInDb( - eContractid.UniswapMockFlashLoanReceiver, - mockFlashLoanReceiver.address - ); +// await insertContractAddressInDb( +// eContractid.UniswapMockFlashLoanReceiver, +// 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 wethAddress = await getWethAddress(poolConfig); - await deployUniswapWETHGateway([wethAddress, lendingPoolAddress]); - }); +// const lendingPoolAddress = await addressesProvider.getLendingPool(); +// const wethAddress = await getWethAddress(poolConfig); +// await deployUniswapWETHGateway([wethAddress, lendingPoolAddress]); +// }); diff --git a/tasks/migrations/aave.dev.ts b/tasks/migrations/aave.dev.ts index 1fe841fe..ed208c6b 100644 --- a/tasks/migrations/aave.dev.ts +++ b/tasks/migrations/aave.dev.ts @@ -35,8 +35,8 @@ task('aave:dev', 'Deploy development enviroment') console.log('5. Initialize lending pool'); await localBRE.run('dev:initialize-lending-pool', {verify, pool: POOL_NAME}); - console.log('6. Deploy Uniswap market'); - await localBRE.run('dev:deploy-uniswap-market', {verify}); + // console.log('6. Deploy Uniswap market'); + // await localBRE.run('dev:deploy-uniswap-market', {verify}); console.log('\nFinished migration'); printContracts(); From 95691770abac75a676d7e8d9cd4dca54f4e20bfa Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Sun, 10 Jan 2021 20:05:34 -0500 Subject: [PATCH 10/31] Reset to original state --- helpers/contracts-getters.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/helpers/contracts-getters.ts b/helpers/contracts-getters.ts index 34b0d134..65834cc6 100644 --- a/helpers/contracts-getters.ts +++ b/helpers/contracts-getters.ts @@ -153,9 +153,7 @@ export const getAllMockedTokens = async () => { const tokens: MockTokenMap = await Object.keys(TokenContractId).reduce>( async (acc, tokenSymbol) => { const accumulator = await acc; - console.log("getAllMockedTokens: got accumulator, next token:", tokenSymbol.toUpperCase()); const address = db.get(`${tokenSymbol.toUpperCase()}.${DRE.network.name}`).value().address; - console.log("getAllMockedTokens: Initialized address for %s, address: %s", tokenSymbol, address); accumulator[tokenSymbol] = await getMintableERC20(address); return Promise.resolve(acc); }, @@ -177,8 +175,6 @@ export const getPairsTokenAggregator = ( const aggregatorAddressIndex = Object.keys(aggregatorsAddresses).findIndex( (value) => value === tokenSymbol ); - //console.log("getPairsTokenAggregator: tokenSymbol:", tokenSymbol); - //console.log("getPairsTokenAggregator: aggregatorsAddresses:\n\n", aggregatorsAddresses); const [, aggregatorAddress] = (Object.entries(aggregatorsAddresses) as [ string, tEthereumAddress From 587c4df47c084476a0a0cdc3b457057fdfc22c23 Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Sun, 10 Jan 2021 20:10:43 -0500 Subject: [PATCH 11/31] Cleanup --- helpers/contracts-deployments.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/helpers/contracts-deployments.ts b/helpers/contracts-deployments.ts index 66e21be4..739ade34 100644 --- a/helpers/contracts-deployments.ts +++ b/helpers/contracts-deployments.ts @@ -388,7 +388,6 @@ export const deployAllMockTokens = async (verify?: boolean) => { verify ); await registerContractInJsonDb(tokenSymbol.toUpperCase(), tokens[tokenSymbol]); - console.log("deployAllMockTokens: deployed", tokenSymbol); } return tokens; }; From 0472cc27f25ebc87248f8a70d9e9f1ff56eade53 Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Sun, 10 Jan 2021 20:40:23 -0500 Subject: [PATCH 12/31] Cleanup (Removed unneeded dev deployment) --- helpers/init-helpers.ts | 13 +- helpers/oracles-helpers.ts | 7 - helpers/types.ts | 14 - helpers/uniswap-contracts-deployments.ts | 241 ----------------- tasks/dev/3_lending_pool.ts | 6 +- tasks/dev/4_oracles.ts | 58 +--- tasks/dev/5_initialize.ts | 2 - tasks/dev/7_uniswap_market.ts | 323 ----------------------- tasks/full/1_address_provider.ts | 2 +- tasks/full/3_oracles.ts | 7 +- tasks/full/5_initialize.ts | 5 +- tasks/migrations/aave.dev.ts | 10 +- test/__setup.spec.ts | 4 +- test/test | 153 ----------- 14 files changed, 14 insertions(+), 831 deletions(-) delete mode 100644 helpers/uniswap-contracts-deployments.ts delete mode 100644 tasks/dev/7_uniswap_market.ts delete mode 100644 test/test diff --git a/helpers/init-helpers.ts b/helpers/init-helpers.ts index 96ec9df7..e80d2f91 100644 --- a/helpers/init-helpers.ts +++ b/helpers/init-helpers.ts @@ -25,7 +25,6 @@ import { } from './contracts-deployments'; import { ZERO_ADDRESS } from './constants'; import { isZeroAddress } from 'ethereumjs-util'; -import { LendingPoolAddressesProvider } from '../types'; const chooseATokenDeployment = (id: eContractid) => { switch (id) { @@ -39,7 +38,6 @@ const chooseATokenDeployment = (id: eContractid) => { }; export const initReservesByHelper = async ( - addressProvider: LendingPoolAddressesProvider, reservesParams: iMultiPoolsAssets, tokenAddresses: { [symbol: string]: tEthereumAddress }, admin: tEthereumAddress, @@ -51,7 +49,7 @@ export const initReservesByHelper = async ( const stableAndVariableDeployer = await getStableAndVariableTokensHelper(); const atokenAndRatesDeployer = await getATokensAndRatesHelper(); - //const addressProvider = await getLendingPoolAddressesProvider(); + const addressProvider = await getLendingPoolAddressesProvider(); const poolAddress = await addressProvider.getLendingPool(); // Set aTokenAndRatesDeployer as temporal admin @@ -82,7 +80,6 @@ export const initReservesByHelper = async ( Object.entries(reservesParams).length * 4 } txs` ); - console.log("initReservesByHelper: tokenAddresses:", tokenAddresses); for (let reservesChunk of reservesChunks) { // Prepare data const tokens: string[] = []; @@ -98,15 +95,13 @@ export const initReservesByHelper = async ( const reservesDecimals: string[] = []; for (let [assetSymbol, { reserveDecimals }] of reservesChunk) { - console.log("initReservesByHelper: assetSymbol:\n%s", assetSymbol); const assetAddressIndex = Object.keys(tokenAddresses).findIndex( (value) => value === assetSymbol ); - console.log("initReservesByHelper: assetAddressIndex:\n%s", assetAddressIndex); const [, tokenAddress] = (Object.entries(tokenAddresses) as [string, string][])[ assetAddressIndex ]; - console.log("initReservesByHelper: tokenAddress:\n%s", assetAddressIndex); + const reserveParamIndex = Object.keys(reservesParams).findIndex( (value) => value === assetSymbol ); @@ -136,7 +131,6 @@ export const initReservesByHelper = async ( } // Deploy stable and variable deployers and save implementations - // PARAMS HANG IN LOCALHOST console.log("Hanging params:\ntokens:\n %s\n symbols:\n %s \n incentivesController: \n %s ", tokens, symbols, incentivesController); const tx1 = await waitForTx( await stableAndVariableDeployer.initDeployment(tokens, symbols, incentivesController) ); @@ -306,13 +300,12 @@ export const getPairsTokenAggregator = ( }; export const configureReservesByHelper = async ( - addressProvider: LendingPoolAddressesProvider, reservesParams: iMultiPoolsAssets, tokenAddresses: { [symbol: string]: tEthereumAddress }, helpers: AaveProtocolDataProvider, admin: tEthereumAddress ) => { - //const addressProvider = await getLendingPoolAddressesProvider(); + const addressProvider = await getLendingPoolAddressesProvider(); const atokenAndRatesDeployer = await getATokensAndRatesHelper(); const tokens: string[] = []; const symbols: string[] = []; diff --git a/helpers/oracles-helpers.ts b/helpers/oracles-helpers.ts index aaa19976..45cec5e2 100644 --- a/helpers/oracles-helpers.ts +++ b/helpers/oracles-helpers.ts @@ -28,7 +28,6 @@ export const setInitialMarketRatesInRatesOracleByHelper = async ( string, IMarketRates ][]) { - console.log("Current asset symbol:", assetSymbol); const assetAddressIndex = Object.keys(assetsAddresses).findIndex( (value) => value === assetSymbol ); @@ -39,12 +38,6 @@ export const setInitialMarketRatesInRatesOracleByHelper = async ( borrowRates.push(borrowRate); symbols.push(assetSymbol); } - - console.log("---setInitialMarketRatesInRatesOracleByHelper---"); - console.log(assetAddresses); - console.log(symbols); - console.log(borrowRates); - // Set borrow rates per chunks const ratesChunks = 20; const chunkedTokens = chunk(assetAddresses, ratesChunks); diff --git a/helpers/types.ts b/helpers/types.ts index 664e3e62..bbb16389 100644 --- a/helpers/types.ts +++ b/helpers/types.ts @@ -28,41 +28,31 @@ export enum AavePools { export enum eContractid { Example = 'Example', LendingPoolAddressesProvider = 'LendingPoolAddressesProvider', - UniswapLendingPoolAddressesProvider = 'UniswapLendingPoolAddressesProvider', MintableERC20 = 'MintableERC20', MintableDelegationERC20 = 'MintableDelegationERC20', LendingPoolAddressesProviderRegistry = 'LendingPoolAddressesProviderRegistry', LendingPoolParametersProvider = 'LendingPoolParametersProvider', LendingPoolConfigurator = 'LendingPoolConfigurator', - UniswapLendingPoolConfigurator = 'UniswapLendingPoolConfigurator', ValidationLogic = 'ValidationLogic', ReserveLogic = 'ReserveLogic', GenericLogic = 'GenericLogic', LendingPool = 'LendingPool', - UniswapLendingPool = 'UniswapLendingPool', PriceOracle = 'PriceOracle', - UniswapPriceOracle = 'UniswapPriceOracle', Proxy = 'Proxy', MockAggregator = 'MockAggregator', LendingRateOracle = 'LendingRateOracle', - UniswapLendingRateOracle = 'UniswapLendingRateOracle', AaveOracle = 'AaveOracle', - UniswapAaveOracle = 'UniswapAaveOracle', DefaultReserveInterestRateStrategy = 'DefaultReserveInterestRateStrategy', LendingPoolCollateralManager = 'LendingPoolCollateralManager', - UniswapLendingPoolCollateralManager = 'UniswapLendingPoolCollateralManager', InitializableAdminUpgradeabilityProxy = 'InitializableAdminUpgradeabilityProxy', MockFlashLoanReceiver = 'MockFlashLoanReceiver', - UniswapMockFlashLoanReceiver = 'UniswapMockFlashLoanReceiver', WalletBalanceProvider = 'WalletBalanceProvider', - UniswapWalletBalanceProvider = 'UniswapWalletBalanceProvider', AToken = 'AToken', MockAToken = 'MockAToken', DelegationAwareAToken = 'DelegationAwareAToken', MockStableDebtToken = 'MockStableDebtToken', MockVariableDebtToken = 'MockVariableDebtToken', AaveProtocolDataProvider = 'AaveProtocolDataProvider', - UniswapAaveProtocolDataProvider = 'UniswapAaveProtocolDataProvider', IERC20Detailed = 'IERC20Detailed', StableDebtToken = 'StableDebtToken', VariableDebtToken = 'VariableDebtToken', @@ -72,16 +62,12 @@ export enum eContractid { ATokensAndRatesHelper = 'ATokensAndRatesHelper', UiPoolDataProvider = 'UiPoolDataProvider', WETHGateway = 'WETHGateway', - UniswapWETHGateway = 'UniswapWETHGateway', WETH = 'WETH', WETHMocked = 'WETHMocked', SelfdestructTransferMock = 'SelfdestructTransferMock', LendingPoolImpl = 'LendingPoolImpl', - UniswapLendingPoolImpl = 'UniswapLendingPoolImpl', LendingPoolConfiguratorImpl = 'LendingPoolConfiguratorImpl', - UniswapLendingPoolConfiguratorImpl = 'UniswapLendingPoolConfiguratorImpl', LendingPoolCollateralManagerImpl = 'LendingPoolCollateralManagerImpl', - UniswapLendingPoolCollateralManagerImpl = 'UniswapLendingPoolCollateralManagerImpl', } /* diff --git a/helpers/uniswap-contracts-deployments.ts b/helpers/uniswap-contracts-deployments.ts deleted file mode 100644 index 18681b1d..00000000 --- a/helpers/uniswap-contracts-deployments.ts +++ /dev/null @@ -1,241 +0,0 @@ -// import { Contract } from 'ethers'; -// import { DRE } from './misc-utils'; -// import { -// tEthereumAddress, -// eContractid, -// tStringTokenSmallUnits, -// AavePools, -// TokenContractId, -// iMultiPoolsAssets, -// IReserveParams, -// PoolConfiguration, -// eEthereumNetwork, -// } from './types'; - -// import { MintableERC20 } from '../types/MintableERC20'; -// import { MockContract } from 'ethereum-waffle'; -// import { getReservesConfigByPool } from './configuration'; -// import { getFirstSigner } from './contracts-getters'; -// import { ZERO_ADDRESS } from './constants'; -// import { -// AaveProtocolDataProviderFactory, -// ATokenFactory, -// ATokensAndRatesHelperFactory, -// AaveOracleFactory, -// DefaultReserveInterestRateStrategyFactory, -// DelegationAwareATokenFactory, -// InitializableAdminUpgradeabilityProxyFactory, -// LendingPoolAddressesProviderFactory, -// LendingPoolAddressesProviderRegistryFactory, -// LendingPoolCollateralManagerFactory, -// LendingPoolConfiguratorFactory, -// LendingPoolFactory, -// LendingRateOracleFactory, -// MintableDelegationERC20Factory, -// MintableERC20Factory, -// MockAggregatorFactory, -// MockATokenFactory, -// MockFlashLoanReceiverFactory, -// MockStableDebtTokenFactory, -// MockVariableDebtTokenFactory, -// PriceOracleFactory, -// ReserveLogicFactory, -// SelfdestructTransferFactory, -// StableDebtTokenFactory, -// VariableDebtTokenFactory, -// WalletBalanceProviderFactory, -// WETH9MockedFactory, -// WETHGatewayFactory, -// } from '../types'; -// import { -// withSaveAndVerify, -// registerContractInJsonDb, -// linkBytecode, -// insertContractAddressInDb, -// } from './contracts-helpers'; -// import { StableAndVariableTokensHelperFactory } from '../types/StableAndVariableTokensHelperFactory'; -// import { MintableDelegationERC20 } from '../types/MintableDelegationERC20'; -// import { readArtifact as buidlerReadArtifact } from '@nomiclabs/buidler/plugins'; -// import { HardhatRuntimeEnvironment } from 'hardhat/types'; -// import { LendingPoolLibraryAddresses } from '../types/LendingPoolFactory'; - -// const readArtifact = async (id: string) => { -// if (DRE.network.name === eEthereumNetwork.buidlerevm) { -// return buidlerReadArtifact(DRE.config.paths.artifacts, id); -// } -// return (DRE as HardhatRuntimeEnvironment).artifacts.readArtifact(id); -// }; - -// export const deployUniswapLendingPoolAddressesProvider = async (marketId: string, verify?: boolean) => -// withSaveAndVerify( -// await new LendingPoolAddressesProviderFactory(await getFirstSigner()).deploy(marketId), -// eContractid.UniswapLendingPoolAddressesProvider, -// [marketId], -// verify -// ); - -// export const deployUniswapLendingPoolConfigurator = async (verify?: boolean) => { -// const lendingPoolConfiguratorImpl = await new LendingPoolConfiguratorFactory( -// await getFirstSigner() -// ).deploy(); -// await insertContractAddressInDb( -// eContractid.UniswapLendingPoolConfiguratorImpl, -// lendingPoolConfiguratorImpl.address -// ); -// return withSaveAndVerify( -// lendingPoolConfiguratorImpl, -// eContractid.UniswapLendingPoolConfigurator, -// [], -// verify -// ); -// }; - -// export const deployUniswapLendingPool = async (verify?: boolean) => { -// const libraries = await deployAaveLibraries(verify); -// const lendingPoolImpl = await new LendingPoolFactory(libraries, await getFirstSigner()).deploy(); -// await insertContractAddressInDb(eContractid.UniswapLendingPoolImpl, lendingPoolImpl.address); -// return withSaveAndVerify(lendingPoolImpl, eContractid.LendingPool, [], verify); -// }; - -// export const deployReserveLogicLibrary = async (verify?: boolean) => -// withSaveAndVerify( -// await new ReserveLogicFactory(await getFirstSigner()).deploy(), -// eContractid.ReserveLogic, -// [], -// verify -// ); - -// export const deployGenericLogic = async (reserveLogic: Contract, verify?: boolean) => { -// const genericLogicArtifact = await readArtifact(eContractid.GenericLogic); - -// const linkedGenericLogicByteCode = linkBytecode(genericLogicArtifact, { -// [eContractid.ReserveLogic]: reserveLogic.address, -// }); - -// const genericLogicFactory = await DRE.ethers.getContractFactory( -// genericLogicArtifact.abi, -// linkedGenericLogicByteCode -// ); - -// const genericLogic = await (await genericLogicFactory.deploy()).deployed(); -// return withSaveAndVerify(genericLogic, eContractid.GenericLogic, [], verify); -// }; - -// export const deployValidationLogic = async ( -// reserveLogic: Contract, -// genericLogic: Contract, -// verify?: boolean -// ) => { -// const validationLogicArtifact = await readArtifact(eContractid.ValidationLogic); - -// const linkedValidationLogicByteCode = linkBytecode(validationLogicArtifact, { -// [eContractid.ReserveLogic]: reserveLogic.address, -// [eContractid.GenericLogic]: genericLogic.address, -// }); - -// const validationLogicFactory = await DRE.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 => { -// const reserveLogic = await deployReserveLogicLibrary(verify); -// const genericLogic = await deployGenericLogic(reserveLogic, verify); -// const validationLogic = await deployValidationLogic(reserveLogic, genericLogic, verify); - -// // 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 -// // require a hardcoded string. -// // -// // how-to: -// // 1. PLACEHOLDER = solidityKeccak256(['string'], `${libPath}:${libName}`).slice(2, 36) -// // 2. LIB_PLACEHOLDER = `__$${PLACEHOLDER}$__` -// // or grab placeholdes from LendingPoolLibraryAddresses at Typechain generation. -// // -// // libPath example: contracts/libraries/logic/GenericLogic.sol -// // libName example: GenericLogic -// return { -// ['__$de8c0cf1a7d7c36c802af9a64fb9d86036$__']: validationLogic.address, -// ['__$22cd43a9dda9ce44e9b92ba393b88fb9ac$__']: reserveLogic.address, -// }; -// }; - -// export const deployUniswapPriceOracle = async (verify?: boolean) => -// withSaveAndVerify( -// await new PriceOracleFactory(await getFirstSigner()).deploy(), -// eContractid.UniswapPriceOracle, -// [], -// verify -// ); - -// export const deployUniswapLendingRateOracle = async (verify?: boolean) => -// withSaveAndVerify( -// await new LendingRateOracleFactory(await getFirstSigner()).deploy(), -// eContractid.UniswapLendingRateOracle, -// [], -// verify -// ); - -// export const deployUniswapAaveOracle = async ( -// args: [tEthereumAddress[], tEthereumAddress[], tEthereumAddress, tEthereumAddress], -// verify?: boolean -// ) => -// withSaveAndVerify( -// await new AaveOracleFactory(await getFirstSigner()).deploy(...args), -// eContractid.UniswapAaveOracle, -// args, -// verify -// ); - -// export const deployUniswapLendingPoolCollateralManager = async (verify?: boolean) => { -// const collateralManagerImpl = await new LendingPoolCollateralManagerFactory( -// await getFirstSigner() -// ).deploy(); -// await insertContractAddressInDb( -// eContractid.UniswapLendingPoolCollateralManagerImpl, -// collateralManagerImpl.address -// ); -// return withSaveAndVerify( -// collateralManagerImpl, -// eContractid.UniswapLendingPoolCollateralManager, -// [], -// verify -// ); -// }; - -// export const deployUniswapMockFlashLoanReceiver = async ( -// addressesProvider: tEthereumAddress, -// verify?: boolean -// ) => -// withSaveAndVerify( -// await new MockFlashLoanReceiverFactory(await getFirstSigner()).deploy(addressesProvider), -// eContractid.UniswapMockFlashLoanReceiver, -// [addressesProvider], -// verify -// ); - -// export const deployUniswapWalletBalancerProvider = async (verify?: boolean) => -// withSaveAndVerify( -// await new WalletBalanceProviderFactory(await getFirstSigner()).deploy(), -// eContractid.UniswapWalletBalanceProvider, -// [], -// verify -// ); - -// export const deployUniswapWETHGateway = async ( -// args: [tEthereumAddress, tEthereumAddress], -// verify?: boolean -// ) => -// withSaveAndVerify( -// await new WETHGatewayFactory(await getFirstSigner()).deploy(...args), -// eContractid.UniswapWETHGateway, -// args, -// verify -// ); diff --git a/tasks/dev/3_lending_pool.ts b/tasks/dev/3_lending_pool.ts index 692c8386..b1aeb58c 100644 --- a/tasks/dev/3_lending_pool.ts +++ b/tasks/dev/3_lending_pool.ts @@ -18,17 +18,15 @@ task('dev:deploy-lending-pool', 'Deploy lending pool for dev enviroment') .addFlag('verify', 'Verify contracts at Etherscan') .setAction(async ({verify}, localBRE) => { await localBRE.run('set-DRE'); - // TEST--- CURRENTLY FAILS BECAUSE ALREADY HAS AN IMPLEMENTATION, SHOULD BE DONE BEFORE UNI MARKET TASK + const addressesProvider = await getLendingPoolAddressesProvider(); - + const lendingPoolImpl = await deployLendingPool(verify); // Set lending pool impl to Address Provider await waitForTx(await addressesProvider.setLendingPoolImpl(lendingPoolImpl.address)); const address = await addressesProvider.getLendingPool(); - console.log("AAVE MARKET LENDING POOL:", address); - const lendingPoolProxy = await getLendingPool(address); await insertContractAddressInDb(eContractid.LendingPool, lendingPoolProxy.address); diff --git a/tasks/dev/4_oracles.ts b/tasks/dev/4_oracles.ts index b8c29660..97f14c8a 100644 --- a/tasks/dev/4_oracles.ts +++ b/tasks/dev/4_oracles.ts @@ -24,113 +24,57 @@ task('dev:deploy-oracles', 'Deploy oracles for dev enviroment') .addFlag('verify', 'Verify contracts at Etherscan') .addParam('pool', `Pool name to retrieve configuration, supported: ${Object.values(ConfigNames)}`) .setAction(async ({verify, pool}, localBRE) => { - await localBRE.run('set-DRE'); const poolConfig = loadPoolConfig(pool); - - console.log("Initialized pool config..."); - const { Mocks: {AllAssetsInitialPrices}, ProtocolGlobalParams: {UsdAddress, MockUsdPriceInWei}, LendingRateOracleRatesCommon, } = poolConfig as ICommonConfiguration; - console.log("Initialized mocks, global params and lending rate oracle rates"); - const defaultTokenList = { ...Object.fromEntries(Object.keys(TokenContractId).map((symbol) => [symbol, ''])), USD: UsdAddress, } as iAssetBase; - - console.log("Initialized defaultTokenList"); - const mockTokens = await getAllMockedTokens(); - - console.log("Initialized mock tokens"); - const mockTokensAddress = Object.keys(mockTokens).reduce>((prev, curr) => { prev[curr as keyof iAssetBase] = mockTokens[curr].address; return prev; }, defaultTokenList); - console.log(mockTokensAddress); - console.log("Initialized mock tokens addresses"); - const addressesProvider = await getLendingPoolAddressesProvider(); - - console.log("Got the addresses provider (check if different both times):", addressesProvider.address); - const admin = await addressesProvider.getPoolAdmin(); - console.log("Got the admin"); - const fallbackOracle = await deployPriceOracle(verify); - - console.log("Deployed fallback price oracle"); - await waitForTx(await fallbackOracle.setEthUsdPrice(MockUsdPriceInWei)); - - console.log("set fallback ETH USD price"); - await setInitialAssetPricesInOracle(AllAssetsInitialPrices, mockTokensAddress, fallbackOracle); - console.log("Set initial asset prices in oracle"); - const mockAggregators = await deployAllMockAggregators(AllAssetsInitialPrices, verify); - console.log("Deployed mock aggregators"); - const allTokenAddresses = getAllTokenAddresses(mockTokens); - - console.log("Got all mock token addresses"); - const allAggregatorsAddresses = getAllAggregatorsAddresses(mockAggregators); - console.log("Got all aggregator addresses"); - const [tokens, aggregators] = getPairsTokenAggregator( allTokenAddresses, allAggregatorsAddresses ); - - console.log("Got \"pairsToken aggregator\""); await deployAaveOracle( [tokens, aggregators, fallbackOracle.address, await getWethAddress(poolConfig)], verify ); - - console.log("Deployed Aave oracle"); - await waitForTx(await addressesProvider.setPriceOracle(fallbackOracle.address)); - console.log("Set price oracle in addresses provider"); - const lendingRateOracle = await deployLendingRateOracle(verify); - - console.log("Deployed lendingRateOracle"); - await waitForTx(await addressesProvider.setLendingRateOracle(lendingRateOracle.address)); - console.log("Set lending rate oracle in addresses provider"); - const {USD, ...tokensAddressesWithoutUsd} = allTokenAddresses; - - console.log("Initialized object with token addresses & usd") - const allReservesAddresses = { ...tokensAddressesWithoutUsd, }; - - console.log("Initialized object with all reserve addresses, allReservesAddresses:"); - console.log(allReservesAddresses); - await setInitialMarketRatesInRatesOracleByHelper( LendingRateOracleRatesCommon, allReservesAddresses, lendingRateOracle, admin ); - - console.log("Task complete"); - }); \ No newline at end of file + }); diff --git a/tasks/dev/5_initialize.ts b/tasks/dev/5_initialize.ts index 9a3896a5..c62f31ce 100644 --- a/tasks/dev/5_initialize.ts +++ b/tasks/dev/5_initialize.ts @@ -53,7 +53,6 @@ task('dev:initialize-lending-pool', 'Initialize lending pool configuration.') const treasuryAddress = await getTreasuryAddress(poolConfig); await initReservesByHelper( - addressesProvider, reservesParams, protoPoolReservesAddresses, admin, @@ -62,7 +61,6 @@ task('dev:initialize-lending-pool', 'Initialize lending pool configuration.') verify ); await configureReservesByHelper( - addressesProvider, reservesParams, protoPoolReservesAddresses, testHelpers, diff --git a/tasks/dev/7_uniswap_market.ts b/tasks/dev/7_uniswap_market.ts deleted file mode 100644 index 3d7a2705..00000000 --- a/tasks/dev/7_uniswap_market.ts +++ /dev/null @@ -1,323 +0,0 @@ -// import { task } from 'hardhat/config'; -// import { -// deployATokensAndRatesHelper, -// deployStableAndVariableTokensHelper, -// deployAaveProtocolDataProvider, -// deployLendingPoolAddressesProvider, //Test -// } from '../../helpers/contracts-deployments'; -// import { -// deployUniswapLendingPoolAddressesProvider, -// deployUniswapLendingPool, -// deployUniswapLendingPoolConfigurator, -// deployUniswapPriceOracle, -// deployUniswapAaveOracle, -// deployUniswapLendingRateOracle, -// deployUniswapLendingPoolCollateralManager, -// deployUniswapMockFlashLoanReceiver, -// deployUniswapWETHGateway, -// deployUniswapWalletBalancerProvider, -// } from '../../helpers/uniswap-contracts-deployments'; -// import { tEthereumAddress, -// eContractid, -// AavePools, -// ICommonConfiguration, -// iAssetBase, -// TokenContractId, -// IMarketRates, -// } from '../../helpers/types'; -// import { -// getLendingPoolAddressesProviderRegistry, -// getLendingPoolAddressesProvider, //Test -// getLendingPool, -// getLendingPoolConfiguratorProxy, -// getAllMockedTokens, -// getPairsTokenAggregator, -// } from '../../helpers/contracts-getters'; -// import { waitForTx, filterMapBy } from '../../helpers/misc-utils'; -// import { UniswapConfig } from '../../markets/uniswap'; -// import { insertContractAddressInDb } from '../../helpers/contracts-helpers'; -// import { -// setInitialAssetPricesInOracle, -// deployAllMockAggregators, -// setInitialMarketRatesInRatesOracleByHelper, -// } from '../../helpers/oracles-helpers'; -// import {getAllAggregatorsAddresses, getAllTokenAddresses} from '../../helpers/mock-helpers'; -// import { -// ConfigNames, -// getReservesConfigByPool, -// getTreasuryAddress, -// loadPoolConfig, -// getWethAddress, -// } from '../../helpers/configuration'; -// import { -// configureReservesByHelper, -// initReservesByHelper, -// } from '../../helpers/init-helpers'; -// import { ZERO_ADDRESS } from '../../helpers/constants'; - - -// const pool = ConfigNames.Uniswap; -// /** -// * @dev addressesProvider is actually created here, so we don't need to use getAddressesProvider -// */ -// task( -// 'dev:deploy-uniswap-market', -// 'Deploy uniswap market' -// ) -// .addFlag('verify', 'Verify contracts at Etherscan') -// .setAction(async ({ verify }, localBRE) => { -// await localBRE.run('set-DRE'); - -// const admin = await (await localBRE.ethers.getSigners())[0].getAddress(); - -// const testProvider = await getLendingPoolAddressesProvider(); -// console.log("Addresses provider from function (pre re-deploy):", testProvider.address); -// const addressesProvider = await deployLendingPoolAddressesProvider(UniswapConfig.MarketId, verify); -// console.log("Addresses provider in execution::", addressesProvider.address) - -// const testProviderPost = await getLendingPoolAddressesProvider(); -// console.log("Addresses provider from function (pre re-deploy):", testProviderPost.address); -// console.log("Addresses provider from function (post re-deploy) should be different:") -// await waitForTx(await addressesProvider.setPoolAdmin(admin)); - - -// const addressesProviderRegistry = await getLendingPoolAddressesProviderRegistry(); -// await waitForTx( -// await addressesProviderRegistry.registerAddressesProvider(addressesProvider.address, 1) -// ); -// console.log(addressesProvider.address); - - -// /** -// * LENDING POOL DEPLOYMENT -// */ -// const lendingPoolImpl = await deployUniswapLendingPool(verify); - -// await waitForTx(await addressesProvider.setLendingPoolImpl(lendingPoolImpl.address)); - -// const address = await addressesProvider.getLendingPool(); -// console.log("UNISWAP MARKET LENDING POOL:", address); -// const lendingPoolProxy = await getLendingPool(address); -// await insertContractAddressInDb(eContractid.UniswapLendingPool, lendingPoolProxy.address); - -// const lendingPoolConfiguratorImpl = await deployUniswapLendingPoolConfigurator(verify); - -// // Set lending pool conf impl to Address Provider -// await waitForTx( -// await addressesProvider.setLendingPoolConfiguratorImpl(lendingPoolConfiguratorImpl.address) -// ); - -// const lendingPoolConfiguratorProxy = await getLendingPoolConfiguratorProxy( -// await addressesProvider.getLendingPoolConfigurator() -// ); - -// await insertContractAddressInDb( -// eContractid.UniswapLendingPoolConfigurator, -// lendingPoolConfiguratorProxy.address -// ); - -// // Deploy deployment helpers -// await deployStableAndVariableTokensHelper( -// [lendingPoolProxy.address, addressesProvider.address], -// verify -// ); -// await deployATokensAndRatesHelper( -// [lendingPoolProxy.address, addressesProvider.address, lendingPoolConfiguratorProxy.address], -// verify -// ); - -// /** -// * @dev Oracle deployment section -// */ - -// console.log("Uniswap oracle deployment beginning.") -// const poolConfig = loadPoolConfig(pool); -// console.log("Initialized pool config..."); - -// const { -// Mocks: {AllAssetsInitialPrices}, -// ProtocolGlobalParams: {UsdAddress, MockUsdPriceInWei}, -// LendingRateOracleRatesCommon, -// } = poolConfig as ICommonConfiguration; - -// console.log("Initialized mocks, global params and lending rate oracle rates"); - -// const defaultTokenList = { -// ...Object.fromEntries(Object.keys(TokenContractId).map((symbol) => [symbol, ''])), -// USD: UsdAddress, -// } as iAssetBase; - -// console.log("Initialized defaultTokenList"); - -// const mockTokens = await getAllMockedTokens(); - -// console.log("Initialized mock tokens"); - -// const mockTokensAddress = Object.keys(mockTokens).reduce>((prev, curr) => { -// prev[curr as keyof iAssetBase] = mockTokens[curr].address; -// return prev; -// }, defaultTokenList); -// console.log(mockTokensAddress); -// console.log("Initialized mock tokens addresses"); - -// // No need to re-initialize addressesProvider and admin - -// const fallbackOracle = await deployUniswapPriceOracle(verify); -// console.log("Deployed fallback price oracle"); - -// await waitForTx(await fallbackOracle.setEthUsdPrice(MockUsdPriceInWei)); -// console.log("set fallback ETH USD price"); - -// await setInitialAssetPricesInOracle(AllAssetsInitialPrices, mockTokensAddress, fallbackOracle); -// console.log("Set initial asset prices in oracle"); - -// const mockAggregators = await deployAllMockAggregators(AllAssetsInitialPrices, verify); -// console.log("Deployed mock aggregators"); - -// const allTokenAddresses = getAllTokenAddresses(mockTokens); -// console.log("Got all mock token addresses"); - -// const allAggregatorsAddresses = getAllAggregatorsAddresses(mockAggregators); -// console.log("Got all aggregator addresses"); -// console.log("allTokenAddresses object: \n", allTokenAddresses); -// //Should modify this to potentially contain only the tokens in the Uniswap market -// // const [tokens, aggregators] = getPairsTokenAggregator( -// // allTokenAddresses, -// // allAggregatorsAddresses -// // ); -// // console.log("Got \"pairsToken aggregator\""); -// // console.log("Tokens: \n", tokens); - -// // const assetAddressIndex = Object.keys(allReservesAddresses).findIndex( -// // (value) => value === assetSymbol -// // ); -// // const [, assetAddress] = (Object.entries(assetsAddresses) as [string, string][])[ -// // assetAddressIndex -// // ]; -// // assetAddresses.push(assetAddress); - -// // await deployUniswapAaveOracle( -// // [tokens, aggregators, fallbackOracle.address, await getWethAddress(poolConfig)], -// // verify -// // ); -// console.log("Deployed Uniswap Aave oracle"); - -// await waitForTx(await addressesProvider.setPriceOracle(fallbackOracle.address)); -// console.log("Set price oracle in addresses provider"); - -// const lendingRateOracle = await deployUniswapLendingRateOracle(verify); -// console.log("Deployed lendingRateOracle"); - -// await waitForTx(await addressesProvider.setLendingRateOracle(lendingRateOracle.address)); -// console.log("Set lending rate oracle in addresses provider"); - -// const {USD, ...tokensAddressesWithoutUsd} = allTokenAddresses; -// console.log("Initialized object with token addresses & usd") - -// const allReservesAddresses = { -// ...tokensAddressesWithoutUsd, -// }; -// console.log("Initialized object with all reserve addresses, allReservesAddresses:"); -// console.log(allReservesAddresses); - -// console.log("LendingRateOracleRatesCommon: \n", LendingRateOracleRatesCommon); -// // -// // -- test -// // -// const [tokens, aggregators] = getPairsTokenAggregator( -// allTokenAddresses, -// allAggregatorsAddresses -// ); -// console.log("Got \"pairsToken aggregator\""); -// console.log("Tokens: \n", tokens); -// const assetAddresses: string[] = []; -// const aggregatorAddresses: string[] = []; -// for (const [assetSymbol, {borrowRate}] of Object.entries(LendingRateOracleRatesCommon) as [ -// string, -// IMarketRates -// ][]) { -// const assetAddressIndex = Object.keys(allReservesAddresses).findIndex( -// (value) => value === assetSymbol -// ); -// const [, assetAddress] = (Object.entries(allReservesAddresses) as [string, string][])[ -// assetAddressIndex -// ]; - -// const [, aggregatorAddress] = (Object.entries(allAggregatorsAddresses) as [string, string][])[ -// assetAddressIndex -// ]; -// aggregatorAddresses.push(aggregatorAddress); -// assetAddresses.push(assetAddress); -// } -// console.log("\nPRICE ORACLE PARAMS:\nassetAddresses: %s\naggregatorAddresses: %s", assetAddresses, aggregatorAddresses); -// await deployUniswapAaveOracle( -// [assetAddresses, aggregatorAddresses, fallbackOracle.address, await getWethAddress(poolConfig)], -// verify -// ); -// // -// // -- test end -// // -// console.log("TEST END-----------------------------------------------------------------------"); -// await setInitialMarketRatesInRatesOracleByHelper( -// LendingRateOracleRatesCommon, -// allReservesAddresses, -// lendingRateOracle, -// admin -// ); - -// console.log("Task complete"); - -// /** -// * @dev Initialization -// */ - -// // No need to initialize poolConfig, mockTokens, allTokenAddresses, admin and -// // addressesProvider and protoReservesAddresses (we use allReserveAddresses) - -// const testHelpers = await deployAaveProtocolDataProvider(addressesProvider.address, verify); - -// const reservesParams = getReservesConfigByPool(AavePools.uniswap); - -// const treasuryAddress = await getTreasuryAddress(poolConfig); - -// await initReservesByHelper( -// addressesProvider, -// reservesParams, -// allReservesAddresses, -// admin, -// treasuryAddress, -// ZERO_ADDRESS, -// verify -// ); - -// await configureReservesByHelper( -// addressesProvider, -// reservesParams, -// allReservesAddresses, -// testHelpers, -// admin -// ); - -// const collateralManager = await deployUniswapLendingPoolCollateralManager(verify); -// await waitForTx( -// await addressesProvider.setLendingPoolCollateralManager(collateralManager.address) -// ); - -// const mockFlashLoanReceiver = await deployUniswapMockFlashLoanReceiver( -// addressesProvider.address, -// verify -// ); - -// await insertContractAddressInDb( -// eContractid.UniswapMockFlashLoanReceiver, -// mockFlashLoanReceiver.address -// ); - -// await deployUniswapWalletBalancerProvider(verify); - -// await insertContractAddressInDb(eContractid.AaveProtocolDataProvider, testHelpers.address); - -// const lendingPoolAddress = await addressesProvider.getLendingPool(); -// const wethAddress = await getWethAddress(poolConfig); -// await deployUniswapWETHGateway([wethAddress, lendingPoolAddress]); -// }); diff --git a/tasks/full/1_address_provider.ts b/tasks/full/1_address_provider.ts index 94506c27..7c0ed167 100644 --- a/tasks/full/1_address_provider.ts +++ b/tasks/full/1_address_provider.ts @@ -81,7 +81,7 @@ task( // 2. Deploy address provider and set genesis manager const addressesProvider = await deployLendingPoolAddressesProvider(MarketId, verify); - // TEMPORARILY DISABLING SEC. 3 FOR KOVAN DEPLOYMENT + // TEMPORARILY DISABLING SEC. 3 FOR GOVERNANCE USE // 3. Set the provider at the Registry // await waitForTx( diff --git a/tasks/full/3_oracles.ts b/tasks/full/3_oracles.ts index 093ea43c..b064328f 100644 --- a/tasks/full/3_oracles.ts +++ b/tasks/full/3_oracles.ts @@ -1,5 +1,5 @@ import { task } from 'hardhat/config'; -import { getParamPerNetwork, getParamPerPool } from '../../helpers/contracts-helpers'; +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'; @@ -32,8 +32,6 @@ task('full:deploy-oracles', 'Deploy oracles for dev enviroment') FallbackOracle, ChainlinkAggregator, } = poolConfig as ICommonConfiguration; - - //console.log("------------------------------------------------ReserveAssets:\n", ReserveAssets); const lendingRateOracles = getLendingRateOracles(poolConfig); const addressesProvider = await getLendingPoolAddressesProvider(); const admin = await getGenesisPoolAdmin(poolConfig); @@ -42,14 +40,13 @@ task('full:deploy-oracles', 'Deploy oracles for dev enviroment') const fallbackOracleAddress = await getParamPerNetwork(FallbackOracle, network); const reserveAssets = await getParamPerNetwork(ReserveAssets, network); const chainlinkAggregators = await getParamPerNetwork(ChainlinkAggregator, network); - //console.log("------------------------------------------------reserveAssets:\n", reserveAssets); const tokensToWatch: SymbolMap = { ...reserveAssets, USD: UsdAddress, }; const [tokens, aggregators] = getPairsTokenAggregator(tokensToWatch, chainlinkAggregators); - console.log("tokens:\n %s \n aggregators: \n %s", tokens, aggregators); + const aaveOracle = notFalsyOrZeroAddress(aaveOracleAddress) ? await getAaveOracle(aaveOracleAddress) : await deployAaveOracle( diff --git a/tasks/full/5_initialize.ts b/tasks/full/5_initialize.ts index 77672bdc..444f55d8 100644 --- a/tasks/full/5_initialize.ts +++ b/tasks/full/5_initialize.ts @@ -36,7 +36,6 @@ task('full:initialize-lending-pool', 'Initialize lending pool configuration.') const testHelpers = await getAaveProtocolDataProvider(); - console.log("reserveAssets:\n", reserveAssets); const admin = await addressesProvider.getPoolAdmin(); if (!reserveAssets) { throw 'Reserve assets is undefined. Check ReserveAssets configuration at config directory'; @@ -44,8 +43,8 @@ task('full:initialize-lending-pool', 'Initialize lending pool configuration.') const treasuryAddress = await getTreasuryAddress(poolConfig); - await initReservesByHelper(addressesProvider, ReservesConfig, reserveAssets, admin, treasuryAddress, ZERO_ADDRESS, verify); - await configureReservesByHelper(addressesProvider, ReservesConfig, reserveAssets, testHelpers, admin); + await initReservesByHelper(ReservesConfig, reserveAssets, admin, treasuryAddress, ZERO_ADDRESS, verify); + await configureReservesByHelper(ReservesConfig, reserveAssets, testHelpers, admin); const collateralManager = await deployLendingPoolCollateralManager(verify); await waitForTx( diff --git a/tasks/migrations/aave.dev.ts b/tasks/migrations/aave.dev.ts index ed208c6b..1892cb53 100644 --- a/tasks/migrations/aave.dev.ts +++ b/tasks/migrations/aave.dev.ts @@ -20,24 +20,18 @@ task('aave:dev', 'Deploy development enviroment') console.log('1. Deploy mock tokens'); await localBRE.run('dev:deploy-mock-tokens', {verify}); - console.log('2. Deploy Aave market address provider'); + console.log('2. Deploy address provider'); await localBRE.run('dev:deploy-address-provider', {verify}); - console.log('3. Deploy Aave lending pool'); + console.log('3. Deploy lending pool'); await localBRE.run('dev:deploy-lending-pool', {verify}); console.log('4. Deploy oracles'); await localBRE.run('dev:deploy-oracles', {verify, pool: POOL_NAME}); - console.log('6. Deploy Uniswap market oracles'); - await localBRE.run('dev:deploy-oracles', {verify, pool: "Uniswap"}); - console.log('5. Initialize lending pool'); await localBRE.run('dev:initialize-lending-pool', {verify, pool: POOL_NAME}); - // console.log('6. Deploy Uniswap market'); - // await localBRE.run('dev:deploy-uniswap-market', {verify}); - console.log('\nFinished migration'); printContracts(); }); diff --git a/test/__setup.spec.ts b/test/__setup.spec.ts index e464b47f..7d2bb638 100644 --- a/test/__setup.spec.ts +++ b/test/__setup.spec.ts @@ -97,7 +97,6 @@ const buildTestEnv = async (deployer: Signer, secondaryWallet: Signer) => { const addressList = await Promise.all( (await DRE.ethers.getSigners()).map((signer) => signer.getAddress()) ); - console.log(addressList); await waitForTx(await addressesProvider.setEmergencyAdmin(addressList[2])); @@ -216,9 +215,8 @@ const buildTestEnv = async (deployer: Signer, secondaryWallet: Signer) => { const treasuryAddress = await getTreasuryAddress(config); - await initReservesByHelper(addressesProvider, reservesParams, allReservesAddresses, admin, treasuryAddress, ZERO_ADDRESS, false); + await initReservesByHelper(reservesParams, allReservesAddresses, admin, treasuryAddress, ZERO_ADDRESS, false); await configureReservesByHelper( - addressesProvider, reservesParams, allReservesAddresses, testHelpers, diff --git a/test/test b/test/test deleted file mode 100644 index 6b201f6c..00000000 --- a/test/test +++ /dev/null @@ -1,153 +0,0 @@ -N# Contracts: 152 -MintableERC20: 0xB00cC45B4a7d3e1FEE684cFc4417998A1c183e6d -LendingPoolAddressesProvider: 0x0459c841b02Aee8730730C737582c53B20a27288 -LendingPoolAddressesProviderRegistry: 0x22474D350EC2dA53D717E30b96e9a2B7628Ede5b -ReserveLogic: 0x7fAeC7791277Ff512c41CA903c177B2Ed952dDAc -GenericLogic: 0x33958cC3535Fc328369EAC2B2Bebd120D67C7fa1 -ValidationLogic: 0x2cBbbBE1B75Ad7848F0844215816F551f429c64f -LendingPoolImpl: 0x8456161947DFc1fC159A0B26c025cD2b4bba0c3e -LendingPool: 0xbAc762e2000b6815268587b081Fd17aC25519aD5 -LendingPoolConfiguratorImpl: 0x5F6CaC05CDF893f029b29F44d368eAeD40e573B6 -LendingPoolConfigurator: 0x2C4603396dE2F08642354A3A102760827FfFe113 -StableAndVariableTokensHelper: 0xadcD6f616fCEEbEd731B2B3F01B8bd51A08b5CbD -ATokensAndRatesHelper: 0x603A373A1571783bD82b708C20a5A4b019BAB78F -DAI: 0x7c2C195CD6D34B8F845992d380aADB2730bB9C6F -AAVE: 0x8858eeB3DfffA017D4BCE9801D340D36Cf895CCf -TUSD: 0x0078371BDeDE8aAc7DeBfFf451B74c5EDB385Af7 -BAT: 0xf4e77E5Da47AC3125140c470c71cBca77B5c638c -WETHMocked: 0x09d728F76D543DB1925f7d1Fd8823e4e82700F99 -WETH: 0xf784709d2317D872237C4bC22f867d1BAe2913AB -USDC: 0x3619DbE27d7c1e7E91aA738697Ae7Bc5FC3eACA5 -USDT: 0x038B86d9d8FAFdd0a02ebd1A476432877b0107C8 -SUSD: 0x1A1FEe7EeD918BD762173e4dc5EfDB8a78C924A8 -ZRX: 0x500D1d6A4c7D8Ae28240b47c8FCde034D827fD5e -MKR: 0xc4905364b78a742ccce7B890A89514061E47068D -WBTC: 0xD6C850aeBFDC46D7F4c207e445cC0d6B0919BDBe -LINK: 0x8B5B7a6055E54a36fF574bbE40cf2eA68d5554b3 -KNC: 0xEcc0a6dbC0bb4D51E4F84A315a9e5B0438cAD4f0 -MANA: 0x20Ce94F404343aD2752A2D01b43fa407db9E0D00 -REN: 0x1d80315fac6aBd3EfeEbE97dEc44461ba7556160 -SNX: 0x2D8553F9ddA85A9B3259F6Bf26911364B85556F5 -BUSD: 0x52d3b94181f8654db2530b0fEe1B19173f519C52 -USD: 0xd15468525c35BDBC1eD8F2e09A00F8a173437f2f -YFI: 0x7e35Eaf7e8FBd7887ad538D4A38Df5BbD073814a -UNI: 0x5bcb88A0d20426e451332eE6C4324b0e663c50E0 -ENJ: 0x3521eF8AaB0323004A6dD8b03CE890F4Ea3A13f5 -WETHDAI: 0x53369fd4680FfE3DfF39Fc6DDa9CfbfD43daeA2E -WETHWBTC: 0xB00cC45B4a7d3e1FEE684cFc4417998A1c183e6d -PriceOracle: 0x06bA8d8af0dF898D0712DffFb0f862cC51AF45c2 -MockAggregator: 0xA0AB1cB92A4AF81f84dCd258155B5c25D247b54E -AaveOracle: 0xD662fb7FDC7526C79AA4417d2A4415416e057ec4 -LendingRateOracle: 0xEC1C93A9f6a9e18E97784c76aC52053587FcDB89 -AaveProtocolDataProvider: 0xf45C720549136d5E2d6a5A2F12573A36E36C3411 -stableDebtAAVE: 0xe3C388495669b8624753a275675AEf9eCc8Eaaa4 -variableDebtAAVE: 0xbdA8106CA657E2bfe1a125f0D0DDE47bA85E92c8 -stableDebtBAT: 0xa8c48Fad16b34bc9BC1203f1784D36CDf61dfD9c -variableDebtBAT: 0x5A7dE46c8176AF8550Df2fEF14464c2cB3B0EE5e -aAAVE: 0x1433d6d0794262c09f19E64177c0dD69A0e4D648 -strategyAAVE: 0x329e6747250B326E5E8029154DFFfE93F4f27016 -aBAT: 0x1A2e1C9d403E9DD6Da5022a14590ec875fBb75ba -strategyBAT: 0x12d5da143C6f7d3322C9b32cdF3a6Cae390A5293 -stableDebtBUSD: 0x453697f5d829556a0373F2b835cF94242B078C9e -variableDebtBUSD: 0x03D049FCA4dE1DA80F9DDF4bf0008115c74C0Da2 -stableDebtDAI: 0x30dDD022BC4df9BB0e6ce94A5535F2137dEA3755 -variableDebtDAI: 0xbfC8B61A3e6eD07C092a74603CeCAe91254745D6 -aBUSD: 0x1BC353ae7758eff98129928631a2D17d69BAb5FA -strategyBUSD: 0x270176D7DB4ec8d2a16b90C78B424AAdbBcFE298 -aDAI: 0x6A61442dBCF10E7168FfcD850CDf7c91Cad3E666 -strategyDAI: 0xA9DD0c06755734f4327F405cd20897D79FaCcFAE -stableDebtENJ: 0x6C0A2d54B37d8Cd321a25328753077D43A387303 -variableDebtENJ: 0x1372E5e41E22BaB997aD453469F0DFB9569dB121 -stableDebtKNC: 0x9bF0208c881906fAC92112320425b403e08Fe44b -variableDebtKNC: 0x6028834D13a4eec68b289E125222e5e5e86a5503 -aENJ: 0x2108E7A4B53516883b60a40ae02600697c8065A2 -strategyENJ: 0x64980e3e653Fe43813A41b9C5AcDB394d7A7320F -aKNC: 0x0f22acabf1Aa485565693B671Fc68B0583f8FEB0 -strategyKNC: 0xC45DA1E746911C76E51CA28b8d8A876735797E3C -stableDebtLINK: 0x3E650a21eAACE6314E98569E8A37FDA1d4cfBE28 -variableDebtLINK: 0xA7430bFB0f7332B1456dCB770D593f1D35bc2B11 -stableDebtMANA: 0x8DB6b6aE3c096E84B9818545974d1577E37Bcb97 -variableDebtMANA: 0x945ea0cf8986724ec075bE09C503c822fF8Ebb75 -aLINK: 0x778c890b128CE3936b744F0c8d7290d1F161D888 -strategyLINK: 0xCD8C6429A2975Db9466fCEFf36020166930a11Cb -aMANA: 0x5fd9aE04361262868d5C33cA1545580fC509b34c -strategyMANA: 0x024CC36954EfDbB9CFdda80a5A8c05Bd8DdF0fc8 -stableDebtMKR: 0xd1bD598200b53FC352483dBe36d9d72C085011A4 -variableDebtMKR: 0x49b81af588031Ecc93E20355E9ADC2d720348347 -stableDebtREN: 0x7367fBfEA2643eCbc0816Cc87B91E82B3Eb307aF -variableDebtREN: 0xAD75a04e5B815558a7E6C84c030e857671875934 -aMKR: 0xbEf21bFD5164eA882d74df73BB0862226C3063E9 -strategyMKR: 0x27a99bef2aF3200c6B7a831C61eF692341C7acEe -aREN: 0xe807dCAB5d5e8c5701c089758aAd34869a4c92Ea -strategyREN: 0xD933d804Dcb597Ac8020623ac32CcE3d4cB81b2a -stableDebtSNX: 0x3F33fb4D89eC6Bd516dCa915A3d85F0374d099d5 -variableDebtSNX: 0xD27B891432c9036E9dC95bc4fE9b8FCb61FBa05e -stableDebtSUSD: 0xFe3C98C3daE2F7562f43D1bBD2021FE127Afec38 -variableDebtSUSD: 0x53070063F0fB13C51C0e2186C0130f29aBe5336b -aSNX: 0x96a8C36C19D2A96642F2738b8E0481f159488EaD -strategySNX: 0xa5eB1859FA97E38C0a4257Af0be9085b3B4B7996 -aSUSD: 0x948Bd60Cba5eB8b7A478aE673145FeA13e2Edbe8 -strategySUSD: 0x7C769501542E694a5Dea6B1FCAf52B9270EADcaf -stableDebtTUSD: 0x6c2E76485dFbaFe2FCC6874e531D71ee82db06f6 -variableDebtTUSD: 0x3FA01122234D545d0247bdDbf4865925A53f6551 -stableDebtUSDC: 0xDD7a535Fb8773EBc4Ae653eCCb22F6561F434a9E -variableDebtUSDC: 0x9d1718D33aE17e54D2aE329b6B51511d4371Bf4a -aTUSD: 0x802881960dCD9457F63c4dbe1E9D081b32b011b9 -strategyTUSD: 0xC1f335a47c45d9F15976A1e11Eb3826590AD2a56 -aUSDC: 0x1CC642F9b88f755C1E7fbB9Acb4A990faddBF608 -strategyUSDC: 0x4272DE39F41085769562b2c17Fd5369097E41492 -stableDebtUSDT: 0x372915a5Bed2B0a5ecEdc96e7133A24aDDFA4Bc4 -variableDebtUSDT: 0x78123523ba15F9847D22a6d3f06bBed70E431114 -stableDebtWBTC: 0x6a3aB96987B70E29bc4203f78D09D0aCB85F219D -variableDebtWBTC: 0xcDD6c3f0dA05129f08DB52380C48A9cf698A8CCA -aUSDT: 0xe88141a1642eD64AE739cd2C896009Be73a43486 -strategyUSDT: 0x881036687070243FC119014c41cdd5e3c22f3E50 -aWBTC: 0xE74801a99A51B89dE670132De7d9c18CC2BBE54A -strategyWBTC: 0x55DFA1D5af234B35D457C13B8a58899848A438F8 -stableDebtWETH: 0xD1220D8A82a26C1396cccb5Ee79d3A42D7D3E3da -variableDebtWETH: 0x4f87eBaac31C3d13C376d52A0FABf5f022660C4c -stableDebtYFI: 0xF2dB8bc0dCd0A6C6F25B7f6ACfB9E026ae0e7494 -variableDebtYFI: 0xce3529624a1f3Ea5DBC1AB130eBeA8211E3b602F -aWETH: 0x7e4b842FFc0598C1f5D8b8A1e2C7AD29E9F233C7 -strategyWETH: 0x52Ac4c1Dbc0263b2FD6AD065B27576d0E7d925B9 -aYFI: 0x895D60248de2edc34C99f1B45d8Dd1731656Df51 -strategyYFI: 0x3cE6D0B4b6dc27C725fA94903Fb33d73bE75e9D7 -stableDebtZRX: 0xF78Fbf3b21aF8Bce2efA3614E507735573c578CC -variableDebtZRX: 0x9Ae60ba71A28a1d738a2FDFC1D0439B33f3f0B1F -aZRX: 0x80aB7B8EfeA24C2D2Ca22315BFa99E03f539C568 -strategyZRX: 0x4D2271CFa5587643B8f5919f3EbF64de7aaa9d5c -DelegationAwareAToken: 0xBAdDA897176B5A94FD4A0eCb59678DDA29181963 -StableDebtToken: 0x64Ea58f488aD445235A0afE9256B066572c6Abc8 -VariableDebtToken: 0x8D0206fEBEB380486729b64bB4cfEDC5b354a6D6 -DefaultReserveInterestRateStrategy: 0x3c5408De7435Dfa3eB2aF2Edf5E39385f68F69b2 -LendingPoolCollateralManagerImpl: 0x6602fca48E95F5068506963E3A8930131108048A -LendingPoolCollateralManager: 0x6602fca48E95F5068506963E3A8930131108048A -MockFlashLoanReceiver: 0x1a66D6103F8BBf9204E1618F095a80b3E4817C95 -WalletBalanceProvider: 0x0EBCa695959e5f138Af772FAa44ce1A9C7aEd921 -WETHGateway: 0x8BFFF31B1757da579Bb5B118489568526F7fb6D4 -MintableDelegationERC20: 0x8BFFF31B1757da579Bb5B118489568526F7fb6D4 -MockAToken: 0x8BFFF31B1757da579Bb5B118489568526F7fb6D4 -MockStableDebtToken: 0x0459c841b02Aee8730730C737582c53B20a27288 -MockVariableDebtToken: 0x2530ce07D254eA185E8e0bCC37a39e2FbA3bE548 -SelfdestructTransferMock: 0x0459c841b02Aee8730730C737582c53B20a27288 -UniswapLendingPool: 0xEC42F4C314dE9492cb3Ef7a860270eCDFE0F851a -UniswapLendingPoolConfigurator: 0x672A68Ff1364E87D8f88ad86410449C117fC97A6 -UniswapLendingPoolAddressesProvider: 0x18b9306737eaf6E8FC8e737F488a1AE077b18053 -UniswapLendingPoolImpl: 0xbAc762e2000b6815268587b081Fd17aC25519aD5 -UniswapLendingPoolConfiguratorImpl: 0xAa7BC1924711B77A0F3Aaebdd550BfeDDDbaf3cd -UniswapPriceOracle: 0xFf130817Aa9863B3D809A2A11617c05646245d80 -UniswapAaveOracle: 0xE91bBe8ee03560E3dda2786f95335F5399813Ca0 -UniswapLendingRateOracle: 0x4977FC58783ceBCC310311C800B786EcAf45F98f -stableDebtWETHDAI: 0x84fF0147dDD2acA72407CfEB7EabCd2b7E49d949 -variableDebtWETHDAI: 0x35A1E1Be236899ab7B63a81127ab522d76A26B3e -aWETHDAI: 0x591D75Ea272E9F22fC4B20Fc4C4E03d8c126b1AB -strategyWETHDAI: 0xF4040B68C37eE6F1324470f48D05cCEC50819b2E -stableDebtWETHWBTC: 0x5a41efF010872DB9a2CA0b47b8b757f37dc35A7f -variableDebtWETHWBTC: 0xee0382a3E9ADeAaA670c425D51ad5F8022c6d9F8 -aWETHWBTC: 0x4dA415c7aDaC37c3d710B5D24b62c6f4a5aF6e5F -strategyWETHWBTC: 0xf0c3F1cd72eA0a1F4e0e98B2e0702fA63a9F9faF -UniswapLendingPoolCollateralManagerImpl: 0x9D2F6Ec881323E78f27d58b996b81EaBCEF8eC58 -UniswapLendingPoolCollateralManager: 0x9D2F6Ec881323E78f27d58b996b81EaBCEF8eC58 -UniswapMockFlashLoanReceiver: 0xad17D0b25259128C968dbCa61CB5864C78004DBE -UniswapWalletBalanceProvider: 0x6Ac05758229c725A6d14F0ae7088985D9B251Fb2 -UniswapWETHGateway: 0xb2B548BE73010C188C083c510d255Aed74843b05 \ No newline at end of file From a4540633eaec9112d4b4319044c29c4b8f655746 Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Sun, 10 Jan 2021 20:41:58 -0500 Subject: [PATCH 13/31] Removed obsolete note --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index d5d9b6bc..ae2e7b69 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -### Uniswap V2 Liquidity Pool Market Aave Fork ``` .///. .///. //. .// `/////////////- `++:++` .++:++` :++` `++: `++:......---.` From 688b62fed2252c8a6d6665e132d5b17db3300c01 Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Mon, 11 Jan 2021 21:15:47 -0500 Subject: [PATCH 14/31] Added gas tracking --- gas-tracker.ts | 8 ++++++++ helpers/contracts-deployments.ts | 5 +++-- helpers/contracts-helpers.ts | 11 ++++++++++- helpers/init-helpers.ts | 16 +++++++++++++++- helpers/oracles-helpers.ts | 12 ++++++++++++ markets/uniswap/commons.ts | 4 ++-- tasks/full/1_address_provider.ts | 8 +++++++- tasks/full/3_oracles.ts | 5 ++++- tasks/full/5_initialize.ts | 3 +++ tasks/migrations/aave.mainnet.ts | 2 ++ tasks/migrations/uniswap.mainnet.ts | 6 +++++- 11 files changed, 71 insertions(+), 9 deletions(-) create mode 100644 gas-tracker.ts diff --git a/gas-tracker.ts b/gas-tracker.ts new file mode 100644 index 00000000..fbd2c48c --- /dev/null +++ b/gas-tracker.ts @@ -0,0 +1,8 @@ +// Should be a ts file that has a global var var gas = 0; +import { BigNumber } from 'ethers'; + +export var totalGas:BigNumber = BigNumber.from(0); + +export function addGas(amount: BigNumber) { + totalGas = totalGas.add(amount); +} \ No newline at end of file diff --git a/helpers/contracts-deployments.ts b/helpers/contracts-deployments.ts index 739ade34..7152a649 100644 --- a/helpers/contracts-deployments.ts +++ b/helpers/contracts-deployments.ts @@ -11,7 +11,6 @@ import { PoolConfiguration, eEthereumNetwork, } from './types'; - import { MintableERC20 } from '../types/MintableERC20'; import { MockContract } from 'ethereum-waffle'; import { getReservesConfigByPool } from './configuration'; @@ -58,6 +57,7 @@ import { MintableDelegationERC20 } from '../types/MintableDelegationERC20'; import { readArtifact as buidlerReadArtifact } from '@nomiclabs/buidler/plugins'; import { HardhatRuntimeEnvironment } from 'hardhat/types'; import { LendingPoolLibraryAddresses } from '../types/LendingPoolFactory'; +import { addGas } from '../gas-tracker'; const readArtifact = async (id: string) => { if (DRE.network.name === eEthereumNetwork.buidlerevm) { @@ -71,7 +71,8 @@ export const deployLendingPoolAddressesProvider = async (marketId: string, verif eContractid.LendingPoolAddressesProvider, [marketId], verify - ); + ) + export const deployLendingPoolAddressesProviderRegistry = async (verify?: boolean) => withSaveAndVerify( diff --git a/helpers/contracts-helpers.ts b/helpers/contracts-helpers.ts index df306c2a..c4f72403 100644 --- a/helpers/contracts-helpers.ts +++ b/helpers/contracts-helpers.ts @@ -16,7 +16,9 @@ import { MintableERC20 } from '../types/MintableERC20'; import { Artifact } from 'hardhat/types'; import { Artifact as BuidlerArtifact } from '@nomiclabs/buidler/types'; import { verifyContract } from './etherscan-verification'; -import { getIErc20Detailed } from './contracts-getters'; +import { getIErc20Detailed, getFirstSigner } from './contracts-getters'; +import { addGas, totalGas } from '../gas-tracker'; + export type MockTokenMap = { [symbol: string]: MintableERC20 }; @@ -88,6 +90,13 @@ export const withSaveAndVerify = async ( args: (string | string[])[], verify?: boolean ): Promise => { + // const signer = await getFirstSigner(); + // const factory = ethers.ContractFactory.fromSolidity(instance); + // const gasCost = await signer.estimateGas(await factory.getDeployTransaction()); + // console.log("TEST:", gasCost.toString()); + addGas(instance.deployTransaction.gasLimit); + console.log("Current totalGas value:", totalGas); + console.log("LOGGED GAS LIMIT:", instance.deployTransaction.gasLimit); await waitForTx(instance.deployTransaction); await registerContractInJsonDb(id, instance); if (DRE.network.name.includes('tenderly')) { diff --git a/helpers/init-helpers.ts b/helpers/init-helpers.ts index e80d2f91..2083e0df 100644 --- a/helpers/init-helpers.ts +++ b/helpers/init-helpers.ts @@ -25,6 +25,7 @@ import { } from './contracts-deployments'; import { ZERO_ADDRESS } from './constants'; import { isZeroAddress } from 'ethereumjs-util'; +import { addGas } from '../gas-tracker'; const chooseATokenDeployment = (id: eContractid) => { switch (id) { @@ -53,6 +54,7 @@ export const initReservesByHelper = async ( const poolAddress = await addressProvider.getLendingPool(); // Set aTokenAndRatesDeployer as temporal admin + addGas(await addressProvider.estimateGas.setPoolAdmin(atokenAndRatesDeployer.address)); await waitForTx(await addressProvider.setPoolAdmin(atokenAndRatesDeployer.address)); // CHUNK CONFIGURATION @@ -130,6 +132,7 @@ export const initReservesByHelper = async ( reservesDecimals.push(reserveDecimals); } + // tx1 and tx2 gas is accounted for later. // Deploy stable and variable deployers and save implementations const tx1 = await waitForTx( await stableAndVariableDeployer.initDeployment(tokens, symbols, incentivesController) @@ -158,7 +161,7 @@ export const initReservesByHelper = async ( console.log(' * gasUsed: debtTokens batch', tx1.gasUsed.toString()); console.log(' * gasUsed: aTokens and Strategy batch', tx2.gasUsed.toString()); gasUsage = gasUsage.add(tx1.gasUsed).add(tx2.gasUsed); - + addGas(gasUsage); const stableTokens: string[] = tx1.events?.map((e) => e.args?.stableToken) || []; const variableTokens: string[] = tx1.events?.map((e) => e.args?.variableToken) || []; const aTokens: string[] = tx2.events?.map((e) => e.args?.aToken) || []; @@ -352,6 +355,7 @@ export const configureReservesByHelper = async ( } if (tokens.length) { // Set aTokenAndRatesDeployer as temporal admin + addGas(await addressProvider.estimateGas.setPoolAdmin(atokenAndRatesDeployer.address)); await waitForTx(await addressProvider.setPoolAdmin(atokenAndRatesDeployer.address)); // Deploy init per chunks @@ -366,6 +370,15 @@ export const configureReservesByHelper = async ( console.log(`- Configure reserves in ${chunkedTokens.length} txs`); for (let chunkIndex = 0; chunkIndex < chunkedTokens.length; chunkIndex++) { + addGas(await atokenAndRatesDeployer.estimateGas.configureReserves( + chunkedTokens[chunkIndex], + chunkedBase[chunkIndex], + chunkedliquidationThresholds[chunkIndex], + chunkedliquidationBonuses[chunkIndex], + chunkedReserveFactors[chunkIndex], + chunkedStableRatesEnabled[chunkIndex], + { gasLimit: 12000000 } + )); await waitForTx( await atokenAndRatesDeployer.configureReserves( chunkedTokens[chunkIndex], @@ -380,6 +393,7 @@ export const configureReservesByHelper = async ( console.log(` - Init for: ${chunkedSymbols[chunkIndex].join(', ')}`); } // Set deployer back as admin + addGas(await addressProvider.estimateGas.setPoolAdmin(admin)); await waitForTx(await addressProvider.setPoolAdmin(admin)); } }; diff --git a/helpers/oracles-helpers.ts b/helpers/oracles-helpers.ts index 45cec5e2..7f8ecb81 100644 --- a/helpers/oracles-helpers.ts +++ b/helpers/oracles-helpers.ts @@ -13,6 +13,7 @@ import {MockAggregator} from '../types/MockAggregator'; import {deployMockAggregator} from './contracts-deployments'; import {chunk, waitForTx} from './misc-utils'; import {getStableAndVariableTokensHelper} from './contracts-getters'; +import { addGas } from '../gas-tracker'; export const setInitialMarketRatesInRatesOracleByHelper = async ( marketRates: iMultiPoolsAssets, @@ -45,12 +46,20 @@ export const setInitialMarketRatesInRatesOracleByHelper = async ( const chunkedSymbols = chunk(symbols, ratesChunks); // Set helper as owner + addGas(await lendingRateOracleInstance.estimateGas.transferOwnership(stableAndVariableTokenHelper.address)); await waitForTx( await lendingRateOracleInstance.transferOwnership(stableAndVariableTokenHelper.address) ); console.log(`- Oracle borrow initalization in ${chunkedTokens.length} txs`); for (let chunkIndex = 0; chunkIndex < chunkedTokens.length; chunkIndex++) { + + addGas(await stableAndVariableTokenHelper.estimateGas.setOracleBorrowRates( + chunkedTokens[chunkIndex], + chunkedRates[chunkIndex], + lendingRateOracleInstance.address + )); + const tx3 = await waitForTx( await stableAndVariableTokenHelper.setOracleBorrowRates( chunkedTokens[chunkIndex], @@ -61,6 +70,7 @@ export const setInitialMarketRatesInRatesOracleByHelper = async ( console.log(` - Setted Oracle Borrow Rates for: ${chunkedSymbols[chunkIndex].join(', ')}`); } // Set back ownership + addGas(await stableAndVariableTokenHelper.estimateGas.setOracleOwnership(lendingRateOracleInstance.address, admin)); await waitForTx( await stableAndVariableTokenHelper.setOracleOwnership(lendingRateOracleInstance.address, admin) ); @@ -78,6 +88,7 @@ export const setInitialAssetPricesInOracle = async ( const [, assetAddress] = (Object.entries(assetsAddresses) as [string, string][])[ assetAddressIndex ]; + addGas(await priceOracleInstance.estimateGas.setAssetPrice(assetAddress, price)); await waitForTx(await priceOracleInstance.setAssetPrice(assetAddress, price)); } }; @@ -94,6 +105,7 @@ export const setAssetPricesInOracle = async ( const [, assetAddress] = (Object.entries(assetsAddresses) as [string, string][])[ assetAddressIndex ]; + addGas(await priceOracleInstance.estimateGas.setAssetPrice(assetAddress, price)); await waitForTx(await priceOracleInstance.setAssetPrice(assetAddress, price)); } }; diff --git a/markets/uniswap/commons.ts b/markets/uniswap/commons.ts index db319e66..619a5e80 100644 --- a/markets/uniswap/commons.ts +++ b/markets/uniswap/commons.ts @@ -126,7 +126,7 @@ export const CommonsConfig: ICommonConfiguration = { [eEthereumNetwork.buidlerevm]: '', [eEthereumNetwork.kovan]: '',//'0xdCde9Bb6a49e37fA433990832AB541AE2d4FEB4a', [eEthereumNetwork.ropsten]: '0x05dcca805a6562c1bdd0423768754acb6993241b', - [eEthereumNetwork.main]: '0x8A32f49FFbA88aba6EFF96F45D8BD1D4b3f35c7D', + [eEthereumNetwork.main]: '', //'0x8A32f49FFbA88aba6EFF96F45D8BD1D4b3f35c7D', [eEthereumNetwork.tenderlyMain]: '0x8A32f49FFbA88aba6EFF96F45D8BD1D4b3f35c7D', }, TokenDistributor: { @@ -144,7 +144,7 @@ export const CommonsConfig: ICommonConfiguration = { [eEthereumNetwork.buidlerevm]: '', [EthereumNetwork.kovan]: '',//'0xB8bE51E6563BB312Cbb2aa26e352516c25c26ac1', [EthereumNetwork.ropsten]: ZERO_ADDRESS, - [EthereumNetwork.main]: '0xA50ba011c48153De246E5192C8f9258A2ba79Ca9', + [EthereumNetwork.main]: '', //'0xA50ba011c48153De246E5192C8f9258A2ba79Ca9', [EthereumNetwork.tenderlyMain]: '0xA50ba011c48153De246E5192C8f9258A2ba79Ca9', }, FallbackOracle: { diff --git a/tasks/full/1_address_provider.ts b/tasks/full/1_address_provider.ts index 7c0ed167..ad7fefd9 100644 --- a/tasks/full/1_address_provider.ts +++ b/tasks/full/1_address_provider.ts @@ -18,8 +18,10 @@ import { } from '../../helpers/contracts-getters'; import { formatEther, isAddress, parseEther } from 'ethers/lib/utils'; import { isZeroAddress } from 'ethereumjs-util'; -import { Signer } from 'ethers'; +import { Signer, BigNumber } from 'ethers'; import { parse } from 'path'; +import { addGas } from '../../gas-tracker'; +//import BigNumber from 'bignumber.js'; task( 'full:deploy-address-provider', @@ -92,6 +94,10 @@ task( // ); // 4. Set pool admins + + + addGas(await addressesProvider.estimateGas.setPoolAdmin(await getGenesisPoolAdmin(poolConfig))); + addGas(await addressesProvider.estimateGas.setEmergencyAdmin(await getEmergencyAdmin(poolConfig))); await waitForTx(await addressesProvider.setPoolAdmin(await getGenesisPoolAdmin(poolConfig))); await waitForTx(await addressesProvider.setEmergencyAdmin(await getEmergencyAdmin(poolConfig))); diff --git a/tasks/full/3_oracles.ts b/tasks/full/3_oracles.ts index b064328f..edcef77d 100644 --- a/tasks/full/3_oracles.ts +++ b/tasks/full/3_oracles.ts @@ -17,6 +17,7 @@ import { getLendingRateOracle, getPairsTokenAggregator, } from '../../helpers/contracts-getters'; +import { addGas } from '../../gas-tracker'; task('full:deploy-oracles', 'Deploy oracles for dev enviroment') .addFlag('verify', 'Verify contracts at Etherscan') @@ -66,8 +67,10 @@ task('full:deploy-oracles', 'Deploy oracles for dev enviroment') admin ); } - + console.log("ORACLES: %s and %s", aaveOracle.address, lendingRateOracle.address); // Register the proxy price provider on the addressesProvider + addGas(await addressesProvider.estimateGas.setPriceOracle(aaveOracle.address)); + addGas(await addressesProvider.estimateGas.setLendingRateOracle(lendingRateOracle.address)); await waitForTx(await addressesProvider.setPriceOracle(aaveOracle.address)); await waitForTx(await addressesProvider.setLendingRateOracle(lendingRateOracle.address)); } catch (error) { diff --git a/tasks/full/5_initialize.ts b/tasks/full/5_initialize.ts index 444f55d8..a40d0f3c 100644 --- a/tasks/full/5_initialize.ts +++ b/tasks/full/5_initialize.ts @@ -19,6 +19,7 @@ import { getLendingPoolAddressesProvider, } from '../../helpers/contracts-getters'; import { ZERO_ADDRESS } from '../../helpers/constants'; +import { addGas } from '../../gas-tracker'; task('full:initialize-lending-pool', 'Initialize lending pool configuration.') .addFlag('verify', 'Verify contracts at Etherscan') @@ -47,6 +48,8 @@ task('full:initialize-lending-pool', 'Initialize lending pool configuration.') await configureReservesByHelper(ReservesConfig, reserveAssets, testHelpers, admin); const collateralManager = await deployLendingPoolCollateralManager(verify); + + addGas(await addressesProvider.estimateGas.setLendingPoolCollateralManager(collateralManager.address)); await waitForTx( await addressesProvider.setLendingPoolCollateralManager(collateralManager.address) ); diff --git a/tasks/migrations/aave.mainnet.ts b/tasks/migrations/aave.mainnet.ts index c8ae5430..deba3b04 100644 --- a/tasks/migrations/aave.mainnet.ts +++ b/tasks/migrations/aave.mainnet.ts @@ -4,6 +4,7 @@ import {checkVerification} from '../../helpers/etherscan-verification'; import {ConfigNames} from '../../helpers/configuration'; import {EthereumNetworkNames} from '../../helpers/types'; import {printContracts} from '../../helpers/misc-utils'; +import {totalGas} from '../../gas-tracker'; task('aave:mainnet', 'Deploy development enviroment') .addFlag('verify', 'Verify contracts at Etherscan') @@ -56,4 +57,5 @@ task('aave:mainnet', 'Deploy development enviroment') } console.log('\nFinished migrations'); printContracts(); + console.log("Total gas used:", totalGas); }); diff --git a/tasks/migrations/uniswap.mainnet.ts b/tasks/migrations/uniswap.mainnet.ts index 7945dca6..5657f6eb 100644 --- a/tasks/migrations/uniswap.mainnet.ts +++ b/tasks/migrations/uniswap.mainnet.ts @@ -4,6 +4,7 @@ import {checkVerification} from '../../helpers/etherscan-verification'; import {ConfigNames} from '../../helpers/configuration'; import {EthereumNetworkNames} from '../../helpers/types'; import {printContracts} from '../../helpers/misc-utils'; +import {totalGas} from '../../gas-tracker'; task('uniswap:mainnet', 'Deploy development enviroment') .addFlag('verify', 'Verify contracts at Etherscan') @@ -23,12 +24,14 @@ task('uniswap:mainnet', 'Deploy development enviroment') const provider = new DRE.ethers.providers.Web3Provider(DRE.tenderlyRPC as any); DRE.ethers.provider = provider; } + // addGas(1); + // console.log(totalGas); console.log('Migration started\n'); console.log('1. Deploy address provider'); await DRE.run('full:deploy-address-provider', {pool: POOL_NAME}); - + console.log('2. Deploy lending pool'); await DRE.run('full:deploy-lending-pool'); @@ -56,4 +59,5 @@ task('uniswap:mainnet', 'Deploy development enviroment') } console.log('\nFinished migrations'); printContracts(); + console.log("Total gas used:", totalGas); }); From 917f6329804f9974a669fa2eaa5b9c8df5bfa3b6 Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Wed, 13 Jan 2021 01:05:44 -0500 Subject: [PATCH 15/31] Added unique prefix functionality --- helpers/contracts-getters.ts | 24 ++-- helpers/types.ts | 23 +-- markets/aave/commons.ts | 9 +- markets/uniswap/commons.ts | 31 +++-- markets/uniswap/index.ts | 42 +++--- package-lock.json | 261 +++++++++++++++++++++++------------ 6 files changed, 248 insertions(+), 142 deletions(-) diff --git a/helpers/contracts-getters.ts b/helpers/contracts-getters.ts index 65834cc6..c1f7c4a4 100644 --- a/helpers/contracts-getters.ts +++ b/helpers/contracts-getters.ts @@ -168,19 +168,19 @@ export const getPairsTokenAggregator = ( }, aggregatorsAddresses: { [tokenSymbol: string]: tEthereumAddress } ): [string[], string[]] => { - const { ETH, USD, WETH, ...assetsAddressesWithoutEth } = allAssetsAddresses; - + const { ETH, USD, WETH, UniWETH, ...assetsAddressesWithoutEth } = allAssetsAddresses; + const pairs = Object.entries(assetsAddressesWithoutEth).map(([tokenSymbol, tokenAddress]) => { - if (tokenSymbol !== 'WETH' && tokenSymbol !== 'ETH') { - const aggregatorAddressIndex = Object.keys(aggregatorsAddresses).findIndex( - (value) => value === tokenSymbol - ); - const [, aggregatorAddress] = (Object.entries(aggregatorsAddresses) as [ - string, - tEthereumAddress - ][])[aggregatorAddressIndex]; - return [tokenAddress, aggregatorAddress]; - } + //if (true/*tokenSymbol !== 'WETH' && tokenSymbol !== 'ETH' && tokenSymbol !== 'UniWETH'*/) { + const aggregatorAddressIndex = Object.keys(aggregatorsAddresses).findIndex( + (value) => value === tokenSymbol + ); + const [, aggregatorAddress] = (Object.entries(aggregatorsAddresses) as [ + string, + tEthereumAddress + ][])[aggregatorAddressIndex]; + return [tokenAddress, aggregatorAddress]; + //} }) as [string, string][]; const mappedPairs = pairs.map(([asset]) => asset); diff --git a/helpers/types.ts b/helpers/types.ts index bbb16389..3f810694 100644 --- a/helpers/types.ts +++ b/helpers/types.ts @@ -201,8 +201,13 @@ export interface iAssetBase { USD: T; REN: T; ENJ: T; - WETHDAI: T; - WETHWBTC: T; + UniWETH: T; + UniWBTC: T; + UniDAI: T; + UniUSDC: T; + UniUSDT: T; + UniWETHDAI: T; + UniWETHWBTC: T; } export type iAssetsWithoutETH = Omit, 'ETH'>; @@ -235,13 +240,13 @@ export type iAavePoolAssets = Pick< export type iUniswapPoolAssets = Pick< iAssetsWithoutUSD, - | 'DAI' - | 'USDC' - | 'USDT' - | 'WBTC' - | 'WETH' - | 'WETHDAI' - | 'WETHWBTC' + | 'UniDAI' + | 'UniUSDC' + | 'UniUSDT' + | 'UniWBTC' + | 'UniWETH' + | 'UniWETHDAI' + | 'UniWETHWBTC' >; export type iMultiPoolsAssets = iAssetCommon | iAavePoolAssets; diff --git a/markets/aave/commons.ts b/markets/aave/commons.ts index fecd714f..1d4b1e4a 100644 --- a/markets/aave/commons.ts +++ b/markets/aave/commons.ts @@ -23,8 +23,13 @@ const MOCK_CHAINLINK_AGGREGATORS_PRICES = { WBTC: oneEther.multipliedBy('47.332685').toFixed(), YFI: oneEther.multipliedBy('22.407436').toFixed(), ZRX: oneEther.multipliedBy('0.001151').toFixed(), - WETHDAI: oneEther.multipliedBy('22.407436').toFixed(), - WETHWBTC: oneEther.multipliedBy('22.407436').toFixed(), + UniDAI: oneEther.multipliedBy('0.00369068412860').toFixed(), + UniUSDC: oneEther.multipliedBy('0.00367714136416').toFixed(), + UniUSDT: oneEther.multipliedBy('0.00369068412860').toFixed(), + UniWBTC: oneEther.multipliedBy('47.332685').toFixed(), + UniWETH: oneEther.toFixed(), + UniWETHDAI: oneEther.multipliedBy('22.407436').toFixed(), + UniWETHWBTC: oneEther.multipliedBy('22.407436').toFixed(), USD: '5848466240000000', }; // ---------------- diff --git a/markets/uniswap/commons.ts b/markets/uniswap/commons.ts index 619a5e80..65378c32 100644 --- a/markets/uniswap/commons.ts +++ b/markets/uniswap/commons.ts @@ -23,8 +23,13 @@ const MOCK_CHAINLINK_AGGREGATORS_PRICES = { WBTC: oneEther.multipliedBy('47.332685').toFixed(), YFI: oneEther.multipliedBy('22.407436').toFixed(), ZRX: oneEther.multipliedBy('0.001151').toFixed(), - WETHDAI: oneEther.multipliedBy('22.407436').toFixed(), - WETHWBTC: oneEther.multipliedBy('22.407436').toFixed(), + UniDAI: oneEther.multipliedBy('0.00369068412860').toFixed(), + UniUSDC: oneEther.multipliedBy('0.00367714136416').toFixed(), + UniUSDT: oneEther.multipliedBy('0.00369068412860').toFixed(), + UniWBTC: oneEther.multipliedBy('47.332685').toFixed(), + UniWETH: oneEther.toFixed(), + UniWETHDAI: oneEther.multipliedBy('22.407436').toFixed(), + UniWETHWBTC: oneEther.multipliedBy('22.407436').toFixed(), USD: '5848466240000000', }; // ---------------- @@ -54,25 +59,25 @@ export const CommonsConfig: ICommonConfiguration = { }, // TODO: reorg alphabetically, checking the reason of tests failing LendingRateOracleRatesCommon: { - WETH: { + UniWETH: { borrowRate: oneRay.multipliedBy(0.03).toFixed(), }, - DAI: { + UniDAI: { borrowRate: oneRay.multipliedBy(0.039).toFixed(), }, - USDC: { + UniUSDC: { borrowRate: oneRay.multipliedBy(0.039).toFixed(), }, - USDT: { + UniUSDT: { borrowRate: oneRay.multipliedBy(0.035).toFixed(), }, - WBTC: { + UniWBTC: { borrowRate: oneRay.multipliedBy(0.03).toFixed(), }, - WETHDAI: { + UniWETHDAI: { borrowRate: oneRay.multipliedBy(0.05).toFixed(), }, - WETHWBTC: { + UniWETHWBTC: { borrowRate: oneRay.multipliedBy(0.05).toFixed(), }, }, @@ -226,9 +231,13 @@ export const CommonsConfig: ICommonConfiguration = { WBTC: '0xdeb288F737066589598e9214E782fa5A8eD689e8', YFI: '0x7c5d4F8345e66f68099581Db340cd65B078C41f4', ZRX: '0x2Da4983a622a8498bb1a21FaE9D8F6C664939962', + UniUSDT: '0xEe9F2375b4bdF6387aa8265dD4FB8F16512A1d46', + UniWBTC: '0xdeb288F737066589598e9214E782fa5A8eD689e8', + UniUSDC: '0x986b5E1e1755e3C2440e960477f25201B0a8bbD4', + UniDAI:'0x773616E4d11A78F511299002da57A0a94577F1f4', + UniWETHDAI: ZERO_ADDRESS, + UniWETHWBTC: ZERO_ADDRESS, USD: '0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419', - WETHDAI: ZERO_ADDRESS, - WETHWBTC: ZERO_ADDRESS, }, [EthereumNetwork.tenderlyMain]: { AAVE: '0x6Df09E975c830ECae5bd4eD9d90f3A95a4f88012', diff --git a/markets/uniswap/index.ts b/markets/uniswap/index.ts index e210c630..0447ca15 100644 --- a/markets/uniswap/index.ts +++ b/markets/uniswap/index.ts @@ -21,26 +21,26 @@ export const UniswapConfig: IUniswapConfiguration = { MarketId: 'Uniswap V2 market', ProviderId: 2, ReservesConfig: { - DAI: strategyDAI, - USDC: strategyUSDC, - USDT: strategyUSDT, - WBTC: strategyWBTC, - WETH: strategyWETH, - WETHDAI: strategyWETHDAI, - WETHWBTC: strategyWETHWBTC + UniWETH: strategyWETH, + UniDAI: strategyDAI, + UniUSDC: strategyUSDC, + UniUSDT: strategyUSDT, + UniWBTC: strategyWBTC, + UniWETHDAI: strategyWETHDAI, + UniWETHWBTC: strategyWETHWBTC }, ReserveAssets: { [eEthereumNetwork.buidlerevm]: {}, [eEthereumNetwork.hardhat]: {}, [eEthereumNetwork.coverage]: {}, [EthereumNetwork.kovan]: { - DAI: '0xFf795577d9AC8bD7D90Ee22b6C1703490b6512FD', - USDC: '0xe22da380ee6B445bb8273C81944ADEB6E8450422', - USDT: '0x13512979ADE267AB5100878E2e0f485B568328a4', - WBTC: '0xD1B98B6607330172f1D991521145A22BCe793277', - WETH: '0xd0a1e359811322d97991e03f863a0c30c2cf029c', - WETHDAI: '0x7d3A67ab574abD3F9849e5fcDa48c19939d032b4', - WETHWBTC: '0x342e78bf229Cd2a750E80D7D7c2C185455979b91', + UniDAI: '0xFf795577d9AC8bD7D90Ee22b6C1703490b6512FD', + UniUSDC: '0xe22da380ee6B445bb8273C81944ADEB6E8450422', + UniUSDT: '0x13512979ADE267AB5100878E2e0f485B568328a4', + UniWBTC: '0xD1B98B6607330172f1D991521145A22BCe793277', + UniWETH: '0xd0a1e359811322d97991e03f863a0c30c2cf029c', + UniWETHDAI: '0x7d3A67ab574abD3F9849e5fcDa48c19939d032b4', + uniWETHWBTC: '0x342e78bf229Cd2a750E80D7D7c2C185455979b91', }, [EthereumNetwork.ropsten]: { // AAVE: '', @@ -65,13 +65,13 @@ export const UniswapConfig: IUniswapConfiguration = { // ZRX: '0x02d7055704EfF050323A2E5ee4ba05DB2A588959', }, [EthereumNetwork.main]: { - DAI: '0x6B175474E89094C44Da98b954EedeAC495271d0F', - USDC: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', - USDT: '0xdAC17F958D2ee523a2206206994597C13D831ec7', - WBTC: '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', - WETH: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', - WETHDAI: '0xA478c2975Ab1Ea89e8196811F51A7B7Ade33eB11', - WETHWBTC: '0xBb2b8038a1640196FbE3e38816F3e67Cba72D940', + UniDAI: '0x6B175474E89094C44Da98b954EedeAC495271d0F', + UniUSDC: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', + UniUSDT: '0xdAC17F958D2ee523a2206206994597C13D831ec7', + UniWBTC: '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', + UniWETH: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', + UniWETHDAI: '0xA478c2975Ab1Ea89e8196811F51A7B7Ade33eB11', + UniWETHWBTC: '0xBb2b8038a1640196FbE3e38816F3e67Cba72D940', }, [EthereumNetwork.tenderlyMain]: { DAI: '0x6B175474E89094C44Da98b954EedeAC495271d0F', diff --git a/package-lock.json b/package-lock.json index dfdeb1a5..39dac6d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5583,12 +5583,14 @@ "dependencies": { "ansi-regex": { "version": "4.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, "ansi-styles": { "version": "3.2.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "^1.9.0" @@ -5596,7 +5598,8 @@ }, "bindings": { "version": "1.5.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", "dev": true, "requires": { "file-uri-to-path": "1.0.0" @@ -5604,7 +5607,8 @@ }, "bip66": { "version": "1.1.5", - "bundled": true, + "resolved": false, + "integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=", "dev": true, "requires": { "safe-buffer": "^5.0.1" @@ -5612,17 +5616,20 @@ }, "bn.js": { "version": "4.11.8", - "bundled": true, + "resolved": false, + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", "dev": true }, "brorand": { "version": "1.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", "dev": true }, "browserify-aes": { "version": "1.2.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "dev": true, "requires": { "buffer-xor": "^1.0.3", @@ -5635,22 +5642,26 @@ }, "buffer-from": { "version": "1.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, "buffer-xor": { "version": "1.0.3", - "bundled": true, + "resolved": false, + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", "dev": true }, "camelcase": { "version": "5.3.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, "cipher-base": { "version": "1.0.4", - "bundled": true, + "resolved": false, + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", "dev": true, "requires": { "inherits": "^2.0.1", @@ -5659,7 +5670,8 @@ }, "cliui": { "version": "5.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "dev": true, "requires": { "string-width": "^3.1.0", @@ -5669,7 +5681,8 @@ }, "color-convert": { "version": "1.9.3", - "bundled": true, + "resolved": false, + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "requires": { "color-name": "1.1.3" @@ -5677,12 +5690,14 @@ }, "color-name": { "version": "1.1.3", - "bundled": true, + "resolved": false, + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, "create-hash": { "version": "1.2.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "dev": true, "requires": { "cipher-base": "^1.0.1", @@ -5694,7 +5709,8 @@ }, "create-hmac": { "version": "1.1.7", - "bundled": true, + "resolved": false, + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "dev": true, "requires": { "cipher-base": "^1.0.3", @@ -5707,7 +5723,8 @@ }, "cross-spawn": { "version": "6.0.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "dev": true, "requires": { "nice-try": "^1.0.4", @@ -5719,12 +5736,14 @@ }, "decamelize": { "version": "1.2.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, "drbg.js": { "version": "1.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs=", "dev": true, "requires": { "browserify-aes": "^1.0.6", @@ -5734,7 +5753,8 @@ }, "elliptic": { "version": "6.5.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-eFOJTMyCYb7xtE/caJ6JJu+bhi67WCYNbkGSknu20pmM8Ke/bqOfdnZWxyoGN26JgfxTbXrsCkEw4KheCT/KGg==", "dev": true, "requires": { "bn.js": "^4.4.0", @@ -5748,12 +5768,14 @@ }, "emoji-regex": { "version": "7.0.3", - "bundled": true, + "resolved": false, + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, "end-of-stream": { "version": "1.4.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", "dev": true, "requires": { "once": "^1.4.0" @@ -5761,7 +5783,8 @@ }, "ethereumjs-util": { "version": "6.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==", "dev": true, "requires": { "bn.js": "^4.11.0", @@ -5775,7 +5798,8 @@ }, "ethjs-util": { "version": "0.1.6", - "bundled": true, + "resolved": false, + "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", "dev": true, "requires": { "is-hex-prefixed": "1.0.0", @@ -5784,7 +5808,8 @@ }, "evp_bytestokey": { "version": "1.0.3", - "bundled": true, + "resolved": false, + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", "dev": true, "requires": { "md5.js": "^1.3.4", @@ -5793,7 +5818,8 @@ }, "execa": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", "dev": true, "requires": { "cross-spawn": "^6.0.0", @@ -5807,12 +5833,14 @@ }, "file-uri-to-path": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", "dev": true }, "find-up": { "version": "3.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "dev": true, "requires": { "locate-path": "^3.0.0" @@ -5820,12 +5848,14 @@ }, "get-caller-file": { "version": "2.0.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, "get-stream": { "version": "4.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", "dev": true, "requires": { "pump": "^3.0.0" @@ -5833,7 +5863,8 @@ }, "hash-base": { "version": "3.0.4", - "bundled": true, + "resolved": false, + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", "dev": true, "requires": { "inherits": "^2.0.1", @@ -5842,7 +5873,8 @@ }, "hash.js": { "version": "1.1.7", - "bundled": true, + "resolved": false, + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", "dev": true, "requires": { "inherits": "^2.0.3", @@ -5851,7 +5883,8 @@ }, "hmac-drbg": { "version": "1.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", "dev": true, "requires": { "hash.js": "^1.0.3", @@ -5861,37 +5894,44 @@ }, "inherits": { "version": "2.0.4", - "bundled": true, + "resolved": false, + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, "invert-kv": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", "dev": true }, "is-fullwidth-code-point": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, "is-hex-prefixed": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=", "dev": true }, "is-stream": { "version": "1.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, "isexe": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, "keccak": { "version": "1.4.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", "dev": true, "requires": { "bindings": "^1.2.1", @@ -5902,7 +5942,8 @@ }, "lcid": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", "dev": true, "requires": { "invert-kv": "^2.0.0" @@ -5910,7 +5951,8 @@ }, "locate-path": { "version": "3.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", "dev": true, "requires": { "p-locate": "^3.0.0", @@ -5919,7 +5961,8 @@ }, "map-age-cleaner": { "version": "0.1.3", - "bundled": true, + "resolved": false, + "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", "dev": true, "requires": { "p-defer": "^1.0.0" @@ -5927,7 +5970,8 @@ }, "md5.js": { "version": "1.3.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", "dev": true, "requires": { "hash-base": "^3.0.0", @@ -5937,7 +5981,8 @@ }, "mem": { "version": "4.3.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", "dev": true, "requires": { "map-age-cleaner": "^0.1.1", @@ -5947,32 +5992,38 @@ }, "mimic-fn": { "version": "2.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true }, "minimalistic-assert": { "version": "1.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", "dev": true }, "minimalistic-crypto-utils": { "version": "1.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", "dev": true }, "nan": { "version": "2.14.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", "dev": true }, "nice-try": { "version": "1.0.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, "npm-run-path": { "version": "2.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "dev": true, "requires": { "path-key": "^2.0.0" @@ -5980,7 +6031,8 @@ }, "once": { "version": "1.4.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { "wrappy": "1" @@ -5988,7 +6040,8 @@ }, "os-locale": { "version": "3.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", "dev": true, "requires": { "execa": "^1.0.0", @@ -5998,22 +6051,26 @@ }, "p-defer": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", "dev": true }, "p-finally": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", "dev": true }, "p-is-promise": { "version": "2.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", "dev": true }, "p-limit": { "version": "2.2.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", "dev": true, "requires": { "p-try": "^2.0.0" @@ -6021,7 +6078,8 @@ }, "p-locate": { "version": "3.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", "dev": true, "requires": { "p-limit": "^2.0.0" @@ -6029,22 +6087,26 @@ }, "p-try": { "version": "2.2.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, "path-exists": { "version": "3.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "dev": true }, "path-key": { "version": "2.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "dev": true }, "pump": { "version": "3.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "dev": true, "requires": { "end-of-stream": "^1.1.0", @@ -6053,17 +6115,20 @@ }, "require-directory": { "version": "2.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, "require-main-filename": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, "ripemd160": { "version": "2.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", "dev": true, "requires": { "hash-base": "^3.0.0", @@ -6072,7 +6137,8 @@ }, "rlp": { "version": "2.2.3", - "bundled": true, + "resolved": false, + "integrity": "sha512-l6YVrI7+d2vpW6D6rS05x2Xrmq8oW7v3pieZOJKBEdjuTF4Kz/iwk55Zyh1Zaz+KOB2kC8+2jZlp2u9L4tTzCQ==", "dev": true, "requires": { "bn.js": "^4.11.1", @@ -6081,12 +6147,14 @@ }, "safe-buffer": { "version": "5.2.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", "dev": true }, "secp256k1": { "version": "3.7.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-1cf8sbnRreXrQFdH6qsg2H71Xw91fCCS9Yp021GnUNJzWJS/py96fS4lHbnTnouLp08Xj6jBoBB6V78Tdbdu5g==", "dev": true, "requires": { "bindings": "^1.5.0", @@ -6101,17 +6169,20 @@ }, "semver": { "version": "5.7.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", "dev": true }, "set-blocking": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, "sha.js": { "version": "2.4.11", - "bundled": true, + "resolved": false, + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, "requires": { "inherits": "^2.0.1", @@ -6120,7 +6191,8 @@ }, "shebang-command": { "version": "1.2.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "dev": true, "requires": { "shebang-regex": "^1.0.0" @@ -6128,22 +6200,26 @@ }, "shebang-regex": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, "signal-exit": { "version": "3.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, "source-map": { "version": "0.6.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, "source-map-support": { "version": "0.5.12", - "bundled": true, + "resolved": false, + "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -6152,7 +6228,8 @@ }, "string-width": { "version": "3.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "requires": { "emoji-regex": "^7.0.1", @@ -6162,7 +6239,8 @@ }, "strip-ansi": { "version": "5.2.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { "ansi-regex": "^4.1.0" @@ -6170,12 +6248,14 @@ }, "strip-eof": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, "strip-hex-prefix": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", "dev": true, "requires": { "is-hex-prefixed": "1.0.0" @@ -6183,7 +6263,8 @@ }, "which": { "version": "1.3.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { "isexe": "^2.0.0" @@ -6191,12 +6272,14 @@ }, "which-module": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, "wrap-ansi": { "version": "5.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", "dev": true, "requires": { "ansi-styles": "^3.2.0", @@ -6206,17 +6289,20 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, "y18n": { "version": "4.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "dev": true }, "yargs": { "version": "13.2.4", - "bundled": true, + "resolved": false, + "integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==", "dev": true, "requires": { "cliui": "^5.0.0", @@ -6234,7 +6320,8 @@ }, "yargs-parser": { "version": "13.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", "dev": true, "requires": { "camelcase": "^5.0.0", From 4f5828457bd032a3a4d8033074545a56af2bbd7d Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Thu, 14 Jan 2021 18:39:18 -0500 Subject: [PATCH 16/31] Removed redundancies --- markets/uniswap/commons.ts | 97 ++++++-------------------------------- 1 file changed, 15 insertions(+), 82 deletions(-) diff --git a/markets/uniswap/commons.ts b/markets/uniswap/commons.ts index 65378c32..db06cfa0 100644 --- a/markets/uniswap/commons.ts +++ b/markets/uniswap/commons.ts @@ -166,100 +166,33 @@ export const CommonsConfig: ICommonConfiguration = { [eEthereumNetwork.hardhat]: {}, [eEthereumNetwork.buidlerevm]: {}, [EthereumNetwork.kovan]: { - AAVE: '0xd04647B7CB523bb9f26730E9B6dE1174db7591Ad', - BAT: '0x0e4fcEC26c9f85c3D714370c98f43C4E02Fc35Ae', - BUSD: '0xbF7A18ea5DE0501f7559144e702b29c55b055CcB', - DAI: '0x22B58f1EbEDfCA50feF632bD73368b2FdA96D541', - ENJ: '0xfaDbe2ee798889F02d1d39eDaD98Eff4c7fe95D4', - KNC: '0xb8E8130d244CFd13a75D6B9Aee029B1C33c808A7', - LINK: '0x3Af8C569ab77af5230596Acf0E8c2F9351d24C38', - MANA: '0x1b93D8E109cfeDcBb3Cc74eD761DE286d5771511', - MKR: '0x0B156192e04bAD92B6C1C13cf8739d14D78D5701', - REN: '0xF1939BECE7708382b5fb5e559f630CB8B39a10ee', - SNX: '0xF9A76ae7a1075Fe7d646b06fF05Bd48b9FA5582e', - SUSD: '0xb343e7a1aF578FA35632435243D814e7497622f7', - TUSD: '0x7aeCF1c19661d12E962b69eBC8f6b2E63a55C660', - UNI: '0x17756515f112429471F86f98D5052aCB6C47f6ee', - USDC: '0x64EaC61A2DFda2c3Fa04eED49AA33D021AeC8838', - USDT: '0x0bF499444525a23E7Bb61997539725cA2e928138', - WBTC: '0xF7904a295A029a3aBDFFB6F12755974a958C7C25', - YFI: '0xC5d1B1DEb2992738C0273408ac43e1e906086B6C', - ZRX: '0xBc3f28Ccc21E9b5856E81E6372aFf57307E2E883', - USD: '0x9326BFA02ADD2366b30bacB125260Af641031331', - WETHDAI: '0x90B86B501BF4d800a7F76E551952E214Cc58Fba3', - WETHWBTC: '0x90B86B501BF4d800a7F76E551952E214Cc58Fba3', + UniUSDT: ZERO_ADDRESS, + UniWBTC: ZERO_ADDRESS, + UniUSDC: ZERO_ADDRESS, + UniDAI:ZERO_ADDRESS, + UniWETHDAI: ZERO_ADDRESS, + UniWETHWBTC: ZERO_ADDRESS, + USD: '0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419', }, [EthereumNetwork.ropsten]: { - AAVE: ZERO_ADDRESS, - BAT: '0xafd8186c962daf599f171b8600f3e19af7b52c92', - BUSD: '0x0A32D96Ff131cd5c3E0E5AAB645BF009Eda61564', - DAI: '0x64b8e49baded7bfb2fd5a9235b2440c0ee02971b', - ENJ: ZERO_ADDRESS, - KNC: '0x19d97ceb36624a31d827032d8216dd2eb15e9845', - LINK: '0xb8c99b98913bE2ca4899CdcaF33a3e519C20EeEc', - MANA: '0xDab909dedB72573c626481fC98CEE1152b81DEC2', - MKR: '0x811B1f727F8F4aE899774B568d2e72916D91F392', - REN: ZERO_ADDRESS, - SNX: '0xA95674a8Ed9aa9D2E445eb0024a9aa05ab44f6bf', - SUSD: '0xe054b4aee7ac7645642dd52f1c892ff0128c98f0', - TUSD: '0x523ac85618df56e940534443125ef16daf785620', - UNI: ZERO_ADDRESS, - USDC: '0xe1480303dde539e2c241bdc527649f37c9cbef7d', - USDT: '0xc08fe0c4d97ccda6b40649c6da621761b628c288', - WBTC: '0x5b8B87A0abA4be247e660B0e0143bB30Cdf566AF', - YFI: ZERO_ADDRESS, - ZRX: '0x1d0052e4ae5b4ae4563cbac50edc3627ca0460d7', - USD: '0x8468b2bDCE073A157E560AA4D9CcF6dB1DB98507', }, [EthereumNetwork.main]: { - AAVE: '0x6Df09E975c830ECae5bd4eD9d90f3A95a4f88012', - BAT: '0x0d16d4528239e9ee52fa531af613AcdB23D88c94', - BUSD: '0x614715d2Af89E6EC99A233818275142cE88d1Cfd', - DAI: '0x773616E4d11A78F511299002da57A0a94577F1f4', - ENJ: '0x24D9aB51950F3d62E9144fdC2f3135DAA6Ce8D1B', - KNC: '0x656c0544eF4C98A6a98491833A89204Abb045d6b', - LINK: '0xDC530D9457755926550b59e8ECcdaE7624181557', - MANA: '0x82A44D92D6c329826dc557c5E1Be6ebeC5D5FeB9', - MKR: '0x24551a8Fb2A7211A25a17B1481f043A8a8adC7f2', - REN: '0x3147D7203354Dc06D9fd350c7a2437bcA92387a4', - SNX: '0x79291A9d692Df95334B1a0B3B4AE6bC606782f8c', - SUSD: '0x8e0b7e6062272B5eF4524250bFFF8e5Bd3497757', - TUSD: '0x3886BA987236181D98F2401c507Fb8BeA7871dF2', - UNI: '0xD6aA3D25116d8dA79Ea0246c4826EB951872e02e', - USDC: '0x986b5E1e1755e3C2440e960477f25201B0a8bbD4', - USDT: '0xEe9F2375b4bdF6387aa8265dD4FB8F16512A1d46', - WBTC: '0xdeb288F737066589598e9214E782fa5A8eD689e8', - YFI: '0x7c5d4F8345e66f68099581Db340cd65B078C41f4', - ZRX: '0x2Da4983a622a8498bb1a21FaE9D8F6C664939962', UniUSDT: '0xEe9F2375b4bdF6387aa8265dD4FB8F16512A1d46', UniWBTC: '0xdeb288F737066589598e9214E782fa5A8eD689e8', UniUSDC: '0x986b5E1e1755e3C2440e960477f25201B0a8bbD4', UniDAI:'0x773616E4d11A78F511299002da57A0a94577F1f4', UniWETHDAI: ZERO_ADDRESS, UniWETHWBTC: ZERO_ADDRESS, - USD: '0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419', + USD: '0x9326BFA02ADD2366b30bacB125260Af641031331', }, [EthereumNetwork.tenderlyMain]: { - AAVE: '0x6Df09E975c830ECae5bd4eD9d90f3A95a4f88012', - BAT: '0x0d16d4528239e9ee52fa531af613AcdB23D88c94', - BUSD: '0x614715d2Af89E6EC99A233818275142cE88d1Cfd', - DAI: '0x773616E4d11A78F511299002da57A0a94577F1f4', - ENJ: '0x24D9aB51950F3d62E9144fdC2f3135DAA6Ce8D1B', - KNC: '0x656c0544eF4C98A6a98491833A89204Abb045d6b', - LINK: '0xDC530D9457755926550b59e8ECcdaE7624181557', - MANA: '0x82A44D92D6c329826dc557c5E1Be6ebeC5D5FeB9', - MKR: '0x24551a8Fb2A7211A25a17B1481f043A8a8adC7f2', - REN: '0x3147D7203354Dc06D9fd350c7a2437bcA92387a4', - SNX: '0x79291A9d692Df95334B1a0B3B4AE6bC606782f8c', - SUSD: '0x8e0b7e6062272B5eF4524250bFFF8e5Bd3497757', - TUSD: '0x3886BA987236181D98F2401c507Fb8BeA7871dF2', - UNI: '0xD6aA3D25116d8dA79Ea0246c4826EB951872e02e', - USDC: '0x986b5E1e1755e3C2440e960477f25201B0a8bbD4', - USDT: '0xEe9F2375b4bdF6387aa8265dD4FB8F16512A1d46', - WBTC: '0xdeb288F737066589598e9214E782fa5A8eD689e8', - YFI: '0x7c5d4F8345e66f68099581Db340cd65B078C41f4', - ZRX: '0x2Da4983a622a8498bb1a21FaE9D8F6C664939962', - USD: '0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419', + UniUSDT: '0xEe9F2375b4bdF6387aa8265dD4FB8F16512A1d46', + UniWBTC: '0xdeb288F737066589598e9214E782fa5A8eD689e8', + UniUSDC: '0x986b5E1e1755e3C2440e960477f25201B0a8bbD4', + UniDAI:'0x773616E4d11A78F511299002da57A0a94577F1f4', + UniWETHDAI: ZERO_ADDRESS, + UniWETHWBTC: ZERO_ADDRESS, + USD: '0x9326BFA02ADD2366b30bacB125260Af641031331', }, }, ReserveAssets: { From eb38932cc2c7411aa9bb62feae456d3ccabfced7 Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Thu, 14 Jan 2021 18:43:49 -0500 Subject: [PATCH 17/31] Cleaned comment --- gas-tracker.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gas-tracker.ts b/gas-tracker.ts index fbd2c48c..0e165a00 100644 --- a/gas-tracker.ts +++ b/gas-tracker.ts @@ -1,4 +1,6 @@ -// Should be a ts file that has a global var var gas = 0; +/** + * @dev This is a simple script that keeps track of gas spent during deployment. + */ import { BigNumber } from 'ethers'; export var totalGas:BigNumber = BigNumber.from(0); From ccb6e36760ff56d2ff27979e5f126aceb06ae268 Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Thu, 14 Jan 2021 18:56:18 -0500 Subject: [PATCH 18/31] Slight cleanup --- helpers/contracts-deployments.ts | 1 - helpers/contracts-helpers.ts | 3 +-- helpers/types.ts | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/helpers/contracts-deployments.ts b/helpers/contracts-deployments.ts index 7152a649..4c4ac58d 100644 --- a/helpers/contracts-deployments.ts +++ b/helpers/contracts-deployments.ts @@ -72,7 +72,6 @@ export const deployLendingPoolAddressesProvider = async (marketId: string, verif [marketId], verify ) - export const deployLendingPoolAddressesProviderRegistry = async (verify?: boolean) => withSaveAndVerify( diff --git a/helpers/contracts-helpers.ts b/helpers/contracts-helpers.ts index c4f72403..702e54ad 100644 --- a/helpers/contracts-helpers.ts +++ b/helpers/contracts-helpers.ts @@ -19,7 +19,6 @@ import { verifyContract } from './etherscan-verification'; import { getIErc20Detailed, getFirstSigner } from './contracts-getters'; import { addGas, totalGas } from '../gas-tracker'; - export type MockTokenMap = { [symbol: string]: MintableERC20 }; export const registerContractInJsonDb = async (contractId: string, contractInstance: Contract) => { @@ -96,7 +95,7 @@ export const withSaveAndVerify = async ( // console.log("TEST:", gasCost.toString()); addGas(instance.deployTransaction.gasLimit); console.log("Current totalGas value:", totalGas); - console.log("LOGGED GAS LIMIT:", instance.deployTransaction.gasLimit); + console.log("Logged gas limit:", instance.deployTransaction.gasLimit); await waitForTx(instance.deployTransaction); await registerContractInJsonDb(id, instance); if (DRE.network.name.includes('tenderly')) { diff --git a/helpers/types.ts b/helpers/types.ts index 3f810694..55113100 100644 --- a/helpers/types.ts +++ b/helpers/types.ts @@ -277,8 +277,6 @@ export enum TokenContractId { YFI = 'YFI', UNI = 'UNI', ENJ = 'ENJ', - WETHDAI = 'WETHDAI', - WETHWBTC = 'WETHWBTC', } export interface IReserveParams extends IReserveBorrowParams, IReserveCollateralParams { From b2123e914ce9e93d89b9602381627449ab5aecc3 Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Thu, 14 Jan 2021 19:06:29 -0500 Subject: [PATCH 19/31] Slight fix --- helpers/contracts-deployments.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers/contracts-deployments.ts b/helpers/contracts-deployments.ts index 4c4ac58d..8f7f0c9d 100644 --- a/helpers/contracts-deployments.ts +++ b/helpers/contracts-deployments.ts @@ -57,7 +57,6 @@ import { MintableDelegationERC20 } from '../types/MintableDelegationERC20'; import { readArtifact as buidlerReadArtifact } from '@nomiclabs/buidler/plugins'; import { HardhatRuntimeEnvironment } from 'hardhat/types'; import { LendingPoolLibraryAddresses } from '../types/LendingPoolFactory'; -import { addGas } from '../gas-tracker'; const readArtifact = async (id: string) => { if (DRE.network.name === eEthereumNetwork.buidlerevm) { @@ -65,13 +64,14 @@ const readArtifact = async (id: string) => { } return (DRE as HardhatRuntimeEnvironment).artifacts.readArtifact(id); }; + export const deployLendingPoolAddressesProvider = async (marketId: string, verify?: boolean) => withSaveAndVerify( await new LendingPoolAddressesProviderFactory(await getFirstSigner()).deploy(marketId), eContractid.LendingPoolAddressesProvider, [marketId], verify - ) + ); export const deployLendingPoolAddressesProviderRegistry = async (verify?: boolean) => withSaveAndVerify( From ed17b5a0379adfc2576ead46c15a691967f61c90 Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Thu, 14 Jan 2021 20:59:14 -0500 Subject: [PATCH 20/31] Slight cleanup --- helpers/contracts-getters.ts | 2 +- helpers/contracts-helpers.ts | 4 ---- tasks/migrations/aave.mainnet.ts | 2 +- tasks/migrations/uniswap.mainnet.ts | 2 +- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/helpers/contracts-getters.ts b/helpers/contracts-getters.ts index c1f7c4a4..f1b847da 100644 --- a/helpers/contracts-getters.ts +++ b/helpers/contracts-getters.ts @@ -169,7 +169,7 @@ export const getPairsTokenAggregator = ( aggregatorsAddresses: { [tokenSymbol: string]: tEthereumAddress } ): [string[], string[]] => { const { ETH, USD, WETH, UniWETH, ...assetsAddressesWithoutEth } = allAssetsAddresses; - + const pairs = Object.entries(assetsAddressesWithoutEth).map(([tokenSymbol, tokenAddress]) => { //if (true/*tokenSymbol !== 'WETH' && tokenSymbol !== 'ETH' && tokenSymbol !== 'UniWETH'*/) { const aggregatorAddressIndex = Object.keys(aggregatorsAddresses).findIndex( diff --git a/helpers/contracts-helpers.ts b/helpers/contracts-helpers.ts index 702e54ad..4b6a2830 100644 --- a/helpers/contracts-helpers.ts +++ b/helpers/contracts-helpers.ts @@ -89,10 +89,6 @@ export const withSaveAndVerify = async ( args: (string | string[])[], verify?: boolean ): Promise => { - // const signer = await getFirstSigner(); - // const factory = ethers.ContractFactory.fromSolidity(instance); - // const gasCost = await signer.estimateGas(await factory.getDeployTransaction()); - // console.log("TEST:", gasCost.toString()); addGas(instance.deployTransaction.gasLimit); console.log("Current totalGas value:", totalGas); console.log("Logged gas limit:", instance.deployTransaction.gasLimit); diff --git a/tasks/migrations/aave.mainnet.ts b/tasks/migrations/aave.mainnet.ts index deba3b04..7ee32855 100644 --- a/tasks/migrations/aave.mainnet.ts +++ b/tasks/migrations/aave.mainnet.ts @@ -57,5 +57,5 @@ task('aave:mainnet', 'Deploy development enviroment') } console.log('\nFinished migrations'); printContracts(); - console.log("Total gas used:", totalGas); + console.log("Total gas used:", totalGas.toString()); }); diff --git a/tasks/migrations/uniswap.mainnet.ts b/tasks/migrations/uniswap.mainnet.ts index 5657f6eb..ab795d23 100644 --- a/tasks/migrations/uniswap.mainnet.ts +++ b/tasks/migrations/uniswap.mainnet.ts @@ -59,5 +59,5 @@ task('uniswap:mainnet', 'Deploy development enviroment') } console.log('\nFinished migrations'); printContracts(); - console.log("Total gas used:", totalGas); + console.log("Total gas used:", totalGas.toString()); }); From 97a6179703f2c697a57fe50a12080bcd566cfcc4 Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Tue, 19 Jan 2021 20:58:21 -0500 Subject: [PATCH 21/31] Added all UNI-V2 pairs and configs --- helpers/contracts-helpers.ts | 2 +- helpers/types.ts | 32 +++- markets/aave/commons.ts | 16 +- markets/uniswap/commons.ts | 114 ++++++++++++-- markets/uniswap/index.ts | 75 ++++++---- markets/uniswap/reservesConfigs.ts | 230 +++++++++++++++++++++++++++-- 6 files changed, 404 insertions(+), 65 deletions(-) diff --git a/helpers/contracts-helpers.ts b/helpers/contracts-helpers.ts index 4b6a2830..8c2e8e58 100644 --- a/helpers/contracts-helpers.ts +++ b/helpers/contracts-helpers.ts @@ -16,7 +16,7 @@ import { MintableERC20 } from '../types/MintableERC20'; import { Artifact } from 'hardhat/types'; import { Artifact as BuidlerArtifact } from '@nomiclabs/buidler/types'; import { verifyContract } from './etherscan-verification'; -import { getIErc20Detailed, getFirstSigner } from './contracts-getters'; +import { getIErc20Detailed } from './contracts-getters'; import { addGas, totalGas } from '../gas-tracker'; export type MockTokenMap = { [symbol: string]: MintableERC20 }; diff --git a/helpers/types.ts b/helpers/types.ts index 55113100..0a2b7194 100644 --- a/helpers/types.ts +++ b/helpers/types.ts @@ -206,8 +206,20 @@ export interface iAssetBase { UniDAI: T; UniUSDC: T; UniUSDT: T; - UniWETHDAI: T; - UniWETHWBTC: T; + UniDAIWETH: T; + UniWBTCWETH: T; + UniAAVEWETH: T; + UniBATWETH: T; + UniUSDCDAI: T; + UniCRVWETH: T; + UniLINKWETH: T; + UniMKRWETH: T; + UniRENWETH: T; + UniSNXWETH: T; + UniUNIWETH: T; + UniUSDCWETH: T; + UniWBTCUSDC: T; + UniYFIWETH: T; } export type iAssetsWithoutETH = Omit, 'ETH'>; @@ -245,8 +257,20 @@ export type iUniswapPoolAssets = Pick< | 'UniUSDT' | 'UniWBTC' | 'UniWETH' - | 'UniWETHDAI' - | 'UniWETHWBTC' + | 'UniDAIWETH' + | 'UniWBTCWETH' + | 'UniAAVEWETH' + | 'UniBATWETH' + | 'UniUSDCDAI' + | 'UniCRVWETH' + | 'UniLINKWETH' + | 'UniMKRWETH' + | 'UniRENWETH' + | 'UniSNXWETH' + | 'UniUNIWETH' + | 'UniUSDCWETH' + | 'UniWBTCUSDC' + | 'UniYFIWETH' >; export type iMultiPoolsAssets = iAssetCommon | iAavePoolAssets; diff --git a/markets/aave/commons.ts b/markets/aave/commons.ts index 1d4b1e4a..beb0c88a 100644 --- a/markets/aave/commons.ts +++ b/markets/aave/commons.ts @@ -28,8 +28,20 @@ const MOCK_CHAINLINK_AGGREGATORS_PRICES = { UniUSDT: oneEther.multipliedBy('0.00369068412860').toFixed(), UniWBTC: oneEther.multipliedBy('47.332685').toFixed(), UniWETH: oneEther.toFixed(), - UniWETHDAI: oneEther.multipliedBy('22.407436').toFixed(), - UniWETHWBTC: oneEther.multipliedBy('22.407436').toFixed(), + UniDAIWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniWBTCWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniAAVEWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniBATWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniUSDCDAI: oneEther.multipliedBy('22.407436').toFixed(), + UniCRVWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniLINKWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniMKRWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniRENWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniSNXWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniUNIWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniUSDCWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniWBTCUSDC: oneEther.multipliedBy('22.407436').toFixed(), + UniYFIWETH: oneEther.multipliedBy('22.407436').toFixed(), USD: '5848466240000000', }; // ---------------- diff --git a/markets/uniswap/commons.ts b/markets/uniswap/commons.ts index db06cfa0..0aa7b4bc 100644 --- a/markets/uniswap/commons.ts +++ b/markets/uniswap/commons.ts @@ -28,8 +28,20 @@ const MOCK_CHAINLINK_AGGREGATORS_PRICES = { UniUSDT: oneEther.multipliedBy('0.00369068412860').toFixed(), UniWBTC: oneEther.multipliedBy('47.332685').toFixed(), UniWETH: oneEther.toFixed(), - UniWETHDAI: oneEther.multipliedBy('22.407436').toFixed(), - UniWETHWBTC: oneEther.multipliedBy('22.407436').toFixed(), + UniDAIWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniWBTCWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniAAVEWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniBATWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniUSDCDAI: oneEther.multipliedBy('22.407436').toFixed(), + UniCRVWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniLINKWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniMKRWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniRENWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniSNXWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniUNIWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniUSDCWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniWBTCUSDC: oneEther.multipliedBy('22.407436').toFixed(), + UniYFIWETH: oneEther.multipliedBy('22.407436').toFixed(), USD: '5848466240000000', }; // ---------------- @@ -74,10 +86,46 @@ export const CommonsConfig: ICommonConfiguration = { UniWBTC: { borrowRate: oneRay.multipliedBy(0.03).toFixed(), }, - UniWETHDAI: { + UniDAIWETH: { borrowRate: oneRay.multipliedBy(0.05).toFixed(), }, - UniWETHWBTC: { + UniWBTCWETH: { + borrowRate: oneRay.multipliedBy(0.05).toFixed(), + }, + UniAAVEWETH:{ + borrowRate: oneRay.multipliedBy(0.05).toFixed(), + }, + UniBATWETH: { + borrowRate: oneRay.multipliedBy(0.05).toFixed(), + }, + UniUSDCDAI: { + borrowRate: oneRay.multipliedBy(0.05).toFixed(), + }, + UniCRVWETH: { + borrowRate: oneRay.multipliedBy(0.05).toFixed(), + }, + UniLINKWETH: { + borrowRate: oneRay.multipliedBy(0.05).toFixed(), + }, + UniMKRWETH: { + borrowRate: oneRay.multipliedBy(0.05).toFixed(), + }, + UniRENWETH: { + borrowRate: oneRay.multipliedBy(0.05).toFixed(), + }, + UniSNXWETH: { + borrowRate: oneRay.multipliedBy(0.05).toFixed(), + }, + UniUNIWETH: { + borrowRate: oneRay.multipliedBy(0.05).toFixed(), + }, + UniUSDCWETH: { + borrowRate: oneRay.multipliedBy(0.05).toFixed(), + }, + UniWBTCUSDC: { + borrowRate: oneRay.multipliedBy(0.05).toFixed(), + }, + UniYFIWETH: { borrowRate: oneRay.multipliedBy(0.05).toFixed(), }, }, @@ -166,13 +214,25 @@ export const CommonsConfig: ICommonConfiguration = { [eEthereumNetwork.hardhat]: {}, [eEthereumNetwork.buidlerevm]: {}, [EthereumNetwork.kovan]: { - UniUSDT: ZERO_ADDRESS, - UniWBTC: ZERO_ADDRESS, - UniUSDC: ZERO_ADDRESS, - UniDAI:ZERO_ADDRESS, - UniWETHDAI: ZERO_ADDRESS, - UniWETHWBTC: ZERO_ADDRESS, - USD: '0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419', + UniUSDT: '0x0bF499444525a23E7Bb61997539725cA2e928138', + UniWBTC: '0xF7904a295A029a3aBDFFB6F12755974a958C7C25', + UniUSDC: '0x64EaC61A2DFda2c3Fa04eED49AA33D021AeC8838', + UniDAI:'0x22B58f1EbEDfCA50feF632bD73368b2FdA96D541', + UniDAIWETH: '0x90B86B501BF4d800a7F76E551952E214Cc58Fba3', // Mock oracles + UniWBTCWETH: '0x90B86B501BF4d800a7F76E551952E214Cc58Fba3', + UniAAVEWETH: '0x90B86B501BF4d800a7F76E551952E214Cc58Fba3', + UniBATWETH: '0x90B86B501BF4d800a7F76E551952E214Cc58Fba3', + UniUSDCDAI: '0x90B86B501BF4d800a7F76E551952E214Cc58Fba3', + UniCRVWETH: '0x90B86B501BF4d800a7F76E551952E214Cc58Fba3', + UniLINKWETH: '0x90B86B501BF4d800a7F76E551952E214Cc58Fba3', + UniMKRWETH: '0x90B86B501BF4d800a7F76E551952E214Cc58Fba3', + UniRENWETH: '0x90B86B501BF4d800a7F76E551952E214Cc58Fba3', + UniSNXWETH: '0x90B86B501BF4d800a7F76E551952E214Cc58Fba3', + UniUNIWETH: '0x90B86B501BF4d800a7F76E551952E214Cc58Fba3', + UniUSDCWETH: '0x90B86B501BF4d800a7F76E551952E214Cc58Fba3', + UniWBTCUSDC: '0x90B86B501BF4d800a7F76E551952E214Cc58Fba3', + UniYFIWETH: '0x90B86B501BF4d800a7F76E551952E214Cc58Fba3', + USD: '0x9326BFA02ADD2366b30bacB125260Af641031331', }, [EthereumNetwork.ropsten]: { }, @@ -181,8 +241,20 @@ export const CommonsConfig: ICommonConfiguration = { UniWBTC: '0xdeb288F737066589598e9214E782fa5A8eD689e8', UniUSDC: '0x986b5E1e1755e3C2440e960477f25201B0a8bbD4', UniDAI:'0x773616E4d11A78F511299002da57A0a94577F1f4', - UniWETHDAI: ZERO_ADDRESS, - UniWETHWBTC: ZERO_ADDRESS, + UniDAIWETH: ZERO_ADDRESS, + UniWBTCWETH: ZERO_ADDRESS, + UniAAVEWETH: ZERO_ADDRESS, + UniBATWETH: ZERO_ADDRESS, + UniUSDCDAI: ZERO_ADDRESS, + UniCRVWETH: ZERO_ADDRESS, + UniLINKWETH: ZERO_ADDRESS, + UniMKRWETH: ZERO_ADDRESS, + UniRENWETH: ZERO_ADDRESS, + UniSNXWETH: ZERO_ADDRESS, + UniUNIWETH: ZERO_ADDRESS, + UniUSDCWETH: ZERO_ADDRESS, + UniWBTCUSDC: ZERO_ADDRESS, + UniYFIWETH: ZERO_ADDRESS, USD: '0x9326BFA02ADD2366b30bacB125260Af641031331', }, [EthereumNetwork.tenderlyMain]: { @@ -190,8 +262,20 @@ export const CommonsConfig: ICommonConfiguration = { UniWBTC: '0xdeb288F737066589598e9214E782fa5A8eD689e8', UniUSDC: '0x986b5E1e1755e3C2440e960477f25201B0a8bbD4', UniDAI:'0x773616E4d11A78F511299002da57A0a94577F1f4', - UniWETHDAI: ZERO_ADDRESS, - UniWETHWBTC: ZERO_ADDRESS, + UniDAIWETH: ZERO_ADDRESS, + UniWBTCWETH: ZERO_ADDRESS, + UniAAVEWETH: ZERO_ADDRESS, + UniBATWETH: ZERO_ADDRESS, + UniUSDCDAI: ZERO_ADDRESS, + UniCRVWETH: ZERO_ADDRESS, + UniLINKWETH: ZERO_ADDRESS, + UniMKRWETH: ZERO_ADDRESS, + UniRENWETH: ZERO_ADDRESS, + UniSNXWETH: ZERO_ADDRESS, + UniUNIWETH: ZERO_ADDRESS, + UniUSDCWETH: ZERO_ADDRESS, + UniWBTCUSDC: ZERO_ADDRESS, + UniYFIWETH: ZERO_ADDRESS, USD: '0x9326BFA02ADD2366b30bacB125260Af641031331', }, }, diff --git a/markets/uniswap/index.ts b/markets/uniswap/index.ts index 0447ca15..55a5a15d 100644 --- a/markets/uniswap/index.ts +++ b/markets/uniswap/index.ts @@ -8,8 +8,20 @@ import { strategyUSDT, strategyWETH, strategyWBTC, - strategyWETHWBTC, - strategyWETHDAI + strategyWBTCWETH, + strategyDAIWETH, + strategyAAVEWETH, + strategyBATWETH, + strategyUSDCDAI, + strategyCRVWETH, + strategyLINKWETH, + strategyMKRWETH, + strategyRENWETH, + strategySNXWETH, + strategyUNIWETH, + strategyUSDCWETH, + strategyWBTCUSDC, + strategyYFIWETH, } from './reservesConfigs'; // ---------------- @@ -26,8 +38,20 @@ export const UniswapConfig: IUniswapConfiguration = { UniUSDC: strategyUSDC, UniUSDT: strategyUSDT, UniWBTC: strategyWBTC, - UniWETHDAI: strategyWETHDAI, - UniWETHWBTC: strategyWETHWBTC + UniDAIWETH: strategyDAIWETH, + UniWBTCWETH: strategyWBTCWETH, + UniAAVEWETH: strategyAAVEWETH, + UniBATWETH: strategyBATWETH, + UniUSDCDAI: strategyUSDCDAI, + UniCRVWETH: strategyCRVWETH, + UniLINKWETH: strategyLINKWETH, + UniMKRWETH: strategyMKRWETH, + UniRENWETH: strategyRENWETH, + UniSNXWETH: strategySNXWETH, + UniUNIWETH: strategyUNIWETH, + UniUSDCWETH: strategyUSDCWETH, + UniWBTCUSDC: strategyWBTCUSDC, + UniYFIWETH: strategyYFIWETH, }, ReserveAssets: { [eEthereumNetwork.buidlerevm]: {}, @@ -39,30 +63,11 @@ export const UniswapConfig: IUniswapConfiguration = { UniUSDT: '0x13512979ADE267AB5100878E2e0f485B568328a4', UniWBTC: '0xD1B98B6607330172f1D991521145A22BCe793277', UniWETH: '0xd0a1e359811322d97991e03f863a0c30c2cf029c', - UniWETHDAI: '0x7d3A67ab574abD3F9849e5fcDa48c19939d032b4', - uniWETHWBTC: '0x342e78bf229Cd2a750E80D7D7c2C185455979b91', + UniDAIWETH: '0x7d3A67ab574abD3F9849e5fcDa48c19939d032b4', + uniWBTCWETH: '0x342e78bf229Cd2a750E80D7D7c2C185455979b91', + // Other assets }, [EthereumNetwork.ropsten]: { - // AAVE: '', - // BAT: '0x85B24b3517E3aC7bf72a14516160541A60cFF19d', - // BUSD: '0xFA6adcFf6A90c11f31Bc9bb59eC0a6efB38381C6', - // DAI: '0xf80A32A835F79D7787E8a8ee5721D0fEaFd78108', - // ENJ: ZERO_ADDRESS, - // KNC: '0xCe4aA1dE3091033Ba74FA2Ad951f6adc5E5cF361', - // LINK: '0x1a906E71FF9e28d8E01460639EB8CF0a6f0e2486', - // MANA: '0x78b1F763857C8645E46eAdD9540882905ff32Db7', - // MKR: '0x2eA9df3bABe04451c9C3B06a2c844587c59d9C37', - // REN: ZERO_ADDRESS, - // SNX: '0xF80Aa7e2Fda4DA065C55B8061767F729dA1476c7', - // SUSD: '0xc374eB17f665914c714Ac4cdC8AF3a3474228cc5', - // TUSD: '0xa2EA00Df6d8594DBc76b79beFe22db9043b8896F', - // UNI: ZERO_ADDRESS, - // USDC: '0x851dEf71f0e6A903375C1e536Bd9ff1684BAD802', - // USDT: '0xB404c51BBC10dcBE948077F18a4B8E553D160084', - // WBTC: '0xa0E54Ab6AA5f0bf1D62EC3526436F3c05b3348A0', - // WETH: '0xc778417e063141139fce010982780140aa0cd5ab', - // YFI: ZERO_ADDRESS, - // ZRX: '0x02d7055704EfF050323A2E5ee4ba05DB2A588959', }, [EthereumNetwork.main]: { UniDAI: '0x6B175474E89094C44Da98b954EedeAC495271d0F', @@ -70,8 +75,20 @@ export const UniswapConfig: IUniswapConfiguration = { UniUSDT: '0xdAC17F958D2ee523a2206206994597C13D831ec7', UniWBTC: '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', UniWETH: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', - UniWETHDAI: '0xA478c2975Ab1Ea89e8196811F51A7B7Ade33eB11', - UniWETHWBTC: '0xBb2b8038a1640196FbE3e38816F3e67Cba72D940', + UniDAIWETH: '0xA478c2975Ab1Ea89e8196811F51A7B7Ade33eB11', + UniWBTCWETH: '0xBb2b8038a1640196FbE3e38816F3e67Cba72D940', + UniAAVEWETH: '0xDFC14d2Af169B0D36C4EFF567Ada9b2E0CAE044f', + UniBATWETH: '0xB6909B960DbbE7392D405429eB2b3649752b4838', + UniUSDCDAI: '0xAE461cA67B15dc8dc81CE7615e0320dA1A9aB8D5', + UniCRVWETH: '0x3dA1313aE46132A397D90d95B1424A9A7e3e0fCE', + UniLINKWETH: '0xa2107FA5B38d9bbd2C461D6EDf11B11A50F6b974', + UniMKRWETH: '0xC2aDdA861F89bBB333c90c492cB837741916A225', + UniRENWETH: '0x8Bd1661Da98EBDd3BD080F0bE4e6d9bE8cE9858c', + UniSNXWETH: '0x43AE24960e5534731Fc831386c07755A2dc33D47', + UniUNIWETH: '0xd3d2E2692501A5c9Ca623199D38826e513033a17', + UniUSDCWETH: '0xB4e16d0168e52d35CaCD2c6185b44281Ec28C9Dc', + UniWBTCUSDC: '0x004375Dff511095CC5A197A54140a24eFEF3A416', + UniYFIWETH: '0x2fDbAdf3C4D5A8666Bc06645B8358ab803996E28', }, [EthereumNetwork.tenderlyMain]: { DAI: '0x6B175474E89094C44Da98b954EedeAC495271d0F', @@ -79,8 +96,6 @@ export const UniswapConfig: IUniswapConfiguration = { USDT: '0xdAC17F958D2ee523a2206206994597C13D831ec7', WBTC: '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', WETH: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', - WETHDAI: '0xA478c2975Ab1Ea89e8196811F51A7B7Ade33eB11', - WETHWBTC: '0xBb2b8038a1640196FbE3e38816F3e67Cba72D940', }, }, }; diff --git a/markets/uniswap/reservesConfigs.ts b/markets/uniswap/reservesConfigs.ts index caeaba46..aed62b2d 100644 --- a/markets/uniswap/reservesConfigs.ts +++ b/markets/uniswap/reservesConfigs.ts @@ -87,24 +87,92 @@ export const strategyUSDT: IReserveParams = { reserveFactor: '1000' }; -export const strategyWETHDAI: IReserveParams = { +export const strategyDAIWETH: IReserveParams = { optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), baseVariableBorrowRate: '0', variableRateSlope1: '0', variableRateSlope2: '0', stableRateSlope1: '0', stableRateSlope2: '0', - baseLTVAsCollateral: '5000', - liquidationThreshold: '6500', - liquidationBonus: '11000', - borrowingEnabled: true, - stableBorrowRateEnabled: true, + baseLTVAsCollateral: '6000', + liquidationThreshold: '7000', + liquidationBonus: '11500', + borrowingEnabled: false, + stableBorrowRateEnabled: false, reserveDecimals: '18', aTokenImpl: eContractid.AToken, - reserveFactor: '1000' + reserveFactor: '0' }; -export const strategyWETHWBTC: IReserveParams = { +export const strategyWBTCWETH: IReserveParams = { + optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: '0', + variableRateSlope1: '0', + variableRateSlope2: '0', + stableRateSlope1: '0', + stableRateSlope2: '0', + baseLTVAsCollateral: '6000', + liquidationThreshold: '7000', + liquidationBonus: '11500', + borrowingEnabled: false, + stableBorrowRateEnabled: false, + reserveDecimals: '18', + aTokenImpl: eContractid.AToken, + reserveFactor: '0' +}; + +export const strategyAAVEWETH: IReserveParams = { + optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: '0', + variableRateSlope1: '0', + variableRateSlope2: '0', + stableRateSlope1: '0', + stableRateSlope2: '0', + baseLTVAsCollateral: '6000', + liquidationThreshold: '7000', + liquidationBonus: '11500', + borrowingEnabled: false, + stableBorrowRateEnabled: false, + reserveDecimals: '18', + aTokenImpl: eContractid.AToken, + reserveFactor: '0' +}; + +export const strategyBATWETH: IReserveParams = { + optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: '0', + variableRateSlope1: '0', + variableRateSlope2: '0', + stableRateSlope1: '0', + stableRateSlope2: '0', + baseLTVAsCollateral: '6000', + liquidationThreshold: '7000', + liquidationBonus: '11500', + borrowingEnabled: false, + stableBorrowRateEnabled: false, + reserveDecimals: '18', + aTokenImpl: eContractid.AToken, + reserveFactor: '0' +}; + +export const strategyUSDCDAI: IReserveParams = { + optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: '0', + variableRateSlope1: '0', + variableRateSlope2: '0', + stableRateSlope1: '0', + stableRateSlope2: '0', + baseLTVAsCollateral: '6000', + liquidationThreshold: '7000', + liquidationBonus: '11500', + borrowingEnabled: false, + stableBorrowRateEnabled: false, + reserveDecimals: '18', + aTokenImpl: eContractid.AToken, + reserveFactor: '0' +}; + +export const strategyCRVWETH: IReserveParams = { optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), baseVariableBorrowRate: '0', variableRateSlope1: '0', @@ -112,11 +180,147 @@ export const strategyWETHWBTC: IReserveParams = { stableRateSlope1: '0', stableRateSlope2: '0', baseLTVAsCollateral: '5000', - liquidationThreshold: '6500', - liquidationBonus: '11000', - borrowingEnabled: true, - stableBorrowRateEnabled: true, + liquidationThreshold: '6000', + liquidationBonus: '11500', + borrowingEnabled: false, + stableBorrowRateEnabled: false, reserveDecimals: '18', aTokenImpl: eContractid.AToken, - reserveFactor: '1000' + reserveFactor: '0' +}; + +export const strategyLINKWETH: IReserveParams = { + optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: '0', + variableRateSlope1: '0', + variableRateSlope2: '0', + stableRateSlope1: '0', + stableRateSlope2: '0', + baseLTVAsCollateral: '6000', + liquidationThreshold: '7000', + liquidationBonus: '11500', + borrowingEnabled: false, + stableBorrowRateEnabled: false, + reserveDecimals: '18', + aTokenImpl: eContractid.AToken, + reserveFactor: '0' +}; + +export const strategyMKRWETH: IReserveParams = { + optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: '0', + variableRateSlope1: '0', + variableRateSlope2: '0', + stableRateSlope1: '0', + stableRateSlope2: '0', + baseLTVAsCollateral: '6000', + liquidationThreshold: '7000', + liquidationBonus: '11500', + borrowingEnabled: false, + stableBorrowRateEnabled: false, + reserveDecimals: '18', + aTokenImpl: eContractid.AToken, + reserveFactor: '0' +}; + +export const strategyRENWETH: IReserveParams = { + optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: '0', + variableRateSlope1: '0', + variableRateSlope2: '0', + stableRateSlope1: '0', + stableRateSlope2: '0', + baseLTVAsCollateral: '6000', + liquidationThreshold: '7000', + liquidationBonus: '11500', + borrowingEnabled: false, + stableBorrowRateEnabled: false, + reserveDecimals: '18', + aTokenImpl: eContractid.AToken, + reserveFactor: '0' +}; + +export const strategySNXWETH: IReserveParams = { + optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: '0', + variableRateSlope1: '0', + variableRateSlope2: '0', + stableRateSlope1: '0', + stableRateSlope2: '0', + baseLTVAsCollateral: '4000', + liquidationThreshold: '6000', + liquidationBonus: '11500', + borrowingEnabled: false, + stableBorrowRateEnabled: false, + reserveDecimals: '18', + aTokenImpl: eContractid.AToken, + reserveFactor: '0' +}; + +export const strategyUNIWETH: IReserveParams = { + optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: '0', + variableRateSlope1: '0', + variableRateSlope2: '0', + stableRateSlope1: '0', + stableRateSlope2: '0', + baseLTVAsCollateral: '6000', + liquidationThreshold: '7000', + liquidationBonus: '11500', + borrowingEnabled: false, + stableBorrowRateEnabled: false, + reserveDecimals: '18', + aTokenImpl: eContractid.AToken, + reserveFactor: '0' +}; + +export const strategyUSDCWETH: IReserveParams = { + optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: '0', + variableRateSlope1: '0', + variableRateSlope2: '0', + stableRateSlope1: '0', + stableRateSlope2: '0', + baseLTVAsCollateral: '6000', + liquidationThreshold: '7000', + liquidationBonus: '11500', + borrowingEnabled: false, + stableBorrowRateEnabled: false, + reserveDecimals: '18', + aTokenImpl: eContractid.AToken, + reserveFactor: '0' +}; + +export const strategyWBTCUSDC: IReserveParams = { + optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: '0', + variableRateSlope1: '0', + variableRateSlope2: '0', + stableRateSlope1: '0', + stableRateSlope2: '0', + baseLTVAsCollateral: '6000', + liquidationThreshold: '7000', + liquidationBonus: '11500', + borrowingEnabled: false, + stableBorrowRateEnabled: false, + reserveDecimals: '18', + aTokenImpl: eContractid.AToken, + reserveFactor: '0' +}; + +export const strategyYFIWETH: IReserveParams = { + optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: '0', + variableRateSlope1: '0', + variableRateSlope2: '0', + stableRateSlope1: '0', + stableRateSlope2: '0', + baseLTVAsCollateral: '5000', + liquidationThreshold: '6000', + liquidationBonus: '11500', + borrowingEnabled: false, + stableBorrowRateEnabled: false, + reserveDecimals: '18', + aTokenImpl: eContractid.AToken, + reserveFactor: '0' }; \ No newline at end of file From 073b30d8c9373a34afd4e0e286180b2a0918d6a0 Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Wed, 20 Jan 2021 21:44:19 -0500 Subject: [PATCH 22/31] Added assets & fixed test --- helpers/types.ts | 19 +++++ markets/uniswap/commons.ts | 2 +- markets/uniswap/reservesConfigs.ts | 132 ++++++++++++++--------------- tasks/dev/4_oracles.ts | 1 - test/__setup.spec.ts | 21 ++++- 5 files changed, 105 insertions(+), 70 deletions(-) diff --git a/helpers/types.ts b/helpers/types.ts index 0a2b7194..79511ee3 100644 --- a/helpers/types.ts +++ b/helpers/types.ts @@ -301,6 +301,25 @@ export enum TokenContractId { YFI = 'YFI', UNI = 'UNI', ENJ = 'ENJ', + UniWETH = 'UniWETH', + UniWBTC = 'UniWBTC', + UniDAI = 'UniDAI', + UniUSDC = 'UniUSDC', + UniUSDT = 'UniUSDT', + UniDAIWETH = 'UniDAIWETH', + UniWBTCWETH = 'UniWBTCWETH', + UniAAVEWETH = 'UniAAVEWETH', + UniBATWETH = 'UniBATWETH', + UniUSDCDAI = 'UniUSDCDAI', + UniCRVWETH = 'UniCRVWETH', + UniLINKWETH = 'UniLINKWETH', + UniMKRWETH = 'UniMKRWETH', + UniRENWETH = 'UniRENWETH', + UniSNXWETH = 'UniSNXWETH', + UniUNIWETH = 'UniUNIWETH', + UniUSDCWETH = 'UniUSDCWETH', + UniWBTCUSDC = 'UniWBTCUSDC', + UniYFIWETH = 'UniYFIWETH', } export interface IReserveParams extends IReserveBorrowParams, IReserveCollateralParams { diff --git a/markets/uniswap/commons.ts b/markets/uniswap/commons.ts index 0aa7b4bc..b037f859 100644 --- a/markets/uniswap/commons.ts +++ b/markets/uniswap/commons.ts @@ -241,7 +241,7 @@ export const CommonsConfig: ICommonConfiguration = { UniWBTC: '0xdeb288F737066589598e9214E782fa5A8eD689e8', UniUSDC: '0x986b5E1e1755e3C2440e960477f25201B0a8bbD4', UniDAI:'0x773616E4d11A78F511299002da57A0a94577F1f4', - UniDAIWETH: ZERO_ADDRESS, + UniDAIWETH: '0xf4071801C4421Db7e63DaC15B9432e50C44a7F42', UniWBTCWETH: ZERO_ADDRESS, UniAAVEWETH: ZERO_ADDRESS, UniBATWETH: ZERO_ADDRESS, diff --git a/markets/uniswap/reservesConfigs.ts b/markets/uniswap/reservesConfigs.ts index aed62b2d..84ab8317 100644 --- a/markets/uniswap/reservesConfigs.ts +++ b/markets/uniswap/reservesConfigs.ts @@ -13,7 +13,7 @@ export const strategyWETH: IReserveParams = { liquidationThreshold: '8250', liquidationBonus: '10500', borrowingEnabled: true, - stableBorrowRateEnabled: true, + stableBorrowRateEnabled: false, reserveDecimals: '18', aTokenImpl: eContractid.AToken, reserveFactor: '1000' @@ -21,7 +21,7 @@ export const strategyWETH: IReserveParams = { export const strategyWBTC: IReserveParams = { optimalUtilizationRate: new BigNumber(0.65).multipliedBy(oneRay).toFixed(), - baseVariableBorrowRate: '0', + baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(), variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(), variableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(), stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(), @@ -30,7 +30,7 @@ export const strategyWBTC: IReserveParams = { liquidationThreshold: '7500', liquidationBonus: '11000', borrowingEnabled: true, - stableBorrowRateEnabled: true, + stableBorrowRateEnabled: false, reserveDecimals: '8', aTokenImpl: eContractid.AToken, reserveFactor: '2000' @@ -47,51 +47,51 @@ export const strategyDAI: IReserveParams = { liquidationThreshold: '8000', liquidationBonus: '10500', borrowingEnabled: true, - stableBorrowRateEnabled: true, + stableBorrowRateEnabled: false, reserveDecimals: '18', aTokenImpl: eContractid.AToken, reserveFactor: '1000' }; export const strategyUSDC: IReserveParams = { - optimalUtilizationRate: new BigNumber(0.9).multipliedBy(oneRay).toFixed(), + optimalUtilizationRate: new BigNumber(0.8).multipliedBy(oneRay).toFixed(), baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(), variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(), - variableRateSlope2: new BigNumber(0.60).multipliedBy(oneRay).toFixed(), + variableRateSlope2: new BigNumber(0.75).multipliedBy(oneRay).toFixed(), stableRateSlope1: new BigNumber(0.02).multipliedBy(oneRay).toFixed(), stableRateSlope2: new BigNumber(0.60).multipliedBy(oneRay).toFixed(), baseLTVAsCollateral: '8000', liquidationThreshold: '8500', liquidationBonus: '10500', borrowingEnabled: true, - stableBorrowRateEnabled: true, + stableBorrowRateEnabled: false, reserveDecimals: '6', aTokenImpl: eContractid.AToken, reserveFactor: '1000' }; export const strategyUSDT: IReserveParams = { - optimalUtilizationRate: new BigNumber(0.9).multipliedBy(oneRay).toFixed(), + optimalUtilizationRate: new BigNumber(0.8).multipliedBy(oneRay).toFixed(), baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(), variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(), - variableRateSlope2: new BigNumber(0.60).multipliedBy(oneRay).toFixed(), + variableRateSlope2: new BigNumber(0.75).multipliedBy(oneRay).toFixed(), stableRateSlope1: new BigNumber(0.02).multipliedBy(oneRay).toFixed(), stableRateSlope2: new BigNumber(0.60).multipliedBy(oneRay).toFixed(), baseLTVAsCollateral: '8000', liquidationThreshold: '8500', liquidationBonus: '10500', borrowingEnabled: true, - stableBorrowRateEnabled: true, + stableBorrowRateEnabled: false, reserveDecimals: '6', aTokenImpl: eContractid.AToken, reserveFactor: '1000' }; export const strategyDAIWETH: IReserveParams = { - optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), - baseVariableBorrowRate: '0', - variableRateSlope1: '0', - variableRateSlope2: '0', + optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(), + variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(), + variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(), stableRateSlope1: '0', stableRateSlope2: '0', baseLTVAsCollateral: '6000', @@ -105,10 +105,10 @@ export const strategyDAIWETH: IReserveParams = { }; export const strategyWBTCWETH: IReserveParams = { - optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), - baseVariableBorrowRate: '0', - variableRateSlope1: '0', - variableRateSlope2: '0', + optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(), + variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(), + variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(), stableRateSlope1: '0', stableRateSlope2: '0', baseLTVAsCollateral: '6000', @@ -122,10 +122,10 @@ export const strategyWBTCWETH: IReserveParams = { }; export const strategyAAVEWETH: IReserveParams = { - optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), - baseVariableBorrowRate: '0', - variableRateSlope1: '0', - variableRateSlope2: '0', + optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(), + variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(), + variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(), stableRateSlope1: '0', stableRateSlope2: '0', baseLTVAsCollateral: '6000', @@ -139,10 +139,10 @@ export const strategyAAVEWETH: IReserveParams = { }; export const strategyBATWETH: IReserveParams = { - optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), - baseVariableBorrowRate: '0', - variableRateSlope1: '0', - variableRateSlope2: '0', + optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(), + variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(), + variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(), stableRateSlope1: '0', stableRateSlope2: '0', baseLTVAsCollateral: '6000', @@ -156,10 +156,10 @@ export const strategyBATWETH: IReserveParams = { }; export const strategyUSDCDAI: IReserveParams = { - optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), - baseVariableBorrowRate: '0', - variableRateSlope1: '0', - variableRateSlope2: '0', + optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(), + variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(), + variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(), stableRateSlope1: '0', stableRateSlope2: '0', baseLTVAsCollateral: '6000', @@ -173,10 +173,10 @@ export const strategyUSDCDAI: IReserveParams = { }; export const strategyCRVWETH: IReserveParams = { - optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), - baseVariableBorrowRate: '0', - variableRateSlope1: '0', - variableRateSlope2: '0', + optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(), + variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(), + variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(), stableRateSlope1: '0', stableRateSlope2: '0', baseLTVAsCollateral: '5000', @@ -190,10 +190,10 @@ export const strategyCRVWETH: IReserveParams = { }; export const strategyLINKWETH: IReserveParams = { - optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), - baseVariableBorrowRate: '0', - variableRateSlope1: '0', - variableRateSlope2: '0', + optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(), + variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(), + variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(), stableRateSlope1: '0', stableRateSlope2: '0', baseLTVAsCollateral: '6000', @@ -207,10 +207,10 @@ export const strategyLINKWETH: IReserveParams = { }; export const strategyMKRWETH: IReserveParams = { - optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), - baseVariableBorrowRate: '0', - variableRateSlope1: '0', - variableRateSlope2: '0', + optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(), + variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(), + variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(), stableRateSlope1: '0', stableRateSlope2: '0', baseLTVAsCollateral: '6000', @@ -224,10 +224,10 @@ export const strategyMKRWETH: IReserveParams = { }; export const strategyRENWETH: IReserveParams = { - optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), - baseVariableBorrowRate: '0', - variableRateSlope1: '0', - variableRateSlope2: '0', + optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(), + variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(), + variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(), stableRateSlope1: '0', stableRateSlope2: '0', baseLTVAsCollateral: '6000', @@ -241,10 +241,10 @@ export const strategyRENWETH: IReserveParams = { }; export const strategySNXWETH: IReserveParams = { - optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), - baseVariableBorrowRate: '0', - variableRateSlope1: '0', - variableRateSlope2: '0', + optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(), + variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(), + variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(), stableRateSlope1: '0', stableRateSlope2: '0', baseLTVAsCollateral: '4000', @@ -258,10 +258,10 @@ export const strategySNXWETH: IReserveParams = { }; export const strategyUNIWETH: IReserveParams = { - optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), - baseVariableBorrowRate: '0', - variableRateSlope1: '0', - variableRateSlope2: '0', + optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(), + variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(), + variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(), stableRateSlope1: '0', stableRateSlope2: '0', baseLTVAsCollateral: '6000', @@ -275,10 +275,10 @@ export const strategyUNIWETH: IReserveParams = { }; export const strategyUSDCWETH: IReserveParams = { - optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), - baseVariableBorrowRate: '0', - variableRateSlope1: '0', - variableRateSlope2: '0', + optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(), + variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(), + variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(), stableRateSlope1: '0', stableRateSlope2: '0', baseLTVAsCollateral: '6000', @@ -292,10 +292,10 @@ export const strategyUSDCWETH: IReserveParams = { }; export const strategyWBTCUSDC: IReserveParams = { - optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), - baseVariableBorrowRate: '0', - variableRateSlope1: '0', - variableRateSlope2: '0', + optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(), + variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(), + variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(), stableRateSlope1: '0', stableRateSlope2: '0', baseLTVAsCollateral: '6000', @@ -309,10 +309,10 @@ export const strategyWBTCUSDC: IReserveParams = { }; export const strategyYFIWETH: IReserveParams = { - optimalUtilizationRate: new BigNumber(0.6).multipliedBy(oneRay).toFixed(), - baseVariableBorrowRate: '0', - variableRateSlope1: '0', - variableRateSlope2: '0', + optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(), + variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(), + variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(), stableRateSlope1: '0', stableRateSlope2: '0', baseLTVAsCollateral: '5000', diff --git a/tasks/dev/4_oracles.ts b/tasks/dev/4_oracles.ts index 97f14c8a..82380b01 100644 --- a/tasks/dev/4_oracles.ts +++ b/tasks/dev/4_oracles.ts @@ -4,7 +4,6 @@ import { deployAaveOracle, deployLendingRateOracle, } from '../../helpers/contracts-deployments'; - import { setInitialAssetPricesInOracle, deployAllMockAggregators, diff --git a/test/__setup.spec.ts b/test/__setup.spec.ts index 7d2bb638..a8aa9854 100644 --- a/test/__setup.spec.ts +++ b/test/__setup.spec.ts @@ -159,8 +159,25 @@ const buildTestEnv = async (deployer: Signer, secondaryWallet: Signer) => { REN: mockTokens.REN.address, UNI: mockTokens.UNI.address, ENJ: mockTokens.ENJ.address, - WETHDAI: mockTokens.WETHDAI.address, - WETHWBTC: mockTokens.WETHWBTC.address, + UniDAI: mockTokens.UniDAI.address, + UniUSDC: mockTokens.UniUSDC.address, + UniUSDT: mockTokens.UniUSDT.address, + UniWBTC: mockTokens.UniWBTC.address, + UniWETH: mockTokens.UniWETH.address, + UniDAIWETH: mockTokens.UniDAIWETH.address, + UniWBTCWETH: mockTokens.UniWBTCWETH.address, + UniAAVEWETH: mockTokens.UniAAVEWETH.address, + UniBATWETH: mockTokens.UniBATWETH.address, + UniUSDCDAI: mockTokens.UniUSDCDAI.address, + UniCRVWETH: mockTokens.UniCRVWETH.address, + UniLINKWETH: mockTokens.UniLINKWETH.address, + UniMKRWETH: mockTokens.UniMKRWETH.address, + UniRENWETH: mockTokens.UniRENWETH.address, + UniSNXWETH: mockTokens.UniSNXWETH.address, + UniUNIWETH: mockTokens.UniUNIWETH.address, + UniUSDCWETH: mockTokens.UniUSDCWETH.address, + UniWBTCUSDC: mockTokens.UniWBTCUSDC.address, + UniYFIWETH: mockTokens.UniYFIWETH.address, USD: USD_ADDRESS, }, fallbackOracle From 5146efbaec429ad453e72526fe258a6fc4fda7f1 Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Thu, 28 Jan 2021 22:06:09 -0500 Subject: [PATCH 23/31] Added agreed upon market parameters --- markets/uniswap/reservesConfigs.ts | 58 +++++++++++++++--------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/markets/uniswap/reservesConfigs.ts b/markets/uniswap/reservesConfigs.ts index 84ab8317..acd09475 100644 --- a/markets/uniswap/reservesConfigs.ts +++ b/markets/uniswap/reservesConfigs.ts @@ -23,7 +23,7 @@ export const strategyWBTC: IReserveParams = { optimalUtilizationRate: new BigNumber(0.65).multipliedBy(oneRay).toFixed(), baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(), variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(), - variableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(), + variableRateSlope2: new BigNumber(1).multipliedBy(oneRay).toFixed(), stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(), stableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(), baseLTVAsCollateral: '7000', @@ -97,11 +97,11 @@ export const strategyDAIWETH: IReserveParams = { baseLTVAsCollateral: '6000', liquidationThreshold: '7000', liquidationBonus: '11500', - borrowingEnabled: false, + borrowingEnabled: true, stableBorrowRateEnabled: false, reserveDecimals: '18', aTokenImpl: eContractid.AToken, - reserveFactor: '0' + reserveFactor: '500' }; export const strategyWBTCWETH: IReserveParams = { @@ -114,11 +114,11 @@ export const strategyWBTCWETH: IReserveParams = { baseLTVAsCollateral: '6000', liquidationThreshold: '7000', liquidationBonus: '11500', - borrowingEnabled: false, + borrowingEnabled: true, stableBorrowRateEnabled: false, reserveDecimals: '18', aTokenImpl: eContractid.AToken, - reserveFactor: '0' + reserveFactor: '1500' }; export const strategyAAVEWETH: IReserveParams = { @@ -131,11 +131,11 @@ export const strategyAAVEWETH: IReserveParams = { baseLTVAsCollateral: '6000', liquidationThreshold: '7000', liquidationBonus: '11500', - borrowingEnabled: false, + borrowingEnabled: true, stableBorrowRateEnabled: false, reserveDecimals: '18', aTokenImpl: eContractid.AToken, - reserveFactor: '0' + reserveFactor: '500' }; export const strategyBATWETH: IReserveParams = { @@ -148,11 +148,11 @@ export const strategyBATWETH: IReserveParams = { baseLTVAsCollateral: '6000', liquidationThreshold: '7000', liquidationBonus: '11500', - borrowingEnabled: false, + borrowingEnabled: true, stableBorrowRateEnabled: false, reserveDecimals: '18', aTokenImpl: eContractid.AToken, - reserveFactor: '0' + reserveFactor: '1500' }; export const strategyUSDCDAI: IReserveParams = { @@ -165,11 +165,11 @@ export const strategyUSDCDAI: IReserveParams = { baseLTVAsCollateral: '6000', liquidationThreshold: '7000', liquidationBonus: '11500', - borrowingEnabled: false, + borrowingEnabled: true, stableBorrowRateEnabled: false, reserveDecimals: '18', aTokenImpl: eContractid.AToken, - reserveFactor: '0' + reserveFactor: '1000' }; export const strategyCRVWETH: IReserveParams = { @@ -182,11 +182,11 @@ export const strategyCRVWETH: IReserveParams = { baseLTVAsCollateral: '5000', liquidationThreshold: '6000', liquidationBonus: '11500', - borrowingEnabled: false, + borrowingEnabled: true, stableBorrowRateEnabled: false, reserveDecimals: '18', aTokenImpl: eContractid.AToken, - reserveFactor: '0' + reserveFactor: '500' }; export const strategyLINKWETH: IReserveParams = { @@ -199,11 +199,11 @@ export const strategyLINKWETH: IReserveParams = { baseLTVAsCollateral: '6000', liquidationThreshold: '7000', liquidationBonus: '11500', - borrowingEnabled: false, + borrowingEnabled: true, stableBorrowRateEnabled: false, reserveDecimals: '18', aTokenImpl: eContractid.AToken, - reserveFactor: '0' + reserveFactor: '1500' }; export const strategyMKRWETH: IReserveParams = { @@ -216,11 +216,11 @@ export const strategyMKRWETH: IReserveParams = { baseLTVAsCollateral: '6000', liquidationThreshold: '7000', liquidationBonus: '11500', - borrowingEnabled: false, + borrowingEnabled: true, stableBorrowRateEnabled: false, reserveDecimals: '18', aTokenImpl: eContractid.AToken, - reserveFactor: '0' + reserveFactor: '1500' }; export const strategyRENWETH: IReserveParams = { @@ -233,11 +233,11 @@ export const strategyRENWETH: IReserveParams = { baseLTVAsCollateral: '6000', liquidationThreshold: '7000', liquidationBonus: '11500', - borrowingEnabled: false, + borrowingEnabled: true, stableBorrowRateEnabled: false, reserveDecimals: '18', aTokenImpl: eContractid.AToken, - reserveFactor: '0' + reserveFactor: '1500' }; export const strategySNXWETH: IReserveParams = { @@ -250,11 +250,11 @@ export const strategySNXWETH: IReserveParams = { baseLTVAsCollateral: '4000', liquidationThreshold: '6000', liquidationBonus: '11500', - borrowingEnabled: false, + borrowingEnabled: true, stableBorrowRateEnabled: false, reserveDecimals: '18', aTokenImpl: eContractid.AToken, - reserveFactor: '0' + reserveFactor: '2000' }; export const strategyUNIWETH: IReserveParams = { @@ -267,11 +267,11 @@ export const strategyUNIWETH: IReserveParams = { baseLTVAsCollateral: '6000', liquidationThreshold: '7000', liquidationBonus: '11500', - borrowingEnabled: false, + borrowingEnabled: true, stableBorrowRateEnabled: false, reserveDecimals: '18', aTokenImpl: eContractid.AToken, - reserveFactor: '0' + reserveFactor: '1500' }; export const strategyUSDCWETH: IReserveParams = { @@ -284,11 +284,11 @@ export const strategyUSDCWETH: IReserveParams = { baseLTVAsCollateral: '6000', liquidationThreshold: '7000', liquidationBonus: '11500', - borrowingEnabled: false, + borrowingEnabled: true, stableBorrowRateEnabled: false, reserveDecimals: '18', aTokenImpl: eContractid.AToken, - reserveFactor: '0' + reserveFactor: '1000' }; export const strategyWBTCUSDC: IReserveParams = { @@ -301,11 +301,11 @@ export const strategyWBTCUSDC: IReserveParams = { baseLTVAsCollateral: '6000', liquidationThreshold: '7000', liquidationBonus: '11500', - borrowingEnabled: false, + borrowingEnabled: true, stableBorrowRateEnabled: false, reserveDecimals: '18', aTokenImpl: eContractid.AToken, - reserveFactor: '0' + reserveFactor: '1500' }; export const strategyYFIWETH: IReserveParams = { @@ -318,9 +318,9 @@ export const strategyYFIWETH: IReserveParams = { baseLTVAsCollateral: '5000', liquidationThreshold: '6000', liquidationBonus: '11500', - borrowingEnabled: false, + borrowingEnabled: true, stableBorrowRateEnabled: false, reserveDecimals: '18', aTokenImpl: eContractid.AToken, - reserveFactor: '0' + reserveFactor: '1500' }; \ No newline at end of file From b4d72bfc374cf23dc93f8d01174a89709a2816f9 Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Fri, 29 Jan 2021 22:51:59 -0500 Subject: [PATCH 24/31] Pulled contracts for light deployment --- contracts/adapters/BaseUniswapAdapter.sol | 534 ++++++++++++++++++ .../adapters/UniswapLiquiditySwapAdapter.sol | 280 +++++++++ contracts/adapters/UniswapRepayAdapter.sol | 259 +++++++++ .../interfaces/IBaseUniswapAdapter.sol | 90 +++ .../deployments/ATokensAndRatesHelper.sol | 103 ++-- .../StableAndVariableTokensHelper.sol | 27 +- contracts/interfaces/IAToken.sol | 9 +- contracts/interfaces/IERC20WithPermit.sol | 16 + contracts/interfaces/IInitializableAToken.sol | 32 ++ .../interfaces/IInitializableDebtToken.sol | 30 + .../interfaces/ILendingPoolConfigurator.sol | 176 ++++++ contracts/interfaces/IStableDebtToken.sol | 10 +- contracts/interfaces/IUniswapV2Router02.sol | 24 + contracts/interfaces/IVariableDebtToken.sol | 9 +- .../mocks/swap/MockUniswapV2Router02.sol | 106 ++++ contracts/mocks/upgradeability/MockAToken.sol | 32 +- .../upgradeability/MockStableDebtToken.sol | 11 - .../upgradeability/MockVariableDebtToken.sol | 17 - .../protocol/lendingpool/LendingPool.sol | 46 +- .../lendingpool/LendingPoolConfigurator.sol | 374 +++++------- .../lendingpool/LendingPoolStorage.sol | 6 + .../libraries/logic/ValidationLogic.sol | 9 +- contracts/protocol/tokenization/AToken.sol | 133 +++-- .../tokenization/DelegationAwareAToken.sol | 23 +- .../tokenization/IncentivizedERC20.sol | 28 +- .../protocol/tokenization/StableDebtToken.sol | 78 ++- .../tokenization/VariableDebtToken.sol | 74 ++- .../tokenization/base/DebtTokenBase.sol | 46 +- 28 files changed, 2051 insertions(+), 531 deletions(-) create mode 100644 contracts/adapters/BaseUniswapAdapter.sol create mode 100644 contracts/adapters/UniswapLiquiditySwapAdapter.sol create mode 100644 contracts/adapters/UniswapRepayAdapter.sol create mode 100644 contracts/adapters/interfaces/IBaseUniswapAdapter.sol create mode 100644 contracts/interfaces/IERC20WithPermit.sol create mode 100644 contracts/interfaces/IInitializableAToken.sol create mode 100644 contracts/interfaces/IInitializableDebtToken.sol create mode 100644 contracts/interfaces/ILendingPoolConfigurator.sol create mode 100644 contracts/interfaces/IUniswapV2Router02.sol create mode 100644 contracts/mocks/swap/MockUniswapV2Router02.sol diff --git a/contracts/adapters/BaseUniswapAdapter.sol b/contracts/adapters/BaseUniswapAdapter.sol new file mode 100644 index 00000000..b04bc8a1 --- /dev/null +++ b/contracts/adapters/BaseUniswapAdapter.sol @@ -0,0 +1,534 @@ +// SPDX-License-Identifier: agpl-3.0 +pragma solidity 0.6.12; +pragma experimental ABIEncoderV2; + +import {PercentageMath} from '../protocol/libraries/math/PercentageMath.sol'; +import {SafeMath} from '../dependencies/openzeppelin/contracts/SafeMath.sol'; +import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol'; +import {IERC20Detailed} from '../dependencies/openzeppelin/contracts/IERC20Detailed.sol'; +import {SafeERC20} from '../dependencies/openzeppelin/contracts/SafeERC20.sol'; +import {Ownable} from '../dependencies/openzeppelin/contracts/Ownable.sol'; +import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol'; +import {DataTypes} from '../protocol/libraries/types/DataTypes.sol'; +import {IUniswapV2Router02} from '../interfaces/IUniswapV2Router02.sol'; +import {IPriceOracleGetter} from '../interfaces/IPriceOracleGetter.sol'; +import {IERC20WithPermit} from '../interfaces/IERC20WithPermit.sol'; +import {FlashLoanReceiverBase} from '../flashloan/base/FlashLoanReceiverBase.sol'; +import {IBaseUniswapAdapter} from './interfaces/IBaseUniswapAdapter.sol'; + +/** + * @title BaseUniswapAdapter + * @notice Implements the logic for performing assets swaps in Uniswap V2 + * @author Aave + **/ +abstract contract BaseUniswapAdapter is FlashLoanReceiverBase, IBaseUniswapAdapter, Ownable { + using SafeMath for uint256; + using PercentageMath for uint256; + using SafeERC20 for IERC20; + + // Max slippage percent allowed + uint256 public constant override MAX_SLIPPAGE_PERCENT = 3000; // 30% + // FLash Loan fee set in lending pool + uint256 public constant override FLASHLOAN_PREMIUM_TOTAL = 9; + // USD oracle asset address + address public constant override USD_ADDRESS = 0x10F7Fc1F91Ba351f9C629c5947AD69bD03C05b96; + + address public immutable override WETH_ADDRESS; + IPriceOracleGetter public immutable override ORACLE; + IUniswapV2Router02 public immutable override UNISWAP_ROUTER; + + constructor( + ILendingPoolAddressesProvider addressesProvider, + IUniswapV2Router02 uniswapRouter, + address wethAddress + ) public FlashLoanReceiverBase(addressesProvider) { + ORACLE = IPriceOracleGetter(addressesProvider.getPriceOracle()); + UNISWAP_ROUTER = uniswapRouter; + WETH_ADDRESS = wethAddress; + } + + /** + * @dev Given an input asset amount, returns the maximum output amount of the other asset and the prices + * @param amountIn Amount of reserveIn + * @param reserveIn Address of the asset to be swap from + * @param reserveOut Address of the asset to be swap to + * @return uint256 Amount out of the reserveOut + * @return uint256 The price of out amount denominated in the reserveIn currency (18 decimals) + * @return uint256 In amount of reserveIn value denominated in USD (8 decimals) + * @return uint256 Out amount of reserveOut value denominated in USD (8 decimals) + */ + function getAmountsOut( + uint256 amountIn, + address reserveIn, + address reserveOut + ) + external + view + override + returns ( + uint256, + uint256, + uint256, + uint256, + address[] memory + ) + { + AmountCalc memory results = _getAmountsOutData(reserveIn, reserveOut, amountIn); + + return ( + results.calculatedAmount, + results.relativePrice, + results.amountInUsd, + results.amountOutUsd, + results.path + ); + } + + /** + * @dev Returns the minimum input asset amount required to buy the given output asset amount and the prices + * @param amountOut Amount of reserveOut + * @param reserveIn Address of the asset to be swap from + * @param reserveOut Address of the asset to be swap to + * @return uint256 Amount in of the reserveIn + * @return uint256 The price of in amount denominated in the reserveOut currency (18 decimals) + * @return uint256 In amount of reserveIn value denominated in USD (8 decimals) + * @return uint256 Out amount of reserveOut value denominated in USD (8 decimals) + */ + function getAmountsIn( + uint256 amountOut, + address reserveIn, + address reserveOut + ) + external + view + override + returns ( + uint256, + uint256, + uint256, + uint256, + address[] memory + ) + { + AmountCalc memory results = _getAmountsInData(reserveIn, reserveOut, amountOut); + + return ( + results.calculatedAmount, + results.relativePrice, + results.amountInUsd, + results.amountOutUsd, + results.path + ); + } + + /** + * @dev Swaps an exact `amountToSwap` of an asset to another + * @param assetToSwapFrom Origin asset + * @param assetToSwapTo Destination asset + * @param amountToSwap Exact amount of `assetToSwapFrom` to be swapped + * @param minAmountOut the min amount of `assetToSwapTo` to be received from the swap + * @return the amount received from the swap + */ + function _swapExactTokensForTokens( + address assetToSwapFrom, + address assetToSwapTo, + uint256 amountToSwap, + uint256 minAmountOut, + bool useEthPath + ) internal returns (uint256) { + uint256 fromAssetDecimals = _getDecimals(assetToSwapFrom); + uint256 toAssetDecimals = _getDecimals(assetToSwapTo); + + uint256 fromAssetPrice = _getPrice(assetToSwapFrom); + uint256 toAssetPrice = _getPrice(assetToSwapTo); + + uint256 expectedMinAmountOut = + amountToSwap + .mul(fromAssetPrice.mul(10**toAssetDecimals)) + .div(toAssetPrice.mul(10**fromAssetDecimals)) + .percentMul(PercentageMath.PERCENTAGE_FACTOR.sub(MAX_SLIPPAGE_PERCENT)); + + require(expectedMinAmountOut < minAmountOut, 'minAmountOut exceed max slippage'); + + // Approves the transfer for the swap. Approves for 0 first to comply with tokens that implement the anti frontrunning approval fix. + IERC20(assetToSwapFrom).safeApprove(address(UNISWAP_ROUTER), 0); + IERC20(assetToSwapFrom).safeApprove(address(UNISWAP_ROUTER), amountToSwap); + + address[] memory path; + if (useEthPath) { + path = new address[](3); + path[0] = assetToSwapFrom; + path[1] = WETH_ADDRESS; + path[2] = assetToSwapTo; + } else { + path = new address[](2); + path[0] = assetToSwapFrom; + path[1] = assetToSwapTo; + } + uint256[] memory amounts = + UNISWAP_ROUTER.swapExactTokensForTokens( + amountToSwap, + minAmountOut, + path, + address(this), + block.timestamp + ); + + emit Swapped(assetToSwapFrom, assetToSwapTo, amounts[0], amounts[amounts.length - 1]); + + return amounts[amounts.length - 1]; + } + + /** + * @dev Receive an exact amount `amountToReceive` of `assetToSwapTo` tokens for as few `assetToSwapFrom` tokens as + * possible. + * @param assetToSwapFrom Origin asset + * @param assetToSwapTo Destination asset + * @param maxAmountToSwap Max amount of `assetToSwapFrom` allowed to be swapped + * @param amountToReceive Exact amount of `assetToSwapTo` to receive + * @return the amount swapped + */ + function _swapTokensForExactTokens( + address assetToSwapFrom, + address assetToSwapTo, + uint256 maxAmountToSwap, + uint256 amountToReceive, + bool useEthPath + ) internal returns (uint256) { + uint256 fromAssetDecimals = _getDecimals(assetToSwapFrom); + uint256 toAssetDecimals = _getDecimals(assetToSwapTo); + + uint256 fromAssetPrice = _getPrice(assetToSwapFrom); + uint256 toAssetPrice = _getPrice(assetToSwapTo); + + uint256 expectedMaxAmountToSwap = + amountToReceive + .mul(toAssetPrice.mul(10**fromAssetDecimals)) + .div(fromAssetPrice.mul(10**toAssetDecimals)) + .percentMul(PercentageMath.PERCENTAGE_FACTOR.add(MAX_SLIPPAGE_PERCENT)); + + require(maxAmountToSwap < expectedMaxAmountToSwap, 'maxAmountToSwap exceed max slippage'); + + // Approves the transfer for the swap. Approves for 0 first to comply with tokens that implement the anti frontrunning approval fix. + IERC20(assetToSwapFrom).safeApprove(address(UNISWAP_ROUTER), 0); + IERC20(assetToSwapFrom).safeApprove(address(UNISWAP_ROUTER), maxAmountToSwap); + + address[] memory path; + if (useEthPath) { + path = new address[](3); + path[0] = assetToSwapFrom; + path[1] = WETH_ADDRESS; + path[2] = assetToSwapTo; + } else { + path = new address[](2); + path[0] = assetToSwapFrom; + path[1] = assetToSwapTo; + } + + uint256[] memory amounts = + UNISWAP_ROUTER.swapTokensForExactTokens( + amountToReceive, + maxAmountToSwap, + path, + address(this), + block.timestamp + ); + + emit Swapped(assetToSwapFrom, assetToSwapTo, amounts[0], amounts[amounts.length - 1]); + + return amounts[0]; + } + + /** + * @dev Get the price of the asset from the oracle denominated in eth + * @param asset address + * @return eth price for the asset + */ + function _getPrice(address asset) internal view returns (uint256) { + return ORACLE.getAssetPrice(asset); + } + + /** + * @dev Get the decimals of an asset + * @return number of decimals of the asset + */ + function _getDecimals(address asset) internal view returns (uint256) { + return IERC20Detailed(asset).decimals(); + } + + /** + * @dev Get the aToken associated to the asset + * @return address of the aToken + */ + function _getReserveData(address asset) internal view returns (DataTypes.ReserveData memory) { + return LENDING_POOL.getReserveData(asset); + } + + /** + * @dev Pull the ATokens from the user + * @param reserve address of the asset + * @param reserveAToken address of the aToken of the reserve + * @param user address + * @param amount of tokens to be transferred to the contract + * @param permitSignature struct containing the permit signature + */ + function _pullAToken( + address reserve, + address reserveAToken, + address user, + uint256 amount, + PermitSignature memory permitSignature + ) internal { + if (_usePermit(permitSignature)) { + IERC20WithPermit(reserveAToken).permit( + user, + address(this), + permitSignature.amount, + permitSignature.deadline, + permitSignature.v, + permitSignature.r, + permitSignature.s + ); + } + + // transfer from user to adapter + IERC20(reserveAToken).safeTransferFrom(user, address(this), amount); + + // withdraw reserve + LENDING_POOL.withdraw(reserve, amount, address(this)); + } + + /** + * @dev Tells if the permit method should be called by inspecting if there is a valid signature. + * If signature params are set to 0, then permit won't be called. + * @param signature struct containing the permit signature + * @return whether or not permit should be called + */ + function _usePermit(PermitSignature memory signature) internal pure returns (bool) { + return + !(uint256(signature.deadline) == uint256(signature.v) && uint256(signature.deadline) == 0); + } + + /** + * @dev Calculates the value denominated in USD + * @param reserve Address of the reserve + * @param amount Amount of the reserve + * @param decimals Decimals of the reserve + * @return whether or not permit should be called + */ + function _calcUsdValue( + address reserve, + uint256 amount, + uint256 decimals + ) internal view returns (uint256) { + uint256 ethUsdPrice = _getPrice(USD_ADDRESS); + uint256 reservePrice = _getPrice(reserve); + + return amount.mul(reservePrice).div(10**decimals).mul(ethUsdPrice).div(10**18); + } + + /** + * @dev Given an input asset amount, returns the maximum output amount of the other asset + * @param reserveIn Address of the asset to be swap from + * @param reserveOut Address of the asset to be swap to + * @param amountIn Amount of reserveIn + * @return Struct containing the following information: + * uint256 Amount out of the reserveOut + * uint256 The price of out amount denominated in the reserveIn currency (18 decimals) + * uint256 In amount of reserveIn value denominated in USD (8 decimals) + * uint256 Out amount of reserveOut value denominated in USD (8 decimals) + */ + function _getAmountsOutData( + address reserveIn, + address reserveOut, + uint256 amountIn + ) internal view returns (AmountCalc memory) { + // Subtract flash loan fee + uint256 finalAmountIn = amountIn.sub(amountIn.mul(FLASHLOAN_PREMIUM_TOTAL).div(10000)); + + address[] memory simplePath = new address[](2); + simplePath[0] = reserveIn; + simplePath[1] = reserveOut; + + uint256[] memory amountsWithoutWeth; + uint256[] memory amountsWithWeth; + + address[] memory pathWithWeth = new address[](3); + if (reserveIn != WETH_ADDRESS && reserveOut != WETH_ADDRESS) { + pathWithWeth[0] = reserveIn; + pathWithWeth[1] = WETH_ADDRESS; + pathWithWeth[2] = reserveOut; + + try UNISWAP_ROUTER.getAmountsOut(finalAmountIn, pathWithWeth) returns ( + uint256[] memory resultsWithWeth + ) { + amountsWithWeth = resultsWithWeth; + } catch { + amountsWithWeth = new uint256[](3); + } + } else { + amountsWithWeth = new uint256[](3); + } + + uint256 bestAmountOut; + try UNISWAP_ROUTER.getAmountsOut(finalAmountIn, simplePath) returns ( + uint256[] memory resultAmounts + ) { + amountsWithoutWeth = resultAmounts; + + bestAmountOut = (amountsWithWeth[2] > amountsWithoutWeth[1]) + ? amountsWithWeth[2] + : amountsWithoutWeth[1]; + } catch { + amountsWithoutWeth = new uint256[](2); + bestAmountOut = amountsWithWeth[2]; + } + + uint256 reserveInDecimals = _getDecimals(reserveIn); + uint256 reserveOutDecimals = _getDecimals(reserveOut); + + uint256 outPerInPrice = + finalAmountIn.mul(10**18).mul(10**reserveOutDecimals).div( + bestAmountOut.mul(10**reserveInDecimals) + ); + + return + AmountCalc( + bestAmountOut, + outPerInPrice, + _calcUsdValue(reserveIn, amountIn, reserveInDecimals), + _calcUsdValue(reserveOut, bestAmountOut, reserveOutDecimals), + (bestAmountOut == 0) ? new address[](2) : (bestAmountOut == amountsWithoutWeth[1]) + ? simplePath + : pathWithWeth + ); + } + + /** + * @dev Returns the minimum input asset amount required to buy the given output asset amount + * @param reserveIn Address of the asset to be swap from + * @param reserveOut Address of the asset to be swap to + * @param amountOut Amount of reserveOut + * @return Struct containing the following information: + * uint256 Amount in of the reserveIn + * uint256 The price of in amount denominated in the reserveOut currency (18 decimals) + * uint256 In amount of reserveIn value denominated in USD (8 decimals) + * uint256 Out amount of reserveOut value denominated in USD (8 decimals) + */ + function _getAmountsInData( + address reserveIn, + address reserveOut, + uint256 amountOut + ) internal view returns (AmountCalc memory) { + (uint256[] memory amounts, address[] memory path) = + _getAmountsInAndPath(reserveIn, reserveOut, amountOut); + + // Add flash loan fee + uint256 finalAmountIn = amounts[0].add(amounts[0].mul(FLASHLOAN_PREMIUM_TOTAL).div(10000)); + + uint256 reserveInDecimals = _getDecimals(reserveIn); + uint256 reserveOutDecimals = _getDecimals(reserveOut); + + uint256 inPerOutPrice = + amountOut.mul(10**18).mul(10**reserveInDecimals).div( + finalAmountIn.mul(10**reserveOutDecimals) + ); + + return + AmountCalc( + finalAmountIn, + inPerOutPrice, + _calcUsdValue(reserveIn, finalAmountIn, reserveInDecimals), + _calcUsdValue(reserveOut, amountOut, reserveOutDecimals), + path + ); + } + + /** + * @dev Calculates the input asset amount required to buy the given output asset amount + * @param reserveIn Address of the asset to be swap from + * @param reserveOut Address of the asset to be swap to + * @param amountOut Amount of reserveOut + * @return uint256[] amounts Array containing the amountIn and amountOut for a swap + */ + function _getAmountsInAndPath( + address reserveIn, + address reserveOut, + uint256 amountOut + ) internal view returns (uint256[] memory, address[] memory) { + address[] memory simplePath = new address[](2); + simplePath[0] = reserveIn; + simplePath[1] = reserveOut; + + uint256[] memory amountsWithoutWeth; + uint256[] memory amountsWithWeth; + address[] memory pathWithWeth = new address[](3); + + if (reserveIn != WETH_ADDRESS && reserveOut != WETH_ADDRESS) { + pathWithWeth[0] = reserveIn; + pathWithWeth[1] = WETH_ADDRESS; + pathWithWeth[2] = reserveOut; + + try UNISWAP_ROUTER.getAmountsIn(amountOut, pathWithWeth) returns ( + uint256[] memory resultsWithWeth + ) { + amountsWithWeth = resultsWithWeth; + } catch { + amountsWithWeth = new uint256[](3); + } + } else { + amountsWithWeth = new uint256[](3); + } + + try UNISWAP_ROUTER.getAmountsIn(amountOut, simplePath) returns ( + uint256[] memory resultAmounts + ) { + amountsWithoutWeth = resultAmounts; + + return + (amountsWithWeth[0] < amountsWithoutWeth[0] && amountsWithWeth[0] != 0) + ? (amountsWithWeth, pathWithWeth) + : (amountsWithoutWeth, simplePath); + } catch { + return (amountsWithWeth, pathWithWeth); + } + } + + /** + * @dev Calculates the input asset amount required to buy the given output asset amount + * @param reserveIn Address of the asset to be swap from + * @param reserveOut Address of the asset to be swap to + * @param amountOut Amount of reserveOut + * @return uint256[] amounts Array containing the amountIn and amountOut for a swap + */ + function _getAmountsIn( + address reserveIn, + address reserveOut, + uint256 amountOut, + bool useEthPath + ) internal view returns (uint256[] memory) { + address[] memory path; + + if (useEthPath) { + path = new address[](3); + path[0] = reserveIn; + path[1] = WETH_ADDRESS; + path[2] = reserveOut; + } else { + path = new address[](2); + path[0] = reserveIn; + path[1] = reserveOut; + } + + return UNISWAP_ROUTER.getAmountsIn(amountOut, path); + } + + /** + * @dev Emergency rescue for token stucked on this contract, as failsafe mechanism + * - Funds should never remain in this contract more time than during transactions + * - Only callable by the owner + **/ + function rescueTokens(IERC20 token) external onlyOwner { + token.transfer(owner(), token.balanceOf(address(this))); + } +} diff --git a/contracts/adapters/UniswapLiquiditySwapAdapter.sol b/contracts/adapters/UniswapLiquiditySwapAdapter.sol new file mode 100644 index 00000000..44745ad5 --- /dev/null +++ b/contracts/adapters/UniswapLiquiditySwapAdapter.sol @@ -0,0 +1,280 @@ +// SPDX-License-Identifier: agpl-3.0 +pragma solidity 0.6.12; +pragma experimental ABIEncoderV2; + +import {BaseUniswapAdapter} from './BaseUniswapAdapter.sol'; +import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol'; +import {IUniswapV2Router02} from '../interfaces/IUniswapV2Router02.sol'; +import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol'; + +/** + * @title UniswapLiquiditySwapAdapter + * @notice Uniswap V2 Adapter to swap liquidity. + * @author Aave + **/ +contract UniswapLiquiditySwapAdapter is BaseUniswapAdapter { + struct PermitParams { + uint256[] amount; + uint256[] deadline; + uint8[] v; + bytes32[] r; + bytes32[] s; + } + + struct SwapParams { + address[] assetToSwapToList; + uint256[] minAmountsToReceive; + bool[] swapAllBalance; + PermitParams permitParams; + bool[] useEthPath; + } + + constructor( + ILendingPoolAddressesProvider addressesProvider, + IUniswapV2Router02 uniswapRouter, + address wethAddress + ) public BaseUniswapAdapter(addressesProvider, uniswapRouter, wethAddress) {} + + /** + * @dev Swaps the received reserve amount from the flash loan into the asset specified in the params. + * The received funds from the swap are then deposited into the protocol on behalf of the user. + * The user should give this contract allowance to pull the ATokens in order to withdraw the underlying asset and + * repay the flash loan. + * @param assets Address of asset to be swapped + * @param amounts Amount of the asset to be swapped + * @param premiums Fee of the flash loan + * @param initiator Address of the user + * @param params Additional variadic field to include extra params. Expected parameters: + * address[] assetToSwapToList List of the addresses of the reserve to be swapped to and deposited + * uint256[] minAmountsToReceive List of min amounts to be received from the swap + * bool[] swapAllBalance Flag indicating if all the user balance should be swapped + * uint256[] permitAmount List of amounts for the permit signature + * uint256[] deadline List of deadlines for the permit signature + * uint8[] v List of v param for the permit signature + * bytes32[] r List of r param for the permit signature + * bytes32[] s List of s param for the permit signature + */ + function executeOperation( + address[] calldata assets, + uint256[] calldata amounts, + uint256[] calldata premiums, + address initiator, + bytes calldata params + ) external override returns (bool) { + require(msg.sender == address(LENDING_POOL), 'CALLER_MUST_BE_LENDING_POOL'); + + SwapParams memory decodedParams = _decodeParams(params); + + require( + assets.length == decodedParams.assetToSwapToList.length && + assets.length == decodedParams.minAmountsToReceive.length && + assets.length == decodedParams.swapAllBalance.length && + assets.length == decodedParams.permitParams.amount.length && + assets.length == decodedParams.permitParams.deadline.length && + assets.length == decodedParams.permitParams.v.length && + assets.length == decodedParams.permitParams.r.length && + assets.length == decodedParams.permitParams.s.length && + assets.length == decodedParams.useEthPath.length, + 'INCONSISTENT_PARAMS' + ); + + for (uint256 i = 0; i < assets.length; i++) { + _swapLiquidity( + assets[i], + decodedParams.assetToSwapToList[i], + amounts[i], + premiums[i], + initiator, + decodedParams.minAmountsToReceive[i], + decodedParams.swapAllBalance[i], + PermitSignature( + decodedParams.permitParams.amount[i], + decodedParams.permitParams.deadline[i], + decodedParams.permitParams.v[i], + decodedParams.permitParams.r[i], + decodedParams.permitParams.s[i] + ), + decodedParams.useEthPath[i] + ); + } + + return true; + } + + struct SwapAndDepositLocalVars { + uint256 i; + uint256 aTokenInitiatorBalance; + uint256 amountToSwap; + uint256 receivedAmount; + address aToken; + } + + /** + * @dev Swaps an amount of an asset to another and deposits the new asset amount on behalf of the user without using + * a flash loan. This method can be used when the temporary transfer of the collateral asset to this contract + * does not affect the user position. + * The user should give this contract allowance to pull the ATokens in order to withdraw the underlying asset and + * perform the swap. + * @param assetToSwapFromList List of addresses of the underlying asset to be swap from + * @param assetToSwapToList List of addresses of the underlying asset to be swap to and deposited + * @param amountToSwapList List of amounts to be swapped. If the amount exceeds the balance, the total balance is used for the swap + * @param minAmountsToReceive List of min amounts to be received from the swap + * @param permitParams List of struct containing the permit signatures + * uint256 permitAmount Amount for the permit signature + * uint256 deadline Deadline for the permit signature + * uint8 v param for the permit signature + * bytes32 r param for the permit signature + * bytes32 s param for the permit signature + * @param useEthPath true if the swap needs to occur using ETH in the routing, false otherwise + */ + function swapAndDeposit( + address[] calldata assetToSwapFromList, + address[] calldata assetToSwapToList, + uint256[] calldata amountToSwapList, + uint256[] calldata minAmountsToReceive, + PermitSignature[] calldata permitParams, + bool[] calldata useEthPath + ) external { + require( + assetToSwapFromList.length == assetToSwapToList.length && + assetToSwapFromList.length == amountToSwapList.length && + assetToSwapFromList.length == minAmountsToReceive.length && + assetToSwapFromList.length == permitParams.length, + 'INCONSISTENT_PARAMS' + ); + + SwapAndDepositLocalVars memory vars; + + for (vars.i = 0; vars.i < assetToSwapFromList.length; vars.i++) { + vars.aToken = _getReserveData(assetToSwapFromList[vars.i]).aTokenAddress; + + vars.aTokenInitiatorBalance = IERC20(vars.aToken).balanceOf(msg.sender); + vars.amountToSwap = amountToSwapList[vars.i] > vars.aTokenInitiatorBalance + ? vars.aTokenInitiatorBalance + : amountToSwapList[vars.i]; + + _pullAToken( + assetToSwapFromList[vars.i], + vars.aToken, + msg.sender, + vars.amountToSwap, + permitParams[vars.i] + ); + + vars.receivedAmount = _swapExactTokensForTokens( + assetToSwapFromList[vars.i], + assetToSwapToList[vars.i], + vars.amountToSwap, + minAmountsToReceive[vars.i], + useEthPath[vars.i] + ); + + // Deposit new reserve + IERC20(assetToSwapToList[vars.i]).safeApprove(address(LENDING_POOL), 0); + IERC20(assetToSwapToList[vars.i]).safeApprove(address(LENDING_POOL), vars.receivedAmount); + LENDING_POOL.deposit(assetToSwapToList[vars.i], vars.receivedAmount, msg.sender, 0); + } + } + + /** + * @dev Swaps an `amountToSwap` of an asset to another and deposits the funds on behalf of the initiator. + * @param assetFrom Address of the underlying asset to be swap from + * @param assetTo Address of the underlying asset to be swap to and deposited + * @param amount Amount from flash loan + * @param premium Premium of the flash loan + * @param minAmountToReceive Min amount to be received from the swap + * @param swapAllBalance Flag indicating if all the user balance should be swapped + * @param permitSignature List of struct containing the permit signature + * @param useEthPath true if the swap needs to occur using ETH in the routing, false otherwise + */ + + struct SwapLiquidityLocalVars { + address aToken; + uint256 aTokenInitiatorBalance; + uint256 amountToSwap; + uint256 receivedAmount; + uint256 flashLoanDebt; + uint256 amountToPull; + } + + function _swapLiquidity( + address assetFrom, + address assetTo, + uint256 amount, + uint256 premium, + address initiator, + uint256 minAmountToReceive, + bool swapAllBalance, + PermitSignature memory permitSignature, + bool useEthPath + ) internal { + + SwapLiquidityLocalVars memory vars; + + vars.aToken = _getReserveData(assetFrom).aTokenAddress; + + vars.aTokenInitiatorBalance = IERC20(vars.aToken).balanceOf(initiator); + vars.amountToSwap = + swapAllBalance && vars.aTokenInitiatorBalance.sub(premium) <= amount + ? vars.aTokenInitiatorBalance.sub(premium) + : amount; + + vars.receivedAmount = + _swapExactTokensForTokens(assetFrom, assetTo, vars.amountToSwap, minAmountToReceive, useEthPath); + + // Deposit new reserve + IERC20(assetTo).safeApprove(address(LENDING_POOL), 0); + IERC20(assetTo).safeApprove(address(LENDING_POOL), vars.receivedAmount); + LENDING_POOL.deposit(assetTo, vars.receivedAmount, initiator, 0); + + vars.flashLoanDebt = amount.add(premium); + vars.amountToPull = vars.amountToSwap.add(premium); + + _pullAToken(assetFrom, vars.aToken, initiator, vars.amountToPull, permitSignature); + + // Repay flash loan + IERC20(assetFrom).safeApprove(address(LENDING_POOL), 0); + IERC20(assetFrom).safeApprove(address(LENDING_POOL), vars.flashLoanDebt); + } + + /** + * @dev Decodes the information encoded in the flash loan params + * @param params Additional variadic field to include extra params. Expected parameters: + * address[] assetToSwapToList List of the addresses of the reserve to be swapped to and deposited + * uint256[] minAmountsToReceive List of min amounts to be received from the swap + * bool[] swapAllBalance Flag indicating if all the user balance should be swapped + * uint256[] permitAmount List of amounts for the permit signature + * uint256[] deadline List of deadlines for the permit signature + * uint8[] v List of v param for the permit signature + * bytes32[] r List of r param for the permit signature + * bytes32[] s List of s param for the permit signature + * bool[] useEthPath true if the swap needs to occur using ETH in the routing, false otherwise + * @return SwapParams struct containing decoded params + */ + function _decodeParams(bytes memory params) internal pure returns (SwapParams memory) { + ( + address[] memory assetToSwapToList, + uint256[] memory minAmountsToReceive, + bool[] memory swapAllBalance, + uint256[] memory permitAmount, + uint256[] memory deadline, + uint8[] memory v, + bytes32[] memory r, + bytes32[] memory s, + bool[] memory useEthPath + ) = + abi.decode( + params, + (address[], uint256[], bool[], uint256[], uint256[], uint8[], bytes32[], bytes32[], bool[]) + ); + + return + SwapParams( + assetToSwapToList, + minAmountsToReceive, + swapAllBalance, + PermitParams(permitAmount, deadline, v, r, s), + useEthPath + ); + } +} \ No newline at end of file diff --git a/contracts/adapters/UniswapRepayAdapter.sol b/contracts/adapters/UniswapRepayAdapter.sol new file mode 100644 index 00000000..c4e7817e --- /dev/null +++ b/contracts/adapters/UniswapRepayAdapter.sol @@ -0,0 +1,259 @@ +// SPDX-License-Identifier: agpl-3.0 +pragma solidity 0.6.12; +pragma experimental ABIEncoderV2; + +import {BaseUniswapAdapter} from './BaseUniswapAdapter.sol'; +import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol'; +import {IUniswapV2Router02} from '../interfaces/IUniswapV2Router02.sol'; +import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol'; +import {DataTypes} from '../protocol/libraries/types/DataTypes.sol'; + +/** + * @title UniswapRepayAdapter + * @notice Uniswap V2 Adapter to perform a repay of a debt with collateral. + * @author Aave + **/ +contract UniswapRepayAdapter is BaseUniswapAdapter { + struct RepayParams { + address collateralAsset; + uint256 collateralAmount; + uint256 rateMode; + PermitSignature permitSignature; + bool useEthPath; + } + + constructor( + ILendingPoolAddressesProvider addressesProvider, + IUniswapV2Router02 uniswapRouter, + address wethAddress + ) public BaseUniswapAdapter(addressesProvider, uniswapRouter, wethAddress) {} + + /** + * @dev Uses the received funds from the flash loan to repay a debt on the protocol on behalf of the user. Then pulls + * the collateral from the user and swaps it to the debt asset to repay the flash loan. + * The user should give this contract allowance to pull the ATokens in order to withdraw the underlying asset, swap it + * and repay the flash loan. + * Supports only one asset on the flash loan. + * @param assets Address of debt asset + * @param amounts Amount of the debt to be repaid + * @param premiums Fee of the flash loan + * @param initiator Address of the user + * @param params Additional variadic field to include extra params. Expected parameters: + * address collateralAsset Address of the reserve to be swapped + * uint256 collateralAmount Amount of reserve to be swapped + * uint256 rateMode Rate modes of the debt to be repaid + * uint256 permitAmount Amount for the permit signature + * uint256 deadline Deadline for the permit signature + * uint8 v V param for the permit signature + * bytes32 r R param for the permit signature + * bytes32 s S param for the permit signature + */ + function executeOperation( + address[] calldata assets, + uint256[] calldata amounts, + uint256[] calldata premiums, + address initiator, + bytes calldata params + ) external override returns (bool) { + require(msg.sender == address(LENDING_POOL), 'CALLER_MUST_BE_LENDING_POOL'); + + RepayParams memory decodedParams = _decodeParams(params); + + _swapAndRepay( + decodedParams.collateralAsset, + assets[0], + amounts[0], + decodedParams.collateralAmount, + decodedParams.rateMode, + initiator, + premiums[0], + decodedParams.permitSignature, + decodedParams.useEthPath + ); + + return true; + } + + /** + * @dev Swaps the user collateral for the debt asset and then repay the debt on the protocol on behalf of the user + * without using flash loans. This method can be used when the temporary transfer of the collateral asset to this + * contract does not affect the user position. + * The user should give this contract allowance to pull the ATokens in order to withdraw the underlying asset + * @param collateralAsset Address of asset to be swapped + * @param debtAsset Address of debt asset + * @param collateralAmount Amount of the collateral to be swapped + * @param debtRepayAmount Amount of the debt to be repaid + * @param debtRateMode Rate mode of the debt to be repaid + * @param permitSignature struct containing the permit signature + * @param useEthPath struct containing the permit signature + + */ + function swapAndRepay( + address collateralAsset, + address debtAsset, + uint256 collateralAmount, + uint256 debtRepayAmount, + uint256 debtRateMode, + PermitSignature calldata permitSignature, + bool useEthPath + ) external { + DataTypes.ReserveData memory collateralReserveData = _getReserveData(collateralAsset); + DataTypes.ReserveData memory debtReserveData = _getReserveData(debtAsset); + + address debtToken = + DataTypes.InterestRateMode(debtRateMode) == DataTypes.InterestRateMode.STABLE + ? debtReserveData.stableDebtTokenAddress + : debtReserveData.variableDebtTokenAddress; + + uint256 currentDebt = IERC20(debtToken).balanceOf(msg.sender); + uint256 amountToRepay = debtRepayAmount <= currentDebt ? debtRepayAmount : currentDebt; + + if (collateralAsset != debtAsset) { + uint256 maxCollateralToSwap = collateralAmount; + if (amountToRepay < debtRepayAmount) { + maxCollateralToSwap = maxCollateralToSwap.mul(amountToRepay).div(debtRepayAmount); + } + + // Get exact collateral needed for the swap to avoid leftovers + uint256[] memory amounts = + _getAmountsIn(collateralAsset, debtAsset, amountToRepay, useEthPath); + require(amounts[0] <= maxCollateralToSwap, 'slippage too high'); + + // Pull aTokens from user + _pullAToken( + collateralAsset, + collateralReserveData.aTokenAddress, + msg.sender, + amounts[0], + permitSignature + ); + + // Swap collateral for debt asset + _swapTokensForExactTokens(collateralAsset, debtAsset, amounts[0], amountToRepay, useEthPath); + } else { + // Pull aTokens from user + _pullAToken( + collateralAsset, + collateralReserveData.aTokenAddress, + msg.sender, + amountToRepay, + permitSignature + ); + } + + // Repay debt. Approves 0 first to comply with tokens that implement the anti frontrunning approval fix + IERC20(debtAsset).safeApprove(address(LENDING_POOL), 0); + IERC20(debtAsset).safeApprove(address(LENDING_POOL), amountToRepay); + LENDING_POOL.repay(debtAsset, amountToRepay, debtRateMode, msg.sender); + } + + /** + * @dev Perform the repay of the debt, pulls the initiator collateral and swaps to repay the flash loan + * + * @param collateralAsset Address of token to be swapped + * @param debtAsset Address of debt token to be received from the swap + * @param amount Amount of the debt to be repaid + * @param collateralAmount Amount of the reserve to be swapped + * @param rateMode Rate mode of the debt to be repaid + * @param initiator Address of the user + * @param premium Fee of the flash loan + * @param permitSignature struct containing the permit signature + */ + function _swapAndRepay( + address collateralAsset, + address debtAsset, + uint256 amount, + uint256 collateralAmount, + uint256 rateMode, + address initiator, + uint256 premium, + PermitSignature memory permitSignature, + bool useEthPath + ) internal { + DataTypes.ReserveData memory collateralReserveData = _getReserveData(collateralAsset); + + // Repay debt. Approves for 0 first to comply with tokens that implement the anti frontrunning approval fix. + IERC20(debtAsset).safeApprove(address(LENDING_POOL), 0); + IERC20(debtAsset).safeApprove(address(LENDING_POOL), amount); + uint256 repaidAmount = IERC20(debtAsset).balanceOf(address(this)); + LENDING_POOL.repay(debtAsset, amount, rateMode, initiator); + repaidAmount = repaidAmount.sub(IERC20(debtAsset).balanceOf(address(this))); + + if (collateralAsset != debtAsset) { + uint256 maxCollateralToSwap = collateralAmount; + if (repaidAmount < amount) { + maxCollateralToSwap = maxCollateralToSwap.mul(repaidAmount).div(amount); + } + + uint256 neededForFlashLoanDebt = repaidAmount.add(premium); + uint256[] memory amounts = + _getAmountsIn(collateralAsset, debtAsset, neededForFlashLoanDebt, useEthPath); + require(amounts[0] <= maxCollateralToSwap, 'slippage too high'); + + // Pull aTokens from user + _pullAToken( + collateralAsset, + collateralReserveData.aTokenAddress, + initiator, + amounts[0], + permitSignature + ); + + // Swap collateral asset to the debt asset + _swapTokensForExactTokens(collateralAsset, debtAsset, amounts[0], neededForFlashLoanDebt, useEthPath); + } else { + // Pull aTokens from user + _pullAToken( + collateralAsset, + collateralReserveData.aTokenAddress, + initiator, + repaidAmount.add(premium), + permitSignature + ); + } + + // Repay flashloan. Approves for 0 first to comply with tokens that implement the anti frontrunning approval fix. + IERC20(debtAsset).safeApprove(address(LENDING_POOL), 0); + IERC20(debtAsset).safeApprove(address(LENDING_POOL), amount.add(premium)); + } + + /** + * @dev Decodes debt information encoded in the flash loan params + * @param params Additional variadic field to include extra params. Expected parameters: + * address collateralAsset Address of the reserve to be swapped + * uint256 collateralAmount Amount of reserve to be swapped + * uint256 rateMode Rate modes of the debt to be repaid + * uint256 permitAmount Amount for the permit signature + * uint256 deadline Deadline for the permit signature + * uint8 v V param for the permit signature + * bytes32 r R param for the permit signature + * bytes32 s S param for the permit signature + * @return RepayParams struct containing decoded params + */ + function _decodeParams(bytes memory params) internal pure returns (RepayParams memory) { + ( + address collateralAsset, + uint256 collateralAmount, + uint256 rateMode, + uint256 permitAmount, + uint256 deadline, + uint8 v, + bytes32 r, + bytes32 s, + bool useEthPath + ) = + abi.decode( + params, + (address, uint256, uint256, uint256, uint256, uint8, bytes32, bytes32, bool) + ); + + return + RepayParams( + collateralAsset, + collateralAmount, + rateMode, + PermitSignature(permitAmount, deadline, v, r, s), + useEthPath + ); + } +} \ No newline at end of file diff --git a/contracts/adapters/interfaces/IBaseUniswapAdapter.sol b/contracts/adapters/interfaces/IBaseUniswapAdapter.sol new file mode 100644 index 00000000..82997b74 --- /dev/null +++ b/contracts/adapters/interfaces/IBaseUniswapAdapter.sol @@ -0,0 +1,90 @@ +// SPDX-License-Identifier: agpl-3.0 +pragma solidity 0.6.12; +pragma experimental ABIEncoderV2; + +import {IPriceOracleGetter} from '../../interfaces/IPriceOracleGetter.sol'; +import {IUniswapV2Router02} from '../../interfaces/IUniswapV2Router02.sol'; + +interface IBaseUniswapAdapter { + event Swapped(address fromAsset, address toAsset, uint256 fromAmount, uint256 receivedAmount); + + struct PermitSignature { + uint256 amount; + uint256 deadline; + uint8 v; + bytes32 r; + bytes32 s; + } + + struct AmountCalc { + uint256 calculatedAmount; + uint256 relativePrice; + uint256 amountInUsd; + uint256 amountOutUsd; + address[] path; + } + + function WETH_ADDRESS() external returns (address); + + function MAX_SLIPPAGE_PERCENT() external returns (uint256); + + function FLASHLOAN_PREMIUM_TOTAL() external returns (uint256); + + function USD_ADDRESS() external returns (address); + + function ORACLE() external returns (IPriceOracleGetter); + + function UNISWAP_ROUTER() external returns (IUniswapV2Router02); + + /** + * @dev Given an input asset amount, returns the maximum output amount of the other asset and the prices + * @param amountIn Amount of reserveIn + * @param reserveIn Address of the asset to be swap from + * @param reserveOut Address of the asset to be swap to + * @return uint256 Amount out of the reserveOut + * @return uint256 The price of out amount denominated in the reserveIn currency (18 decimals) + * @return uint256 In amount of reserveIn value denominated in USD (8 decimals) + * @return uint256 Out amount of reserveOut value denominated in USD (8 decimals) + * @return address[] The exchange path + */ + function getAmountsOut( + uint256 amountIn, + address reserveIn, + address reserveOut + ) + external + view + returns ( + uint256, + uint256, + uint256, + uint256, + address[] memory + ); + + /** + * @dev Returns the minimum input asset amount required to buy the given output asset amount and the prices + * @param amountOut Amount of reserveOut + * @param reserveIn Address of the asset to be swap from + * @param reserveOut Address of the asset to be swap to + * @return uint256 Amount in of the reserveIn + * @return uint256 The price of in amount denominated in the reserveOut currency (18 decimals) + * @return uint256 In amount of reserveIn value denominated in USD (8 decimals) + * @return uint256 Out amount of reserveOut value denominated in USD (8 decimals) + * @return address[] The exchange path + */ + function getAmountsIn( + uint256 amountOut, + address reserveIn, + address reserveOut + ) + external + view + returns ( + uint256, + uint256, + uint256, + uint256, + address[] memory + ); +} diff --git a/contracts/deployments/ATokensAndRatesHelper.sol b/contracts/deployments/ATokensAndRatesHelper.sol index a29dc6f2..400f7ca6 100644 --- a/contracts/deployments/ATokensAndRatesHelper.sol +++ b/contracts/deployments/ATokensAndRatesHelper.sol @@ -20,6 +20,20 @@ contract ATokensAndRatesHelper is Ownable { address private poolConfigurator; event deployedContracts(address aToken, address strategy); + struct InitDeploymentInput { + address asset; + uint256[6] rates; + } + + struct ConfigureReserveInput { + address asset; + uint256 baseLTV; + uint256 liquidationThreshold; + uint256 liquidationBonus; + uint256 reserveFactor; + bool stableBorrowingEnabled; + } + constructor( address payable _pool, address _addressesProvider, @@ -30,93 +44,40 @@ contract ATokensAndRatesHelper is Ownable { poolConfigurator = _poolConfigurator; } - function initDeployment( - address[] calldata assets, - string[] calldata symbols, - uint256[6][] calldata rates, - address treasuryAddress, - address incentivesController - ) external onlyOwner { - require(assets.length == symbols.length, 't Arrays not same length'); - require(rates.length == symbols.length, 'r Arrays not same length'); - for (uint256 i = 0; i < assets.length; i++) { + function initDeployment(InitDeploymentInput[] calldata inputParams) external onlyOwner { + for (uint256 i = 0; i < inputParams.length; i++) { emit deployedContracts( - address( - new AToken( - LendingPool(pool), - assets[i], - treasuryAddress, - StringLib.concat('Aave interest bearing ', symbols[i]), - StringLib.concat('a', symbols[i]), - incentivesController - ) - ), + address(new AToken()), address( new DefaultReserveInterestRateStrategy( LendingPoolAddressesProvider(addressesProvider), - rates[i][0], - rates[i][1], - rates[i][2], - rates[i][3], - rates[i][4], - rates[i][5] + inputParams[i].rates[0], + inputParams[i].rates[1], + inputParams[i].rates[2], + inputParams[i].rates[3], + inputParams[i].rates[4], + inputParams[i].rates[5] ) ) ); } } - function initReserve( - address[] calldata stables, - address[] calldata variables, - address[] calldata aTokens, - address[] calldata strategies, - uint8[] calldata reserveDecimals - ) external onlyOwner { - require(variables.length == stables.length); - require(aTokens.length == stables.length); - require(strategies.length == stables.length); - require(reserveDecimals.length == stables.length); - - for (uint256 i = 0; i < stables.length; i++) { - LendingPoolConfigurator(poolConfigurator).initReserve( - aTokens[i], - stables[i], - variables[i], - reserveDecimals[i], - strategies[i] - ); - } - } - - function configureReserves( - address[] calldata assets, - uint256[] calldata baseLTVs, - uint256[] calldata liquidationThresholds, - uint256[] calldata liquidationBonuses, - uint256[] calldata reserveFactors, - bool[] calldata stableBorrowingEnabled - ) external onlyOwner { - require(baseLTVs.length == assets.length); - require(liquidationThresholds.length == assets.length); - require(liquidationBonuses.length == assets.length); - require(stableBorrowingEnabled.length == assets.length); - require(reserveFactors.length == assets.length); - + function configureReserves(ConfigureReserveInput[] calldata inputParams) external onlyOwner { LendingPoolConfigurator configurator = LendingPoolConfigurator(poolConfigurator); - for (uint256 i = 0; i < assets.length; i++) { + for (uint256 i = 0; i < inputParams.length; i++) { configurator.configureReserveAsCollateral( - assets[i], - baseLTVs[i], - liquidationThresholds[i], - liquidationBonuses[i] + inputParams[i].asset, + inputParams[i].baseLTV, + inputParams[i].liquidationThreshold, + inputParams[i].liquidationBonus ); configurator.enableBorrowingOnReserve( - assets[i], - stableBorrowingEnabled[i] + inputParams[i].asset, + inputParams[i].stableBorrowingEnabled ); - configurator.setReserveFactor(assets[i], reserveFactors[i]); + configurator.setReserveFactor(inputParams[i].asset, inputParams[i].reserveFactor); } } } diff --git a/contracts/deployments/StableAndVariableTokensHelper.sol b/contracts/deployments/StableAndVariableTokensHelper.sol index 8f76bbe1..e31651f3 100644 --- a/contracts/deployments/StableAndVariableTokensHelper.sol +++ b/contracts/deployments/StableAndVariableTokensHelper.sol @@ -18,34 +18,11 @@ contract StableAndVariableTokensHelper is Ownable { addressesProvider = _addressesProvider; } - function initDeployment( - address[] calldata tokens, - string[] calldata symbols, - address incentivesController - ) external onlyOwner { + function initDeployment(address[] calldata tokens, string[] calldata symbols) external onlyOwner { require(tokens.length == symbols.length, 'Arrays not same length'); require(pool != address(0), 'Pool can not be zero address'); for (uint256 i = 0; i < tokens.length; i++) { - emit deployedContracts( - address( - new StableDebtToken( - pool, - tokens[i], - StringLib.concat('Aave stable debt bearing ', symbols[i]), - StringLib.concat('stableDebt', symbols[i]), - incentivesController - ) - ), - address( - new VariableDebtToken( - pool, - tokens[i], - StringLib.concat('Aave variable debt bearing ', symbols[i]), - StringLib.concat('variableDebt', symbols[i]), - incentivesController - ) - ) - ); + emit deployedContracts(address(new StableDebtToken()), address(new VariableDebtToken())); } } diff --git a/contracts/interfaces/IAToken.sol b/contracts/interfaces/IAToken.sol index 5fa1a4f0..ca338270 100644 --- a/contracts/interfaces/IAToken.sol +++ b/contracts/interfaces/IAToken.sol @@ -3,8 +3,10 @@ pragma solidity 0.6.12; import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol'; import {IScaledBalanceToken} from './IScaledBalanceToken.sol'; +import {IInitializableAToken} from './IInitializableAToken.sol'; +import {IAaveIncentivesController} from './IAaveIncentivesController.sol'; -interface IAToken is IERC20, IScaledBalanceToken { +interface IAToken is IERC20, IScaledBalanceToken, IInitializableAToken { /** * @dev Emitted after the mint action * @param from The address performing the mint @@ -85,4 +87,9 @@ interface IAToken is IERC20, IScaledBalanceToken { * @return The amount transferred **/ function transferUnderlyingTo(address user, uint256 amount) external returns (uint256); + + /** + * @dev Returns the address of the incentives controller contract + **/ + function getIncentivesController() external view returns (IAaveIncentivesController); } diff --git a/contracts/interfaces/IERC20WithPermit.sol b/contracts/interfaces/IERC20WithPermit.sol new file mode 100644 index 00000000..46466b90 --- /dev/null +++ b/contracts/interfaces/IERC20WithPermit.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: agpl-3.0 +pragma solidity 0.6.12; + +import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol'; + +interface IERC20WithPermit is IERC20 { + function permit( + address owner, + address spender, + uint256 value, + uint256 deadline, + uint8 v, + bytes32 r, + bytes32 s + ) external; +} diff --git a/contracts/interfaces/IInitializableAToken.sol b/contracts/interfaces/IInitializableAToken.sol new file mode 100644 index 00000000..9cffe6ce --- /dev/null +++ b/contracts/interfaces/IInitializableAToken.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: agpl-3.0 +pragma solidity 0.6.12; + +import {ILendingPool} from './ILendingPool.sol'; +import {IAaveIncentivesController} from './IAaveIncentivesController.sol'; + +/** + * @title IInitializableAToken + * @notice Interface for the initialize function on AToken + * @author Aave + **/ +interface IInitializableAToken { + /** + * @dev Initializes the aToken + * @param pool The address of the lending pool where this aToken will be used + * @param treasury The address of the Aave treasury, receiving the fees on this aToken + * @param underlyingAsset The address of the underlying asset of this aToken (E.g. WETH for aWETH) + * @param incentivesController The smart contract managing potential incentives distribution + * @param aTokenDecimals The decimals of the aToken, same as the underlying asset's + * @param aTokenName The name of the aToken + * @param aTokenSymbol The symbol of the aToken + */ + function initialize( + ILendingPool pool, + address treasury, + address underlyingAsset, + IAaveIncentivesController incentivesController, + uint8 aTokenDecimals, + string calldata aTokenName, + string calldata aTokenSymbol + ) external; +} diff --git a/contracts/interfaces/IInitializableDebtToken.sol b/contracts/interfaces/IInitializableDebtToken.sol new file mode 100644 index 00000000..0a85c968 --- /dev/null +++ b/contracts/interfaces/IInitializableDebtToken.sol @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: agpl-3.0 +pragma solidity 0.6.12; + +import {ILendingPool} from './ILendingPool.sol'; +import {IAaveIncentivesController} from './IAaveIncentivesController.sol'; + +/** + * @title IInitializableDebtToken + * @notice Interface for the initialize function common between debt tokens + * @author Aave + **/ +interface IInitializableDebtToken { + /** + * @dev Initializes the debt token. + * @param pool The address of the lending pool where this aToken will be used + * @param underlyingAsset The address of the underlying asset of this aToken (E.g. WETH for aWETH) + * @param incentivesController The smart contract managing potential incentives distribution + * @param debtTokenDecimals The decimals of the debtToken, same as the underlying asset's + * @param debtTokenName The name of the token + * @param debtTokenSymbol The symbol of the token + */ + function initialize( + ILendingPool pool, + address underlyingAsset, + IAaveIncentivesController incentivesController, + uint8 debtTokenDecimals, + string memory debtTokenName, + string memory debtTokenSymbol + ) external; +} diff --git a/contracts/interfaces/ILendingPoolConfigurator.sol b/contracts/interfaces/ILendingPoolConfigurator.sol new file mode 100644 index 00000000..8981db6c --- /dev/null +++ b/contracts/interfaces/ILendingPoolConfigurator.sol @@ -0,0 +1,176 @@ +// SPDX-License-Identifier: agpl-3.0 +pragma solidity 0.6.12; +pragma experimental ABIEncoderV2; + +interface ILendingPoolConfigurator { + struct InitReserveInput { + address aTokenImpl; + address stableDebtTokenImpl; + address variableDebtTokenImpl; + uint8 underlyingAssetDecimals; + address interestRateStrategyAddress; + address underlyingAsset; + address treasury; + address incentivesController; + string underlyingAssetName; + string aTokenName; + string aTokenSymbol; + string variableDebtTokenName; + string variableDebtTokenSymbol; + string stableDebtTokenName; + string stableDebtTokenSymbol; + } + + struct UpdateATokenInput { + address asset; + address treasury; + address incentivesController; + string name; + string symbol; + address implementation; + } + + struct UpdateDebtTokenInput { + address asset; + address incentivesController; + string name; + string symbol; + address implementation; + } + + /** + * @dev Emitted when a reserve is initialized. + * @param asset The address of the underlying asset of the reserve + * @param aToken The address of the associated aToken contract + * @param stableDebtToken The address of the associated stable rate debt token + * @param variableDebtToken The address of the associated variable rate debt token + * @param interestRateStrategyAddress The address of the interest rate strategy for the reserve + **/ + event ReserveInitialized( + address indexed asset, + address indexed aToken, + address stableDebtToken, + address variableDebtToken, + address interestRateStrategyAddress + ); + + /** + * @dev Emitted when borrowing is enabled on a reserve + * @param asset The address of the underlying asset of the reserve + * @param stableRateEnabled True if stable rate borrowing is enabled, false otherwise + **/ + event BorrowingEnabledOnReserve(address indexed asset, bool stableRateEnabled); + + /** + * @dev Emitted when borrowing is disabled on a reserve + * @param asset The address of the underlying asset of the reserve + **/ + event BorrowingDisabledOnReserve(address indexed asset); + + /** + * @dev Emitted when the collateralization risk parameters for the specified asset are updated. + * @param asset The address of the underlying asset of the reserve + * @param ltv The loan to value of the asset when used as collateral + * @param liquidationThreshold The threshold at which loans using this asset as collateral will be considered undercollateralized + * @param liquidationBonus The bonus liquidators receive to liquidate this asset + **/ + event CollateralConfigurationChanged( + address indexed asset, + uint256 ltv, + uint256 liquidationThreshold, + uint256 liquidationBonus + ); + + /** + * @dev Emitted when stable rate borrowing is enabled on a reserve + * @param asset The address of the underlying asset of the reserve + **/ + event StableRateEnabledOnReserve(address indexed asset); + + /** + * @dev Emitted when stable rate borrowing is disabled on a reserve + * @param asset The address of the underlying asset of the reserve + **/ + event StableRateDisabledOnReserve(address indexed asset); + + /** + * @dev Emitted when a reserve is activated + * @param asset The address of the underlying asset of the reserve + **/ + event ReserveActivated(address indexed asset); + + /** + * @dev Emitted when a reserve is deactivated + * @param asset The address of the underlying asset of the reserve + **/ + event ReserveDeactivated(address indexed asset); + + /** + * @dev Emitted when a reserve is frozen + * @param asset The address of the underlying asset of the reserve + **/ + event ReserveFrozen(address indexed asset); + + /** + * @dev Emitted when a reserve is unfrozen + * @param asset The address of the underlying asset of the reserve + **/ + event ReserveUnfrozen(address indexed asset); + + /** + * @dev Emitted when a reserve factor is updated + * @param asset The address of the underlying asset of the reserve + * @param factor The new reserve factor + **/ + event ReserveFactorChanged(address indexed asset, uint256 factor); + + /** + * @dev Emitted when the reserve decimals are updated + * @param asset The address of the underlying asset of the reserve + * @param decimals The new decimals + **/ + event ReserveDecimalsChanged(address indexed asset, uint256 decimals); + + /** + * @dev Emitted when a reserve interest strategy contract is updated + * @param asset The address of the underlying asset of the reserve + * @param strategy The new address of the interest strategy contract + **/ + event ReserveInterestRateStrategyChanged(address indexed asset, address strategy); + + /** + * @dev Emitted when an aToken implementation is upgraded + * @param asset The address of the underlying asset of the reserve + * @param proxy The aToken proxy address + * @param implementation The new aToken implementation + **/ + event ATokenUpgraded( + address indexed asset, + address indexed proxy, + address indexed implementation + ); + + /** + * @dev Emitted when the implementation of a stable debt token is upgraded + * @param asset The address of the underlying asset of the reserve + * @param proxy The stable debt token proxy address + * @param implementation The new aToken implementation + **/ + event StableDebtTokenUpgraded( + address indexed asset, + address indexed proxy, + address indexed implementation + ); + + /** + * @dev Emitted when the implementation of a variable debt token is upgraded + * @param asset The address of the underlying asset of the reserve + * @param proxy The variable debt token proxy address + * @param implementation The new aToken implementation + **/ + event VariableDebtTokenUpgraded( + address indexed asset, + address indexed proxy, + address indexed implementation + ); +} diff --git a/contracts/interfaces/IStableDebtToken.sol b/contracts/interfaces/IStableDebtToken.sol index c24750bc..e39cf8b5 100644 --- a/contracts/interfaces/IStableDebtToken.sol +++ b/contracts/interfaces/IStableDebtToken.sol @@ -1,6 +1,9 @@ // SPDX-License-Identifier: agpl-3.0 pragma solidity 0.6.12; +import {IInitializableDebtToken} from './IInitializableDebtToken.sol'; +import {IAaveIncentivesController} from './IAaveIncentivesController.sol'; + /** * @title IStableDebtToken * @notice Defines the interface for the stable debt token @@ -8,7 +11,7 @@ pragma solidity 0.6.12; * @author Aave **/ -interface IStableDebtToken { +interface IStableDebtToken is IInitializableDebtToken { /** * @dev Emitted when new stable debt is minted * @param user The address of the user who triggered the minting @@ -122,4 +125,9 @@ interface IStableDebtToken { * @return The debt balance of the user since the last burn/mint action **/ function principalBalanceOf(address user) external view returns (uint256); + + /** + * @dev Returns the address of the incentives controller contract + **/ + function getIncentivesController() external view returns (IAaveIncentivesController); } diff --git a/contracts/interfaces/IUniswapV2Router02.sol b/contracts/interfaces/IUniswapV2Router02.sol new file mode 100644 index 00000000..af0f8280 --- /dev/null +++ b/contracts/interfaces/IUniswapV2Router02.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: agpl-3.0 +pragma solidity 0.6.12; + +interface IUniswapV2Router02 { + function swapExactTokensForTokens( + uint256 amountIn, + uint256 amountOutMin, + address[] calldata path, + address to, + uint256 deadline + ) external returns (uint256[] memory amounts); + + function swapTokensForExactTokens( + uint amountOut, + uint amountInMax, + address[] calldata path, + address to, + uint deadline + ) external returns (uint256[] memory amounts); + + function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); + + function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); +} diff --git a/contracts/interfaces/IVariableDebtToken.sol b/contracts/interfaces/IVariableDebtToken.sol index 6a0c1555..d88c25fc 100644 --- a/contracts/interfaces/IVariableDebtToken.sol +++ b/contracts/interfaces/IVariableDebtToken.sol @@ -2,13 +2,15 @@ pragma solidity 0.6.12; import {IScaledBalanceToken} from './IScaledBalanceToken.sol'; +import {IInitializableDebtToken} from './IInitializableDebtToken.sol'; +import {IAaveIncentivesController} from './IAaveIncentivesController.sol'; /** * @title IVariableDebtToken * @author Aave * @notice Defines the basic interface for a variable debt token. **/ -interface IVariableDebtToken is IScaledBalanceToken { +interface IVariableDebtToken is IScaledBalanceToken, IInitializableDebtToken { /** * @dev Emitted after the mint action * @param from The address performing the mint @@ -52,4 +54,9 @@ interface IVariableDebtToken is IScaledBalanceToken { uint256 amount, uint256 index ) external; + + /** + * @dev Returns the address of the incentives controller contract + **/ + function getIncentivesController() external view returns (IAaveIncentivesController); } diff --git a/contracts/mocks/swap/MockUniswapV2Router02.sol b/contracts/mocks/swap/MockUniswapV2Router02.sol new file mode 100644 index 00000000..b7fd3f80 --- /dev/null +++ b/contracts/mocks/swap/MockUniswapV2Router02.sol @@ -0,0 +1,106 @@ +// SPDX-License-Identifier: agpl-3.0 +pragma solidity 0.6.12; + +import {IUniswapV2Router02} from '../../interfaces/IUniswapV2Router02.sol'; +import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol'; +import {MintableERC20} from '../tokens/MintableERC20.sol'; + +contract MockUniswapV2Router02 is IUniswapV2Router02 { + mapping(address => uint256) internal _amountToReturn; + mapping(address => uint256) internal _amountToSwap; + mapping(address => mapping(address => mapping(uint256 => uint256))) internal _amountsIn; + mapping(address => mapping(address => mapping(uint256 => uint256))) internal _amountsOut; + uint256 internal defaultMockValue; + + function setAmountToReturn(address reserve, uint256 amount) public { + _amountToReturn[reserve] = amount; + } + + function setAmountToSwap(address reserve, uint256 amount) public { + _amountToSwap[reserve] = amount; + } + + function swapExactTokensForTokens( + uint256 amountIn, + uint256, /* amountOutMin */ + address[] calldata path, + address to, + uint256 /* deadline */ + ) external override returns (uint256[] memory amounts) { + IERC20(path[0]).transferFrom(msg.sender, address(this), amountIn); + + MintableERC20(path[1]).mint(_amountToReturn[path[0]]); + IERC20(path[1]).transfer(to, _amountToReturn[path[0]]); + + amounts = new uint256[](path.length); + amounts[0] = amountIn; + amounts[1] = _amountToReturn[path[0]]; + } + + function swapTokensForExactTokens( + uint256 amountOut, + uint256, /* amountInMax */ + address[] calldata path, + address to, + uint256 /* deadline */ + ) external override returns (uint256[] memory amounts) { + IERC20(path[0]).transferFrom(msg.sender, address(this), _amountToSwap[path[0]]); + + MintableERC20(path[1]).mint(amountOut); + IERC20(path[1]).transfer(to, amountOut); + + amounts = new uint256[](path.length); + amounts[0] = _amountToSwap[path[0]]; + amounts[1] = amountOut; + } + + function setAmountOut( + uint256 amountIn, + address reserveIn, + address reserveOut, + uint256 amountOut + ) public { + _amountsOut[reserveIn][reserveOut][amountIn] = amountOut; + } + + function setAmountIn( + uint256 amountOut, + address reserveIn, + address reserveOut, + uint256 amountIn + ) public { + _amountsIn[reserveIn][reserveOut][amountOut] = amountIn; + } + + function setDefaultMockValue(uint256 value) public { + defaultMockValue = value; + } + + function getAmountsOut(uint256 amountIn, address[] calldata path) + external + view + override + returns (uint256[] memory) + { + uint256[] memory amounts = new uint256[](path.length); + amounts[0] = amountIn; + amounts[1] = _amountsOut[path[0]][path[1]][amountIn] > 0 + ? _amountsOut[path[0]][path[1]][amountIn] + : defaultMockValue; + return amounts; + } + + function getAmountsIn(uint256 amountOut, address[] calldata path) + external + view + override + returns (uint256[] memory) + { + uint256[] memory amounts = new uint256[](path.length); + amounts[0] = _amountsIn[path[0]][path[1]][amountOut] > 0 + ? _amountsIn[path[0]][path[1]][amountOut] + : defaultMockValue; + amounts[1] = amountOut; + return amounts; + } +} diff --git a/contracts/mocks/upgradeability/MockAToken.sol b/contracts/mocks/upgradeability/MockAToken.sol index f0eda38c..7e7b6f2a 100644 --- a/contracts/mocks/upgradeability/MockAToken.sol +++ b/contracts/mocks/upgradeability/MockAToken.sol @@ -2,39 +2,11 @@ pragma solidity 0.6.12; import {AToken} from '../../protocol/tokenization/AToken.sol'; -import {LendingPool} from '../../protocol/lendingpool/LendingPool.sol'; +import {ILendingPool} from '../../interfaces/ILendingPool.sol'; +import {IAaveIncentivesController} from '../../interfaces/IAaveIncentivesController.sol'; contract MockAToken is AToken { - constructor( - LendingPool pool, - address underlyingAssetAddress, - address reserveTreasury, - string memory tokenName, - string memory tokenSymbol, - address incentivesController - ) - public - AToken( - pool, - underlyingAssetAddress, - reserveTreasury, - tokenName, - tokenSymbol, - incentivesController - ) - {} - function getRevision() internal pure override returns (uint256) { return 0x2; } - - function initialize( - uint8 _underlyingAssetDecimals, - string calldata _tokenName, - string calldata _tokenSymbol - ) external virtual override initializer { - _setName(_tokenName); - _setSymbol(_tokenSymbol); - _setDecimals(_underlyingAssetDecimals); - } } diff --git a/contracts/mocks/upgradeability/MockStableDebtToken.sol b/contracts/mocks/upgradeability/MockStableDebtToken.sol index 5030c171..cbc66664 100644 --- a/contracts/mocks/upgradeability/MockStableDebtToken.sol +++ b/contracts/mocks/upgradeability/MockStableDebtToken.sol @@ -4,17 +4,6 @@ pragma solidity 0.6.12; import {StableDebtToken} from '../../protocol/tokenization/StableDebtToken.sol'; contract MockStableDebtToken is StableDebtToken { - constructor( - address _pool, - address _underlyingAssetAddress, - string memory _tokenName, - string memory _tokenSymbol, - address incentivesController - ) - public - StableDebtToken(_pool, _underlyingAssetAddress, _tokenName, _tokenSymbol, incentivesController) - {} - function getRevision() internal pure override returns (uint256) { return 0x2; } diff --git a/contracts/mocks/upgradeability/MockVariableDebtToken.sol b/contracts/mocks/upgradeability/MockVariableDebtToken.sol index 0a9a03aa..497682c3 100644 --- a/contracts/mocks/upgradeability/MockVariableDebtToken.sol +++ b/contracts/mocks/upgradeability/MockVariableDebtToken.sol @@ -4,23 +4,6 @@ pragma solidity 0.6.12; import {VariableDebtToken} from '../../protocol/tokenization/VariableDebtToken.sol'; contract MockVariableDebtToken is VariableDebtToken { - constructor( - address _pool, - address _underlyingAssetAddress, - string memory _tokenName, - string memory _tokenSymbol, - address incentivesController - ) - public - VariableDebtToken( - _pool, - _underlyingAssetAddress, - _tokenName, - _tokenSymbol, - incentivesController - ) - {} - function getRevision() internal pure override returns (uint256) { return 0x2; } diff --git a/contracts/protocol/lendingpool/LendingPool.sol b/contracts/protocol/lendingpool/LendingPool.sol index 7c48f237..75e80230 100644 --- a/contracts/protocol/lendingpool/LendingPool.sol +++ b/contracts/protocol/lendingpool/LendingPool.sol @@ -49,10 +49,6 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage using PercentageMath for uint256; using SafeERC20 for IERC20; - //main configuration parameters - uint256 public constant MAX_STABLE_RATE_BORROW_SIZE_PERCENT = 2500; - uint256 public constant FLASHLOAN_PREMIUM_TOTAL = 9; - uint256 public constant MAX_NUMBER_RESERVES = 128; uint256 public constant LENDINGPOOL_REVISION = 0x2; modifier whenNotPaused() { @@ -86,9 +82,20 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage * - Caching the address of the LendingPoolAddressesProvider in order to reduce gas consumption * on subsequent operations * @param provider The address of the LendingPoolAddressesProvider + * @param maxStableRateBorrowSizePercent The percentage of available liquidity that can be borrowed at once at stable rate + * @param flashLoanPremiumTotal The fee on flash loans + * @param maxNumberOfReserves Maximum number of reserves supported to be listed in this LendingPool **/ - function initialize(ILendingPoolAddressesProvider provider) public initializer { + function initialize( + ILendingPoolAddressesProvider provider, + uint256 maxStableRateBorrowSizePercent, + uint256 flashLoanPremiumTotal, + uint256 maxNumberOfReserves + ) public initializer { _addressesProvider = provider; + _maxStableRateBorrowSizePercent = maxStableRateBorrowSizePercent; + _flashLoanPremiumTotal = flashLoanPremiumTotal; + _maxNumberOfReserves = maxNumberOfReserves; } /** @@ -144,7 +151,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage address asset, uint256 amount, address to - ) external override whenNotPaused returns (uint256) { + ) external override whenNotPaused returns (uint256) { DataTypes.ReserveData storage reserve = _reserves[asset]; address aToken = reserve.aTokenAddress; @@ -499,7 +506,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage for (vars.i = 0; vars.i < assets.length; vars.i++) { aTokenAddresses[vars.i] = _reserves[assets[vars.i]].aTokenAddress; - premiums[vars.i] = amounts[vars.i].mul(FLASHLOAN_PREMIUM_TOTAL).div(10000); + premiums[vars.i] = amounts[vars.i].mul(_flashLoanPremiumTotal).div(10000); IAToken(aTokenAddresses[vars.i]).transferUnderlyingTo(receiverAddress, amounts[vars.i]); } @@ -703,6 +710,27 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage return _addressesProvider; } + /** + * @dev Returns the percentage of available liquidity that can be borrowed at once at stable rate + */ + function MAX_STABLE_RATE_BORROW_SIZE_PERCENT() public view returns (uint256) { + return _maxStableRateBorrowSizePercent; + } + + /** + * @dev Returns the fee on flash loans + */ + function FLASHLOAN_PREMIUM_TOTAL() public view returns (uint256) { + return _flashLoanPremiumTotal; + } + + /** + * @dev Returns the maximum number of reserves supported to be listed in this LendingPool + */ + function MAX_NUMBER_RESERVES() public view returns (uint256) { + return _maxNumberOfReserves; + } + /** * @dev Validates and finalizes an aToken transfer * - Only callable by the overlying aToken of the `asset` @@ -847,7 +875,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage vars.amount, amountInETH, vars.interestRateMode, - MAX_STABLE_RATE_BORROW_SIZE_PERCENT, + _maxStableRateBorrowSizePercent, _reserves, userConfig, _reservesList, @@ -909,7 +937,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage function _addReserveToList(address asset) internal { uint256 reservesCount = _reservesCount; - require(reservesCount < MAX_NUMBER_RESERVES, Errors.LP_NO_MORE_RESERVES_ALLOWED); + require(reservesCount < _maxNumberOfReserves, Errors.LP_NO_MORE_RESERVES_ALLOWED); bool reserveAlreadyAdded = _reserves[asset].id != 0 || _reservesList[0] == asset; diff --git a/contracts/protocol/lendingpool/LendingPoolConfigurator.sol b/contracts/protocol/lendingpool/LendingPoolConfigurator.sol index bb3fb774..f42415ca 100644 --- a/contracts/protocol/lendingpool/LendingPoolConfigurator.sol +++ b/contracts/protocol/lendingpool/LendingPoolConfigurator.sol @@ -10,11 +10,14 @@ import { import {ReserveConfiguration} from '../libraries/configuration/ReserveConfiguration.sol'; import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol'; import {ILendingPool} from '../../interfaces/ILendingPool.sol'; -import {ITokenConfiguration} from '../../interfaces/ITokenConfiguration.sol'; import {IERC20Detailed} from '../../dependencies/openzeppelin/contracts/IERC20Detailed.sol'; import {Errors} from '../libraries/helpers/Errors.sol'; import {PercentageMath} from '../libraries/math/PercentageMath.sol'; import {DataTypes} from '../libraries/types/DataTypes.sol'; +import {IInitializableDebtToken} from '../../interfaces/IInitializableDebtToken.sol'; +import {IInitializableAToken} from '../../interfaces/IInitializableAToken.sol'; +import {IAaveIncentivesController} from '../../interfaces/IAaveIncentivesController.sol'; +import {ILendingPoolConfigurator} from '../../interfaces/ILendingPoolConfigurator.sol'; /** * @title LendingPoolConfigurator contract @@ -22,147 +25,11 @@ import {DataTypes} from '../libraries/types/DataTypes.sol'; * @dev Implements the configuration methods for the Aave protocol **/ -contract LendingPoolConfigurator is VersionedInitializable { +contract LendingPoolConfigurator is VersionedInitializable, ILendingPoolConfigurator { using SafeMath for uint256; using PercentageMath for uint256; using ReserveConfiguration for DataTypes.ReserveConfigurationMap; - /** - * @dev Emitted when a reserve is initialized. - * @param asset The address of the underlying asset of the reserve - * @param aToken The address of the associated aToken contract - * @param stableDebtToken The address of the associated stable rate debt token - * @param variableDebtToken The address of the associated variable rate debt token - * @param interestRateStrategyAddress The address of the interest rate strategy for the reserve - **/ - event ReserveInitialized( - address indexed asset, - address indexed aToken, - address stableDebtToken, - address variableDebtToken, - address interestRateStrategyAddress - ); - - /** - * @dev Emitted when borrowing is enabled on a reserve - * @param asset The address of the underlying asset of the reserve - * @param stableRateEnabled True if stable rate borrowing is enabled, false otherwise - **/ - event BorrowingEnabledOnReserve(address indexed asset, bool stableRateEnabled); - - /** - * @dev Emitted when borrowing is disabled on a reserve - * @param asset The address of the underlying asset of the reserve - **/ - event BorrowingDisabledOnReserve(address indexed asset); - - /** - * @dev Emitted when the collateralization risk parameters for the specified asset are updated. - * @param asset The address of the underlying asset of the reserve - * @param ltv The loan to value of the asset when used as collateral - * @param liquidationThreshold The threshold at which loans using this asset as collateral will be considered undercollateralized - * @param liquidationBonus The bonus liquidators receive to liquidate this asset - **/ - event CollateralConfigurationChanged( - address indexed asset, - uint256 ltv, - uint256 liquidationThreshold, - uint256 liquidationBonus - ); - - /** - * @dev Emitted when stable rate borrowing is enabled on a reserve - * @param asset The address of the underlying asset of the reserve - **/ - event StableRateEnabledOnReserve(address indexed asset); - - /** - * @dev Emitted when stable rate borrowing is disabled on a reserve - * @param asset The address of the underlying asset of the reserve - **/ - event StableRateDisabledOnReserve(address indexed asset); - - /** - * @dev Emitted when a reserve is activated - * @param asset The address of the underlying asset of the reserve - **/ - event ReserveActivated(address indexed asset); - - /** - * @dev Emitted when a reserve is deactivated - * @param asset The address of the underlying asset of the reserve - **/ - event ReserveDeactivated(address indexed asset); - - /** - * @dev Emitted when a reserve is frozen - * @param asset The address of the underlying asset of the reserve - **/ - event ReserveFrozen(address indexed asset); - - /** - * @dev Emitted when a reserve is unfrozen - * @param asset The address of the underlying asset of the reserve - **/ - event ReserveUnfrozen(address indexed asset); - - /** - * @dev Emitted when a reserve factor is updated - * @param asset The address of the underlying asset of the reserve - * @param factor The new reserve factor - **/ - event ReserveFactorChanged(address indexed asset, uint256 factor); - - /** - * @dev Emitted when the reserve decimals are updated - * @param asset The address of the underlying asset of the reserve - * @param decimals The new decimals - **/ - event ReserveDecimalsChanged(address indexed asset, uint256 decimals); - - /** - * @dev Emitted when a reserve interest strategy contract is updated - * @param asset The address of the underlying asset of the reserve - * @param strategy The new address of the interest strategy contract - **/ - event ReserveInterestRateStrategyChanged(address indexed asset, address strategy); - - /** - * @dev Emitted when an aToken implementation is upgraded - * @param asset The address of the underlying asset of the reserve - * @param proxy The aToken proxy address - * @param implementation The new aToken implementation - **/ - event ATokenUpgraded( - address indexed asset, - address indexed proxy, - address indexed implementation - ); - - /** - * @dev Emitted when the implementation of a stable debt token is upgraded - * @param asset The address of the underlying asset of the reserve - * @param proxy The stable debt token proxy address - * @param implementation The new aToken implementation - **/ - event StableDebtTokenUpgraded( - address indexed asset, - address indexed proxy, - address indexed implementation - ); - - /** - * @dev Emitted when the implementation of a variable debt token is upgraded - * @param asset The address of the underlying asset of the reserve - * @param proxy The variable debt token proxy address - * @param implementation The new aToken implementation - **/ - event VariableDebtTokenUpgraded( - address indexed asset, - address indexed proxy, - address indexed implementation - ); - ILendingPoolAddressesProvider internal addressesProvider; ILendingPool internal pool; @@ -191,114 +58,186 @@ contract LendingPoolConfigurator is VersionedInitializable { } /** - * @dev Initializes a reserve - * @param aTokenImpl The address of the aToken contract implementation - * @param stableDebtTokenImpl The address of the stable debt token contract - * @param variableDebtTokenImpl The address of the variable debt token contract - * @param underlyingAssetDecimals The decimals of the reserve underlying asset - * @param interestRateStrategyAddress The address of the interest rate strategy contract for this reserve + * @dev Initializes reserves in batch **/ - function initReserve( - address aTokenImpl, - address stableDebtTokenImpl, - address variableDebtTokenImpl, - uint8 underlyingAssetDecimals, - address interestRateStrategyAddress - ) public onlyPoolAdmin { - address asset = ITokenConfiguration(aTokenImpl).UNDERLYING_ASSET_ADDRESS(); + function batchInitReserve(InitReserveInput[] calldata inputParams) public onlyPoolAdmin { + ILendingPool cachedPool = pool; + for (uint256 i = 0; i < inputParams.length; i++) { + _initReserve(cachedPool, inputParams[i]); + } + } - require( - address(pool) == ITokenConfiguration(aTokenImpl).POOL(), - Errors.LPC_INVALID_ATOKEN_POOL_ADDRESS - ); - require( - address(pool) == ITokenConfiguration(stableDebtTokenImpl).POOL(), - Errors.LPC_INVALID_STABLE_DEBT_TOKEN_POOL_ADDRESS - ); - require( - address(pool) == ITokenConfiguration(variableDebtTokenImpl).POOL(), - Errors.LPC_INVALID_VARIABLE_DEBT_TOKEN_POOL_ADDRESS - ); - require( - asset == ITokenConfiguration(stableDebtTokenImpl).UNDERLYING_ASSET_ADDRESS(), - Errors.LPC_INVALID_STABLE_DEBT_TOKEN_UNDERLYING_ADDRESS - ); - require( - asset == ITokenConfiguration(variableDebtTokenImpl).UNDERLYING_ASSET_ADDRESS(), - Errors.LPC_INVALID_VARIABLE_DEBT_TOKEN_UNDERLYING_ADDRESS - ); - - address aTokenProxyAddress = _initTokenWithProxy(aTokenImpl, underlyingAssetDecimals); + function _initReserve(ILendingPool pool, InitReserveInput calldata inputParams) internal { + address aTokenProxyAddress = + _initTokenWithProxy( + inputParams.aTokenImpl, + abi.encodeWithSelector( + IInitializableAToken.initialize.selector, + pool, + inputParams.treasury, + inputParams.underlyingAsset, + IAaveIncentivesController(inputParams.incentivesController), + inputParams.underlyingAssetDecimals, + inputParams.aTokenName, + inputParams.aTokenSymbol + ) + ); address stableDebtTokenProxyAddress = - _initTokenWithProxy(stableDebtTokenImpl, underlyingAssetDecimals); + _initTokenWithProxy( + inputParams.stableDebtTokenImpl, + abi.encodeWithSelector( + IInitializableDebtToken.initialize.selector, + pool, + inputParams.underlyingAsset, + IAaveIncentivesController(inputParams.incentivesController), + inputParams.underlyingAssetDecimals, + inputParams.stableDebtTokenName, + inputParams.stableDebtTokenSymbol + ) + ); address variableDebtTokenProxyAddress = - _initTokenWithProxy(variableDebtTokenImpl, underlyingAssetDecimals); + _initTokenWithProxy( + inputParams.variableDebtTokenImpl, + abi.encodeWithSelector( + IInitializableDebtToken.initialize.selector, + pool, + inputParams.underlyingAsset, + IAaveIncentivesController(inputParams.incentivesController), + inputParams.underlyingAssetDecimals, + inputParams.variableDebtTokenName, + inputParams.variableDebtTokenSymbol + ) + ); pool.initReserve( - asset, + inputParams.underlyingAsset, aTokenProxyAddress, stableDebtTokenProxyAddress, variableDebtTokenProxyAddress, - interestRateStrategyAddress + inputParams.interestRateStrategyAddress ); - DataTypes.ReserveConfigurationMap memory currentConfig = pool.getConfiguration(asset); + DataTypes.ReserveConfigurationMap memory currentConfig = + pool.getConfiguration(inputParams.underlyingAsset); - currentConfig.setDecimals(underlyingAssetDecimals); + currentConfig.setDecimals(inputParams.underlyingAssetDecimals); currentConfig.setActive(true); currentConfig.setFrozen(false); - pool.setConfiguration(asset, currentConfig.data); + pool.setConfiguration(inputParams.underlyingAsset, currentConfig.data); emit ReserveInitialized( - asset, + inputParams.underlyingAsset, aTokenProxyAddress, stableDebtTokenProxyAddress, variableDebtTokenProxyAddress, - interestRateStrategyAddress + inputParams.interestRateStrategyAddress ); } /** * @dev Updates the aToken implementation for the reserve - * @param asset The address of the underlying asset of the reserve to be updated - * @param implementation The address of the new aToken implementation **/ - function updateAToken(address asset, address implementation) external onlyPoolAdmin { - DataTypes.ReserveData memory reserveData = pool.getReserveData(asset); + function updateAToken(UpdateATokenInput calldata inputParams) external onlyPoolAdmin { + ILendingPool cachedPool = pool; - _upgradeTokenImplementation(asset, reserveData.aTokenAddress, implementation); + DataTypes.ReserveData memory reserveData = cachedPool.getReserveData(inputParams.asset); - emit ATokenUpgraded(asset, reserveData.aTokenAddress, implementation); + DataTypes.ReserveConfigurationMap memory configuration = + cachedPool.getConfiguration(inputParams.asset); + + (, , , uint256 decimals, ) = configuration.getParamsMemory(); + + _upgradeTokenImplementation( + reserveData.aTokenAddress, + inputParams.implementation, + abi.encodeWithSelector( + IInitializableAToken.initialize.selector, + cachedPool, + inputParams.treasury, + inputParams.asset, + inputParams.incentivesController, + decimals, + inputParams.name, + inputParams.symbol + ) + ); + + emit ATokenUpgraded(inputParams.asset, reserveData.aTokenAddress, inputParams.implementation); } /** * @dev Updates the stable debt token implementation for the reserve - * @param asset The address of the underlying asset of the reserve to be updated - * @param implementation The address of the new aToken implementation **/ - function updateStableDebtToken(address asset, address implementation) external onlyPoolAdmin { - DataTypes.ReserveData memory reserveData = pool.getReserveData(asset); + function updateStableDebtToken(UpdateDebtTokenInput calldata inputParams) external onlyPoolAdmin { + ILendingPool cachedPool = pool; - _upgradeTokenImplementation(asset, reserveData.stableDebtTokenAddress, implementation); + DataTypes.ReserveData memory reserveData = cachedPool.getReserveData(inputParams.asset); - emit StableDebtTokenUpgraded(asset, reserveData.stableDebtTokenAddress, implementation); + DataTypes.ReserveConfigurationMap memory configuration = + cachedPool.getConfiguration(inputParams.asset); + + (, , , uint256 decimals, ) = configuration.getParamsMemory(); + + _upgradeTokenImplementation( + reserveData.stableDebtTokenAddress, + inputParams.implementation, + abi.encodeWithSelector( + IInitializableDebtToken.initialize.selector, + cachedPool, + inputParams.asset, + inputParams.incentivesController, + decimals, + inputParams.name, + inputParams.symbol + ) + ); + + emit StableDebtTokenUpgraded( + inputParams.asset, + reserveData.stableDebtTokenAddress, + inputParams.implementation + ); } /** * @dev Updates the variable debt token implementation for the asset - * @param asset The address of the underlying asset of the reserve to be updated - * @param implementation The address of the new aToken implementation **/ - function updateVariableDebtToken(address asset, address implementation) external onlyPoolAdmin { - DataTypes.ReserveData memory reserveData = pool.getReserveData(asset); + function updateVariableDebtToken(UpdateDebtTokenInput calldata inputParams) + external + onlyPoolAdmin + { + ILendingPool cachedPool = pool; - _upgradeTokenImplementation(asset, reserveData.variableDebtTokenAddress, implementation); + DataTypes.ReserveData memory reserveData = cachedPool.getReserveData(inputParams.asset); - emit VariableDebtTokenUpgraded(asset, reserveData.variableDebtTokenAddress, implementation); + DataTypes.ReserveConfigurationMap memory configuration = + cachedPool.getConfiguration(inputParams.asset); + + (, , , uint256 decimals, ) = configuration.getParamsMemory(); + + _upgradeTokenImplementation( + reserveData.variableDebtTokenAddress, + inputParams.implementation, + abi.encodeWithSelector( + IInitializableDebtToken.initialize.selector, + cachedPool, + inputParams.asset, + inputParams.incentivesController, + decimals, + inputParams.name, + inputParams.symbol + ) + ); + + emit VariableDebtTokenUpgraded( + inputParams.asset, + reserveData.variableDebtTokenAddress, + inputParams.implementation + ); } /** @@ -509,44 +448,27 @@ contract LendingPoolConfigurator is VersionedInitializable { pool.setPause(val); } - function _initTokenWithProxy(address implementation, uint8 decimals) internal returns (address) { + function _initTokenWithProxy(address implementation, bytes memory initParams) + internal + returns (address) + { InitializableImmutableAdminUpgradeabilityProxy proxy = new InitializableImmutableAdminUpgradeabilityProxy(address(this)); - bytes memory params = - abi.encodeWithSignature( - 'initialize(uint8,string,string)', - decimals, - IERC20Detailed(implementation).name(), - IERC20Detailed(implementation).symbol() - ); - - proxy.initialize(implementation, params); + proxy.initialize(implementation, initParams); return address(proxy); } function _upgradeTokenImplementation( - address asset, address proxyAddress, - address implementation + address implementation, + bytes memory initParams ) internal { InitializableImmutableAdminUpgradeabilityProxy proxy = InitializableImmutableAdminUpgradeabilityProxy(payable(proxyAddress)); - DataTypes.ReserveConfigurationMap memory configuration = pool.getConfiguration(asset); - - (, , , uint256 decimals, ) = configuration.getParamsMemory(); - - bytes memory params = - abi.encodeWithSignature( - 'initialize(uint8,string,string)', - uint8(decimals), - IERC20Detailed(implementation).name(), - IERC20Detailed(implementation).symbol() - ); - - proxy.upgradeToAndCall(implementation, params); + proxy.upgradeToAndCall(implementation, initParams); } function _checkNoLiquidity(address asset) internal view { diff --git a/contracts/protocol/lendingpool/LendingPoolStorage.sol b/contracts/protocol/lendingpool/LendingPoolStorage.sol index 4edff4a3..198a3eea 100644 --- a/contracts/protocol/lendingpool/LendingPoolStorage.sol +++ b/contracts/protocol/lendingpool/LendingPoolStorage.sol @@ -23,4 +23,10 @@ contract LendingPoolStorage { uint256 internal _reservesCount; bool internal _paused; + + uint256 internal _maxStableRateBorrowSizePercent; + + uint256 internal _flashLoanPremiumTotal; + + uint256 internal _maxNumberOfReserves; } diff --git a/contracts/protocol/libraries/logic/ValidationLogic.sol b/contracts/protocol/libraries/logic/ValidationLogic.sol index d08e7055..080b792d 100644 --- a/contracts/protocol/libraries/logic/ValidationLogic.sol +++ b/contracts/protocol/libraries/logic/ValidationLogic.sol @@ -89,20 +89,13 @@ library ValidationLogic { } struct ValidateBorrowLocalVars { - uint256 principalBorrowBalance; uint256 currentLtv; uint256 currentLiquidationThreshold; - uint256 requestedBorrowAmountETH; uint256 amountOfCollateralNeededETH; uint256 userCollateralBalanceETH; uint256 userBorrowBalanceETH; - uint256 borrowBalanceIncrease; - uint256 currentReserveStableRate; uint256 availableLiquidity; - uint256 finalUserBorrowRate; uint256 healthFactor; - DataTypes.InterestRateMode rateMode; - bool healthFactorBelowThreshold; bool isActive; bool isFrozen; bool borrowingEnabled; @@ -197,7 +190,7 @@ library ValidationLogic { * 3. Users will be able to borrow only a portion of the total available liquidity **/ - if (vars.rateMode == DataTypes.InterestRateMode.STABLE) { + if (interestRateMode == uint256(DataTypes.InterestRateMode.STABLE)) { //check if the borrow mode is stable and if stable rate borrowing is enabled on this reserve require(vars.stableRateBorrowingEnabled, Errors.VL_STABLE_BORROWING_NOT_ENABLED); diff --git a/contracts/protocol/tokenization/AToken.sol b/contracts/protocol/tokenization/AToken.sol index 00df0b61..1a47ebf4 100644 --- a/contracts/protocol/tokenization/AToken.sol +++ b/contracts/protocol/tokenization/AToken.sol @@ -9,13 +9,18 @@ import {WadRayMath} from '../libraries/math/WadRayMath.sol'; import {Errors} from '../libraries/helpers/Errors.sol'; import {VersionedInitializable} from '../libraries/aave-upgradeability/VersionedInitializable.sol'; import {IncentivizedERC20} from './IncentivizedERC20.sol'; +import {IAaveIncentivesController} from '../../interfaces/IAaveIncentivesController.sol'; /** * @title Aave ERC20 AToken * @dev Implementation of the interest bearing token for the Aave protocol * @author Aave */ -contract AToken is VersionedInitializable, IncentivizedERC20, IAToken { +contract AToken is + VersionedInitializable, + IncentivizedERC20('ATOKEN_IMPL', 'ATOKEN_IMPL', 0), + IAToken +{ using WadRayMath for uint256; using SafeERC20 for IERC20; @@ -25,44 +30,46 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken { bytes32 public constant PERMIT_TYPEHASH = keccak256('Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)'); - uint256 public constant UINT_MAX_VALUE = uint256(-1); uint256 public constant ATOKEN_REVISION = 0x1; - address public immutable UNDERLYING_ASSET_ADDRESS; - address public immutable RESERVE_TREASURY_ADDRESS; - ILendingPool public immutable POOL; /// @dev owner => next valid nonce to submit with permit() mapping(address => uint256) public _nonces; bytes32 public DOMAIN_SEPARATOR; - modifier onlyLendingPool { - require(_msgSender() == address(POOL), Errors.CT_CALLER_MUST_BE_LENDING_POOL); - _; - } + ILendingPool internal _pool; + address internal _treasury; + address internal _underlyingAsset; + IAaveIncentivesController internal _incentivesController; - constructor( - ILendingPool pool, - address underlyingAssetAddress, - address reserveTreasuryAddress, - string memory tokenName, - string memory tokenSymbol, - address incentivesController - ) public IncentivizedERC20(tokenName, tokenSymbol, 18, incentivesController) { - POOL = pool; - UNDERLYING_ASSET_ADDRESS = underlyingAssetAddress; - RESERVE_TREASURY_ADDRESS = reserveTreasuryAddress; + modifier onlyLendingPool { + require(_msgSender() == address(_pool), Errors.CT_CALLER_MUST_BE_LENDING_POOL); + _; } function getRevision() internal pure virtual override returns (uint256) { return ATOKEN_REVISION; } + /** + * @dev Initializes the aToken + * @param pool The address of the lending pool where this aToken will be used + * @param treasury The address of the Aave treasury, receiving the fees on this aToken + * @param underlyingAsset The address of the underlying asset of this aToken (E.g. WETH for aWETH) + * @param incentivesController The smart contract managing potential incentives distribution + * @param aTokenDecimals The decimals of the aToken, same as the underlying asset's + * @param aTokenName The name of the aToken + * @param aTokenSymbol The symbol of the aToken + */ function initialize( - uint8 underlyingAssetDecimals, - string calldata tokenName, - string calldata tokenSymbol - ) external virtual initializer { + ILendingPool pool, + address treasury, + address underlyingAsset, + IAaveIncentivesController incentivesController, + uint8 aTokenDecimals, + string calldata aTokenName, + string calldata aTokenSymbol + ) external override initializer { uint256 chainId; //solium-disable-next-line @@ -73,16 +80,21 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken { DOMAIN_SEPARATOR = keccak256( abi.encode( EIP712_DOMAIN, - keccak256(bytes(tokenName)), + keccak256(bytes(aTokenName)), keccak256(EIP712_REVISION), chainId, address(this) ) ); - _setName(tokenName); - _setSymbol(tokenSymbol); - _setDecimals(underlyingAssetDecimals); + _setName(aTokenName); + _setSymbol(aTokenSymbol); + _setDecimals(aTokenDecimals); + + _pool = pool; + _treasury = treasury; + _underlyingAsset = underlyingAsset; + _incentivesController = incentivesController; } /** @@ -103,7 +115,7 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken { require(amountScaled != 0, Errors.CT_INVALID_BURN_AMOUNT); _burn(user, amountScaled); - IERC20(UNDERLYING_ASSET_ADDRESS).safeTransfer(receiverOfUnderlying, amount); + IERC20(_underlyingAsset).safeTransfer(receiverOfUnderlying, amount); emit Transfer(user, address(0), amount); emit Burn(user, receiverOfUnderlying, amount, index); @@ -145,14 +157,16 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken { return; } + address treasury = _treasury; + // Compared to the normal mint, we don't check for rounding errors. // The amount to mint can easily be very small since it is a fraction of the interest ccrued. // In that case, the treasury will experience a (very small) loss, but it // wont cause potentially valid transactions to fail. - _mint(RESERVE_TREASURY_ADDRESS, amount.rayDiv(index)); + _mint(treasury, amount.rayDiv(index)); - emit Transfer(address(0), RESERVE_TREASURY_ADDRESS, amount); - emit Mint(RESERVE_TREASURY_ADDRESS, amount, index); + emit Transfer(address(0), treasury, amount); + emit Mint(treasury, amount, index); } /** @@ -185,7 +199,7 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken { override(IncentivizedERC20, IERC20) returns (uint256) { - return super.balanceOf(user).rayMul(POOL.getReserveNormalizedIncome(UNDERLYING_ASSET_ADDRESS)); + return super.balanceOf(user).rayMul(_pool.getReserveNormalizedIncome(_underlyingAsset)); } /** @@ -226,7 +240,7 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken { return 0; } - return currentSupplyScaled.rayMul(POOL.getReserveNormalizedIncome(UNDERLYING_ASSET_ADDRESS)); + return currentSupplyScaled.rayMul(_pool.getReserveNormalizedIncome(_underlyingAsset)); } /** @@ -237,6 +251,41 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken { return super.totalSupply(); } + /** + * @dev Returns the address of the Aave treasury, receiving the fees on this aToken + **/ + function RESERVE_TREASURY_ADDRESS() public view returns (address) { + return _treasury; + } + + /** + * @dev Returns the address of the underlying asset of this aToken (E.g. WETH for aWETH) + **/ + function UNDERLYING_ASSET_ADDRESS() public view returns (address) { + return _underlyingAsset; + } + + /** + * @dev Returns the address of the lending pool where this aToken is used + **/ + function POOL() public view returns (ILendingPool) { + return _pool; + } + + /** + * @dev For internal usage in the logic of the parent contract IncentivizedERC20 + **/ + function _getIncentivesController() internal view override returns (IAaveIncentivesController) { + return _incentivesController; + } + + /** + * @dev Returns the address of the incentives controller contract + **/ + function getIncentivesController() external view override returns (IAaveIncentivesController) { + return _getIncentivesController(); + } + /** * @dev Transfers the underlying asset to `target`. Used by the LendingPool to transfer * assets in borrow(), withdraw() and flashLoan() @@ -250,7 +299,7 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken { onlyLendingPool returns (uint256) { - IERC20(UNDERLYING_ASSET_ADDRESS).safeTransfer(target, amount); + IERC20(_underlyingAsset).safeTransfer(target, amount); return amount; } @@ -305,7 +354,10 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken { uint256 amount, bool validate ) internal { - uint256 index = POOL.getReserveNormalizedIncome(UNDERLYING_ASSET_ADDRESS); + address underlyingAsset = _underlyingAsset; + ILendingPool pool = _pool; + + uint256 index = pool.getReserveNormalizedIncome(underlyingAsset); uint256 fromBalanceBefore = super.balanceOf(from).rayMul(index); uint256 toBalanceBefore = super.balanceOf(to).rayMul(index); @@ -313,14 +365,7 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken { super._transfer(from, to, amount.rayDiv(index)); if (validate) { - POOL.finalizeTransfer( - UNDERLYING_ASSET_ADDRESS, - from, - to, - amount, - fromBalanceBefore, - toBalanceBefore - ); + pool.finalizeTransfer(underlyingAsset, from, to, amount, fromBalanceBefore, toBalanceBefore); } emit BalanceTransfer(from, to, amount, index); diff --git a/contracts/protocol/tokenization/DelegationAwareAToken.sol b/contracts/protocol/tokenization/DelegationAwareAToken.sol index 4e49f2b6..443e10fb 100644 --- a/contracts/protocol/tokenization/DelegationAwareAToken.sol +++ b/contracts/protocol/tokenization/DelegationAwareAToken.sol @@ -14,36 +14,17 @@ import {AToken} from './AToken.sol'; contract DelegationAwareAToken is AToken { modifier onlyPoolAdmin { require( - _msgSender() == ILendingPool(POOL).getAddressesProvider().getPoolAdmin(), + _msgSender() == ILendingPool(_pool).getAddressesProvider().getPoolAdmin(), Errors.CALLER_NOT_POOL_ADMIN ); _; } - constructor( - ILendingPool pool, - address underlyingAssetAddress, - address reserveTreasury, - string memory tokenName, - string memory tokenSymbol, - address incentivesController - ) - public - AToken( - pool, - underlyingAssetAddress, - reserveTreasury, - tokenName, - tokenSymbol, - incentivesController - ) - {} - /** * @dev Delegates voting power of the underlying asset to a `delegatee` address * @param delegatee The address that will receive the delegation **/ function delegateUnderlyingTo(address delegatee) external onlyPoolAdmin { - IDelegationToken(UNDERLYING_ASSET_ADDRESS).delegate(delegatee); + IDelegationToken(_underlyingAsset).delegate(delegatee); } } diff --git a/contracts/protocol/tokenization/IncentivizedERC20.sol b/contracts/protocol/tokenization/IncentivizedERC20.sol index 101eaf9a..fb831769 100644 --- a/contracts/protocol/tokenization/IncentivizedERC20.sol +++ b/contracts/protocol/tokenization/IncentivizedERC20.sol @@ -12,11 +12,9 @@ import {IAaveIncentivesController} from '../../interfaces/IAaveIncentivesControl * @notice Basic ERC20 implementation * @author Aave, inspired by the Openzeppelin ERC20 implementation **/ -contract IncentivizedERC20 is Context, IERC20, IERC20Detailed { +abstract contract IncentivizedERC20 is Context, IERC20, IERC20Detailed { using SafeMath for uint256; - IAaveIncentivesController internal immutable _incentivesController; - mapping(address => uint256) internal _balances; mapping(address => mapping(address => uint256)) private _allowances; @@ -28,13 +26,11 @@ contract IncentivizedERC20 is Context, IERC20, IERC20Detailed { constructor( string memory name, string memory symbol, - uint8 decimals, - address incentivesController + uint8 decimals ) public { _name = name; _symbol = symbol; _decimals = decimals; - _incentivesController = IAaveIncentivesController(incentivesController); } /** @@ -72,6 +68,12 @@ contract IncentivizedERC20 is Context, IERC20, IERC20Detailed { return _balances[account]; } + /** + * @return Abstract function implemented by the child aToken/debtToken. + * Done this way in order to not break compatibility with previous versions of aTokens/debtTokens + **/ + function _getIncentivesController() internal view virtual returns(IAaveIncentivesController); + /** * @dev Executes a transfer of tokens from _msgSender() to recipient * @param recipient The recipient of the tokens @@ -180,11 +182,11 @@ contract IncentivizedERC20 is Context, IERC20, IERC20Detailed { uint256 oldRecipientBalance = _balances[recipient]; _balances[recipient] = _balances[recipient].add(amount); - if (address(_incentivesController) != address(0)) { + if (address(_getIncentivesController()) != address(0)) { uint256 currentTotalSupply = _totalSupply; - _incentivesController.handleAction(sender, currentTotalSupply, oldSenderBalance); + _getIncentivesController().handleAction(sender, currentTotalSupply, oldSenderBalance); if (sender != recipient) { - _incentivesController.handleAction(recipient, currentTotalSupply, oldRecipientBalance); + _getIncentivesController().handleAction(recipient, currentTotalSupply, oldRecipientBalance); } } } @@ -200,8 +202,8 @@ contract IncentivizedERC20 is Context, IERC20, IERC20Detailed { uint256 oldAccountBalance = _balances[account]; _balances[account] = oldAccountBalance.add(amount); - if (address(_incentivesController) != address(0)) { - _incentivesController.handleAction(account, oldTotalSupply, oldAccountBalance); + if (address(_getIncentivesController()) != address(0)) { + _getIncentivesController().handleAction(account, oldTotalSupply, oldAccountBalance); } } @@ -216,8 +218,8 @@ contract IncentivizedERC20 is Context, IERC20, IERC20Detailed { uint256 oldAccountBalance = _balances[account]; _balances[account] = oldAccountBalance.sub(amount, 'ERC20: burn amount exceeds balance'); - if (address(_incentivesController) != address(0)) { - _incentivesController.handleAction(account, oldTotalSupply, oldAccountBalance); + if (address(_getIncentivesController()) != address(0)) { + _getIncentivesController().handleAction(account, oldTotalSupply, oldAccountBalance); } } diff --git a/contracts/protocol/tokenization/StableDebtToken.sol b/contracts/protocol/tokenization/StableDebtToken.sol index 78401405..f52c4931 100644 --- a/contracts/protocol/tokenization/StableDebtToken.sol +++ b/contracts/protocol/tokenization/StableDebtToken.sol @@ -5,6 +5,8 @@ import {DebtTokenBase} from './base/DebtTokenBase.sol'; import {MathUtils} from '../libraries/math/MathUtils.sol'; import {WadRayMath} from '../libraries/math/WadRayMath.sol'; import {IStableDebtToken} from '../../interfaces/IStableDebtToken.sol'; +import {ILendingPool} from '../../interfaces/ILendingPool.sol'; +import {IAaveIncentivesController} from '../../interfaces/IAaveIncentivesController.sol'; import {Errors} from '../libraries/helpers/Errors.sol'; /** @@ -23,13 +25,35 @@ contract StableDebtToken is IStableDebtToken, DebtTokenBase { mapping(address => uint256) internal _usersStableRate; uint40 internal _totalSupplyTimestamp; - constructor( - address pool, + ILendingPool internal _pool; + address internal _underlyingAsset; + IAaveIncentivesController internal _incentivesController; + + /** + * @dev Initializes the debt token. + * @param pool The address of the lending pool where this aToken will be used + * @param underlyingAsset The address of the underlying asset of this aToken (E.g. WETH for aWETH) + * @param incentivesController The smart contract managing potential incentives distribution + * @param debtTokenDecimals The decimals of the debtToken, same as the underlying asset's + * @param debtTokenName The name of the token + * @param debtTokenSymbol The symbol of the token + */ + function initialize( + ILendingPool pool, address underlyingAsset, - string memory name, - string memory symbol, - address incentivesController - ) public DebtTokenBase(pool, underlyingAsset, name, symbol, incentivesController) {} + IAaveIncentivesController incentivesController, + uint8 debtTokenDecimals, + string memory debtTokenName, + string memory debtTokenSymbol + ) public override initializer { + _setName(debtTokenName); + _setSymbol(debtTokenSymbol); + _setDecimals(debtTokenDecimals); + + _pool = pool; + _underlyingAsset = underlyingAsset; + _incentivesController = incentivesController; + } /** * @dev Gets the revision of the stable debt token implementation @@ -300,6 +324,48 @@ contract StableDebtToken is IStableDebtToken, DebtTokenBase { return super.balanceOf(user); } + /** + * @dev Returns the address of the underlying asset of this aToken (E.g. WETH for aWETH) + **/ + function UNDERLYING_ASSET_ADDRESS() public view returns (address) { + return _underlyingAsset; + } + + /** + * @dev Returns the address of the lending pool where this aToken is used + **/ + function POOL() public view returns (ILendingPool) { + return _pool; + } + + /** + * @dev Returns the address of the incentives controller contract + **/ + function getIncentivesController() external view override returns (IAaveIncentivesController) { + return _getIncentivesController(); + } + + /** + * @dev For internal usage in the logic of the parent contracts + **/ + function _getIncentivesController() internal view override returns (IAaveIncentivesController) { + return _incentivesController; + } + + /** + * @dev For internal usage in the logic of the parent contracts + **/ + function _getUnderlyingAssetAddress() internal view override returns (address) { + return _underlyingAsset; + } + + /** + * @dev For internal usage in the logic of the parent contracts + **/ + function _getLendingPool() internal view override returns (ILendingPool) { + return _pool; + } + /** * @dev Calculates the total supply * @param avgRate The average rate at which the total supply increases diff --git a/contracts/protocol/tokenization/VariableDebtToken.sol b/contracts/protocol/tokenization/VariableDebtToken.sol index d2e27ac3..60a47e12 100644 --- a/contracts/protocol/tokenization/VariableDebtToken.sol +++ b/contracts/protocol/tokenization/VariableDebtToken.sol @@ -5,6 +5,8 @@ import {IVariableDebtToken} from '../../interfaces/IVariableDebtToken.sol'; import {WadRayMath} from '../libraries/math/WadRayMath.sol'; import {Errors} from '../libraries/helpers/Errors.sol'; import {DebtTokenBase} from './base/DebtTokenBase.sol'; +import {ILendingPool} from '../../interfaces/ILendingPool.sol'; +import {IAaveIncentivesController} from '../../interfaces/IAaveIncentivesController.sol'; /** * @title VariableDebtToken @@ -17,13 +19,35 @@ contract VariableDebtToken is DebtTokenBase, IVariableDebtToken { uint256 public constant DEBT_TOKEN_REVISION = 0x1; - constructor( - address pool, + ILendingPool internal _pool; + address internal _underlyingAsset; + IAaveIncentivesController internal _incentivesController; + + /** + * @dev Initializes the debt token. + * @param pool The address of the lending pool where this aToken will be used + * @param underlyingAsset The address of the underlying asset of this aToken (E.g. WETH for aWETH) + * @param incentivesController The smart contract managing potential incentives distribution + * @param debtTokenDecimals The decimals of the debtToken, same as the underlying asset's + * @param debtTokenName The name of the token + * @param debtTokenSymbol The symbol of the token + */ + function initialize( + ILendingPool pool, address underlyingAsset, - string memory name, - string memory symbol, - address incentivesController - ) public DebtTokenBase(pool, underlyingAsset, name, symbol, incentivesController) {} + IAaveIncentivesController incentivesController, + uint8 debtTokenDecimals, + string memory debtTokenName, + string memory debtTokenSymbol + ) public override initializer { + _setName(debtTokenName); + _setSymbol(debtTokenSymbol); + _setDecimals(debtTokenDecimals); + + _pool = pool; + _underlyingAsset = underlyingAsset; + _incentivesController = incentivesController; + } /** * @dev Gets the revision of the stable debt token implementation @@ -44,7 +68,7 @@ contract VariableDebtToken is DebtTokenBase, IVariableDebtToken { return 0; } - return scaledBalance.rayMul(POOL.getReserveNormalizedVariableDebt(UNDERLYING_ASSET_ADDRESS)); + return scaledBalance.rayMul(_pool.getReserveNormalizedVariableDebt(_underlyingAsset)); } /** @@ -113,8 +137,7 @@ contract VariableDebtToken is DebtTokenBase, IVariableDebtToken { * @return The total supply **/ function totalSupply() public view virtual override returns (uint256) { - return - super.totalSupply().rayMul(POOL.getReserveNormalizedVariableDebt(UNDERLYING_ASSET_ADDRESS)); + return super.totalSupply().rayMul(_pool.getReserveNormalizedVariableDebt(_underlyingAsset)); } /** @@ -139,4 +162,37 @@ contract VariableDebtToken is DebtTokenBase, IVariableDebtToken { { return (super.balanceOf(user), super.totalSupply()); } + + /** + * @dev Returns the address of the underlying asset of this aToken (E.g. WETH for aWETH) + **/ + function UNDERLYING_ASSET_ADDRESS() public view returns (address) { + return _underlyingAsset; + } + + /** + * @dev Returns the address of the incentives controller contract + **/ + function getIncentivesController() external view override returns (IAaveIncentivesController) { + return _getIncentivesController(); + } + + /** + * @dev Returns the address of the lending pool where this aToken is used + **/ + function POOL() public view returns (ILendingPool) { + return _pool; + } + + function _getIncentivesController() internal view override returns (IAaveIncentivesController) { + return _incentivesController; + } + + function _getUnderlyingAssetAddress() internal view override returns (address) { + return _underlyingAsset; + } + + function _getLendingPool() internal view override returns (ILendingPool) { + return _pool; + } } diff --git a/contracts/protocol/tokenization/base/DebtTokenBase.sol b/contracts/protocol/tokenization/base/DebtTokenBase.sol index 07bdef22..4d75bc2f 100644 --- a/contracts/protocol/tokenization/base/DebtTokenBase.sol +++ b/contracts/protocol/tokenization/base/DebtTokenBase.sol @@ -16,54 +16,20 @@ import {Errors} from '../../libraries/helpers/Errors.sol'; */ abstract contract DebtTokenBase is - IncentivizedERC20, + IncentivizedERC20('DEBTTOKEN_IMPL', 'DEBTTOKEN_IMPL', 0), VersionedInitializable, ICreditDelegationToken { - address public immutable UNDERLYING_ASSET_ADDRESS; - ILendingPool public immutable POOL; - mapping(address => mapping(address => uint256)) internal _borrowAllowances; /** * @dev Only lending pool can call functions marked by this modifier **/ modifier onlyLendingPool { - require(_msgSender() == address(POOL), Errors.CT_CALLER_MUST_BE_LENDING_POOL); + require(_msgSender() == address(_getLendingPool()), Errors.CT_CALLER_MUST_BE_LENDING_POOL); _; } - /** - * @dev The metadata of the token will be set on the proxy, that the reason of - * passing "NULL" and 0 as metadata - */ - constructor( - address pool, - address underlyingAssetAddress, - string memory name, - string memory symbol, - address incentivesController - ) public IncentivizedERC20(name, symbol, 18, incentivesController) { - POOL = ILendingPool(pool); - UNDERLYING_ASSET_ADDRESS = underlyingAssetAddress; - } - - /** - * @dev Initializes the debt token. - * @param name The name of the token - * @param symbol The symbol of the token - * @param decimals The decimals of the token - */ - function initialize( - uint8 decimals, - string memory name, - string memory symbol - ) public initializer { - _setName(name); - _setSymbol(symbol); - _setDecimals(decimals); - } - /** * @dev delegates borrowing power to a user on the specific debt token * @param delegatee the address receiving the delegated borrowing power @@ -73,7 +39,7 @@ abstract contract DebtTokenBase is **/ function approveDelegation(address delegatee, uint256 amount) external override { _borrowAllowances[_msgSender()][delegatee] = amount; - emit BorrowAllowanceDelegated(_msgSender(), delegatee, UNDERLYING_ASSET_ADDRESS, amount); + emit BorrowAllowanceDelegated(_msgSender(), delegatee, _getUnderlyingAssetAddress(), amount); } /** @@ -162,6 +128,10 @@ abstract contract DebtTokenBase is _borrowAllowances[delegator][delegatee] = newAllowance; - emit BorrowAllowanceDelegated(delegator, delegatee, UNDERLYING_ASSET_ADDRESS, newAllowance); + emit BorrowAllowanceDelegated(delegator, delegatee, _getUnderlyingAssetAddress(), newAllowance); } + + function _getUnderlyingAssetAddress() internal view virtual returns (address); + + function _getLendingPool() internal view virtual returns (ILendingPool); } From 517d51f900bb6cdef41ee879dbc5c358e9070bf6 Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Fri, 29 Jan 2021 22:52:12 -0500 Subject: [PATCH 25/31] Began work on implementing light deployment scripts --- helpers/contracts-deployments.ts | 14 ++--- helpers/init-helpers.ts | 93 ++++++++++++++++++++++-------- markets/uniswap/reservesConfigs.ts | 2 +- 3 files changed, 77 insertions(+), 32 deletions(-) diff --git a/helpers/contracts-deployments.ts b/helpers/contracts-deployments.ts index 8f7f0c9d..1e5940eb 100644 --- a/helpers/contracts-deployments.ts +++ b/helpers/contracts-deployments.ts @@ -300,7 +300,7 @@ export const deployStableDebtToken = async ( verify: boolean ) => withSaveAndVerify( - await new StableDebtTokenFactory(await getFirstSigner()).deploy(...args), + await new StableDebtTokenFactory(await getFirstSigner()).deploy(), eContractid.StableDebtToken, args, verify @@ -311,7 +311,7 @@ export const deployVariableDebtToken = async ( verify: boolean ) => withSaveAndVerify( - await new VariableDebtTokenFactory(await getFirstSigner()).deploy(...args), + await new VariableDebtTokenFactory(await getFirstSigner()).deploy(), eContractid.VariableDebtToken, args, verify @@ -338,7 +338,7 @@ export const deployGenericAToken = async ( ] = [poolAddress, underlyingAssetAddress, treasuryAddress, name, symbol, incentivesController]; return withSaveAndVerify( - await new ATokenFactory(await getFirstSigner()).deploy(...args), + await new ATokenFactory(await getFirstSigner()).deploy(), eContractid.AToken, args, verify @@ -366,7 +366,7 @@ export const deployDelegationAwareAToken = async ( ] = [poolAddress, underlyingAssetAddress, treasuryAddress, name, symbol, incentivesController]; return withSaveAndVerify( - await new DelegationAwareATokenFactory(await getFirstSigner()).deploy(...args), + await new DelegationAwareATokenFactory(await getFirstSigner()).deploy(), eContractid.DelegationAwareAToken, args, verify @@ -451,7 +451,7 @@ export const deployMockStableDebtToken = async ( verify?: boolean ) => withSaveAndVerify( - await new MockStableDebtTokenFactory(await getFirstSigner()).deploy(...args), + await new MockStableDebtTokenFactory(await getFirstSigner()).deploy(), eContractid.MockStableDebtToken, args, verify @@ -470,7 +470,7 @@ export const deployMockVariableDebtToken = async ( verify?: boolean ) => withSaveAndVerify( - await new MockVariableDebtTokenFactory(await getFirstSigner()).deploy(...args), + await new MockVariableDebtTokenFactory(await getFirstSigner()).deploy(), eContractid.MockVariableDebtToken, args, verify @@ -481,7 +481,7 @@ export const deployMockAToken = async ( verify?: boolean ) => withSaveAndVerify( - await new MockATokenFactory(await getFirstSigner()).deploy(...args), + await new MockATokenFactory(await getFirstSigner()).deploy(), eContractid.MockAToken, args, verify diff --git a/helpers/init-helpers.ts b/helpers/init-helpers.ts index 2083e0df..a8794df2 100644 --- a/helpers/init-helpers.ts +++ b/helpers/init-helpers.ts @@ -95,7 +95,19 @@ export const initReservesByHelper = async ( BigNumberish ][] = []; const reservesDecimals: string[] = []; - + // TEST + const inputParams: { + asset: string, + rates: [ + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish + ] + }[] = []; + // TEST for (let [assetSymbol, { reserveDecimals }] of reservesChunk) { const assetAddressIndex = Object.keys(tokenAddresses).findIndex( (value) => value === assetSymbol @@ -130,12 +142,26 @@ export const initReservesByHelper = async ( stableRateSlope2, ]); reservesDecimals.push(reserveDecimals); + + // TEST + inputParams.push({ + asset: tokenAddress, + rates: [ + optimalUtilizationRate, + baseVariableBorrowRate, + variableRateSlope1, + variableRateSlope2, + stableRateSlope1, + stableRateSlope2 + ] + }); + // TEST } // tx1 and tx2 gas is accounted for later. // Deploy stable and variable deployers and save implementations const tx1 = await waitForTx( - await stableAndVariableDeployer.initDeployment(tokens, symbols, incentivesController) + await stableAndVariableDeployer.initDeployment(tokens, symbols) ); tx1.events?.forEach((event, index) => { rawInsertContractAddressInDb(`stableDebt${symbols[index]}`, event?.args?.stableToken); @@ -144,13 +170,7 @@ export const initReservesByHelper = async ( // Deploy atokens and rate strategies and save implementations const tx2 = await waitForTx( - await atokenAndRatesDeployer.initDeployment( - tokens, - symbols, - strategyRates, - treasuryAddress, - incentivesController - ) + await atokenAndRatesDeployer.initDeployment(inputParams) ); tx2.events?.forEach((event, index) => { rawInsertContractAddressInDb(`a${symbols[index]}`, event?.args?.aToken); @@ -317,6 +337,16 @@ export const configureReservesByHelper = async ( const liquidationBonuses: string[] = []; const reserveFactors: string[] = []; const stableRatesEnabled: boolean[] = []; + // TEST + const inputParams : { + asset: string; + baseLTV: BigNumberish; + liquidationThreshold: BigNumberish; + liquidationBonus: BigNumberish; + reserveFactor: BigNumberish; + stableBorrowingEnabled: boolean; + }[] = []; + // TEST for (const [ assetSymbol, @@ -345,6 +375,18 @@ export const configureReservesByHelper = async ( continue; } // Push data + + // TEST + inputParams.push({ + asset: tokenAddress, + baseLTV: baseLTVAsCollateral, + liquidationThreshold: liquidationThreshold, + liquidationBonus: liquidationBonus, + reserveFactor: reserveFactor, + stableBorrowingEnabled: stableBorrowRateEnabled + }); + // TEST + tokens.push(tokenAddress); symbols.push(assetSymbol); baseLTVA.push(baseLTVAsCollateral); @@ -368,25 +410,28 @@ export const configureReservesByHelper = async ( const chunkedReserveFactors = chunk(reserveFactors, enableChunks); const chunkedStableRatesEnabled = chunk(stableRatesEnabled, enableChunks); + // TEST + const chunkedInputParams = chunk(inputParams, enableChunks); + // TEST + + console.log(`- Configure reserves in ${chunkedTokens.length} txs`); for (let chunkIndex = 0; chunkIndex < chunkedTokens.length; chunkIndex++) { - addGas(await atokenAndRatesDeployer.estimateGas.configureReserves( - chunkedTokens[chunkIndex], - chunkedBase[chunkIndex], - chunkedliquidationThresholds[chunkIndex], - chunkedliquidationBonuses[chunkIndex], - chunkedReserveFactors[chunkIndex], - chunkedStableRatesEnabled[chunkIndex], - { gasLimit: 12000000 } - )); + // addGas(await atokenAndRatesDeployer.estimateGas.configureReserves( + // chunkedTokens[chunkIndex], + // chunkedBase[chunkIndex], + // chunkedliquidationThresholds[chunkIndex], + // chunkedliquidationBonuses[chunkIndex], + // chunkedReserveFactors[chunkIndex], + // chunkedStableRatesEnabled[chunkIndex], + // { gasLimit: 12000000 } + // )); + + + await waitForTx( await atokenAndRatesDeployer.configureReserves( - chunkedTokens[chunkIndex], - chunkedBase[chunkIndex], - chunkedliquidationThresholds[chunkIndex], - chunkedliquidationBonuses[chunkIndex], - chunkedReserveFactors[chunkIndex], - chunkedStableRatesEnabled[chunkIndex], + chunkedInputParams[chunkIndex], { gasLimit: 12000000 } ) ); diff --git a/markets/uniswap/reservesConfigs.ts b/markets/uniswap/reservesConfigs.ts index acd09475..6961d4d5 100644 --- a/markets/uniswap/reservesConfigs.ts +++ b/markets/uniswap/reservesConfigs.ts @@ -77,7 +77,7 @@ export const strategyUSDT: IReserveParams = { variableRateSlope2: new BigNumber(0.75).multipliedBy(oneRay).toFixed(), stableRateSlope1: new BigNumber(0.02).multipliedBy(oneRay).toFixed(), stableRateSlope2: new BigNumber(0.60).multipliedBy(oneRay).toFixed(), - baseLTVAsCollateral: '8000', + baseLTVAsCollateral: '-1', liquidationThreshold: '8500', liquidationBonus: '10500', borrowingEnabled: true, From 57996bd5b876547272e781cbfd8612ea0989ef04 Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Mon, 1 Feb 2021 16:10:14 -0500 Subject: [PATCH 26/31] Pulled lendingPool fix from origin --- contracts/protocol/lendingpool/LendingPool.sol | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/contracts/protocol/lendingpool/LendingPool.sol b/contracts/protocol/lendingpool/LendingPool.sol index 75e80230..0f4d9674 100644 --- a/contracts/protocol/lendingpool/LendingPool.sol +++ b/contracts/protocol/lendingpool/LendingPool.sol @@ -82,20 +82,12 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage * - Caching the address of the LendingPoolAddressesProvider in order to reduce gas consumption * on subsequent operations * @param provider The address of the LendingPoolAddressesProvider - * @param maxStableRateBorrowSizePercent The percentage of available liquidity that can be borrowed at once at stable rate - * @param flashLoanPremiumTotal The fee on flash loans - * @param maxNumberOfReserves Maximum number of reserves supported to be listed in this LendingPool **/ - function initialize( - ILendingPoolAddressesProvider provider, - uint256 maxStableRateBorrowSizePercent, - uint256 flashLoanPremiumTotal, - uint256 maxNumberOfReserves - ) public initializer { + function initialize(ILendingPoolAddressesProvider provider) public initializer { _addressesProvider = provider; - _maxStableRateBorrowSizePercent = maxStableRateBorrowSizePercent; - _flashLoanPremiumTotal = flashLoanPremiumTotal; - _maxNumberOfReserves = maxNumberOfReserves; + _maxStableRateBorrowSizePercent = 2500; + _flashLoanPremiumTotal = 9; + _maxNumberOfReserves = 128; } /** From 221c19c910179a60c0c37914323098efac71feeb Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Mon, 1 Feb 2021 18:23:11 -0500 Subject: [PATCH 27/31] Tentative fix in init-helpers for light deployment --- helpers/init-helpers.ts | 92 +++++++++++++++++++++++++++++++++-------- 1 file changed, 74 insertions(+), 18 deletions(-) diff --git a/helpers/init-helpers.ts b/helpers/init-helpers.ts index a8794df2..8b5a8388 100644 --- a/helpers/init-helpers.ts +++ b/helpers/init-helpers.ts @@ -12,6 +12,7 @@ import { getAToken, getATokensAndRatesHelper, getLendingPoolAddressesProvider, + getLendingPoolConfiguratorProxy, getStableAndVariableTokensHelper, } from './contracts-getters'; import { rawInsertContractAddressInDb } from './contracts-helpers'; @@ -26,6 +27,7 @@ import { import { ZERO_ADDRESS } from './constants'; import { isZeroAddress } from 'ethereumjs-util'; import { addGas } from '../gas-tracker'; +import { getTreasuryAddress } from './configuration'; const chooseATokenDeployment = (id: eContractid) => { switch (id) { @@ -77,11 +79,32 @@ export const initReservesByHelper = async ( let reserveInitDecimals: string[] = []; let reserveSymbols: string[] = []; + // TEST START + 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, + }[] = []; + // TEST END + console.log( `- Token deployments in ${reservesChunks.length * 2} txs instead of ${ Object.entries(reservesParams).length * 4 } txs` ); + for (let reservesChunk of reservesChunks) { // Prepare data const tokens: string[] = []; @@ -95,7 +118,7 @@ export const initReservesByHelper = async ( BigNumberish ][] = []; const reservesDecimals: string[] = []; - // TEST + // TEST START const inputParams: { asset: string, rates: [ @@ -107,7 +130,7 @@ export const initReservesByHelper = async ( BigNumberish ] }[] = []; - // TEST + // TEST END for (let [assetSymbol, { reserveDecimals }] of reservesChunk) { const assetAddressIndex = Object.keys(tokenAddresses).findIndex( (value) => value === assetSymbol @@ -143,7 +166,7 @@ export const initReservesByHelper = async ( ]); reservesDecimals.push(reserveDecimals); - // TEST + // TEST START inputParams.push({ asset: tokenAddress, rates: [ @@ -155,7 +178,7 @@ export const initReservesByHelper = async ( stableRateSlope2 ] }); - // TEST + // TEST END } // tx1 and tx2 gas is accounted for later. @@ -181,7 +204,7 @@ export const initReservesByHelper = async ( console.log(' * gasUsed: debtTokens batch', tx1.gasUsed.toString()); console.log(' * gasUsed: aTokens and Strategy batch', tx2.gasUsed.toString()); gasUsage = gasUsage.add(tx1.gasUsed).add(tx2.gasUsed); - addGas(gasUsage); + const stableTokens: string[] = tx1.events?.map((e) => e.args?.stableToken) || []; const variableTokens: string[] = tx1.events?.map((e) => e.args?.variableToken) || []; const aTokens: string[] = tx2.events?.map((e) => e.args?.aToken) || []; @@ -196,6 +219,29 @@ export const initReservesByHelper = async ( reserveSymbols = [...reserveSymbols, ...symbols]; } + // TEST START + for (let i = 0; i < deployedATokens.length; i ++) { + initInputParams.push({ + aTokenImpl: deployedATokens[i], + stableDebtTokenImpl: deployedStableTokens[i], + variableDebtTokenImpl: deployedVariableTokens[i], + underlyingAssetDecimals: reserveInitDecimals[i], + interestRateStrategyAddress: deployedRates[i], + underlyingAsset: reserveTokens[i], + treasury: treasuryAddress, + incentivesController: ZERO_ADDRESS, + underlyingAssetName: reserveSymbols[i], + aTokenName: `Aave Interest Bearing ${reserveSymbols[i]}`, + aTokenSymbol: `a${reserveSymbols[i]}`, + variableDebtTokenName: `Aave Variable Debt ${reserveSymbols[i]}`, + variableDebtTokenSymbol: `variableDebt${reserveSymbols[i]}`, + stableDebtTokenName: `Aave Stable Debt ${reserveSymbols[i]}`, + stableDebtTokenSymbol: `stableDebt${reserveSymbols[i]}` + }); + } + // TEST END + + // Deploy delegated aware reserves tokens const delegatedAwareReserves = Object.entries(reservesParams).filter( ([_, { aTokenImpl }]) => aTokenImpl === eContractid.DelegationAwareAToken @@ -273,24 +319,34 @@ export const initReservesByHelper = async ( const chunkedDecimals = chunk(reserveInitDecimals, initChunks); const chunkedSymbols = chunk(reserveSymbols, initChunks); + // TEST START + const configurator = await getLendingPoolConfiguratorProxy(); + await waitForTx(await addressProvider.setPoolAdmin(admin)); + + const chunkedInitInputParams = chunk(initInputParams, initChunks); + // TEST END console.log(`- Reserves initialization in ${chunkedStableTokens.length} txs`); for (let chunkIndex = 0; chunkIndex < chunkedDecimals.length; chunkIndex++) { const tx3 = await waitForTx( - await atokenAndRatesDeployer.initReserve( - chunkedStableTokens[chunkIndex], - chunkedVariableTokens[chunkIndex], - chunkedAtokens[chunkIndex], - chunkedRates[chunkIndex], - chunkedDecimals[chunkIndex] - ) + // await atokenAndRatesDeployer.initReserve( + // chunkedStableTokens[chunkIndex], + // chunkedVariableTokens[chunkIndex], + // chunkedAtokens[chunkIndex], + // chunkedRates[chunkIndex], + // chunkedDecimals[chunkIndex] + // ) + await configurator.batchInitReserve(chunkedInitInputParams[chunkIndex]) + ); console.log(` - Reserve ready for: ${chunkedSymbols[chunkIndex].join(', ')}`); console.log(' * gasUsed', tx3.gasUsed.toString()); gasUsage = gasUsage.add(tx3.gasUsed); } + addGas(gasUsage); // Set deployer back as admin + addGas(await addressProvider.estimateGas.setPoolAdmin(admin)); await waitForTx(await addressProvider.setPoolAdmin(admin)); return gasUsage; }; @@ -337,7 +393,7 @@ export const configureReservesByHelper = async ( const liquidationBonuses: string[] = []; const reserveFactors: string[] = []; const stableRatesEnabled: boolean[] = []; - // TEST + // TEST START const inputParams : { asset: string; baseLTV: BigNumberish; @@ -346,7 +402,7 @@ export const configureReservesByHelper = async ( reserveFactor: BigNumberish; stableBorrowingEnabled: boolean; }[] = []; - // TEST + // TEST END for (const [ assetSymbol, @@ -376,7 +432,7 @@ export const configureReservesByHelper = async ( } // Push data - // TEST + // TEST START inputParams.push({ asset: tokenAddress, baseLTV: baseLTVAsCollateral, @@ -385,7 +441,7 @@ export const configureReservesByHelper = async ( reserveFactor: reserveFactor, stableBorrowingEnabled: stableBorrowRateEnabled }); - // TEST + // TEST END tokens.push(tokenAddress); symbols.push(assetSymbol); @@ -410,9 +466,9 @@ export const configureReservesByHelper = async ( const chunkedReserveFactors = chunk(reserveFactors, enableChunks); const chunkedStableRatesEnabled = chunk(stableRatesEnabled, enableChunks); - // TEST + // TEST START const chunkedInputParams = chunk(inputParams, enableChunks); - // TEST + // TEST END console.log(`- Configure reserves in ${chunkedTokens.length} txs`); From d63ae5405f7a3b50c6d525aaf3833aa2a327d1bb Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Mon, 1 Feb 2021 18:42:01 -0500 Subject: [PATCH 28/31] Fixed missing gas estimation --- helpers/init-helpers.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/helpers/init-helpers.ts b/helpers/init-helpers.ts index 8b5a8388..58748d67 100644 --- a/helpers/init-helpers.ts +++ b/helpers/init-helpers.ts @@ -484,6 +484,10 @@ export const configureReservesByHelper = async ( // )); + addGas(await atokenAndRatesDeployer.estimateGas.configureReserves( + chunkedInputParams[chunkIndex], + { gasLimit: 12000000 } + )); await waitForTx( await atokenAndRatesDeployer.configureReserves( From ca0e744df51f97313768c43abe396ad514b578c6 Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Mon, 1 Feb 2021 22:12:36 -0500 Subject: [PATCH 29/31] Fixed delegation aware aToken test --- test/delegation-aware-atoken.spec.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/delegation-aware-atoken.spec.ts b/test/delegation-aware-atoken.spec.ts index 0e782495..903979e6 100644 --- a/test/delegation-aware-atoken.spec.ts +++ b/test/delegation-aware-atoken.spec.ts @@ -33,9 +33,13 @@ makeSuite('AToken: underlying delegation', (testEnv: TestEnv) => { delegationERC20 = await deployMintableDelegationERC20(['DEL', 'DEL', '18']); delegationAToken = await deployDelegationAwareAToken( - [pool.address, delegationERC20.address, ZERO_ADDRESS, 'aDEL', 'aDEL', ZERO_ADDRESS], + [pool.address, ZERO_ADDRESS, delegationERC20.address, ZERO_ADDRESS, '18', 'aDEL', 'aDEL'], false ); + + await delegationAToken.initialize(pool.address, ZERO_ADDRESS, delegationERC20.address, ZERO_ADDRESS, '18', 'aDEL', 'aDEL'); + + console.log((await delegationAToken.decimals()).toString()); }); it('Tries to delegate with the caller not being the Aave admin', async () => { From 19436c055ee113cf72368c9677218cb5cd88bfbf Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Tue, 2 Feb 2021 16:38:34 -0500 Subject: [PATCH 30/31] Pulled waitForTx changes --- test/helpers/actions.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index b33f146d..cbe06e5c 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -128,7 +128,9 @@ export const approve = async (reserveSymbol: string, user: SignerWithAddress, te const token = await getMintableERC20(reserve); - await token.connect(user.signer).approve(pool.address, '100000000000000000000000000000'); + await waitForTx( + await token.connect(user.signer).approve(pool.address, '100000000000000000000000000000') + ); }; export const deposit = async ( @@ -314,7 +316,7 @@ export const delegateBorrowAllowance = async ( await expect(delegateAllowancePromise, revertMessage).to.be.revertedWith(revertMessage); return; } else { - await delegateAllowancePromise; + await waitForTx(await delegateAllowancePromise); const allowance = await debtToken.borrowAllowance(user.address, receiver); expect(allowance.toString()).to.be.equal( amountToDelegate, From 9431541593a6f1a002e92ca4d12588268d230201 Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Tue, 2 Feb 2021 17:44:46 -0500 Subject: [PATCH 31/31] More fixes, some stable tests fail WIP --- .../protocol/lendingpool/LendingPool.sol | 5 +- .../libraries/logic/ValidationLogic.sol | 4 +- helpers/contracts-deployments.ts | 164 +++++++++++++----- helpers/init-helpers.ts | 26 +-- test/delegation-aware-atoken.spec.ts | 6 +- test/helpers/actions.ts | 5 +- test/upgradeability.spec.ts | 126 ++++++++++++-- 7 files changed, 260 insertions(+), 76 deletions(-) diff --git a/contracts/protocol/lendingpool/LendingPool.sol b/contracts/protocol/lendingpool/LendingPool.sol index 0f4d9674..7164227d 100644 --- a/contracts/protocol/lendingpool/LendingPool.sol +++ b/contracts/protocol/lendingpool/LendingPool.sol @@ -26,6 +26,9 @@ import {UserConfiguration} from '../libraries/configuration/UserConfiguration.so import {DataTypes} from '../libraries/types/DataTypes.sol'; import {LendingPoolStorage} from './LendingPoolStorage.sol'; +// TEST +import { console } from 'hardhat/console.sol'; + /** * @title LendingPool contract * @dev Main point of interaction with an Aave protocol's market @@ -206,7 +209,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage address onBehalfOf ) external override whenNotPaused { DataTypes.ReserveData storage reserve = _reserves[asset]; - + _executeBorrow( ExecuteBorrowParams( asset, diff --git a/contracts/protocol/libraries/logic/ValidationLogic.sol b/contracts/protocol/libraries/logic/ValidationLogic.sol index 080b792d..89d7c323 100644 --- a/contracts/protocol/libraries/logic/ValidationLogic.sol +++ b/contracts/protocol/libraries/logic/ValidationLogic.sol @@ -16,6 +16,8 @@ import {Helpers} from '../helpers/Helpers.sol'; import {IReserveInterestRateStrategy} from '../../../interfaces/IReserveInterestRateStrategy.sol'; import {DataTypes} from '../types/DataTypes.sol'; +import {console} from 'hardhat/console.sol'; + /** * @title ReserveLogic library * @author Aave @@ -194,7 +196,7 @@ library ValidationLogic { //check if the borrow mode is stable and if stable rate borrowing is enabled on this reserve require(vars.stableRateBorrowingEnabled, Errors.VL_STABLE_BORROWING_NOT_ENABLED); - + console.log("Reserve aToken balance on borrowing address:", IERC20(reserve.aTokenAddress).balanceOf(userAddress)); require( !userConfig.isUsingAsCollateral(reserve.id) || reserve.configuration.getLtv() == 0 || diff --git a/helpers/contracts-deployments.ts b/helpers/contracts-deployments.ts index 1e5940eb..ee7ef103 100644 --- a/helpers/contracts-deployments.ts +++ b/helpers/contracts-deployments.ts @@ -298,79 +298,111 @@ export const deployDefaultReserveInterestRateStrategy = async ( export const deployStableDebtToken = async ( args: [tEthereumAddress, tEthereumAddress, string, string, tEthereumAddress], verify: boolean -) => - withSaveAndVerify( +) => { + const instance = await withSaveAndVerify( await new StableDebtTokenFactory(await getFirstSigner()).deploy(), eContractid.StableDebtToken, - args, + [], verify ); + await instance.initialize( + args[0], + args[1], + args[2], + "18", + args[3], + args[4] + ); + + return instance; +} + + export const deployVariableDebtToken = async ( args: [tEthereumAddress, tEthereumAddress, string, string, tEthereumAddress], verify: boolean -) => - withSaveAndVerify( +) => { + const instance = await withSaveAndVerify( await new VariableDebtTokenFactory(await getFirstSigner()).deploy(), eContractid.VariableDebtToken, - args, + [], verify ); + await instance.initialize( + args[0], + args[1], + args[2], + "18", + args[3], + args[4] + ); + + return instance; +} + + export const deployGenericAToken = async ( - [poolAddress, underlyingAssetAddress, treasuryAddress, name, symbol,incentivesController]: [ + [poolAddress, underlyingAssetAddress, treasuryAddress, incentivesController, name, symbol]: [ + tEthereumAddress, tEthereumAddress, tEthereumAddress, tEthereumAddress, string, - string, - tEthereumAddress + string ], verify: boolean ) => { - const args: [ - tEthereumAddress, - tEthereumAddress, - string, - string, - tEthereumAddress, - tEthereumAddress - - ] = [poolAddress, underlyingAssetAddress, treasuryAddress, name, symbol, incentivesController]; - return withSaveAndVerify( + const instance = await withSaveAndVerify( await new ATokenFactory(await getFirstSigner()).deploy(), eContractid.AToken, - args, + [], verify ); + + await instance.initialize( + poolAddress, + treasuryAddress, + underlyingAssetAddress, + incentivesController, + "18", + name, + symbol + ); + + return instance; }; export const deployDelegationAwareAToken = async ( - [poolAddress, underlyingAssetAddress, treasuryAddress, name, symbol, incentivesController]: [ + [pool, underlyingAssetAddress, treasuryAddress, incentivesController, name, symbol]: [ + tEthereumAddress, tEthereumAddress, tEthereumAddress, tEthereumAddress, string, - string, - tEthereumAddress + string ], verify: boolean ) => { - const args: [ - tEthereumAddress, - tEthereumAddress, - string, - string, - tEthereumAddress, - tEthereumAddress - ] = [poolAddress, underlyingAssetAddress, treasuryAddress, name, symbol, incentivesController]; - - return withSaveAndVerify( + const instance = await withSaveAndVerify( await new DelegationAwareATokenFactory(await getFirstSigner()).deploy(), eContractid.DelegationAwareAToken, - args, + [], verify ); + + await instance.initialize( + pool, + treasuryAddress, + underlyingAssetAddress, + incentivesController, + "18", + name, + symbol + ) + + return instance; }; export const deployAllMockTokens = async (verify?: boolean) => { @@ -447,16 +479,29 @@ export const deployWETHGateway = async ( ); export const deployMockStableDebtToken = async ( - args: [tEthereumAddress, tEthereumAddress, string, string, tEthereumAddress], + args: [tEthereumAddress, tEthereumAddress, tEthereumAddress, string, string], verify?: boolean -) => - withSaveAndVerify( +) => { + const instance = await withSaveAndVerify( await new MockStableDebtTokenFactory(await getFirstSigner()).deploy(), eContractid.MockStableDebtToken, - args, + [], verify ); + await instance.initialize( + args[0], + args[1], + args[2], + "18", + args[3], + args[4] + ); + + return instance; +} + + export const deployWETHMocked = async (verify?: boolean) => withSaveAndVerify( await new WETH9MockedFactory(await getFirstSigner()).deploy(), @@ -466,26 +511,53 @@ export const deployWETHMocked = async (verify?: boolean) => ); export const deployMockVariableDebtToken = async ( - args: [tEthereumAddress, tEthereumAddress, string, string, tEthereumAddress], + args: [tEthereumAddress, tEthereumAddress, tEthereumAddress, string, string], verify?: boolean -) => - withSaveAndVerify( +) => { + const instance = await withSaveAndVerify( await new MockVariableDebtTokenFactory(await getFirstSigner()).deploy(), eContractid.MockVariableDebtToken, - args, + [], verify ); + await instance.initialize( + args[0], + args[1], + args[2], + "18", + args[3], + args[4] + ); + + return instance; +} + + export const deployMockAToken = async ( - args: [tEthereumAddress, tEthereumAddress, tEthereumAddress, string, string, tEthereumAddress], +args: [tEthereumAddress, tEthereumAddress, tEthereumAddress,tEthereumAddress, string, string], verify?: boolean -) => - withSaveAndVerify( +) => { + const instance = await withSaveAndVerify( await new MockATokenFactory(await getFirstSigner()).deploy(), eContractid.MockAToken, - args, + [], verify ); + + await instance.initialize( + args[0], + args[2], + args[1], + args[3], + "18", + args[4], + args[5], + ); + + return instance; +} + export const deploySelfdestructTransferMock = async (verify?: boolean) => withSaveAndVerify( diff --git a/helpers/init-helpers.ts b/helpers/init-helpers.ts index 58748d67..623483e5 100644 --- a/helpers/init-helpers.ts +++ b/helpers/init-helpers.ts @@ -231,11 +231,11 @@ export const initReservesByHelper = async ( treasury: treasuryAddress, incentivesController: ZERO_ADDRESS, underlyingAssetName: reserveSymbols[i], - aTokenName: `Aave Interest Bearing ${reserveSymbols[i]}`, + aTokenName: `Aave interest bearing ${reserveSymbols[i]}`, aTokenSymbol: `a${reserveSymbols[i]}`, - variableDebtTokenName: `Aave Variable Debt ${reserveSymbols[i]}`, + variableDebtTokenName: `Aave variable debt bearing ${reserveSymbols[i]}`, variableDebtTokenSymbol: `variableDebt${reserveSymbols[i]}`, - stableDebtTokenName: `Aave Stable Debt ${reserveSymbols[i]}`, + stableDebtTokenName: `Aave stable debt bearing ${reserveSymbols[i]}`, stableDebtTokenSymbol: `stableDebt${reserveSymbols[i]}` }); } @@ -263,9 +263,9 @@ export const initReservesByHelper = async ( poolAddress, tokenAddresses[symbol], treasuryAddress, + ZERO_ADDRESS, `Aave interest bearing ${symbol}`, `a${symbol}`, - ZERO_ADDRESS, ], verify ); @@ -273,9 +273,9 @@ export const initReservesByHelper = async ( [ poolAddress, tokenAddresses[symbol], + ZERO_ADDRESS, // Incentives controller `Aave stable debt bearing ${symbol}`, - `stableDebt${symbol}`, - ZERO_ADDRESS, + `stableDebt${symbol}` ], verify ); @@ -283,9 +283,9 @@ export const initReservesByHelper = async ( [ poolAddress, tokenAddresses[symbol], + ZERO_ADDRESS, // Incentives controller `Aave variable debt bearing ${symbol}`, `variableDebt${symbol}`, - ZERO_ADDRESS, ], verify ); @@ -573,9 +573,9 @@ export const initTokenReservesByHelper = async ( [ poolAddress, tokenAddresses[symbol], + ZERO_ADDRESS, // Incentives controller `Aave stable debt bearing ${symbol}`, - `stableDebt${symbol}`, - ZERO_ADDRESS, + `stableDebt${symbol}` ], verify ); @@ -586,9 +586,9 @@ export const initTokenReservesByHelper = async ( [ poolAddress, tokenAddresses[symbol], + ZERO_ADDRESS, // Incentives Controller `Aave variable debt bearing ${symbol}`, - `variableDebt${symbol}`, - ZERO_ADDRESS, + `variableDebt${symbol}` ], verify ); @@ -604,9 +604,9 @@ export const initTokenReservesByHelper = async ( poolAddress, tokenAddresses[symbol], treasuryAddress, - `Aave interest bearing ${symbol}`, - `a${symbol}`, ZERO_ADDRESS, + `Aave interest bearing ${symbol}`, + `a${symbol}` ], verify ); diff --git a/test/delegation-aware-atoken.spec.ts b/test/delegation-aware-atoken.spec.ts index 903979e6..7b04913e 100644 --- a/test/delegation-aware-atoken.spec.ts +++ b/test/delegation-aware-atoken.spec.ts @@ -9,6 +9,7 @@ import { DRE } from '../helpers/misc-utils'; import { ConfigNames, getATokenDomainSeparatorPerNetwork, + getTreasuryAddress, loadPoolConfig, } from '../helpers/configuration'; import { waitForTx } from '../helpers/misc-utils'; @@ -19,6 +20,7 @@ import { import { DelegationAwareATokenFactory } from '../types'; import { DelegationAwareAToken } from '../types/DelegationAwareAToken'; import { MintableDelegationERC20 } from '../types/MintableDelegationERC20'; +import AaveConfig from '../markets/aave'; const { parseEther } = ethers.utils; @@ -33,11 +35,11 @@ makeSuite('AToken: underlying delegation', (testEnv: TestEnv) => { delegationERC20 = await deployMintableDelegationERC20(['DEL', 'DEL', '18']); delegationAToken = await deployDelegationAwareAToken( - [pool.address, ZERO_ADDRESS, delegationERC20.address, ZERO_ADDRESS, '18', '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'); + //await delegationAToken.initialize(pool.address, ZERO_ADDRESS, delegationERC20.address, ZERO_ADDRESS, '18', 'aDEL', 'aDEL'); console.log((await delegationAToken.decimals()).toString()); }); diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index cbe06e5c..b1fa48a6 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -161,6 +161,9 @@ export const deposit = async ( if (sendValue) { txOptions.value = await convertToCurrencyDecimals(reserve, sendValue); } + + //console.log("Depositing %s %s, expecting %s", amountToDeposit.toString(), reserveSymbol, expectedResult); + if (expectedResult === 'success') { const txResult = await waitForTx( await pool @@ -348,7 +351,7 @@ export const borrow = async ( ); const amountToBorrow = await convertToCurrencyDecimals(reserve, amount); - + //console.log("Borrowing %s %s with rate mode %s expecting", amountToBorrow.toString(), reserveSymbol, interestRateMode, expectedResult); if (expectedResult === 'success') { const txResult = await waitForTx( await pool diff --git a/test/upgradeability.spec.ts b/test/upgradeability.spec.ts index 92ab1ee1..a7d62d37 100644 --- a/test/upgradeability.spec.ts +++ b/test/upgradeability.spec.ts @@ -10,6 +10,7 @@ import { getAToken, getMockStableDebtToken, getMockVariableDebtToken, + getStableDebtToken, getVariableDebtToken, } from '../helpers/contracts-getters'; import { @@ -30,25 +31,25 @@ makeSuite('Upgradeability', (testEnv: TestEnv) => { pool.address, dai.address, ZERO_ADDRESS, + ZERO_ADDRESS, 'Aave Interest bearing DAI updated', 'aDAI', - ZERO_ADDRESS, ]); const stableDebtTokenInstance = await deployMockStableDebtToken([ pool.address, dai.address, + ZERO_ADDRESS, 'Aave stable debt bearing DAI updated', 'stableDebtDAI', - ZERO_ADDRESS, ]); const variableDebtTokenInstance = await deployMockVariableDebtToken([ pool.address, dai.address, + ZERO_ADDRESS, 'Aave variable debt bearing DAI updated', 'variableDebtDAI', - ZERO_ADDRESS, ]); newATokenAddress = aTokenInstance.address; @@ -59,8 +60,26 @@ makeSuite('Upgradeability', (testEnv: TestEnv) => { it('Tries to update the DAI Atoken implementation with a different address than the lendingPoolManager', async () => { const {dai, configurator, users} = testEnv; + const name = await (await getAToken(newATokenAddress)).name(); + const symbol = await (await getAToken(newATokenAddress)).symbol(); + + const updateATokenInputParams: { + asset: string; + treasury: string; + incentivesController: string; + name: string; + symbol: string; + implementation: string; + } = { + asset: dai.address, + treasury: ZERO_ADDRESS, + incentivesController: ZERO_ADDRESS, + name: name, + symbol: symbol, + implementation: newATokenAddress, + }; await expect( - configurator.connect(users[1].signer).updateAToken(dai.address, newATokenAddress) + configurator.connect(users[1].signer).updateAToken(updateATokenInputParams) ).to.be.revertedWith(CALLER_NOT_POOL_ADMIN); }); @@ -68,8 +87,24 @@ makeSuite('Upgradeability', (testEnv: TestEnv) => { const {dai, configurator, aDai} = testEnv; const name = await (await getAToken(newATokenAddress)).name(); + const symbol = await (await getAToken(newATokenAddress)).symbol(); - await configurator.updateAToken(dai.address, newATokenAddress); + const updateATokenInputParams: { + asset: string; + treasury: string; + incentivesController: string; + name: string; + symbol: string; + implementation: string; + } = { + asset: dai.address, + treasury: ZERO_ADDRESS, + incentivesController: ZERO_ADDRESS, + name: name, + symbol: symbol, + implementation: newATokenAddress, + }; + await configurator.updateAToken(updateATokenInputParams); const tokenName = await aDai.name(); @@ -79,19 +114,53 @@ makeSuite('Upgradeability', (testEnv: TestEnv) => { it('Tries to update the DAI Stable debt token implementation with a different address than the lendingPoolManager', async () => { const {dai, configurator, users} = testEnv; + const name = await (await getStableDebtToken(newStableTokenAddress)).name(); + const symbol = await (await getStableDebtToken(newStableTokenAddress)).symbol(); + + + const updateDebtTokenInput: { + asset: string; + incentivesController: string; + name: string; + symbol: string; + implementation: string; + } = { + asset: dai.address, + incentivesController: ZERO_ADDRESS, + name: name, + symbol: symbol, + implementation: newStableTokenAddress, + } + await expect( configurator .connect(users[1].signer) - .updateStableDebtToken(dai.address, newStableTokenAddress) + .updateStableDebtToken(updateDebtTokenInput) ).to.be.revertedWith(CALLER_NOT_POOL_ADMIN); }); it('Upgrades the DAI stable debt token implementation ', async () => { const {dai, configurator, pool, helpersContract} = testEnv; - const name = await (await getAToken(newATokenAddress)).name(); + const name = await (await getStableDebtToken(newStableTokenAddress)).name(); + const symbol = await (await getStableDebtToken(newStableTokenAddress)).symbol(); - await configurator.updateStableDebtToken(dai.address, newStableTokenAddress); + + const updateDebtTokenInput: { + asset: string; + incentivesController: string; + name: string; + symbol: string; + implementation: string; + } = { + asset: dai.address, + incentivesController: ZERO_ADDRESS, + name: name, + symbol: symbol, + implementation: newStableTokenAddress, + } + + await configurator.updateStableDebtToken(updateDebtTokenInput); const {stableDebtTokenAddress} = await helpersContract.getReserveTokensAddresses(dai.address); @@ -104,20 +173,53 @@ makeSuite('Upgradeability', (testEnv: TestEnv) => { it('Tries to update the DAI variable debt token implementation with a different address than the lendingPoolManager', async () => { const {dai, configurator, users} = testEnv; + + const name = await (await getVariableDebtToken(newVariableTokenAddress)).name(); + const symbol = await (await getVariableDebtToken(newVariableTokenAddress)).symbol(); + + const updateDebtTokenInput: { + asset: string; + incentivesController: string; + name: string; + symbol: string; + implementation: string; + } = { + asset: dai.address, + incentivesController: ZERO_ADDRESS, + name: name, + symbol: symbol, + implementation: newVariableTokenAddress, + } await expect( configurator .connect(users[1].signer) - .updateVariableDebtToken(dai.address, newVariableTokenAddress) + .updateVariableDebtToken(updateDebtTokenInput) ).to.be.revertedWith(CALLER_NOT_POOL_ADMIN); }); it('Upgrades the DAI variable debt token implementation ', async () => { const {dai, configurator, pool, helpersContract} = testEnv; + + const name = await (await getVariableDebtToken(newVariableTokenAddress)).name(); + const symbol = await (await getVariableDebtToken(newVariableTokenAddress)).symbol(); + + const updateDebtTokenInput: { + asset: string; + incentivesController: string; + name: string; + symbol: string; + implementation: string; + } = { + asset: dai.address, + incentivesController: ZERO_ADDRESS, + name: name, + symbol: symbol, + implementation: newVariableTokenAddress, + } + //const name = await (await getAToken(newATokenAddress)).name(); - const name = await (await getAToken(newATokenAddress)).name(); - - await configurator.updateVariableDebtToken(dai.address, newVariableTokenAddress); + await configurator.updateVariableDebtToken(updateDebtTokenInput); const {variableDebtTokenAddress} = await helpersContract.getReserveTokensAddresses(dai.address);