diff --git a/ethers-core/src/types/chain.rs b/ethers-core/src/types/chain.rs index a7bad24c2..4dbac50fb 100644 --- a/ethers-core/src/types/chain.rs +++ b/ethers-core/src/types/chain.rs @@ -197,6 +197,8 @@ pub enum Chain { Mode = 34443, ModeSepolia = 919, + + KakarotSepolia = 107107114116, } // === impl Chain === @@ -334,11 +336,11 @@ impl Chain { 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 | - BaseGoerli | BaseSepolia | BlastSepolia | ZkSync | ZkSyncTestnet | PolygonZkEvm | - PolygonZkEvmTestnet | Metis | Linea | LineaTestnet | Mantle | MantleTestnet | - Zora | ZoraGoerli | ZoraSepolia => return None, + Morden | Ropsten | Rinkeby | Goerli | Kovan | Sepolia | Holesky | Moonbase + | MoonbeamDev | OptimismKovan | Poa | Sokol | Rsk | EmeraldTestnet | Boba | Base + | BaseGoerli | BaseSepolia | BlastSepolia | ZkSync | ZkSyncTestnet | PolygonZkEvm + | PolygonZkEvmTestnet | Metis | Linea | LineaTestnet | Mantle | MantleTestnet + | Zora | ZoraGoerli | ZoraSepolia | KakarotSepolia => return None, }; Some(Duration::from_millis(ms)) @@ -359,68 +361,69 @@ impl Chain { match self { // Known legacy chains / non EIP-1559 compliant - OptimismKovan | - Fantom | - FantomTestnet | - BinanceSmartChain | - BinanceSmartChainTestnet | - ArbitrumTestnet | - Rsk | - Oasis | - Emerald | - EmeraldTestnet | - Celo | - CeloAlfajores | - CeloBaklava | - Boba | - ZkSync | - ZkSyncTestnet | - Mantle | - MantleTestnet | - PolygonZkEvm | - PolygonZkEvmTestnet | - Metis | - Viction | - Scroll | - ScrollSepolia => true, + OptimismKovan + | Fantom + | FantomTestnet + | BinanceSmartChain + | BinanceSmartChainTestnet + | ArbitrumTestnet + | Rsk + | Oasis + | Emerald + | EmeraldTestnet + | Celo + | CeloAlfajores + | CeloBaklava + | Boba + | ZkSync + | ZkSyncTestnet + | Mantle + | MantleTestnet + | PolygonZkEvm + | PolygonZkEvmTestnet + | Metis + | Viction + | Scroll + | ScrollSepolia => true, // Known EIP-1559 chains - Mainnet | - Goerli | - Sepolia | - Holesky | - Base | - BaseGoerli | - BaseSepolia | - BlastSepolia | - Optimism | - OptimismGoerli | - OptimismSepolia | - Polygon | - PolygonMumbai | - PolygonAmoy | - Avalanche | - AvalancheFuji | - Arbitrum | - ArbitrumGoerli | - ArbitrumSepolia | - ArbitrumNova | - FilecoinMainnet | - Linea | - LineaTestnet | - FilecoinCalibrationTestnet | - Gnosis | - Chiado | - Mode | - ModeSepolia | - Zora | - ZoraGoerli | - ZoraSepolia => false, + Mainnet + | Goerli + | Sepolia + | Holesky + | Base + | BaseGoerli + | BaseSepolia + | BlastSepolia + | Optimism + | OptimismGoerli + | OptimismSepolia + | Polygon + | PolygonMumbai + | PolygonAmoy + | Avalanche + | AvalancheFuji + | Arbitrum + | ArbitrumGoerli + | ArbitrumSepolia + | ArbitrumNova + | FilecoinMainnet + | Linea + | LineaTestnet + | FilecoinCalibrationTestnet + | Gnosis + | Chiado + | Mode + | ModeSepolia + | Zora + | ZoraGoerli + | ZoraSepolia + | KakarotSepolia => false, // Unknown / not applicable, default to false for backwards compatibility - Dev | AnvilHardhat | Morden | Ropsten | Rinkeby | Cronos | CronosTestnet | Kovan | - Sokol | Poa | Moonbeam | MoonbeamDev | Moonriver | Moonbase | Evmos | - EvmosTestnet | Aurora | AuroraTestnet | Canto | CantoTestnet | ScrollAlphaTestnet => { + Dev | AnvilHardhat | Morden | Ropsten | Rinkeby | Cronos | CronosTestnet | Kovan + | Sokol | Poa | Moonbeam | MoonbeamDev | Moonriver | Moonbase | Evmos + | EvmosTestnet | Aurora | AuroraTestnet | Canto | CantoTestnet | ScrollAlphaTestnet => { false } } @@ -627,11 +630,14 @@ impl Chain { ZoraSepolia => { ("https://sepolia.explorer.zora.energy/api", "https://sepolia.explorer.zora.energy") } + KakarotSepolia => { + ("https://sepolia.kakarotscan.org/api", "https://sepolia.kakarotscan.org") + } 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; } Viction => ("https://www.vicscan.xyz/api", "https://www.vicscan.xyz"), @@ -659,41 +665,41 @@ impl Chain { use Chain::*; let api_key_name = match self { - Mainnet | - Morden | - Ropsten | - Kovan | - Rinkeby | - Goerli | - Holesky | - Optimism | - OptimismGoerli | - OptimismKovan | - OptimismSepolia | - BinanceSmartChain | - BinanceSmartChainTestnet | - Arbitrum | - ArbitrumTestnet | - ArbitrumGoerli | - ArbitrumSepolia | - ArbitrumNova | - Cronos | - CronosTestnet | - Aurora | - AuroraTestnet | - Celo | - CeloAlfajores | - CeloBaklava | - Base | - Linea | - Mantle | - MantleTestnet | - BaseGoerli | - BaseSepolia | - BlastSepolia | - Gnosis | - Scroll | - ScrollSepolia => "ETHERSCAN_API_KEY", + Mainnet + | Morden + | Ropsten + | Kovan + | Rinkeby + | Goerli + | Holesky + | Optimism + | OptimismGoerli + | OptimismKovan + | OptimismSepolia + | BinanceSmartChain + | BinanceSmartChainTestnet + | Arbitrum + | ArbitrumTestnet + | ArbitrumGoerli + | ArbitrumSepolia + | ArbitrumNova + | Cronos + | CronosTestnet + | Aurora + | AuroraTestnet + | Celo + | CeloAlfajores + | CeloBaklava + | Base + | Linea + | Mantle + | MantleTestnet + | BaseGoerli + | BaseSepolia + | BlastSepolia + | Gnosis + | Scroll + | ScrollSepolia => "ETHERSCAN_API_KEY", Avalanche | AvalancheFuji => "SNOWTRACE_API_KEY", @@ -705,33 +711,32 @@ impl Chain { Moonbeam | Moonbase | MoonbeamDev | Moonriver => "MOONSCAN_API_KEY", - Canto | CantoTestnet | Zora | ZoraGoerli | ZoraSepolia | Mode | ModeSepolia => { - "BLOCKSCOUT_API_KEY" - } + Canto | CantoTestnet | Zora | ZoraGoerli | ZoraSepolia | Mode | ModeSepolia + | KakarotSepolia => "BLOCKSCOUT_API_KEY", Boba => "BOBASCAN_API_KEY", // Explicitly exhaustive. See NB above. - ScrollAlphaTestnet | - Metis | - Chiado | - Sepolia | - Rsk | - Sokol | - Poa | - Oasis | - Emerald | - EmeraldTestnet | - Evmos | - EvmosTestnet | - AnvilHardhat | - Dev | - ZkSync | - ZkSyncTestnet | - FilecoinMainnet | - LineaTestnet | - Viction | - FilecoinCalibrationTestnet => return None, + ScrollAlphaTestnet + | Metis + | Chiado + | Sepolia + | Rsk + | Sokol + | Poa + | Oasis + | Emerald + | EmeraldTestnet + | Evmos + | EvmosTestnet + | AnvilHardhat + | Dev + | ZkSync + | ZkSyncTestnet + | FilecoinMainnet + | LineaTestnet + | Viction + | FilecoinCalibrationTestnet => return None, }; Some(api_key_name)