use alloy_primitives::{Address, address};
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[cfg_attr(feature = "schema", schemars(rename_all = "snake_case"))]
#[repr(u64)]
#[allow(missing_docs)]
#[non_exhaustive]
pub enum NamedChain {
Mainnet = 1,
Morden = 2,
Ropsten = 3,
Rinkeby = 4,
Goerli = 5,
Optimism = 10,
Flare = 14,
Elastos = 20,
Cronos = 25,
Rsk = 30,
RskTestnet = 31,
TelosEvm = 40,
TelosEvmTestnet = 41,
Kovan = 42,
Crab = 44,
Darwinia = 46,
XdcMainnet = 50,
XdcTestnet = 51,
BinanceSmartChain = 56,
OptimismKovan = 69,
CfxTestnet = 71,
Sokol = 77,
Viction = 88,
BinanceSmartChainTestnet = 97,
Poa = 99,
Gnosis = 100,
FlareCoston2 = 114,
Fuse = 122,
Unichain = 130,
Polygon = 137,
Monad = 143,
Sonic = 146,
Shimmer = 148,
Redbelly = 151,
RedbellyTestnet = 153,
OpBNBMainnet = 204,
HappychainTestnet = 216,
Lens = 232,
Fantom = 250,
Fraxtal = 252,
Boba = 288,
ZkSyncTestnet = 300,
FilecoinMainnet = 314,
ZkSync = 324,
CronosTestnet = 338,
Pulsechain = 369,
Syndr = 404,
OptimismGoerli = 420,
Pgn = 424,
World = 480,
AcalaMandalaTestnet = 595,
KaruraTestnet = 596,
AcalaTestnet = 597,
BattleChain = 626,
BattleChainTestnet = 627,
Karura = 686,
Koi = 701,
CantoTestnet = 740,
Acala = 787,
ModeSepolia = 919,
PulsechainTestnet = 943,
StableMainnet = 988,
Hyperliquid = 999,
Cfx = 1030,
Metis = 1088,
Core = 1116,
Lisk = 1135,
MoonbeamDev = 1281,
Moonbeam = 1284,
Moonriver = 1285,
Moonbase = 1287,
UnichainSepolia = 1301,
SeiTestnet = 1328,
Sei = 1329,
Dev = 1337,
InjectiveTestnet = 1439,
Vana = 1480,
Story = 1514,
GravityAlphaMainnet = 1625,
Injective = 1776,
Soneium = 1868,
SoneiumMinatoTestnet = 1946,
Ronin = 2020,
StableTestnet = 2201,
FraxtalTestnet = 2522,
Abstract = 2741,
FantomTestnet = 4002,
Merlin = 4200,
Tempo = 4217,
MegaEth = 4326,
MemeCore = 4352,
Robinhood = 4663,
Iotex = 4689,
WorldSepolia = 4801,
Mantle = 5000,
MantleSepolia = 5003,
OpBNBTestnet = 5611,
MegaEthTestnet = 6343,
Zeta = 7000,
Canto = 7700,
Kaia = 8217,
Base = 8453,
EvmosTestnet = 9000,
Evmos = 9001,
Plasma = 9745,
PlasmaTestnet = 9746,
MonadTestnet = 10143,
Chiado = 10200,
AbstractTestnet = 11124,
Cannon = 13370,
Immutable = 13371,
ImmutableTestnet = 13473,
GravityAlphaTestnetSepolia = 13505,
SignetPecorino = 14174,
SonicTestnet = 14601,
Holesky = 17000,
FluentDevnet = 20993,
FluentTestnet = 20994,
Fluent = 25363,
Oasis = 26863,
TempoDevnet = 31318,
AnvilHardhat = 31337,
Curtis = 33111,
ApeChain = 33139,
Mode = 34443,
LensTestnet = 37111,
Arbitrum = 42161,
ArbitrumNova = 42170,
Celo = 42220,
EmeraldTestnet = 42261,
Emerald = 42262,
TempoTestnet = 42429,
TempoModerato = 42431,
Etherlink = 42793,
AvalancheFuji = 43113,
Avalanche = 43114,
Formicarium = 43521,
Insectarium = 43522,
RobinhoodTestnet = 46630,
Sophon = 50104,
Superposition = 55244,
Ink = 57073,
PgnSepolia = 58008,
LineaGoerli = 59140,
LineaSepolia = 59141,
Linea = 59144,
Bob = 60808,
Treasure = 61166,
RadiusTestnet = 72344,
PolygonAmoy = 80002,
BerachainBepolia = 80069,
Berachain = 80094,
Blast = 81457,
BaseGoerli = 84531,
BaseSepolia = 84532,
Plume = 98866,
PlumeTestnet = 98867,
SuperpositionTestnet = 98985,
Gravity = 127001,
EtherlinkShadownet = 127823,
Taiko = 167000,
TaikoHekla = 167009,
Bitlayer = 200901,
RoninTestnet = 202601,
FilecoinCalibrationTestnet = 314159,
ArbitrumTestnet = 421611,
ArbitrumGoerli = 421613,
ArbitrumSepolia = 421614,
SyndrSepolia = 444444,
AutonomysNovaTestnet = 490000,
ScrollSepolia = 534351,
Scroll = 534352,
Hoodi = 560048,
Xai = 660279,
Radius = 723487,
Katana = 747474,
InkSepolia = 763373,
BobSepolia = 808813,
Odyssey = 911867,
TreasureTopaz = 978658,
ArcTestnet = 5042002,
Zora = 7777777,
CeloSepolia = 11142220,
Sepolia = 11155111,
OptimismSepolia = 11155420,
Corn = 21000000,
CornTestnet = 21000001,
BlastSepolia = 168587773,
SkaleBaseSepoliaTestnet = 324705682,
PolkadotTestnet = 420420417,
Kusama = 420420418,
Polkadot = 420420419,
SophonTestnet = 531050104,
Degen = 666666666,
ZoraSepolia = 999999999,
SkaleBase = 1187947933,
Aurora = 1313161554,
AuroraTestnet = 1313161555,
XaiSepolia = 37714555429,
}
impl NamedChain {
pub const COUNT: usize = 199;
pub const VARIANTS: &'static [Self] = &[
Self::Mainnet,
Self::Morden,
Self::Ropsten,
Self::Rinkeby,
Self::Goerli,
Self::Optimism,
Self::Flare,
Self::Elastos,
Self::Cronos,
Self::Rsk,
Self::RskTestnet,
Self::TelosEvm,
Self::TelosEvmTestnet,
Self::Kovan,
Self::Crab,
Self::Darwinia,
Self::XdcMainnet,
Self::XdcTestnet,
Self::BinanceSmartChain,
Self::OptimismKovan,
Self::CfxTestnet,
Self::Sokol,
Self::Viction,
Self::BinanceSmartChainTestnet,
Self::Poa,
Self::Gnosis,
Self::FlareCoston2,
Self::Fuse,
Self::Unichain,
Self::Polygon,
Self::Monad,
Self::Sonic,
Self::Shimmer,
Self::Redbelly,
Self::RedbellyTestnet,
Self::OpBNBMainnet,
Self::HappychainTestnet,
Self::Lens,
Self::Fantom,
Self::Fraxtal,
Self::Boba,
Self::ZkSyncTestnet,
Self::FilecoinMainnet,
Self::ZkSync,
Self::CronosTestnet,
Self::Pulsechain,
Self::Syndr,
Self::OptimismGoerli,
Self::Pgn,
Self::World,
Self::AcalaMandalaTestnet,
Self::KaruraTestnet,
Self::AcalaTestnet,
Self::BattleChain,
Self::BattleChainTestnet,
Self::Karura,
Self::Koi,
Self::CantoTestnet,
Self::Acala,
Self::ModeSepolia,
Self::PulsechainTestnet,
Self::StableMainnet,
Self::Hyperliquid,
Self::Cfx,
Self::Metis,
Self::Core,
Self::Lisk,
Self::MoonbeamDev,
Self::Moonbeam,
Self::Moonriver,
Self::Moonbase,
Self::UnichainSepolia,
Self::SeiTestnet,
Self::Sei,
Self::Dev,
Self::InjectiveTestnet,
Self::Vana,
Self::Story,
Self::GravityAlphaMainnet,
Self::Injective,
Self::Soneium,
Self::SoneiumMinatoTestnet,
Self::Ronin,
Self::StableTestnet,
Self::FraxtalTestnet,
Self::Abstract,
Self::FantomTestnet,
Self::Merlin,
Self::Tempo,
Self::MegaEth,
Self::MemeCore,
Self::Robinhood,
Self::Iotex,
Self::WorldSepolia,
Self::Mantle,
Self::MantleSepolia,
Self::OpBNBTestnet,
Self::MegaEthTestnet,
Self::Zeta,
Self::Canto,
Self::Kaia,
Self::Base,
Self::EvmosTestnet,
Self::Evmos,
Self::Plasma,
Self::PlasmaTestnet,
Self::MonadTestnet,
Self::Chiado,
Self::AbstractTestnet,
Self::Cannon,
Self::Immutable,
Self::ImmutableTestnet,
Self::GravityAlphaTestnetSepolia,
Self::SignetPecorino,
Self::SonicTestnet,
Self::Holesky,
Self::FluentDevnet,
Self::FluentTestnet,
Self::Fluent,
Self::Oasis,
Self::TempoDevnet,
Self::AnvilHardhat,
Self::Curtis,
Self::ApeChain,
Self::Mode,
Self::LensTestnet,
Self::Arbitrum,
Self::ArbitrumNova,
Self::Celo,
Self::EmeraldTestnet,
Self::Emerald,
Self::TempoTestnet,
Self::TempoModerato,
Self::Etherlink,
Self::AvalancheFuji,
Self::Avalanche,
Self::Formicarium,
Self::Insectarium,
Self::RobinhoodTestnet,
Self::Sophon,
Self::Superposition,
Self::Ink,
Self::PgnSepolia,
Self::LineaGoerli,
Self::LineaSepolia,
Self::Linea,
Self::Bob,
Self::Treasure,
Self::RadiusTestnet,
Self::PolygonAmoy,
Self::BerachainBepolia,
Self::Berachain,
Self::Blast,
Self::BaseGoerli,
Self::BaseSepolia,
Self::Plume,
Self::PlumeTestnet,
Self::SuperpositionTestnet,
Self::Gravity,
Self::EtherlinkShadownet,
Self::Taiko,
Self::TaikoHekla,
Self::Bitlayer,
Self::RoninTestnet,
Self::FilecoinCalibrationTestnet,
Self::ArbitrumTestnet,
Self::ArbitrumGoerli,
Self::ArbitrumSepolia,
Self::SyndrSepolia,
Self::AutonomysNovaTestnet,
Self::ScrollSepolia,
Self::Scroll,
Self::Hoodi,
Self::Xai,
Self::Radius,
Self::Katana,
Self::InkSepolia,
Self::BobSepolia,
Self::Odyssey,
Self::TreasureTopaz,
Self::ArcTestnet,
Self::Zora,
Self::CeloSepolia,
Self::Sepolia,
Self::OptimismSepolia,
Self::Corn,
Self::CornTestnet,
Self::BlastSepolia,
Self::SkaleBaseSepoliaTestnet,
Self::PolkadotTestnet,
Self::Kusama,
Self::Polkadot,
Self::SophonTestnet,
Self::Degen,
Self::ZoraSepolia,
Self::SkaleBase,
Self::Aurora,
Self::AuroraTestnet,
Self::XaiSepolia,
];
pub const VARIANT_NAMES: &'static [&'static str] = &{
let mut names = [""; 199];
let mut index = 0;
while index < CHAIN_DATA.len() {
names[index] = CHAIN_DATA[index].name();
index += 1;
}
names
};
#[inline]
const fn from_index(index: ChainIndex) -> Self {
Self::VARIANTS[index as usize]
}
const fn index(self) -> ChainIndex {
match self {
Self::Mainnet => 0,
Self::Morden => 1,
Self::Ropsten => 2,
Self::Rinkeby => 3,
Self::Goerli => 4,
Self::Optimism => 5,
Self::Flare => 6,
Self::Elastos => 7,
Self::Cronos => 8,
Self::Rsk => 9,
Self::RskTestnet => 10,
Self::TelosEvm => 11,
Self::TelosEvmTestnet => 12,
Self::Kovan => 13,
Self::Crab => 14,
Self::Darwinia => 15,
Self::XdcMainnet => 16,
Self::XdcTestnet => 17,
Self::BinanceSmartChain => 18,
Self::OptimismKovan => 19,
Self::CfxTestnet => 20,
Self::Sokol => 21,
Self::Viction => 22,
Self::BinanceSmartChainTestnet => 23,
Self::Poa => 24,
Self::Gnosis => 25,
Self::FlareCoston2 => 26,
Self::Fuse => 27,
Self::Unichain => 28,
Self::Polygon => 29,
Self::Monad => 30,
Self::Sonic => 31,
Self::Shimmer => 32,
Self::Redbelly => 33,
Self::RedbellyTestnet => 34,
Self::OpBNBMainnet => 35,
Self::HappychainTestnet => 36,
Self::Lens => 37,
Self::Fantom => 38,
Self::Fraxtal => 39,
Self::Boba => 40,
Self::ZkSyncTestnet => 41,
Self::FilecoinMainnet => 42,
Self::ZkSync => 43,
Self::CronosTestnet => 44,
Self::Pulsechain => 45,
Self::Syndr => 46,
Self::OptimismGoerli => 47,
Self::Pgn => 48,
Self::World => 49,
Self::AcalaMandalaTestnet => 50,
Self::KaruraTestnet => 51,
Self::AcalaTestnet => 52,
Self::BattleChain => 53,
Self::BattleChainTestnet => 54,
Self::Karura => 55,
Self::Koi => 56,
Self::CantoTestnet => 57,
Self::Acala => 58,
Self::ModeSepolia => 59,
Self::PulsechainTestnet => 60,
Self::StableMainnet => 61,
Self::Hyperliquid => 62,
Self::Cfx => 63,
Self::Metis => 64,
Self::Core => 65,
Self::Lisk => 66,
Self::MoonbeamDev => 67,
Self::Moonbeam => 68,
Self::Moonriver => 69,
Self::Moonbase => 70,
Self::UnichainSepolia => 71,
Self::SeiTestnet => 72,
Self::Sei => 73,
Self::Dev => 74,
Self::InjectiveTestnet => 75,
Self::Vana => 76,
Self::Story => 77,
Self::GravityAlphaMainnet => 78,
Self::Injective => 79,
Self::Soneium => 80,
Self::SoneiumMinatoTestnet => 81,
Self::Ronin => 82,
Self::StableTestnet => 83,
Self::FraxtalTestnet => 84,
Self::Abstract => 85,
Self::FantomTestnet => 86,
Self::Merlin => 87,
Self::Tempo => 88,
Self::MegaEth => 89,
Self::MemeCore => 90,
Self::Robinhood => 91,
Self::Iotex => 92,
Self::WorldSepolia => 93,
Self::Mantle => 94,
Self::MantleSepolia => 95,
Self::OpBNBTestnet => 96,
Self::MegaEthTestnet => 97,
Self::Zeta => 98,
Self::Canto => 99,
Self::Kaia => 100,
Self::Base => 101,
Self::EvmosTestnet => 102,
Self::Evmos => 103,
Self::Plasma => 104,
Self::PlasmaTestnet => 105,
Self::MonadTestnet => 106,
Self::Chiado => 107,
Self::AbstractTestnet => 108,
Self::Cannon => 109,
Self::Immutable => 110,
Self::ImmutableTestnet => 111,
Self::GravityAlphaTestnetSepolia => 112,
Self::SignetPecorino => 113,
Self::SonicTestnet => 114,
Self::Holesky => 115,
Self::FluentDevnet => 116,
Self::FluentTestnet => 117,
Self::Fluent => 118,
Self::Oasis => 119,
Self::TempoDevnet => 120,
Self::AnvilHardhat => 121,
Self::Curtis => 122,
Self::ApeChain => 123,
Self::Mode => 124,
Self::LensTestnet => 125,
Self::Arbitrum => 126,
Self::ArbitrumNova => 127,
Self::Celo => 128,
Self::EmeraldTestnet => 129,
Self::Emerald => 130,
Self::TempoTestnet => 131,
Self::TempoModerato => 132,
Self::Etherlink => 133,
Self::AvalancheFuji => 134,
Self::Avalanche => 135,
Self::Formicarium => 136,
Self::Insectarium => 137,
Self::RobinhoodTestnet => 138,
Self::Sophon => 139,
Self::Superposition => 140,
Self::Ink => 141,
Self::PgnSepolia => 142,
Self::LineaGoerli => 143,
Self::LineaSepolia => 144,
Self::Linea => 145,
Self::Bob => 146,
Self::Treasure => 147,
Self::RadiusTestnet => 148,
Self::PolygonAmoy => 149,
Self::BerachainBepolia => 150,
Self::Berachain => 151,
Self::Blast => 152,
Self::BaseGoerli => 153,
Self::BaseSepolia => 154,
Self::Plume => 155,
Self::PlumeTestnet => 156,
Self::SuperpositionTestnet => 157,
Self::Gravity => 158,
Self::EtherlinkShadownet => 159,
Self::Taiko => 160,
Self::TaikoHekla => 161,
Self::Bitlayer => 162,
Self::RoninTestnet => 163,
Self::FilecoinCalibrationTestnet => 164,
Self::ArbitrumTestnet => 165,
Self::ArbitrumGoerli => 166,
Self::ArbitrumSepolia => 167,
Self::SyndrSepolia => 168,
Self::AutonomysNovaTestnet => 169,
Self::ScrollSepolia => 170,
Self::Scroll => 171,
Self::Hoodi => 172,
Self::Xai => 173,
Self::Radius => 174,
Self::Katana => 175,
Self::InkSepolia => 176,
Self::BobSepolia => 177,
Self::Odyssey => 178,
Self::TreasureTopaz => 179,
Self::ArcTestnet => 180,
Self::Zora => 181,
Self::CeloSepolia => 182,
Self::Sepolia => 183,
Self::OptimismSepolia => 184,
Self::Corn => 185,
Self::CornTestnet => 186,
Self::BlastSepolia => 187,
Self::SkaleBaseSepoliaTestnet => 188,
Self::PolkadotTestnet => 189,
Self::Kusama => 190,
Self::Polkadot => 191,
Self::SophonTestnet => 192,
Self::Degen => 193,
Self::ZoraSepolia => 194,
Self::SkaleBase => 195,
Self::Aurora => 196,
Self::AuroraTestnet => 197,
Self::XaiSepolia => 198,
}
}
#[inline]
const fn data(self) -> ChainData {
CHAIN_DATA[self.index() as usize]
}
#[inline]
const fn has_flag(self, flag: ChainFlags) -> bool {
self.data().flags & flag != 0
}
pub const fn from_chain_id(id: u64) -> Option<Self> {
match id {
1 => Some(Self::Mainnet),
2 => Some(Self::Morden),
3 => Some(Self::Ropsten),
4 => Some(Self::Rinkeby),
5 => Some(Self::Goerli),
10 => Some(Self::Optimism),
14 => Some(Self::Flare),
20 => Some(Self::Elastos),
25 => Some(Self::Cronos),
30 => Some(Self::Rsk),
31 => Some(Self::RskTestnet),
40 => Some(Self::TelosEvm),
41 => Some(Self::TelosEvmTestnet),
42 => Some(Self::Kovan),
44 => Some(Self::Crab),
46 => Some(Self::Darwinia),
50 => Some(Self::XdcMainnet),
51 => Some(Self::XdcTestnet),
56 => Some(Self::BinanceSmartChain),
69 => Some(Self::OptimismKovan),
71 => Some(Self::CfxTestnet),
77 => Some(Self::Sokol),
88 => Some(Self::Viction),
97 => Some(Self::BinanceSmartChainTestnet),
99 => Some(Self::Poa),
100 => Some(Self::Gnosis),
114 => Some(Self::FlareCoston2),
122 => Some(Self::Fuse),
130 => Some(Self::Unichain),
137 => Some(Self::Polygon),
143 => Some(Self::Monad),
146 => Some(Self::Sonic),
148 => Some(Self::Shimmer),
151 => Some(Self::Redbelly),
153 => Some(Self::RedbellyTestnet),
204 => Some(Self::OpBNBMainnet),
216 => Some(Self::HappychainTestnet),
232 => Some(Self::Lens),
250 => Some(Self::Fantom),
252 => Some(Self::Fraxtal),
288 => Some(Self::Boba),
300 => Some(Self::ZkSyncTestnet),
314 => Some(Self::FilecoinMainnet),
324 => Some(Self::ZkSync),
338 => Some(Self::CronosTestnet),
369 => Some(Self::Pulsechain),
404 => Some(Self::Syndr),
420 => Some(Self::OptimismGoerli),
424 => Some(Self::Pgn),
480 => Some(Self::World),
595 => Some(Self::AcalaMandalaTestnet),
596 => Some(Self::KaruraTestnet),
597 => Some(Self::AcalaTestnet),
626 => Some(Self::BattleChain),
627 => Some(Self::BattleChainTestnet),
686 => Some(Self::Karura),
701 => Some(Self::Koi),
740 => Some(Self::CantoTestnet),
787 => Some(Self::Acala),
919 => Some(Self::ModeSepolia),
943 => Some(Self::PulsechainTestnet),
988 => Some(Self::StableMainnet),
999 => Some(Self::Hyperliquid),
1030 => Some(Self::Cfx),
1088 => Some(Self::Metis),
1116 => Some(Self::Core),
1135 => Some(Self::Lisk),
1281 => Some(Self::MoonbeamDev),
1284 => Some(Self::Moonbeam),
1285 => Some(Self::Moonriver),
1287 => Some(Self::Moonbase),
1301 => Some(Self::UnichainSepolia),
1328 => Some(Self::SeiTestnet),
1329 => Some(Self::Sei),
1337 => Some(Self::Dev),
1439 => Some(Self::InjectiveTestnet),
1480 => Some(Self::Vana),
1514 => Some(Self::Story),
1625 => Some(Self::GravityAlphaMainnet),
1776 => Some(Self::Injective),
1868 => Some(Self::Soneium),
1946 => Some(Self::SoneiumMinatoTestnet),
2020 => Some(Self::Ronin),
2201 => Some(Self::StableTestnet),
2522 => Some(Self::FraxtalTestnet),
2741 => Some(Self::Abstract),
4002 => Some(Self::FantomTestnet),
4200 => Some(Self::Merlin),
4217 => Some(Self::Tempo),
4326 => Some(Self::MegaEth),
4352 => Some(Self::MemeCore),
4663 => Some(Self::Robinhood),
4689 => Some(Self::Iotex),
4801 => Some(Self::WorldSepolia),
5000 => Some(Self::Mantle),
5003 => Some(Self::MantleSepolia),
5611 => Some(Self::OpBNBTestnet),
6343 => Some(Self::MegaEthTestnet),
7000 => Some(Self::Zeta),
7700 => Some(Self::Canto),
8217 => Some(Self::Kaia),
8453 => Some(Self::Base),
9000 => Some(Self::EvmosTestnet),
9001 => Some(Self::Evmos),
9745 => Some(Self::Plasma),
9746 => Some(Self::PlasmaTestnet),
10143 => Some(Self::MonadTestnet),
10200 => Some(Self::Chiado),
11124 => Some(Self::AbstractTestnet),
13370 => Some(Self::Cannon),
13371 => Some(Self::Immutable),
13473 => Some(Self::ImmutableTestnet),
13505 => Some(Self::GravityAlphaTestnetSepolia),
14174 => Some(Self::SignetPecorino),
14601 => Some(Self::SonicTestnet),
17000 => Some(Self::Holesky),
20993 => Some(Self::FluentDevnet),
20994 => Some(Self::FluentTestnet),
25363 => Some(Self::Fluent),
26863 => Some(Self::Oasis),
31318 => Some(Self::TempoDevnet),
31337 => Some(Self::AnvilHardhat),
33111 => Some(Self::Curtis),
33139 => Some(Self::ApeChain),
34443 => Some(Self::Mode),
37111 => Some(Self::LensTestnet),
42161 => Some(Self::Arbitrum),
42170 => Some(Self::ArbitrumNova),
42220 => Some(Self::Celo),
42261 => Some(Self::EmeraldTestnet),
42262 => Some(Self::Emerald),
42429 => Some(Self::TempoTestnet),
42431 => Some(Self::TempoModerato),
42793 => Some(Self::Etherlink),
43113 => Some(Self::AvalancheFuji),
43114 => Some(Self::Avalanche),
43521 => Some(Self::Formicarium),
43522 => Some(Self::Insectarium),
46630 => Some(Self::RobinhoodTestnet),
50104 => Some(Self::Sophon),
55244 => Some(Self::Superposition),
57073 => Some(Self::Ink),
58008 => Some(Self::PgnSepolia),
59140 => Some(Self::LineaGoerli),
59141 => Some(Self::LineaSepolia),
59144 => Some(Self::Linea),
60808 => Some(Self::Bob),
61166 => Some(Self::Treasure),
72344 => Some(Self::RadiusTestnet),
80002 => Some(Self::PolygonAmoy),
80069 => Some(Self::BerachainBepolia),
80094 => Some(Self::Berachain),
81457 => Some(Self::Blast),
84531 => Some(Self::BaseGoerli),
84532 => Some(Self::BaseSepolia),
98866 => Some(Self::Plume),
98867 => Some(Self::PlumeTestnet),
98985 => Some(Self::SuperpositionTestnet),
127001 => Some(Self::Gravity),
127823 => Some(Self::EtherlinkShadownet),
167000 => Some(Self::Taiko),
167009 => Some(Self::TaikoHekla),
200901 => Some(Self::Bitlayer),
202601 => Some(Self::RoninTestnet),
314159 => Some(Self::FilecoinCalibrationTestnet),
421611 => Some(Self::ArbitrumTestnet),
421613 => Some(Self::ArbitrumGoerli),
421614 => Some(Self::ArbitrumSepolia),
444444 => Some(Self::SyndrSepolia),
490000 => Some(Self::AutonomysNovaTestnet),
534351 => Some(Self::ScrollSepolia),
534352 => Some(Self::Scroll),
560048 => Some(Self::Hoodi),
660279 => Some(Self::Xai),
723487 => Some(Self::Radius),
747474 => Some(Self::Katana),
763373 => Some(Self::InkSepolia),
808813 => Some(Self::BobSepolia),
911867 => Some(Self::Odyssey),
978658 => Some(Self::TreasureTopaz),
5042002 => Some(Self::ArcTestnet),
7777777 => Some(Self::Zora),
11142220 => Some(Self::CeloSepolia),
11155111 => Some(Self::Sepolia),
11155420 => Some(Self::OptimismSepolia),
21000000 => Some(Self::Corn),
21000001 => Some(Self::CornTestnet),
168587773 => Some(Self::BlastSepolia),
324705682 => Some(Self::SkaleBaseSepoliaTestnet),
420420417 => Some(Self::PolkadotTestnet),
420420418 => Some(Self::Kusama),
420420419 => Some(Self::Polkadot),
531050104 => Some(Self::SophonTestnet),
666666666 => Some(Self::Degen),
999999999 => Some(Self::ZoraSepolia),
1187947933 => Some(Self::SkaleBase),
1313161554 => Some(Self::Aurora),
1313161555 => Some(Self::AuroraTestnet),
37714555429 => Some(Self::XaiSepolia),
_ => None,
}
}
#[inline]
pub const fn as_str(&self) -> &'static str {
self.data().name()
}
#[inline]
pub const fn is_ethereum(&self) -> bool {
self.has_flag(FLAG_ETHEREUM)
}
#[inline]
pub const fn is_optimism(self) -> bool {
self.has_flag(FLAG_OPTIMISM)
}
#[inline]
pub const fn is_gnosis(self) -> bool {
matches!(self, Self::Gnosis | Self::Chiado)
}
#[inline]
pub const fn is_polygon(self) -> bool {
matches!(self, Self::Polygon | Self::PolygonAmoy)
}
#[inline]
pub const fn is_arbitrum(self) -> bool {
self.has_flag(FLAG_ARBITRUM)
}
#[inline]
pub const fn is_elastic(self) -> bool {
self.has_flag(FLAG_ELASTIC)
}
#[inline]
pub const fn is_tempo(self) -> bool {
self.has_flag(FLAG_TEMPO)
}
#[inline]
pub const fn is_custom_sourcify(self) -> bool {
matches!(self, Self::Tempo | Self::TempoTestnet | Self::TempoModerato)
}
#[inline]
pub const fn is_legacy(self) -> bool {
self.has_flag(FLAG_LEGACY)
}
#[inline]
pub const fn supports_shanghai(self) -> bool {
self.has_flag(FLAG_SUPPORTS_SHANGHAI)
}
#[inline]
pub const fn is_testnet(self) -> bool {
self.has_flag(FLAG_TESTNET)
}
#[inline]
pub const fn native_currency_symbol(self) -> Option<&'static str> {
self.data().native_currency_symbol()
}
#[inline]
pub const fn etherscan_urls(self) -> Option<(&'static str, &'static str)> {
let data = self.data();
match (data.etherscan_api_url(), data.etherscan_base_url()) {
(Some(api), Some(base)) => Some((api, base)),
_ => None,
}
}
#[inline]
pub const fn etherscan_api_key_name(self) -> Option<&'static str> {
self.data().etherscan_api_key_name()
}
#[inline]
pub const fn wrapped_native_token(self) -> Option<Address> {
let index = self.data().wrapped_native_token;
if index == NO_INDEX { None } else { Some(WRAPPED_NATIVE_TOKENS[index as usize]) }
}
#[inline]
pub(crate) const fn average_blocktime_millis(self) -> u16 {
self.data().average_blocktime_millis
}
pub(crate) fn from_parse_str(value: &str) -> Option<Self> {
PARSE_NAMES.get(value).copied().map(Self::from_index)
}
#[cfg(feature = "serde")]
pub(crate) fn from_serde_str(value: &str) -> Option<Self> {
PARSE_NAMES.get(value).or_else(|| SERDE_NAMES.get(value)).copied().map(Self::from_index)
}
}
type ChainIndex = u8;
type ChainFlags = u8;
const FLAG_LEGACY: ChainFlags = 1 << 0;
const FLAG_SUPPORTS_SHANGHAI: ChainFlags = 1 << 1;
const FLAG_TESTNET: ChainFlags = 1 << 2;
const FLAG_ETHEREUM: ChainFlags = 1 << 3;
const FLAG_OPTIMISM: ChainFlags = 1 << 4;
const FLAG_ARBITRUM: ChainFlags = 1 << 5;
const FLAG_ELASTIC: ChainFlags = 1 << 6;
const FLAG_TEMPO: ChainFlags = 1 << 7;
const NO_INDEX: u8 = u8::MAX;
#[derive(Clone, Copy)]
#[repr(C, packed)]
struct ChainData {
name: u8,
native_currency_symbol: u8,
etherscan_api_url: u8,
etherscan_base_url: u8,
etherscan_api_key_name: u8,
average_blocktime_millis: u16,
flags: ChainFlags,
wrapped_native_token: u8,
}
impl ChainData {
#[inline]
const fn name(self) -> &'static str {
CHAIN_NAMES[self.name as usize]
}
#[inline]
const fn native_currency_symbol(self) -> Option<&'static str> {
static_str(&NATIVE_CURRENCY_SYMBOLS, self.native_currency_symbol)
}
#[inline]
const fn etherscan_api_url(self) -> Option<&'static str> {
static_str(ÐERSCAN_API_URLS, self.etherscan_api_url)
}
#[inline]
const fn etherscan_base_url(self) -> Option<&'static str> {
static_str(ÐERSCAN_BASE_URLS, self.etherscan_base_url)
}
#[inline]
const fn etherscan_api_key_name(self) -> Option<&'static str> {
static_str(ÐERSCAN_API_KEY_NAMES, self.etherscan_api_key_name)
}
}
const fn static_str(table: &'static [&'static str], index: u8) -> Option<&'static str> {
if index == NO_INDEX { None } else { Some(table[index as usize]) }
}
#[cfg(test)]
pub(crate) const PARSE_ALIASES: &[(NamedChain, &str)] = &[
(NamedChain::Mainnet, "ethlive"),
(NamedChain::BinanceSmartChain, "binance-smart-chain"),
(NamedChain::BinanceSmartChain, "bnb-smart-chain"),
(NamedChain::BinanceSmartChainTestnet, "binance-smart-chain-testnet"),
(NamedChain::BinanceSmartChainTestnet, "bnb-smart-chain-testnet"),
(NamedChain::Gnosis, "gnosis"),
(NamedChain::Gnosis, "gnosis-chain"),
(NamedChain::Tempo, "tempo-mainnet"),
(NamedChain::AnvilHardhat, "anvil"),
(NamedChain::AnvilHardhat, "hardhat"),
(NamedChain::Curtis, "apechain-testnet"),
(NamedChain::AvalancheFuji, "avalanche-fuji"),
(NamedChain::Formicarium, "memecore-formicarium"),
(NamedChain::Insectarium, "memecore-insectarium"),
(NamedChain::PolygonAmoy, "polygon-amoy"),
(NamedChain::BerachainBepolia, "berachain-bepolia-testnet"),
(NamedChain::TreasureTopaz, "treasure-topaz-testnet"),
];
#[cfg(all(test, feature = "serde"))]
pub(crate) const SERDE_ALIASES: &[(NamedChain, &str)] = &[
(NamedChain::RskTestnet, "rsk_testnet"),
(NamedChain::TelosEvm, "telos_evm"),
(NamedChain::TelosEvmTestnet, "telos_evm_testnet"),
(NamedChain::TelosEvmTestnet, "telos_testnet"),
(NamedChain::TelosEvmTestnet, "telos-evm-testnet"),
(NamedChain::XdcMainnet, "xdc_mainnet"),
(NamedChain::XdcTestnet, "xdc_testnet"),
(NamedChain::BinanceSmartChain, "binance_smart_chain"),
(NamedChain::OptimismKovan, "optimism_kovan"),
(NamedChain::CfxTestnet, "cfx_testnet"),
(NamedChain::CfxTestnet, "conflux-espace-testnet"),
(NamedChain::BinanceSmartChainTestnet, "binance_smart_chain_testnet"),
(NamedChain::BinanceSmartChainTestnet, "bsc_testnet"),
(NamedChain::FlareCoston2, "flare_coston2"),
(NamedChain::RedbellyTestnet, "redbelly_testnet"),
(NamedChain::OpBNBMainnet, "opbnb_mainnet"),
(NamedChain::OpBNBMainnet, "op-bnb-mainnet"),
(NamedChain::HappychainTestnet, "happychain_testnet"),
(NamedChain::ZkSyncTestnet, "zk_sync_testnet"),
(NamedChain::ZkSyncTestnet, "zksync_testnet"),
(NamedChain::FilecoinMainnet, "filecoin_mainnet"),
(NamedChain::ZkSync, "zk_sync"),
(NamedChain::CronosTestnet, "cronos_testnet"),
(NamedChain::OptimismGoerli, "optimism_goerli"),
(NamedChain::World, "worldchain"),
(NamedChain::AcalaMandalaTestnet, "acala_mandala_testnet"),
(NamedChain::KaruraTestnet, "karura_testnet"),
(NamedChain::AcalaTestnet, "acala_testnet"),
(NamedChain::BattleChain, "battle_chain"),
(NamedChain::BattleChainTestnet, "battle_chain_testnet"),
(NamedChain::BattleChainTestnet, "battlechain_testnet"),
(NamedChain::CantoTestnet, "canto_testnet"),
(NamedChain::ModeSepolia, "mode_sepolia"),
(NamedChain::PulsechainTestnet, "pulsechain_testnet"),
(NamedChain::StableMainnet, "stable_mainnet"),
(NamedChain::Cfx, "conflux-espace"),
(NamedChain::MoonbeamDev, "moonbeam_dev"),
(NamedChain::UnichainSepolia, "unichain_sepolia"),
(NamedChain::SeiTestnet, "sei_testnet"),
(NamedChain::InjectiveTestnet, "injective_testnet"),
(NamedChain::GravityAlphaMainnet, "gravity_alpha_mainnet"),
(NamedChain::SoneiumMinatoTestnet, "soneium_minato_testnet"),
(NamedChain::StableTestnet, "stable_testnet"),
(NamedChain::FraxtalTestnet, "fraxtal_testnet"),
(NamedChain::FantomTestnet, "fantom_testnet"),
(NamedChain::MegaEth, "mega_eth"),
(NamedChain::MemeCore, "meme_core"),
(NamedChain::WorldSepolia, "world_sepolia"),
(NamedChain::WorldSepolia, "worldchain-sepolia"),
(NamedChain::MantleSepolia, "mantle_sepolia"),
(NamedChain::OpBNBTestnet, "opbnb_testnet"),
(NamedChain::OpBNBTestnet, "op-bnb-testnet"),
(NamedChain::MegaEthTestnet, "mega_eth_testnet"),
(NamedChain::MegaEthTestnet, "megaeth_testnet"),
(NamedChain::EvmosTestnet, "evmos_testnet"),
(NamedChain::PlasmaTestnet, "plasma_testnet"),
(NamedChain::MonadTestnet, "monad_testnet"),
(NamedChain::AbstractTestnet, "abstract_testnet"),
(NamedChain::ImmutableTestnet, "immutable_testnet"),
(NamedChain::GravityAlphaTestnetSepolia, "gravity_alpha_testnet_sepolia"),
(NamedChain::SignetPecorino, "signet_pecorino"),
(NamedChain::SonicTestnet, "sonic_testnet"),
(NamedChain::FluentDevnet, "fluent_devnet"),
(NamedChain::FluentTestnet, "fluent_testnet"),
(NamedChain::TempoDevnet, "tempo_devnet"),
(NamedChain::AnvilHardhat, "anvil_hardhat"),
(NamedChain::ApeChain, "ape_chain"),
(NamedChain::LensTestnet, "lens_testnet"),
(NamedChain::Arbitrum, "arbitrum_one"),
(NamedChain::Arbitrum, "arbitrum-one"),
(NamedChain::ArbitrumNova, "arbitrum_nova"),
(NamedChain::EmeraldTestnet, "emerald_testnet"),
(NamedChain::TempoTestnet, "tempo_testnet"),
(NamedChain::TempoModerato, "tempo_moderato"),
(NamedChain::AvalancheFuji, "avalanche_fuji"),
(NamedChain::Formicarium, "formicairum"),
(NamedChain::RobinhoodTestnet, "robinhood_testnet"),
(NamedChain::PgnSepolia, "pgn_sepolia"),
(NamedChain::LineaGoerli, "linea_goerli"),
(NamedChain::LineaSepolia, "linea_sepolia"),
(NamedChain::RadiusTestnet, "radius_testnet"),
(NamedChain::PolygonAmoy, "polygon_amoy"),
(NamedChain::BerachainBepolia, "berachain_bepolia"),
(NamedChain::BaseGoerli, "base_goerli"),
(NamedChain::BaseSepolia, "base_sepolia"),
(NamedChain::PlumeTestnet, "plume_testnet"),
(NamedChain::SuperpositionTestnet, "superposition_testnet"),
(NamedChain::Gravity, "gravity"),
(NamedChain::EtherlinkShadownet, "etherlink_shadownet"),
(NamedChain::TaikoHekla, "taiko_hekla"),
(NamedChain::RoninTestnet, "ronin_testnet"),
(NamedChain::FilecoinCalibrationTestnet, "filecoin_calibration_testnet"),
(NamedChain::ArbitrumTestnet, "arbitrum_testnet"),
(NamedChain::ArbitrumGoerli, "arbitrum_goerli"),
(NamedChain::ArbitrumSepolia, "arbitrum_sepolia"),
(NamedChain::SyndrSepolia, "syndr_sepolia"),
(NamedChain::AutonomysNovaTestnet, "autonomys_nova_testnet"),
(NamedChain::ScrollSepolia, "scroll_sepolia"),
(NamedChain::ScrollSepolia, "scroll_sepolia_testnet"),
(NamedChain::InkSepolia, "ink_sepolia"),
(NamedChain::InkSepolia, "ink_sepolia_testnet"),
(NamedChain::BobSepolia, "bob_sepolia"),
(NamedChain::TreasureTopaz, "treasure_topaz"),
(NamedChain::ArcTestnet, "arc_testnet"),
(NamedChain::CeloSepolia, "celo_sepolia"),
(NamedChain::OptimismSepolia, "optimism_sepolia"),
(NamedChain::CornTestnet, "corn_testnet"),
(NamedChain::BlastSepolia, "blast_sepolia"),
(NamedChain::SkaleBaseSepoliaTestnet, "skale_base_sepolia_testnet"),
(NamedChain::PolkadotTestnet, "polkadot_testnet"),
(NamedChain::SophonTestnet, "sophon_testnet"),
(NamedChain::ZoraSepolia, "zora_sepolia"),
(NamedChain::SkaleBase, "skale_base"),
(NamedChain::AuroraTestnet, "aurora_testnet"),
(NamedChain::XaiSepolia, "xai_sepolia"),
];
static CHAIN_NAMES: [&str; 199] = [
"mainnet",
"morden",
"ropsten",
"rinkeby",
"goerli",
"optimism",
"flare",
"elastos",
"cronos",
"rsk",
"rsk-testnet",
"telos",
"telos-testnet",
"kovan",
"crab",
"darwinia",
"xdc-mainnet",
"xdc-testnet",
"bsc",
"optimism-kovan",
"cfx-testnet",
"sokol",
"viction",
"bsc-testnet",
"poa",
"xdai",
"flare-coston2",
"fuse",
"unichain",
"polygon",
"monad",
"sonic",
"shimmer",
"redbelly",
"redbelly-testnet",
"opbnb-mainnet",
"happychain-testnet",
"lens",
"fantom",
"fraxtal",
"boba",
"zksync-testnet",
"filecoin-mainnet",
"zksync",
"cronos-testnet",
"pulsechain",
"syndr",
"optimism-goerli",
"pgn",
"world",
"acala-mandala-testnet",
"karura-testnet",
"acala-testnet",
"battlechain",
"battlechain-testnet",
"karura",
"koi",
"canto-testnet",
"acala",
"mode-sepolia",
"pulsechain-testnet",
"stable-mainnet",
"hyperliquid",
"cfx",
"metis",
"core",
"lisk",
"moonbeam-dev",
"moonbeam",
"moonriver",
"moonbase",
"unichain-sepolia",
"sei-testnet",
"sei",
"dev",
"injective-testnet",
"vana",
"story",
"gravity-alpha-mainnet",
"injective",
"soneium",
"soneium-minato-testnet",
"ronin",
"stable-testnet",
"fraxtal-testnet",
"abstract",
"fantom-testnet",
"merlin",
"tempo",
"megaeth",
"memecore",
"robinhood",
"iotex",
"world-sepolia",
"mantle",
"mantle-sepolia",
"opbnb-testnet",
"megaeth-testnet",
"zeta",
"canto",
"kaia",
"base",
"evmos-testnet",
"evmos",
"plasma",
"plasma-testnet",
"monad-testnet",
"chiado",
"abstract-testnet",
"cannon",
"immutable",
"immutable-testnet",
"gravity-alpha-testnet-sepolia",
"signet-pecorino",
"sonic-testnet",
"holesky",
"fluent-devnet",
"fluent-testnet",
"fluent",
"oasis",
"tempo-devnet",
"anvil-hardhat",
"curtis",
"apechain",
"mode",
"lens-testnet",
"arbitrum",
"arbitrum-nova",
"celo",
"emerald-testnet",
"emerald",
"tempo-testnet",
"tempo-moderato",
"etherlink",
"fuji",
"avalanche",
"formicarium",
"insectarium",
"robinhood-testnet",
"sophon",
"superposition",
"ink",
"pgn-sepolia",
"linea-goerli",
"linea-sepolia",
"linea",
"bob",
"treasure",
"radius-testnet",
"amoy",
"berachain-bepolia",
"berachain",
"blast",
"base-goerli",
"base-sepolia",
"plume",
"plume-testnet",
"superposition-testnet",
"grav",
"etherlink-shadownet",
"taiko",
"taiko-hekla",
"bitlayer",
"ronin-testnet",
"filecoin-calibration-testnet",
"arbitrum-testnet",
"arbitrum-goerli",
"arbitrum-sepolia",
"syndr-sepolia",
"autonomys-nova-testnet",
"scroll-sepolia",
"scroll",
"hoodi",
"xai",
"radius",
"katana",
"ink-sepolia",
"bob-sepolia",
"odyssey",
"treasure-topaz",
"arc-testnet",
"zora",
"celo-sepolia",
"sepolia",
"optimism-sepolia",
"corn",
"corn-testnet",
"blast-sepolia",
"skale-base-sepolia-testnet",
"polkadot-testnet",
"kusama",
"polkadot",
"sophon-testnet",
"degen",
"zora-sepolia",
"skale-base",
"aurora",
"aurora-testnet",
"xai-sepolia",
];
static NATIVE_CURRENCY_SYMBOLS: [&str; 62] = [
"ETH", "FLR", "RBTC", "tRBTC", "TLOS", "CRAB", "RING", "XDC", "TXDC", "BNB", "CFX", "C2FLR",
"POL", "MON", "S", "SMR", "RBNT", "HAPPY", "GHO", "PLS", "WRLD", "KRING", "USDT0", "HYPE",
"CORE", "DEV", "GLMR", "MOVR", "SEI", "INJ", "VANA", "IP", "G", "RON", "BTC", "USD", "M",
"IOTX", "MNT", "ZETA", "KAIA", "XPL", "IMX", "tIMX", "USDS", "APE", "GRASS", "CELO", "XTZ",
"tM", "SOPH", "MAGIC", "RUSD", "BERA", "PLUME", "XAI", "USDC", "BTCN", "PAS", "KSM", "DOT",
"DEGEN",
];
static ETHERSCAN_API_URLS: [&str; 161] = [
"https://api.etherscan.io/v2/api?chainid=1",
"https://api.etherscan.io/v2/api?chainid=10",
"https://flare-explorer.flare.network/api",
"https://esc.elastos.io/api",
"https://api.etherscan.io/v2/api?chainid=25",
"https://blockscout.com/rsk/mainnet/api",
"https://rootstock-testnet.blockscout.com/api",
"https://api.teloscan.io/api",
"https://api.testnet.teloscan.io/api",
"https://crab-scan.darwinia.network/api",
"https://explorer.darwinia.network/api",
"https://api.etherscan.io/v2/api?chainid=50",
"https://api.etherscan.io/v2/api?chainid=51",
"https://api.etherscan.io/v2/api?chainid=56",
"https://evmapi-testnet.confluxscan.org/api",
"https://www.vicscan.xyz/api",
"https://api.etherscan.io/v2/api?chainid=97",
"https://api.etherscan.io/v2/api?chainid=100",
"https://coston2-explorer.flare.network/api",
"https://explorer.fuse.io/api",
"https://api.etherscan.io/v2/api?chainid=130",
"https://api.etherscan.io/v2/api?chainid=137",
"https://api.etherscan.io/v2/api?chainid=143",
"https://api.etherscan.io/v2/api?chainid=146",
"https://explorer.evm.shimmer.network/api",
"https://api.routescan.io/v2/network/mainnet/evm/151/etherscan",
"https://api.routescan.io/v2/network/testnet/evm/153/etherscan",
"https://api.etherscan.io/v2/api?chainid=204",
"https://explorer.testnet.happy.tech/api",
"https://explorer-api.lens.xyz",
"https://api.etherscan.io/v2/api?chainid=252",
"https://api.bobascan.com/api",
"https://block-explorer-api.sepolia.zksync.dev/api",
"https://block-explorer-api.mainnet.zksync.io/api",
"https://api.scan.pulsechain.com",
"https://explorer.syndr.com/api",
"https://api.etherscan.io/v2/api?chainid=480",
"https://blockscout.mandala.aca-staging.network/api",
"https://block-explorer-api.battlechain.com/api",
"https://block-explorer-api.testnet.battlechain.com/api",
"https://blockscout.karura.network/api",
"https://blockscout.acala.network/api",
"https://sepolia.explorer.mode.network/api",
"https://api.scan.v4.testnet.pulsechain.com",
"https://api.etherscan.io/v2/api?chainid=988",
"https://api.etherscan.io/v2/api?chainid=999",
"https://evmapi.confluxscan.org/api",
"https://api.routescan.io/v2/network/mainnet/evm/1088/etherscan",
"https://openapi.coredao.org/api",
"https://blockscout.lisk.com/api",
"https://api.etherscan.io/v2/api?chainid=1284",
"https://api.etherscan.io/v2/api?chainid=1285",
"https://api.etherscan.io/v2/api?chainid=1287",
"https://api.etherscan.io/v2/api?chainid=1301",
"https://api.etherscan.io/v2/api?chainid=1328",
"https://api.etherscan.io/v2/api?chainid=1329",
"https://testnet.blockscout-api.injective.network/api",
"https://api.vanascan.io/api",
"https://www.storyscan.xyz/api",
"https://explorer.gravity.xyz/api",
"https://blockscout-api.injective.network/api",
"https://soneium.blockscout.com/api",
"https://soneium-minato.blockscout.com/api",
"https://skynet-api.roninchain.com/ronin",
"https://api.etherscan.io/v2/api?chainid=2201",
"https://api.etherscan.io/v2/api?chainid=2522",
"https://api.etherscan.io/v2/api?chainid=2741",
"https://scan.merlinchain.io/api",
"https://contracts.tempo.xyz",
"https://api.etherscan.io/v2/api?chainid=4326",
"https://api.etherscan.io/v2/api?chainid=4352",
"https://robinhoodchain.blockscout.com/api",
"https://api.etherscan.io/v2/api?chainid=4801",
"https://api.etherscan.io/v2/api?chainid=5000",
"https://api.etherscan.io/v2/api?chainid=5003",
"https://api.etherscan.io/v2/api?chainid=5611",
"https://api.etherscan.io/v2/api?chainid=6343",
"https://zetachain.blockscout.com/api",
"https://mainnet-oapi.kaiascan.io/api",
"https://api.etherscan.io/v2/api?chainid=8453",
"https://api.etherscan.io/v2/api?chainid=9745",
"https://api.etherscan.io/v2/api?chainid=9746",
"https://api.etherscan.io/v2/api?chainid=10143",
"https://gnosis-chiado.blockscout.com/api",
"https://api.etherscan.io/v2/api?chainid=11124",
"https://explorer.immutable.com/api",
"https://explorer.testnet.immutable.com/api",
"https://explorer-sepolia.gravity.xyz/api",
"https://explorer.pecorino.signet.sh/api",
"https://api.etherscan.io/v2/api?chainid=14601",
"https://api.etherscan.io/v2/api?chainid=17000",
"https://api-devnet.fluentscan.xyz/api",
"https://api-testnet.fluentscan.xyz/api",
"https://api.fluentscan.xyz/api",
"https://api.etherscan.io/v2/api?chainid=33111",
"https://api.etherscan.io/v2/api?chainid=33139",
"https://explorer.mode.network/api",
"https://block-explorer-api.staging.lens.zksync.dev",
"https://api.etherscan.io/v2/api?chainid=42161",
"https://api.etherscan.io/v2/api?chainid=42170",
"https://api.etherscan.io/v2/api?chainid=42220",
"https://testnet.explorer.emerald.oasis.dev/api",
"https://explorer.emerald.oasis.dev/api",
"https://explorer.etherlink.com/api",
"https://api.etherscan.io/v2/api?chainid=43113",
"https://api.etherscan.io/v2/api?chainid=43114",
"https://api.etherscan.io/v2/api?chainid=43521",
"https://insectarium.blockscout.memecore.com/api",
"https://explorer.testnet.chain.robinhood.com/api",
"https://api.etherscan.io/v2/api?chainid=50104",
"https://explorer.superposition.so/api",
"https://explorer.inkonchain.com/api/v2",
"https://api.etherscan.io/v2/api?chainid=59141",
"https://api.etherscan.io/v2/api?chainid=59144",
"https://explorer.gobob.xyz/api",
"https://testnet.radiustech.xyz/api",
"https://api.etherscan.io/v2/api?chainid=80002",
"https://api.etherscan.io/v2/api?chainid=80069",
"https://api.etherscan.io/v2/api?chainid=80094",
"https://api.etherscan.io/v2/api?chainid=81457",
"https://api.etherscan.io/v2/api?chainid=84532",
"https://explorer.plume.org/api",
"https://testnet-explorer.plume.org/api",
"https://testnet-explorer.superposition.so/api",
"https://mainnet-explorer.gravity.xyz/api",
"https://shadownet.explorer.etherlink.com/api",
"https://api.etherscan.io/v2/api?chainid=167000",
"https://api.etherscan.io/v2/api?chainid=167009",
"https://api.btrscan.com/scan/api",
"https://api-gateway.skymavis.com/rpc/testnet",
"https://api.calibration.node.glif.io/rpc/v1",
"https://api.etherscan.io/v2/api?chainid=421614",
"https://sepolia-explorer.syndr.com/api",
"https://api.etherscan.io/v2/api?chainid=534351",
"https://api.etherscan.io/v2/api?chainid=534352",
"https://api.etherscan.io/v2/api?chainid=560048",
"https://api.etherscan.io/v2/api?chainid=660279",
"https://network.radiustech.xyz/api",
"https://api.etherscan.io/v2/api?chainid=747474",
"https://explorer-sepolia.inkonchain.com/api/v2",
"https://bob-sepolia.explorer.gobob.xyz/api",
"https://odyssey-explorer.ithaca.xyz/api",
"https://testnet.arcscan.app/api",
"https://explorer.zora.energy/api",
"https://api.etherscan.io/v2/api?chainid=11142220",
"https://api.etherscan.io/v2/api?chainid=11155111",
"https://api.etherscan.io/v2/api?chainid=11155420",
"https://api.routescan.io/v2/network/mainnet/evm/21000000/etherscan/api",
"https://api.routescan.io/v2/network/testnet/evm/21000001/etherscan/api",
"https://api.etherscan.io/v2/api?chainid=168587773",
"https://base-sepolia-testnet-explorer.skalenodes.com/api",
"https://blockscout-testnet.polkadot.io/api",
"https://blockscout-kusama.polkadot.io/api",
"https://blockscout.polkadot.io/api",
"https://api.etherscan.io/v2/api?chainid=531050104",
"https://explorer.degen.tips/api",
"https://sepolia.explorer.zora.energy/api",
"https://skale-base-explorer.skalenodes.com/api",
"https://api.aurorascan.dev/api",
"https://testnet.aurorascan.dev/api",
"https://api.etherscan.io/v2/api?chainid=37714555429",
];
static ETHERSCAN_BASE_URLS: [&str; 163] = [
"https://etherscan.io",
"https://optimistic.etherscan.io",
"https://flare-explorer.flare.network",
"https://esc.elastos.io",
"https://cronoscan.com",
"https://blockscout.com/rsk/mainnet",
"https://rootstock-testnet.blockscout.com",
"https://teloscan.io",
"https://testnet.teloscan.io",
"https://crab-scan.darwinia.network",
"https://explorer.darwinia.network",
"https://xdcscan.com",
"https://testnet.xdcscan.com",
"https://bscscan.com",
"https://evmtestnet.confluxscan.org",
"https://www.vicscan.xyz",
"https://testnet.bscscan.com",
"https://gnosisscan.io",
"https://coston2-explorer.flare.network",
"https://explorer.fuse.io",
"https://uniscan.xyz",
"https://polygonscan.com",
"https://monadscan.com",
"https://sonicscan.org",
"https://explorer.evm.shimmer.network",
"https://redbelly.routescan.io",
"https://redbelly.testnet.routescan.io",
"https://opbnb.bscscan.com",
"https://explorer.testnet.happy.tech",
"https://explorer.lens.xyz",
"https://fraxscan.com",
"https://bobascan.com",
"https://sepolia.explorer.zksync.io",
"https://explorer.zksync.io",
"https://scan.pulsechain.com",
"https://explorer.syndr.com",
"https://worldscan.org",
"https://blockscout.mandala.aca-staging.network",
"https://explorer.battlechain.com",
"https://explorer.testnet.battlechain.com",
"https://blockscout.karura.network",
"https://blockscout.acala.network",
"https://sepolia.explorer.mode.network",
"https://scan.v4.testnet.pulsechain.com",
"https://stablescan.xyz",
"https://hyperevmscan.io",
"https://evm.confluxscan.org",
"https://explorer.metis.io",
"https://scan.coredao.org",
"https://blockscout.lisk.com",
"https://moonbeam.moonscan.io",
"https://moonriver.moonscan.io",
"https://moonbase.moonscan.io",
"https://sepolia.uniscan.xyz",
"https://testnet.seiscan.io",
"https://seiscan.io",
"https://testnet.blockscout.injective.network",
"https://vanascan.io",
"https://www.storyscan.xyz",
"https://explorer.gravity.xyz",
"https://blockscout.injective.network",
"https://soneium.blockscout.com",
"https://soneium-minato.blockscout.com",
"https://app.roninchain.com",
"https://testnet.stablescan.xyz",
"https://holesky.fraxscan.com",
"https://abscan.org",
"https://scan.merlinchain.io",
"https://explore.tempo.xyz",
"https://mega.etherscan.io",
"https://memecorescan.io",
"https://robinhoodchain.blockscout.com",
"https://sepolia.worldscan.org",
"https://mantlescan.xyz",
"https://sepolia.mantlescan.xyz",
"https://opbnb-testnet.bscscan.com",
"https://megaeth-testnet-v2.blockscout.com",
"https://zetachain.blockscout.com",
"https://kaiascan.io",
"https://basescan.org",
"https://plasmascan.to",
"https://testnet.plasmascan.to",
"https://testnet.monadscan.com",
"https://gnosis-chiado.blockscout.com",
"https://sepolia.abscan.org",
"https://explorer.immutable.com",
"https://explorer.testnet.immutable.com",
"https://explorer-sepolia.gravity.xyz",
"https://explorer.pecorino.signet.sh",
"https://testnet.sonicscan.org",
"https://holesky.etherscan.io",
"https://devnet.fluentscan.xyz",
"https://testnet.fluentscan.xyz",
"https://fluentscan.xyz",
"https://curtis.apescan.io",
"https://apescan.io",
"https://explorer.mode.network",
"https://explorer.testnet.lens.xyz",
"https://arbiscan.io",
"https://nova.arbiscan.io",
"https://celoscan.io",
"https://testnet.explorer.emerald.oasis.dev",
"https://explorer.emerald.oasis.dev",
"https://explore.andantino.tempo.xyz",
"https://explore.moderato.tempo.xyz",
"https://explorer.etherlink.com",
"https://testnet.snowscan.xyz",
"https://snowscan.xyz",
"https://formicarium.memecorescan.io",
"https://insectarium.blockscout.memecore.com",
"https://explorer.testnet.chain.robinhood.com",
"https://sophscan.xyz",
"https://explorer.superposition.so",
"https://explorer.inkonchain.com",
"https://sepolia.lineascan.build",
"https://lineascan.build",
"https://explorer.gobob.xyz",
"https://testnet.radiustech.xyz",
"https://amoy.polygonscan.com",
"https://testnet.berascan.com",
"https://berascan.com",
"https://blastscan.io",
"https://sepolia.basescan.org",
"https://explorer.plume.org",
"https://testnet-explorer.plume.org",
"https://testnet-explorer.superposition.so",
"https://mainnet-explorer.gravity.xyz",
"https://shadownet.explorer.etherlink.com",
"https://taikoscan.io",
"https://hekla.taikoscan.io",
"https://www.btrscan.com",
"https://saigon-explorer.roninchain.com",
"https://calibration.filfox.info/en",
"https://sepolia.arbiscan.io",
"https://sepolia-explorer.syndr.com",
"https://sepolia.scrollscan.com",
"https://scrollscan.com",
"https://hoodi.etherscan.io",
"https://xaiscan.io",
"https://network.radiustech.xyz",
"https://katanascan.com",
"https://explorer-sepolia.inkonchain.com",
"https://bob-sepolia.explorer.gobob.xyz",
"https://odyssey-explorer.ithaca.xyz",
"https://testnet.arcscan.app",
"https://explorer.zora.energy",
"https://sepolia.celoscan.io",
"https://sepolia.etherscan.io",
"https://sepolia-optimism.etherscan.io",
"https://cornscan.io",
"https://testnet.cornscan.io",
"https://sepolia.blastscan.io",
"https://base-sepolia-testnet-explorer.skalenodes.com",
"https://blockscout-testnet.polkadot.io",
"https://blockscout-kusama.polkadot.io",
"https://blockscout.polkadot.io",
"https://testnet.sophscan.xyz",
"https://explorer.degen.tips",
"https://sepolia.explorer.zora.energy",
"https://skale-base-explorer.skalenodes.com",
"https://aurorascan.dev",
"https://testnet.aurorascan.dev",
"https://sepolia.xaiscan.io",
];
static ETHERSCAN_API_KEY_NAMES: [&str; 12] = [
"ETHERSCAN_API_KEY",
"BLOCKSCOUT_API_KEY",
"ROUTESCAN_API_KEY",
"FTMSCAN_API_KEY",
"BOBASCAN_API_KEY",
"CORESCAN_API_KEY",
"MOONSCAN_API_KEY",
"MERLINSCAN_API_KEY",
"ZETASCAN_API_KEY",
"KAIASCAN_API_KEY",
"BERASCAN_API_KEY",
"BITLAYERSCAN_API_KEY",
];
static WRAPPED_NATIVE_TOKENS: [Address; 34] = [
address!("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"),
address!("0x4200000000000000000000000000000000000006"),
address!("0x967F8799aF07dF1534d48A95a5C9FEBE92c53AE0"),
address!("0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"),
address!("0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d"),
address!("0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270"),
address!("0x039e2fB66102314Ce7b64Ce5Ce3E5183bc94aD38"),
address!("0x6ed1F491e2d31536D6561f6bdB2AdC8F092a6076"),
address!("0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83"),
address!("0x5AEa5775959fBC2557Cc8789bC1bf90A239D9a91"),
address!("0x5555555555555555555555555555555555555555"),
address!("0x40375C92d9FAf44d2f9db9Bd9ba41a3317a2404f"),
address!("0xE30feDd158A2e3b13e9badaeABaFc5516e95e8C7"),
address!("0x00EDdD9621Fb08436d0331c149D1690909a5906d"),
address!("0x1514000000000000000000000000000000000000"),
address!("0x3439153EB7AF838Ad19d56E1571FBD09333C2809"),
address!("0xF6D226f9Dc15d9bB51182815b320D3fBE324e1bA"),
address!("0x653e645e3d81a72e71328Bc01A04002945E3ef7A"),
address!("0xA00744882684C3e4747faEFD68D283eA44099D03"),
address!("0xdEAddEaDdeadDEadDEADDEAddEADDEAddead1111"),
address!("0x5F0b1a82749cb4E2278EC87F8BF6B618dC71a8bf"),
address!("0x19Aac5f612f524B754CA7e7c41cbFa2E981A4432"),
address!("0x48b62137EdfA95a428D35C09E44256a739F6B557"),
address!("0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"),
address!("0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7"),
address!("0xF1f9E08a0818594FDe4713AE0Db1E46672Ca960E"),
address!("0x1fB719f10b56d7a85DCD32f27f897375fB21cfdd"),
address!("0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f"),
address!("0x263D8f36Bb8d0d9526255E205868C26690b04B88"),
address!("0x6969696969696969696969696969696969696969"),
address!("0x4300000000000000000000000000000000000004"),
address!("0xA51894664A773981C6C112C43ce576f315d5b1B6"),
address!("0xfF204e2681A6fA0e2C3FaDe68a1B28fb90E4Fc5F"),
address!("0x5300000000000000000000000000000000000004"),
];
static CHAIN_DATA: [ChainData; 199] = {
use FLAG_ARBITRUM as A;
use FLAG_ELASTIC as X;
use FLAG_ETHEREUM as E;
use FLAG_LEGACY as L;
use FLAG_OPTIMISM as O;
use FLAG_SUPPORTS_SHANGHAI as S;
use FLAG_TEMPO as TP;
use FLAG_TESTNET as T;
use NO_INDEX as N;
use NO_INDEX as W;
#[allow(clippy::too_many_arguments)]
const fn d(
name: u8,
native_currency_symbol: u8,
etherscan_api_url: u8,
etherscan_base_url: u8,
etherscan_api_key_name: u8,
average_blocktime_millis: u16,
flags: ChainFlags,
wrapped_native_token: u8,
) -> ChainData {
ChainData {
name,
native_currency_symbol,
etherscan_api_url,
etherscan_base_url,
etherscan_api_key_name,
average_blocktime_millis,
flags,
wrapped_native_token,
}
}
[
d(0, 0, 0, 0, 0, 12000, S | E, 0),
d(1, 0, N, N, 0, 0, T | E, W),
d(2, 0, N, N, 0, 0, T | E, W),
d(3, 0, N, N, 0, 0, T | E, W),
d(4, 0, N, N, 0, 0, S | T | E, W),
d(5, 0, 1, 1, 0, 2000, S | O, 1),
d(6, 1, 2, 2, 1, 1800, 0, W),
d(7, N, 3, 3, N, 5000, L, W),
d(8, N, 4, 4, 0, 5700, 0, W),
d(9, 2, 5, 5, N, 25000, L | S, 2),
d(10, 3, 6, 6, N, 25000, L | S | T, W),
d(11, 4, 7, 7, N, 500, 0, W),
d(12, 4, 8, 8, N, 500, T, W),
d(13, 0, N, N, 0, 0, T | E, W),
d(14, 5, 9, 9, 1, 6000, S, W),
d(15, 6, 10, 10, 1, 6000, S, W),
d(16, 7, 11, 11, 0, 2400, 0, W),
d(17, 8, 12, 12, 0, 2400, T, W),
d(18, 9, 13, 13, 0, 450, S, 3),
d(19, N, N, N, 0, 0, L | T | O, W),
d(20, 10, 14, 14, N, 500, S | T, W),
d(21, N, N, N, N, 0, 0, W),
d(22, N, 15, 15, N, 2000, L, W),
d(23, 9, 16, 16, 0, 450, S | T, W),
d(24, N, N, N, N, 0, 0, W),
d(25, N, 17, 17, 0, 5000, S, 4),
d(26, 11, 18, 18, 1, 2500, T, W),
d(27, N, 19, 19, 1, 5000, 0, W),
d(28, 0, 20, 20, 0, 1000, S | O, W),
d(29, 12, 21, 21, 0, 2100, S, 5),
d(30, 13, 22, 22, 0, 400, S, W),
d(31, 14, 23, 23, 0, 1000, S, 6),
d(32, 15, 24, 24, 1, 5000, L | S | T, W),
d(33, 16, 25, 25, 2, 60000, S, 7),
d(34, 16, 26, 26, 2, 60000, S | T, W),
d(35, 9, 27, 27, 0, 1000, S | O, 1),
d(36, 17, 28, 28, N, 2000, S | T | O, W),
d(37, 18, 29, 29, N, 1000, X, W),
d(38, N, N, N, 3, 1200, L, 8),
d(39, N, 30, 30, 0, 2000, S | O, W),
d(40, N, 31, 31, 4, 0, 0, W),
d(41, 0, 32, 32, 0, 1000, T | X, W),
d(42, N, N, N, N, 30000, 0, W),
d(43, 0, 33, 33, 0, 1000, X, 9),
d(44, N, N, N, 0, 5700, T, W),
d(45, 19, 34, 34, N, 10000, S, W),
d(46, N, 35, 35, 0, 260, S, W),
d(47, N, N, N, 0, 2000, S | T | O, W),
d(48, N, N, N, 1, 2000, O, W),
d(49, 20, 36, 36, 1, 2000, S | O, W),
d(50, N, 37, 37, 1, 12500, S | T, W),
d(51, N, N, N, 1, 12500, S | T, W),
d(52, N, N, N, 1, 12500, S | T, W),
d(53, 0, 38, 38, N, 250, S | X, W),
d(54, 0, 39, 39, N, 250, S | T | X, W),
d(55, N, 40, 40, 1, 12500, S, W),
d(56, 21, N, N, 1, 6000, S | T, W),
d(57, N, N, N, 1, 5700, T, W),
d(58, N, 41, 41, 1, 12500, S, W),
d(59, N, 42, 42, 1, 2000, S | T | O, W),
d(60, 19, 43, 43, N, 10101, S | T, W),
d(61, 22, 44, 44, 0, 700, S, W),
d(62, 23, 45, 45, 0, 2000, 0, 10),
d(63, 10, 46, 46, N, 500, S, W),
d(64, N, 47, 47, N, 0, 0, W),
d(65, 24, 48, 48, 5, 3000, 0, 11),
d(66, 0, 49, 49, 1, 2000, O, W),
d(67, 25, N, N, 6, 0, S | T, W),
d(68, 26, 50, 50, 6, 6500, S, W),
d(69, 27, 51, 51, 6, 6500, S, W),
d(70, 25, 52, 52, 6, 6500, S | T, W),
d(71, 0, 53, 53, 0, 1000, S | T | O, W),
d(72, 28, 54, 54, 0, 500, T, W),
d(73, 28, 55, 55, 0, 500, S, 12),
d(74, N, N, N, N, 200, T, W),
d(75, 29, 56, 56, 1, 700, S | T, W),
d(76, 30, 57, 57, 1, 6000, 0, 13),
d(77, 31, 58, 58, 1, 2500, 0, 14),
d(78, 32, 59, 59, N, 260, S, W),
d(79, 29, 60, 60, 1, 700, S, W),
d(80, N, 61, 61, 1, 2000, S | O, W),
d(81, N, 62, 62, 1, 2000, S | T | O, W),
d(82, 33, 63, 63, N, 3000, 0, W),
d(83, 22, 64, 64, 0, 700, S | T, W),
d(84, N, 65, 65, 0, 2000, S | T | O, W),
d(85, 0, 66, 66, 0, 1000, X, 15),
d(86, N, N, N, 3, 1200, L | T, W),
d(87, 34, 67, 67, 7, 3000, 0, 16),
d(88, 35, 68, 68, N, 500, S | TP, W),
d(89, 0, 69, 69, 0, 1000, S, W),
d(90, 36, 70, 70, 0, 7000, S, 17),
d(91, 0, 71, 71, N, 400, S | A, W),
d(92, 37, N, N, N, 5000, S, 18),
d(93, 20, 72, 72, 1, 2000, S | T | O, W),
d(94, 38, 73, 73, 0, 2000, S, 19),
d(95, 38, 74, 74, 0, 2000, S | T, W),
d(96, 9, 75, 75, 0, 1000, S | T | O, W),
d(97, 0, 76, 76, 0, 1000, S | T, W),
d(98, 39, 77, 77, 8, 6000, 0, 20),
d(99, N, N, N, 1, 5700, 0, W),
d(100, 40, 78, 78, 9, 1000, 0, 21),
d(101, 0, 79, 79, 0, 2000, S | O, 1),
d(102, N, N, N, N, 1900, T, W),
d(103, N, N, N, N, 1900, 0, W),
d(104, 41, 80, 80, 0, 1000, 0, W),
d(105, 41, 81, 81, 0, 1000, T, W),
d(106, 13, 82, 82, 0, 400, S | T, W),
d(107, N, 83, 83, N, 5000, S, W),
d(108, N, 84, 84, 0, 1000, T | X, W),
d(109, N, N, N, N, 0, S | T, W),
d(110, 42, 85, 85, 1, 2000, S, W),
d(111, 43, 86, 86, 1, 2000, S | T, W),
d(112, 32, 87, 87, N, 260, S | T, W),
d(113, 44, 88, 88, 1, 12000, S | T, W),
d(114, 14, 89, 89, 0, 1000, T, W),
d(115, 0, 90, 90, 0, 0, S | T | E, W),
d(116, N, 91, 91, N, 3000, S | T, W),
d(117, N, 92, 92, N, 1000, S | T, W),
d(118, N, 93, 93, N, 1000, 0, W),
d(119, N, N, N, N, 5500, 0, W),
d(120, 35, N, N, N, 500, S | T | TP, W),
d(121, N, N, N, N, 200, S | T, W),
d(122, 45, 94, 94, 1, 260, S | T, W),
d(123, 45, 95, 95, 0, 260, S, 22),
d(124, N, 96, 96, 1, 2000, S | O, W),
d(125, 46, 97, 97, N, 1000, T | X, W),
d(126, 0, 98, 98, 0, 260, S | A, 23),
d(127, 0, 99, 99, 0, 260, S | A, W),
d(128, 47, 100, 100, 0, 1000, S | O, W),
d(129, N, 101, 101, N, 0, L | T, W),
d(130, N, 102, 102, N, 6000, L, W),
d(131, 35, 68, 103, N, 500, S | T | TP, W),
d(132, 35, 68, 104, N, 500, S | T | TP, W),
d(133, 48, 103, 105, 1, 5000, S, W),
d(134, N, 104, 106, 0, 2000, S | T, W),
d(135, N, 105, 107, 0, 2000, S, 24),
d(136, 49, 106, 108, 0, 7000, S | T, 17),
d(137, 49, 107, 109, N, 7000, S | T, 17),
d(138, 0, 108, 110, N, 400, S | T | A, W),
d(139, 50, 109, 111, 0, 1000, L | X, 25),
d(140, 0, 110, 112, 1, 260, S, 26),
d(141, 0, 111, 113, 1, 1000, S | O, W),
d(142, N, N, N, 1, 2000, T | O, W),
d(143, N, N, N, N, 2000, T, W),
d(144, N, 112, 114, 0, 2000, T, W),
d(145, 0, 113, 115, 0, 2000, S, 27),
d(146, 0, 114, 116, N, 2000, S, W),
d(147, 51, N, N, N, 0, L, 28),
d(148, 52, 115, 117, N, 500, S | T, W),
d(149, 12, 116, 118, 0, 2100, T, W),
d(150, 53, 117, 119, 10, 2000, S | T, W),
d(151, 53, 118, 120, 10, 2000, S, 29),
d(152, N, 119, 121, 0, 2000, S, 30),
d(153, 0, N, N, 0, 2000, S | T | O, W),
d(154, 0, 120, 122, 0, 2000, S | T | O, W),
d(155, 54, 121, 123, N, 260, S, W),
d(156, 54, 122, 124, N, 260, S | T, W),
d(157, 0, 123, 125, 1, 260, S | T, W),
d(158, 32, 124, 126, N, 260, S, W),
d(159, 48, 125, 127, 1, 5000, S | T, W),
d(160, 0, 126, 128, 0, 12000, S, 31),
d(161, 0, 127, 129, 0, 12000, S | T, W),
d(162, 34, 128, 130, 11, 3000, 0, 32),
d(163, 33, 129, 131, N, 3000, T, W),
d(164, N, 130, 132, N, 30000, T, W),
d(165, N, N, N, 0, 260, T | A, W),
d(166, N, N, N, 0, 260, T | A, W),
d(167, N, 131, 133, 0, 260, S | T | A, W),
d(168, N, 132, 134, 0, 260, S | T, W),
d(169, N, N, N, N, 1000, S | T, W),
d(170, 0, 133, 135, 0, 3000, S | T, W),
d(171, 0, 134, 136, 0, 3000, S, 33),
d(172, N, 135, 137, 0, 0, S | T, W),
d(173, 55, 136, 138, 0, 260, S, W),
d(174, 52, 137, 139, N, 500, S, W),
d(175, 0, 138, 140, 0, 1000, S | O, W),
d(176, N, 139, 141, 1, 1000, S | T | O, W),
d(177, N, 140, 142, N, 2000, S | T, W),
d(178, N, 141, 143, N, 1000, S | T | O, W),
d(179, 51, N, N, N, 0, L | T, W),
d(180, 56, 142, 144, 1, 500, S | T, W),
d(181, N, 143, 145, 1, 2000, O, W),
d(182, 47, 144, 146, 1, 1000, S | T, W),
d(183, 0, 145, 147, 0, 0, S | T | E, W),
d(184, 0, 146, 148, 0, 2000, S | T | O, W),
d(185, 57, 147, 149, 2, 0, S, W),
d(186, 57, 148, 150, 2, 0, S | T, W),
d(187, N, 149, 151, 0, 2000, S | T | O, W),
d(188, N, 150, 152, 1, 1000, T, W),
d(189, 58, 151, 153, 1, 2000, S | T, W),
d(190, 59, 152, 154, 1, 2000, S, W),
d(191, 60, 153, 155, 1, 2000, S, W),
d(192, 50, 154, 156, 0, 1000, L | T | X, W),
d(193, 61, 155, 157, N, 600, 0, W),
d(194, N, 156, 158, 1, 2000, S | T | O, W),
d(195, N, 157, 159, 1, 1000, 0, W),
d(196, N, 158, 160, 0, 1100, 0, W),
d(197, N, 159, 161, 0, 1100, T, W),
d(198, 55, 160, 162, 0, 260, S | T, W),
]
};
static PARSE_NAMES: phf::Map<&'static str, ChainIndex> = ::phf::Map {
key: 16287231350648472473,
disps: &[
(0, 34),
(0, 62),
(0, 2),
(0, 18),
(0, 59),
(0, 33),
(0, 5),
(0, 2),
(0, 34),
(0, 16),
(0, 1),
(0, 53),
(0, 0),
(0, 51),
(0, 50),
(0, 27),
(0, 0),
(0, 18),
(0, 4),
(0, 5),
(0, 2),
(0, 0),
(0, 2),
(0, 100),
(0, 6),
(0, 5),
(0, 2),
(0, 30),
(0, 15),
(0, 15),
(0, 1),
(1, 57),
(0, 0),
(0, 7),
(0, 9),
(0, 0),
(0, 54),
(0, 7),
(0, 12),
(0, 30),
(0, 0),
(0, 12),
(0, 24),
(0, 60),
(0, 58),
(0, 0),
(0, 6),
(0, 9),
(0, 0),
(0, 8),
(0, 12),
(0, 14),
(0, 8),
(0, 3),
(0, 0),
(1, 67),
(0, 20),
(0, 37),
(0, 12),
(0, 0),
(0, 33),
(0, 14),
(0, 11),
(0, 0),
(0, 21),
(2, 22),
(0, 29),
(0, 146),
(0, 0),
(0, 1),
(0, 3),
(0, 179),
],
entries: &[
("fluent", NamedChain::Fluent.index()),
("xdc-testnet", NamedChain::XdcTestnet.index()),
("soneium-minato-testnet", NamedChain::SoneiumMinatoTestnet.index()),
("arbitrum-nova", NamedChain::ArbitrumNova.index()),
("evmos", NamedChain::Evmos.index()),
("superposition-testnet", NamedChain::SuperpositionTestnet.index()),
("plasma", NamedChain::Plasma.index()),
("binance-smart-chain", NamedChain::BinanceSmartChain.index()),
("corn", NamedChain::Corn.index()),
("lisk", NamedChain::Lisk.index()),
("bob-sepolia", NamedChain::BobSepolia.index()),
("tempo-devnet", NamedChain::TempoDevnet.index()),
("fuji", NamedChain::AvalancheFuji.index()),
("ronin-testnet", NamedChain::RoninTestnet.index()),
("plasma-testnet", NamedChain::PlasmaTestnet.index()),
("canto", NamedChain::Canto.index()),
("goerli", NamedChain::Goerli.index()),
("optimism-kovan", NamedChain::OptimismKovan.index()),
("aurora", NamedChain::Aurora.index()),
("memecore-formicarium", NamedChain::Formicarium.index()),
("zksync-testnet", NamedChain::ZkSyncTestnet.index()),
("avalanche-fuji", NamedChain::AvalancheFuji.index()),
("syndr-sepolia", NamedChain::SyndrSepolia.index()),
("immutable-testnet", NamedChain::ImmutableTestnet.index()),
("megaeth", NamedChain::MegaEth.index()),
("elastos", NamedChain::Elastos.index()),
("celo-sepolia", NamedChain::CeloSepolia.index()),
("world-sepolia", NamedChain::WorldSepolia.index()),
("cannon", NamedChain::Cannon.index()),
("evmos-testnet", NamedChain::EvmosTestnet.index()),
("iotex", NamedChain::Iotex.index()),
("tempo-mainnet", NamedChain::Tempo.index()),
("boba", NamedChain::Boba.index()),
("amoy", NamedChain::PolygonAmoy.index()),
("sophon-testnet", NamedChain::SophonTestnet.index()),
("opbnb-testnet", NamedChain::OpBNBTestnet.index()),
("taiko", NamedChain::Taiko.index()),
("plume-testnet", NamedChain::PlumeTestnet.index()),
("skale-base-sepolia-testnet", NamedChain::SkaleBaseSepoliaTestnet.index()),
("bitlayer", NamedChain::Bitlayer.index()),
("zora", NamedChain::Zora.index()),
("bsc", NamedChain::BinanceSmartChain.index()),
("poa", NamedChain::Poa.index()),
("abstract-testnet", NamedChain::AbstractTestnet.index()),
("unichain-sepolia", NamedChain::UnichainSepolia.index()),
("optimism-goerli", NamedChain::OptimismGoerli.index()),
("avalanche", NamedChain::Avalanche.index()),
("moonriver", NamedChain::Moonriver.index()),
("megaeth-testnet", NamedChain::MegaEthTestnet.index()),
("darwinia", NamedChain::Darwinia.index()),
("morden", NamedChain::Morden.index()),
("rsk", NamedChain::Rsk.index()),
("hoodi", NamedChain::Hoodi.index()),
("memecore-insectarium", NamedChain::Insectarium.index()),
("fuse", NamedChain::Fuse.index()),
("gnosis", NamedChain::Gnosis.index()),
("moonbeam", NamedChain::Moonbeam.index()),
("aurora-testnet", NamedChain::AuroraTestnet.index()),
("linea-sepolia", NamedChain::LineaSepolia.index()),
("radius", NamedChain::Radius.index()),
("xdai", NamedChain::Gnosis.index()),
("polygon", NamedChain::Polygon.index()),
("sonic", NamedChain::Sonic.index()),
("mode", NamedChain::Mode.index()),
("bob", NamedChain::Bob.index()),
("emerald", NamedChain::Emerald.index()),
("blast", NamedChain::Blast.index()),
("mantle", NamedChain::Mantle.index()),
("base-sepolia", NamedChain::BaseSepolia.index()),
("monad-testnet", NamedChain::MonadTestnet.index()),
("dev", NamedChain::Dev.index()),
("zora-sepolia", NamedChain::ZoraSepolia.index()),
("base-goerli", NamedChain::BaseGoerli.index()),
("stable-mainnet", NamedChain::StableMainnet.index()),
("arbitrum-goerli", NamedChain::ArbitrumGoerli.index()),
("arbitrum", NamedChain::Arbitrum.index()),
("optimism-sepolia", NamedChain::OptimismSepolia.index()),
("fluent-devnet", NamedChain::FluentDevnet.index()),
("robinhood", NamedChain::Robinhood.index()),
("superposition", NamedChain::Superposition.index()),
("kusama", NamedChain::Kusama.index()),
("degen", NamedChain::Degen.index()),
("hardhat", NamedChain::AnvilHardhat.index()),
("memecore", NamedChain::MemeCore.index()),
("berachain-bepolia", NamedChain::BerachainBepolia.index()),
("hyperliquid", NamedChain::Hyperliquid.index()),
("zeta", NamedChain::Zeta.index()),
("bnb-smart-chain-testnet", NamedChain::BinanceSmartChainTestnet.index()),
("plume", NamedChain::Plume.index()),
("injective-testnet", NamedChain::InjectiveTestnet.index()),
("ethlive", NamedChain::Mainnet.index()),
("abstract", NamedChain::Abstract.index()),
("arc-testnet", NamedChain::ArcTestnet.index()),
("apechain-testnet", NamedChain::Curtis.index()),
("merlin", NamedChain::Merlin.index()),
("flare-coston2", NamedChain::FlareCoston2.index()),
("mainnet", NamedChain::Mainnet.index()),
("viction", NamedChain::Viction.index()),
("fraxtal-testnet", NamedChain::FraxtalTestnet.index()),
("happychain-testnet", NamedChain::HappychainTestnet.index()),
("ink", NamedChain::Ink.index()),
("syndr", NamedChain::Syndr.index()),
("immutable", NamedChain::Immutable.index()),
("rsk-testnet", NamedChain::RskTestnet.index()),
("lens-testnet", NamedChain::LensTestnet.index()),
("story", NamedChain::Story.index()),
("celo", NamedChain::Celo.index()),
("acala", NamedChain::Acala.index()),
("vana", NamedChain::Vana.index()),
("cfx", NamedChain::Cfx.index()),
("skale-base", NamedChain::SkaleBase.index()),
("acala-mandala-testnet", NamedChain::AcalaMandalaTestnet.index()),
("apechain", NamedChain::ApeChain.index()),
("robinhood-testnet", NamedChain::RobinhoodTestnet.index()),
("filecoin-calibration-testnet", NamedChain::FilecoinCalibrationTestnet.index()),
("stable-testnet", NamedChain::StableTestnet.index()),
("berachain", NamedChain::Berachain.index()),
("cronos-testnet", NamedChain::CronosTestnet.index()),
("kaia", NamedChain::Kaia.index()),
("opbnb-mainnet", NamedChain::OpBNBMainnet.index()),
("karura-testnet", NamedChain::KaruraTestnet.index()),
("autonomys-nova-testnet", NamedChain::AutonomysNovaTestnet.index()),
("monad", NamedChain::Monad.index()),
("zksync", NamedChain::ZkSync.index()),
("pgn-sepolia", NamedChain::PgnSepolia.index()),
("fantom", NamedChain::Fantom.index()),
("redbelly", NamedChain::Redbelly.index()),
("bsc-testnet", NamedChain::BinanceSmartChainTestnet.index()),
("blast-sepolia", NamedChain::BlastSepolia.index()),
("linea", NamedChain::Linea.index()),
("fantom-testnet", NamedChain::FantomTestnet.index()),
("crab", NamedChain::Crab.index()),
("corn-testnet", NamedChain::CornTestnet.index()),
("chiado", NamedChain::Chiado.index()),
("xdc-mainnet", NamedChain::XdcMainnet.index()),
("redbelly-testnet", NamedChain::RedbellyTestnet.index()),
("grav", NamedChain::Gravity.index()),
("bnb-smart-chain", NamedChain::BinanceSmartChain.index()),
("radius-testnet", NamedChain::RadiusTestnet.index()),
("sokol", NamedChain::Sokol.index()),
("formicarium", NamedChain::Formicarium.index()),
("fraxtal", NamedChain::Fraxtal.index()),
("flare", NamedChain::Flare.index()),
("ropsten", NamedChain::Ropsten.index()),
("moonbeam-dev", NamedChain::MoonbeamDev.index()),
("injective", NamedChain::Injective.index()),
("xai", NamedChain::Xai.index()),
("pulsechain", NamedChain::Pulsechain.index()),
("battlechain", NamedChain::BattleChain.index()),
("sei", NamedChain::Sei.index()),
("core", NamedChain::Core.index()),
("berachain-bepolia-testnet", NamedChain::BerachainBepolia.index()),
("optimism", NamedChain::Optimism.index()),
("etherlink-shadownet", NamedChain::EtherlinkShadownet.index()),
("scroll-sepolia", NamedChain::ScrollSepolia.index()),
("pgn", NamedChain::Pgn.index()),
("ink-sepolia", NamedChain::InkSepolia.index()),
("binance-smart-chain-testnet", NamedChain::BinanceSmartChainTestnet.index()),
("ronin", NamedChain::Ronin.index()),
("insectarium", NamedChain::Insectarium.index()),
("xai-sepolia", NamedChain::XaiSepolia.index()),
("tempo-testnet", NamedChain::TempoTestnet.index()),
("arbitrum-sepolia", NamedChain::ArbitrumSepolia.index()),
("telos", NamedChain::TelosEvm.index()),
("acala-testnet", NamedChain::AcalaTestnet.index()),
("rinkeby", NamedChain::Rinkeby.index()),
("odyssey", NamedChain::Odyssey.index()),
("kovan", NamedChain::Kovan.index()),
("gravity-alpha-testnet-sepolia", NamedChain::GravityAlphaTestnetSepolia.index()),
("lens", NamedChain::Lens.index()),
("emerald-testnet", NamedChain::EmeraldTestnet.index()),
("sophon", NamedChain::Sophon.index()),
("polkadot", NamedChain::Polkadot.index()),
("metis", NamedChain::Metis.index()),
("scroll", NamedChain::Scroll.index()),
("oasis", NamedChain::Oasis.index()),
("base", NamedChain::Base.index()),
("polkadot-testnet", NamedChain::PolkadotTestnet.index()),
("mantle-sepolia", NamedChain::MantleSepolia.index()),
("canto-testnet", NamedChain::CantoTestnet.index()),
("etherlink", NamedChain::Etherlink.index()),
("unichain", NamedChain::Unichain.index()),
("curtis", NamedChain::Curtis.index()),
("holesky", NamedChain::Holesky.index()),
("filecoin-mainnet", NamedChain::FilecoinMainnet.index()),
("koi", NamedChain::Koi.index()),
("tempo", NamedChain::Tempo.index()),
("signet-pecorino", NamedChain::SignetPecorino.index()),
("gravity-alpha-mainnet", NamedChain::GravityAlphaMainnet.index()),
("treasure-topaz", NamedChain::TreasureTopaz.index()),
("sonic-testnet", NamedChain::SonicTestnet.index()),
("polygon-amoy", NamedChain::PolygonAmoy.index()),
("fluent-testnet", NamedChain::FluentTestnet.index()),
("telos-testnet", NamedChain::TelosEvmTestnet.index()),
("shimmer", NamedChain::Shimmer.index()),
("world", NamedChain::World.index()),
("sei-testnet", NamedChain::SeiTestnet.index()),
("pulsechain-testnet", NamedChain::PulsechainTestnet.index()),
("gnosis-chain", NamedChain::Gnosis.index()),
("cfx-testnet", NamedChain::CfxTestnet.index()),
("katana", NamedChain::Katana.index()),
("cronos", NamedChain::Cronos.index()),
("sepolia", NamedChain::Sepolia.index()),
("tempo-moderato", NamedChain::TempoModerato.index()),
("battlechain-testnet", NamedChain::BattleChainTestnet.index()),
("taiko-hekla", NamedChain::TaikoHekla.index()),
("treasure", NamedChain::Treasure.index()),
("anvil-hardhat", NamedChain::AnvilHardhat.index()),
("anvil", NamedChain::AnvilHardhat.index()),
("soneium", NamedChain::Soneium.index()),
("arbitrum-testnet", NamedChain::ArbitrumTestnet.index()),
("linea-goerli", NamedChain::LineaGoerli.index()),
("treasure-topaz-testnet", NamedChain::TreasureTopaz.index()),
("mode-sepolia", NamedChain::ModeSepolia.index()),
("moonbase", NamedChain::Moonbase.index()),
("karura", NamedChain::Karura.index()),
],
};
#[cfg(feature = "serde")]
static SERDE_NAMES: phf::Map<&'static str, ChainIndex> = ::phf::Map {
key: 16287231350648472473,
disps: &[
(0, 7),
(0, 18),
(0, 9),
(0, 17),
(0, 1),
(0, 22),
(0, 4),
(0, 0),
(0, 13),
(0, 17),
(0, 0),
(0, 0),
(0, 76),
(0, 0),
(1, 0),
(0, 2),
(0, 3),
(0, 1),
(0, 7),
(0, 13),
(0, 4),
(1, 52),
(0, 2),
(0, 4),
(0, 84),
(0, 8),
(0, 16),
(0, 6),
(1, 17),
(0, 16),
(0, 3),
(0, 0),
(0, 100),
(0, 6),
(0, 29),
(0, 26),
(0, 0),
(0, 104),
(0, 38),
],
entries: &[
("ink_sepolia_testnet", NamedChain::InkSepolia.index()),
("skale_base_sepolia_testnet", NamedChain::SkaleBaseSepoliaTestnet.index()),
("telos_evm_testnet", NamedChain::TelosEvmTestnet.index()),
("arbitrum_nova", NamedChain::ArbitrumNova.index()),
("mantle_sepolia", NamedChain::MantleSepolia.index()),
("ink_sepolia", NamedChain::InkSepolia.index()),
("optimism_kovan", NamedChain::OptimismKovan.index()),
("arbitrum-one", NamedChain::Arbitrum.index()),
("sonic_testnet", NamedChain::SonicTestnet.index()),
("bsc_testnet", NamedChain::BinanceSmartChainTestnet.index()),
("fraxtal_testnet", NamedChain::FraxtalTestnet.index()),
("fluent_testnet", NamedChain::FluentTestnet.index()),
("arbitrum_testnet", NamedChain::ArbitrumTestnet.index()),
("gravity_alpha_testnet_sepolia", NamedChain::GravityAlphaTestnetSepolia.index()),
("formicairum", NamedChain::Formicarium.index()),
("arc_testnet", NamedChain::ArcTestnet.index()),
("meme_core", NamedChain::MemeCore.index()),
("berachain_bepolia", NamedChain::BerachainBepolia.index()),
("battlechain_testnet", NamedChain::BattleChainTestnet.index()),
("aurora_testnet", NamedChain::AuroraTestnet.index()),
("celo_sepolia", NamedChain::CeloSepolia.index()),
("zk_sync", NamedChain::ZkSync.index()),
("acala_mandala_testnet", NamedChain::AcalaMandalaTestnet.index()),
("syndr_sepolia", NamedChain::SyndrSepolia.index()),
("opbnb_mainnet", NamedChain::OpBNBMainnet.index()),
("megaeth_testnet", NamedChain::MegaEthTestnet.index()),
("sei_testnet", NamedChain::SeiTestnet.index()),
("zora_sepolia", NamedChain::ZoraSepolia.index()),
("arbitrum_goerli", NamedChain::ArbitrumGoerli.index()),
("stable_testnet", NamedChain::StableTestnet.index()),
("pulsechain_testnet", NamedChain::PulsechainTestnet.index()),
("tempo_moderato", NamedChain::TempoModerato.index()),
("linea_sepolia", NamedChain::LineaSepolia.index()),
("filecoin_calibration_testnet", NamedChain::FilecoinCalibrationTestnet.index()),
("xdc_mainnet", NamedChain::XdcMainnet.index()),
("op-bnb-testnet", NamedChain::OpBNBTestnet.index()),
("tempo_testnet", NamedChain::TempoTestnet.index()),
("fantom_testnet", NamedChain::FantomTestnet.index()),
("plume_testnet", NamedChain::PlumeTestnet.index()),
("ronin_testnet", NamedChain::RoninTestnet.index()),
("ape_chain", NamedChain::ApeChain.index()),
("scroll_sepolia", NamedChain::ScrollSepolia.index()),
("pgn_sepolia", NamedChain::PgnSepolia.index()),
("soneium_minato_testnet", NamedChain::SoneiumMinatoTestnet.index()),
("binance_smart_chain", NamedChain::BinanceSmartChain.index()),
("xai_sepolia", NamedChain::XaiSepolia.index()),
("skale_base", NamedChain::SkaleBase.index()),
("plasma_testnet", NamedChain::PlasmaTestnet.index()),
("stable_mainnet", NamedChain::StableMainnet.index()),
("canto_testnet", NamedChain::CantoTestnet.index()),
("unichain_sepolia", NamedChain::UnichainSepolia.index()),
("zksync_testnet", NamedChain::ZkSyncTestnet.index()),
("bob_sepolia", NamedChain::BobSepolia.index()),
("lens_testnet", NamedChain::LensTestnet.index()),
("treasure_topaz", NamedChain::TreasureTopaz.index()),
("evmos_testnet", NamedChain::EvmosTestnet.index()),
("robinhood_testnet", NamedChain::RobinhoodTestnet.index()),
("base_sepolia", NamedChain::BaseSepolia.index()),
("binance_smart_chain_testnet", NamedChain::BinanceSmartChainTestnet.index()),
("worldchain-sepolia", NamedChain::WorldSepolia.index()),
("autonomys_nova_testnet", NamedChain::AutonomysNovaTestnet.index()),
("optimism_sepolia", NamedChain::OptimismSepolia.index()),
("corn_testnet", NamedChain::CornTestnet.index()),
("zk_sync_testnet", NamedChain::ZkSyncTestnet.index()),
("linea_goerli", NamedChain::LineaGoerli.index()),
("superposition_testnet", NamedChain::SuperpositionTestnet.index()),
("etherlink_shadownet", NamedChain::EtherlinkShadownet.index()),
("blast_sepolia", NamedChain::BlastSepolia.index()),
("base_goerli", NamedChain::BaseGoerli.index()),
("abstract_testnet", NamedChain::AbstractTestnet.index()),
("fluent_devnet", NamedChain::FluentDevnet.index()),
("gravity", NamedChain::Gravity.index()),
("acala_testnet", NamedChain::AcalaTestnet.index()),
("filecoin_mainnet", NamedChain::FilecoinMainnet.index()),
("telos-evm-testnet", NamedChain::TelosEvmTestnet.index()),
("opbnb_testnet", NamedChain::OpBNBTestnet.index()),
("flare_coston2", NamedChain::FlareCoston2.index()),
("monad_testnet", NamedChain::MonadTestnet.index()),
("moonbeam_dev", NamedChain::MoonbeamDev.index()),
("telos_testnet", NamedChain::TelosEvmTestnet.index()),
("optimism_goerli", NamedChain::OptimismGoerli.index()),
("xdc_testnet", NamedChain::XdcTestnet.index()),
("arbitrum_sepolia", NamedChain::ArbitrumSepolia.index()),
("scroll_sepolia_testnet", NamedChain::ScrollSepolia.index()),
("conflux-espace-testnet", NamedChain::CfxTestnet.index()),
("worldchain", NamedChain::World.index()),
("happychain_testnet", NamedChain::HappychainTestnet.index()),
("op-bnb-mainnet", NamedChain::OpBNBMainnet.index()),
("sophon_testnet", NamedChain::SophonTestnet.index()),
("mega_eth", NamedChain::MegaEth.index()),
("anvil_hardhat", NamedChain::AnvilHardhat.index()),
("emerald_testnet", NamedChain::EmeraldTestnet.index()),
("world_sepolia", NamedChain::WorldSepolia.index()),
("rsk_testnet", NamedChain::RskTestnet.index()),
("telos_evm", NamedChain::TelosEvm.index()),
("mode_sepolia", NamedChain::ModeSepolia.index()),
("cronos_testnet", NamedChain::CronosTestnet.index()),
("signet_pecorino", NamedChain::SignetPecorino.index()),
("avalanche_fuji", NamedChain::AvalancheFuji.index()),
("polygon_amoy", NamedChain::PolygonAmoy.index()),
("gravity_alpha_mainnet", NamedChain::GravityAlphaMainnet.index()),
("karura_testnet", NamedChain::KaruraTestnet.index()),
("redbelly_testnet", NamedChain::RedbellyTestnet.index()),
("battle_chain_testnet", NamedChain::BattleChainTestnet.index()),
("mega_eth_testnet", NamedChain::MegaEthTestnet.index()),
("arbitrum_one", NamedChain::Arbitrum.index()),
("immutable_testnet", NamedChain::ImmutableTestnet.index()),
("battle_chain", NamedChain::BattleChain.index()),
("cfx_testnet", NamedChain::CfxTestnet.index()),
("tempo_devnet", NamedChain::TempoDevnet.index()),
("radius_testnet", NamedChain::RadiusTestnet.index()),
("polkadot_testnet", NamedChain::PolkadotTestnet.index()),
("taiko_hekla", NamedChain::TaikoHekla.index()),
("injective_testnet", NamedChain::InjectiveTestnet.index()),
("conflux-espace", NamedChain::Cfx.index()),
],
};
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn no_index_is_not_used_as_index() {
assert_table_len(CHAIN_NAMES.len());
assert_table_len(NATIVE_CURRENCY_SYMBOLS.len());
assert_table_len(ETHERSCAN_API_URLS.len());
assert_table_len(ETHERSCAN_BASE_URLS.len());
assert_table_len(ETHERSCAN_API_KEY_NAMES.len());
assert_table_len(WRAPPED_NATIVE_TOKENS.len());
for data in CHAIN_DATA.iter().copied() {
assert_index(data.name, CHAIN_NAMES.len());
assert_optional_index(data.native_currency_symbol, NATIVE_CURRENCY_SYMBOLS.len());
assert_optional_index(data.etherscan_api_url, ETHERSCAN_API_URLS.len());
assert_optional_index(data.etherscan_base_url, ETHERSCAN_BASE_URLS.len());
assert_optional_index(data.etherscan_api_key_name, ETHERSCAN_API_KEY_NAMES.len());
assert_optional_index(data.wrapped_native_token, WRAPPED_NATIVE_TOKENS.len());
}
}
fn assert_table_len(len: usize) {
assert!(len <= NO_INDEX as usize);
}
fn assert_index(index: u8, len: usize) {
assert_ne!(index, NO_INDEX);
assert!((index as usize) < len);
}
fn assert_optional_index(index: u8, len: usize) {
if index != NO_INDEX {
assert!((index as usize) < len);
}
}
}