From 865ddc4379b06871ae042b0f943dfe2c77ec0c99 Mon Sep 17 00:00:00 2001 From: Kevin Peters Date: Tue, 24 Sep 2024 15:04:24 -0500 Subject: [PATCH] Allow all flavors of USDC to be transferred on Sui Should be removed once CCTP is launched on Sui and Wormhole-wrapped USDC flavors are deprecated. Fixes #2706 --- wormhole-connect/src/utils/index.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/wormhole-connect/src/utils/index.ts b/wormhole-connect/src/utils/index.ts index d465686bd..60252b084 100644 --- a/wormhole-connect/src/utils/index.ts +++ b/wormhole-connect/src/utils/index.ts @@ -113,6 +113,12 @@ export function getDisplayName(token: TokenConfig, chain: Chain): string { } const isEthereum = token.nativeChain === 'Ethereum'; + + // TODO: remove this once CCTP is launched on Sui + if (isStableCoin(token) && !isEthereum && chain === 'Sui') { + return `Wormhole-wrapped ${token.nativeChain} ${baseName}`; + } + const prefix = `Wormhole-wrapped ${ isFrankensteinToken(token, chain) ? isEthereum @@ -398,6 +404,12 @@ export const isFrankensteinToken = (token: TokenConfig, chain: Chain) => { return true; } + // TODO: Remove this once CCTP is launched on Sui + // Allow all USDC flavors to be transferred on Sui + if (token.symbol === 'USDC' && chain === 'Sui') { + return false; + } + return ( !(['Ethereum', 'Sepolia'] as Chain[]).includes(nativeChain) && ['ETH', 'WETH', 'wstETH', 'USDT', 'USDC', 'USDC.e'].includes(symbol) @@ -414,6 +426,10 @@ export const isCanonicalToken = (token: TokenConfig, chain: Chain) => { return token.key === 'USDCeth' && chain === 'Sui'; }; +export const isStableCoin = (token: TokenConfig) => { + return token.symbol === 'USDC' || token.symbol === 'USDT'; +}; + export const millisToHumanString = (ts: number): string => { if (ts > 60000) { const minutes = Math.ceil(ts / 60000);