Skip to content

Commit

Permalink
Support Darwinia Arbitrum RING transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
JayJay1024 committed Nov 14, 2023
1 parent 2e43fdb commit f0cd4e4
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 4 deletions.
10 changes: 9 additions & 1 deletion packages/apps/src/bridges/helix-lpbridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@ export class HelixLpBridge extends BaseBridge {
sourceToken?: Token;
targetToken?: Token;
}) {
super(args);
const sourceToken = args.sourceToken;
const targetToken = args.targetToken;
if (args.sourceChain?.network === "darwinia-dvm" && sourceToken?.symbol === "RING") {
sourceToken.address = "0xE7578598Aac020abFB918f33A20faD5B71d670b4";
} else if (args.targetChain?.network === "darwinia-dvm" && targetToken?.symbol === "RING") {
targetToken.address = "0xE7578598Aac020abFB918f33A20faD5B71d670b4";
}
super({ ...args, sourceToken, targetToken });

this.initContract();

this.logo = args.logo ?? {
Expand Down
10 changes: 9 additions & 1 deletion packages/apps/src/bridges/helixbridge-dvmdvm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,15 @@ export class HelixBridgeDVMDVM extends BaseBridge {
sourceToken?: Token;
targetToken?: Token;
}) {
super(args);
const sourceToken = args.sourceToken;
const targetToken = args.targetToken;
if (args.sourceChain?.network === "darwinia-dvm" && sourceToken?.symbol === "RING") {
sourceToken.address = "0xE7578598Aac020abFB918f33A20faD5B71d670b4";
} else if (args.targetChain?.network === "darwinia-dvm" && targetToken?.symbol === "RING") {
targetToken.address = "0xE7578598Aac020abFB918f33A20faD5B71d670b4";
}
super({ ...args, sourceToken, targetToken });

this.initContract();
this.ensureSpecVersion();

Expand Down
10 changes: 9 additions & 1 deletion packages/apps/src/bridges/helixbridge-dvmevm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@ export class HelixBridgeDVMEVM extends BaseBridge {
sourceToken?: Token;
targetToken?: Token;
}) {
super(args);
const sourceToken = args.sourceToken;
const targetToken = args.targetToken;
if (args.sourceChain?.network === "darwinia-dvm" && sourceToken?.symbol === "RING") {
sourceToken.address = "0xE7578598Aac020abFB918f33A20faD5B71d670b4";
} else if (args.targetChain?.network === "darwinia-dvm" && targetToken?.symbol === "RING") {
targetToken.address = "0xE7578598Aac020abFB918f33A20faD5B71d670b4";
}
super({ ...args, sourceToken, targetToken });

this.initContract();

this.logo = args.logo ?? {
Expand Down
1 change: 1 addition & 0 deletions packages/apps/src/config/chains/arbitrum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const arbitrumChain: ChainConfig = {
logo: "ring.svg",
cross: [
{ target: { network: "ethereum", symbol: "RING" }, bridge: { category: "lnbridgev20-opposite" } },
{ target: { network: "darwinia-dvm", symbol: "RING" }, bridge: { category: "lnbridgev20-default" } },
{ target: { network: "polygon", symbol: "RING" }, bridge: { category: "lnbridgev20-default" } },
],
},
Expand Down
3 changes: 2 additions & 1 deletion packages/apps/src/config/chains/darwinia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ export const darwiniaChain: ChainConfig = {
symbol: "RING",
name: "RING",
type: "native",
address: "0xE7578598Aac020abFB918f33A20faD5B71d670b4",
address: "0x0000000000000000000000000000000000000000",
logo: "ring.svg",
cross: [
{ target: { network: "arbitrum", symbol: "RING" }, bridge: { category: "lnbridgev20-default" } },
{
target: { network: "crab-dvm", symbol: "xWRING" },
bridge: { category: "helix-sub2subv21(lock)" },
Expand Down

0 comments on commit f0cd4e4

Please sign in to comment.