diff --git a/ethers-core/src/types/chain.rs b/ethers-core/src/types/chain.rs index 2fa3bd03e..63ebc4bd5 100644 --- a/ethers-core/src/types/chain.rs +++ b/ethers-core/src/types/chain.rs @@ -174,6 +174,10 @@ pub enum Chain { #[strum(to_string = "mantle-testnet")] #[serde(alias = "mantle_testnet")] MantleTestnet = 5001, + + Zora = 7777777, + ZoraGoerli = 999, + ZoraSepolia = 999999999, } // === impl Chain === @@ -312,7 +316,9 @@ impl Chain { Morden | Ropsten | Rinkeby | Goerli | Kovan | Sepolia | Holesky | Moonbase | MoonbeamDev | OptimismKovan | Poa | Sokol | Rsk | EmeraldTestnet | Boba | Base | BaseGoerli | ZkSync | ZkSyncTestnet | PolygonZkEvm | PolygonZkEvmTestnet | Metis | - Linea | LineaTestnet | Mantle | MantleTestnet => return None, + Linea | LineaTestnet | Mantle | MantleTestnet | Zora | ZoraGoerli | ZoraSepolia => { + return None + } }; Some(Duration::from_millis(ms)) @@ -378,7 +384,10 @@ impl Chain { LineaTestnet | FilecoinCalibrationTestnet | Gnosis | - Chiado => false, + Chiado | + Zora | + ZoraGoerli | + ZoraSepolia => false, // Unknown / not applicable, default to false for backwards compatibility Dev | AnvilHardhat | Morden | Ropsten | Rinkeby | Cronos | CronosTestnet | Kovan | @@ -571,10 +580,18 @@ impl Chain { ("https://explorer.testnet.mantle.xyz/api", "https://explorer.testnet.mantle.xyz") } + Zora => ("https://explorer.zora.energy/api", "https://explorer.zora.energy"), + ZoraGoerli => { + ("https://testnet.explorer.zora.energy/api", "https://testnet.explorer.zora.energy") + } + ZoraSepolia => { + ("https://sepolia.explorer.zora.energy/api", "https://sepolia.explorer.zora.energy") + } + AnvilHardhat | Dev | Morden | MoonbeamDev | FilecoinMainnet => { // this is explicitly exhaustive so we don't forget to add new urls when adding a // new chain - return None + return None; } }; @@ -636,7 +653,7 @@ impl Chain { Moonbeam | Moonbase | MoonbeamDev | Moonriver => "MOONSCAN_API_KEY", - Canto | CantoTestnet => "BLOCKSCOUT_API_KEY", + Canto | CantoTestnet | Zora | ZoraGoerli | ZoraSepolia => "BLOCKSCOUT_API_KEY", Boba => "BOBASCAN_API_KEY",