From 7279f9d28401646983ca620ef3bfc9e3739f3557 Mon Sep 17 00:00:00 2001 From: Georges KABBOUCHI Date: Wed, 20 Apr 2022 11:59:01 +0300 Subject: [PATCH] aave v3 closes #40 --- abis/read/aaveV3.json | 1222 +++++++++++++++++ abis/read/uiProtocolDataProvider.json | 482 +++++++ .../context/aaveV3/SidebarAaveV3Borrow.vue | 228 +++ .../context/aaveV3/SidebarAaveV3Payback.vue | 265 ++++ .../context/aaveV3/SidebarAaveV3Supply.vue | 238 ++++ .../context/aaveV3/SidebarAaveV3Withdraw.vue | 231 ++++ composables/protocols/useAaveV3Position.ts | 681 +++++++++ composables/useSidebar.ts | 23 +- composables/useToken.ts | 3 + constant/addresses.ts | 17 +- constant/atokensV3/arbitrum.ts | 84 ++ constant/atokensV3/avalanche.ts | 84 ++ constant/atokensV3/fantom.ts | 114 ++ constant/atokensV3/index.ts | 13 + constant/atokensV3/optimism.ts | 84 ++ constant/atokensV3/polygon.ts | 164 +++ nuxt.config.js | 10 + package.json | 1 + pages/aave-v3.vue | 211 +++ pages/index.vue | 28 + utils/index.ts | 1 + yarn.lock | 384 ++++++ 22 files changed, 4560 insertions(+), 8 deletions(-) create mode 100644 abis/read/aaveV3.json create mode 100644 abis/read/uiProtocolDataProvider.json create mode 100644 components/sidebar/context/aaveV3/SidebarAaveV3Borrow.vue create mode 100644 components/sidebar/context/aaveV3/SidebarAaveV3Payback.vue create mode 100644 components/sidebar/context/aaveV3/SidebarAaveV3Supply.vue create mode 100644 components/sidebar/context/aaveV3/SidebarAaveV3Withdraw.vue create mode 100644 composables/protocols/useAaveV3Position.ts create mode 100644 constant/atokensV3/arbitrum.ts create mode 100644 constant/atokensV3/avalanche.ts create mode 100644 constant/atokensV3/fantom.ts create mode 100644 constant/atokensV3/index.ts create mode 100644 constant/atokensV3/optimism.ts create mode 100644 constant/atokensV3/polygon.ts create mode 100644 pages/aave-v3.vue create mode 100644 utils/index.ts diff --git a/abis/read/aaveV3.json b/abis/read/aaveV3.json new file mode 100644 index 0000000..7efc12b --- /dev/null +++ b/abis/read/aaveV3.json @@ -0,0 +1,1222 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "getConfig", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "data", + "type": "uint256" + } + ], + "internalType": "struct UserConfigurationMap", + "name": "data", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "getConfiguration", + "outputs": [ + { + "internalType": "bool[]", + "name": "collateral", + "type": "bool[]" + }, + { + "internalType": "bool[]", + "name": "borrowed", + "type": "bool[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "id", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "getEmodeCategoryData", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "uint16", + "name": "ltv", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "liquidationThreshold", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "liquidationBonus", + "type": "uint16" + }, + { + "internalType": "address", + "name": "priceSource", + "type": "address" + }, + { + "internalType": "string", + "name": "label", + "type": "string" + } + ], + "internalType": "struct EModeCategory", + "name": "data", + "type": "tuple" + } + ], + "internalType": "struct AaveV3Helper.EmodeData", + "name": "eModeData", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getEthPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "ethPrice", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getList", + "outputs": [ + { + "internalType": "address[]", + "name": "data", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "getPosition", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "totalCollateralBase", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalBorrowsBase", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "availableBorrowsBase", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "currentLiquidationThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ltv", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "healthFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "eModeId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "baseUnit", + "type": "uint256" + }, + { + "internalType": "address", + "name": "baseAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + } + ], + "internalType": "struct AaveV3Helper.BaseCurrency", + "name": "base", + "type": "tuple" + } + ], + "internalType": "struct AaveV3Helper.AaveV3UserData", + "name": "", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "supplyBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stableBorrowBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "variableBorrowBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "supplyRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stableBorrowRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "userStableBorrowRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "variableBorrowRate", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isCollateral", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "bool", + "name": "usageAsCollateralEnabled", + "type": "bool" + }, + { + "internalType": "bool", + "name": "borrowEnabled", + "type": "bool" + }, + { + "internalType": "bool", + "name": "stableBorrowEnabled", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isActive", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isFrozen", + "type": "bool" + } + ], + "internalType": "struct AaveV3Helper.Flags", + "name": "flag", + "type": "tuple" + } + ], + "internalType": "struct AaveV3Helper.AaveV3UserTokenData[]", + "name": "", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ltv", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "threshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalSupply", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "availableLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalStableDebt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalVariableDebt", + "type": "uint256" + }, + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + } + ], + "internalType": "struct AaveV3Helper.Token", + "name": "aToken", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + } + ], + "internalType": "struct AaveV3Helper.Token", + "name": "stableDebtToken", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + } + ], + "internalType": "struct AaveV3Helper.Token", + "name": "variableDebtToken", + "type": "tuple" + } + ], + "internalType": "struct AaveV3Helper.ReserveAddresses", + "name": "reserves", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "supplyCap", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowCap", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "eModeCategory", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "debtCeiling", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "debtCeilingDecimals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationFee", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isolationBorrowEnabled", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isPaused", + "type": "bool" + } + ], + "internalType": "struct AaveV3Helper.AaveV3Token", + "name": "token", + "type": "tuple" + } + ], + "internalType": "struct AaveV3Helper.AaveV3TokenData[]", + "name": "", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "underlyingAsset", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "components": [ + { + "internalType": "string", + "name": "rewardTokenSymbol", + "type": "string" + }, + { + "internalType": "address", + "name": "rewardTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "emissionPerSecond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "userUnclaimedRewards", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rewardTokenDecimals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "precision", + "type": "uint256" + } + ], + "internalType": "struct AaveV3Helper.RewardsInfo[]", + "name": "rewardsTokenInfo", + "type": "tuple[]" + } + ], + "internalType": "struct AaveV3Helper.IncentivesData", + "name": "aIncentiveData", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "components": [ + { + "internalType": "string", + "name": "rewardTokenSymbol", + "type": "string" + }, + { + "internalType": "address", + "name": "rewardTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "emissionPerSecond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "userUnclaimedRewards", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rewardTokenDecimals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "precision", + "type": "uint256" + } + ], + "internalType": "struct AaveV3Helper.RewardsInfo[]", + "name": "rewardsTokenInfo", + "type": "tuple[]" + } + ], + "internalType": "struct AaveV3Helper.IncentivesData", + "name": "vIncentiveData", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "components": [ + { + "internalType": "string", + "name": "rewardTokenSymbol", + "type": "string" + }, + { + "internalType": "address", + "name": "rewardTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "emissionPerSecond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "userUnclaimedRewards", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rewardTokenDecimals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "precision", + "type": "uint256" + } + ], + "internalType": "struct AaveV3Helper.RewardsInfo[]", + "name": "rewardsTokenInfo", + "type": "tuple[]" + } + ], + "internalType": "struct AaveV3Helper.IncentivesData", + "name": "sIncentiveData", + "type": "tuple" + } + ], + "internalType": "struct AaveV3Helper.ReserveIncentiveData[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "getPositionAll", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "totalCollateralBase", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalBorrowsBase", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "availableBorrowsBase", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "currentLiquidationThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ltv", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "healthFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "eModeId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "baseUnit", + "type": "uint256" + }, + { + "internalType": "address", + "name": "baseAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + } + ], + "internalType": "struct AaveV3Helper.BaseCurrency", + "name": "base", + "type": "tuple" + } + ], + "internalType": "struct AaveV3Helper.AaveV3UserData", + "name": "", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "supplyBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stableBorrowBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "variableBorrowBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "supplyRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stableBorrowRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "userStableBorrowRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "variableBorrowRate", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isCollateral", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "bool", + "name": "usageAsCollateralEnabled", + "type": "bool" + }, + { + "internalType": "bool", + "name": "borrowEnabled", + "type": "bool" + }, + { + "internalType": "bool", + "name": "stableBorrowEnabled", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isActive", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isFrozen", + "type": "bool" + } + ], + "internalType": "struct AaveV3Helper.Flags", + "name": "flag", + "type": "tuple" + } + ], + "internalType": "struct AaveV3Helper.AaveV3UserTokenData[]", + "name": "", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ltv", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "threshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalSupply", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "availableLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalStableDebt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalVariableDebt", + "type": "uint256" + }, + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + } + ], + "internalType": "struct AaveV3Helper.Token", + "name": "aToken", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + } + ], + "internalType": "struct AaveV3Helper.Token", + "name": "stableDebtToken", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + } + ], + "internalType": "struct AaveV3Helper.Token", + "name": "variableDebtToken", + "type": "tuple" + } + ], + "internalType": "struct AaveV3Helper.ReserveAddresses", + "name": "reserves", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "supplyCap", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowCap", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "eModeCategory", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "debtCeiling", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "debtCeilingDecimals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationFee", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isolationBorrowEnabled", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isPaused", + "type": "bool" + } + ], + "internalType": "struct AaveV3Helper.AaveV3Token", + "name": "token", + "type": "tuple" + } + ], + "internalType": "struct AaveV3Helper.AaveV3TokenData[]", + "name": "", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "underlyingAsset", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "components": [ + { + "internalType": "string", + "name": "rewardTokenSymbol", + "type": "string" + }, + { + "internalType": "address", + "name": "rewardTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "emissionPerSecond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "userUnclaimedRewards", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rewardTokenDecimals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "precision", + "type": "uint256" + } + ], + "internalType": "struct AaveV3Helper.RewardsInfo[]", + "name": "rewardsTokenInfo", + "type": "tuple[]" + } + ], + "internalType": "struct AaveV3Helper.IncentivesData", + "name": "aIncentiveData", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "components": [ + { + "internalType": "string", + "name": "rewardTokenSymbol", + "type": "string" + }, + { + "internalType": "address", + "name": "rewardTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "emissionPerSecond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "userUnclaimedRewards", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rewardTokenDecimals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "precision", + "type": "uint256" + } + ], + "internalType": "struct AaveV3Helper.RewardsInfo[]", + "name": "rewardsTokenInfo", + "type": "tuple[]" + } + ], + "internalType": "struct AaveV3Helper.IncentivesData", + "name": "vIncentiveData", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "components": [ + { + "internalType": "string", + "name": "rewardTokenSymbol", + "type": "string" + }, + { + "internalType": "address", + "name": "rewardTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "emissionPerSecond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "userUnclaimedRewards", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rewardTokenDecimals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "precision", + "type": "uint256" + } + ], + "internalType": "struct AaveV3Helper.RewardsInfo[]", + "name": "rewardsTokenInfo", + "type": "tuple[]" + } + ], + "internalType": "struct AaveV3Helper.IncentivesData", + "name": "sIncentiveData", + "type": "tuple" + } + ], + "internalType": "struct AaveV3Helper.ReserveIncentiveData[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getReservesList", + "outputs": [ + { + "internalType": "address[]", + "name": "data", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "self", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveIndex", + "type": "uint256" + } + ], + "name": "isBorrowing", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "self", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveIndex", + "type": "uint256" + } + ], + "name": "isUsingAsCollateral", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "self", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveIndex", + "type": "uint256" + } + ], + "name": "isUsingAsCollateralOrBorrowing", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + } +] \ No newline at end of file diff --git a/abis/read/uiProtocolDataProvider.json b/abis/read/uiProtocolDataProvider.json new file mode 100644 index 0000000..e56431a --- /dev/null +++ b/abis/read/uiProtocolDataProvider.json @@ -0,0 +1,482 @@ +[ + { + "inputs": [ + { + "internalType": "contract IEACAggregatorProxy", + "name": "_networkBaseTokenPriceInUsdProxyAggregator", + "type": "address" + }, + { + "internalType": "contract IEACAggregatorProxy", + "name": "_marketReferenceCurrencyPriceInUsdProxyAggregator", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "ETH_CURRENCY_UNIT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MKR_ADDRESS", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_bytes32", + "type": "bytes32" + } + ], + "name": "bytes32ToString", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPoolAddressesProvider", + "name": "provider", + "type": "address" + } + ], + "name": "getReservesData", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "underlyingAsset", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseLTVasCollateral", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveLiquidationThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveLiquidationBonus", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveFactor", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "usageAsCollateralEnabled", + "type": "bool" + }, + { + "internalType": "bool", + "name": "borrowingEnabled", + "type": "bool" + }, + { + "internalType": "bool", + "name": "stableBorrowRateEnabled", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isActive", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isFrozen", + "type": "bool" + }, + { + "internalType": "uint128", + "name": "liquidityIndex", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "variableBorrowIndex", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "liquidityRate", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "variableBorrowRate", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "stableBorrowRate", + "type": "uint128" + }, + { + "internalType": "uint40", + "name": "lastUpdateTimestamp", + "type": "uint40" + }, + { + "internalType": "address", + "name": "aTokenAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "stableDebtTokenAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "variableDebtTokenAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "interestRateStrategyAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "availableLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalPrincipalStableDebt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "averageStableRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stableDebtLastUpdateTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalScaledVariableDebt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "priceInMarketReferenceCurrency", + "type": "uint256" + }, + { + "internalType": "address", + "name": "priceOracle", + "type": "address" + }, + { + "internalType": "uint256", + "name": "variableRateSlope1", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "variableRateSlope2", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stableRateSlope1", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stableRateSlope2", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseStableBorrowRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseVariableBorrowRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "optimalUsageRatio", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isPaused", + "type": "bool" + }, + { + "internalType": "uint128", + "name": "accruedToTreasury", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "unbacked", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "isolationModeTotalDebt", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "debtCeiling", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "debtCeilingDecimals", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "eModeCategoryId", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "borrowCap", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "supplyCap", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "eModeLtv", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "eModeLiquidationThreshold", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "eModeLiquidationBonus", + "type": "uint16" + }, + { + "internalType": "address", + "name": "eModePriceSource", + "type": "address" + }, + { + "internalType": "string", + "name": "eModeLabel", + "type": "string" + }, + { + "internalType": "bool", + "name": "borrowableInIsolation", + "type": "bool" + } + ], + "internalType": "struct IUiPoolDataProviderV3.AggregatedReserveData[]", + "name": "", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "marketReferenceCurrencyUnit", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "marketReferenceCurrencyPriceInUsd", + "type": "int256" + }, + { + "internalType": "int256", + "name": "networkBaseTokenPriceInUsd", + "type": "int256" + }, + { + "internalType": "uint8", + "name": "networkBaseTokenPriceDecimals", + "type": "uint8" + } + ], + "internalType": "struct IUiPoolDataProviderV3.BaseCurrencyInfo", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPoolAddressesProvider", + "name": "provider", + "type": "address" + } + ], + "name": "getReservesList", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPoolAddressesProvider", + "name": "provider", + "type": "address" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "getUserReservesData", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "underlyingAsset", + "type": "address" + }, + { + "internalType": "uint256", + "name": "scaledATokenBalance", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "usageAsCollateralEnabledOnUser", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "stableBorrowRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "scaledVariableDebt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "principalStableDebt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stableBorrowLastUpdateTimestamp", + "type": "uint256" + } + ], + "internalType": "struct IUiPoolDataProviderV3.UserReserveData[]", + "name": "", + "type": "tuple[]" + }, + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "marketReferenceCurrencyPriceInUsdProxyAggregator", + "outputs": [ + { + "internalType": "contract IEACAggregatorProxy", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "networkBaseTokenPriceInUsdProxyAggregator", + "outputs": [ + { + "internalType": "contract IEACAggregatorProxy", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/components/sidebar/context/aaveV3/SidebarAaveV3Borrow.vue b/components/sidebar/context/aaveV3/SidebarAaveV3Borrow.vue new file mode 100644 index 0000000..6327f55 --- /dev/null +++ b/components/sidebar/context/aaveV3/SidebarAaveV3Borrow.vue @@ -0,0 +1,228 @@ + + + diff --git a/components/sidebar/context/aaveV3/SidebarAaveV3Payback.vue b/components/sidebar/context/aaveV3/SidebarAaveV3Payback.vue new file mode 100644 index 0000000..256078c --- /dev/null +++ b/components/sidebar/context/aaveV3/SidebarAaveV3Payback.vue @@ -0,0 +1,265 @@ + + + diff --git a/components/sidebar/context/aaveV3/SidebarAaveV3Supply.vue b/components/sidebar/context/aaveV3/SidebarAaveV3Supply.vue new file mode 100644 index 0000000..8003ed2 --- /dev/null +++ b/components/sidebar/context/aaveV3/SidebarAaveV3Supply.vue @@ -0,0 +1,238 @@ + + + diff --git a/components/sidebar/context/aaveV3/SidebarAaveV3Withdraw.vue b/components/sidebar/context/aaveV3/SidebarAaveV3Withdraw.vue new file mode 100644 index 0000000..3578e4d --- /dev/null +++ b/components/sidebar/context/aaveV3/SidebarAaveV3Withdraw.vue @@ -0,0 +1,231 @@ + + + diff --git a/composables/protocols/useAaveV3Position.ts b/composables/protocols/useAaveV3Position.ts new file mode 100644 index 0000000..a53321a --- /dev/null +++ b/composables/protocols/useAaveV3Position.ts @@ -0,0 +1,681 @@ +import { AbiItem } from "web3-utils"; + +import aaveV3ABI from "~/abis/read/aaveV3.json"; +import uiDataProviderABI from '~/abis/read/uiProtocolDataProvider.json' +import { computed, ref, watch } from "@nuxtjs/composition-api"; +import { useDSA } from "~/composables/useDSA"; +import { useWeb3 } from "@instadapp/vue-web3"; +import BigNumber from "bignumber.js"; +import atokensV3 from "~/constant/atokensV3"; +import tokens from "~/constant/tokens"; +import { Multicall } from 'ethereum-multicall' +import { Network, useNetwork } from "~/composables/useNetwork"; +import { useBigNumber } from "~/composables/useBigNumber"; +import { usePosition } from "~/composables/usePosition"; +import { useToken } from "~/composables/useToken"; +import { useSorting } from "~/composables/useSorting"; +import useEventBus from "../useEventBus"; +import addresses from "~/constant/addresses"; +import Web3 from "web3"; + +const { + times, + isZero, + div, + max, + gt, + minus, + ensureValue, + plus +} = useBigNumber(); +const { getType } = usePosition(); + +export const position = ref({ + totalSupplyInEth: new BigNumber(0), + totalBorrowInEth: new BigNumber(0), + totalSupplyInUsd: "0", + totalBorrowInUsd: "0", + totalBorrowStableInEth: new BigNumber(0), + totalBorrowVariableInEth: new BigNumber(0), + maxBorrowLimitInEth: new BigNumber(0), + maxBorrowLiquidityLimitInEth: new BigNumber(0), + status: new BigNumber(0), + liquidation: new BigNumber(0), + maxLiquidation: new BigNumber(0), + ethPriceInUsd: new BigNumber(0), + pendingRewards: new BigNumber(0), + emodeId: "0", + data: [], +}); +const totalSupply = computed(() => + position.value + ? times( + position.value.totalSupplyInEth, + position.value.ethPriceInUsd + ).toFixed() + : 0 +); + +const totalBorrow = computed(() => + position.value + ? times( + position.value.totalBorrowInEth, + position.value.ethPriceInUsd + ).toFixed() + : 0 +); + +const ethPriceInUsd = computed(() => position.value?.ethPriceInUsd); + +const annualPercentageRateTypes = computed(() => [ + { label: "Variable", value: "variable", rateMode: 2 }, + { label: "Stable", value: "stable", rateMode: 1 } +]); + + +async function getAaveV3TokenList(web3Instance: Web3, network: Network) { + try { + let rawData + + const uiDataProvider = new web3Instance.eth.Contract(uiDataProviderABI as any, addresses[network].uiData) + + try { + rawData = await uiDataProvider.methods.getReservesData(addresses[network].poolDataProvider).call() + } catch (error) { + console.log(error) + return Promise.reject(error) + } + const tokenList = { tokenData: [], aaveTokensArr: [], rawData } + for (const x of rawData[0]) { + const ele = atokensV3[network].allTokens.find((y) => { + return y.address.toLowerCase() === x.aTokenAddress.toLowerCase() + }) + if (!ele || !tokens[network].getTokenByKey(ele.root)) { + tokenList.tokenData.push({ + root: x.symbol.toLowerCase(), + type: 'atoken', + symbol: `A${x.symbol}`, + name: `AAVE ${x.symbol}`, + address: x.aTokenAddress, + decimals: x.decimals, + factor: new BigNumber(x.baseLTVasCollateral).dividedBy(1e4), + key: `a${x.symbol.toLowerCase()}`, + underlyingAsset: x.underlyingAsset, + supplyCap: x.supplyCap, + borrowCap: x.borrowCap, + availableLiquidity: new BigNumber(x.availableLiquidity).dividedBy(10 ** x.decimals), + totalScaledVariableDebt: new BigNumber(x.totalScaledVariableDebt).dividedBy(10 ** x.decimals), + totalPrincipalStableDebt: new BigNumber(x.totalPrincipalStableDebt).dividedBy(10 ** x.decimals), + reserveLiquidationBonus: new BigNumber(x.reserveLiquidationBonus).dividedBy(1e4), + eModeLiquidationThreshold: new BigNumber(x.eModeLiquidationThreshold).dividedBy(1e4), + eModeLiquidationBonus: new BigNumber(x.eModeLiquidationBonus).dividedBy(1e4), + eModeLtv: new BigNumber(x.eModeLtv).dividedBy(1e4), + borrowableInIsolation: x.borrowableInIsolation, + isolatedModeDebtCeilingInUsd: new BigNumber(x.debtCeiling).dividedBy(10 ** x.debtCeilingDecimals), + }) + } else { + tokenList.tokenData.push({ + ...ele, + underlyingAsset: x.underlyingAsset, + supplyCap: x.supplyCap, + borrowCap: x.borrowCap, + availableLiquidity: new BigNumber(x.availableLiquidity).dividedBy(10 ** x.decimals), + totalScaledVariableDebt: new BigNumber(x.totalScaledVariableDebt).dividedBy(10 ** x.decimals), + totalPrincipalStableDebt: new BigNumber(x.totalPrincipalStableDebt).dividedBy(10 ** x.decimals), + reserveLiquidationBonus: new BigNumber(x.reserveLiquidationBonus).dividedBy(1e4), + eModeLiquidationThreshold: new BigNumber(x.eModeLiquidationThreshold).dividedBy(1e4), + eModeLiquidationBonus: new BigNumber(x.eModeLiquidationBonus).dividedBy(1e4), + eModeLtv: new BigNumber(x.eModeLtv).dividedBy(1e4), + borrowableInIsolation: x.borrowableInIsolation, + isolatedModeDebtCeilingInUsd: new BigNumber(x.debtCeiling).dividedBy(10 ** x.debtCeilingDecimals), + }) + } + tokenList.aaveTokensArr.push(x.underlyingAsset) + } + + return tokenList + } catch (error) { + console.log(error) + return Promise.reject(error) + } +} + + +export function useAaveV3Position( + { overridePosition } = { overridePosition: null } +) { + overridePosition = overridePosition || (pos => pos); + + const { library, chainId } = useWeb3(); + const { activeNetworkId } = useNetwork(); + const { activeAccount } = useDSA(); + const { getTokenByKey, allATokensV3 } = useToken(); + const { byMaxSupplyOrBorrowDesc } = useSorting(); + const { onEvent } = useEventBus(); + + const resolver = computed( + () => + // @ts-ignore + addresses[activeNetworkId.value]?.resolver?.aave_v3 + ); + + const fetchPosition = async () => { + if (!library.value) { + return; + } + + if (!activeAccount.value) { + return; + } + const multicall = new Multicall({ + multicallCustomContractAddress: activeNetworkId.value === Network.Optimism ? '0xca11bde05977b3631167028862be2a173976ca11' : undefined, + web3Instance: library.value, + tryAggregate: true, + }) + + const { tokenData, aaveTokensArr, rawData } = await getAaveV3TokenList(library.value, activeNetworkId.value) + + const contractCallContext = [] + + tokenData.forEach((atoken, i) => { + contractCallContext.push( + { + reference: `domainSeperatorCall${i}`, + contractAddress: atoken.address, + abi: ['function DOMAIN_SEPARATOR() public view returns (bytes32)'], + calls: [{ reference: `domainSeperatorCall, ${i}`, methodName: 'DOMAIN_SEPARATOR', methodParameters: [] }], + }, + { + reference: `userNonce${i}`, + contractAddress: atoken.address, + abi: ['function nonces(address owner) public view returns (uint256)'], + calls: [{ reference: `userNonce, ${i}`, methodName: 'nonces', methodParameters: [activeAccount.value.address] }], + }, + ) + }) + const aaveResolverInstance = new library.value.eth.Contract( + aaveV3ABI as AbiItem[], + resolver.value + ); + + const [aaveRawData, ethPrice] = await Promise.all([ + aaveResolverInstance.methods.getPosition(activeAccount.value.address, aaveTokensArr).call(), + aaveResolverInstance.methods.getEthPrice().call(), + + ]) + + const results = (await multicall.call(contractCallContext)).results + + + const newPos = calculateAavePosition( + aaveRawData, + rawData, + tokenData, + ethPrice, + results, + ); + + return newPos; + }; + + const refreshPosition = async () => { + position.value = await fetchPosition(); + }; + + onEvent("protocol::aaveV3::refresh", refreshPosition); + + watch( + library, + async val => { + if (val) { + refreshPosition(); + } + }, + { immediate: true } + ); + + watch( + activeAccount, + async val => { + if (val) { + refreshPosition(); + } + }, + { immediate: true } + ); + + const stats = computed(() => + displayPositions.value.reduce( + (stats, { key, supply, borrow, priceInEth, factor, liquidation }) => { + if (key === "eth") { + stats.ethSupplied = supply; + } + + stats.totalSupplyInEth = plus( + stats.totalSupplyInEth, + times(supply, priceInEth) + ).toFixed(); + stats.totalBorrowInEth = plus( + stats.totalBorrowInEth, + times(borrow, priceInEth) + ).toFixed(); + stats.totalMaxBorrowLimitInEth = plus( + stats.totalMaxBorrowLimitInEth, + times(supply, times(priceInEth, factor)) + ).toFixed(); + stats.totalMaxLiquidationLimitInEth = plus( + stats.totalMaxLiquidationLimitInEth, + times(supply, times(priceInEth, liquidation)) + ).toFixed(); + + return stats; + }, + { + totalSupplyInEth: "0", + totalBorrowInEth: "0", + totalMaxBorrowLimitInEth: "0", + totalMaxLiquidationLimitInEth: "0", + ethSupplied: "0" + } + ) + ); + + const rewardTokenPriceInUsd = computed(() => { + if (activeNetworkId.value === Network.Polygon) { + return ensureValue( + position.value.data.find(position => position.key === "matic") + ?.priceInUsd + ); + } + return ensureValue( + position.value.data.find(position => position.key === "aave")?.priceInUsd + ); + }); + + const displayPositions = computed(() => { + if (!position.value) { + return []; + } + + return allATokensV3.value + .flatMap(atoken => { + const token = getTokenByKey(atoken.root); + + const atokenPosition = position.value.data.find( + x => x.key === atoken.root + ); + + const p = getPositionOrDefaultPosition(token, atokenPosition); + + if (gt(p.supply, "0") && gt(p.borrow, "0")) { + return [ + { ...p, type: "supply" }, + { ...p, type: "borrow" } + ]; + } else { + return [p]; + } + }) + .sort((a, b) => + minus( + max(b.supplyUsd, b.borrowUsd), + max(a.supplyUsd, a.borrowUsd) + ).toNumber() + ) + .map(overridePosition) + .sort(byMaxSupplyOrBorrowDesc); + }); + + function getPositionOrDefaultPosition(token, position) { + if (!position) { + const defaultPosition = { + key: token.key, + aTokenKey: "", + aTokenBal: "0", + aDecimals: "0", + cf: "0", + ll: "0", + supply: "0", + supplyUsd: "0", + supplyRate: "0", + borrow: "0", + borrowUsd: "0", + borrowRate: "0", + type: "no", + isEnabledAsCollateral: true, + borrowEnabled: true, + availableLiquidity: "0", + stableBorrowEnabled: true, + borrowStable: "0", + borrowStableRate: "0", + supplyRewardRate: "0", + borrowRewardRate: "0" + }; + + return defaultPosition; + } + + return { + key: token.key, + aTokenKey: position.aTokenKey, + aTokenBal: position.aTokenBal, + aDecimals: position.aDecimals, + cf: position.factor, + ll: position.liquidation, + factor: position.factor, + liquidation: position.liquidation, + supply: position.supply, + supplyUsd: times(position.supply, position.priceInUsd).toFixed(), + supplyRate: position.supplyRate, + borrow: position.borrow, + borrowUsd: times(position.borrow, position.priceInUsd).toFixed(), + borrowRate: position.borrowRate, + priceInEth: position.priceInEth, + type: getType(position), + isEnabledAsCollateral: position.isEnabledAsCollateral, + borrowEnabled: position.borrowEnabled, + availableLiquidity: position.availableLiquidity, + borrowStableUsd: times( + position.borrowStable, + position.priceInUsd + ).toFixed(), + stableBorrowEnabled: position.stableBorrowEnabled, + borrowStable: position.borrowStable, + borrowStableRate: position.borrowStableRate, + priceInUsd: position.priceInUsd, + supplyRewardRate: times( + position.supplyRewardRate, + rewardTokenPriceInUsd.value + ).toFixed(), + borrowRewardRate: times( + position.borrowRewardRate, + rewardTokenPriceInUsd.value + ).toFixed() + }; + } + + const maxLiquidation = computed(() => { + if (isZero(stats.value.totalSupplyInEth)) return "0"; + + return max( + div( + stats.value.totalMaxLiquidationLimitInEth, + stats.value.totalSupplyInEth + ), + "0" + ).toFixed(); + }); + + const liquidationPrice = computed(() => { + if (isZero(stats.value.ethSupplied)) return "0"; + + return max( + times( + div( + stats.value.totalBorrowInEth, + stats.value.totalMaxLiquidationLimitInEth + ), + ethPriceInUsd.value + ), + "0" + ).toFixed(); + }); + + const status = computed(() => { + if ( + isZero(stats.value.totalSupplyInEth) && + !isZero(stats.value.totalBorrowInEth) + ) + return "1.1"; + if (isZero(stats.value.totalSupplyInEth)) return "0"; + + return max( + div(stats.value.totalBorrowInEth, stats.value.totalSupplyInEth), + "0" + ).toFixed(); + }); + + const liquidation = computed(() => { + if (isZero(stats.value.totalSupplyInEth)) return "0"; + + return max( + div(stats.value.totalMaxBorrowLimitInEth, stats.value.totalSupplyInEth), + "0" + ).toFixed(); + }); + + return { + stats, + displayPositions, + position, + fetchPosition, + refreshPosition, + totalSupply, + totalBorrow, + status, + liquidation, + maxLiquidation, + liquidationPrice, + liquidationMaxPrice: ethPriceInUsd, + annualPercentageRateTypes + }; +} + +function calculateAavePosition(res: any[], rawData: any[], tokenList: any[], ethPrice: any, multiCallResults: any) { + console.log({ + res, + rawData, + tokenList, + ethPrice, + multiCallResults, + }) + try { + ethPrice = new BigNumber(ethPrice).dividedBy(1e8) + + const dataPos = [] + const AaveV3UserData = res[0] + const [ + totalCollateralBase, + totalBorrowsBase, + _availableBorrowsBase, + currentLiquidationThreshold, + ltv, + _healthFactor, + eModeId, + _base, + ] = AaveV3UserData + + // const tokenUiData = rawData[0] + const baseCurrencyInfo = rawData[1] + + // const [baseUnit, baseInUSD] = baseCurrencyInfo + const [baseUnit] = baseCurrencyInfo + + const newPosition: any = { + totalSupplyInEth: new BigNumber(0), + totalBorrowInEth: new BigNumber(0), + totalSupplyInUsd: new BigNumber(totalCollateralBase).dividedBy(baseUnit).toFixed(), + totalBorrowInUsd: new BigNumber(totalBorrowsBase).dividedBy(baseUnit).toFixed(), + totalBorrowStableInEth: new BigNumber(0), + totalBorrowVariableInEth: new BigNumber(0), + maxBorrowLimitInEth: new BigNumber(0), + maxBorrowLiquidityLimitInEth: new BigNumber(0), + status: new BigNumber(0), + liquidation: new BigNumber(ltv).dividedBy(1e4), + maxLiquidation: new BigNumber(currentLiquidationThreshold).dividedBy(1e4), + ethPriceInUsd: new BigNumber(ethPrice), + pendingRewards: new BigNumber(0), + emodeId: eModeId, + data: [], + // tokens: {}, + } + + tokenList.forEach((atoken, i) => { + /* eslint-disable no-unused-vars */ + const [ + supplyBalanceInWei, + borrowStableBalanceInWei, + borrowVariableBalanceInWei, + supplyRatePerBlock, + borrowStableRatePerBlock, + userStableBorrowRatePerBlock, + borrowVariableRatePerBlock, + isCollateralEnabled, + price, + flag, + ] = res[1][i] + const [usageAsCollateralEnabled, borrowEnabled, stableBorrowEnabled, isActive, isFrozen] = flag + + const [ + asset, + symbol, + decimals, + ltv, + threshold, + reserveFactor, + totalSupply, + availableLiquidity, + totalStableDebt, + totalVariableDebt, + reserves, + aaveV3Token, + // collateralEmission, + // debtEmission, + // aTokenAddress, + // stableDebtTokenAddress, + // variableDebtTokenAddress, + ] = res[2][i] + /* eslint-enable no-unused-vars */ + + const [aTokenAddr, sTokenAddr, vTokenAddr] = reserves + + // Reward Info: TODO + // const rewardInfo = res[3][i] + // const aIncentiveData = rewardInfo[1] + // const rewardsTokenInfo = aIncentiveData.rewardsTokenInfo + // const UserRewardInfo = { + // rewardTokenSymbol: rewardsTokenInfo[0], + // rewardTokenDecimals: rewardsTokenInfo[4], + // rewardTokenAddress: rewardsTokenInfo[1], + // userUnclaimedRewards: rewardsTokenInfo[3], + // } + + const [, , eModeCategory] = aaveV3Token + const root = atoken.root + const factor = new BigNumber(ltv).dividedBy(1e4) + const priceInUsd = new BigNumber(price).dividedBy(baseUnit).toFixed() + const priceInEth = new BigNumber(priceInUsd).dividedBy(ethPrice) + const supply = new BigNumber(supplyBalanceInWei).dividedBy(10 ** decimals) + const borrowStable = new BigNumber(borrowStableBalanceInWei).dividedBy(10 ** decimals) + const borrowVariable = new BigNumber(borrowVariableBalanceInWei).dividedBy(10 ** decimals) + const supplyRate = new BigNumber(supplyRatePerBlock).dividedBy(1e27).toFixed() + const supplyYield = supplyRate + const borrowStableRate = new BigNumber(borrowStableRatePerBlock).dividedBy(1e27).toFixed() + const userBorrowStableRate = new BigNumber(userStableBorrowRatePerBlock).dividedBy(1e27).toFixed() + const borrowVariableRate = new BigNumber(borrowVariableRatePerBlock).dividedBy(1e27).toFixed() + const borrowStableYield = borrowStableRate + const borrowVariableYield = borrowVariableRate + + // const totalSupplied = new BigNumber(totalSupply).dividedBy(10 ** decimals).multipliedBy(priceInUsd) + // const totalDebt = BigNumber.sum(BigNumber(totalVariableDebt), BigNumber(totalStableDebt)) + + // .dividedBy(10 ** decimals) + // .multipliedBy(priceInUsd) + + // const supplyRewardRate = new BigNumber(collateralEmission) + // .multipliedBy(31536000) + // .dividedBy(1e18) + // .dividedBy(totalSupplied) + // .toFixed() + // const borrowRewardRate = new BigNumber(debtEmission) + // .multipliedBy(31536000) + // .dividedBy(1e18) + // .dividedBy(totalDebt) + // .toFixed() + + newPosition.totalSupplyInEth = newPosition.totalSupplyInEth.plus(supply.multipliedBy(priceInEth)) + newPosition.maxBorrowLimitInEth = newPosition.maxBorrowLimitInEth.plus( + supply.multipliedBy(priceInEth).multipliedBy(factor), + ) + newPosition.maxBorrowLiquidityLimitInEth = newPosition.maxBorrowLiquidityLimitInEth.plus( + supply.multipliedBy(priceInEth).multipliedBy((threshold / 10000).toString()), + ) + newPosition.totalBorrowInEth = newPosition.totalBorrowInEth.plus( + borrowStable.plus(borrowVariable).multipliedBy(priceInEth), + ) + newPosition.totalBorrowStableInEth = newPosition.totalBorrowStableInEth.plus(borrowStable.multipliedBy(priceInEth)) + newPosition.totalBorrowVariableInEth = newPosition.totalBorrowVariableInEth.plus( + borrowVariable.multipliedBy(priceInEth), + ) + + dataPos.push({ + key: root, + underlyingTokenAddress: atoken.underlyingAsset, + aTokenAddr: aTokenAddr[0], + stableDebtTokenAddress: sTokenAddr[0], + variableDebtTokenAddress: vTokenAddr[0], + aTokenBal: supplyBalanceInWei, + aTokenKey: atoken.key, + aDecimals: atoken.decimals.toString(), + priceInEth: priceInEth.toFixed(), + priceInUsd, + liquidationBonus: new BigNumber(atoken.reserveLiquidationBonus).toString(), + supply: supply.toFixed(), + borrowStable: borrowStable.toFixed(), + borrowCap: atoken.borrowCap, + supplyCap: atoken.supplyCap, + borrow: borrowVariable.toFixed(), // TODO: change later + supplyRate, + supplyYield, + borrowStableRate, + userBorrowStableRate, + borrowStableYield, + borrowRate: borrowVariableRate, // TODO: change later + borrowYield: borrowVariableYield, // TODO: change later + factor: factor.toFixed(), + liquidation: (threshold / 10000).toString(), + isEnabledAsCollateral: isCollateralEnabled, + borrowEnabled, + stableBorrowEnabled, + availableLiquidity: atoken.availableLiquidity.toFixed(0), + totalScaledVariableDebt: atoken.totalScaledVariableDebt.toFixed(0), + totalScaledStableDebt: atoken.totalPrincipalStableDebt.toFixed(0), + eModeCategory, + eModeFactor: new BigNumber(atoken.eModeLtv).toString(), + eModeLiquidation: new BigNumber(atoken.eModeLiquidationThreshold).toString(), + eModeLiquidationBonus: new BigNumber(atoken.eModeLiquidationBonus).toString(), + eModeLabel: atoken.eModeLabel, + borrowableInIsolation: atoken.borrowableInIsolation, + isIsolatedAsset: atoken.isolatedModeDebtCeilingInUsd > 0, + isolationDebtCeiling: atoken.isolatedModeDebtCeilingInUsd, + UserRewardInfo: {}, + domainSeperator: multiCallResults[`domainSeperatorCall${i}`].callsReturnContext[0].returnValues, + atokenNonce: new BigNumber(multiCallResults[`userNonce${i}`].callsReturnContext[0].returnValues).toString(), + // supplyRewardRate, + // borrowRewardRate, + }) + }) + + const totalSupplyInEthIsZero = newPosition.totalSupplyInEth.isZero() + const status = totalSupplyInEthIsZero ? 0 : newPosition.totalBorrowInEth.dividedBy(newPosition.totalSupplyInEth).toFixed() + + // const pendingRewards = new BigNumber(res[1].pendingRewards).dividedBy(1e18).toFixed() + + newPosition.totalSupplyInEth = newPosition.totalSupplyInEth.toFixed() + newPosition.totalBorrowInEth = newPosition.totalBorrowInEth.toFixed() + newPosition.maxBorrowLimitInEth = newPosition.maxBorrowLimitInEth.toFixed() + newPosition.maxBorrowLiquidityLimitInEth = newPosition.maxBorrowLiquidityLimitInEth.toFixed() + newPosition.totalBorrowStableInEth = newPosition.totalBorrowStableInEth.toFixed() + newPosition.totalBorrowVariableInEth = newPosition.totalBorrowVariableInEth.toFixed() + + newPosition.status = status + newPosition.pendingRewards = 0 // TODO = pendingRewards + + newPosition.data = dataPos + + return newPosition + } catch (error) { + console.error(error); + return Promise.reject(error); + } +} diff --git a/composables/useSidebar.ts b/composables/useSidebar.ts index 408ebe5..a7d81c8 100644 --- a/composables/useSidebar.ts +++ b/composables/useSidebar.ts @@ -14,6 +14,11 @@ import SidebarAaveV2Withdraw from '~/components/sidebar/context/aaveV2/SidebarAa import SidebarAaveV2Borrow from '~/components/sidebar/context/aaveV2/SidebarAaveV2Borrow.vue' import SidebarAaveV2Payback from '~/components/sidebar/context/aaveV2/SidebarAaveV2Payback.vue' +import SidebarAaveV3Supply from "~/components/sidebar/context/aaveV3/SidebarAaveV3Supply.vue"; +import SidebarAaveV3Withdraw from '~/components/sidebar/context/aaveV3/SidebarAaveV3Withdraw.vue' +import SidebarAaveV3Borrow from '~/components/sidebar/context/aaveV3/SidebarAaveV3Borrow.vue' +import SidebarAaveV3Payback from '~/components/sidebar/context/aaveV3/SidebarAaveV3Payback.vue' + import SidebarOverview from '~/components/sidebar/context/overview/SidebarOverview.vue' import SidebarDepositOverview from '~/components/sidebar/context/SidebarDepositOverview.vue' import SidebarWithdraw from '~/components/sidebar/context/SidebarWithdraw.vue' @@ -56,8 +61,8 @@ import SidebarStrategySelection from '~/components/sidebar/context/strategy/Side import SidebarStrategy from '~/components/sidebar/context/strategy/SidebarStrategy.vue' const sidebars = { - "#overview" : {component: SidebarOverview, back : false, close : true }, - "#deposit-overview": {component: SidebarDepositOverview, back: { hash: 'overview' } }, + "#overview": { component: SidebarOverview, back: false, close: true }, + "#deposit-overview": { component: SidebarDepositOverview, back: { hash: 'overview' } }, '#withdraw-token': { component: SidebarWithdraw, back: { hash: 'overview' } }, '#strategies': { component: SidebarStrategySelection }, '#strategy': { component: SidebarStrategy }, @@ -107,6 +112,12 @@ const sidebars = { "/mainnet/yearn-v2": { component: null }, "/mainnet/yearn-v2#supply": { component: SidebarYearnV2Supply }, "/mainnet/yearn-v2#withdraw": { component: SidebarYearnV2Withdraw }, + + "/aave-v3": { component: null }, + "/aave-v3#supply": { component: SidebarAaveV3Supply }, + "/aave-v3#borrow": { component: SidebarAaveV3Borrow }, + "/aave-v3#payback": { component: SidebarAaveV3Payback }, + "/aave-v3#withdraw": { component: SidebarAaveV3Withdraw }, }; const sidebar = ref(null); @@ -130,15 +141,15 @@ export function init() { //@ts-ignore const [hash, params] = route.hash.split("?"); - - if (hasPathChanged){ + + if (hasPathChanged) { router.push({ hash: null }) return } - //@ts-ignore + //@ts-ignore sidebar.value = sidebars[route.path + hash] || sidebars[hash]; - + if (!sidebar.value) { props.value = {}; return; diff --git a/composables/useToken.ts b/composables/useToken.ts index 486c57f..c9b78db 100644 --- a/composables/useToken.ts +++ b/composables/useToken.ts @@ -1,5 +1,6 @@ import { computed } from "@nuxtjs/composition-api"; import atokensV2 from "~/constant/atokensV2"; +import atokensV3 from "~/constant/atokensV3"; import tokens from "~/constant/tokens"; import { useBigNumber } from "./useBigNumber"; import { useNetwork } from "./useNetwork"; @@ -14,6 +15,7 @@ export function useToken() { ); const allATokensV2 = computed(() => atokensV2[activeNetworkId.value].allTokens); + const allATokensV3 = computed(() => atokensV3[activeNetworkId.value].allTokens); function valInt(val, decimals) { const num = toBN(val); @@ -24,6 +26,7 @@ export function useToken() { return { getTokenByKey, allATokensV2, + allATokensV3, valInt }; } diff --git a/constant/addresses.ts b/constant/addresses.ts index 81f55f8..6097fcf 100644 --- a/constant/addresses.ts +++ b/constant/addresses.ts @@ -15,7 +15,9 @@ const addresses = { bprotocol: "0x3843019c19259117ed473947007bcafc5c0c7129", yearnV2: "0x3f6DCA8a0b7d04737BC3B2aEAbeB1C09431581f0", universe: "0xa7963898453c00b61cff8ce7e5b28c4e8bf1348f" - } + }, + uiData: undefined, + poolDataProvider: undefined, }, polygon: { @@ -25,13 +27,16 @@ const addresses = { }, resolver: { aave_v2: "0x1f5e200493adB54FEB4a7D734E48649143ecE2CA", + aave_v3: '0x7cdBD859f2EDA545289378112FD991571d6eb73e', accounts: "0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474", balance: "0x04F8a41be023f839E709eeEaA0725FD766139A4d", merkleResolver: { aave_v2: "0x2a26228e607ffD2aB2bD3aA49cBae0eDC6469Bf8" }, weth: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" - } + }, + uiData: '0x8F1AD487C9413d7e81aB5B4E88B024Ae3b5637D0', + poolDataProvider: '0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb', }, arbitrum: { core: { @@ -41,11 +46,14 @@ const addresses = { resolver: { accounts: '0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474', balance: '0x29572b16D306acd7ca0CBCA0F08C3EFF131fFDA5', + aave_v3: '0x7cdBD859f2EDA545289378112FD991571d6eb73e', uniswap_v3: '0x04F8a41be023f839E709eeEaA0725FD766139A4d', // uniswap_v3_staker: '0x1a96af80ED8753a77E23074De78480675049A3c9', nonfungiblePositionManager: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88', }, uniswapV3Staker: '0x1f98407aaB862CdDeF78Ed252D6f557aA5b0f00d', + uiData: '0x3f960bB91e85Ae2dB561BDd01B515C5A5c65802b', + poolDataProvider: '0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb', }, avalanche: { core: { @@ -54,9 +62,12 @@ const addresses = { }, resolver: { aave_v2: '0x43c51C24b49f7cF389D043e93533E5179870Eea3', + aave_v3: '0x7cdBD859f2EDA545289378112FD991571d6eb73e', accounts: '0x746e318e179CB0A359C1FeE8331A3F9bE309b3CE', balance: '0xE6F92a3eCAa618FC5D4Bf2a14090787715C115F0', }, + uiData: '0xdBbFaFC45983B4659E368a3025b81f69Ab6E5093', + poolDataProvider: '0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb', }, optimism: { core: { @@ -68,6 +79,8 @@ const addresses = { aave_v3: '0x7cdBD859f2EDA545289378112FD991571d6eb73e', balance: '0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2', }, + uiData: '0x64f558d4BFC1c03a8c8B2ff84976fF04c762b51f', + poolDataProvider: '0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb', }, }; diff --git a/constant/atokensV3/arbitrum.ts b/constant/atokensV3/arbitrum.ts new file mode 100644 index 0000000..c2b122b --- /dev/null +++ b/constant/atokensV3/arbitrum.ts @@ -0,0 +1,84 @@ +import { createTokenUtils } from '../../utils' + +export default createTokenUtils([ + { + key: 'adai', + type: 'atoken', + symbol: 'ADAI', + name: 'Aave DAI', + address: '0x82E64f49Ed5EC1bC6e43DAD4FC8Af9bb3A2312EE', + decimals: 18, + factor: 0.75, + root: 'dai', + }, + { + key: 'alink', + type: 'atoken', + symbol: 'ALINK', + name: 'Aave LINK', + address: '0x191c10Aa4AF7C30e871E70C95dB0E4eb77237530', + decimals: 18, + factor: 0.7, + root: 'link', + }, + { + key: 'aeth', + type: 'atoken', + symbol: 'AETH', + name: 'Aave ETH', + address: '0xe50fA9b3c56FfB159cB0FCA61F5c9D750e8128c8', + decimals: 18, + factor: 0.8, + root: 'eth', + }, + { + key: 'ausdc', + type: 'atoken', + symbol: 'AUSDC', + name: 'Aave USDC', + address: '0x625E7708f30cA75bfd92586e17077590C60eb4cD', + decimals: 6, + factor: 0.8, + root: 'usdc', + }, + { + key: 'ausdt', + type: 'atoken', + symbol: 'AUSDT', + name: 'Aave USDT', + address: '0x6ab707Aca953eDAeFBc4fD23bA73294241490620', + decimals: 6, + factor: 0.75, + root: 'usdt', + }, + { + key: 'awbtc', + type: 'atoken', + symbol: 'AWBTC', + name: 'Aave WBTC', + address: '0x078f358208685046a11C85e8ad32895DED33A249', + decimals: 8, + factor: 0.7, + root: 'wbtc', + }, + { + key: 'aaave', + type: 'atoken', + symbol: 'AAAVE', + name: 'Aave AAVE', + address: '0xf329e36C7bF6E5E86ce2150875a84Ce77f477375', + decimals: 18, + factor: 0.5, + root: 'aave', + }, + { + key: 'aeurs', + type: 'atoken', + symbol: 'EURS', + name: 'Aave EURS', + address: '0x6d80113e533a2C0fe82EaBD35f1875DcEA89Ea97', + decimals: 2, + factor: 0.65, + root: 'eurs', + }, +]) diff --git a/constant/atokensV3/avalanche.ts b/constant/atokensV3/avalanche.ts new file mode 100644 index 0000000..ac95538 --- /dev/null +++ b/constant/atokensV3/avalanche.ts @@ -0,0 +1,84 @@ +import { createTokenUtils } from '../../utils' + +export default createTokenUtils([ + { + key: 'adai', + type: 'atoken', + symbol: 'ADAI', + name: 'Aave DAI', + address: '0x82E64f49Ed5EC1bC6e43DAD4FC8Af9bb3A2312EE', + decimals: 18, + factor: 0.75, + root: 'dai', + }, + { + key: 'alink', + type: 'atoken', + symbol: 'ALINK', + name: 'Aave LINK', + address: '0x191c10Aa4AF7C30e871E70C95dB0E4eb77237530', + decimals: 18, + factor: 0.5, + root: 'link', + }, + { + key: 'aeth', + type: 'atoken', + symbol: 'AETH', + name: 'Aave ETH', + address: '0xe50fA9b3c56FfB159cB0FCA61F5c9D750e8128c8', + decimals: 18, + factor: 0.8, + root: 'eth', + }, + { + key: 'ausdc', + type: 'atoken', + symbol: 'AUSDC', + name: 'Aave USDC', + address: '0x625E7708f30cA75bfd92586e17077590C60eb4cD', + decimals: 6, + factor: 0.825, + root: 'usdc', + }, + { + key: 'ausdt', + type: 'atoken', + symbol: 'AUSDT', + name: 'Aave USDT', + address: '0x6ab707Aca953eDAeFBc4fD23bA73294241490620', + decimals: 6, + factor: 0.75, + root: 'usdt', + }, + { + key: 'awbtc', + type: 'atoken', + symbol: 'AWBTC', + name: 'Aave WBTC', + address: '0x078f358208685046a11C85e8ad32895DED33A249', + decimals: 8, + factor: 0.7, + root: 'wbtc', + }, + { + key: 'aaave', + type: 'atoken', + symbol: 'AAAVE', + name: 'Aave AAVE', + address: '0xf329e36C7bF6E5E86ce2150875a84Ce77f477375', + decimals: 18, + factor: 0.6, + root: 'aave', + }, + { + key: 'awavax', + type: 'atoken', + symbol: 'AWAVAX', + name: 'Aave WAVAX', + address: '0x6d80113e533a2C0fe82EaBD35f1875DcEA89Ea97', + decimals: 18, + factor: 0.65, + root: 'avax', + }, +]) diff --git a/constant/atokensV3/fantom.ts b/constant/atokensV3/fantom.ts new file mode 100644 index 0000000..9a306fa --- /dev/null +++ b/constant/atokensV3/fantom.ts @@ -0,0 +1,114 @@ +import { createTokenUtils } from '../../utils' + +export default createTokenUtils([ + { + key: 'adai', + type: 'atoken', + symbol: 'ADAI', + name: 'Aave DAI', + address: '0x82E64f49Ed5EC1bC6e43DAD4FC8Af9bb3A2312EE', + decimals: 18, + factor: 0.75, + root: 'dai', + }, + { + key: 'alink', + type: 'atoken', + symbol: 'ALINK', + name: 'Aave LINK', + address: '0x191c10Aa4AF7C30e871E70C95dB0E4eb77237530', + decimals: 18, + factor: 0.5, + root: 'link', + }, + { + key: 'aeth', + type: 'atoken', + symbol: 'AETH', + name: 'Aave ETH', + address: '0xe50fA9b3c56FfB159cB0FCA61F5c9D750e8128c8', + decimals: 18, + factor: 0.8, + root: 'eth', + }, + { + key: 'ausdc', + type: 'atoken', + symbol: 'AUSDC', + name: 'Aave USDC', + address: '0x625E7708f30cA75bfd92586e17077590C60eb4cD', + decimals: 6, + factor: 0.825, + root: 'usdc', + }, + // { + // key: 'ausdt', + // type: 'atoken', + // symbol: 'AUSDT', + // name: 'Aave USDT', + // address: '0x6ab707Aca953eDAeFBc4fD23bA73294241490620', + // decimals: 6, + // factor: 0, + // root: 'usdt', + // }, + { + key: 'awbtc', + type: 'atoken', + symbol: 'AWBTC', + name: 'Aave WBTC', + address: '0x078f358208685046a11C85e8ad32895DED33A249', + decimals: 8, + factor: 0.7, + root: 'wbtc', + }, + { + key: 'aaave', + type: 'atoken', + symbol: 'AAAVE', + name: 'Aave AAVE', + address: '0xf329e36C7bF6E5E86ce2150875a84Ce77f477375', + decimals: 18, + factor: 0.6, + root: 'aave', + }, + { + key: 'aftm', + type: 'atoken', + symbol: 'AFTM', + name: 'Aave FTM', + address: '0x6d80113e533a2C0fe82EaBD35f1875DcEA89Ea97', + decimals: 18, + factor: 0.25, + root: 'ftm', + }, + { + key: 'asushi', + type: 'atoken', + symbol: 'ASUSHI', + name: 'Aave SUSHI', + address: '0xc45A479877e1e9Dfe9FcD4056c699575a1045dAA', + decimals: 18, + factor: 0.2, + root: 'sushi', + }, + { + key: 'acrv', + type: 'atoken', + symbol: 'ACRV', + name: 'Aave CRV', + address: '0x513c7E3a9c69cA3e22550eF58AC1C0088e918FFf', + decimals: 18, + factor: 0.75, + root: 'crv', + }, + { + key: 'afusdt', + type: 'atoken', + symbol: 'AFUSDT', + name: 'Aave FUSDT', + address: '0x6ab707Aca953eDAeFBc4fD23bA73294241490620', + decimals: 6, + factor: 0.75, + root: 'fusdt', + }, +]) diff --git a/constant/atokensV3/index.ts b/constant/atokensV3/index.ts new file mode 100644 index 0000000..df90a8f --- /dev/null +++ b/constant/atokensV3/index.ts @@ -0,0 +1,13 @@ +import polygon from './polygon' +import arbitrum from './arbitrum' +import avalanche from './avalanche' +import optimism from './optimism' +import fantom from './fantom' + +export default { + polygon, + arbitrum, + avalanche, + optimism, + fantom, +} diff --git a/constant/atokensV3/optimism.ts b/constant/atokensV3/optimism.ts new file mode 100644 index 0000000..e406135 --- /dev/null +++ b/constant/atokensV3/optimism.ts @@ -0,0 +1,84 @@ +import { createTokenUtils } from '../../utils' + +export default createTokenUtils([ + { + key: 'adai', + type: 'atoken', + symbol: 'ADAI', + name: 'Aave DAI', + address: '0x82E64f49Ed5EC1bC6e43DAD4FC8Af9bb3A2312EE', + decimals: 18, + factor: 0.75, + root: 'dai', + }, + { + key: 'alink', + type: 'atoken', + symbol: 'ALINK', + name: 'Aave LINK', + address: '0x191c10Aa4AF7C30e871E70C95dB0E4eb77237530', + decimals: 18, + factor: 0.7, + root: 'link', + }, + { + key: 'aeth', + type: 'atoken', + symbol: 'AETH', + name: 'Aave ETH', + address: '0xe50fA9b3c56FfB159cB0FCA61F5c9D750e8128c8', + decimals: 18, + factor: 0.8, + root: 'eth', + }, + { + key: 'ausdc', + type: 'atoken', + symbol: 'AUSDC', + name: 'Aave USDC', + address: '0x625E7708f30cA75bfd92586e17077590C60eb4cD', + decimals: 6, + factor: 0.8, + root: 'usdc', + }, + { + key: 'ausdt', + type: 'atoken', + symbol: 'AUSDT', + name: 'Aave USDT', + address: '0x6ab707Aca953eDAeFBc4fD23bA73294241490620', + decimals: 6, + factor: 0.75, + root: 'usdt', + }, + { + key: 'awbtc', + type: 'atoken', + symbol: 'AWBTC', + name: 'Aave WBTC', + address: '0x078f358208685046a11C85e8ad32895DED33A249', + decimals: 8, + factor: 0.7, + root: 'wbtc', + }, + { + key: 'aaave', + type: 'atoken', + symbol: 'AAAVE', + name: 'Aave AAVE', + address: '0xf329e36C7bF6E5E86ce2150875a84Ce77f477375', + decimals: 18, + factor: 0.5, + root: 'aave', + }, + { + key: 'asusd', + type: 'atoken', + symbol: 'ASUSD', + name: 'AAVE SUSD', + address: '0x6d80113e533a2C0fe82EaBD35f1875DcEA89Ea97', + decimals: 18, + factor: 0, + root: 'susd', + }, +]) diff --git a/constant/atokensV3/polygon.ts b/constant/atokensV3/polygon.ts new file mode 100644 index 0000000..d280932 --- /dev/null +++ b/constant/atokensV3/polygon.ts @@ -0,0 +1,164 @@ +import { createTokenUtils } from '../../utils' + +export default createTokenUtils([ + { + key: 'aeth', + type: 'atoken', + symbol: 'AETH', + name: 'Aave ETH', + address: '0xe50fA9b3c56FfB159cB0FCA61F5c9D750e8128c8', + decimals: 18, + factor: 0.8, + root: 'eth', + }, + { + key: 'adai', + type: 'atoken', + symbol: 'ADAI', + name: 'Aave DAI', + address: '0x82E64f49Ed5EC1bC6e43DAD4FC8Af9bb3A2312EE', + decimals: 18, + factor: 0.75, + root: 'dai', + }, + { + key: 'ausdc', + type: 'atoken', + symbol: 'AUSDC', + name: 'Aave USDC', + address: '0x625E7708f30cA75bfd92586e17077590C60eb4cD', + decimals: 6, + factor: 0.825, + root: 'usdc', + }, + { + key: 'ausdt', + type: 'atoken', + symbol: 'AUSDT', + name: 'Aave USDT', + address: '0x6ab707Aca953eDAeFBc4fD23bA73294241490620', + decimals: 6, + factor: 0.75, + root: 'usdt', + }, + { + key: 'awbtc', + type: 'atoken', + symbol: 'AWBTC', + name: 'Aave WBTC', + address: '0x078f358208685046a11C85e8ad32895DED33A249', + decimals: 8, + factor: 0.7, + root: 'wbtc', + }, + { + key: 'aaave', + type: 'atoken', + symbol: 'AAAVE', + name: 'Aave AAVE', + address: '0xf329e36C7bF6E5E86ce2150875a84Ce77f477375', + decimals: 18, + factor: 0.6, + root: 'aave', + }, + { + key: 'awmatic', + type: 'atoken', + symbol: 'AWMATIC', + name: 'Aave WMATIC', + address: '0x6d80113e533a2C0fe82EaBD35f1875DcEA89Ea97', + decimals: 18, + factor: 0.65, + root: 'matic', + }, + { + key: 'asushi', + type: 'atoken', + symbol: 'ASUSHI', + name: 'Aave SUSHI', + address: '0xc45A479877e1e9Dfe9FcD4056c699575a1045dAA', + decimals: 18, + factor: 0.2, + root: 'sushi', + }, + { + key: 'alink', + type: 'atoken', + symbol: 'ALINK', + name: 'Aave LINK', + address: '0x191c10Aa4AF7C30e871E70C95dB0E4eb77237530', + decimals: 18, + factor: 0.5, + root: 'link', + }, + { + key: 'abal', + type: 'atoken', + symbol: 'ABAL', + name: 'Aave BAL', + address: '0x8ffDf2DE812095b1D19CB146E4c004587C0A0692', + decimals: 18, + factor: 0.2, + root: 'bal', + }, + { + key: 'acrv', + type: 'atoken', + symbol: 'ACRV', + name: 'Aave CRV', + address: '0x513c7E3a9c69cA3e22550eF58AC1C0088e918FFf', + decimals: 18, + factor: 0.75, + root: 'crv', + }, + { + key: 'adpi', + type: 'atoken', + symbol: 'ADPI', + name: 'Aave DPI', + address: '0x724dc807b04555b71ed48a6896b6F41593b8C637', + decimals: 18, + factor: 0.2, + root: 'dpi', + }, + { + key: 'aghst', + type: 'atoken', + symbol: 'AGHST', + name: 'Aave GHST', + address: '0x8Eb270e296023E9D92081fdF967dDd7878724424', + decimals: 18, + factor: 0.25, + root: 'ghst', + }, + { + key: 'aeurs', + type: 'atoken', + symbol: 'AEURS', + name: 'Aave EURS', + address: '0x38d693cE1dF5AaDF7bC62595A37D667aD57922e5', + decimals: 2, + factor: 0.65, + root: 'eurs', + }, + { + key: 'ajeur', + type: 'atoken', + symbol: 'AjEUR', + name: 'Aave jEUR', + address: '0x6533afac2E7BCCB20dca161449A13A32D391fb00', + decimals: 18, + factor: 0, + root: 'jeur', + }, + { + key: 'aageur', + type: 'atoken', + symbol: 'AAGEUR', + name: 'Aave agEUR', + address: '0x8437d7C167dFB82ED4Cb79CD44B7a32A1dd95c77', + decimals: 18, + factor: 0, + root: 'ageur', + }, +]) diff --git a/nuxt.config.js b/nuxt.config.js index 6e0c8d1..675d63a 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -104,6 +104,16 @@ export default { '@nuxtjs/pwa', ], + svg: { + vueSvgLoader: { + svgo: { + plugins: [ + { cleanupIDs: false }, + ], + }, + } + }, + pwa: { meta: { appleStatusBarStyle: 'default', diff --git a/package.json b/package.json index c013099..1e1ba33 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "core-js": "^3.15.1", "css-color-function": "^1.3.3", "dsa-connect": "^0.6.13", + "ethereum-multicall": "^2.10.0", "nuxt": "^2.15.7", "qrcode": "^1.4.4", "slugify": "^1.6.0", diff --git a/pages/aave-v3.vue b/pages/aave-v3.vue new file mode 100644 index 0000000..5533730 --- /dev/null +++ b/pages/aave-v3.vue @@ -0,0 +1,211 @@ + + + diff --git a/pages/index.vue b/pages/index.vue index 5d40fe8..d748977 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -113,6 +113,13 @@ const appsPerNetwork = { name: "1inch", url: "/1inch", description: "DEX Aggregator" + }, + { + id: "aave-v3", + icon: AaveIcon, + name: "Aave v3", + url: "/aave-v3", + description: "Lend and borrow straight from your Gnosis Safe" } ], arbitrum: [ @@ -122,6 +129,13 @@ const appsPerNetwork = { name: "1inch", url: "/1inch", description: "DEX Aggregator" + }, + { + id: "aave-v3", + icon: AaveIcon, + name: "Aave v3", + url: "/aave-v3", + description: "Lend and borrow straight from your Gnosis Safe" } ], avalanche: [ @@ -131,6 +145,13 @@ const appsPerNetwork = { name: "Aave v2", url: "/aave-v2", description: "Lend and borrow straight from your Gnosis Safe" + }, + { + id: "aave-v3", + icon: AaveIcon, + name: "Aave v3", + url: "/aave-v3", + description: "Lend and borrow straight from your Gnosis Safe" } ], optimism: [ @@ -140,6 +161,13 @@ const appsPerNetwork = { name: "1inch", url: "/1inch", description: "DEX Aggregator" + }, + { + id: "aave-v3", + icon: AaveIcon, + name: "Aave v3", + url: "/aave-v3", + description: "Lend and borrow straight from your Gnosis Safe" } ] }; diff --git a/utils/index.ts b/utils/index.ts new file mode 100644 index 0000000..b6fa9b4 --- /dev/null +++ b/utils/index.ts @@ -0,0 +1 @@ +export * from './create-token-utils'; diff --git a/yarn.lock b/yarn.lock index 845ecdd..1b1012f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1277,6 +1277,21 @@ "@ethersproject/properties" "^5.4.0" "@ethersproject/strings" "^5.4.0" +"@ethersproject/abi@5.6.1", "@ethersproject/abi@^5.6.0": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.6.1.tgz#f7de888edeb56b0a657b672bdd1b3a1135cd14f7" + integrity sha512-0cqssYh6FXjlwKWBmLm3+zH2BNARoS5u/hxbz+LpQmcDB3w0W553h2btWui1/uZp2GBM/SI3KniTuMcYyHpA5w== + dependencies: + "@ethersproject/address" "^5.6.0" + "@ethersproject/bignumber" "^5.6.0" + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/constants" "^5.6.0" + "@ethersproject/hash" "^5.6.0" + "@ethersproject/keccak256" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/strings" "^5.6.0" + "@ethersproject/abstract-provider@5.4.1", "@ethersproject/abstract-provider@^5.4.0": version "5.4.1" resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.4.1.tgz#e404309a29f771bd4d28dbafadcaa184668c2a6e" @@ -1290,6 +1305,19 @@ "@ethersproject/transactions" "^5.4.0" "@ethersproject/web" "^5.4.0" +"@ethersproject/abstract-provider@5.6.0", "@ethersproject/abstract-provider@^5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.6.0.tgz#0c4ac7054650dbd9c476cf5907f588bbb6ef3061" + integrity sha512-oPMFlKLN+g+y7a79cLK3WiLcjWFnZQtXWgnLAbHZcN3s7L4v90UHpTOrLk+m3yr0gt+/h9STTM6zrr7PM8uoRw== + dependencies: + "@ethersproject/bignumber" "^5.6.0" + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/networks" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/transactions" "^5.6.0" + "@ethersproject/web" "^5.6.0" + "@ethersproject/abstract-signer@5.4.1", "@ethersproject/abstract-signer@^5.4.0": version "5.4.1" resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.4.1.tgz#e4e9abcf4dd4f1ba0db7dff9746a5f78f355ea81" @@ -1301,6 +1329,17 @@ "@ethersproject/logger" "^5.4.0" "@ethersproject/properties" "^5.4.0" +"@ethersproject/abstract-signer@5.6.0", "@ethersproject/abstract-signer@^5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.6.0.tgz#9cd7ae9211c2b123a3b29bf47aab17d4d016e3e7" + integrity sha512-WOqnG0NJKtI8n0wWZPReHtaLkDByPL67tn4nBaDAhmVq8sjHTPbCdz4DRhVu/cfTOvfy9w3iq5QZ7BX7zw56BQ== + dependencies: + "@ethersproject/abstract-provider" "^5.6.0" + "@ethersproject/bignumber" "^5.6.0" + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/address@5.4.0", "@ethersproject/address@>=5.0.0-beta.128", "@ethersproject/address@^5.0.4", "@ethersproject/address@^5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.4.0.tgz#ba2d00a0f8c4c0854933b963b9a3a9f6eb4a37a3" @@ -1312,6 +1351,17 @@ "@ethersproject/logger" "^5.4.0" "@ethersproject/rlp" "^5.4.0" +"@ethersproject/address@5.6.0", "@ethersproject/address@^5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.6.0.tgz#13c49836d73e7885fc148ad633afad729da25012" + integrity sha512-6nvhYXjbXsHPS+30sHZ+U4VMagFC/9zAk6Gd/h3S21YW4+yfb0WfRtaAIZ4kfM4rrVwqiy284LP0GtL5HXGLxQ== + dependencies: + "@ethersproject/bignumber" "^5.6.0" + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/keccak256" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/rlp" "^5.6.0" + "@ethersproject/base64@5.4.0", "@ethersproject/base64@^5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.4.0.tgz#7252bf65295954c9048c7ca5f43e5c86441b2a9a" @@ -1319,6 +1369,13 @@ dependencies: "@ethersproject/bytes" "^5.4.0" +"@ethersproject/base64@5.6.0", "@ethersproject/base64@^5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.6.0.tgz#a12c4da2a6fb86d88563216b0282308fc15907c9" + integrity sha512-2Neq8wxJ9xHxCF9TUgmKeSh9BXJ6OAxWfeGWvbauPh8FuHEjamgHilllx8KkSd5ErxyHIX7Xv3Fkcud2kY9ezw== + dependencies: + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/basex@5.4.0", "@ethersproject/basex@^5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.4.0.tgz#0a2da0f4e76c504a94f2b21d3161ed9438c7f8a6" @@ -1327,6 +1384,14 @@ "@ethersproject/bytes" "^5.4.0" "@ethersproject/properties" "^5.4.0" +"@ethersproject/basex@5.6.0", "@ethersproject/basex@^5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.6.0.tgz#9ea7209bf0a1c3ddc2a90f180c3a7f0d7d2e8a69" + integrity sha512-qN4T+hQd/Md32MoJpc69rOwLYRUXwjTlhHDIeUkUmiN/JyWkkLLMoG0TqvSQKNqZOMgN5stbUYN6ILC+eD7MEQ== + dependencies: + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/bignumber@5.4.2", "@ethersproject/bignumber@>=5.0.0-beta.130", "@ethersproject/bignumber@^5.0.7", "@ethersproject/bignumber@^5.4.0": version "5.4.2" resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.4.2.tgz#44232e015ae4ce82ac034de549eb3583c71283d8" @@ -1336,6 +1401,15 @@ "@ethersproject/logger" "^5.4.0" bn.js "^4.11.9" +"@ethersproject/bignumber@5.6.0", "@ethersproject/bignumber@^5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.6.0.tgz#116c81b075c57fa765a8f3822648cf718a8a0e26" + integrity sha512-VziMaXIUHQlHJmkv1dlcd6GY2PmT0khtAqaMctCIDogxkrarMzA9L94KN1NeXqqOfFD6r0sJT3vCTOFSmZ07DA== + dependencies: + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + bn.js "^4.11.9" + "@ethersproject/bytes@5.4.0", "@ethersproject/bytes@>=5.0.0-beta.129", "@ethersproject/bytes@^5.0.4", "@ethersproject/bytes@^5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.4.0.tgz#56fa32ce3bf67153756dbaefda921d1d4774404e" @@ -1343,6 +1417,13 @@ dependencies: "@ethersproject/logger" "^5.4.0" +"@ethersproject/bytes@5.6.1", "@ethersproject/bytes@^5.6.0": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.6.1.tgz#24f916e411f82a8a60412344bf4a813b917eefe7" + integrity sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g== + dependencies: + "@ethersproject/logger" "^5.6.0" + "@ethersproject/constants@5.4.0", "@ethersproject/constants@>=5.0.0-beta.128", "@ethersproject/constants@^5.0.4", "@ethersproject/constants@^5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.4.0.tgz#ee0bdcb30bf1b532d2353c977bf2ef1ee117958a" @@ -1350,6 +1431,13 @@ dependencies: "@ethersproject/bignumber" "^5.4.0" +"@ethersproject/constants@5.6.0", "@ethersproject/constants@^5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.6.0.tgz#55e3eb0918584d3acc0688e9958b0cedef297088" + integrity sha512-SrdaJx2bK0WQl23nSpV/b1aq293Lh0sUaZT/yYKPDKn4tlAbkH96SPJwIhwSwTsoQQZxuh1jnqsKwyymoiBdWA== + dependencies: + "@ethersproject/bignumber" "^5.6.0" + "@ethersproject/contracts@5.4.1": version "5.4.1" resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.4.1.tgz#3eb4f35b7fe60a962a75804ada2746494df3e470" @@ -1366,6 +1454,22 @@ "@ethersproject/properties" "^5.4.0" "@ethersproject/transactions" "^5.4.0" +"@ethersproject/contracts@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.6.0.tgz#60f2cfc7addd99a865c6c8cfbbcec76297386067" + integrity sha512-74Ge7iqTDom0NX+mux8KbRUeJgu1eHZ3iv6utv++sLJG80FVuU9HnHeKVPfjd9s3woFhaFoQGf3B3iH/FrQmgw== + dependencies: + "@ethersproject/abi" "^5.6.0" + "@ethersproject/abstract-provider" "^5.6.0" + "@ethersproject/abstract-signer" "^5.6.0" + "@ethersproject/address" "^5.6.0" + "@ethersproject/bignumber" "^5.6.0" + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/constants" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/transactions" "^5.6.0" + "@ethersproject/hash@5.4.0", "@ethersproject/hash@>=5.0.0-beta.128", "@ethersproject/hash@^5.0.4", "@ethersproject/hash@^5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.4.0.tgz#d18a8e927e828e22860a011f39e429d388344ae0" @@ -1380,6 +1484,20 @@ "@ethersproject/properties" "^5.4.0" "@ethersproject/strings" "^5.4.0" +"@ethersproject/hash@5.6.0", "@ethersproject/hash@^5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.6.0.tgz#d24446a5263e02492f9808baa99b6e2b4c3429a2" + integrity sha512-fFd+k9gtczqlr0/BruWLAu7UAOas1uRRJvOR84uDf4lNZ+bTkGl366qvniUZHKtlqxBRU65MkOobkmvmpHU+jA== + dependencies: + "@ethersproject/abstract-signer" "^5.6.0" + "@ethersproject/address" "^5.6.0" + "@ethersproject/bignumber" "^5.6.0" + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/keccak256" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/strings" "^5.6.0" + "@ethersproject/hdnode@5.4.0", "@ethersproject/hdnode@^5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.4.0.tgz#4bc9999b9a12eb5ce80c5faa83114a57e4107cac" @@ -1398,6 +1516,24 @@ "@ethersproject/transactions" "^5.4.0" "@ethersproject/wordlists" "^5.4.0" +"@ethersproject/hdnode@5.6.0", "@ethersproject/hdnode@^5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.6.0.tgz#9dcbe8d629bbbcf144f2cae476337fe92d320998" + integrity sha512-61g3Jp3nwDqJcL/p4nugSyLrpl/+ChXIOtCEM8UDmWeB3JCAt5FoLdOMXQc3WWkc0oM2C0aAn6GFqqMcS/mHTw== + dependencies: + "@ethersproject/abstract-signer" "^5.6.0" + "@ethersproject/basex" "^5.6.0" + "@ethersproject/bignumber" "^5.6.0" + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/pbkdf2" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/sha2" "^5.6.0" + "@ethersproject/signing-key" "^5.6.0" + "@ethersproject/strings" "^5.6.0" + "@ethersproject/transactions" "^5.6.0" + "@ethersproject/wordlists" "^5.6.0" + "@ethersproject/json-wallets@5.4.0", "@ethersproject/json-wallets@^5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.4.0.tgz#2583341cfe313fc9856642e8ace3080154145e95" @@ -1417,6 +1553,25 @@ aes-js "3.0.0" scrypt-js "3.0.1" +"@ethersproject/json-wallets@5.6.0", "@ethersproject/json-wallets@^5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.6.0.tgz#4c2fc27f17e36c583e7a252fb938bc46f98891e5" + integrity sha512-fmh86jViB9r0ibWXTQipxpAGMiuxoqUf78oqJDlCAJXgnJF024hOOX7qVgqsjtbeoxmcLwpPsXNU0WEe/16qPQ== + dependencies: + "@ethersproject/abstract-signer" "^5.6.0" + "@ethersproject/address" "^5.6.0" + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/hdnode" "^5.6.0" + "@ethersproject/keccak256" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/pbkdf2" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/random" "^5.6.0" + "@ethersproject/strings" "^5.6.0" + "@ethersproject/transactions" "^5.6.0" + aes-js "3.0.0" + scrypt-js "3.0.1" + "@ethersproject/keccak256@5.4.0", "@ethersproject/keccak256@>=5.0.0-beta.127", "@ethersproject/keccak256@^5.0.0-beta.130", "@ethersproject/keccak256@^5.0.3", "@ethersproject/keccak256@^5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.4.0.tgz#7143b8eea4976080241d2bd92e3b1f1bf7025318" @@ -1425,11 +1580,24 @@ "@ethersproject/bytes" "^5.4.0" js-sha3 "0.5.7" +"@ethersproject/keccak256@5.6.0", "@ethersproject/keccak256@^5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.6.0.tgz#fea4bb47dbf8f131c2e1774a1cecbfeb9d606459" + integrity sha512-tk56BJ96mdj/ksi7HWZVWGjCq0WVl/QvfhFQNeL8fxhBlGoP+L80uDCiQcpJPd+2XxkivS3lwRm3E0CXTfol0w== + dependencies: + "@ethersproject/bytes" "^5.6.0" + js-sha3 "0.8.0" + "@ethersproject/logger@5.4.1", "@ethersproject/logger@>=5.0.0-beta.129", "@ethersproject/logger@^5.0.5", "@ethersproject/logger@^5.4.0": version "5.4.1" resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.4.1.tgz#503bd33683538b923c578c07d1c2c0dd18672054" integrity sha512-DZ+bRinnYLPw1yAC64oRl0QyVZj43QeHIhVKfD/+YwSz4wsv1pfwb5SOFjz+r710YEWzU6LrhuSjpSO+6PeE4A== +"@ethersproject/logger@5.6.0", "@ethersproject/logger@^5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.6.0.tgz#d7db1bfcc22fd2e4ab574cba0bb6ad779a9a3e7a" + integrity sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg== + "@ethersproject/networks@5.4.2", "@ethersproject/networks@^5.4.0": version "5.4.2" resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.4.2.tgz#2247d977626e97e2c3b8ee73cd2457babde0ce35" @@ -1437,6 +1605,13 @@ dependencies: "@ethersproject/logger" "^5.4.0" +"@ethersproject/networks@5.6.2", "@ethersproject/networks@^5.6.0": + version "5.6.2" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.6.2.tgz#2bacda62102c0b1fcee408315f2bed4f6fbdf336" + integrity sha512-9uEzaJY7j5wpYGTojGp8U89mSsgQLc40PCMJLMCnFXTs7nhBveZ0t7dbqWUNrepWTszDbFkYD6WlL8DKx5huHA== + dependencies: + "@ethersproject/logger" "^5.6.0" + "@ethersproject/pbkdf2@5.4.0", "@ethersproject/pbkdf2@^5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.4.0.tgz#ed88782a67fda1594c22d60d0ca911a9d669641c" @@ -1445,6 +1620,14 @@ "@ethersproject/bytes" "^5.4.0" "@ethersproject/sha2" "^5.4.0" +"@ethersproject/pbkdf2@5.6.0", "@ethersproject/pbkdf2@^5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.6.0.tgz#04fcc2d7c6bff88393f5b4237d906a192426685a" + integrity sha512-Wu1AxTgJo3T3H6MIu/eejLFok9TYoSdgwRr5oGY1LTLfmGesDoSx05pemsbrPT2gG4cQME+baTSCp5sEo2erZQ== + dependencies: + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/sha2" "^5.6.0" + "@ethersproject/properties@5.4.1", "@ethersproject/properties@>=5.0.0-beta.131", "@ethersproject/properties@^5.0.3", "@ethersproject/properties@^5.4.0": version "5.4.1" resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.4.1.tgz#9f051f976ce790142c6261ccb7b826eaae1f2f36" @@ -1452,6 +1635,13 @@ dependencies: "@ethersproject/logger" "^5.4.0" +"@ethersproject/properties@5.6.0", "@ethersproject/properties@^5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.6.0.tgz#38904651713bc6bdd5bdd1b0a4287ecda920fa04" + integrity sha512-szoOkHskajKePTJSZ46uHUWWkbv7TzP2ypdEK6jGMqJaEt2sb0jCgfBo0gH0m2HBpRixMuJ6TBRaQCF7a9DoCg== + dependencies: + "@ethersproject/logger" "^5.6.0" + "@ethersproject/providers@5.4.5": version "5.4.5" resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.4.5.tgz#eb2ea2a743a8115f79604a8157233a3a2c832928" @@ -1477,6 +1667,31 @@ bech32 "1.1.4" ws "7.4.6" +"@ethersproject/providers@5.6.4", "@ethersproject/providers@^5.0.10": + version "5.6.4" + resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.6.4.tgz#1a49c211b57b0b2703c320819abbbfa35c83dff7" + integrity sha512-WAdknnaZ52hpHV3qPiJmKx401BLpup47h36Axxgre9zT+doa/4GC/Ne48ICPxTm0BqndpToHjpLP1ZnaxyE+vw== + dependencies: + "@ethersproject/abstract-provider" "^5.6.0" + "@ethersproject/abstract-signer" "^5.6.0" + "@ethersproject/address" "^5.6.0" + "@ethersproject/basex" "^5.6.0" + "@ethersproject/bignumber" "^5.6.0" + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/constants" "^5.6.0" + "@ethersproject/hash" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/networks" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/random" "^5.6.0" + "@ethersproject/rlp" "^5.6.0" + "@ethersproject/sha2" "^5.6.0" + "@ethersproject/strings" "^5.6.0" + "@ethersproject/transactions" "^5.6.0" + "@ethersproject/web" "^5.6.0" + bech32 "1.1.4" + ws "7.4.6" + "@ethersproject/random@5.4.0", "@ethersproject/random@^5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.4.0.tgz#9cdde60e160d024be39cc16f8de3b9ce39191e16" @@ -1485,6 +1700,14 @@ "@ethersproject/bytes" "^5.4.0" "@ethersproject/logger" "^5.4.0" +"@ethersproject/random@5.6.0", "@ethersproject/random@^5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.6.0.tgz#1505d1ab6a250e0ee92f436850fa3314b2cb5ae6" + integrity sha512-si0PLcLjq+NG/XHSZz90asNf+YfKEqJGVdxoEkSukzbnBgC8rydbgbUgBbBGLeHN4kAJwUFEKsu3sCXT93YMsw== + dependencies: + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/rlp@5.4.0", "@ethersproject/rlp@^5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.4.0.tgz#de61afda5ff979454e76d3b3310a6c32ad060931" @@ -1493,6 +1716,14 @@ "@ethersproject/bytes" "^5.4.0" "@ethersproject/logger" "^5.4.0" +"@ethersproject/rlp@5.6.0", "@ethersproject/rlp@^5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.6.0.tgz#55a7be01c6f5e64d6e6e7edb6061aa120962a717" + integrity sha512-dz9WR1xpcTL+9DtOT/aDO+YyxSSdO8YIS0jyZwHHSlAmnxA6cKU3TrTd4Xc/bHayctxTgGLYNuVVoiXE4tTq1g== + dependencies: + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/sha2@5.4.0", "@ethersproject/sha2@^5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.4.0.tgz#c9a8db1037014cbc4e9482bd662f86c090440371" @@ -1502,6 +1733,15 @@ "@ethersproject/logger" "^5.4.0" hash.js "1.1.7" +"@ethersproject/sha2@5.6.0", "@ethersproject/sha2@^5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.6.0.tgz#364c4c11cc753bda36f31f001628706ebadb64d9" + integrity sha512-1tNWCPFLu1n3JM9t4/kytz35DkuF9MxqkGGEHNauEbaARdm2fafnOyw1s0tIQDPKF/7bkP1u3dbrmjpn5CelyA== + dependencies: + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + hash.js "1.1.7" + "@ethersproject/signing-key@5.4.0", "@ethersproject/signing-key@^5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.4.0.tgz#2f05120984e81cf89a3d5f6dec5c68ee0894fbec" @@ -1514,6 +1754,18 @@ elliptic "6.5.4" hash.js "1.1.7" +"@ethersproject/signing-key@5.6.0", "@ethersproject/signing-key@^5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.6.0.tgz#4f02e3fb09e22b71e2e1d6dc4bcb5dafa69ce042" + integrity sha512-S+njkhowmLeUu/r7ir8n78OUKx63kBdMCPssePS89So1TH4hZqnWFsThEd/GiXYp9qMxVrydf7KdM9MTGPFukA== + dependencies: + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + bn.js "^4.11.9" + elliptic "6.5.4" + hash.js "1.1.7" + "@ethersproject/solidity@5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.4.0.tgz#1305e058ea02dc4891df18b33232b11a14ece9ec" @@ -1525,6 +1777,18 @@ "@ethersproject/sha2" "^5.4.0" "@ethersproject/strings" "^5.4.0" +"@ethersproject/solidity@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.6.0.tgz#64657362a596bf7f5630bdc921c07dd78df06dc3" + integrity sha512-YwF52vTNd50kjDzqKaoNNbC/r9kMDPq3YzDWmsjFTRBcIF1y4JCQJ8gB30wsTfHbaxgxelI5BfxQSxD/PbJOww== + dependencies: + "@ethersproject/bignumber" "^5.6.0" + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/keccak256" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/sha2" "^5.6.0" + "@ethersproject/strings" "^5.6.0" + "@ethersproject/strings@5.4.0", "@ethersproject/strings@>=5.0.0-beta.130", "@ethersproject/strings@^5.0.4", "@ethersproject/strings@^5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.4.0.tgz#fb12270132dd84b02906a8d895ae7e7fa3d07d9a" @@ -1534,6 +1798,15 @@ "@ethersproject/constants" "^5.4.0" "@ethersproject/logger" "^5.4.0" +"@ethersproject/strings@5.6.0", "@ethersproject/strings@^5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.6.0.tgz#9891b26709153d996bf1303d39a7f4bc047878fd" + integrity sha512-uv10vTtLTZqrJuqBZR862ZQjTIa724wGPWQqZrofaPI/kUsf53TBG0I0D+hQ1qyNtllbNzaW+PDPHHUI6/65Mg== + dependencies: + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/constants" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/transactions@5.4.0", "@ethersproject/transactions@^5.0.0-beta.135", "@ethersproject/transactions@^5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.4.0.tgz#a159d035179334bd92f340ce0f77e83e9e1522e0" @@ -1549,6 +1822,21 @@ "@ethersproject/rlp" "^5.4.0" "@ethersproject/signing-key" "^5.4.0" +"@ethersproject/transactions@5.6.0", "@ethersproject/transactions@^5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.6.0.tgz#4b594d73a868ef6e1529a2f8f94a785e6791ae4e" + integrity sha512-4HX+VOhNjXHZyGzER6E/LVI2i6lf9ejYeWD6l4g50AdmimyuStKc39kvKf1bXWQMg7QNVh+uC7dYwtaZ02IXeg== + dependencies: + "@ethersproject/address" "^5.6.0" + "@ethersproject/bignumber" "^5.6.0" + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/constants" "^5.6.0" + "@ethersproject/keccak256" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/rlp" "^5.6.0" + "@ethersproject/signing-key" "^5.6.0" + "@ethersproject/units@5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.4.0.tgz#d57477a4498b14b88b10396062c8cbbaf20c79fe" @@ -1558,6 +1846,15 @@ "@ethersproject/constants" "^5.4.0" "@ethersproject/logger" "^5.4.0" +"@ethersproject/units@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.6.0.tgz#e5cbb1906988f5740254a21b9ded6bd51e826d9c" + integrity sha512-tig9x0Qmh8qbo1w8/6tmtyrm/QQRviBh389EQ+d8fP4wDsBrJBf08oZfoiz1/uenKK9M78yAP4PoR7SsVoTjsw== + dependencies: + "@ethersproject/bignumber" "^5.6.0" + "@ethersproject/constants" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/wallet@5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.4.0.tgz#fa5b59830b42e9be56eadd45a16a2e0933ad9353" @@ -1579,6 +1876,27 @@ "@ethersproject/transactions" "^5.4.0" "@ethersproject/wordlists" "^5.4.0" +"@ethersproject/wallet@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.6.0.tgz#33d11a806d783864208f348709a5a3badac8e22a" + integrity sha512-qMlSdOSTyp0MBeE+r7SUhr1jjDlC1zAXB8VD84hCnpijPQiSNbxr6GdiLXxpUs8UKzkDiNYYC5DRI3MZr+n+tg== + dependencies: + "@ethersproject/abstract-provider" "^5.6.0" + "@ethersproject/abstract-signer" "^5.6.0" + "@ethersproject/address" "^5.6.0" + "@ethersproject/bignumber" "^5.6.0" + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/hash" "^5.6.0" + "@ethersproject/hdnode" "^5.6.0" + "@ethersproject/json-wallets" "^5.6.0" + "@ethersproject/keccak256" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/random" "^5.6.0" + "@ethersproject/signing-key" "^5.6.0" + "@ethersproject/transactions" "^5.6.0" + "@ethersproject/wordlists" "^5.6.0" + "@ethersproject/web@5.4.0", "@ethersproject/web@^5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.4.0.tgz#49fac173b96992334ed36a175538ba07a7413d1f" @@ -1590,6 +1908,17 @@ "@ethersproject/properties" "^5.4.0" "@ethersproject/strings" "^5.4.0" +"@ethersproject/web@5.6.0", "@ethersproject/web@^5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.6.0.tgz#4bf8b3cbc17055027e1a5dd3c357e37474eaaeb8" + integrity sha512-G/XHj0hV1FxI2teHRfCGvfBUHFmU+YOSbCxlAMqJklxSa7QMiHFQfAxvwY2PFqgvdkxEKwRNr/eCjfAPEm2Ctg== + dependencies: + "@ethersproject/base64" "^5.6.0" + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/strings" "^5.6.0" + "@ethersproject/wordlists@5.4.0", "@ethersproject/wordlists@^5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.4.0.tgz#f34205ec3bbc9e2c49cadaee774cf0b07e7573d7" @@ -1601,6 +1930,17 @@ "@ethersproject/properties" "^5.4.0" "@ethersproject/strings" "^5.4.0" +"@ethersproject/wordlists@5.6.0", "@ethersproject/wordlists@^5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.6.0.tgz#79e62c5276e091d8575f6930ba01a29218ded032" + integrity sha512-q0bxNBfIX3fUuAo9OmjlEYxP40IB8ABgb7HjEZCL5IKubzV3j30CWi2rqQbjTS2HfoyQbfINoKcTVWP4ejwR7Q== + dependencies: + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/hash" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/strings" "^5.6.0" + "@gar/promisify@^1.0.1": version "1.1.2" resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.2.tgz#30aa825f11d438671d585bd44e7fd564535fc210" @@ -7027,6 +7367,14 @@ ethereum-cryptography@^0.1.3: secp256k1 "^4.0.1" setimmediate "^1.0.5" +ethereum-multicall@^2.10.0: + version "2.10.0" + resolved "https://registry.yarnpkg.com/ethereum-multicall/-/ethereum-multicall-2.10.0.tgz#db8e41109e01c63058cf99a1b00770c93e8abb75" + integrity sha512-H5rYoNJ+ukV5Z932AkxsEzV9MveJgb1Y5aFfS5SmenFuUkTwx9gje1d1JSl44+Wa8PBLuu9+7BHIX1mdJdQLSg== + dependencies: + "@ethersproject/providers" "^5.0.10" + ethers "^5.0.15" + ethereum-types@^2.1.6: version "2.1.6" resolved "https://registry.yarnpkg.com/ethereum-types/-/ethereum-types-2.1.6.tgz#57d9d515fad86ab987c0f6962c4203be37da8579" @@ -7247,6 +7595,42 @@ ethereumjs-wallet@0.6.5: utf8 "^3.0.0" uuid "^3.3.2" +ethers@^5.0.15: + version "5.6.4" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.6.4.tgz#23629e9a7d4bc5802dfb53d4da420d738744b53c" + integrity sha512-62UIfxAQXdf67TeeOaoOoPctm5hUlYgfd0iW3wxfj7qRYKDcvvy0f+sJ3W2/Pyx77R8dblvejA8jokj+lS+ATQ== + dependencies: + "@ethersproject/abi" "5.6.1" + "@ethersproject/abstract-provider" "5.6.0" + "@ethersproject/abstract-signer" "5.6.0" + "@ethersproject/address" "5.6.0" + "@ethersproject/base64" "5.6.0" + "@ethersproject/basex" "5.6.0" + "@ethersproject/bignumber" "5.6.0" + "@ethersproject/bytes" "5.6.1" + "@ethersproject/constants" "5.6.0" + "@ethersproject/contracts" "5.6.0" + "@ethersproject/hash" "5.6.0" + "@ethersproject/hdnode" "5.6.0" + "@ethersproject/json-wallets" "5.6.0" + "@ethersproject/keccak256" "5.6.0" + "@ethersproject/logger" "5.6.0" + "@ethersproject/networks" "5.6.2" + "@ethersproject/pbkdf2" "5.6.0" + "@ethersproject/properties" "5.6.0" + "@ethersproject/providers" "5.6.4" + "@ethersproject/random" "5.6.0" + "@ethersproject/rlp" "5.6.0" + "@ethersproject/sha2" "5.6.0" + "@ethersproject/signing-key" "5.6.0" + "@ethersproject/solidity" "5.6.0" + "@ethersproject/strings" "5.6.0" + "@ethersproject/transactions" "5.6.0" + "@ethersproject/units" "5.6.0" + "@ethersproject/wallet" "5.6.0" + "@ethersproject/web" "5.6.0" + "@ethersproject/wordlists" "5.6.0" + ethers@^5.4.5: version "5.4.7" resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.4.7.tgz#0fd491a5da7c9793de2d6058d76b41b1e7efba8f"