From 584d0fffa9590c65b3e2271ee8e58e111162e3cd Mon Sep 17 00:00:00 2001 From: zilayo <84344709+zilayo@users.noreply.github.com> Date: Wed, 31 Jan 2024 16:14:24 +0000 Subject: [PATCH] feat: Add Mode & Mode Sepolia (#2720) --- ethers-contract/src/multicall/constants.rs | 1 + ethers-core/src/types/chain.rs | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ethers-contract/src/multicall/constants.rs b/ethers-contract/src/multicall/constants.rs index 7e30d70c6..2579ea991 100644 --- a/ethers-contract/src/multicall/constants.rs +++ b/ethers-contract/src/multicall/constants.rs @@ -76,5 +76,6 @@ pub const MULTICALL_SUPPORTED_CHAIN_IDS: &[u64] = { 321, // KCC 106, // Velas 40, // Telos + Mode as u64, // Mode Mainnet ] }; diff --git a/ethers-core/src/types/chain.rs b/ethers-core/src/types/chain.rs index 54b972b02..fd80c5232 100644 --- a/ethers-core/src/types/chain.rs +++ b/ethers-core/src/types/chain.rs @@ -183,6 +183,9 @@ pub enum Chain { Zora = 7777777, ZoraGoerli = 999, ZoraSepolia = 999999999, + + Mode = 34443, + ModeSepolia = 919, } // === impl Chain === @@ -318,6 +321,7 @@ impl Chain { Scroll | ScrollSepolia | ScrollAlphaTestnet => 3_000, Gnosis | Chiado => 5_000, Viction => 2_000, + Mode | ModeSepolia => 2_000, // Explicitly exhaustive. See NB above. Morden | Ropsten | Rinkeby | Goerli | Kovan | Sepolia | Holesky | Moonbase | MoonbeamDev | OptimismKovan | Poa | Sokol | Rsk | EmeraldTestnet | Boba | Base | @@ -394,6 +398,8 @@ impl Chain { FilecoinCalibrationTestnet | Gnosis | Chiado | + Mode | + ModeSepolia | Zora | ZoraGoerli | ZoraSepolia => false, @@ -609,6 +615,12 @@ impl Chain { return None } Viction => ("https://www.vicscan.xyz/api", "https://www.vicscan.xyz"), + + Mode => ("https://explorer.mode.network/api", "https://explorer.mode.network"), + ModeSepolia => ( + "https://sepolia.explorer.mode.network/api", + "https://sepolia.explorer.mode.network", + ), }; Some(urls) @@ -671,7 +683,9 @@ impl Chain { Moonbeam | Moonbase | MoonbeamDev | Moonriver => "MOONSCAN_API_KEY", - Canto | CantoTestnet | Zora | ZoraGoerli | ZoraSepolia => "BLOCKSCOUT_API_KEY", + Canto | CantoTestnet | Zora | ZoraGoerli | ZoraSepolia | Mode | ModeSepolia => { + "BLOCKSCOUT_API_KEY" + } Boba => "BOBASCAN_API_KEY",