diff --git a/packages/apps/public/images/network/scroll.png b/packages/apps/public/images/network/scroll.png new file mode 100644 index 000000000..4939fb4dc Binary files /dev/null and b/packages/apps/public/images/network/scroll.png differ diff --git a/packages/apps/src/config/chains/mantle.ts b/packages/apps/src/config/chains/mantle.ts index 94812a2ed..2df4b154f 100644 --- a/packages/apps/src/config/chains/mantle.ts +++ b/packages/apps/src/config/chains/mantle.ts @@ -37,6 +37,7 @@ export const mantleChain: ChainConfig = { cross: [ { target: { network: "arbitrum", symbol: "USDT" }, bridge: { category: "lnbridgev20-default" } }, { target: { network: "zksync", symbol: "USDT" }, bridge: { category: "lnbridgev20-default" } }, + { target: { network: "scroll", symbol: "USDT" }, bridge: { category: "lnbridgev20-default" } }, ], }, ], diff --git a/packages/apps/src/config/chains/scroll.ts b/packages/apps/src/config/chains/scroll.ts new file mode 100644 index 000000000..45675654d --- /dev/null +++ b/packages/apps/src/config/chains/scroll.ts @@ -0,0 +1,43 @@ +import { ChainConfig, ChainID } from "@/types/chain"; + +export const scrollChain: ChainConfig = { + id: ChainID.SCROLL, + network: "scroll", + name: "Scroll", + logo: "scroll.png", + nativeCurrency: { + name: "ETH", + symbol: "ETH", + decimals: 18, + }, + rpcUrls: { + default: { + http: ["https://rpc.scroll.io"], + webSocket: [], + }, + public: { + http: ["https://rpc.scroll.io"], + webSocket: [], + }, + }, + blockExplorers: { + default: { + name: "Scrollscan", + url: "https://scrollscan.com", + }, + }, + tokens: [ + { + decimals: 6, + symbol: "USDT", + name: "USDT", + type: "erc20", + address: "0xf55BEC9cafDbE8730f096Aa55dad6D22d44099Df", + logo: "usdt.svg", + cross: [ + { target: { network: "mantle", symbol: "USDT" }, bridge: { category: "lnbridgev20-default" } }, + { target: { network: "zksync", symbol: "USDT" }, bridge: { category: "lnbridgev20-default" } }, + ], + }, + ], +}; diff --git a/packages/apps/src/config/chains/zksync.ts b/packages/apps/src/config/chains/zksync.ts index 25e2cd6a6..551bea41c 100644 --- a/packages/apps/src/config/chains/zksync.ts +++ b/packages/apps/src/config/chains/zksync.ts @@ -37,6 +37,7 @@ export const zksyncChain: ChainConfig = { cross: [ { target: { network: "arbitrum", symbol: "USDT" }, bridge: { category: "lnbridgev20-default" } }, { target: { network: "mantle", symbol: "USDT" }, bridge: { category: "lnbridgev20-default" } }, + { target: { network: "scroll", symbol: "USDT" }, bridge: { category: "lnbridgev20-default" } }, ], }, ], diff --git a/packages/apps/src/providers/rainbow-provider.tsx b/packages/apps/src/providers/rainbow-provider.tsx index 54079235f..89c84fabb 100644 --- a/packages/apps/src/providers/rainbow-provider.tsx +++ b/packages/apps/src/providers/rainbow-provider.tsx @@ -22,6 +22,7 @@ import { darwiniaChain } from "@/config/chains/darwinia"; import { crabChain } from "@/config/chains/crab"; import { polygonChain } from "@/config/chains/polygon"; import { mumbaiChain } from "@/config/chains/mumbai"; +import { scrollChain } from "@/config/chains/scroll"; const projectId = process.env.NEXT_PUBLIC_WALLET_CONNECT_ID || ""; const appName = "Helix Bridge"; @@ -30,6 +31,7 @@ const { tokens: _1, ...darwinia } = darwiniaChain; const { tokens: _2, ...crab } = crabChain; const { tokens: _3, ...polygon } = polygonChain; const { tokens: _4, ...mumbai } = mumbaiChain; +const { tokens: _5, ...scroll } = scrollChain; export default function RainbowProvider({ children }: PropsWithChildren) { const { chains, publicClient } = configureChains( @@ -48,6 +50,7 @@ export default function RainbowProvider({ children }: PropsWithChildren crab, polygon, mumbai, + scroll, ], [publicProvider()], ); diff --git a/packages/apps/src/types/chain.ts b/packages/apps/src/types/chain.ts index 1840377b0..f00736152 100644 --- a/packages/apps/src/types/chain.ts +++ b/packages/apps/src/types/chain.ts @@ -25,6 +25,8 @@ export enum ChainID { MUMBAI = 80001, POLYGON = 137, + + SCROLL = 534352, } // According to graphql indexer @@ -44,7 +46,8 @@ export type Network = | "mantle" | "mantle-goerli" | "polygon" - | "mumbai"; + | "mumbai" + | "scroll"; export interface ChainConfig extends Chain { id: ChainID; diff --git a/packages/apps/src/utils/chain.ts b/packages/apps/src/utils/chain.ts index c9467aebb..0e9a0270d 100644 --- a/packages/apps/src/utils/chain.ts +++ b/packages/apps/src/utils/chain.ts @@ -16,6 +16,7 @@ import { ChainConfig, ChainID, Network } from "@/types/chain"; import { isProduction } from "./env"; import { polygonChain } from "@/config/chains/polygon"; import { mumbaiChain } from "@/config/chains/mumbai"; +import { scrollChain } from "@/config/chains/scroll"; export function getChainConfig(chainIdOrNetwork?: ChainID | Network | null): ChainConfig | undefined { switch (chainIdOrNetwork) { @@ -67,6 +68,9 @@ export function getChainConfig(chainIdOrNetwork?: ChainID | Network | null): Cha case ChainID.MUMBAI: case "mumbai": return mumbaiChain; + case ChainID.SCROLL: + case "scroll": + return scrollChain; default: return; } @@ -90,6 +94,7 @@ export function getChainsConfig() { zksyncGoerliChain, mumbaiChain, polygonChain, + scrollChain, ]; if (isProduction()) {