diff --git a/packages/apps/src/bridges/helixbridge-dvmdvm.ts b/packages/apps/src/bridges/helixbridge-dvmdvm.ts index 712d049fd..7d3494f3d 100644 --- a/packages/apps/src/bridges/helixbridge-dvmdvm.ts +++ b/packages/apps/src/bridges/helixbridge-dvmdvm.ts @@ -101,9 +101,17 @@ export class HelixBridgeDVMDVM extends BaseBridge { } private async burn(_: string, recipient: string, amount: bigint, options?: { totalFee: bigint }) { - if (options && this.contract && this.specVersion && this.sourceToken && this.publicClient && this.walletClient) { + if ( + options && + this.contract && + this.specVersion && + this.sourceToken && + this.targetToken && + this.publicClient && + this.walletClient + ) { const { args, value, functionName } = - this.sourceToken.type === "native" + this.targetToken.type === "native" ? { functionName: "burnAndRemoteUnlockNative", args: [this.specVersion.target, this.gasLimit, recipient, amount], diff --git a/packages/apps/src/bridges/helixbridge-dvmevm.ts b/packages/apps/src/bridges/helixbridge-dvmevm.ts index 23541ed34..d06270dee 100644 --- a/packages/apps/src/bridges/helixbridge-dvmevm.ts +++ b/packages/apps/src/bridges/helixbridge-dvmevm.ts @@ -70,9 +70,9 @@ export class HelixBridgeDVMEVM extends BaseBridge { } private async burn(_: string, recipient: string, amount: bigint, options?: { totalFee: bigint }) { - if (options && this.contract && this.sourceToken && this.publicClient && this.walletClient) { + if (options && this.contract && this.sourceToken && this.targetToken && this.publicClient && this.walletClient) { const { args, functionName } = - this.sourceToken.type === "native" + this.targetToken.type === "native" ? { functionName: "burnAndRemoteUnlockNative", args: [recipient, amount], diff --git a/packages/apps/src/components/record-detail.tsx b/packages/apps/src/components/record-detail.tsx index 7347f0a87..82f51b9cb 100644 --- a/packages/apps/src/components/record-detail.tsx +++ b/packages/apps/src/components/record-detail.tsx @@ -36,12 +36,14 @@ export default function RecordDetail(props: Props) { }); const bridgeClient = useMemo(() => { + const category = record?.historyRecordById?.bridge; const sourceChain = getChainConfig(record?.historyRecordById?.fromChain); const targetChain = getChainConfig(record?.historyRecordById?.toChain); - const category = record?.historyRecordById?.bridge; + const sourceToken = sourceChain?.tokens.find((t) => t.symbol === record?.historyRecordById?.sendToken); + const targetToken = targetChain?.tokens.find((t) => t.symbol === record?.historyRecordById?.recvToken); - if (sourceChain && targetChain && category) { - return bridgeFactory({ category, sourceChain, targetChain }); + if (category) { + return bridgeFactory({ category, sourceChain, targetChain, sourceToken, targetToken }); } return undefined; diff --git a/packages/apps/src/config/chains/arbitrum.ts b/packages/apps/src/config/chains/arbitrum.ts index 9c929eaa6..6ae44bf0a 100644 --- a/packages/apps/src/config/chains/arbitrum.ts +++ b/packages/apps/src/config/chains/arbitrum.ts @@ -43,5 +43,14 @@ export const arbitrumChain: ChainConfig = { logo: "ring.svg", cross: [{ target: { network: "ethereum", symbol: "RING" }, bridge: { category: "lnbridgev20-opposite" } }], }, + { + decimals: 18, + symbol: "USDT", + name: "USDT", + type: "erc20", + address: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9", + logo: "usdt.svg", + cross: [{ target: { network: "mantle", symbol: "USDT" }, bridge: { category: "lnbridgev20-default" } }], + }, ], }; diff --git a/packages/apps/src/config/chains/darwinia.ts b/packages/apps/src/config/chains/darwinia.ts index f8cb2fa55..a38ef849b 100644 --- a/packages/apps/src/config/chains/darwinia.ts +++ b/packages/apps/src/config/chains/darwinia.ts @@ -41,11 +41,6 @@ export const darwiniaChain: ChainConfig = { bridge: { category: "helix-sub2subv21(lock)" }, action: "issue", }, - { - target: { network: "ethereum", symbol: "RING" }, - bridge: { category: "helix-sub2ethv2(lock)" }, - action: "issue", - }, { target: { network: "ethereum", symbol: "RING" }, bridge: { category: "lpbridge-darwinia-dvm" }, @@ -54,8 +49,22 @@ export const darwiniaChain: ChainConfig = { index: 0, price: 440000n, }, + { + target: { network: "ethereum", symbol: "RING" }, + bridge: { category: "helix-sub2ethv2(lock)" }, + action: "issue", + }, ], }, + { + decimals: 18, + symbol: "WRING", + name: "WRING", + type: "erc20", + address: "0x", + logo: "ring.svg", + cross: [], + }, { decimals: 18, symbol: "KTON", diff --git a/packages/apps/src/config/chains/ethereum.ts b/packages/apps/src/config/chains/ethereum.ts index 18ae528b0..a6c53633f 100644 --- a/packages/apps/src/config/chains/ethereum.ts +++ b/packages/apps/src/config/chains/ethereum.ts @@ -48,15 +48,15 @@ export const ethereumChain: ChainConfig = { { target: { network: "arbitrum", symbol: "RING" }, bridge: { category: "lnbridgev20-default" } }, { target: { network: "darwinia-dvm", symbol: "RING" }, - bridge: { category: "helix-sub2ethv2(unlock)" }, + bridge: { category: "lpbridge-ethereum" }, action: "redeem", + baseFee: parseUnits("3000", 18), + index: 0, }, { target: { network: "darwinia-dvm", symbol: "RING" }, - bridge: { category: "lpbridge-ethereum" }, + bridge: { category: "helix-sub2ethv2(unlock)" }, action: "redeem", - baseFee: parseUnits("3000", 18), - index: 0, }, ], }, diff --git a/packages/apps/src/config/chains/mantle.ts b/packages/apps/src/config/chains/mantle.ts index 21d114f84..38f2af4d8 100644 --- a/packages/apps/src/config/chains/mantle.ts +++ b/packages/apps/src/config/chains/mantle.ts @@ -26,5 +26,15 @@ export const mantleChain: ChainConfig = { url: "https://explorer.mantle.xyz/", }, }, - tokens: [], + tokens: [ + { + decimals: 18, + symbol: "USDT", + name: "USDT", + type: "erc20", + address: "0x201EBa5CC46D216Ce6DC03F6a759e8E766e956aE", + logo: "usdt.svg", + cross: [{ target: { network: "arbitrum", symbol: "USDT" }, bridge: { category: "lnbridgev20-default" } }], + }, + ], }; diff --git a/packages/apps/src/types/token.ts b/packages/apps/src/types/token.ts index 25f648ba1..d7e979c24 100644 --- a/packages/apps/src/types/token.ts +++ b/packages/apps/src/types/token.ts @@ -9,6 +9,7 @@ export type TokenSymbol = | "ORING" | "CRAB" | "KTON" + | "WRING" | "xWRING" | "xWCRAB" | "MNT";