Skip to content

Commit

Permalink
Skip fetching the balance if the wrapper token does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Lbqds committed Nov 6, 2024
1 parent f81702b commit ff47346
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions bridge_ui/src/hooks/useGetSourceParsedTokenAccounts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ff47346

Please sign in to comment.