Skip to content

Commit

Permalink
fix(bridge-ui): defaulting to source chain explorer for link to canon…
Browse files Browse the repository at this point in the history
…ical address (#16701)

Co-authored-by: Korbinian <[email protected]>
  • Loading branch information
ricecodekhmer and KorbinianK authored Apr 11, 2024
1 parent 55426ef commit 68bd435
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/bridge-ui/src/libs/token/getCanonicalInfoForToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,15 @@ const _getStatus = async ({ address, srcChainId, destChainId, type }: CheckCanon
// if both are zero we are dealing with a canonical address
canonicalTokenAddress = srcChainTokenAddress;
// But either chain passed could be the canonical chain, so we need to check which one
const checkSrcChainForCanonicalChain = (await srcTokenVaultContract.read.canonicalToBridged([
srcChainId,
const checkDestChainForCanonicalChain = (await destTokenVaultContract.read.canonicalToBridged([
destChainId,
srcChainTokenAddress,
])) as Address;

if (checkSrcChainForCanonicalChain === zeroAddress) {
canonicalChain = destChainId;
} else {
if (checkDestChainForCanonicalChain === zeroAddress) {
canonicalChain = srcChainId;
} else {
canonicalChain = destChainId;
}
} else if (destCanonicalCheck !== zeroAddress) {
// if the destination is not zero, we found a canonical address there
Expand Down

0 comments on commit 68bd435

Please sign in to comment.