From ff4734692239b774955122e08c9d7b33529a1351 Mon Sep 17 00:00:00 2001 From: lbqds Date: Wed, 6 Nov 2024 08:02:55 +0800 Subject: [PATCH] Skip fetching the balance if the wrapper token does not exist --- bridge_ui/src/hooks/useGetSourceParsedTokenAccounts.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/bridge_ui/src/hooks/useGetSourceParsedTokenAccounts.tsx b/bridge_ui/src/hooks/useGetSourceParsedTokenAccounts.tsx index 48335e08..eae68fa1 100644 --- a/bridge_ui/src/hooks/useGetSourceParsedTokenAccounts.tsx +++ b/bridge_ui/src/hooks/useGetSourceParsedTokenAccounts.tsx @@ -599,6 +599,7 @@ export const getEVMAccounts = async (chainId: ChainId, signer: ethers.Signer, wa : await ethers_contracts.BridgeImplementation__factory .connect(getTokenBridgeAddressForChain(chainId), signer) .wrappedAsset(token.tokenChain, hexToUint8Array(token.tokenAddress)) + if (tokenId === ethers.constants.AddressZero) return undefined const tokenContract = ethers_contracts.ERC20__factory.connect(tokenId, signer) const amount = await tokenContract.balanceOf(walletAddress) return {