From 7981aa4ed767678a3873a372244b6fbb484e23e7 Mon Sep 17 00:00:00 2001 From: SarveshLimaye Date: Sun, 17 Nov 2024 04:08:12 +0700 Subject: [PATCH] bridge between optimism and base link tokens enabled --- frontend/next.config.ts | 2 +- frontend/src/components/Bridge/Bridge.tsx | 2 -- frontend/src/utils/helper.ts | 37 +++++++++++++++++++++++ frontend/src/utils/providers.tsx | 10 ++++++ 4 files changed, 48 insertions(+), 3 deletions(-) diff --git a/frontend/next.config.ts b/frontend/next.config.ts index 10ee5b1..a780a1d 100644 --- a/frontend/next.config.ts +++ b/frontend/next.config.ts @@ -4,7 +4,7 @@ const nextConfig: NextConfig = { /* config options here */ reactStrictMode: true, images: { - domains: ["cryptologos.cc"], + domains: ["cryptologos.cc", "i.seadn.io"], dangerouslyAllowSVG: true, // Add your image host domain here }, }; diff --git a/frontend/src/components/Bridge/Bridge.tsx b/frontend/src/components/Bridge/Bridge.tsx index 5cd72a3..1d2b833 100644 --- a/frontend/src/components/Bridge/Bridge.tsx +++ b/frontend/src/components/Bridge/Bridge.tsx @@ -137,8 +137,6 @@ export default function Bridge() { ); console.log(amountToPass); - console.log(address); - const ccipFees = await poolContract.getCcipFeesForBridging( amountToPass, address!, diff --git a/frontend/src/utils/helper.ts b/frontend/src/utils/helper.ts index 6858d07..9a99fbe 100644 --- a/frontend/src/utils/helper.ts +++ b/frontend/src/utils/helper.ts @@ -89,6 +89,35 @@ export const chains = [ }, ], }, + { + id: 84532, + name: "Base Sepolia", + logo: "https://i.seadn.io/gcs/files/f75d772fba8058dbbbefbc0578bae807.png?auto=format&dpr=1&w=384", + factoryAddress: "0x275fC6E5b9BCE1b756EacA955b7758070099e07d", + tokens: [ + { + symbol: "LINK", + name: "Chainlink", + address: "0xE4aB69C077896252FAFBD49EFD26B5D171A32410", + logo: "https://cryptologos.cc/logos/chainlink-link-logo.svg?v=025", + }, + ], + }, + + { + id: 11155420, + name: "Optimism Sepolia", + logo: "https://cryptologos.cc/logos/optimism-ethereum-op-logo.png?v=025", + factoryAddress: "0xfa24eaD3De76045f875998dd1d75562057cEB26d", + tokens: [ + { + symbol: "LINK", + name: "Chainlink", + address: "0xE4aB69C077896252FAFBD49EFD26B5D171A32410", + logo: "https://cryptologos.cc/logos/chainlink-link-logo.svg?v=025", + }, + ], + }, ]; export const SEPOLIA_CHAIN_ID = 11155111; @@ -97,6 +126,10 @@ export const CARDONA_CHAIN_ID = 2442; export const ARBITUM_SEPOLIA_CHAIN_ID = 421614; +export const OPTIMISM_SEPOLIA_CHAIN_ID = 11155420; + +export const BASE_SEPOLIA_CHAIN_ID = 84532; + export const NATIVE_ADDRESS = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"; export const UNIFIED_BRIDGE = "0x528e26b25a34a4a5d0dbda1d57d318153d2ed582"; @@ -128,5 +161,9 @@ export const getPoolAddress = (srcChainId: number) => { return "0x29277F9207Ff093c206292c28406Ee51e1605166"; } else if (srcChainId === ARBITUM_SEPOLIA_CHAIN_ID) { return "0xD255FBb48513e92c7D7e2a16769dDDE92d8698E6"; + } else if (srcChainId === BASE_SEPOLIA_CHAIN_ID) { + return "0x0ffb63091d69A3c050FA5A788A68cff304F76ae6"; + } else if (srcChainId === OPTIMISM_SEPOLIA_CHAIN_ID) { + return "0xDAd3276564bEC357300F3cD7B852015ADc278A42"; } }; diff --git a/frontend/src/utils/providers.tsx b/frontend/src/utils/providers.tsx index 175004d..b2d6182 100644 --- a/frontend/src/utils/providers.tsx +++ b/frontend/src/utils/providers.tsx @@ -9,6 +9,8 @@ import { arbitrumSepolia, scrollSepolia, lineaSepolia, + baseSepolia, + optimismSepolia, } from "wagmi/chains"; import { type ReactNode, useState } from "react"; import { type State, WagmiProvider, createConfig, http } from "wagmi"; @@ -25,6 +27,8 @@ const connectkitConfig: any = createConfig( arbitrumSepolia, scrollSepolia, lineaSepolia, + baseSepolia, + optimismSepolia, ], transports: { [sepolia.id]: http( @@ -45,6 +49,12 @@ const connectkitConfig: any = createConfig( [lineaSepolia.id]: http( `https://linea-sepolia.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_ID}` ), + [baseSepolia.id]: http( + `https://base-sepolia.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_ID}` + ), + [optimismSepolia.id]: http( + `https://optimism-sepolia.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_ID}` + ), }, walletConnectProjectId: