diff --git a/cspell.json b/cspell.json index 182d920eed61..a95e6fc19fa4 100644 --- a/cspell.json +++ b/cspell.json @@ -87,6 +87,7 @@ "fbid", "filelist", "fileservice", + "flashloan", "formating", "fullfilled", "furucombo", @@ -124,6 +125,7 @@ "labelledby", "lamports", "languagedetector", + "lendingpool", "leste", "linkedin", "linkswap", @@ -154,9 +156,6 @@ "monospace", "mooniswap", "msgpack", - "mska", - "mskb", - "mskc", "multicall", "multihop", "mutex", @@ -196,7 +195,9 @@ "radisk", "rarible", "realmasknetwork", + "rebalance", "redpacket", + "repayer", "replacestate", "repost", "resizer", @@ -301,6 +302,7 @@ "fbclid", "findtruman", "flac", + "frax", "ftgs", "ftpoap", "fusd", @@ -308,6 +310,7 @@ "getdodoroute", "getx", "gorli", + "gusd", "gwapj", "hookform", "horiz", @@ -331,11 +334,6 @@ "metaplex", "metaswap", "misaka", - "mska", - "mskb", - "mskc", - "mskd", - "mske", "nft", "nftred", "nftx", @@ -358,6 +356,7 @@ "qlurl", "rawdata", "redpackets", + "renfil", "reponame", "rpcs", "setx", @@ -379,12 +378,14 @@ "unlocklock", "unlockprotocol", "unstoppabledomains", + "usdp", "usei", "vitalik", "vussxxjdr", "walletlink", "wnative", "xdescribe", + "xsushi", "xtest" ], "ignoreRegExpList": ["/@servie/"], diff --git a/packages/mask/shared-ui/locales/en-US.json b/packages/mask/shared-ui/locales/en-US.json index b8342b4b448a..b8b822066700 100644 --- a/packages/mask/shared-ui/locales/en-US.json +++ b/packages/mask/shared-ui/locales/en-US.json @@ -424,7 +424,7 @@ "plugin_trader_data_source": "Data Source", "plugin_trader_price_updated": "Price Updated", "plugin_savings": "Savings", - "plugin_savings_type": "Type", + "plugin_savings_asset": "Asset", "plugin_no_protocol_available": "No savings protocols available on this network", "plugin_savings_apr": "APR", "plugin_savings_wallet": "Wallet", diff --git a/packages/mask/src/plugins/Savings/SNSAdaptor/IconURL.tsx b/packages/mask/src/plugins/Savings/SNSAdaptor/IconURL.tsx index cd1196af0236..718a431cd33c 100644 --- a/packages/mask/src/plugins/Savings/SNSAdaptor/IconURL.tsx +++ b/packages/mask/src/plugins/Savings/SNSAdaptor/IconURL.tsx @@ -1,4 +1,6 @@ -export const IconURLs: Readonly> = { - lido: new URL('./assets/lido.png', import.meta.url).toString(), - eth: new URL('./assets/eth.png', import.meta.url).toString(), +import { ProtocolType } from '../types' + +export const ProviderIconURLs: Record = { + [ProtocolType.Lido]: new URL('./assets/lido.png', import.meta.url).toString(), + [ProtocolType.AAVE]: new URL('./assets/aave.png', import.meta.url).toString(), } diff --git a/packages/mask/src/plugins/Savings/SNSAdaptor/SavingsDialog.tsx b/packages/mask/src/plugins/Savings/SNSAdaptor/SavingsDialog.tsx index 2ead2cf16ade..9632a626f126 100644 --- a/packages/mask/src/plugins/Savings/SNSAdaptor/SavingsDialog.tsx +++ b/packages/mask/src/plugins/Savings/SNSAdaptor/SavingsDialog.tsx @@ -1,24 +1,52 @@ -import { useState, useMemo } from 'react' -import { useAsync } from 'react-use' +import { useMemo, useState } from 'react' +import { useAsync, useUpdateEffect } from 'react-use' import { Typography, DialogContent } from '@mui/material' -import { ChainId, getChainIdFromNetworkType, useChainId } from '@masknet/web3-shared-evm' import { isDashboardPage, EMPTY_LIST } from '@masknet/shared-base' +import { FolderTabPanel, FolderTabs } from '@masknet/theme' +import { + createContract, + ChainId, + FungibleTokenDetailed, + getChainIdFromNetworkType, + useChainId, + useWeb3, + EthereumTokenType, + useFungibleTokensDetailed, + getAaveConstants, + ZERO_ADDRESS, +} from '@masknet/web3-shared-evm' import { useI18N } from '../../../utils' import { InjectedDialog } from '../../../components/shared/InjectedDialog' import { WalletStatusBox } from '../../../components/shared/WalletStatusBox' import { AllProviderTradeContext } from '../../Trader/trader/useAllProviderTradeContext' import { TargetChainIdContext } from '../../Trader/trader/useTargetChainIdContext' -import { FolderTabPanel, FolderTabs } from '@masknet/theme' import { NetworkTab } from '../../../components/shared/NetworkTab' import { WalletRPC } from '../../Wallet/messages' -import { ProtocolCategory, ProtocolType, TabType } from '../types' -import { SavingsProtocols } from '../protocols' - +import { SavingsProtocol, TabType } from '../types' import { useStyles } from './SavingsDialogStyles' import { SavingsTable } from './SavingsTable' import { SavingsForm } from './SavingsForm' +import type { AaveProtocolDataProvider } from '@masknet/web3-contracts/types/AaveProtocolDataProvider' +import AaveProtocolDataProviderABI from '@masknet/web3-contracts/abis/AaveProtocolDataProvider.json' +import { LidoProtocol } from '../protocols/LDOProtocol' +import { AAVEProtocol } from '../protocols/AAVEProtocol' +import { LDO_PAIRS } from '../constants' +import type { AbiItem } from 'web3-utils' +import { flatten, compact } from 'lodash-unified' + +function splitToPair(a: FungibleTokenDetailed[] | undefined) { + if (!a) { + return [] + } + return a.reduce(function (result: any, value, index, array) { + if (index % 2 === 0) { + result.push(array.slice(index, index + 2)) + } + return result + }, []) +} -interface SavingsDialogProps { +export interface SavingsDialogProps { open: boolean onClose?: () => void } @@ -30,42 +58,70 @@ export function SavingsDialog({ open, onClose }: SavingsDialogProps) { const currentChainId = useChainId() const [chainId, setChainId] = useState(currentChainId) + + const web3 = useWeb3({ chainId }) const [tab, setTab] = useState(TabType.Deposit) - const [selectedProtocol, setSelectedProtocol] = useState(null) + const [selectedProtocol, setSelectedProtocol] = useState(null) const { value: chains = EMPTY_LIST } = useAsync(async () => { const networks = await WalletRPC.getSupportedNetworks() return networks.map((network) => getChainIdFromNetworkType(network)) }, []) - const mappableProtocols = useMemo(() => { - return Object.keys(ProtocolCategory) - .map((category) => ({ - category, - protocols: SavingsProtocols.filter( - (protocol) => protocol.category.toLowerCase() === category.toLowerCase(), - ), - })) - .filter((categorizedProtocol) => - categorizedProtocol.protocols.some(({ availableNetworks }) => - availableNetworks.some((network) => network.chainId === chainId), - ), - ) - }, [chainId]) + const { value: aaveTokens } = useAsync(async () => { + if (chainId !== ChainId.Mainnet) { + return [] + } + + const address = getAaveConstants(chainId).AAVE_PROTOCOL_DATA_PROVIDER_CONTRACT_ADDRESS || ZERO_ADDRESS + + const protocolDataContract = createContract( + web3, + address, + AaveProtocolDataProviderABI as AbiItem[], + ) + + const tokens = await protocolDataContract?.methods.getAllReservesTokens().call() + + const aTokens = await protocolDataContract?.methods.getAllATokens().call() + + return tokens?.map((token) => { + return [token[1], aTokens?.filter((f) => f[0].toUpperCase() === `a${token[0]}`.toUpperCase())[0][1]] + }) + }, [web3, chainId]) + + const { value: detailedAaveTokens } = useFungibleTokensDetailed( + compact(flatten(aaveTokens ?? [])).map((m) => { + return { address: m, type: EthereumTokenType.ERC20 } + }) ?? [], + chainId, + ) + + const protocols = useMemo( + () => [ + ...LDO_PAIRS.filter((x) => x[0].chainId === chainId).map((pair) => new LidoProtocol(pair)), + ...splitToPair(detailedAaveTokens).map((pair: any) => new AAVEProtocol(pair)), + ], + [chainId, detailedAaveTokens], + ) + + useUpdateEffect(() => { + setChainId(currentChainId) + }, [currentChainId]) return ( { if (selectedProtocol === null) { onClose?.() } else { setSelectedProtocol(null) } - }} - title={t('plugin_savings')}> + }}> {!isDashboard ? (
@@ -73,7 +129,9 @@ export function SavingsDialog({ open, onClose }: SavingsDialogProps) {
) : null} - {selectedProtocol === null ? ( + {selectedProtocol ? ( + + ) : ( <>
- {mappableProtocols.length === 0 ? ( - + {protocols.length === 0 ? ( + {t('plugin_no_protocol_available')} ) : ( - + - + !x.balance.isZero())} setTab={setTab} + setSelectedProtocol={setSelectedProtocol} /> )}
- ) : ( - )}
diff --git a/packages/mask/src/plugins/Savings/SNSAdaptor/SavingsForm.tsx b/packages/mask/src/plugins/Savings/SNSAdaptor/SavingsForm.tsx index 4027030abe94..d700ba4748b7 100644 --- a/packages/mask/src/plugins/Savings/SNSAdaptor/SavingsForm.tsx +++ b/packages/mask/src/plugins/Savings/SNSAdaptor/SavingsForm.tsx @@ -1,59 +1,62 @@ import BigNumber from 'bignumber.js' import { Typography } from '@mui/material' import { useState, useMemo, useCallback } from 'react' -import { useAsync } from 'react-use' +import { useAsync, useAsyncFn } from 'react-use' import { unreachable } from '@dimensiondev/kit' +import { isLessThan, rightShift } from '@masknet/web3-shared-base' import { EthereumTokenType, - useNativeTokenDetailed, useFungibleTokenBalance, useWeb3, useAccount, formatCurrency, formatBalance, + isSameAddress, + useTokenConstants, + createERC20Token, + getAaveConstants, + ZERO_ADDRESS, + createContract, } from '@masknet/web3-shared-evm' -import { TokenAmountPanel, FormattedCurrency, LoadingAnimation } from '@masknet/shared' +import { TokenAmountPanel, FormattedCurrency, LoadingAnimation, TokenIcon } from '@masknet/shared' import { useRemoteControlledDialog } from '@masknet/shared-base-ui' import { useTokenPrice } from '../../Wallet/hooks/useTokenPrice' import { useI18N } from '../../../utils' import { useStyles } from './SavingsFormStyles' -import { IconURLs } from './IconURL' -import { TabType, ProtocolType } from '../types' -import { SavingsProtocols } from '../protocols' -import { isLessThan, rightShift } from '@masknet/web3-shared-base' +import { TabType, ProtocolType, SavingsProtocol } from '../types' import { EthereumWalletConnectedBoundary } from '../../../web3/UI/EthereumWalletConnectedBoundary' import { EthereumChainBoundary } from '../../../web3/UI/EthereumChainBoundary' import { ActionButtonPromise } from '../../../extension/options-page/DashboardComponents/ActionButton' import { PluginTraderMessages } from '../../Trader/messages' import type { Coin } from '../../Trader/types' +import { EthereumERC20TokenApprovedBoundary } from '../../../web3/UI/EthereumERC20TokenApprovedBoundary' +import type { AaveLendingPoolAddressProvider } from '@masknet/web3-contracts/types/AaveLendingPoolAddressProvider' +import AaveLendingPoolAddressProviderABI from '@masknet/web3-contracts/abis/AaveLendingPoolAddressProvider.json' +import type { AbiItem } from 'web3-utils' export interface SavingsFormProps { chainId: number - selectedProtocol: ProtocolType + protocol: SavingsProtocol tab: TabType onClose?: () => void } -export function SavingsForm({ chainId, selectedProtocol, tab, onClose }: SavingsFormProps) { +export function SavingsForm({ chainId, protocol, tab, onClose }: SavingsFormProps) { const { t } = useI18N() const { classes } = useStyles() - const protocol = SavingsProtocols[selectedProtocol] - const targetChainId = chainId - const { value: nativeTokenDetailed } = useNativeTokenDetailed() const web3 = useWeb3({ chainId }) const account = useAccount() - + const { NATIVE_TOKEN_ADDRESS } = useTokenConstants() const [inputAmount, setInputAmount] = useState('') const [estimatedGas, setEstimatedGas] = useState(new BigNumber('0')) - const [loading, setLoading] = useState(false) - const { value: nativeTokenBalance } = useFungibleTokenBalance(EthereumTokenType.Native, '', targetChainId) + const { value: nativeTokenBalance } = useFungibleTokenBalance(EthereumTokenType.Native, '', chainId) const { setDialog: openSwapDialog } = useRemoteControlledDialog(PluginTraderMessages.swapDialogUpdated) const onConvertClick = useCallback(() => { - const token = protocol.getFungibleTokenDetails(targetChainId) + const token = protocol.stakeToken openSwapDialog({ open: true, traderProps: { @@ -66,43 +69,58 @@ export function SavingsForm({ chainId, selectedProtocol, tab, onClose }: Savings } as Coin, }, }) - }, [protocol, targetChainId, openSwapDialog]) + }, [protocol, openSwapDialog]) // #region form variables - const tokenAmount = useMemo(() => new BigNumber(rightShift(inputAmount || '0', 18)), [inputAmount]) - const inputAsBN = useMemo(() => new BigNumber(rightShift(inputAmount, 18)), [inputAmount]) + const { value: inputTokenBalance } = useFungibleTokenBalance( + isSameAddress(protocol.bareToken.address, NATIVE_TOKEN_ADDRESS) + ? EthereumTokenType.Native + : protocol.bareToken.type ?? EthereumTokenType.Native, + protocol.bareToken.address, + chainId, + ) + const tokenAmount = useMemo( + () => new BigNumber(rightShift(inputAmount || '0', protocol.bareToken.decimals)), + [inputAmount, protocol.bareToken.decimals], + ) const balanceAsBN = useMemo( - () => (TabType.Deposit ? new BigNumber(nativeTokenBalance || '0') : protocol.balance), - [nativeTokenBalance, protocol.balance], + () => (tab === TabType.Deposit ? new BigNumber(inputTokenBalance || '0') : protocol.balance), + [tab, protocol.balance, inputTokenBalance], ) - useAsync(async () => { - if (!(inputAsBN.toNumber() > 0)) return - setLoading(true) - const gasEstimate = - tab === TabType.Deposit - ? await protocol.depositEstimate(account, targetChainId, web3, inputAsBN) - : await protocol.withdrawEstimate(account, targetChainId, web3, inputAsBN) - setEstimatedGas(gasEstimate) - setLoading(false) - }, [protocol, chainId, inputAmount]) + const { loading } = useAsync(async () => { + if (!(tokenAmount.toNumber() > 0)) return + try { + setEstimatedGas( + tab === TabType.Deposit + ? await protocol.depositEstimate(account, chainId, web3, tokenAmount) + : await protocol.withdrawEstimate(account, chainId, web3, tokenAmount), + ) + } catch { + // do nothing + console.log('Failed to estimate gas') + } + }, [chainId, tab, protocol, tokenAmount]) // #endregion // #region form validation const validationMessage = useMemo(() => { if (tokenAmount.isZero() || !inputAmount) return t('plugin_trader_error_amount_absence') - if (isLessThan(inputAsBN, 0)) return t('plugin_trade_error_input_amount_less_minimum_amount') + if (isLessThan(tokenAmount, 0)) return t('plugin_trade_error_input_amount_less_minimum_amount') if (isLessThan(balanceAsBN.minus(estimatedGas), tokenAmount)) { return t('plugin_trader_error_insufficient_balance', { - symbol: tab === TabType.Deposit ? protocol.base : protocol.pair, + symbol: tab === TabType.Deposit ? protocol.bareToken.symbol : protocol.stakeToken.symbol, }) } return '' }, [inputAmount, tokenAmount, nativeTokenBalance, balanceAsBN]) - const tokenPrice = useTokenPrice(chainId, undefined) + const tokenPrice = useTokenPrice( + chainId, + !isSameAddress(protocol.bareToken.address, NATIVE_TOKEN_ADDRESS) ? protocol.bareToken.address : undefined, + ) const tokenValueUSD = useMemo( () => (inputAmount ? new BigNumber(inputAmount).times(tokenPrice).toFixed(2) : '0'), @@ -110,8 +128,136 @@ export function SavingsForm({ chainId, selectedProtocol, tab, onClose }: Savings ) // #endregion + const { value: approvalData } = useAsync(async () => { + const token = protocol.bareToken + const aavePoolAddress = + getAaveConstants(chainId).AAVE_LENDING_POOL_ADDRESSES_PROVIDER_CONTRACT_ADDRESS || ZERO_ADDRESS + + const lPoolAddressProviderContract = createContract( + web3, + aavePoolAddress, + AaveLendingPoolAddressProviderABI as AbiItem[], + ) + + const poolAddress = await lPoolAddressProviderContract?.methods.getLendingPool().call() + + return { + approveToken: + token.type === EthereumTokenType.ERC20 + ? createERC20Token(chainId, token.address, token.decimals, token.name, token.symbol) + : undefined, + approveAmount: new BigNumber(inputAmount).shiftedBy(token.decimals), + approveAddress: poolAddress, + } + }, [protocol.bareToken, inputAmount, chainId]) + + const [, executor] = useAsyncFn(async () => { + switch (tab) { + case TabType.Deposit: + if (!(await protocol.deposit(account, chainId, web3, tokenAmount))) { + throw new Error('Failed to deposit token.') + } else { + await protocol.updateBalance(chainId, web3, account) + } + return + case TabType.Withdraw: + switch (protocol.type) { + case ProtocolType.Lido: + onClose?.() + onConvertClick() + return + default: + if (!(await protocol.withdraw(account, chainId, web3, tokenAmount))) { + throw new Error('Failed to withdraw token.') + } else { + await protocol.updateBalance(chainId, web3, account) + } + return + } + default: + unreachable(tab) + } + }, [tab, protocol, account, chainId, web3, tokenAmount]) + const needsSwap = protocol.type === ProtocolType.Lido && tab === TabType.Withdraw + const buttonDom = useMemo(() => { + if (tab === TabType.Deposit) + return ( + + + + + + + + ) + + return ( + + + + + + ) + }, [executor, validationMessage, needsSwap, protocol, tab, approvalData, chainId]) + return (
{needsSwap ? null : ( @@ -122,7 +268,7 @@ export function SavingsForm({ chainId, selectedProtocol, tab, onClose }: Savings maxAmount={balanceAsBN.minus(estimatedGas).toString()} balance={balanceAsBN.toString()} label={t('plugin_savings_amount')} - token={nativeTokenDetailed} + token={protocol.bareToken} onAmountChange={setInputAmount} InputProps={{ classes: { root: classes.inputTextField } }} MaxChipProps={{ classes: { root: classes.maxChip } }} @@ -148,75 +294,15 @@ export function SavingsForm({ chainId, selectedProtocol, tab, onClose }: Savings )}
- - - {protocol.pair} {t('plugin_savings_apr')}% + + + {protocol.bareToken.name} {t('plugin_savings_apr')}% - + {protocol.apr}%
- - - - { - switch (tab) { - case TabType.Deposit: - if (!(await protocol.deposit(account, targetChainId, web3, tokenAmount))) { - throw new Error('Could not deposit') - } - return - case TabType.Withdraw: - switch (protocol.type) { - case ProtocolType.Lido: - onClose?.() - onConvertClick() - return - default: - if (!(await protocol.withdraw(account, targetChainId, web3, tokenAmount))) { - throw new Error('Could not withdraw') - } - return - } - default: - unreachable(tab) - } - }} - /> - - + {buttonDom}
) } diff --git a/packages/mask/src/plugins/Savings/SNSAdaptor/SavingsFormStyles.tsx b/packages/mask/src/plugins/Savings/SNSAdaptor/SavingsFormStyles.tsx index ed6a7499b176..21146da0d84c 100644 --- a/packages/mask/src/plugins/Savings/SNSAdaptor/SavingsFormStyles.tsx +++ b/packages/mask/src/plugins/Savings/SNSAdaptor/SavingsFormStyles.tsx @@ -39,6 +39,7 @@ export const useStyles = makeStyles()((theme, props) => ({ fontWeight: 'bold', }, rowImage: { + width: '24px', height: '24px', margin: '0 5px 0 0', }, diff --git a/packages/mask/src/plugins/Savings/SNSAdaptor/SavingsTable.tsx b/packages/mask/src/plugins/Savings/SNSAdaptor/SavingsTable.tsx index 6fb7685bf44d..a47db0bcf228 100644 --- a/packages/mask/src/plugins/Savings/SNSAdaptor/SavingsTable.tsx +++ b/packages/mask/src/plugins/Savings/SNSAdaptor/SavingsTable.tsx @@ -1,34 +1,41 @@ import { useAsync } from 'react-use' -import { Box, Grid, Button, Typography } from '@mui/material' import { makeStyles } from '@masknet/theme' -import { FormattedBalance } from '@masknet/shared' -import { useWeb3, useAccount, formatBalance } from '@masknet/web3-shared-evm' +import { Box, Button, Grid, Typography, CircularProgress } from '@mui/material' +import { FormattedBalance, TokenIcon } from '@masknet/shared' import { isZero, rightShift } from '@masknet/web3-shared-base' -import type { ChainId } from '@masknet/web3-shared-evm' -import { IconURLs } from './IconURL' +import { ChainId, formatBalance, isSameAddress, useAccount, useAssets, useWeb3 } from '@masknet/web3-shared-evm' +import { ProviderIconURLs } from './IconURL' import { useI18N } from '../../../utils' -import { ProtocolType, SavingsProtocol, TabType } from '../types' -import { SavingsProtocols } from '../protocols' +import { SavingsProtocol, TabType } from '../types' const useStyles = makeStyles()((theme, props) => ({ containerWrap: { fontFamily: theme.typography.fontFamily, }, + tableContainer: { + maxHeight: 350, + overflowY: 'scroll', + }, tableHeader: { display: 'flex', background: theme.palette.mode === 'light' ? '#F6F8F8' : '#17191D', - borderRadius: '8px', + borderRadius: theme.spacing(1), margin: '0 0 15px 0', }, tableRow: { display: 'flex', background: theme.palette.mode === 'light' ? '#F6F8F8' : '#17191D', - borderRadius: '8px', + borderRadius: theme.spacing(1), + marginBottom: theme.spacing(1), + + '&:last-child': { + marginBottom: '0', + }, }, tableItem: { display: 'flex', background: theme.palette.mode === 'light' ? '#F6F8F8' : '#17191D', - borderRadius: '8px', + borderRadius: theme.spacing(1), }, tableCell: { display: 'flex', @@ -41,58 +48,68 @@ const useStyles = makeStyles()((theme, props) => ({ margin: '0 20px 0 0', }, logo: { + width: '32px', height: '32px', }, logoMini: { height: '16px', position: 'absolute', - bottom: '3px', + bottom: 0, right: '-5px', }, - protocolLabel: { - fontSize: 12, - opacity: 0.5, + protocolLabel: {}, + loading: { + display: 'flex', + justifyContent: 'center', + alignItems: 'center', + minHeight: 300, + width: '100%', }, })) -export interface MappableProtocol { - category: string - protocols: SavingsProtocol[] -} - export interface SavingsTableProps { chainId: ChainId tab: TabType - mappableProtocols: MappableProtocol[] - setSelectedProtocol(protocol: ProtocolType): void + protocols: SavingsProtocol[] setTab(tab: TabType): void + setSelectedProtocol(protocol: SavingsProtocol): void } -export function SavingsTable({ chainId, tab, mappableProtocols, setSelectedProtocol, setTab }: SavingsTableProps) { +export function SavingsTable({ chainId, tab, protocols, setTab, setSelectedProtocol }: SavingsTableProps) { const { t } = useI18N() const { classes } = useStyles() const web3 = useWeb3({ chainId }) + const account = useAccount() + const { value: assets, loading: getAssetsLoading } = useAssets( + protocols.map((x) => x.bareToken), + chainId, + ) + // Only fetch protocol APR and Balance on chainId change - useAsync(async () => { - for (const protocol of SavingsProtocols) { - await protocol.getApr() - await protocol.getBalance(chainId, web3, account) - } - }, [chainId]) + const { loading } = useAsync(async () => { + await Promise.all( + protocols.map(async (protocol) => { + protocol.updateApr(chainId, web3) + protocol.updateBalance(chainId, web3, account) + }), + ) + }, [chainId, web3, account, protocols]) return ( - {t('plugin_savings_type')} + {t('plugin_savings_asset')} - - {t('plugin_savings_apr')} - - + {tab === TabType.Deposit ? ( + + {t('plugin_savings_apr')} + + ) : null} + {t('plugin_savings_wallet')} @@ -100,35 +117,48 @@ export function SavingsTable({ chainId, tab, mappableProtocols, setSelectedProto - {mappableProtocols.map((categorizedProtocol) => { - const protocols = categorizedProtocol.protocols - if (protocols.length === 1) { - const protocol = protocols[0] - - return ( - + {loading || getAssetsLoading ? ( +
+ +
+ ) : ( +
+ {protocols.map((protocol, index) => ( +
- - + +
- {protocol.category.toUpperCase()} - {protocol.name} + {protocol.bareToken.symbol}
- - {protocol.apr}% - - + {tab === TabType.Deposit ? ( + + {protocol.apr}% + + ) : null} + + isSameAddress(x.token.address, protocol.bareToken.address), + )?.balance + : protocol.balance + } + decimals={protocol.bareToken.decimals} significant={6} - minimumBalance={rightShift(10, protocol.decimals - 6)} + minimumBalance={rightShift(10, protocol.bareToken.decimals - 6)} formatter={formatBalance} /> @@ -139,8 +169,8 @@ export function SavingsTable({ chainId, tab, mappableProtocols, setSelectedProto color="primary" disabled={tab === TabType.Withdraw ? isZero(protocol.balance) : false} onClick={() => { - setSelectedProtocol(protocol.type) setTab(tab) + setSelectedProtocol(protocol) }}> {tab === TabType.Deposit ? t('plugin_savings_deposit') @@ -148,20 +178,9 @@ export function SavingsTable({ chainId, tab, mappableProtocols, setSelectedProto - ) - } else { - /* - * - * @TODO: Add mappable protocols with chevron to toggle - * currency pairs to expand and collapse as according to Figma - * - * Reference: - * https://www.figma.com/file/gVkQ67y285b4FXVV1KPThN/TwitterV1?node-id=17600%3A374185 - * - */ - return <> - } - })} + ))} +
+ )}
) } diff --git a/packages/mask/src/plugins/Savings/SNSAdaptor/assets/aave.png b/packages/mask/src/plugins/Savings/SNSAdaptor/assets/aave.png new file mode 100644 index 000000000000..de6347b97ebc Binary files /dev/null and b/packages/mask/src/plugins/Savings/SNSAdaptor/assets/aave.png differ diff --git a/packages/mask/src/plugins/Savings/constants.ts b/packages/mask/src/plugins/Savings/constants.ts index b6e77632bb66..4f800312198b 100644 --- a/packages/mask/src/plugins/Savings/constants.ts +++ b/packages/mask/src/plugins/Savings/constants.ts @@ -1,2 +1,138 @@ +import { ChainId, createERC20Tokens, createNativeToken, FungibleTokenDetailed } from '@masknet/web3-shared-evm' + export const SAVINGS_PLUGIN_NAME = 'Savings' export const SAVINGS_PLUGIN_ID = 'com.savings' + +export const LDO_PAIRS: [FungibleTokenDetailed, FungibleTokenDetailed][] = [ + [ + createNativeToken(ChainId.Mainnet), + createERC20Tokens('LDO_stETH_ADDRESS', 'Liquid staked Ether 2.0', 'stETH', 18)[ChainId.Mainnet], + ], +] + +export const AAVE_PAIRS: [FungibleTokenDetailed, FungibleTokenDetailed][] = [ + [ + createERC20Tokens('USDT_ADDRESS', 'Tether USD', 'USDT', 6)[ChainId.Mainnet], + createERC20Tokens('aUSDT_ADDRESS', 'Aave Interest bearing USDT', 'aUSDT', 6)[ChainId.Mainnet], + ], + [ + createERC20Tokens('WBTC_ADDRESS', 'WBTC', 'WBTC', 8)[ChainId.Mainnet], + createERC20Tokens('aWBTC_ADDRESS', 'aWBTC', 'aWBTC', 8)[ChainId.Mainnet], + ], + [ + createERC20Tokens('WETH_ADDRESS', 'WETH', 'WETH', 18)[ChainId.Mainnet], + createERC20Tokens('aWETH_ADDRESS', 'aWETH', 'aWETH', 18)[ChainId.Mainnet], + ], + [ + createERC20Tokens('YFI_ADDRESS', 'YFI', 'YFI', 18)[ChainId.Mainnet], + createERC20Tokens('aYFI_ADDRESS', 'aYFI', 'aYFI', 18)[ChainId.Mainnet], + ], + [ + createERC20Tokens('ZRX_ADDRESS', 'ZRX', 'ZRX', 18)[ChainId.Mainnet], + createERC20Tokens('aZRX_ADDRESS', 'aZRX', 'aZRX', 18)[ChainId.Mainnet], + ], + [ + createERC20Tokens('UNI_ADDRESS', 'UNI', 'UNI', 18)[ChainId.Mainnet], + createERC20Tokens('aUNI_ADDRESS', 'aUNI', 'aUNI', 18)[ChainId.Mainnet], + ], + [ + createERC20Tokens('AAVE_ADDRESS', 'AAVE', 'AAVE', 18)[ChainId.Mainnet], + createERC20Tokens('aAAVE_ADDRESS', 'aAAVE', 'aAAVE', 18)[ChainId.Mainnet], + ], + [ + createERC20Tokens('BAT_ADDRESS', 'BAT', 'BAT', 18)[ChainId.Mainnet], + createERC20Tokens('aBAT_ADDRESS', 'aBAT', 'aBAT', 18)[ChainId.Mainnet], + ], + [ + createERC20Tokens('BUSD_ADDRESS', 'BUSD', 'BUSD', 18)[ChainId.Mainnet], + createERC20Tokens('aBUSD_ADDRESS', 'aBUSD', 'aBUSD', 18)[ChainId.Mainnet], + ], + [ + createERC20Tokens('DAI_ADDRESS', 'DAI', 'DAI', 18)[ChainId.Mainnet], + createERC20Tokens('aDAI_ADDRESS', 'aDAI', 'aDAI', 18)[ChainId.Mainnet], + ], + [ + createERC20Tokens('ENJ_ADDRESS', 'ENJ', 'ENJ', 18)[ChainId.Mainnet], + createERC20Tokens('aENJ_ADDRESS', 'aENJ', 'aENJ', 18)[ChainId.Mainnet], + ], + [ + createERC20Tokens('KNC_ADDRESS', 'KNC', 'KNC', 18)[ChainId.Mainnet], + createERC20Tokens('aKNC_ADDRESS', 'aKNC', 'aKNC', 18)[ChainId.Mainnet], + ], + [ + createERC20Tokens('LINK_ADDRESS', 'LINK', 'LINK', 18)[ChainId.Mainnet], + createERC20Tokens('aLINK_ADDRESS', 'aLINK', 'aLINK', 18)[ChainId.Mainnet], + ], + [ + createERC20Tokens('MANA_ADDRESS', 'MANA', 'MANA', 18)[ChainId.Mainnet], + createERC20Tokens('aMANA_ADDRESS', 'aMANA', 'aMANA', 18)[ChainId.Mainnet], + ], + [ + createERC20Tokens('MKR_ADDRESS', 'MKR', 'MKR', 18)[ChainId.Mainnet], + createERC20Tokens('aMKR_ADDRESS', 'aMKR', 'aMKR', 18)[ChainId.Mainnet], + ], + [ + createERC20Tokens('REN_ADDRESS', 'REN', 'REN', 18)[ChainId.Mainnet], + createERC20Tokens('aREN_ADDRESS', 'aREN', 'aREN', 18)[ChainId.Mainnet], + ], + [ + createERC20Tokens('SNX_ADDRESS', 'SNX', 'SNX', 18)[ChainId.Mainnet], + createERC20Tokens('aSNX_ADDRESS', 'aSNX', 'aSNX', 18)[ChainId.Mainnet], + ], + [ + createERC20Tokens('sUSD_ADDRESS', 'sUSD', 'sUSD', 18)[ChainId.Mainnet], + createERC20Tokens('aSUSD_ADDRESS', 'aSUSD', 'aSUSD', 18)[ChainId.Mainnet], + ], + [ + createERC20Tokens('TUSD_ADDRESS', 'TUSD', 'TUSD', 18)[ChainId.Mainnet], + createERC20Tokens('aTUSD_ADDRESS', 'aTUSD', 'aTUSD', 18)[ChainId.Mainnet], + ], + [ + createERC20Tokens('USDC_ADDRESS', 'USDC', 'USDC', 6)[ChainId.Mainnet], + createERC20Tokens('aUSDC_ADDRESS', 'aUSDC', 'aUSDC', 6)[ChainId.Mainnet], + ], + [ + createERC20Tokens('CRV_ADDRESS', 'CRV', 'CRV', 18)[ChainId.Mainnet], + createERC20Tokens('aCRV_ADDRESS', 'aCRV', 'aCRV', 18)[ChainId.Mainnet], + ], + [ + createERC20Tokens('GUSD_ADDRESS', 'GUSD', 'GUSD', 2)[ChainId.Mainnet], + createERC20Tokens('aGUSD_ADDRESS', 'aGUSD', 'aGUSD', 2)[ChainId.Mainnet], + ], + [ + createERC20Tokens('BAL_ADDRESS', 'BAL', 'BAL', 18)[ChainId.Mainnet], + createERC20Tokens('aBAL_ADDRESS', 'aBAL', 'aBAL', 18)[ChainId.Mainnet], + ], + [ + createERC20Tokens('xSUSHI_ADDRESS', 'xSUSHI', 'xSUSHI', 18)[ChainId.Mainnet], + createERC20Tokens('aXSUSHI_ADDRESS', 'aXSUSHI', 'aXSUSHI', 18)[ChainId.Mainnet], + ], + [ + createERC20Tokens('renFIL_ADDRESS', 'renFIL', 'renFIL', 18)[ChainId.Mainnet], + createERC20Tokens('aRENFIL_ADDRESS', 'aRENFIL', 'aRENFIL', 18)[ChainId.Mainnet], + ], + [ + createERC20Tokens('RAI_ADDRESS', 'RAI', 'RAI', 18)[ChainId.Mainnet], + createERC20Tokens('aRAI_ADDRESS', 'aRAI', 'aRAI', 18)[ChainId.Mainnet], + ], + [ + createERC20Tokens('AMPL_ADDRESS', 'AMPL', 'AMPL', 9)[ChainId.Mainnet], + createERC20Tokens('aAMPL_ADDRESS', 'aAMPL', 'aAMPL', 9)[ChainId.Mainnet], + ], + [ + createERC20Tokens('USDP_ADDRESS', 'USDP', 'USDP', 18)[ChainId.Mainnet], + createERC20Tokens('aUSDP_ADDRESS', 'aUSDP', 'aUSDP', 18)[ChainId.Mainnet], + ], + [ + createERC20Tokens('DPI_ADDRESS', 'DPI', 'DPI', 18)[ChainId.Mainnet], + createERC20Tokens('aDPI_ADDRESS', 'aDPI', 'aDPI', 18)[ChainId.Mainnet], + ], + [ + createERC20Tokens('FRAX_ADDRESS', 'FRAX', 'FRAX', 18)[ChainId.Mainnet], + createERC20Tokens('aFRAX_ADDRESS', 'aFRAX', 'aFRAX', 18)[ChainId.Mainnet], + ], + [ + createERC20Tokens('FEI_ADDRESS', 'FEI', 'FEI', 18)[ChainId.Mainnet], + createERC20Tokens('aFEI_ADDRESS', 'aFEI', 'aFEI', 18)[ChainId.Mainnet], + ], +] diff --git a/packages/mask/src/plugins/Savings/protocols/AAVEProtocol.ts b/packages/mask/src/plugins/Savings/protocols/AAVEProtocol.ts new file mode 100644 index 000000000000..002047567ee4 --- /dev/null +++ b/packages/mask/src/plugins/Savings/protocols/AAVEProtocol.ts @@ -0,0 +1,250 @@ +import type Web3 from 'web3' +import type { AbiItem } from 'web3-utils' +import BigNumber from 'bignumber.js' +import { pow10, ZERO } from '@masknet/web3-shared-base' +import { + ChainId, + getAaveConstants, + createContract, + FungibleTokenDetailed, + ZERO_ADDRESS, +} from '@masknet/web3-shared-evm' +import type { AaveLendingPool } from '@masknet/web3-contracts/types/AaveLendingPool' +import type { AaveLendingPoolAddressProvider } from '@masknet/web3-contracts/types/AaveLendingPoolAddressProvider' +import AaveLendingPoolAddressProviderABI from '@masknet/web3-contracts/abis/AaveLendingPoolAddressProvider.json' +import AaveLendingPoolABI from '@masknet/web3-contracts/abis/AaveLendingPool.json' +import { ProtocolType, SavingsProtocol } from '../types' +import type { ERC20 } from '@masknet/web3-contracts/types/ERC20' +import ERC20ABI from '@masknet/web3-contracts/abis/ERC20.json' + +export class AAVEProtocol implements SavingsProtocol { + static DEFAULT_APR = '0.17' + + private _apr = '0.00' + private _balance = ZERO + + constructor(readonly pair: [FungibleTokenDetailed, FungibleTokenDetailed]) {} + + get type() { + return ProtocolType.AAVE + } + + get apr() { + return this._apr + } + + get balance() { + return this._balance + } + + get bareToken() { + return this.pair[0] + } + + get stakeToken() { + return this.pair[1] + } + + public async updateApr(chainId: ChainId, web3: Web3) { + try { + const subgraphUrl = getAaveConstants(chainId).AAVE_SUBGRAPHS || '' + + if (!subgraphUrl) { + this._apr = AAVEProtocol.DEFAULT_APR + return + } + + const body = JSON.stringify({ + query: `{ + reserves (where: { + underlyingAsset: "${this.bareToken.address}" + pool : "0xb53c1a33016b2dc2ff3653530bff1848a515c8c5" + }) { + id + name + underlyingAsset + price { + id + } + liquidityRate + } + }`, + }) + const response = await fetch(subgraphUrl, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: body, + }) + const fullResponse: { + data: { + reserves: { + id: string + name: string + decimals: number + underlyingAsset: string + liquidityRate: number + }[] + } + } = await response.json() + const liquidityRate = +fullResponse.data.reserves[0].liquidityRate + + const RAY = pow10(27) // 10 to the power 27 + const SECONDS_PER_YEAR = 31536000 + + // APY and APR are returned here as decimals, multiply by 100 to get the percents + this._apr = new BigNumber(liquidityRate).times(100).div(RAY).toFixed(2) + } catch (error) { + console.error('AAVE: Apr Error:', error) + this._apr = AAVEProtocol.DEFAULT_APR + } + } + + public async updateBalance(chainId: ChainId, web3: Web3, account: string) { + try { + const subgraphUrl = getAaveConstants(chainId).AAVE_SUBGRAPHS || '' + + if (!subgraphUrl) { + this._apr = AAVEProtocol.DEFAULT_APR + return + } + + const body = JSON.stringify({ + query: `{ + reserves (where: { + underlyingAsset: "${this.bareToken.address}" + pool : "0xb53c1a33016b2dc2ff3653530bff1848a515c8c5" + }) { + id + aToken { + id + } + } + }`, + }) + const response = await fetch(subgraphUrl, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: body, + }) + + const fullResponse: { + data: { + reserves: { + aToken: { + id: string + } + }[] + } + } = await response.json() + + const aTokenId = fullResponse.data.reserves[0].aToken.id + const contract = createContract(web3, aTokenId || ZERO_ADDRESS, ERC20ABI as AbiItem[]) + this._balance = new BigNumber((await contract?.methods.balanceOf(account).call()) ?? '0') + } catch (error) { + console.error('AAVE BALANCE ERROR: ', error) + this._balance = ZERO + } + } + + public async depositEstimate(account: string, chainId: ChainId, web3: Web3, value: BigNumber.Value) { + try { + const operation = await this.createDepositTokenOperation(account, chainId, web3, value) + const gasEstimate = await operation?.estimateGas({ + from: account, + }) + + return new BigNumber(gasEstimate || 0) + } catch (error) { + console.error('AAVE deposit estimate ERROR: ', error) + return ZERO + } + } + + private async createDepositTokenOperation(account: string, chainId: ChainId, web3: Web3, value: BigNumber.Value) { + const aaveLPoolAddress = + getAaveConstants(chainId).AAVE_LENDING_POOL_ADDRESSES_PROVIDER_CONTRACT_ADDRESS || ZERO_ADDRESS + const lPoolAddressProviderContract = createContract( + web3, + aaveLPoolAddress, + AaveLendingPoolAddressProviderABI as AbiItem[], + ) + + const poolAddress = await lPoolAddressProviderContract?.methods.getLendingPool().call() + + const contract = createContract( + web3, + poolAddress || ZERO_ADDRESS, + AaveLendingPoolABI as AbiItem[], + ) + return contract?.methods.deposit(this.bareToken.address, new BigNumber(value).toFixed(), account, '0') + } + + public async deposit(account: string, chainId: ChainId, web3: Web3, value: BigNumber.Value) { + try { + const gasEstimate = await this.depositEstimate(account, chainId, web3, value) + const operation = await this.createDepositTokenOperation(account, chainId, web3, value) + if (operation) { + await operation.send({ + from: account, + gas: gasEstimate.toNumber(), + }) + return true + } + return false + } catch (error) { + return false + } + } + + public async withdrawEstimate(account: string, chainId: ChainId, web3: Web3, value: BigNumber.Value) { + try { + const lPoolAddressProviderContract = createContract( + web3, + getAaveConstants(chainId).AAVE_LENDING_POOL_ADDRESSES_PROVIDER_CONTRACT_ADDRESS || ZERO_ADDRESS, + AaveLendingPoolAddressProviderABI as AbiItem[], + ) + + const poolAddress = await lPoolAddressProviderContract?.methods.getLendingPool().call() + + const contract = createContract( + web3, + poolAddress || ZERO_ADDRESS, + AaveLendingPoolABI as AbiItem[], + ) + const gasEstimate = await contract?.methods + .withdraw(this.bareToken.address, new BigNumber(value).toFixed(), account) + .estimateGas({ + from: account, + }) + return new BigNumber(gasEstimate || 0) + } catch (error) { + return ZERO + } + } + + public async withdraw(account: string, chainId: ChainId, web3: Web3, value: BigNumber.Value) { + try { + const lPoolAddressProviderContract = createContract( + web3, + getAaveConstants(chainId).AAVE_LENDING_POOL_ADDRESSES_PROVIDER_CONTRACT_ADDRESS || ZERO_ADDRESS, + AaveLendingPoolAddressProviderABI as AbiItem[], + ) + + const poolAddress = await lPoolAddressProviderContract?.methods.getLendingPool().call() + + const gasEstimate = await this.withdrawEstimate(account, chainId, web3, value) + const contract = createContract( + web3, + poolAddress || ZERO_ADDRESS, + AaveLendingPoolABI as AbiItem[], + ) + await contract?.methods.withdraw(this.bareToken.address, new BigNumber(value).toFixed(), account).send({ + from: account, + gas: gasEstimate.toNumber(), + }) + return true + } catch (error) { + return false + } + } +} diff --git a/packages/mask/src/plugins/Savings/protocols/LDOProtocol.ts b/packages/mask/src/plugins/Savings/protocols/LDOProtocol.ts index 4c1664fbabac..686eb9be3fc4 100644 --- a/packages/mask/src/plugins/Savings/protocols/LDOProtocol.ts +++ b/packages/mask/src/plugins/Savings/protocols/LDOProtocol.ts @@ -1,115 +1,61 @@ import type Web3 from 'web3' import type { AbiItem } from 'web3-utils' +import BigNumber from 'bignumber.js' import { - EthereumTokenType, ChainId, - getSavingsConstants, + getLidoConstants, createContract, FungibleTokenDetailed, ZERO_ADDRESS, } from '@masknet/web3-shared-evm' +import { ZERO } from '@masknet/web3-shared-base' import type { Lido } from '@masknet/web3-contracts/types/Lido' import LidoABI from '@masknet/web3-contracts/abis/Lido.json' -import BigNumber from 'bignumber.js' -import { ProtocolCategory, SavingsNetwork, SavingsProtocol, ProtocolType } from '../types' +import { SavingsProtocol, ProtocolType } from '../types' -export interface LidoContract { - type: EthereumTokenType - chainName: string - ldoContract: string - stEthContract: string -} +export class LidoProtocol implements SavingsProtocol { + private _apr = '0.00' + private _balance = ZERO -export const LidoContracts: { [key: number]: LidoContract } = { - [ChainId.Mainnet]: { - type: EthereumTokenType.ERC20, - chainName: 'Ethereum', - ldoContract: getSavingsConstants(ChainId.Mainnet).LIDO || ZERO_ADDRESS, - stEthContract: getSavingsConstants(ChainId.Mainnet).LIDO_STETH || ZERO_ADDRESS, - }, - [ChainId.Gorli]: { - type: EthereumTokenType.ERC20, - chainName: 'Gorli', - ldoContract: getSavingsConstants(ChainId.Gorli).LIDO || ZERO_ADDRESS, - stEthContract: getSavingsConstants(ChainId.Gorli).LIDO_STETH || ZERO_ADDRESS, - }, -} + readonly type = ProtocolType.Lido -export class LidoProtocol implements SavingsProtocol { - public category = ProtocolCategory.ETH - public type = ProtocolType.Lido - public name = 'Lido' - public image = 'lido' - public base = 'ETH' - public pair = 'stETH' - public decimals = 18 - public apr = '0.00' - public balance = new BigNumber('0') - public availableNetworks: SavingsNetwork[] = [ - { - chainId: ChainId.Mainnet, - chainName: 'Ethereum', - contractAddress: getSavingsConstants(ChainId.Mainnet).LIDO_STETH || ZERO_ADDRESS, - }, - { - chainId: ChainId.Gorli, - chainName: 'Gorli', - contractAddress: getSavingsConstants(ChainId.Gorli).LIDO_STETH || ZERO_ADDRESS, - }, - ] + constructor(readonly pair: [FungibleTokenDetailed, FungibleTokenDetailed]) {} - public getFungibleTokenDetails(chainId: ChainId): FungibleTokenDetailed { - let contractAddress = '' + get apr() { + return this._apr + } - for (const network of this.availableNetworks) { - if (network.chainId === chainId) { - contractAddress = network.contractAddress - } - } + get balance() { + return this._balance + } - return { - type: 1, - chainId: chainId, - address: contractAddress, - symbol: 'stETH', - decimals: 18, - name: 'Liquid staked Ether 2.0', - logoURI: [ - 'https://static.debank.com/image/eth_token/logo_url/0xae7ab96520de3a18e5e111b5eaab095312d7fe84/f768023f77be7a2ea23c37f25b272048.png', - 'https://tokens.1inch.io/0xae7ab96520de3a18e5e111b5eaab095312d7fe84.png', - ], - } + get bareToken() { + return this.pair[0] + } + + get stakeToken() { + return this.pair[1] } - public async getApr() { + async updateApr(chainId: ChainId, web3: Web3): Promise { try { - const LidoAprUrl = 'https://cors.r2d2.to/?https://stake.lido.fi/api/steth-apr' - const response = await fetch(LidoAprUrl) - const apr = await response.text() - this.apr = apr - return apr - } catch (error) { - console.log('LDO `getApr()` error', error) - // Default APR is 5.30% - this.apr = '5.30' - return '5.30' + const response = await fetch('https://cors.r2d2.to/?https://stake.lido.fi/api/steth-apr') + this._apr = await response.text() + } catch { + // the default APR is 5.30% + this._apr = '5.30' } } - - public async getBalance(chainId: ChainId, web3: Web3, account: string) { + async updateBalance(chainId: ChainId, web3: Web3, account: string): Promise { try { const contract = createContract( web3, - getSavingsConstants(chainId).LIDO_STETH || ZERO_ADDRESS, + getLidoConstants(chainId).LIDO_stETH_ADDRESS || ZERO_ADDRESS, LidoABI as AbiItem[], ) - const balance = await contract?.methods.balanceOf(account).call() - this.balance = new BigNumber(balance || '0') - return this.balance + this._balance = new BigNumber((await contract?.methods.balanceOf(account).call()) ?? '0') } catch (error) { - console.log('LDO `getBalance()` error', error) - this.balance = new BigNumber('0') - return this.balance + this._balance = ZERO } } @@ -117,11 +63,11 @@ export class LidoProtocol implements SavingsProtocol { try { const contract = createContract( web3, - getSavingsConstants(chainId).LIDO_STETH || ZERO_ADDRESS, + getLidoConstants(chainId).LIDO_stETH_ADDRESS || ZERO_ADDRESS, LidoABI as AbiItem[], ) const gasEstimate = await contract?.methods - .submit(getSavingsConstants(chainId).LIDO_REFERRAL_ADDRESS || ZERO_ADDRESS) + .submit(getLidoConstants(chainId).LIDO_REFERRAL_ADDRESS || ZERO_ADDRESS) .estimateGas({ from: account, value: value.toString(), @@ -138,10 +84,10 @@ export class LidoProtocol implements SavingsProtocol { try { const contract = createContract( web3, - getSavingsConstants(chainId).LIDO_STETH || ZERO_ADDRESS, + getLidoConstants(chainId).LIDO_stETH_ADDRESS || ZERO_ADDRESS, LidoABI as AbiItem[], ) - await contract?.methods.submit(getSavingsConstants(chainId).LIDO_REFERRAL_ADDRESS || ZERO_ADDRESS).send({ + await contract?.methods.submit(getLidoConstants(chainId).LIDO_REFERRAL_ADDRESS || ZERO_ADDRESS).send({ from: account, value: value.toString(), gas: 300000, @@ -155,7 +101,7 @@ export class LidoProtocol implements SavingsProtocol { } public async withdrawEstimate(account: string, chainId: ChainId, web3: Web3, value: BigNumber.Value) { - return new BigNumber('0') + return ZERO } public async withdraw(account: string, chainId: ChainId, web3: Web3, value: BigNumber.Value) { @@ -176,5 +122,3 @@ export class LidoProtocol implements SavingsProtocol { return false } } - -export default new LidoProtocol() diff --git a/packages/mask/src/plugins/Savings/protocols/index.ts b/packages/mask/src/plugins/Savings/protocols/index.ts index 460cbef77532..c4e741db42d2 100644 --- a/packages/mask/src/plugins/Savings/protocols/index.ts +++ b/packages/mask/src/plugins/Savings/protocols/index.ts @@ -1,4 +1,8 @@ -import type { SavingsProtocol } from '../types' -import LidoProtocol from './LDOProtocol' +import { AAVE_PAIRS, LDO_PAIRS } from '../constants' +import { LidoProtocol } from './LDOProtocol' +import { AAVEProtocol } from './AAVEProtocol' -export const SavingsProtocols: SavingsProtocol[] = [LidoProtocol] +export const SavingsProtocols = [ + ...LDO_PAIRS.map((pair) => new LidoProtocol(pair)), + ...AAVE_PAIRS.map((pair) => new AAVEProtocol(pair)), +] diff --git a/packages/mask/src/plugins/Savings/types.ts b/packages/mask/src/plugins/Savings/types.ts index 5a690fef29a5..5dec892e7314 100644 --- a/packages/mask/src/plugins/Savings/types.ts +++ b/packages/mask/src/plugins/Savings/types.ts @@ -1,43 +1,42 @@ -import type BigNumber from 'bignumber.js' import type Web3 from 'web3' +import type BigNumber from 'bignumber.js' import type { ChainId, FungibleTokenDetailed } from '@masknet/web3-shared-evm' -export interface SavingsNetwork { - chainId: ChainId - chainName: string - contractAddress: string -} - -export enum ProtocolCategory { - ETH = 'eth', +export enum TabType { + Deposit = 'deposit', + Withdraw = 'withdraw', } export enum ProtocolType { Lido = 0, + AAVE = 1, } - export interface SavingsProtocol { - category: ProtocolCategory - type: ProtocolType - name: string - image: string - base: string - pair: string - decimals: number - availableNetworks: SavingsNetwork[] - apr: string - balance: BigNumber - - getFungibleTokenDetails(chainId: ChainId): FungibleTokenDetailed - getApr(): Promise - getBalance(chainId: ChainId, web3: Web3, account: string): Promise + readonly type: ProtocolType + + /** + * annual percentage rate + */ + readonly apr: string + + /** + * the amount of staked tokens of the latest found account + */ + readonly balance: BigNumber + + /** + * combine a bare token and a staked token with being a pair + */ + readonly pair: [FungibleTokenDetailed, FungibleTokenDetailed] + + readonly bareToken: FungibleTokenDetailed + readonly stakeToken: FungibleTokenDetailed + + updateApr(chainId: ChainId, web3: Web3): Promise + updateBalance(chainId: ChainId, web3: Web3, account: string): Promise + depositEstimate(account: string, chainId: ChainId, web3: Web3, value: BigNumber.Value): Promise deposit(account: string, chainId: ChainId, web3: Web3, value: BigNumber.Value): Promise withdrawEstimate(account: string, chainId: ChainId, web3: Web3, value: BigNumber.Value): Promise withdraw(account: string, chainId: ChainId, web3: Web3, value: BigNumber.Value): Promise } - -export enum TabType { - Deposit = 'deposit', - Withdraw = 'withdraw', -} diff --git a/packages/mask/src/plugins/Trader/constants/sushiswap.ts b/packages/mask/src/plugins/Trader/constants/sushiswap.ts index cf063b9a1af6..9c245496daff 100644 --- a/packages/mask/src/plugins/Trader/constants/sushiswap.ts +++ b/packages/mask/src/plugins/Trader/constants/sushiswap.ts @@ -1,9 +1,6 @@ import { ChainId, DAI, - MSKA, - MSKB, - MSKC, RUNE, USDC, USDT, @@ -30,7 +27,6 @@ export const SUSHISWAP_CUSTOM_BASES: ERC20TokenCustomizedBase = {} export const SUSHISWAP_BASE_AGAINST_TOKENS: ERC20AgainstToken = { ...WNATIVE_ONLY, [ChainId.Mainnet]: [WNATIVE, DAI, USDC, USDT, WBTC, RUNE, NFTX, STETH].map((x) => x[ChainId.Mainnet]), - [ChainId.Rinkeby]: [WNATIVE, MSKA, MSKB, MSKC].map((x) => x[ChainId.Rinkeby]), [ChainId.Matic]: [WNATIVE, USDC, WBTC, DAI, USDT].map((x) => x[ChainId.Matic]), [ChainId.BSC]: [WNATIVE, DAI, BUSD, USDC, USDT, BTCB].map((x) => x[ChainId.BSC]), [ChainId.xDai]: [WNATIVE, USDC, USDT, WBTC].map((x) => x[ChainId.xDai]), diff --git a/packages/mask/src/plugins/Trader/constants/trisolaris.ts b/packages/mask/src/plugins/Trader/constants/trisolaris.ts index 305107345a1f..f4b0f3152bae 100644 --- a/packages/mask/src/plugins/Trader/constants/trisolaris.ts +++ b/packages/mask/src/plugins/Trader/constants/trisolaris.ts @@ -1,4 +1,4 @@ -import { ChainId, DAI, MSKA, MSKB, MSKC, USDC, USDT, WBTC, WNATIVE, WNATIVE_ONLY } from '@masknet/web3-shared-evm' +import { ChainId, DAI, USDC, USDT, WBTC, WNATIVE, WNATIVE_ONLY } from '@masknet/web3-shared-evm' import type { ERC20AgainstToken, ERC20TokenCustomizedBase } from './types' /** @@ -9,7 +9,6 @@ export const TRISOLARIS_CUSTOM_BASES: ERC20TokenCustomizedBase = {} export const TRISOLARIS_BASE_AGAINST_TOKENS: ERC20AgainstToken = { ...WNATIVE_ONLY, - [ChainId.Rinkeby]: [WNATIVE, MSKA, MSKB, MSKC].map((x) => x[ChainId.Rinkeby]), [ChainId.Matic]: [WNATIVE, USDC, WBTC, DAI, USDT].map((x) => x[ChainId.Matic]), [ChainId.Aurora]: [WNATIVE, DAI, USDT, USDC, WBTC].map((x) => x[ChainId.Aurora]), } diff --git a/packages/mask/src/plugins/Trader/constants/uniswap.ts b/packages/mask/src/plugins/Trader/constants/uniswap.ts index 01e5d9cba1de..dbf356667492 100644 --- a/packages/mask/src/plugins/Trader/constants/uniswap.ts +++ b/packages/mask/src/plugins/Trader/constants/uniswap.ts @@ -1,4 +1,4 @@ -import { ChainId, AMPL, DAI, MSKA, MSKB, MSKC, USDC, USDT, WBTC, WNATIVE, WNATIVE_ONLY } from '@masknet/web3-shared-evm' +import { ChainId, AMPL, DAI, USDC, USDT, WBTC, WNATIVE, WNATIVE_ONLY } from '@masknet/web3-shared-evm' import { Percent } from '@uniswap/sdk-core' import JSBI from 'jsbi' import type { ERC20AgainstToken, ERC20TokenCustomizedBase } from './types' @@ -20,7 +20,6 @@ export const UNISWAP_BASE_AGAINST_TOKENS: ERC20AgainstToken = { ...WNATIVE_ONLY, [ChainId.Mainnet]: [WNATIVE, DAI, USDC, USDT, WBTC].map((x) => x[ChainId.Mainnet]), [ChainId.Matic]: [WNATIVE, DAI, USDC, USDT, WBTC].map((x) => x[ChainId.Matic]), - [ChainId.Rinkeby]: [WNATIVE, MSKA, MSKB, MSKC].map((x) => x[ChainId.Rinkeby]), } export const MAX_HOP = 3 diff --git a/packages/web3-constants/evm/savings.json b/packages/web3-constants/evm/aave.json similarity index 66% rename from packages/web3-constants/evm/savings.json rename to packages/web3-constants/evm/aave.json index 0f58f923eb48..1967d793a144 100644 --- a/packages/web3-constants/evm/savings.json +++ b/packages/web3-constants/evm/aave.json @@ -1,10 +1,10 @@ { - "LIDO": { - "Mainnet": "0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32", + "AAVE_SUBGRAPHS": { + "Mainnet": "https://api.thegraph.com/subgraphs/name/aave/protocol-v2", "Ropsten": "", "Rinkeby": "", - "Kovan": "", - "Gorli": "0x56340274fB5a72af1A3C6609061c451De7961Bd4", + "Kovan": "https://api.thegraph.com/subgraphs/name/aave/protocol-v2-kovan", + "Gorli": "", "BSC": "", "BSCT": "", "Matic": "", @@ -19,12 +19,12 @@ "Aurora": "", "Aurora_Testnet": "" }, - "LIDO_STETH": { - "Mainnet": "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84", + "AAVE_LENDING_POOL_ADDRESSES_PROVIDER_CONTRACT_ADDRESS": { + "Mainnet": "0xb53c1a33016b2dc2ff3653530bff1848a515c8c5", "Ropsten": "", "Rinkeby": "", - "Kovan": "", - "Gorli": "0x1643E812aE58766192Cf7D2Cf9567dF2C37e9B7F", + "Kovan": "0x88757f2f99175387ab4c6a4b3067c77a695b0349", + "Gorli": "", "BSC": "", "BSCT": "", "Matic": "", @@ -39,12 +39,12 @@ "Aurora": "", "Aurora_Testnet": "" }, - "LIDO_REFERRAL_ADDRESS": { - "Mainnet": "0x278D7e418a28ff763eEeDf29238CD6dfcade3A3a", + "AAVE_PROTOCOL_DATA_PROVIDER_CONTRACT_ADDRESS": { + "Mainnet": "0x057835Ad21a177dbdd3090bB1CAE03EaCF78Fc6d", "Ropsten": "", "Rinkeby": "", "Kovan": "", - "Gorli": "0x278D7e418a28ff763eEeDf29238CD6dfcade3A3a", + "Gorli": "", "BSC": "", "BSCT": "", "Matic": "", diff --git a/packages/web3-constants/evm/coingecko.json b/packages/web3-constants/evm/coingecko.json index 20dbb8910035..6f3add83afa9 100644 --- a/packages/web3-constants/evm/coingecko.json +++ b/packages/web3-constants/evm/coingecko.json @@ -17,8 +17,7 @@ "Celo": "celo", "Fantom": "fantom", "Aurora": "aurora", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "COIN_ID": { "Mainnet": "ethereum", @@ -38,7 +37,6 @@ "Celo": "celo", "Fantom": "fantom", "Aurora": "ethereum", - "Aurora_Testnet": "", - "Conflux": "conflux-token" + "Aurora_Testnet": "" } } diff --git a/packages/web3-constants/evm/coinmarketcap.json b/packages/web3-constants/evm/coinmarketcap.json index 44f07aaa4b88..ffd32861a9a2 100644 --- a/packages/web3-constants/evm/coinmarketcap.json +++ b/packages/web3-constants/evm/coinmarketcap.json @@ -17,7 +17,6 @@ "Celo": "5567", "Fantom": "3513", "Aurora": "1313161554", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" } } diff --git a/packages/web3-constants/evm/debank.json b/packages/web3-constants/evm/debank.json index f4ba365239c1..070df0c683df 100644 --- a/packages/web3-constants/evm/debank.json +++ b/packages/web3-constants/evm/debank.json @@ -17,7 +17,6 @@ "Celo": "celo", "Fantom": "ftm", "Aurora": "aurora", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" } } diff --git a/packages/web3-constants/evm/ethereum.json b/packages/web3-constants/evm/ethereum.json index 4e4fefb89d3b..f4ca94106031 100644 --- a/packages/web3-constants/evm/ethereum.json +++ b/packages/web3-constants/evm/ethereum.json @@ -17,8 +17,7 @@ "Celo": "0x8e28F1d64ceD52b9A09aB1AA3071Aa3c05802d1F", "Fantom": "0xc119574d5fb333f5ac018658d4d8b5035e16bf39", "Aurora": "0xC119574D5Fb333F5AC018658D4d8b5035E16bf39", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "MULTICALL_ADDRESS": { "Mainnet": "0x1F98415757620B543A52E61c46B32eB19261F984", @@ -38,8 +37,7 @@ "Celo": "0x072453AdEC16cFC7FB6Af1517c3f25407180cccC", "Fantom": "0x913975af2Bb8a6Be4100D7dc5e9765B77F6A5d6c", "Aurora": "0x6cc1b1058F9153358278C35E0b2D382f1585854B", - "Aurora_Testnet": "", - "Conflux": "0x19f179d7e0d7d9f9d5386afff64271d98a91615b" + "Aurora_Testnet": "" }, "ENS_REGISTRAR_ADDRESS": { "Mainnet": "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", diff --git a/packages/web3-constants/evm/ito.json b/packages/web3-constants/evm/ito.json index f15c7c3a47e6..f0cbea49edfb 100644 --- a/packages/web3-constants/evm/ito.json +++ b/packages/web3-constants/evm/ito.json @@ -57,8 +57,7 @@ "Celo": "0xaA5bfd7355637eA7405CB194a55303e821c4c569", "Fantom": "0x981be454a930479d92C91a0092D204b64845A5D6", "Aurora": "0x2cf91AD8C175305EBe6970Bd8f81231585EFbd77", - "Aurora_Testnet": "0xdcA6F476EebCDE8FE8b072e3fC80dBC28dC209b3", - "Conflux": "0x066804d9123bf2609ed4a4a40b1177a9c5a9ed51" + "Aurora_Testnet": "0xdcA6F476EebCDE8FE8b072e3fC80dBC28dC209b3" }, "ITO2_CONTRACT_CREATION_BLOCK_HEIGHT": { "Mainnet": 12766513, @@ -78,8 +77,7 @@ "Celo": 10278776, "Fantom": 25071597, "Aurora": 57350598, - "Aurora_Testnet": 77919102, - "Conflux": 37722805 + "Aurora_Testnet": 77919102 }, "DEFAULT_QUALIFICATION_ADDRESS": { "Mainnet": "0x81b6ae377e360dcad63611846a2516f4ba8c88ac", @@ -119,8 +117,7 @@ "Celo": "0x2cB220F925E603A04BEE05F210252120deBA29d7", "Fantom": "0x83D6b366f21e413f214EB077D5378478e71a5eD2", "Aurora": "0x578a7Fee5f0D8CEc7d00578Bf37374C5b95C4b98", - "Aurora_Testnet": "", - "Conflux": "0x05ee315e407c21a594f807d61d6cc11306d1f149" + "Aurora_Testnet": "" }, "SUBGRAPH_URL": { "Mainnet": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-ito-mainnet", diff --git a/packages/web3-constants/evm/lido.json b/packages/web3-constants/evm/lido.json new file mode 100644 index 000000000000..5b88bd5868e3 --- /dev/null +++ b/packages/web3-constants/evm/lido.json @@ -0,0 +1,42 @@ +{ + "LIDO_stETH_ADDRESS": { + "Mainnet": "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "0x1643E812aE58766192Cf7D2Cf9567dF2C37e9B7F", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "LIDO_REFERRAL_ADDRESS": { + "Mainnet": "0x934b510d4c9103e6a87aef13b816fb080286d649", + "Ropsten": "0x934b510d4c9103e6a87aef13b816fb080286d649", + "Rinkeby": "0x934b510d4c9103e6a87aef13b816fb080286d649", + "Kovan": "0x934b510d4c9103e6a87aef13b816fb080286d649", + "Gorli": "0x934b510d4c9103e6a87aef13b816fb080286d649", + "BSC": "0x934b510d4c9103e6a87aef13b816fb080286d649", + "BSCT": "0x934b510d4c9103e6a87aef13b816fb080286d649", + "Matic": "0x934b510d4c9103e6a87aef13b816fb080286d649", + "Mumbai": "0x934b510d4c9103e6a87aef13b816fb080286d649", + "Arbitrum": "0x934b510d4c9103e6a87aef13b816fb080286d649", + "Arbitrum_Rinkeby": "0x934b510d4c9103e6a87aef13b816fb080286d649", + "xDai": "0x934b510d4c9103e6a87aef13b816fb080286d649", + "Avalanche": "0x934b510d4c9103e6a87aef13b816fb080286d649", + "Avalanche_Fuji": "0x934b510d4c9103e6a87aef13b816fb080286d649", + "Celo": "0x934b510d4c9103e6a87aef13b816fb080286d649", + "Fantom": "0x934b510d4c9103e6a87aef13b816fb080286d649", + "Aurora": "0x934b510d4c9103e6a87aef13b816fb080286d649", + "Aurora_Testnet": "0x934b510d4c9103e6a87aef13b816fb080286d649" + } +} diff --git a/packages/web3-constants/evm/nft-red-packet.json b/packages/web3-constants/evm/nft-red-packet.json index b0457542eee0..14f892ec49c5 100644 --- a/packages/web3-constants/evm/nft-red-packet.json +++ b/packages/web3-constants/evm/nft-red-packet.json @@ -17,8 +17,7 @@ "Celo": "", "Fantom": "", "Aurora": "0x05ee315E407C21a594f807D61d6CC11306D1F149", - "Aurora_Testnet": "0x97369fEE7db34E0BfE47861f2ec44b4378d13eB4", - "Conflux": "0x5b966f3a32db9c180843bcb40267a66b73e4f022" + "Aurora_Testnet": "0x97369fEE7db34E0BfE47861f2ec44b4378d13eB4" }, "SUBGRAPH_URL": { "Mainnet": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-nft-red-packet-mainnet", @@ -38,7 +37,6 @@ "Celo": "", "Fantom": "", "Aurora": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-nft-red-packet-aurora", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" } } diff --git a/packages/web3-constants/evm/red-packet.json b/packages/web3-constants/evm/red-packet.json index f88e4a77a16d..d587717e2cd6 100644 --- a/packages/web3-constants/evm/red-packet.json +++ b/packages/web3-constants/evm/red-packet.json @@ -77,8 +77,7 @@ "Celo": "0xAb7B1bE4233A04e5C43a810E75657ECED8E5463B", "Fantom": "0x578a7Fee5f0D8CEc7d00578Bf37374C5b95C4b98", "Aurora": "0x19f179D7e0D7d9F9d5386afFF64271D98A91615B", - "Aurora_Testnet": "0xdB93cCd481012bB5D1E2c8d0aF7C5f2940c00fdC", - "Conflux": "0x96c7d011cdfd467f551605f0f5fce279f86f4186" + "Aurora_Testnet": "0xdB93cCd481012bB5D1E2c8d0aF7C5f2940c00fdC" }, "HAPPY_RED_PACKET_ADDRESS_V4_BLOCK_HEIGHT": { "Mainnet": 12939427, @@ -98,8 +97,7 @@ "Celo": 10413552, "Fantom": 25112473, "Aurora": 57552338, - "Aurora_Testnet": 77918765, - "Conflux": 37670572 + "Aurora_Testnet": 77918765 }, "SUBGRAPH_URL": { "Mainnet": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-red-packet-mainnet", diff --git a/packages/web3-constants/evm/rpc.json b/packages/web3-constants/evm/rpc.json index 5bd061c414bb..54cfb9185c13 100644 --- a/packages/web3-constants/evm/rpc.json +++ b/packages/web3-constants/evm/rpc.json @@ -59,8 +59,7 @@ "Celo": ["https://forno.celo.org"], "Fantom": ["https://rpc.ftm.tools/"], "Aurora": ["https://mainnet.aurora.dev"], - "Aurora_Testnet": ["https://testnet.aurora.dev"], - "Conflux": ["https://evm.confluxrpc.com"] + "Aurora_Testnet": ["https://testnet.aurora.dev"] }, "RPC_WEIGHTS": { "Mainnet": [0, 1, 2, 3, 4], @@ -80,7 +79,6 @@ "Celo": [0, 0, 0, 0, 0], "Fantom": [0, 0, 0, 0, 0], "Aurora": [0, 0, 0, 0, 0], - "Aurora_Testnet": [0, 0, 0, 0, 0], - "Conflux": [0, 0, 0, 0, 0] + "Aurora_Testnet": [0, 0, 0, 0, 0] } } diff --git a/packages/web3-constants/evm/token-asset-base-url.json b/packages/web3-constants/evm/token-asset-base-url.json index 79acb11afe4d..994c1a1189ae 100644 --- a/packages/web3-constants/evm/token-asset-base-url.json +++ b/packages/web3-constants/evm/token-asset-base-url.json @@ -47,7 +47,6 @@ "Celo": [], "Fantom": [], "Aurora": [], - "Aurora_Testnet": [], - "Conflux": [] + "Aurora_Testnet": [] } } diff --git a/packages/web3-constants/evm/token-list.json b/packages/web3-constants/evm/token-list.json index 15193e2a83fb..76b7b8870aee 100644 --- a/packages/web3-constants/evm/token-list.json +++ b/packages/web3-constants/evm/token-list.json @@ -17,7 +17,6 @@ "Celo": ["https://tokens.r2d2.to/latest/42220/tokens.json"], "Fantom": ["https://tokens.r2d2.to/latest/250/tokens.json"], "Aurora": ["https://tokens.r2d2.to/latest/1313161554/tokens.json"], - "Aurora_Testnet": [], - "Conflux": ["https://tokens.r2d2.to/latest/1030/tokens.json"] + "Aurora_Testnet": [] } } diff --git a/packages/web3-constants/evm/token.json b/packages/web3-constants/evm/token.json index df67190f8364..0f711d9f0db0 100644 --- a/packages/web3-constants/evm/token.json +++ b/packages/web3-constants/evm/token.json @@ -17,8 +17,27 @@ "Celo": "0x471EcE3750Da237f93B8E339c536989b8978a438", "Fantom": "0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83", "Aurora": "0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" + }, + "LDO_stETH_ADDRESS": { + "Mainnet": "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "0x1643E812aE58766192Cf7D2Cf9567dF2C37e9B7F", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" }, "USDC_ADDRESS": { "Mainnet": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", @@ -38,8 +57,7 @@ "Celo": "0x2A3684e9Dc20B857375EA04235F2F7edBe818FA7", "Fantom": "0x04068da6c83afcfa0e13ba15a6696662335d5b75", "Aurora": "0xb12bfca5a55806aaf64e99521918a4bf0fc40802", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "USDT_ADDRESS": { "Mainnet": "0xdAC17F958D2ee523a2206206994597C13D831ec7", @@ -59,8 +77,27 @@ "Celo": "0xb020d981420744f6b0fedd22bb67cd37ce18a1d5", "Fantom": "", "Aurora": "0x4988a896b1227218e4a686fde5eabdcabd91571f", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" + }, + "aUSDT_ADDRESS": { + "Mainnet": "0x71fc860F7D3A592A4a98740e39dB31d25db65ae8", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "0x1643E812aE58766192Cf7D2Cf9567dF2C37e9B7F", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" }, "HUSD_ADDRESS": { "Mainnet": "0xdf574c24545e5ffecb9a659c229253d4111d87e1", @@ -80,8 +117,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "BUSD_ADDRESS": { "Mainnet": "0x4fabb145d64652a948d72533023f6e7a623c7c53", @@ -101,8 +137,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "COMP_ADDRESS": { "Mainnet": "0xc00e94Cb662C3520282E6f5717214004A7f26888", @@ -122,8 +157,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "EASY_ADDRESS": { "Mainnet": "", @@ -143,8 +177,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "MKR_ADDRESS": { "Mainnet": "0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2", @@ -164,8 +197,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "MASK_ADDRESS": { "Mainnet": "0x69af81e73A73B40adF4f3d4223Cd9b1ECE623074", @@ -185,8 +217,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "MSKA_ADDRESS": { "Mainnet": "", @@ -206,8 +237,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "MSKB_ADDRESS": { "Mainnet": "", @@ -227,8 +257,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "MSKC_ADDRESS": { "Mainnet": "", @@ -248,8 +277,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "MSKD_ADDRESS": { "Mainnet": "", @@ -269,8 +297,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "MSKE_ADDRESS": { "Mainnet": "", @@ -290,8 +317,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "DAI_ADDRESS": { "Mainnet": "0x6B175474E89094C44Da98b954EedeAC495271d0F", @@ -311,8 +337,7 @@ "Celo": "", "Fantom": "0x8D11eC38a3EB5E956B052f67Da8Bdc9bef8Abf3E", "Aurora": "0xe3520349f477a5f6eb06107066048508498a291b", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "AMPL_ADDRESS": { "Mainnet": "0xD46bA6D942050d489DBd938a2C909A5d5039A161", @@ -332,8 +357,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "OKB_ADDRESS": { "Mainnet": "0x75231F58b43240C9718Dd58B4967c5114342a86c", @@ -353,8 +377,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "UST_ADDRESS": { "Mainnet": "0xa47c8bf37f92aBed4A126BDA807A7b7498661acD", @@ -374,8 +397,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "eUSDC_ADDRESS": { "Mainnet": "", @@ -395,8 +417,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "eUSDT_ADDRESS": { "Mainnet": "", @@ -416,8 +437,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "fUSDT_ADDRESS": { "Mainnet": "", @@ -437,8 +457,7 @@ "Celo": "", "Fantom": "0x049d68029688eAbF473097a2fC38ef61633A3C7A", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "eDAI_ADDRESS": { "Mainnet": "", @@ -458,8 +477,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "UNITOKEN_ADDRESS": { "Mainnet": "", @@ -479,8 +497,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "TT01_ADDRESS": { "Mainnet": "", @@ -500,8 +517,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "TT02_ADDRESS": { "Mainnet": "", @@ -521,8 +537,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "QUICK_ADDRESS": { "Mainnet": "", @@ -542,8 +557,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "WANNA_ADDRESS": { "Mainnet": "", @@ -563,8 +577,7 @@ "Celo": "", "Fantom": "", "Aurora": "0x7faA64Faf54750a2E3eE621166635fEAF406Ab22", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "WBTC_ADDRESS": { "Mainnet": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599", @@ -584,8 +597,7 @@ "Celo": "0xBe50a3013A1c94768A1ABb78c3cB79AB28fc1aCE", "Fantom": "0x321162Cd933E2Be498Cd2267a90534A804051b11", "Aurora": "0xf4eb217ba2454613b15dbdea6e5f22276410e89e", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "IGG_ADDRESS": { "Mainnet": "", @@ -605,8 +617,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "OM_ADDRESS": { "Mainnet": "", @@ -626,8 +637,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "SUSHI_ADDRESS": { "Mainnet": "0x6B3595068778DD592e39A122f4f5a5cF09C90fE2", @@ -647,8 +657,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "YAM_ADDRESS": { "Mainnet": "0x0e2298E3B3390e3b945a5456fBf59eCc3f55DA16", @@ -668,8 +677,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "RUNE_ADDRESS": { "Mainnet": "0x3155BA85D5F96b2d030a4966AF206230e46849cb", @@ -689,8 +697,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "YFI_ADDRESS": { "Mainnet": "0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e", @@ -710,8 +717,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "sUSD_ADDRESS": { "Mainnet": "0x57ab1ec28d129707052df4df418d58a2d46d5f51", @@ -731,8 +737,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "BTCB_ADDRESS": { "Mainnet": "", @@ -752,8 +757,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "CAKE_ADDRESS": { "Mainnet": "", @@ -773,8 +777,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "maUSDC_ADDRESS": { "Mainnet": "", @@ -794,8 +797,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "stETH_ADDRESS": { "Mainnet": "0xDFe66B14D37C77F4E9b180cEb433d1b164f0281D", @@ -815,8 +817,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "NFTX_ADDRESS": { "Mainnet": "0x87d73E916D7057945c9BcD8cdd94e42A6F47f776", @@ -836,8 +837,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "cUSD_ADDRESS": { "Mainnet": "", @@ -857,8 +857,7 @@ "Celo": "0x765de816845861e75a25fca122bb6898b8b1282a", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "cEUR_ADDRESS": { "Mainnet": "", @@ -878,8 +877,7 @@ "Celo": "0x765de816845861e75a25fca122bb6898b8b1282a", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "xTRI_ADDRESS": { "Mainnet": "", @@ -899,8 +897,7 @@ "Celo": "", "Fantom": "", "Aurora": "0x802119e4e253D5C19aA06A5d567C5a41596D6803", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "JOE_ADDRESS": { "Mainnet": "", @@ -920,8 +917,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "PNG_ADDRESS": { "Mainnet": "", @@ -941,8 +937,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "ETHER_ADDRESS": { "Mainnet": "", @@ -962,8 +957,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "NATIVE_TOKEN_ADDRESS": { "Mainnet": "0x0000000000000000000000000000000000000000", @@ -983,7 +977,1066 @@ "Celo": "0x471ece3750da237f93b8e339c536989b8978a438", "Fantom": "0x0000000000000000000000000000000000000000", "Aurora": "0x0000000000000000000000000000000000000000", - "Aurora_Testnet": "", - "Conflux": "0x0000000000000000000000000000000000000000" + "Aurora_Testnet": "" + }, + "WETH_ADDRESS": { + "Mainnet": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aWETH_ADDRESS": { + "Mainnet": "0x030bA81f1c18d280636F32af80b9AAd02Cf0854e", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "ZRX_ADDRESS": { + "Mainnet": "0xE41d2489571d322189246DaFA5ebDe1F4699F498", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aZRX_ADDRESS": { + "Mainnet": "0xDf7FF54aAcAcbFf42dfe29DD6144A69b629f8C9e", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "UNI_ADDRESS": { + "Mainnet": "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aUNI_ADDRESS": { + "Mainnet": "0xB9D7CB55f463405CDfBe4E90a6D2Df01C2B92BF1", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "LIDO_ADDRESS": { + "Mainnet": "0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "0x56340274fB5a72af1A3C6609061c451De7961Bd4", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "AAVE_ADDRESS": { + "Mainnet": "0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aAAVE_ADDRESS": { + "Mainnet": "0xFFC97d72E13E01096502Cb8Eb52dEe56f74DAD7B", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "BAT_ADDRESS": { + "Mainnet": "0x0D8775F648430679A709E98d2b0Cb6250d2887EF", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aBAT_ADDRESS": { + "Mainnet": "0x05Ec93c0365baAeAbF7AefFb0972ea7ECdD39CF1", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "ENJ_ADDRESS": { + "Mainnet": "0xF629cBd94d3791C9250152BD8dfBDF380E2a3B9c", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aENJ_ADDRESS": { + "Mainnet": "0xaC6Df26a590F08dcC95D5a4705ae8abbc88509Ef", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "KNC_ADDRESS": { + "Mainnet": "0xdd974D5C2e2928deA5F71b9825b8b646686BD200", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aKNC_ADDRESS": { + "Mainnet": "0x39C6b3e42d6A679d7D776778Fe880BC9487C2EDA", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "LINK_ADDRESS": { + "Mainnet": "0x514910771AF9Ca656af840dff83E8264EcF986CA", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aLINK_ADDRESS": { + "Mainnet": "0xa06bC25B5805d5F8d82847D191Cb4Af5A3e873E0", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "MANA_ADDRESS": { + "Mainnet": "0x0F5D2fB29fb7d3CFeE444a200298f468908cC942", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aMANA_ADDRESS": { + "Mainnet": "0xa685a61171bb30d4072B338c80Cb7b2c865c873E", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "REN_ADDRESS": { + "Mainnet": "0x408e41876cCCDC0F92210600ef50372656052a38", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aREN_ADDRESS": { + "Mainnet": "0xCC12AbE4ff81c9378D670De1b57F8e0Dd228D77a", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "SNX_ADDRESS": { + "Mainnet": "0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aSNX_ADDRESS": { + "Mainnet": "0x35f6B052C598d933D69A4EEC4D04c73A191fE6c2", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "TUSD_ADDRESS": { + "Mainnet": "0x0000000000085d4780B73119b644AE5ecd22b376", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aTUSD_ADDRESS": { + "Mainnet": "0x101cc05f4A51C0319f570d5E146a8C625198e636", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "CRV_ADDRESS": { + "Mainnet": "0xD533a949740bb3306d119CC777fa900bA034cd52", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aCRV_ADDRESS": { + "Mainnet": "0x8dAE6Cb04688C62d939ed9B68d32Bc62e49970b1", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "GUSD_ADDRESS": { + "Mainnet": "0x056Fd409E1d7A124BD7017459dFEa2F387b6d5Cd", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aGUSD_ADDRESS": { + "Mainnet": "0xD37EE7e4f452C6638c96536e68090De8cBcdb583", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "BAL_ADDRESS": { + "Mainnet": "0xba100000625a3754423978a60c9317c58a424e3D", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aBAL_ADDRESS": { + "Mainnet": "0x272F97b7a56a387aE942350bBC7Df5700f8a4576", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "xSUSHI_ADDRESS": { + "Mainnet": "0x8798249c2E607446EfB7Ad49eC89dD1865Ff4272", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aXSUSHI_ADDRESS": { + "Mainnet": "0xF256CC7847E919FAc9B808cC216cAc87CCF2f47a", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "renFIL_ADDRESS": { + "Mainnet": "0xD5147bc8e386d91Cc5DBE72099DAC6C9b99276F5", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aRENFIL_ADDRESS": { + "Mainnet": "0x514cd6756CCBe28772d4Cb81bC3156BA9d1744aa", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "RAI_ADDRESS": { + "Mainnet": "0x03ab458634910AaD20eF5f1C8ee96F1D6ac54919", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aRAI_ADDRESS": { + "Mainnet": "0xc9BC48c72154ef3e5425641a3c747242112a46AF", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "USDP_ADDRESS": { + "Mainnet": "0x8E870D67F660D95d5be530380D0eC0bd388289E1", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aUSDP_ADDRESS": { + "Mainnet": "0x2e8F4bdbE3d47d7d7DE490437AeA9915D930F1A3", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "DPI_ADDRESS": { + "Mainnet": "0x1494CA1F11D487c2bBe4543E90080AeBa4BA3C2b", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aDPI_ADDRESS": { + "Mainnet": "0x6F634c6135D2EBD550000ac92F494F9CB8183dAe", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "FRAX_ADDRESS": { + "Mainnet": "0x853d955aCEf822Db058eb8505911ED77F175b99e", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aFRAX_ADDRESS": { + "Mainnet": "0xd4937682df3C8aEF4FE912A96A74121C0829E664", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "FEI_ADDRESS": { + "Mainnet": "0x956F47F50A910163D8BF957Cf5846D573E7f87CA", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aFEI_ADDRESS": { + "Mainnet": "0x683923dB55Fead99A79Fa01A27EeC3cB19679cC3", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aWBTC_ADDRESS": { + "Mainnet": "0x9ff58f4fFB29fA2266Ab25e75e2A8b3503311656", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aYFI_ADDRESS": { + "Mainnet": "0x5165d24277cD063F5ac44Efd447B27025e888f37", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aBUSD_ADDRESS": { + "Mainnet": "0xA361718326c15715591c299427c62086F69923D9", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aDAI_ADDRESS": { + "Mainnet": "0x028171bCA77440897B824Ca71D1c56caC55b68A3", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aMKR_ADDRESS": { + "Mainnet": "0xc713e5E149D5D0715DcD1c156a020976e7E56B88", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aSUSD_ADDRESS": { + "Mainnet": "0x6C5024Cd4F8A59110119C56f8933403A539555EB", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aUSDC_ADDRESS": { + "Mainnet": "0xBcca60bB61934080951369a648Fb03DF4F96263C", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" + }, + "aAMPL_ADDRESS": { + "Mainnet": "0x1E6bb68Acec8fefBD87D192bE09bb274170a0548", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "" } } diff --git a/packages/web3-constants/evm/trader.json b/packages/web3-constants/evm/trader.json index e8cac04eca46..be8dcb28d3fb 100644 --- a/packages/web3-constants/evm/trader.json +++ b/packages/web3-constants/evm/trader.json @@ -17,8 +17,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "UNISWAP_V2_FACTORY_ADDRESS": { "Mainnet": "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f", @@ -38,8 +37,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "UNISWAP_V2_THEGRAPH": { "Mainnet": "https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2", @@ -59,8 +57,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "UNISWAP_V2_INIT_CODE_HASH": { "Mainnet": "0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f", @@ -80,8 +77,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "UNISWAP_SWAP_ROUTER_ADDRESS": { "Mainnet": "0xe592427a0aece92de3edee1f18e0157c05861564", @@ -101,8 +97,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "UNISWAP_V3_FACTORY_ADDRESS": { "Mainnet": "0x1F98431c8aD98523631AE4a59f267346ea31F984", @@ -122,8 +117,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "UNISWAP_V3_QUOTER_ADDRESS": { "Mainnet": "0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6", @@ -143,8 +137,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "UNISWAP_V3_THEGRAPH": { "Mainnet": "https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v3", @@ -164,8 +157,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "UNISWAP_V3_INIT_CODE_HASH": { "Mainnet": "0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54", @@ -185,8 +177,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "SUSHISWAP_ROUTER_ADDRESS": { "Mainnet": "0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F", @@ -206,8 +197,7 @@ "Celo": "0x1421bDe4B10e8dd459b3BCb598810B1337D56842", "Fantom": "0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506", "Aurora": "0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "SUSHISWAP_FACTORY_ADDRESS": { "Mainnet": "0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac", @@ -227,8 +217,7 @@ "Celo": "0xc35DADB65012eC5796536bD9864eD8773aBc74C4", "Fantom": "0xc35DADB65012eC5796536bD9864eD8773aBc74C4", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "SUSHISWAP_THEGRAPH": { "Mainnet": "https://api.thegraph.com/subgraphs/name/zippoxer/sushiswap-subgraph-fork", @@ -248,8 +237,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "SUSHISWAP_INIT_CODE_HASH": { "Mainnet": "0xe18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303", @@ -269,8 +257,7 @@ "Celo": "0xe18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303", "Fantom": "0xe18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "SASHIMISWAP_ROUTER_ADDRESS": { "Mainnet": "0xe4fe6a45f354e845f954cddee6084603cedb9410", @@ -290,8 +277,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "SASHIMISWAP_FACTORY_ADDRESS": { "Mainnet": "0xF028F723ED1D0fE01cC59973C49298AA95c57472", @@ -311,8 +297,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "SASHIMISWAP_THEGRAPH": { "Mainnet": "https://api.thegraph.com/subgraphs/name/sashimiproject/sashimi", @@ -332,8 +317,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "SASHIMISWAP_INIT_CODE_HASH": { "Mainnet": "0xb465bbe4edb8c9b0da8ff0b2b36ce0065de9fcd5a33f32c6856ea821779c8b72", @@ -353,8 +337,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "QUICKSWAP_ROUTER_ADDRESS": { "Mainnet": "", @@ -374,8 +357,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "QUICKSWAP_FACTORY_ADDRESS": { "Mainnet": "", @@ -395,8 +377,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "QUICKSWAP_THEGRAPH": { "Mainnet": "", @@ -416,8 +397,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "QUICKSWAP_INIT_CODE_HASH": { "Mainnet": "", @@ -437,8 +417,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "PANCAKESWAP_ROUTER_ADDRESS": { "Mainnet": "", @@ -458,8 +437,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "PANCAKESWAP_FACTORY_ADDRESS": { "Mainnet": "", @@ -479,8 +457,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "PANCAKESWAP_THEGRAPH": { "Mainnet": "", @@ -500,8 +477,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "PANCAKESWAP_INIT_CODE_HASH": { "Mainnet": "", @@ -521,8 +497,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "BALANCER_ETH_ADDRESS": { "Mainnet": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", @@ -542,8 +517,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "BALANCER_EXCHANGE_PROXY_ADDRESS": { "Mainnet": "0x3E66B66Fd1d0b02fDa6C811Da9E0547970DB2f21", @@ -563,8 +537,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "BALANCER_POOLS_URL": { "Mainnet": "https://ipfs.fleek.co/ipns/balancer-bucket.storage.fleek.co/balancer-exchange/pools", @@ -584,8 +557,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "DODO_ETH_ADDRESS": { "Mainnet": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", @@ -605,8 +577,7 @@ "Celo": "", "Fantom": "", "Aurora": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "DODO_EXCHANGE_PROXY_ADDRESS": { "Mainnet": "0xCB859eA579b28e02B87A1FDE08d087ab9dbE5149", @@ -626,8 +597,7 @@ "Celo": "", "Fantom": "", "Aurora": "0x335aC99bb3E51BDbF22025f092Ebc1Cf2c5cC619", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "BANCOR_ETH_ADDRESS": { "Mainnet": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", @@ -647,8 +617,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "BANCOR_EXCHANGE_PROXY_ADDRESS": { "Mainnet": "0x2F9EC37d6CcFFf1caB21733BdaDEdE11c823cCB0", @@ -668,8 +637,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "TRADERJOE_ROUTER_ADDRESS": { "Mainnet": "", @@ -689,8 +657,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "TRADERJOE_FACTORY_ADDRESS": { "Mainnet": "", @@ -710,8 +677,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "TRADERJOE_THEGRAPH": { "Mainnet": "https://api.thegraph.com/subgraphs/name/traderjoe-xyz/exchange", @@ -731,8 +697,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "TRADERJOE_INIT_CODE_HASH": { "Mainnet": "", @@ -752,8 +717,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "OPENOCEAN_ETH_ADDRESS": { "Mainnet": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", @@ -773,8 +737,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "OPENOCEAN_EXCHANGE_PROXY_ADDRESS": { "Mainnet": "0x6352a56caadC4F1E25CD6c75970Fa768A3304e64", @@ -794,8 +757,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "PANGOLIN_ROUTER_ADDRESS": { "Mainnet": "", @@ -815,8 +777,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "PANGOLIN_FACTORY_ADDRESS": { "Mainnet": "", @@ -836,8 +797,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "PANGOLIN_THEGRAPH": { "Mainnet": "", @@ -857,8 +817,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "PANGOLIN_INIT_CODE_HASH": { "Mainnet": "", @@ -878,8 +837,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "WANNASWAP_ROUTER_V2_ADDRESS": { "Mainnet": "", @@ -899,8 +857,7 @@ "Celo": "", "Fantom": "", "Aurora": "0xa3a1eF5Ae6561572023363862e238aFA84C72ef5", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "WANNASWAP_ROUTER_ADDRESS": { "Mainnet": "", @@ -920,8 +877,7 @@ "Celo": "", "Fantom": "", "Aurora": "0x8f1E0Cf0f9f269Bc977C38635E560aa5b0E63323", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "WANNASWAP_FACTORY_ADDRESS": { "Mainnet": "", @@ -941,8 +897,7 @@ "Celo": "", "Fantom": "", "Aurora": "0x7928D4FeA7b2c90C732c10aFF59cf403f0C38246", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "WANNASWAP_THEGRAPH": { "Mainnet": "", @@ -962,8 +917,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "WANNASWAP_INIT_CODE_HASH": { "Mainnet": "", @@ -983,8 +937,7 @@ "Celo": "", "Fantom": "", "Aurora": "0xa06b8b0642cf6a9298322d0c8ac3c68c291ca24dc66245cf23aa2abc33b57e21", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "TRISOLARIS_ROUTER_ADDRESS": { "Mainnet": "", @@ -1004,8 +957,7 @@ "Celo": "", "Fantom": "", "Aurora": "0x2CB45Edb4517d5947aFdE3BEAbF95A582506858B", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "TRISOLARIS_FACTORY_ADDRESS": { "Mainnet": "", @@ -1025,8 +977,7 @@ "Celo": "", "Fantom": "", "Aurora": "0xc66F594268041dB60507F00703b152492fb176E7", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "TRISOLARIS_THEGRAPH": { "Mainnet": "", @@ -1046,8 +997,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "TRISOLARIS_INIT_CODE_HASH": { "Mainnet": "", @@ -1067,8 +1017,7 @@ "Celo": "", "Fantom": "", "Aurora": "0x754e1d90e536e4c1df81b7f030f47b4ca80c87120e145c294f098c83a6cb5ace", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "MDEX_ROUTER_ADDRESS": { "Mainnet": "0x74119c3bca85bEA0538A62319a79b4a372590B47", @@ -1088,8 +1037,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "MDEX_FACTORY_ADDRESS": { "Mainnet": "0x7DAe51BD3E3376B8c7c4900E9107f12Be3AF1bA8", @@ -1109,8 +1057,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "MDEX_THEGRAPH": { "Mainnet": "", @@ -1130,8 +1077,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "MDEX_INIT_CODE_HASH": { "Mainnet": "0x8ecc069c645df696f2ca5116ab459c5c2889f299e73c1b208aaa3cdd7d110b16", @@ -1151,7 +1097,6 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" } } diff --git a/packages/web3-constants/evm/zerion.json b/packages/web3-constants/evm/zerion.json index 7ccce157682d..e0d70150b37f 100644 --- a/packages/web3-constants/evm/zerion.json +++ b/packages/web3-constants/evm/zerion.json @@ -17,8 +17,7 @@ "Celo": "celo-assets", "Fantom": "fantom-assets", "Aurora": "aurora-assets", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" }, "TRANSACTIONS_SCOPE_NAME": { "Mainnet": "transactions", @@ -38,7 +37,6 @@ "Celo": "celo-transactions", "Fantom": "fantom-transactions", "Aurora": "aurora-transactions", - "Aurora_Testnet": "", - "Conflux": "" + "Aurora_Testnet": "" } } diff --git a/packages/web3-contracts/abis/AaveLendingPool.json b/packages/web3-contracts/abis/AaveLendingPool.json new file mode 100644 index 000000000000..1c3250f32ba7 --- /dev/null +++ b/packages/web3-contracts/abis/AaveLendingPool.json @@ -0,0 +1,1079 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "onBehalfOf", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "borrowRateMode", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "borrowRate", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint16", + "name": "referral", + "type": "uint16" + } + ], + "name": "Borrow", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "onBehalfOf", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint16", + "name": "referral", + "type": "uint16" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "initiator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "premium", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "referralCode", + "type": "uint16" + } + ], + "name": "FlashLoan", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "collateralAsset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "debtAsset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "debtToCover", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidatedCollateralAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "receiveAToken", + "type": "bool" + } + ], + "name": "LiquidationCall", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "RebalanceStableBorrowRate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "repayer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Repay", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidityRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "stableBorrowRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "variableBorrowRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidityIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "variableBorrowIndex", + "type": "uint256" + } + ], + "name": "ReserveDataUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "ReserveUsedAsCollateralDisabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "ReserveUsedAsCollateralEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rateMode", + "type": "uint256" + } + ], + "name": "Swap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Withdraw", + "type": "event" + }, + { + "inputs": [], + "name": "FLASHLOAN_PREMIUM_TOTAL", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "LENDINGPOOL_REVISION", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_NUMBER_RESERVES", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_STABLE_RATE_BORROW_SIZE_PERCENT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "interestRateMode", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "referralCode", + "type": "uint16" + }, + { + "internalType": "address", + "name": "onBehalfOf", + "type": "address" + } + ], + "name": "borrow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "onBehalfOf", + "type": "address" + }, + { + "internalType": "uint16", + "name": "referralCode", + "type": "uint16" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balanceFromBefore", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balanceToBefore", + "type": "uint256" + } + ], + "name": "finalizeTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiverAddress", + "type": "address" + }, + { + "internalType": "address[]", + "name": "assets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "modes", + "type": "uint256[]" + }, + { + "internalType": "address", + "name": "onBehalfOf", + "type": "address" + }, + { + "internalType": "bytes", + "name": "params", + "type": "bytes" + }, + { + "internalType": "uint16", + "name": "referralCode", + "type": "uint16" + } + ], + "name": "flashLoan", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getAddressesProvider", + "outputs": [ + { + "internalType": "contract ILendingPoolAddressesProvider", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "getConfiguration", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "data", + "type": "uint256" + } + ], + "internalType": "struct DataTypes.ReserveConfigurationMap", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "getReserveData", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "uint256", + "name": "data", + "type": "uint256" + } + ], + "internalType": "struct DataTypes.ReserveConfigurationMap", + "name": "configuration", + "type": "tuple" + }, + { + "internalType": "uint128", + "name": "liquidityIndex", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "variableBorrowIndex", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "currentLiquidityRate", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "currentVariableBorrowRate", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "currentStableBorrowRate", + "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": "uint8", + "name": "id", + "type": "uint8" + } + ], + "internalType": "struct DataTypes.ReserveData", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "getReserveNormalizedIncome", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "getReserveNormalizedVariableDebt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getReservesList", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "getUserAccountData", + "outputs": [ + { + "internalType": "uint256", + "name": "totalCollateralETH", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalDebtETH", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "availableBorrowsETH", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "currentLiquidationThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ltv", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "healthFactor", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "getUserConfiguration", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "data", + "type": "uint256" + } + ], + "internalType": "struct DataTypes.UserConfigurationMap", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "address", + "name": "aTokenAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "stableDebtAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "variableDebtAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "interestRateStrategyAddress", + "type": "address" + } + ], + "name": "initReserve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ILendingPoolAddressesProvider", + "name": "provider", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateralAsset", + "type": "address" + }, + { + "internalType": "address", + "name": "debtAsset", + "type": "address" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "uint256", + "name": "debtToCover", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "receiveAToken", + "type": "bool" + } + ], + "name": "liquidationCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "rebalanceStableBorrowRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rateMode", + "type": "uint256" + }, + { + "internalType": "address", + "name": "onBehalfOf", + "type": "address" + } + ], + "name": "repay", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "uint256", + "name": "configuration", + "type": "uint256" + } + ], + "name": "setConfiguration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "val", + "type": "bool" + } + ], + "name": "setPause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "address", + "name": "rateStrategyAddress", + "type": "address" + } + ], + "name": "setReserveInterestRateStrategyAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "bool", + "name": "useAsCollateral", + "type": "bool" + } + ], + "name": "setUserUseReserveAsCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "uint256", + "name": "rateMode", + "type": "uint256" + } + ], + "name": "swapBorrowRateMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "withdraw", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/packages/web3-contracts/abis/AaveLendingPoolAddressProvider.json b/packages/web3-contracts/abis/AaveLendingPoolAddressProvider.json new file mode 100644 index 000000000000..33baf06e9a14 --- /dev/null +++ b/packages/web3-contracts/abis/AaveLendingPoolAddressProvider.json @@ -0,0 +1,476 @@ +[ + { + "inputs": [ + { + "internalType": "string", + "name": "marketId", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "hasProxy", + "type": "bool" + } + ], + "name": "AddressSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "ConfigurationAdminUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "EmergencyAdminUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "LendingPoolCollateralManagerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "LendingPoolConfiguratorUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "LendingPoolUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "LendingRateOracleUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "newMarketId", + "type": "string" + } + ], + "name": "MarketIdSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "PriceOracleUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "ProxyCreated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "getAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getEmergencyAdmin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getLendingPool", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getLendingPoolCollateralManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getLendingPoolConfigurator", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getLendingRateOracle", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getMarketId", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPoolAdmin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPriceOracle", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "setAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "implementationAddress", + "type": "address" + } + ], + "name": "setAddressAsProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "emergencyAdmin", + "type": "address" + } + ], + "name": "setEmergencyAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "manager", + "type": "address" + } + ], + "name": "setLendingPoolCollateralManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "configurator", + "type": "address" + } + ], + "name": "setLendingPoolConfiguratorImpl", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + } + ], + "name": "setLendingPoolImpl", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "lendingRateOracle", + "type": "address" + } + ], + "name": "setLendingRateOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "marketId", + "type": "string" + } + ], + "name": "setMarketId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "admin", + "type": "address" + } + ], + "name": "setPoolAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "priceOracle", + "type": "address" + } + ], + "name": "setPriceOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/packages/web3-contracts/abis/AaveProtocolDataProvider.json b/packages/web3-contracts/abis/AaveProtocolDataProvider.json new file mode 100644 index 000000000000..5a1f00ca2e73 --- /dev/null +++ b/packages/web3-contracts/abis/AaveProtocolDataProvider.json @@ -0,0 +1,297 @@ +[ + { + "inputs": [ + { + "internalType": "contract ILendingPoolAddressesProvider", + "name": "addressesProvider", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "ADDRESSES_PROVIDER", + "outputs": [ + { + "internalType": "contract ILendingPoolAddressesProvider", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllATokens", + "outputs": [ + { + "components": [ + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + } + ], + "internalType": "struct AaveProtocolDataProvider.TokenData[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllReservesTokens", + "outputs": [ + { + "components": [ + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + } + ], + "internalType": "struct AaveProtocolDataProvider.TokenData[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "getReserveConfigurationData", + "outputs": [ + { + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ltv", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationBonus", + "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" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "getReserveData", + "outputs": [ + { + "internalType": "uint256", + "name": "availableLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalStableDebt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalVariableDebt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidityRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "variableBorrowRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stableBorrowRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "averageStableBorrowRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidityIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "variableBorrowIndex", + "type": "uint256" + }, + { + "internalType": "uint40", + "name": "lastUpdateTimestamp", + "type": "uint40" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "getReserveTokensAddresses", + "outputs": [ + { + "internalType": "address", + "name": "aTokenAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "stableDebtTokenAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "variableDebtTokenAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "getUserReserveData", + "outputs": [ + { + "internalType": "uint256", + "name": "currentATokenBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "currentStableDebt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "currentVariableDebt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "principalStableDebt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "scaledVariableDebt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stableBorrowRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidityRate", + "type": "uint256" + }, + { + "internalType": "uint40", + "name": "stableRateLastUpdated", + "type": "uint40" + }, + { + "internalType": "bool", + "name": "usageAsCollateralEnabled", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/packages/web3-contracts/abis/AaveStableDebtToken.json b/packages/web3-contracts/abis/AaveStableDebtToken.json new file mode 100644 index 000000000000..b99658486c2e --- /dev/null +++ b/packages/web3-contracts/abis/AaveStableDebtToken.json @@ -0,0 +1,323 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "currentBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balanceIncrease", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "avgStableRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newTotalSupply", + "type": "uint256" + } + ], + "name": "Burn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "onBehalfOf", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "currentBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balanceIncrease", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "avgStableRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newTotalSupply", + "type": "uint256" + } + ], + "name": "Mint", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approveDelegation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "fromUser", + "type": "address" + }, + { + "internalType": "address", + "name": "toUser", + "type": "address" + } + ], + "name": "borrowAllowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getAverageStableRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSupplyData", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint40", + "name": "", + "type": "uint40" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTotalSupplyAndAvgRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTotalSupplyLastUpdated", + "outputs": [ + { + "internalType": "uint40", + "name": "", + "type": "uint40" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "getUserLastUpdated", + "outputs": [ + { + "internalType": "uint40", + "name": "", + "type": "uint40" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "getUserStableRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "address", + "name": "onBehalfOf", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rate", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "principalBalanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/packages/web3-contracts/types/AaveLendingPool.d.ts b/packages/web3-contracts/types/AaveLendingPool.d.ts new file mode 100644 index 000000000000..927c8b6d8bc9 --- /dev/null +++ b/packages/web3-contracts/types/AaveLendingPool.d.ts @@ -0,0 +1,363 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import BN from 'bn.js' +import { ContractOptions } from 'web3-eth-contract' +import { EventLog } from 'web3-core' +import { EventEmitter } from 'events' +import { + Callback, + PayableTransactionObject, + NonPayableTransactionObject, + BlockType, + ContractEventLog, + BaseContract, +} from './types' + +export interface EventOptions { + filter?: object + fromBlock?: BlockType + topics?: string[] +} + +export type Borrow = ContractEventLog<{ + reserve: string + user: string + onBehalfOf: string + amount: string + borrowRateMode: string + borrowRate: string + referral: string + 0: string + 1: string + 2: string + 3: string + 4: string + 5: string + 6: string +}> +export type Deposit = ContractEventLog<{ + reserve: string + user: string + onBehalfOf: string + amount: string + referral: string + 0: string + 1: string + 2: string + 3: string + 4: string +}> +export type FlashLoan = ContractEventLog<{ + target: string + initiator: string + asset: string + amount: string + premium: string + referralCode: string + 0: string + 1: string + 2: string + 3: string + 4: string + 5: string +}> +export type LiquidationCall = ContractEventLog<{ + collateralAsset: string + debtAsset: string + user: string + debtToCover: string + liquidatedCollateralAmount: string + liquidator: string + receiveAToken: boolean + 0: string + 1: string + 2: string + 3: string + 4: string + 5: string + 6: boolean +}> +export type Paused = ContractEventLog<{}> +export type RebalanceStableBorrowRate = ContractEventLog<{ + reserve: string + user: string + 0: string + 1: string +}> +export type Repay = ContractEventLog<{ + reserve: string + user: string + repayer: string + amount: string + 0: string + 1: string + 2: string + 3: string +}> +export type ReserveDataUpdated = ContractEventLog<{ + reserve: string + liquidityRate: string + stableBorrowRate: string + variableBorrowRate: string + liquidityIndex: string + variableBorrowIndex: string + 0: string + 1: string + 2: string + 3: string + 4: string + 5: string +}> +export type ReserveUsedAsCollateralDisabled = ContractEventLog<{ + reserve: string + user: string + 0: string + 1: string +}> +export type ReserveUsedAsCollateralEnabled = ContractEventLog<{ + reserve: string + user: string + 0: string + 1: string +}> +export type Swap = ContractEventLog<{ + reserve: string + user: string + rateMode: string + 0: string + 1: string + 2: string +}> +export type Unpaused = ContractEventLog<{}> +export type Withdraw = ContractEventLog<{ + reserve: string + user: string + to: string + amount: string + 0: string + 1: string + 2: string + 3: string +}> + +export interface AaveLendingPool extends BaseContract { + constructor(jsonInterface: any[], address?: string, options?: ContractOptions): AaveLendingPool + clone(): AaveLendingPool + methods: { + FLASHLOAN_PREMIUM_TOTAL(): NonPayableTransactionObject + + LENDINGPOOL_REVISION(): NonPayableTransactionObject + + MAX_NUMBER_RESERVES(): NonPayableTransactionObject + + MAX_STABLE_RATE_BORROW_SIZE_PERCENT(): NonPayableTransactionObject + + borrow( + asset: string, + amount: number | string | BN, + interestRateMode: number | string | BN, + referralCode: number | string | BN, + onBehalfOf: string, + ): NonPayableTransactionObject + + deposit( + asset: string, + amount: number | string | BN, + onBehalfOf: string, + referralCode: number | string | BN, + ): NonPayableTransactionObject + + finalizeTransfer( + asset: string, + from: string, + to: string, + amount: number | string | BN, + balanceFromBefore: number | string | BN, + balanceToBefore: number | string | BN, + ): NonPayableTransactionObject + + flashLoan( + receiverAddress: string, + assets: string[], + amounts: (number | string | BN)[], + modes: (number | string | BN)[], + onBehalfOf: string, + params: string | number[], + referralCode: number | string | BN, + ): NonPayableTransactionObject + + getAddressesProvider(): NonPayableTransactionObject + + getConfiguration(asset: string): NonPayableTransactionObject<[string]> + + getReserveData( + asset: string, + ): NonPayableTransactionObject< + [[string], string, string, string, string, string, string, string, string, string, string, string] + > + + getReserveNormalizedIncome(asset: string): NonPayableTransactionObject + + getReserveNormalizedVariableDebt(asset: string): NonPayableTransactionObject + + getReservesList(): NonPayableTransactionObject + + getUserAccountData(user: string): NonPayableTransactionObject<{ + totalCollateralETH: string + totalDebtETH: string + availableBorrowsETH: string + currentLiquidationThreshold: string + ltv: string + healthFactor: string + 0: string + 1: string + 2: string + 3: string + 4: string + 5: string + }> + + getUserConfiguration(user: string): NonPayableTransactionObject<[string]> + + initReserve( + asset: string, + aTokenAddress: string, + stableDebtAddress: string, + variableDebtAddress: string, + interestRateStrategyAddress: string, + ): NonPayableTransactionObject + + initialize(provider: string): NonPayableTransactionObject + + liquidationCall( + collateralAsset: string, + debtAsset: string, + user: string, + debtToCover: number | string | BN, + receiveAToken: boolean, + ): NonPayableTransactionObject + + paused(): NonPayableTransactionObject + + rebalanceStableBorrowRate(asset: string, user: string): NonPayableTransactionObject + + repay( + asset: string, + amount: number | string | BN, + rateMode: number | string | BN, + onBehalfOf: string, + ): NonPayableTransactionObject + + setConfiguration(asset: string, configuration: number | string | BN): NonPayableTransactionObject + + setPause(val: boolean): NonPayableTransactionObject + + setReserveInterestRateStrategyAddress( + asset: string, + rateStrategyAddress: string, + ): NonPayableTransactionObject + + setUserUseReserveAsCollateral(asset: string, useAsCollateral: boolean): NonPayableTransactionObject + + swapBorrowRateMode(asset: string, rateMode: number | string | BN): NonPayableTransactionObject + + withdraw(asset: string, amount: number | string | BN, to: string): NonPayableTransactionObject + } + events: { + Borrow(cb?: Callback): EventEmitter + Borrow(options?: EventOptions, cb?: Callback): EventEmitter + + Deposit(cb?: Callback): EventEmitter + Deposit(options?: EventOptions, cb?: Callback): EventEmitter + + FlashLoan(cb?: Callback): EventEmitter + FlashLoan(options?: EventOptions, cb?: Callback): EventEmitter + + LiquidationCall(cb?: Callback): EventEmitter + LiquidationCall(options?: EventOptions, cb?: Callback): EventEmitter + + Paused(cb?: Callback): EventEmitter + Paused(options?: EventOptions, cb?: Callback): EventEmitter + + RebalanceStableBorrowRate(cb?: Callback): EventEmitter + RebalanceStableBorrowRate(options?: EventOptions, cb?: Callback): EventEmitter + + Repay(cb?: Callback): EventEmitter + Repay(options?: EventOptions, cb?: Callback): EventEmitter + + ReserveDataUpdated(cb?: Callback): EventEmitter + ReserveDataUpdated(options?: EventOptions, cb?: Callback): EventEmitter + + ReserveUsedAsCollateralDisabled(cb?: Callback): EventEmitter + ReserveUsedAsCollateralDisabled( + options?: EventOptions, + cb?: Callback, + ): EventEmitter + + ReserveUsedAsCollateralEnabled(cb?: Callback): EventEmitter + ReserveUsedAsCollateralEnabled( + options?: EventOptions, + cb?: Callback, + ): EventEmitter + + Swap(cb?: Callback): EventEmitter + Swap(options?: EventOptions, cb?: Callback): EventEmitter + + Unpaused(cb?: Callback): EventEmitter + Unpaused(options?: EventOptions, cb?: Callback): EventEmitter + + Withdraw(cb?: Callback): EventEmitter + Withdraw(options?: EventOptions, cb?: Callback): EventEmitter + + allEvents(options?: EventOptions, cb?: Callback): EventEmitter + } + + once(event: 'Borrow', cb: Callback): void + once(event: 'Borrow', options: EventOptions, cb: Callback): void + + once(event: 'Deposit', cb: Callback): void + once(event: 'Deposit', options: EventOptions, cb: Callback): void + + once(event: 'FlashLoan', cb: Callback): void + once(event: 'FlashLoan', options: EventOptions, cb: Callback): void + + once(event: 'LiquidationCall', cb: Callback): void + once(event: 'LiquidationCall', options: EventOptions, cb: Callback): void + + once(event: 'Paused', cb: Callback): void + once(event: 'Paused', options: EventOptions, cb: Callback): void + + once(event: 'RebalanceStableBorrowRate', cb: Callback): void + once(event: 'RebalanceStableBorrowRate', options: EventOptions, cb: Callback): void + + once(event: 'Repay', cb: Callback): void + once(event: 'Repay', options: EventOptions, cb: Callback): void + + once(event: 'ReserveDataUpdated', cb: Callback): void + once(event: 'ReserveDataUpdated', options: EventOptions, cb: Callback): void + + once(event: 'ReserveUsedAsCollateralDisabled', cb: Callback): void + once( + event: 'ReserveUsedAsCollateralDisabled', + options: EventOptions, + cb: Callback, + ): void + + once(event: 'ReserveUsedAsCollateralEnabled', cb: Callback): void + once( + event: 'ReserveUsedAsCollateralEnabled', + options: EventOptions, + cb: Callback, + ): void + + once(event: 'Swap', cb: Callback): void + once(event: 'Swap', options: EventOptions, cb: Callback): void + + once(event: 'Unpaused', cb: Callback): void + once(event: 'Unpaused', options: EventOptions, cb: Callback): void + + once(event: 'Withdraw', cb: Callback): void + once(event: 'Withdraw', options: EventOptions, cb: Callback): void +} diff --git a/packages/web3-contracts/types/AaveLendingPoolAddressProvider.d.ts b/packages/web3-contracts/types/AaveLendingPoolAddressProvider.d.ts new file mode 100644 index 000000000000..1b04de4f3b88 --- /dev/null +++ b/packages/web3-contracts/types/AaveLendingPoolAddressProvider.d.ts @@ -0,0 +1,208 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import BN from 'bn.js' +import { ContractOptions } from 'web3-eth-contract' +import { EventLog } from 'web3-core' +import { EventEmitter } from 'events' +import { + Callback, + PayableTransactionObject, + NonPayableTransactionObject, + BlockType, + ContractEventLog, + BaseContract, +} from './types' + +export interface EventOptions { + filter?: object + fromBlock?: BlockType + topics?: string[] +} + +export type AddressSet = ContractEventLog<{ + id: string + newAddress: string + hasProxy: boolean + 0: string + 1: string + 2: boolean +}> +export type ConfigurationAdminUpdated = ContractEventLog<{ + newAddress: string + 0: string +}> +export type EmergencyAdminUpdated = ContractEventLog<{ + newAddress: string + 0: string +}> +export type LendingPoolCollateralManagerUpdated = ContractEventLog<{ + newAddress: string + 0: string +}> +export type LendingPoolConfiguratorUpdated = ContractEventLog<{ + newAddress: string + 0: string +}> +export type LendingPoolUpdated = ContractEventLog<{ + newAddress: string + 0: string +}> +export type LendingRateOracleUpdated = ContractEventLog<{ + newAddress: string + 0: string +}> +export type MarketIdSet = ContractEventLog<{ + newMarketId: string + 0: string +}> +export type OwnershipTransferred = ContractEventLog<{ + previousOwner: string + newOwner: string + 0: string + 1: string +}> +export type PriceOracleUpdated = ContractEventLog<{ + newAddress: string + 0: string +}> +export type ProxyCreated = ContractEventLog<{ + id: string + newAddress: string + 0: string + 1: string +}> + +export interface AaveLendingPoolAddressProvider extends BaseContract { + constructor(jsonInterface: any[], address?: string, options?: ContractOptions): AaveLendingPoolAddressProvider + clone(): AaveLendingPoolAddressProvider + methods: { + getAddress(id: string | number[]): NonPayableTransactionObject + + getEmergencyAdmin(): NonPayableTransactionObject + + getLendingPool(): NonPayableTransactionObject + + getLendingPoolCollateralManager(): NonPayableTransactionObject + + getLendingPoolConfigurator(): NonPayableTransactionObject + + getLendingRateOracle(): NonPayableTransactionObject + + getMarketId(): NonPayableTransactionObject + + getPoolAdmin(): NonPayableTransactionObject + + getPriceOracle(): NonPayableTransactionObject + + owner(): NonPayableTransactionObject + + renounceOwnership(): NonPayableTransactionObject + + setAddress(id: string | number[], newAddress: string): NonPayableTransactionObject + + setAddressAsProxy(id: string | number[], implementationAddress: string): NonPayableTransactionObject + + setEmergencyAdmin(emergencyAdmin: string): NonPayableTransactionObject + + setLendingPoolCollateralManager(manager: string): NonPayableTransactionObject + + setLendingPoolConfiguratorImpl(configurator: string): NonPayableTransactionObject + + setLendingPoolImpl(pool: string): NonPayableTransactionObject + + setLendingRateOracle(lendingRateOracle: string): NonPayableTransactionObject + + setMarketId(marketId: string): NonPayableTransactionObject + + setPoolAdmin(admin: string): NonPayableTransactionObject + + setPriceOracle(priceOracle: string): NonPayableTransactionObject + + transferOwnership(newOwner: string): NonPayableTransactionObject + } + events: { + AddressSet(cb?: Callback): EventEmitter + AddressSet(options?: EventOptions, cb?: Callback): EventEmitter + + ConfigurationAdminUpdated(cb?: Callback): EventEmitter + ConfigurationAdminUpdated(options?: EventOptions, cb?: Callback): EventEmitter + + EmergencyAdminUpdated(cb?: Callback): EventEmitter + EmergencyAdminUpdated(options?: EventOptions, cb?: Callback): EventEmitter + + LendingPoolCollateralManagerUpdated(cb?: Callback): EventEmitter + LendingPoolCollateralManagerUpdated( + options?: EventOptions, + cb?: Callback, + ): EventEmitter + + LendingPoolConfiguratorUpdated(cb?: Callback): EventEmitter + LendingPoolConfiguratorUpdated( + options?: EventOptions, + cb?: Callback, + ): EventEmitter + + LendingPoolUpdated(cb?: Callback): EventEmitter + LendingPoolUpdated(options?: EventOptions, cb?: Callback): EventEmitter + + LendingRateOracleUpdated(cb?: Callback): EventEmitter + LendingRateOracleUpdated(options?: EventOptions, cb?: Callback): EventEmitter + + MarketIdSet(cb?: Callback): EventEmitter + MarketIdSet(options?: EventOptions, cb?: Callback): EventEmitter + + OwnershipTransferred(cb?: Callback): EventEmitter + OwnershipTransferred(options?: EventOptions, cb?: Callback): EventEmitter + + PriceOracleUpdated(cb?: Callback): EventEmitter + PriceOracleUpdated(options?: EventOptions, cb?: Callback): EventEmitter + + ProxyCreated(cb?: Callback): EventEmitter + ProxyCreated(options?: EventOptions, cb?: Callback): EventEmitter + + allEvents(options?: EventOptions, cb?: Callback): EventEmitter + } + + once(event: 'AddressSet', cb: Callback): void + once(event: 'AddressSet', options: EventOptions, cb: Callback): void + + once(event: 'ConfigurationAdminUpdated', cb: Callback): void + once(event: 'ConfigurationAdminUpdated', options: EventOptions, cb: Callback): void + + once(event: 'EmergencyAdminUpdated', cb: Callback): void + once(event: 'EmergencyAdminUpdated', options: EventOptions, cb: Callback): void + + once(event: 'LendingPoolCollateralManagerUpdated', cb: Callback): void + once( + event: 'LendingPoolCollateralManagerUpdated', + options: EventOptions, + cb: Callback, + ): void + + once(event: 'LendingPoolConfiguratorUpdated', cb: Callback): void + once( + event: 'LendingPoolConfiguratorUpdated', + options: EventOptions, + cb: Callback, + ): void + + once(event: 'LendingPoolUpdated', cb: Callback): void + once(event: 'LendingPoolUpdated', options: EventOptions, cb: Callback): void + + once(event: 'LendingRateOracleUpdated', cb: Callback): void + once(event: 'LendingRateOracleUpdated', options: EventOptions, cb: Callback): void + + once(event: 'MarketIdSet', cb: Callback): void + once(event: 'MarketIdSet', options: EventOptions, cb: Callback): void + + once(event: 'OwnershipTransferred', cb: Callback): void + once(event: 'OwnershipTransferred', options: EventOptions, cb: Callback): void + + once(event: 'PriceOracleUpdated', cb: Callback): void + once(event: 'PriceOracleUpdated', options: EventOptions, cb: Callback): void + + once(event: 'ProxyCreated', cb: Callback): void + once(event: 'ProxyCreated', options: EventOptions, cb: Callback): void +} diff --git a/packages/web3-contracts/types/AaveProtocolDataProvider.d.ts b/packages/web3-contracts/types/AaveProtocolDataProvider.d.ts new file mode 100644 index 000000000000..c55d154bef05 --- /dev/null +++ b/packages/web3-contracts/types/AaveProtocolDataProvider.d.ts @@ -0,0 +1,116 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import BN from 'bn.js' +import { ContractOptions } from 'web3-eth-contract' +import { EventLog } from 'web3-core' +import { EventEmitter } from 'events' +import { + Callback, + PayableTransactionObject, + NonPayableTransactionObject, + BlockType, + ContractEventLog, + BaseContract, +} from './types' + +export interface EventOptions { + filter?: object + fromBlock?: BlockType + topics?: string[] +} + +export interface AaveProtocolDataProvider extends BaseContract { + constructor(jsonInterface: any[], address?: string, options?: ContractOptions): AaveProtocolDataProvider + clone(): AaveProtocolDataProvider + methods: { + ADDRESSES_PROVIDER(): NonPayableTransactionObject + + getAllATokens(): NonPayableTransactionObject<[string, string][]> + + getAllReservesTokens(): NonPayableTransactionObject<[string, string][]> + + getReserveConfigurationData(asset: string): NonPayableTransactionObject<{ + decimals: string + ltv: string + liquidationThreshold: string + liquidationBonus: string + reserveFactor: string + usageAsCollateralEnabled: boolean + borrowingEnabled: boolean + stableBorrowRateEnabled: boolean + isActive: boolean + isFrozen: boolean + 0: string + 1: string + 2: string + 3: string + 4: string + 5: boolean + 6: boolean + 7: boolean + 8: boolean + 9: boolean + }> + + getReserveData(asset: string): NonPayableTransactionObject<{ + availableLiquidity: string + totalStableDebt: string + totalVariableDebt: string + liquidityRate: string + variableBorrowRate: string + stableBorrowRate: string + averageStableBorrowRate: string + liquidityIndex: string + variableBorrowIndex: string + lastUpdateTimestamp: string + 0: string + 1: string + 2: string + 3: string + 4: string + 5: string + 6: string + 7: string + 8: string + 9: string + }> + + getReserveTokensAddresses(asset: string): NonPayableTransactionObject<{ + aTokenAddress: string + stableDebtTokenAddress: string + variableDebtTokenAddress: string + 0: string + 1: string + 2: string + }> + + getUserReserveData( + asset: string, + user: string, + ): NonPayableTransactionObject<{ + currentATokenBalance: string + currentStableDebt: string + currentVariableDebt: string + principalStableDebt: string + scaledVariableDebt: string + stableBorrowRate: string + liquidityRate: string + stableRateLastUpdated: string + usageAsCollateralEnabled: boolean + 0: string + 1: string + 2: string + 3: string + 4: string + 5: string + 6: string + 7: string + 8: boolean + }> + } + events: { + allEvents(options?: EventOptions, cb?: Callback): EventEmitter + } +} diff --git a/packages/web3-contracts/types/AaveStableDebtToken.d.ts b/packages/web3-contracts/types/AaveStableDebtToken.d.ts new file mode 100644 index 000000000000..5b407b64a865 --- /dev/null +++ b/packages/web3-contracts/types/AaveStableDebtToken.d.ts @@ -0,0 +1,111 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import BN from 'bn.js' +import { ContractOptions } from 'web3-eth-contract' +import { EventLog } from 'web3-core' +import { EventEmitter } from 'events' +import { + Callback, + PayableTransactionObject, + NonPayableTransactionObject, + BlockType, + ContractEventLog, + BaseContract, +} from './types' + +export interface EventOptions { + filter?: object + fromBlock?: BlockType + topics?: string[] +} + +export type Burn = ContractEventLog<{ + user: string + amount: string + currentBalance: string + balanceIncrease: string + avgStableRate: string + newTotalSupply: string + 0: string + 1: string + 2: string + 3: string + 4: string + 5: string +}> +export type Mint = ContractEventLog<{ + user: string + onBehalfOf: string + amount: string + currentBalance: string + balanceIncrease: string + newRate: string + avgStableRate: string + newTotalSupply: string + 0: string + 1: string + 2: string + 3: string + 4: string + 5: string + 6: string + 7: string +}> + +export interface AaveStableDebtToken extends BaseContract { + constructor(jsonInterface: any[], address?: string, options?: ContractOptions): AaveStableDebtToken + clone(): AaveStableDebtToken + methods: { + approveDelegation(delegatee: string, amount: number | string | BN): NonPayableTransactionObject + + borrowAllowance(fromUser: string, toUser: string): NonPayableTransactionObject + + burn(user: string, amount: number | string | BN): NonPayableTransactionObject + + getAverageStableRate(): NonPayableTransactionObject + + getSupplyData(): NonPayableTransactionObject<{ + 0: string + 1: string + 2: string + 3: string + }> + + getTotalSupplyAndAvgRate(): NonPayableTransactionObject<{ + 0: string + 1: string + }> + + getTotalSupplyLastUpdated(): NonPayableTransactionObject + + getUserLastUpdated(user: string): NonPayableTransactionObject + + getUserStableRate(user: string): NonPayableTransactionObject + + mint( + user: string, + onBehalfOf: string, + amount: number | string | BN, + rate: number | string | BN, + ): NonPayableTransactionObject + + principalBalanceOf(user: string): NonPayableTransactionObject + } + events: { + Burn(cb?: Callback): EventEmitter + Burn(options?: EventOptions, cb?: Callback): EventEmitter + + Mint(cb?: Callback): EventEmitter + Mint(options?: EventOptions, cb?: Callback): EventEmitter + + allEvents(options?: EventOptions, cb?: Callback): EventEmitter + } + + once(event: 'Burn', cb: Callback): void + once(event: 'Burn', options: EventOptions, cb: Callback): void + + once(event: 'Mint', cb: Callback): void + once(event: 'Mint', options: EventOptions, cb: Callback): void +} diff --git a/packages/web3-shared/evm/constants/constants.ts b/packages/web3-shared/evm/constants/constants.ts index fd7716545eff..feef208f28eb 100644 --- a/packages/web3-shared/evm/constants/constants.ts +++ b/packages/web3-shared/evm/constants/constants.ts @@ -24,7 +24,8 @@ import SpaceStationGalaxy from '@masknet/web3-constants/evm/space-station-galaxy import OpenseaAPI from '@masknet/web3-constants/evm/opensea-api.json' import CryptoArtAI from '@masknet/web3-constants/evm/cryptoartai.json' import ArtBlocks from '@masknet/web3-constants/evm/artblocks.json' -import Savings from '@masknet/web3-constants/evm/savings.json' +import Aave from '@masknet/web3-constants/evm/aave.json' +import Lido from '@masknet/web3-constants/evm/lido.json' import { hookTransform, transform, transformFromJSON } from './utils' function getEnvConstants(key: 'WEB3_CONSTANTS_RPC') { @@ -116,5 +117,8 @@ export const useArtBlocksConstants = hookTransform(getArtBlocksConstants) export const getNftRedPacketConstants = transform(NftRedPacket) export const useNftRedPacketConstants = hookTransform(getNftRedPacketConstants) -export const getSavingsConstants = transform(Savings) -export const useSavingsConstants = hookTransform(getSavingsConstants) +export const getAaveConstants = transform(Aave) +export const useAaveConstants = hookTransform(getAaveConstants) + +export const getLidoConstants = transform(Lido) +export const useLidoConstants = hookTransform(getLidoConstants) diff --git a/packages/web3-shared/evm/constants/tokens.ts b/packages/web3-shared/evm/constants/tokens.ts index 486f30fea1ca..69b687e60645 100644 --- a/packages/web3-shared/evm/constants/tokens.ts +++ b/packages/web3-shared/evm/constants/tokens.ts @@ -12,11 +12,6 @@ export const HUSD = createERC20Tokens('HUSD_ADDRESS', 'Huobi USD', 'HUSD', 6) export const BUSD = createERC20Tokens('BUSD_ADDRESS', 'Huobi USD', 'BUSD', 6) export const COMP = createERC20Tokens('COMP_ADDRESS', 'Compound', 'COMP', 18) export const MKR = createERC20Tokens('MKR_ADDRESS', 'Maker', 'MKR', 18) -export const MSKA = createERC20Tokens('MSKA_ADDRESS', 'Mask A', 'MSKA', 18) -export const MSKB = createERC20Tokens('MSKB_ADDRESS', 'Mask B', 'MSKB', 18) -export const MSKC = createERC20Tokens('MSKC_ADDRESS', 'Mask C', 'MSKC', 18) -export const MSKD = createERC20Tokens('MSKD_ADDRESS', 'Mask D', 'MSKD', 18) -export const MSKE = createERC20Tokens('MSKE_ADDRESS', 'Mask E', 'MSKE', 18) export const DAI = createERC20Tokens('DAI_ADDRESS', 'Dai Stablecoin', 'DAI', 18) export const DAIe = createERC20Tokens('DAI_ADDRESS', 'Dai Stablecoin', 'DAI.e', 18) export const AMPL = createERC20Tokens('AMPL_ADDRESS', 'Ampleforth', 'AMPL', 18) diff --git a/packages/web3-shared/evm/hooks/useERC20TokenDetailed.ts b/packages/web3-shared/evm/hooks/useERC20TokenDetailed.ts index 85bea6c89210..1a52e4da03b6 100644 --- a/packages/web3-shared/evm/hooks/useERC20TokenDetailed.ts +++ b/packages/web3-shared/evm/hooks/useERC20TokenDetailed.ts @@ -27,8 +27,8 @@ export function useFungibleTokensDetailed(listOfToken: Pick listOfToken.map((t) => t.address), [JSON.stringify(listOfToken)]) - const erc20TokenContracts = useERC20TokenContracts(listOfAddress) - const erc20TokenBytes32Contracts = useERC20TokenBytes32Contracts(listOfAddress) + const erc20TokenContracts = useERC20TokenContracts(listOfAddress, chainId) + const erc20TokenBytes32Contracts = useERC20TokenBytes32Contracts(listOfAddress, chainId) return useAsyncRetry( async () =>