Skip to content

Commit

Permalink
fix: xcm decoding identify correct erc20 contract (#1079)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xKheops authored Sep 18, 2023
1 parent 5aadf99 commit 0267dda
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,20 @@ export const EthSignMoonXTokensTransfer: FC = () => {
}

const token = tokens.find(
(t) => t.type === "evm-erc20" && t.contractAddress === currencyAddress
(t) =>
t.type === "evm-erc20" &&
t.evmNetwork?.id === network?.id &&
t.contractAddress === currencyAddress
)

if (token) {
const { decimals, symbol, coingeckoId, logo } = token
return { decimals, symbol, coingeckoId, image: logo }
}

const { decimals, symbol, coingeckoId, image } = erc20.token || {}
return { decimals, symbol, coingeckoId, image: image }
}, [currencyAddress, erc20.token, nativeToken, tokens])
}, [currencyAddress, erc20.token, nativeToken, network?.id, tokens])

const target = useMemo(() => decodeMultilocation(destination), [destination])

Expand Down

0 comments on commit 0267dda

Please sign in to comment.