From 9599cf77fe225df3298f0202c6f732bfb3408b86 Mon Sep 17 00:00:00 2001 From: Will Qiu Date: Fri, 29 Dec 2023 13:01:22 +0800 Subject: [PATCH 1/2] feat: add base sepolia --- src/chain.rs | 7 +++++++ src/named.rs | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/src/chain.rs b/src/chain.rs index be287e1..1406d22 100644 --- a/src/chain.rs +++ b/src/chain.rs @@ -286,6 +286,12 @@ impl Chain { Self::from_named(NamedChain::BaseGoerli) } + /// Returns the base sepolia chain. + #[inline] + pub const fn base_sepolia() -> Self { + Self::from_named(NamedChain::BaseSepolia) + } + /// Returns the base mainnet chain. #[inline] pub const fn base_mainnet() -> Self { @@ -322,6 +328,7 @@ impl Chain { | NamedChain::OptimismSepolia | NamedChain::Base | NamedChain::BaseGoerli + | NamedChain::BaseSepolia ) ) } diff --git a/src/named.rs b/src/named.rs index 396c991..4dbfd69 100644 --- a/src/named.rs +++ b/src/named.rs @@ -146,6 +146,7 @@ pub enum NamedChain { Base = 8453, BaseGoerli = 84531, + BaseSepolia = 84532, Linea = 59144, LineaTestnet = 59140, @@ -314,6 +315,7 @@ impl NamedChain { | C::OptimismSepolia | C::Base | C::BaseGoerli + | C::BaseSepolia | C::Zora | C::ZoraGoerli | C::ZoraSepolia => 2_000, @@ -421,6 +423,7 @@ impl NamedChain { | C::Holesky | C::Base | C::BaseGoerli + | C::BaseSepolia | C::Optimism | C::OptimismGoerli | C::OptimismSepolia @@ -480,6 +483,7 @@ impl NamedChain { | C::OptimismGoerli | C::OptimismSepolia | C::BaseGoerli + | C::BaseSepolia | C::Gnosis | C::Chiado | C::ZoraSepolia @@ -516,6 +520,7 @@ impl NamedChain { | C::AuroraTestnet | C::AvalancheFuji | C::BaseGoerli + | C::BaseSepolia | C::BinanceSmartChainTestnet | C::CantoTestnet | C::CronosTestnet @@ -770,6 +775,9 @@ impl NamedChain { C::Base => ("https://api.basescan.org/api", "https://basescan.org"), C::BaseGoerli => ("https://api-goerli.basescan.org/api", "https://goerli.basescan.org"), + C::BaseSepolia => { + ("https://api-sepolia.basescan.org/api", "https://sepolia.basescan.org") + } C::ZkSync => { ("https://zksync2-mainnet-explorer.zksync.io", "https://explorer.zksync.io") @@ -846,6 +854,7 @@ impl NamedChain { | C::Mantle | C::MantleTestnet | C::BaseGoerli + | C::BaseSepolia | C::Gnosis | C::Scroll | C::ScrollSepolia => "ETHERSCAN_API_KEY", From 69652b419adda3bec043c3c540d531ff03e49fd4 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Fri, 29 Dec 2023 14:58:28 +0100 Subject: [PATCH 2/2] chore: update chains.json --- assets/chains.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/assets/chains.json b/assets/chains.json index 824e0f6..3b27555 100644 --- a/assets/chains.json +++ b/assets/chains.json @@ -684,6 +684,18 @@ "etherscanBaseUrl": "https://goerli.basescan.org", "etherscanApiKeyName": "ETHERSCAN_API_KEY" }, + "84532": { + "internalId": "BaseSepolia", + "name": "base-sepolia", + "averageBlocktimeHint": 2000, + "isLegacy": false, + "supportsShanghai": true, + "isTestnet": true, + "nativeCurrencySymbol": null, + "etherscanApiUrl": "https://api-sepolia.basescan.org/api", + "etherscanBaseUrl": "https://sepolia.basescan.org", + "etherscanApiKeyName": "ETHERSCAN_API_KEY" + }, "314159": { "internalId": "FilecoinCalibrationTestnet", "name": "filecoin-calibration-testnet",