From a6d4609f8366fbf611ae9047f7ac54322e121f7d Mon Sep 17 00:00:00 2001 From: Chaise Lapacik Date: Mon, 12 Feb 2024 14:41:12 -0800 Subject: [PATCH] [STABLE-5750] Add support for Sepolia --- README.md | 2 +- src/constants/addresses.ts | 12 +++++------ src/constants/chains.ts | 42 +++++++++++++++++++------------------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index fd9d5d8..da2d5aa 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # CCTP Sample App -A sample app used to demonstrate CCTP step by step capabilities on testnet. The app currently supports Ethereum Goerli, Avalanche Fuji C-Chain, and Arbitrum Goerli testnets. +A sample app used to demonstrate CCTP step by step capabilities on testnet. The app currently supports Ethereum Sepolia, Avalanche Fuji C-Chain, and Arbitrum Sepolia testnets. ![](./docs/screenshot.png) diff --git a/src/constants/addresses.ts b/src/constants/addresses.ts index 6cae3f8..b21e76c 100644 --- a/src/constants/addresses.ts +++ b/src/constants/addresses.ts @@ -4,31 +4,31 @@ import { SupportedChainId } from 'constants/chains' * Map of supported chains to USDC contract addresses */ export const CHAIN_IDS_TO_USDC_ADDRESSES = { - [SupportedChainId.ETH_GOERLI]: '0x07865c6E87B9F70255377e024ace6630C1Eaa37F', + [SupportedChainId.ETH_SEPOLIA]: '0x1c7d4b196cb0c7b01d743fbc6116a902379c7238', [SupportedChainId.AVAX_FUJI]: '0x5425890298aed601595a70AB815c96711a31Bc65', - [SupportedChainId.ARB_GOERLI]: '0xfd064a18f3bf249cf1f87fc203e90d8f650f2d63', + [SupportedChainId.ARB_SEPOLIA]: '0x75faf114eafb1bdbe2f0316df893fd58ce46aa4d', } /** * Map of supported chains to Token Messenger contract addresses */ export const CHAIN_IDS_TO_TOKEN_MESSENGER_ADDRESSES = { - [SupportedChainId.ETH_GOERLI]: '0xd0c3da58f55358142b8d3e06c1c30c5c6114efe8', + [SupportedChainId.ETH_SEPOLIA]: '0x9f3b8679c73c2fef8b59b4f3444d4e156fb70aa5', [SupportedChainId.AVAX_FUJI]: '0xeb08f243e5d3fcff26a9e38ae5520a669f4019d0', - [SupportedChainId.ARB_GOERLI]: '0x12dcfd3fe2e9eac2859fd1ed86d2ab8c5a2f9352', + [SupportedChainId.ARB_SEPOLIA]: '0x9f3b8679c73c2fef8b59b4f3444d4e156fb70aa5', } /** * Map of supported chains to Message Transmitter contract addresses */ export const CHAIN_IDS_TO_MESSAGE_TRANSMITTER_ADDRESSES = { - [SupportedChainId.ETH_GOERLI]: '0x26413e8157cd32011e726065a5462e97dd4d03d9', + [SupportedChainId.ETH_SEPOLIA]: '0x7865fafc2db2093669d92c0f33aeef291086befd', [SupportedChainId.AVAX_FUJI]: '0xa9fb1b3009dcb79e2fe346c16a604b8fa8ae0a79', - [SupportedChainId.ARB_GOERLI]: '0x109bc137cb64eab7c0b1dddd1edf341467dc2d35', + [SupportedChainId.ARB_SEPOLIA]: '0xacf1ceef35caac005e15888ddb8a3515c41b4872', } diff --git a/src/constants/chains.ts b/src/constants/chains.ts index bbdee72..e19f028 100644 --- a/src/constants/chains.ts +++ b/src/constants/chains.ts @@ -11,9 +11,9 @@ export enum Chain { * List of all the chain/network IDs supported */ export enum SupportedChainId { - ETH_GOERLI = 5, + ETH_SEPOLIA = 11155111, AVAX_FUJI = 43113, - ARB_GOERLI = 421613, + ARB_SEPOLIA = 421614, } /** @@ -21,9 +21,9 @@ export enum SupportedChainId { * TODO: Infer from SupportedChainId */ export const SupportedChainIdHex = { - ETH_GOERLI: '0x5', + ETH_SEPOLIA: '0xaa36a7', AVAX_FUJI: '0xa869', - ARB_GOERLI: '0x66eed', + ARB_SEPOLIA: '0x66eee', } interface ChainToChainIdMap { @@ -35,9 +35,9 @@ interface ChainToChainIdMap { */ export const CHAIN_TO_CHAIN_ID: ChainToChainIdMap = { - [Chain.ETH]: SupportedChainId.ETH_GOERLI, + [Chain.ETH]: SupportedChainId.ETH_SEPOLIA, [Chain.AVAX]: SupportedChainId.AVAX_FUJI, - [Chain.ARB]: SupportedChainId.ARB_GOERLI, + [Chain.ARB]: SupportedChainId.ARB_SEPOLIA, } interface ChainToChainNameMap { @@ -83,20 +83,20 @@ interface AddEthereumChainParameter { rpcUrls?: string[] } -const ETH_GOERLI: AddEthereumChainParameter = { - chainId: '0x5', - blockExplorerUrls: ['https://goerli.etherscan.io'], - chainName: 'Goerli Test Network', +const ETH_SEPOLIA: AddEthereumChainParameter = { + chainId: SupportedChainIdHex.ETH_SEPOLIA, + blockExplorerUrls: ['https://sepolia.etherscan.io'], + chainName: 'Sepolia Test Network', nativeCurrency: { - name: 'Goerli ETH', - symbol: 'gorETH', + name: 'Ethereum', + symbol: 'ETH', decimals: 18, }, - rpcUrls: ['https://goerli.infura.io/v3/'], + rpcUrls: ['https://sepolia.infura.io/v3/'], } const AVAX_FUJI: AddEthereumChainParameter = { - chainId: '0xa869', + chainId: SupportedChainIdHex.AVAX_FUJI, blockExplorerUrls: ['https://testnet.snowtrace.io/'], chainName: 'Avalanche FUJI C-Chain', nativeCurrency: { @@ -107,16 +107,16 @@ const AVAX_FUJI: AddEthereumChainParameter = { rpcUrls: ['https://api.avax-test.network/ext/bc/C/rpc'], } -const ARB_GOERLI: AddEthereumChainParameter = { - chainId: SupportedChainIdHex.ARB_GOERLI, - blockExplorerUrls: ['https://goerli.arbiscan.io/'], - chainName: 'Arbitrum Goerli Testnet', +const ARB_SEPOLIA: AddEthereumChainParameter = { + chainId: SupportedChainIdHex.ARB_SEPOLIA, + blockExplorerUrls: ['https://sepolia.arbiscan.io/'], + chainName: 'Arbitrum Sepolia Testnet', nativeCurrency: { name: 'Ethereum', symbol: 'ETH', decimals: 18, }, - rpcUrls: ['https://arb-goerli.g.alchemy.com/v2/demo'], + rpcUrls: ['https://arb-sepolia.g.alchemy.com/v2/demo'], } interface ChainIdToChainParameters { @@ -124,7 +124,7 @@ interface ChainIdToChainParameters { } export const CHAIN_ID_HEXES_TO_PARAMETERS: ChainIdToChainParameters = { - [SupportedChainIdHex.ETH_GOERLI]: ETH_GOERLI, + [SupportedChainIdHex.ETH_SEPOLIA]: ETH_SEPOLIA, [SupportedChainIdHex.AVAX_FUJI]: AVAX_FUJI, - [SupportedChainIdHex.ARB_GOERLI]: ARB_GOERLI, + [SupportedChainIdHex.ARB_SEPOLIA]: ARB_SEPOLIA, }