From 3252848923dd4497c0ef2fa4e197ce8dfd0f7dc4 Mon Sep 17 00:00:00 2001 From: UncleBill Date: Wed, 18 Oct 2023 18:01:27 +0800 Subject: [PATCH] feat: mf-5475 add scroll chain (#10971) --- .../components/TokenPicker/TokenItem.tsx | 1 + .../components/UnlockERC20Token/index.tsx | 4 +- .../src/SiteAdaptor/ApprovalDialog.tsx | 109 +++++++++--------- packages/plugins/Approval/src/base.ts | 1 + .../src/SiteAdaptor/RedPacketDialog.tsx | 11 +- packages/plugins/RedPacket/src/base.ts | 1 + packages/plugins/Tips/src/base.ts | 1 + .../helpers/getEVMAvailableTraderProviders.ts | 1 + .../plugins/Trader/src/providers/ZeroX.ts | 1 + .../AssetsManagement/ChainRuntimeProvider.tsx | 2 + .../index.tsx | 29 ++--- .../src/UI/components/TokenIcon/index.tsx | 4 +- packages/web3-constants/evm/ethereum.json | 6 +- .../web3-constants/evm/nft-red-packet.json | 6 +- packages/web3-constants/evm/red-packet.json | 6 +- packages/web3-constants/evm/rpc.json | 9 +- .../evm/token-asset-base-url.json | 6 +- packages/web3-constants/evm/token-list.json | 3 +- packages/web3-constants/evm/token.json | 12 +- packages/web3-hooks/base/src/useBeat.ts | 3 + .../evm/src/useERC20TokenAllowance.ts | 16 +-- .../evm/src/useERC20TokenApproveCallback.ts | 8 +- packages/web3-providers/src/Rabby/helpers.tsx | 1 + .../web3-providers/src/SimpleHash/apis/EVM.ts | 2 +- .../src/SimpleHash/apis/Solana.ts | 7 +- .../web3-providers/src/SimpleHash/helpers.ts | 10 +- .../src/SimpleHash/solana-helpers.ts | 3 +- .../web3-providers/src/SimpleHash/type.ts | 2 +- .../web3-shared/evm/src/assets/scroll.png | Bin 0 -> 19203 bytes .../web3-shared/evm/src/constants/chains.json | 26 +++++ .../evm/src/constants/descriptors.ts | 11 ++ .../web3-shared/evm/src/constants/tokens.ts | 1 + packages/web3-shared/evm/src/types/index.ts | 3 + 33 files changed, 195 insertions(+), 111 deletions(-) create mode 100644 packages/web3-shared/evm/src/assets/scroll.png diff --git a/packages/mask/src/extension/popups/components/TokenPicker/TokenItem.tsx b/packages/mask/src/extension/popups/components/TokenPicker/TokenItem.tsx index 16ffe18fc3f3..ee8ba6fa32d3 100644 --- a/packages/mask/src/extension/popups/components/TokenPicker/TokenItem.tsx +++ b/packages/mask/src/extension/popups/components/TokenPicker/TokenItem.tsx @@ -145,6 +145,7 @@ export const TokenItem = memo(function TokenItem({ (function UnlockERC20 const { data: token } = useFungibleToken( NetworkPluginID.PLUGIN_EVM, transaction.formattedTransaction?.tokenInAddress, + undefined, + { chainId }, ) const { data: balance = '0' } = useFungibleTokenBalance( @@ -244,7 +246,7 @@ export const UnlockERC20Token = memo(function UnlockERC20 ) : null} {t('popups_wallet_unlock_erc20_requested_by')} {transaction.formattedTransaction.popup?.spender ? ( - + {t('contract')}: {transaction.formattedTransaction.popup?.spender}{' '} diff --git a/packages/plugins/Approval/src/SiteAdaptor/ApprovalDialog.tsx b/packages/plugins/Approval/src/SiteAdaptor/ApprovalDialog.tsx index 193cd46d52a1..a9044fc3e107 100644 --- a/packages/plugins/Approval/src/SiteAdaptor/ApprovalDialog.tsx +++ b/packages/plugins/Approval/src/SiteAdaptor/ApprovalDialog.tsx @@ -5,65 +5,64 @@ import { TabContext } from '@mui/lab' import { PluginWalletStatusBar, InjectedDialog, NetworkTab } from '@masknet/shared' import { useChainContext } from '@masknet/web3-hooks-base' import { type ChainId } from '@masknet/web3-shared-evm' -import { NetworkPluginID, PluginID } from '@masknet/shared-base' +import { EMPTY_LIST, NetworkPluginID, PluginID } from '@masknet/shared-base' import { useActivatedPlugin } from '@masknet/plugin-infra/dom' import { useI18N } from '../locales/index.js' import { ApprovalTokenContent } from './ApprovalTokenContent.js' import { ApprovalNFTContent } from './ApprovalNFTContent.js' +import { useMemo } from 'react' -const useStyles = makeStyles<{ listItemBackground?: string; listItemBackgroundIcon?: string } | void>()( - (theme, props) => ({ - dialogRoot: { - width: 600, - height: 620, - overflowX: 'hidden', +const useStyles = makeStyles()((theme, props) => ({ + dialogRoot: { + width: 600, + height: 620, + overflowX: 'hidden', + }, + dialogContent: { + width: 600, + background: theme.palette.maskColor.bottom, + padding: 0, + margin: 'auto', + overflowX: 'hidden', + }, + contentWrapper: { + width: 602, + padding: 0, + overflowY: 'auto', + overflowX: 'hidden', + height: '100%', + '::-webkit-scrollbar': { + backgroundColor: 'transparent', + width: 18, }, - dialogContent: { - width: 600, - background: theme.palette.maskColor.bottom, - padding: 0, - margin: 'auto', - overflowX: 'hidden', + '::-webkit-scrollbar-thumb': { + borderRadius: '20px', + width: 5, + border: '7px solid rgba(0, 0, 0, 0)', + backgroundColor: theme.palette.maskColor.secondaryLine, + backgroundClip: 'padding-box', }, - contentWrapper: { - width: 602, - padding: 0, - overflowY: 'auto', - overflowX: 'hidden', - height: '100%', - '::-webkit-scrollbar': { - backgroundColor: 'transparent', - width: 18, - }, - '::-webkit-scrollbar-thumb': { - borderRadius: '20px', - width: 5, - border: '7px solid rgba(0, 0, 0, 0)', - backgroundColor: theme.palette.maskColor.secondaryLine, - backgroundClip: 'padding-box', - }, + }, + dialogTitle: { + '& > p': { + overflow: 'visible', }, - dialogTitle: { - '& > p': { - overflow: 'visible', - }, - }, - abstractTabWrapper: { - width: '100%', - paddingBottom: theme.spacing(2), - }, - approvalWrapper: { - display: 'flex', - flexDirection: 'column', - width: '100%', - height: '100%', - }, - footer: { - position: 'sticky', - bottom: 0, - }, - }), -) + }, + abstractTabWrapper: { + width: '100%', + paddingBottom: theme.spacing(2), + }, + approvalWrapper: { + display: 'flex', + flexDirection: 'column', + width: '100%', + height: '100%', + }, + footer: { + position: 'sticky', + bottom: 0, + }, +})) export interface ApprovalDialogProps { open: boolean @@ -111,9 +110,11 @@ function ApprovalWrapper(props: ApprovalWrapperProps) { const { chainId } = useChainContext() const approvalDefinition = useActivatedPlugin(PluginID.Approval, 'any') - const chainIdList = compact( - approvalDefinition?.enableRequirement.web3?.[NetworkPluginID.PLUGIN_EVM]?.supportedChainIds ?? [], - ) + const chainIdList = useMemo(() => { + return compact( + approvalDefinition?.enableRequirement.web3?.[NetworkPluginID.PLUGIN_EVM]?.supportedChainIds ?? EMPTY_LIST, + ) + }, [approvalDefinition]) const { classes } = useStyles() return ( diff --git a/packages/plugins/Approval/src/base.ts b/packages/plugins/Approval/src/base.ts index 29b6ca65af40..1fa41fc34d44 100644 --- a/packages/plugins/Approval/src/base.ts +++ b/packages/plugins/Approval/src/base.ts @@ -32,6 +32,7 @@ export const base: Plugin.Shared.Definition = { ChainId.Avalanche, ChainId.Aurora, ChainId.Optimism, + ChainId.Scroll, ], }, [NetworkPluginID.PLUGIN_FLOW]: { supportedChainIds: [] }, diff --git a/packages/plugins/RedPacket/src/SiteAdaptor/RedPacketDialog.tsx b/packages/plugins/RedPacket/src/SiteAdaptor/RedPacketDialog.tsx index 3f5026b307fd..dabf2abbcbdd 100644 --- a/packages/plugins/RedPacket/src/SiteAdaptor/RedPacketDialog.tsx +++ b/packages/plugins/RedPacket/src/SiteAdaptor/RedPacketDialog.tsx @@ -1,5 +1,4 @@ import { useCallback, useMemo, useState } from 'react' -import { compact } from 'lodash-es' import Web3Utils from 'web3-utils' import { DialogContent, Tab, useTheme } from '@mui/material' import { TabContext, TabPanel } from '@mui/lab' @@ -83,12 +82,10 @@ export default function RedPacketDialog(props: RedPacketDialogProps) { const theme = useTheme() const mode = useSiteThemeMode(theme) const { classes } = useStyles({ currentTab, showHistory, isDim: mode === 'dim' }) - const chainIdList = useMemo(() => { - return compact( - currentTab === tabs.tokens - ? approvalDefinition?.enableRequirement.web3?.[NetworkPluginID.PLUGIN_EVM]?.supportedChainIds ?? [] - : [ChainId.Mainnet, ChainId.BSC, ChainId.Matic], - ) + const chainIdList: ChainId[] = useMemo(() => { + return currentTab === tabs.tokens + ? approvalDefinition?.enableRequirement.web3?.[NetworkPluginID.PLUGIN_EVM]?.supportedChainIds ?? [] + : [ChainId.Mainnet, ChainId.BSC, ChainId.Matic] }, [currentTab === tabs.tokens, approvalDefinition?.enableRequirement.web3]) const chainId = chainIdList.includes(_chainId) ? _chainId : ChainId.Mainnet diff --git a/packages/plugins/RedPacket/src/base.ts b/packages/plugins/RedPacket/src/base.ts index eb727982321e..8a018b22d54e 100644 --- a/packages/plugins/RedPacket/src/base.ts +++ b/packages/plugins/RedPacket/src/base.ts @@ -34,6 +34,7 @@ export const base: Plugin.Shared.Definition = { ChainId.Aurora, ChainId.Conflux, ChainId.Astar, + ChainId.Scroll, ], }, [NetworkPluginID.PLUGIN_FLOW]: { supportedChainIds: [] }, diff --git a/packages/plugins/Tips/src/base.ts b/packages/plugins/Tips/src/base.ts index dcadba546c9d..2c694c2f84f1 100644 --- a/packages/plugins/Tips/src/base.ts +++ b/packages/plugins/Tips/src/base.ts @@ -33,6 +33,7 @@ export const base: Plugin.Shared.Definition = { ChainId.Fantom, ChainId.Conflux, ChainId.Astar, + ChainId.Scroll, ChainId.Optimism, ], }, diff --git a/packages/plugins/Trader/src/helpers/getEVMAvailableTraderProviders.ts b/packages/plugins/Trader/src/helpers/getEVMAvailableTraderProviders.ts index e2351f57e66a..2018e155b1c8 100644 --- a/packages/plugins/Trader/src/helpers/getEVMAvailableTraderProviders.ts +++ b/packages/plugins/Trader/src/helpers/getEVMAvailableTraderProviders.ts @@ -55,6 +55,7 @@ export function getEVMAvailableTraderProviders(networkType?: NetworkType) { return [TradeProvider.DODO, TradeProvider.WANNASWAP, TradeProvider.TRISOLARIS] case NetworkType.Astar: return [TradeProvider.ARTHSWAP, TradeProvider.VERSA, TradeProvider.ASTAREXCHANGE, TradeProvider.YUMISWAP] + case NetworkType.Scroll: case NetworkType.Boba: case NetworkType.Fuse: case NetworkType.Metis: diff --git a/packages/plugins/Trader/src/providers/ZeroX.ts b/packages/plugins/Trader/src/providers/ZeroX.ts index 15bcbe3bb52e..005ee780a895 100644 --- a/packages/plugins/Trader/src/providers/ZeroX.ts +++ b/packages/plugins/Trader/src/providers/ZeroX.ts @@ -47,6 +47,7 @@ export function getNativeTokenLabel(networkType: NetworkType) { case NetworkType.Optimism: case NetworkType.Conflux: case NetworkType.Astar: + case NetworkType.Scroll: case NetworkType.Moonbeam: case NetworkType.CustomNetwork: return ZRX_NATIVE_TOKEN_ADDRESS diff --git a/packages/shared/src/UI/components/AssetsManagement/ChainRuntimeProvider.tsx b/packages/shared/src/UI/components/AssetsManagement/ChainRuntimeProvider.tsx index bf9f07b28fb7..0c90d0afac9a 100644 --- a/packages/shared/src/UI/components/AssetsManagement/ChainRuntimeProvider.tsx +++ b/packages/shared/src/UI/components/AssetsManagement/ChainRuntimeProvider.tsx @@ -33,6 +33,7 @@ const ChainRuntimeContext = createContext({ networks: EMPTY_LIST, }) +// https://docs.simplehash.com/reference/chains const SimpleHashSupportedChains: Record = { [NetworkPluginID.PLUGIN_EVM]: [ ChainId.Mainnet, @@ -43,6 +44,7 @@ const SimpleHashSupportedChains: Record = { ChainId.Optimism, ChainId.Avalanche, ChainId.xDai, + ChainId.Scroll, ], [NetworkPluginID.PLUGIN_SOLANA]: [SolanaChainId.Mainnet], [NetworkPluginID.PLUGIN_FLOW]: [FlowChainId.Mainnet], diff --git a/packages/shared/src/UI/components/EthereumERC20TokenApprovedBoundary/index.tsx b/packages/shared/src/UI/components/EthereumERC20TokenApprovedBoundary/index.tsx index 09b3d41ed716..91651dfe1b8d 100644 --- a/packages/shared/src/UI/components/EthereumERC20TokenApprovedBoundary/index.tsx +++ b/packages/shared/src/UI/components/EthereumERC20TokenApprovedBoundary/index.tsx @@ -2,7 +2,7 @@ import { unreachable } from '@masknet/kit' import { TokenIcon } from '@masknet/shared' import { ActionButton, type ActionButtonProps, makeStyles, ShadowRootTooltip } from '@masknet/theme' import { ApproveStateType, useERC20TokenApproveCallback } from '@masknet/web3-hooks-evm' -import { isSameAddress, type FungibleToken } from '@masknet/web3-shared-base' +import { isSameAddress, type FungibleToken, isGte } from '@masknet/web3-shared-base' import type { ChainId, SchemaType } from '@masknet/web3-shared-evm' import { HelpOutline } from '@mui/icons-material' import React, { useCallback } from 'react' @@ -69,21 +69,22 @@ export function EthereumERC20TokenApprovedBoundary(props: EthereumERC20TokenAppr account, }) - const approved = !!spenders?.find( - (x) => isSameAddress(x.tokenInfo.address, token?.address) && isSameAddress(x.address, spender), + const [{ type: approveStateType, allowance }, transactionState, approveCallback] = useERC20TokenApproveCallback( + token?.address ?? '', + amount, + spender ?? '', + () => { + callback?.() + refetch() + }, + token?.chainId, ) + console.log('allowance', allowance) - const [{ type: approveStateType, allowance }, transactionState, approveCallback, _resetApproveCallback] = - useERC20TokenApproveCallback( - token?.address ?? '', - amount, - spender ?? '', - () => { - callback?.() - refetch() - }, - token?.chainId, - ) + const approved = + spenders?.some( + (x) => isSameAddress(x.tokenInfo.address, token?.address) && isSameAddress(x.address, spender), + ) || isGte(allowance, amount) const loading = spendersLoading || diff --git a/packages/shared/src/UI/components/TokenIcon/index.tsx b/packages/shared/src/UI/components/TokenIcon/index.tsx index 6d0fadf29f1d..249ce183a9cb 100644 --- a/packages/shared/src/UI/components/TokenIcon/index.tsx +++ b/packages/shared/src/UI/components/TokenIcon/index.tsx @@ -1,4 +1,4 @@ -import type { NetworkPluginID } from '@masknet/shared-base' +import { NetworkPluginID } from '@masknet/shared-base' import type { Web3Helper } from '@masknet/web3-helpers' import { useChainContext, useFungibleToken, useWeb3Hub } from '@masknet/web3-hooks-base' import { TokenType } from '@masknet/web3-shared-base' @@ -18,7 +18,7 @@ export interface TokenIconProps extends IconProps { export const TokenIcon = memo(function TokenIcon(props: TokenIconProps) { const { - pluginID, + pluginID = NetworkPluginID.PLUGIN_EVM, chainId: propChainId, address, logoURL, diff --git a/packages/web3-constants/evm/ethereum.json b/packages/web3-constants/evm/ethereum.json index 468f9d1aca8f..3bdfec92f96b 100644 --- a/packages/web3-constants/evm/ethereum.json +++ b/packages/web3-constants/evm/ethereum.json @@ -18,7 +18,8 @@ "Celo": "0x8e28F1d64ceD52b9A09aB1AA3071Aa3c05802d1F", "Fantom": "0xc119574d5fb333f5ac018658d4d8b5035e16bf39", "Aurora": "0xC119574D5Fb333F5AC018658D4d8b5035E16bf39", - "Astar": "0xf5056B96ab242C566002852d0b98ce0BcDf1af51" + "Astar": "0xf5056B96ab242C566002852d0b98ce0BcDf1af51", + "Scroll": "0xbC7d98985966f56A66B0cB5F23d865676dc2ac84" }, "MULTICALL_ADDRESS": { "Mainnet": "0x1F98415757620B543A52E61c46B32eB19261F984", @@ -42,7 +43,8 @@ "Fantom": "0x913975af2Bb8a6Be4100D7dc5e9765B77F6A5d6c", "Aurora": "0x6cc1b1058F9153358278C35E0b2D382f1585854B", "Conflux": "0x19f179d7e0d7d9f9d5386afff64271d98a91615b", - "Astar": "0x1410304B91a280ad083196B0B50e9d8df749d860" + "Astar": "0x1410304B91a280ad083196B0B50e9d8df749d860", + "Scroll": "0x20Ee232E34B87061fE3ba0DB738A3531A3e915BF" }, "ENS_REGISTRAR_ADDRESS": { "Mainnet": "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", diff --git a/packages/web3-constants/evm/nft-red-packet.json b/packages/web3-constants/evm/nft-red-packet.json index 24df487b267c..05398b732ebe 100644 --- a/packages/web3-constants/evm/nft-red-packet.json +++ b/packages/web3-constants/evm/nft-red-packet.json @@ -12,7 +12,8 @@ "Aurora": "0x05ee315E407C21a594f807D61d6CC11306D1F149", "Aurora_Testnet": "0x97369fEE7db34E0BfE47861f2ec44b4378d13eB4", "Conflux": "0x5b966f3a32db9c180843bcb40267a66b73e4f022", - "Astar": "0xc3e62b2CC70439C32a381Bfc056aCEd1d7162cef" + "Astar": "0xc3e62b2CC70439C32a381Bfc056aCEd1d7162cef", + "Scroll": "0x727F8030964CCEC6B0E344399c8d8E2B4C837351" }, "NFT_RED_PACKET_ADDRESS_BLOCK_HEIGHT": { "Mainnet": 13229711, @@ -39,6 +40,7 @@ "Aurora": 0, "Aurora_Testnet": 0, "Conflux": 0, - "Astar": 0 + "Astar": 0, + "Scroll": 96705 } } diff --git a/packages/web3-constants/evm/red-packet.json b/packages/web3-constants/evm/red-packet.json index 388d7ba0703e..369218f748ff 100644 --- a/packages/web3-constants/evm/red-packet.json +++ b/packages/web3-constants/evm/red-packet.json @@ -35,7 +35,8 @@ "Aurora": "0x19f179D7e0D7d9F9d5386afFF64271D98A91615B", "Aurora_Testnet": "0xdB93cCd481012bB5D1E2c8d0aF7C5f2940c00fdC", "Conflux": "0x96c7d011cdfd467f551605f0f5fce279f86f4186", - "Astar": "0x2cF46Db820e279c5fBF778367D49d9C931D54524" + "Astar": "0x2cF46Db820e279c5fBF778367D49d9C931D54524", + "Scroll": "0x16f61cb37169523635B6761f3C946892fb3c18fB" }, "HAPPY_RED_PACKET_ADDRESS_V4_BLOCK_HEIGHT": { "Mainnet": 12939427, @@ -62,6 +63,7 @@ "Aurora": 57552338, "Aurora_Testnet": 77918765, "Conflux": 37670572, - "Astar": 910985 + "Astar": 910985, + "Scroll": 96705 } } diff --git a/packages/web3-constants/evm/rpc.json b/packages/web3-constants/evm/rpc.json index 1c1aa1a31335..0593a5584223 100644 --- a/packages/web3-constants/evm/rpc.json +++ b/packages/web3-constants/evm/rpc.json @@ -69,7 +69,8 @@ "Aurora": ["https://mainnet.aurora.dev"], "Aurora_Testnet": ["https://testnet.aurora.dev"], "Conflux": ["https://evm.confluxrpc.com"], - "Astar": ["https://astar.api.onfinality.io/public"] + "Astar": ["https://astar.api.onfinality.io/public"], + "Scroll": ["https://rpc.scroll.io"] }, "RPC_URLS_OFFICIAL": { "Mainnet": ["https://mainnet.infura.io/v3/d65858b010d249419cf8687eca12b094"], @@ -96,7 +97,8 @@ "Aurora": ["https://mainnet.aurora.dev"], "Aurora_Testnet": ["https://testnet.aurora.dev/"], "Conflux": ["https://evm.confluxrpc.com"], - "Astar": ["https://rpc.astar.network:8545"] + "Astar": ["https://rpc.astar.network:8545"], + "Scroll": ["https://rpc.scroll.io"] }, "RPC_WEIGHTS": { "Mainnet": [0, 1, 2, 3, 4], @@ -123,6 +125,7 @@ "Aurora": [0, 0, 0, 0, 0], "Aurora_Testnet": [0, 0, 0, 0, 0], "Conflux": [0, 0, 0, 0, 0], - "Astar": [0, 0, 0, 0, 0] + "Astar": [0, 0, 0, 0, 0], + "Scroll": [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 818e8d50af5e..ddff11f28fd0 100644 --- a/packages/web3-constants/evm/token-asset-base-url.json +++ b/packages/web3-constants/evm/token-asset-base-url.json @@ -24,7 +24,8 @@ "Aurora": ["https://imagedelivery.net/PCnTHRkdRhGodr0AWBAvMA/Assets/blockchains/aurora"], "Aurora_Testnet": [], "Conflux": ["https://imagedelivery.net/PCnTHRkdRhGodr0AWBAvMA/Assets/blockchains/conflux"], - "Astar": ["https://imagedelivery.net/PCnTHRkdRhGodr0AWBAvMA/Assets/blockchains/astar"] + "Astar": ["https://imagedelivery.net/PCnTHRkdRhGodr0AWBAvMA/Assets/blockchains/astar"], + "Scroll": ["https://imagedelivery.net/PCnTHRkdRhGodr0AWBAvMA/Assets/blockchains/scroll"] }, "ERC20_TOKEN_ASSET_BASE_URI": { "Mainnet": ["https://imagedelivery.net/PCnTHRkdRhGodr0AWBAvMA/Assets/blockchains/ethereum/assets"], @@ -51,6 +52,7 @@ "Aurora": ["https://imagedelivery.net/PCnTHRkdRhGodr0AWBAvMA/Assets/blockchains/aurora/assets"], "Aurora_Testnet": [], "Conflux": ["https://imagedelivery.net/PCnTHRkdRhGodr0AWBAvMA/Assets/blockchains/conflux/assets"], - "Astar": ["https://imagedelivery.net/PCnTHRkdRhGodr0AWBAvMA/Assets/blockchains/astar/assets"] + "Astar": ["https://imagedelivery.net/PCnTHRkdRhGodr0AWBAvMA/Assets/blockchains/astar/assets"], + "Scroll": ["https://imagedelivery.net/PCnTHRkdRhGodr0AWBAvMA/Assets/blockchains/scroll/assets"] } } diff --git a/packages/web3-constants/evm/token-list.json b/packages/web3-constants/evm/token-list.json index 5f6d1c912ab0..0976b32820c5 100644 --- a/packages/web3-constants/evm/token-list.json +++ b/packages/web3-constants/evm/token-list.json @@ -24,6 +24,7 @@ "Aurora": ["https://tokens.r2d2.to/latest/1313161554/tokens.json"], "Aurora_Testnet": [], "Conflux": ["https://tokens.r2d2.to/latest/1030/tokens.json"], - "Astar": ["https://tokens.r2d2.to/latest/592/tokens.json"] + "Astar": ["https://tokens.r2d2.to/latest/592/tokens.json"], + "Scroll": ["https://tokens.r2d2.to/latest/534352/tokens.json"] } } diff --git a/packages/web3-constants/evm/token.json b/packages/web3-constants/evm/token.json index 602b72d40ced..9de0bb8b486e 100644 --- a/packages/web3-constants/evm/token.json +++ b/packages/web3-constants/evm/token.json @@ -22,7 +22,8 @@ "Celo": "0x471EcE3750Da237f93B8E339c536989b8978a438", "Fantom": "0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83", "Aurora": "0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB", - "Astar": "0xaeaaf0e2c81af264101b9129c00f4440ccf0f720" + "Astar": "0xaeaaf0e2c81af264101b9129c00f4440ccf0f720", + "Scroll": "0x5300000000000000000000000000000000000004" }, "LDO_stETH_ADDRESS": { "Mainnet": "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84", @@ -51,7 +52,8 @@ "Celo": "0x2A3684e9Dc20B857375EA04235F2F7edBe818FA7", "Fantom": "0x04068da6c83afcfa0e13ba15a6696662335d5b75", "Aurora": "0xb12bfca5a55806aaf64e99521918a4bf0fc40802", - "Astar": "0x6a2d262D56735DbA19Dd70682B39F6bE9a931D98" + "Astar": "0x6a2d262D56735DbA19Dd70682B39F6bE9a931D98", + "Scroll": "0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4" }, "USDT_ADDRESS": { "Mainnet": "0xdAC17F958D2ee523a2206206994597C13D831ec7", @@ -65,7 +67,8 @@ "Avalanche": "0xc7198437980c041c805A1EDcbA50c1Ce5db95118", "Celo": "0xb020d981420744f6b0fedd22bb67cd37ce18a1d5", "Aurora": "0x4988a896b1227218e4a686fde5eabdcabd91571f", - "Astar": "0x3795C36e7D12A8c252A20C5a7B455f7c57b60283" + "Astar": "0x3795C36e7D12A8c252A20C5a7B455f7c57b60283", + "Scroll": "0xf55BEC9cafDbE8730f096Aa55dad6D22d44099Df" }, "aUSDT_ADDRESS": { "Mainnet": "0x71fc860F7D3A592A4a98740e39dB31d25db65ae8", @@ -305,7 +308,8 @@ "Aurora": "0x0000000000000000000000000000000000000000", "Aurora_Testnet": "0x0000000000000000000000000000000000000000", "Conflux": "0x0000000000000000000000000000000000000000", - "Astar": "0x0000000000000000000000000000000000000000" + "Astar": "0x0000000000000000000000000000000000000000", + "Scroll": "0x0000000000000000000000000000000000000000" }, "WETH_ADDRESS": { "Mainnet": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", diff --git a/packages/web3-hooks/base/src/useBeat.ts b/packages/web3-hooks/base/src/useBeat.ts index 7d4f8985009f..748d2ca6cdc9 100644 --- a/packages/web3-hooks/base/src/useBeat.ts +++ b/packages/web3-hooks/base/src/useBeat.ts @@ -17,6 +17,9 @@ export function useBeat(delay = 1000) { return beat } +/** + * @deprecated Use react-query with refetchInterval + */ export function useBeatRetry(fn: () => Promise, delay = 1000, deps: DependencyList = []): AsyncStateRetry { const beat = useBeat(delay) return useAsyncRetry(fn, deps.concat(beat)) diff --git a/packages/web3-hooks/evm/src/useERC20TokenAllowance.ts b/packages/web3-hooks/evm/src/useERC20TokenAllowance.ts index 559a96e28f07..4a5dac69171d 100644 --- a/packages/web3-hooks/evm/src/useERC20TokenAllowance.ts +++ b/packages/web3-hooks/evm/src/useERC20TokenAllowance.ts @@ -1,27 +1,27 @@ -import type { AsyncStateRetry } from 'react-use/lib/useAsyncRetry.js' import { Contract } from '@masknet/web3-providers' import type { NetworkPluginID } from '@masknet/shared-base' import type { ConnectionOptions } from '@masknet/web3-providers/types' -import { useChainContext, useBeatRetry } from '@masknet/web3-hooks-base' +import { useChainContext } from '@masknet/web3-hooks-base' +import { useQuery } from '@tanstack/react-query' export function useERC20TokenAllowance( address?: string, spender?: string, options?: ConnectionOptions, -): AsyncStateRetry { +) { const { account, chainId } = useChainContext({ account: options?.account, chainId: options?.chainId, }) - return useBeatRetry( - async () => { + return useQuery({ + queryKey: ['erc20-allowance', address, account, spender], + queryFn: async () => { if (!account || !address || !spender) return '0' return Contract.getERC20Contract(address, { chainId })?.methods.allowance(account, spender).call({ from: account, }) }, - 30 * 1000, - [account, chainId, spender], - ) + refetchInterval: 30 * 1000, + }) } diff --git a/packages/web3-hooks/evm/src/useERC20TokenApproveCallback.ts b/packages/web3-hooks/evm/src/useERC20TokenApproveCallback.ts index 51aa2fb210c8..957a2a8f25b7 100644 --- a/packages/web3-hooks/evm/src/useERC20TokenApproveCallback.ts +++ b/packages/web3-hooks/evm/src/useERC20TokenApproveCallback.ts @@ -35,10 +35,10 @@ export function useERC20TokenApproveCallback( refetch: revalidateBalance, } = useFungibleTokenBalance(NetworkPluginID.PLUGIN_EVM, address, { chainId: tokenChainId }) const { - value: allowance = '0', - loading: loadingAllowance, + data: allowance = '0', + isLoading: loadingAllowance, error: errorAllowance, - retry: revalidateAllowance, + refetch: revalidateAllowance, } = useERC20TokenAllowance(address, spender, { chainId: tokenChainId }) // the computed approve state @@ -86,7 +86,7 @@ export function useERC20TokenApproveCallback( const resetCallback = useCallback(() => { revalidateBalance() revalidateAllowance() - }, [revalidateBalance, revalidateAllowance]) + }, [revalidateBalance]) return [ { diff --git a/packages/web3-providers/src/Rabby/helpers.tsx b/packages/web3-providers/src/Rabby/helpers.tsx index 7e1efb347962..356e1380f62f 100644 --- a/packages/web3-providers/src/Rabby/helpers.tsx +++ b/packages/web3-providers/src/Rabby/helpers.tsx @@ -19,6 +19,7 @@ export const resolveNetworkOnRabby = createLookupTableResolver { - if (!x?.id || x.spam_score >= SPAM_SCORE) return false + if (!x?.id || (x.spam_score !== null && x.spam_score >= SPAM_SCORE)) return false return ( isValidChainId(resolveChainId(x.chain)) && x.top_contracts.length > 0 && diff --git a/packages/web3-providers/src/SimpleHash/apis/Solana.ts b/packages/web3-providers/src/SimpleHash/apis/Solana.ts index 69aba9f9be3e..eedf3338b097 100644 --- a/packages/web3-providers/src/SimpleHash/apis/Solana.ts +++ b/packages/web3-providers/src/SimpleHash/apis/Solana.ts @@ -101,7 +101,12 @@ export class SimpleHashAPI_Solana implements NonFungibleTokenAPI.Provider x?.id && isValidChainId(resolveSolanaChainId(x.chain)) && x.spam_score <= SPAM_SCORE) + .filter( + (x) => + x?.id && + isValidChainId(resolveSolanaChainId(x.chain)) && + (x.spam_score === null || x.spam_score <= SPAM_SCORE), + ) .map((x) => createSolanaNonFungibleCollection(x)) return createPageable(collections, createIndicator(indicator)) diff --git a/packages/web3-providers/src/SimpleHash/helpers.ts b/packages/web3-providers/src/SimpleHash/helpers.ts index 7ee4ef121169..39cd658e2dc1 100644 --- a/packages/web3-providers/src/SimpleHash/helpers.ts +++ b/packages/web3-providers/src/SimpleHash/helpers.ts @@ -38,7 +38,9 @@ export function createNonFungibleAsset(asset: Asset): NonFungibleAsset= SPAM_SCORE) return + + const spam_score = asset.collection.spam_score + if (!chainId || !isValidChainId(chainId) || !address || (spam_score !== null && spam_score >= SPAM_SCORE)) return const schema = asset.contract.type === 'ERC721' ? SchemaType.ERC721 : SchemaType.ERC1155 const name = asset.name || getAssetFullName(asset.contract_address, asset.contract.name, asset.name, asset.token_id) @@ -156,6 +158,10 @@ export const resolveChainId: (chainId: string) => ChainId | undefined = memoize( return ChainId.BSC case 'base': return ChainId.Base + case 'scroll': + return ChainId.Scroll + case 'celo': + return ChainId.Celo default: return undefined } @@ -171,6 +177,8 @@ const ChainNameMap: Record> = { [ChainId.Avalanche]: 'avalanche', [ChainId.xDai]: 'gnosis', [ChainId.Base]: 'base', + [ChainId.Scroll]: 'scroll', + [ChainId.Celo]: 'celo', }, [NetworkPluginID.PLUGIN_SOLANA]: { [SolanaChainId.Mainnet]: 'solana', diff --git a/packages/web3-providers/src/SimpleHash/solana-helpers.ts b/packages/web3-providers/src/SimpleHash/solana-helpers.ts index 28edc850ee89..b42873681954 100644 --- a/packages/web3-providers/src/SimpleHash/solana-helpers.ts +++ b/packages/web3-providers/src/SimpleHash/solana-helpers.ts @@ -12,7 +12,8 @@ export function createSolanaNonFungibleAsset(asset: Asset): NonFungibleAsset= SPAM_SCORE) return + const spam_score = asset.collection.spam_score + if (!chainId || !isValidChainId(chainId) || !address || (spam_score !== null && spam_score >= SPAM_SCORE)) return // On Solana the contract is synonymous with the mint address - the field name on collection is recommended instead const name = isValidDomain(asset.name) ? asset.name diff --git a/packages/web3-providers/src/SimpleHash/type.ts b/packages/web3-providers/src/SimpleHash/type.ts index 836cad218168..b15daf86d578 100644 --- a/packages/web3-providers/src/SimpleHash/type.ts +++ b/packages/web3-providers/src/SimpleHash/type.ts @@ -17,7 +17,7 @@ export interface Collection { collection_id: string description: string external_url: string - spam_score: number + spam_score: number | null discord_url: string floor_prices: Array<{ marketplace_id: LiteralUnion<'blur' | 'looksrare' | 'opensea' | 'x2y2'> diff --git a/packages/web3-shared/evm/src/assets/scroll.png b/packages/web3-shared/evm/src/assets/scroll.png new file mode 100644 index 0000000000000000000000000000000000000000..4f5b305bcb9976ff07142cca3778f3cad95622af GIT binary patch literal 19203 zcmXVXbzD@>_xJ45T}mU1fPjQZNxCai3X&fsq+0<&q-&RwkWxxYS`d^HK~PE%knR!$ zDe2CI-F+_K=l93H_TIU3&pk6|=FExriPF_pr=eu01OU+7(@@a|01jQk0XZr3ci=OE zh5jhqG>l&WK*eK%`)}{5-1*N3 zw%HJv@X+qvzf*&^gll|~&j}NeqI=gSD$N>{^H>!OL=!M=|0RDfh<)~7@>Rk5Ps*dj{_cNFyN7%3Oyb*e|Bmtg&zOLQ;=6yBdo)KeltfLYL7%vM zL<#u0*+i=#S1CU-siA&NqVk#0pg#&Kg}q>(My0i*`3L-LKc`2sFkQb?mx7>I*t?(;9li!isXR}!d zu(DmT2BEBxThdk8{AlqLm7~>yOd;KfoCnw}csebNbWR&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cIz)y$1)(-i(QZ*nM=J!UU tY`6zg8s_)9hx}e?(C?Qp>;TE;zX1=Dlp(D^8^Qnp002ovPDHLkV1mH*{KEhM literal 0 HcmV?d00001 diff --git a/packages/web3-shared/evm/src/constants/chains.json b/packages/web3-shared/evm/src/constants/chains.json index 73dd5b2ee308..b181405aaf73 100644 --- a/packages/web3-shared/evm/src/constants/chains.json +++ b/packages/web3-shared/evm/src/constants/chains.json @@ -648,6 +648,32 @@ } ] }, + { + "chainId": 534352, + "type": "Scroll", + "name": "Scroll", + "network": "mainnet", + "fullName": "Scroll", + "shortName": "Scroll", + "rpc": ["https://rpc.scroll.io"], + "faucets": [], + "features": [], + "nativeCurrency": { + "chainId": 534352, + "name": "Ether", + "symbol": "ETH", + "decimals": 18, + "logoURL": "https://imagedelivery.net/PCnTHRkdRhGodr0AWBAvMA/Assets/blockchains/ethereum/info/logo.png/quality=85" + }, + "infoURL": "https://scrollscan.com/", + "explorers": [ + { + "name": "blockscout", + "url": "https://scrollscan.com/", + "standard": "EIP3091" + } + ] + }, { "chainId": 25, "name": "Cronos", diff --git a/packages/web3-shared/evm/src/constants/descriptors.ts b/packages/web3-shared/evm/src/constants/descriptors.ts index 081986367da5..4218d4118c9b 100644 --- a/packages/web3-shared/evm/src/constants/descriptors.ts +++ b/packages/web3-shared/evm/src/constants/descriptors.ts @@ -255,6 +255,17 @@ export const NETWORK_DESCRIPTORS: Array> averageBlockDelay: 10, isMainnet: true, }, + { + ID: `${PLUGIN_ID}_scroll`, + networkSupporterPluginID: PLUGIN_ID, + chainId: ChainId.Scroll, + type: NetworkType.Scroll, + name: 'Scroll', + icon: new URL('../assets/scroll.png', import.meta.url).href, + iconColor: 'rgb(255, 248, 243)', + averageBlockDelay: 9, + isMainnet: true, + }, { ID: `${PLUGIN_ID}_optimism`, networkSupporterPluginID: PLUGIN_ID, diff --git a/packages/web3-shared/evm/src/constants/tokens.ts b/packages/web3-shared/evm/src/constants/tokens.ts index 7a6c5070b7bd..373d91c5e746 100644 --- a/packages/web3-shared/evm/src/constants/tokens.ts +++ b/packages/web3-shared/evm/src/constants/tokens.ts @@ -90,4 +90,5 @@ export const WNATIVE_ONLY: ERC20AgainstToken = { [ChainId.Optimism]: [WNATIVE[ChainId.Optimism]], [ChainId.Optimism_Goerli]: [WNATIVE[ChainId.Optimism_Goerli]], [ChainId.Astar]: [WNATIVE[ChainId.Astar]], + [ChainId.Scroll]: [WNATIVE[ChainId.Scroll]], } diff --git a/packages/web3-shared/evm/src/types/index.ts b/packages/web3-shared/evm/src/types/index.ts index bf66b7593ec1..cbf91e28cd12 100644 --- a/packages/web3-shared/evm/src/types/index.ts +++ b/packages/web3-shared/evm/src/types/index.ts @@ -83,6 +83,8 @@ export enum ChainId { // Astar Astar = 592, + Scroll = 534352, + ZKSync_Alpha_Testnet = 280, Crossbell = 3737, @@ -272,6 +274,7 @@ export enum NetworkType { Optimism = 'Optimism', Conflux = 'Conflux', Astar = 'Astar', + Scroll = 'Scroll', Moonbeam = 'Moonbeam', CustomNetwork = 'CustomNetwork', }