Skip to main content

alloy_chains/generated/
named.rs

1// @generated by scripts/update-registry.py. Do NOT modify manually.
2
3use alloy_primitives::{Address, address};
4
5/// An Ethereum EIP-155 chain.
6#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
7#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
8#[cfg_attr(feature = "schema", schemars(rename_all = "snake_case"))]
9#[repr(u64)]
10#[allow(missing_docs)]
11#[non_exhaustive]
12pub enum NamedChain {
13    Mainnet = 1,
14    Morden = 2,
15    Ropsten = 3,
16    Rinkeby = 4,
17    Goerli = 5,
18    Optimism = 10,
19    Flare = 14,
20    Elastos = 20,
21    Cronos = 25,
22    Rsk = 30,
23    RskTestnet = 31,
24    TelosEvm = 40,
25    TelosEvmTestnet = 41,
26    Kovan = 42,
27    Crab = 44,
28    Darwinia = 46,
29    XdcMainnet = 50,
30    XdcTestnet = 51,
31    BinanceSmartChain = 56,
32    OptimismKovan = 69,
33    CfxTestnet = 71,
34    Sokol = 77,
35    Viction = 88,
36    BinanceSmartChainTestnet = 97,
37    Poa = 99,
38    Gnosis = 100,
39    FlareCoston2 = 114,
40    Fuse = 122,
41    Unichain = 130,
42    Polygon = 137,
43    Monad = 143,
44    Sonic = 146,
45    Shimmer = 148,
46    Redbelly = 151,
47    RedbellyTestnet = 153,
48    OpBNBMainnet = 204,
49    HappychainTestnet = 216,
50    Lens = 232,
51    Fantom = 250,
52    Fraxtal = 252,
53    Boba = 288,
54    ZkSyncTestnet = 300,
55    FilecoinMainnet = 314,
56    ZkSync = 324,
57    CronosTestnet = 338,
58    Pulsechain = 369,
59    Syndr = 404,
60    OptimismGoerli = 420,
61    Pgn = 424,
62    World = 480,
63    AcalaMandalaTestnet = 595,
64    KaruraTestnet = 596,
65    AcalaTestnet = 597,
66    BattleChain = 626,
67    BattleChainTestnet = 627,
68    Karura = 686,
69    Koi = 701,
70    CantoTestnet = 740,
71    Acala = 787,
72    ModeSepolia = 919,
73    PulsechainTestnet = 943,
74    StableMainnet = 988,
75    Hyperliquid = 999,
76    Cfx = 1030,
77    Metis = 1088,
78    Core = 1116,
79    Lisk = 1135,
80    MoonbeamDev = 1281,
81    Moonbeam = 1284,
82    Moonriver = 1285,
83    Moonbase = 1287,
84    UnichainSepolia = 1301,
85    SeiTestnet = 1328,
86    Sei = 1329,
87    Dev = 1337,
88    InjectiveTestnet = 1439,
89    Vana = 1480,
90    Story = 1514,
91    GravityAlphaMainnet = 1625,
92    Pharos = 1672,
93    Injective = 1776,
94    Soneium = 1868,
95    SoneiumMinatoTestnet = 1946,
96    Ronin = 2020,
97    StableTestnet = 2201,
98    FraxtalTestnet = 2522,
99    Abstract = 2741,
100    FantomTestnet = 4002,
101    Merlin = 4200,
102    Tempo = 4217,
103    MegaEth = 4326,
104    MemeCore = 4352,
105    Robinhood = 4663,
106    Iotex = 4689,
107    WorldSepolia = 4801,
108    Mantle = 5000,
109    MantleSepolia = 5003,
110    OpBNBTestnet = 5611,
111    MegaEthTestnet = 6343,
112    Zeta = 7000,
113    Canto = 7700,
114    Kaia = 8217,
115    Base = 8453,
116    EvmosTestnet = 9000,
117    Evmos = 9001,
118    Plasma = 9745,
119    PlasmaTestnet = 9746,
120    MonadTestnet = 10143,
121    Chiado = 10200,
122    AbstractTestnet = 11124,
123    Cannon = 13370,
124    Immutable = 13371,
125    ImmutableTestnet = 13473,
126    GravityAlphaTestnetSepolia = 13505,
127    SignetPecorino = 14174,
128    SonicTestnet = 14601,
129    Holesky = 17000,
130    FluentDevnet = 20993,
131    FluentTestnet = 20994,
132    Fluent = 25363,
133    Oasis = 26863,
134    TempoDevnet = 31318,
135    AnvilHardhat = 31337,
136    Curtis = 33111,
137    ApeChain = 33139,
138    Mode = 34443,
139    LensTestnet = 37111,
140    Arbitrum = 42161,
141    ArbitrumNova = 42170,
142    Celo = 42220,
143    EmeraldTestnet = 42261,
144    Emerald = 42262,
145    TempoTestnet = 42429,
146    TempoModerato = 42431,
147    Etherlink = 42793,
148    AvalancheFuji = 43113,
149    Avalanche = 43114,
150    Formicarium = 43521,
151    Insectarium = 43522,
152    RobinhoodTestnet = 46630,
153    Sophon = 50104,
154    Superposition = 55244,
155    Ink = 57073,
156    PgnSepolia = 58008,
157    LineaGoerli = 59140,
158    LineaSepolia = 59141,
159    Linea = 59144,
160    Bob = 60808,
161    Treasure = 61166,
162    RadiusTestnet = 72344,
163    PolygonAmoy = 80002,
164    BerachainBepolia = 80069,
165    Berachain = 80094,
166    Blast = 81457,
167    BaseGoerli = 84531,
168    BaseSepolia = 84532,
169    Plume = 98866,
170    PlumeTestnet = 98867,
171    SuperpositionTestnet = 98985,
172    Gravity = 127001,
173    EtherlinkShadownet = 127823,
174    Taiko = 167000,
175    TaikoHekla = 167009,
176    Bitlayer = 200901,
177    RoninTestnet = 202601,
178    FilecoinCalibrationTestnet = 314159,
179    ArbitrumTestnet = 421611,
180    ArbitrumGoerli = 421613,
181    ArbitrumSepolia = 421614,
182    SyndrSepolia = 444444,
183    AutonomysNovaTestnet = 490000,
184    ScrollSepolia = 534351,
185    Scroll = 534352,
186    Hoodi = 560048,
187    Xai = 660279,
188    PharosTestnet = 688688,
189    Radius = 723487,
190    Katana = 747474,
191    InkSepolia = 763373,
192    BobSepolia = 808813,
193    Odyssey = 911867,
194    TreasureTopaz = 978658,
195    ArcTestnet = 5042002,
196    Zora = 7777777,
197    CeloSepolia = 11142220,
198    Sepolia = 11155111,
199    OptimismSepolia = 11155420,
200    Corn = 21000000,
201    CornTestnet = 21000001,
202    BlastSepolia = 168587773,
203    SkaleBaseSepoliaTestnet = 324705682,
204    PolkadotTestnet = 420420417,
205    Kusama = 420420418,
206    Polkadot = 420420419,
207    SophonTestnet = 531050104,
208    Degen = 666666666,
209    ZoraSepolia = 999999999,
210    SkaleBase = 1187947933,
211    Aurora = 1313161554,
212    AuroraTestnet = 1313161555,
213    XaiSepolia = 37714555429,
214}
215
216impl NamedChain {
217    /// The number of named chains.
218    pub const COUNT: usize = 201;
219
220    /// All named chains in declaration order.
221    pub const VARIANTS: &'static [Self] = &[
222        Self::Mainnet,
223        Self::Morden,
224        Self::Ropsten,
225        Self::Rinkeby,
226        Self::Goerli,
227        Self::Optimism,
228        Self::Flare,
229        Self::Elastos,
230        Self::Cronos,
231        Self::Rsk,
232        Self::RskTestnet,
233        Self::TelosEvm,
234        Self::TelosEvmTestnet,
235        Self::Kovan,
236        Self::Crab,
237        Self::Darwinia,
238        Self::XdcMainnet,
239        Self::XdcTestnet,
240        Self::BinanceSmartChain,
241        Self::OptimismKovan,
242        Self::CfxTestnet,
243        Self::Sokol,
244        Self::Viction,
245        Self::BinanceSmartChainTestnet,
246        Self::Poa,
247        Self::Gnosis,
248        Self::FlareCoston2,
249        Self::Fuse,
250        Self::Unichain,
251        Self::Polygon,
252        Self::Monad,
253        Self::Sonic,
254        Self::Shimmer,
255        Self::Redbelly,
256        Self::RedbellyTestnet,
257        Self::OpBNBMainnet,
258        Self::HappychainTestnet,
259        Self::Lens,
260        Self::Fantom,
261        Self::Fraxtal,
262        Self::Boba,
263        Self::ZkSyncTestnet,
264        Self::FilecoinMainnet,
265        Self::ZkSync,
266        Self::CronosTestnet,
267        Self::Pulsechain,
268        Self::Syndr,
269        Self::OptimismGoerli,
270        Self::Pgn,
271        Self::World,
272        Self::AcalaMandalaTestnet,
273        Self::KaruraTestnet,
274        Self::AcalaTestnet,
275        Self::BattleChain,
276        Self::BattleChainTestnet,
277        Self::Karura,
278        Self::Koi,
279        Self::CantoTestnet,
280        Self::Acala,
281        Self::ModeSepolia,
282        Self::PulsechainTestnet,
283        Self::StableMainnet,
284        Self::Hyperliquid,
285        Self::Cfx,
286        Self::Metis,
287        Self::Core,
288        Self::Lisk,
289        Self::MoonbeamDev,
290        Self::Moonbeam,
291        Self::Moonriver,
292        Self::Moonbase,
293        Self::UnichainSepolia,
294        Self::SeiTestnet,
295        Self::Sei,
296        Self::Dev,
297        Self::InjectiveTestnet,
298        Self::Vana,
299        Self::Story,
300        Self::GravityAlphaMainnet,
301        Self::Pharos,
302        Self::Injective,
303        Self::Soneium,
304        Self::SoneiumMinatoTestnet,
305        Self::Ronin,
306        Self::StableTestnet,
307        Self::FraxtalTestnet,
308        Self::Abstract,
309        Self::FantomTestnet,
310        Self::Merlin,
311        Self::Tempo,
312        Self::MegaEth,
313        Self::MemeCore,
314        Self::Robinhood,
315        Self::Iotex,
316        Self::WorldSepolia,
317        Self::Mantle,
318        Self::MantleSepolia,
319        Self::OpBNBTestnet,
320        Self::MegaEthTestnet,
321        Self::Zeta,
322        Self::Canto,
323        Self::Kaia,
324        Self::Base,
325        Self::EvmosTestnet,
326        Self::Evmos,
327        Self::Plasma,
328        Self::PlasmaTestnet,
329        Self::MonadTestnet,
330        Self::Chiado,
331        Self::AbstractTestnet,
332        Self::Cannon,
333        Self::Immutable,
334        Self::ImmutableTestnet,
335        Self::GravityAlphaTestnetSepolia,
336        Self::SignetPecorino,
337        Self::SonicTestnet,
338        Self::Holesky,
339        Self::FluentDevnet,
340        Self::FluentTestnet,
341        Self::Fluent,
342        Self::Oasis,
343        Self::TempoDevnet,
344        Self::AnvilHardhat,
345        Self::Curtis,
346        Self::ApeChain,
347        Self::Mode,
348        Self::LensTestnet,
349        Self::Arbitrum,
350        Self::ArbitrumNova,
351        Self::Celo,
352        Self::EmeraldTestnet,
353        Self::Emerald,
354        Self::TempoTestnet,
355        Self::TempoModerato,
356        Self::Etherlink,
357        Self::AvalancheFuji,
358        Self::Avalanche,
359        Self::Formicarium,
360        Self::Insectarium,
361        Self::RobinhoodTestnet,
362        Self::Sophon,
363        Self::Superposition,
364        Self::Ink,
365        Self::PgnSepolia,
366        Self::LineaGoerli,
367        Self::LineaSepolia,
368        Self::Linea,
369        Self::Bob,
370        Self::Treasure,
371        Self::RadiusTestnet,
372        Self::PolygonAmoy,
373        Self::BerachainBepolia,
374        Self::Berachain,
375        Self::Blast,
376        Self::BaseGoerli,
377        Self::BaseSepolia,
378        Self::Plume,
379        Self::PlumeTestnet,
380        Self::SuperpositionTestnet,
381        Self::Gravity,
382        Self::EtherlinkShadownet,
383        Self::Taiko,
384        Self::TaikoHekla,
385        Self::Bitlayer,
386        Self::RoninTestnet,
387        Self::FilecoinCalibrationTestnet,
388        Self::ArbitrumTestnet,
389        Self::ArbitrumGoerli,
390        Self::ArbitrumSepolia,
391        Self::SyndrSepolia,
392        Self::AutonomysNovaTestnet,
393        Self::ScrollSepolia,
394        Self::Scroll,
395        Self::Hoodi,
396        Self::Xai,
397        Self::PharosTestnet,
398        Self::Radius,
399        Self::Katana,
400        Self::InkSepolia,
401        Self::BobSepolia,
402        Self::Odyssey,
403        Self::TreasureTopaz,
404        Self::ArcTestnet,
405        Self::Zora,
406        Self::CeloSepolia,
407        Self::Sepolia,
408        Self::OptimismSepolia,
409        Self::Corn,
410        Self::CornTestnet,
411        Self::BlastSepolia,
412        Self::SkaleBaseSepoliaTestnet,
413        Self::PolkadotTestnet,
414        Self::Kusama,
415        Self::Polkadot,
416        Self::SophonTestnet,
417        Self::Degen,
418        Self::ZoraSepolia,
419        Self::SkaleBase,
420        Self::Aurora,
421        Self::AuroraTestnet,
422        Self::XaiSepolia,
423    ];
424
425    /// All named chain string representations in declaration order.
426    pub const VARIANT_NAMES: &'static [&'static str] = &{
427        let mut names = [""; 201];
428        let mut index = 0;
429        while index < CHAIN_DATA.len() {
430            names[index] = CHAIN_DATA[index].name();
431            index += 1;
432        }
433        names
434    };
435
436    #[inline]
437    const fn from_index(index: ChainIndex) -> Self {
438        Self::VARIANTS[index as usize]
439    }
440
441    const fn index(self) -> ChainIndex {
442        match self {
443            Self::Mainnet => 0,
444            Self::Morden => 1,
445            Self::Ropsten => 2,
446            Self::Rinkeby => 3,
447            Self::Goerli => 4,
448            Self::Optimism => 5,
449            Self::Flare => 6,
450            Self::Elastos => 7,
451            Self::Cronos => 8,
452            Self::Rsk => 9,
453            Self::RskTestnet => 10,
454            Self::TelosEvm => 11,
455            Self::TelosEvmTestnet => 12,
456            Self::Kovan => 13,
457            Self::Crab => 14,
458            Self::Darwinia => 15,
459            Self::XdcMainnet => 16,
460            Self::XdcTestnet => 17,
461            Self::BinanceSmartChain => 18,
462            Self::OptimismKovan => 19,
463            Self::CfxTestnet => 20,
464            Self::Sokol => 21,
465            Self::Viction => 22,
466            Self::BinanceSmartChainTestnet => 23,
467            Self::Poa => 24,
468            Self::Gnosis => 25,
469            Self::FlareCoston2 => 26,
470            Self::Fuse => 27,
471            Self::Unichain => 28,
472            Self::Polygon => 29,
473            Self::Monad => 30,
474            Self::Sonic => 31,
475            Self::Shimmer => 32,
476            Self::Redbelly => 33,
477            Self::RedbellyTestnet => 34,
478            Self::OpBNBMainnet => 35,
479            Self::HappychainTestnet => 36,
480            Self::Lens => 37,
481            Self::Fantom => 38,
482            Self::Fraxtal => 39,
483            Self::Boba => 40,
484            Self::ZkSyncTestnet => 41,
485            Self::FilecoinMainnet => 42,
486            Self::ZkSync => 43,
487            Self::CronosTestnet => 44,
488            Self::Pulsechain => 45,
489            Self::Syndr => 46,
490            Self::OptimismGoerli => 47,
491            Self::Pgn => 48,
492            Self::World => 49,
493            Self::AcalaMandalaTestnet => 50,
494            Self::KaruraTestnet => 51,
495            Self::AcalaTestnet => 52,
496            Self::BattleChain => 53,
497            Self::BattleChainTestnet => 54,
498            Self::Karura => 55,
499            Self::Koi => 56,
500            Self::CantoTestnet => 57,
501            Self::Acala => 58,
502            Self::ModeSepolia => 59,
503            Self::PulsechainTestnet => 60,
504            Self::StableMainnet => 61,
505            Self::Hyperliquid => 62,
506            Self::Cfx => 63,
507            Self::Metis => 64,
508            Self::Core => 65,
509            Self::Lisk => 66,
510            Self::MoonbeamDev => 67,
511            Self::Moonbeam => 68,
512            Self::Moonriver => 69,
513            Self::Moonbase => 70,
514            Self::UnichainSepolia => 71,
515            Self::SeiTestnet => 72,
516            Self::Sei => 73,
517            Self::Dev => 74,
518            Self::InjectiveTestnet => 75,
519            Self::Vana => 76,
520            Self::Story => 77,
521            Self::GravityAlphaMainnet => 78,
522            Self::Pharos => 79,
523            Self::Injective => 80,
524            Self::Soneium => 81,
525            Self::SoneiumMinatoTestnet => 82,
526            Self::Ronin => 83,
527            Self::StableTestnet => 84,
528            Self::FraxtalTestnet => 85,
529            Self::Abstract => 86,
530            Self::FantomTestnet => 87,
531            Self::Merlin => 88,
532            Self::Tempo => 89,
533            Self::MegaEth => 90,
534            Self::MemeCore => 91,
535            Self::Robinhood => 92,
536            Self::Iotex => 93,
537            Self::WorldSepolia => 94,
538            Self::Mantle => 95,
539            Self::MantleSepolia => 96,
540            Self::OpBNBTestnet => 97,
541            Self::MegaEthTestnet => 98,
542            Self::Zeta => 99,
543            Self::Canto => 100,
544            Self::Kaia => 101,
545            Self::Base => 102,
546            Self::EvmosTestnet => 103,
547            Self::Evmos => 104,
548            Self::Plasma => 105,
549            Self::PlasmaTestnet => 106,
550            Self::MonadTestnet => 107,
551            Self::Chiado => 108,
552            Self::AbstractTestnet => 109,
553            Self::Cannon => 110,
554            Self::Immutable => 111,
555            Self::ImmutableTestnet => 112,
556            Self::GravityAlphaTestnetSepolia => 113,
557            Self::SignetPecorino => 114,
558            Self::SonicTestnet => 115,
559            Self::Holesky => 116,
560            Self::FluentDevnet => 117,
561            Self::FluentTestnet => 118,
562            Self::Fluent => 119,
563            Self::Oasis => 120,
564            Self::TempoDevnet => 121,
565            Self::AnvilHardhat => 122,
566            Self::Curtis => 123,
567            Self::ApeChain => 124,
568            Self::Mode => 125,
569            Self::LensTestnet => 126,
570            Self::Arbitrum => 127,
571            Self::ArbitrumNova => 128,
572            Self::Celo => 129,
573            Self::EmeraldTestnet => 130,
574            Self::Emerald => 131,
575            Self::TempoTestnet => 132,
576            Self::TempoModerato => 133,
577            Self::Etherlink => 134,
578            Self::AvalancheFuji => 135,
579            Self::Avalanche => 136,
580            Self::Formicarium => 137,
581            Self::Insectarium => 138,
582            Self::RobinhoodTestnet => 139,
583            Self::Sophon => 140,
584            Self::Superposition => 141,
585            Self::Ink => 142,
586            Self::PgnSepolia => 143,
587            Self::LineaGoerli => 144,
588            Self::LineaSepolia => 145,
589            Self::Linea => 146,
590            Self::Bob => 147,
591            Self::Treasure => 148,
592            Self::RadiusTestnet => 149,
593            Self::PolygonAmoy => 150,
594            Self::BerachainBepolia => 151,
595            Self::Berachain => 152,
596            Self::Blast => 153,
597            Self::BaseGoerli => 154,
598            Self::BaseSepolia => 155,
599            Self::Plume => 156,
600            Self::PlumeTestnet => 157,
601            Self::SuperpositionTestnet => 158,
602            Self::Gravity => 159,
603            Self::EtherlinkShadownet => 160,
604            Self::Taiko => 161,
605            Self::TaikoHekla => 162,
606            Self::Bitlayer => 163,
607            Self::RoninTestnet => 164,
608            Self::FilecoinCalibrationTestnet => 165,
609            Self::ArbitrumTestnet => 166,
610            Self::ArbitrumGoerli => 167,
611            Self::ArbitrumSepolia => 168,
612            Self::SyndrSepolia => 169,
613            Self::AutonomysNovaTestnet => 170,
614            Self::ScrollSepolia => 171,
615            Self::Scroll => 172,
616            Self::Hoodi => 173,
617            Self::Xai => 174,
618            Self::PharosTestnet => 175,
619            Self::Radius => 176,
620            Self::Katana => 177,
621            Self::InkSepolia => 178,
622            Self::BobSepolia => 179,
623            Self::Odyssey => 180,
624            Self::TreasureTopaz => 181,
625            Self::ArcTestnet => 182,
626            Self::Zora => 183,
627            Self::CeloSepolia => 184,
628            Self::Sepolia => 185,
629            Self::OptimismSepolia => 186,
630            Self::Corn => 187,
631            Self::CornTestnet => 188,
632            Self::BlastSepolia => 189,
633            Self::SkaleBaseSepoliaTestnet => 190,
634            Self::PolkadotTestnet => 191,
635            Self::Kusama => 192,
636            Self::Polkadot => 193,
637            Self::SophonTestnet => 194,
638            Self::Degen => 195,
639            Self::ZoraSepolia => 196,
640            Self::SkaleBase => 197,
641            Self::Aurora => 198,
642            Self::AuroraTestnet => 199,
643            Self::XaiSepolia => 200,
644        }
645    }
646
647    #[inline]
648    const fn data(self) -> ChainData {
649        CHAIN_DATA[self.index() as usize]
650    }
651
652    #[inline]
653    const fn has_flag(self, flag: ChainFlags) -> bool {
654        self.data().flags & flag != 0
655    }
656
657    /// Returns the chain for the given EIP-155 chain ID.
658    pub const fn from_chain_id(id: u64) -> Option<Self> {
659        match id {
660            1 => Some(Self::Mainnet),
661            2 => Some(Self::Morden),
662            3 => Some(Self::Ropsten),
663            4 => Some(Self::Rinkeby),
664            5 => Some(Self::Goerli),
665            10 => Some(Self::Optimism),
666            14 => Some(Self::Flare),
667            20 => Some(Self::Elastos),
668            25 => Some(Self::Cronos),
669            30 => Some(Self::Rsk),
670            31 => Some(Self::RskTestnet),
671            40 => Some(Self::TelosEvm),
672            41 => Some(Self::TelosEvmTestnet),
673            42 => Some(Self::Kovan),
674            44 => Some(Self::Crab),
675            46 => Some(Self::Darwinia),
676            50 => Some(Self::XdcMainnet),
677            51 => Some(Self::XdcTestnet),
678            56 => Some(Self::BinanceSmartChain),
679            69 => Some(Self::OptimismKovan),
680            71 => Some(Self::CfxTestnet),
681            77 => Some(Self::Sokol),
682            88 => Some(Self::Viction),
683            97 => Some(Self::BinanceSmartChainTestnet),
684            99 => Some(Self::Poa),
685            100 => Some(Self::Gnosis),
686            114 => Some(Self::FlareCoston2),
687            122 => Some(Self::Fuse),
688            130 => Some(Self::Unichain),
689            137 => Some(Self::Polygon),
690            143 => Some(Self::Monad),
691            146 => Some(Self::Sonic),
692            148 => Some(Self::Shimmer),
693            151 => Some(Self::Redbelly),
694            153 => Some(Self::RedbellyTestnet),
695            204 => Some(Self::OpBNBMainnet),
696            216 => Some(Self::HappychainTestnet),
697            232 => Some(Self::Lens),
698            250 => Some(Self::Fantom),
699            252 => Some(Self::Fraxtal),
700            288 => Some(Self::Boba),
701            300 => Some(Self::ZkSyncTestnet),
702            314 => Some(Self::FilecoinMainnet),
703            324 => Some(Self::ZkSync),
704            338 => Some(Self::CronosTestnet),
705            369 => Some(Self::Pulsechain),
706            404 => Some(Self::Syndr),
707            420 => Some(Self::OptimismGoerli),
708            424 => Some(Self::Pgn),
709            480 => Some(Self::World),
710            595 => Some(Self::AcalaMandalaTestnet),
711            596 => Some(Self::KaruraTestnet),
712            597 => Some(Self::AcalaTestnet),
713            626 => Some(Self::BattleChain),
714            627 => Some(Self::BattleChainTestnet),
715            686 => Some(Self::Karura),
716            701 => Some(Self::Koi),
717            740 => Some(Self::CantoTestnet),
718            787 => Some(Self::Acala),
719            919 => Some(Self::ModeSepolia),
720            943 => Some(Self::PulsechainTestnet),
721            988 => Some(Self::StableMainnet),
722            999 => Some(Self::Hyperliquid),
723            1030 => Some(Self::Cfx),
724            1088 => Some(Self::Metis),
725            1116 => Some(Self::Core),
726            1135 => Some(Self::Lisk),
727            1281 => Some(Self::MoonbeamDev),
728            1284 => Some(Self::Moonbeam),
729            1285 => Some(Self::Moonriver),
730            1287 => Some(Self::Moonbase),
731            1301 => Some(Self::UnichainSepolia),
732            1328 => Some(Self::SeiTestnet),
733            1329 => Some(Self::Sei),
734            1337 => Some(Self::Dev),
735            1439 => Some(Self::InjectiveTestnet),
736            1480 => Some(Self::Vana),
737            1514 => Some(Self::Story),
738            1625 => Some(Self::GravityAlphaMainnet),
739            1672 => Some(Self::Pharos),
740            1776 => Some(Self::Injective),
741            1868 => Some(Self::Soneium),
742            1946 => Some(Self::SoneiumMinatoTestnet),
743            2020 => Some(Self::Ronin),
744            2201 => Some(Self::StableTestnet),
745            2522 => Some(Self::FraxtalTestnet),
746            2741 => Some(Self::Abstract),
747            4002 => Some(Self::FantomTestnet),
748            4200 => Some(Self::Merlin),
749            4217 => Some(Self::Tempo),
750            4326 => Some(Self::MegaEth),
751            4352 => Some(Self::MemeCore),
752            4663 => Some(Self::Robinhood),
753            4689 => Some(Self::Iotex),
754            4801 => Some(Self::WorldSepolia),
755            5000 => Some(Self::Mantle),
756            5003 => Some(Self::MantleSepolia),
757            5611 => Some(Self::OpBNBTestnet),
758            6343 => Some(Self::MegaEthTestnet),
759            7000 => Some(Self::Zeta),
760            7700 => Some(Self::Canto),
761            8217 => Some(Self::Kaia),
762            8453 => Some(Self::Base),
763            9000 => Some(Self::EvmosTestnet),
764            9001 => Some(Self::Evmos),
765            9745 => Some(Self::Plasma),
766            9746 => Some(Self::PlasmaTestnet),
767            10143 => Some(Self::MonadTestnet),
768            10200 => Some(Self::Chiado),
769            11124 => Some(Self::AbstractTestnet),
770            13370 => Some(Self::Cannon),
771            13371 => Some(Self::Immutable),
772            13473 => Some(Self::ImmutableTestnet),
773            13505 => Some(Self::GravityAlphaTestnetSepolia),
774            14174 => Some(Self::SignetPecorino),
775            14601 => Some(Self::SonicTestnet),
776            17000 => Some(Self::Holesky),
777            20993 => Some(Self::FluentDevnet),
778            20994 => Some(Self::FluentTestnet),
779            25363 => Some(Self::Fluent),
780            26863 => Some(Self::Oasis),
781            31318 => Some(Self::TempoDevnet),
782            31337 => Some(Self::AnvilHardhat),
783            33111 => Some(Self::Curtis),
784            33139 => Some(Self::ApeChain),
785            34443 => Some(Self::Mode),
786            37111 => Some(Self::LensTestnet),
787            42161 => Some(Self::Arbitrum),
788            42170 => Some(Self::ArbitrumNova),
789            42220 => Some(Self::Celo),
790            42261 => Some(Self::EmeraldTestnet),
791            42262 => Some(Self::Emerald),
792            42429 => Some(Self::TempoTestnet),
793            42431 => Some(Self::TempoModerato),
794            42793 => Some(Self::Etherlink),
795            43113 => Some(Self::AvalancheFuji),
796            43114 => Some(Self::Avalanche),
797            43521 => Some(Self::Formicarium),
798            43522 => Some(Self::Insectarium),
799            46630 => Some(Self::RobinhoodTestnet),
800            50104 => Some(Self::Sophon),
801            55244 => Some(Self::Superposition),
802            57073 => Some(Self::Ink),
803            58008 => Some(Self::PgnSepolia),
804            59140 => Some(Self::LineaGoerli),
805            59141 => Some(Self::LineaSepolia),
806            59144 => Some(Self::Linea),
807            60808 => Some(Self::Bob),
808            61166 => Some(Self::Treasure),
809            72344 => Some(Self::RadiusTestnet),
810            80002 => Some(Self::PolygonAmoy),
811            80069 => Some(Self::BerachainBepolia),
812            80094 => Some(Self::Berachain),
813            81457 => Some(Self::Blast),
814            84531 => Some(Self::BaseGoerli),
815            84532 => Some(Self::BaseSepolia),
816            98866 => Some(Self::Plume),
817            98867 => Some(Self::PlumeTestnet),
818            98985 => Some(Self::SuperpositionTestnet),
819            127001 => Some(Self::Gravity),
820            127823 => Some(Self::EtherlinkShadownet),
821            167000 => Some(Self::Taiko),
822            167009 => Some(Self::TaikoHekla),
823            200901 => Some(Self::Bitlayer),
824            202601 => Some(Self::RoninTestnet),
825            314159 => Some(Self::FilecoinCalibrationTestnet),
826            421611 => Some(Self::ArbitrumTestnet),
827            421613 => Some(Self::ArbitrumGoerli),
828            421614 => Some(Self::ArbitrumSepolia),
829            444444 => Some(Self::SyndrSepolia),
830            490000 => Some(Self::AutonomysNovaTestnet),
831            534351 => Some(Self::ScrollSepolia),
832            534352 => Some(Self::Scroll),
833            560048 => Some(Self::Hoodi),
834            660279 => Some(Self::Xai),
835            688688 => Some(Self::PharosTestnet),
836            723487 => Some(Self::Radius),
837            747474 => Some(Self::Katana),
838            763373 => Some(Self::InkSepolia),
839            808813 => Some(Self::BobSepolia),
840            911867 => Some(Self::Odyssey),
841            978658 => Some(Self::TreasureTopaz),
842            5042002 => Some(Self::ArcTestnet),
843            7777777 => Some(Self::Zora),
844            11142220 => Some(Self::CeloSepolia),
845            11155111 => Some(Self::Sepolia),
846            11155420 => Some(Self::OptimismSepolia),
847            21000000 => Some(Self::Corn),
848            21000001 => Some(Self::CornTestnet),
849            168587773 => Some(Self::BlastSepolia),
850            324705682 => Some(Self::SkaleBaseSepoliaTestnet),
851            420420417 => Some(Self::PolkadotTestnet),
852            420420418 => Some(Self::Kusama),
853            420420419 => Some(Self::Polkadot),
854            531050104 => Some(Self::SophonTestnet),
855            666666666 => Some(Self::Degen),
856            999999999 => Some(Self::ZoraSepolia),
857            1187947933 => Some(Self::SkaleBase),
858            1313161554 => Some(Self::Aurora),
859            1313161555 => Some(Self::AuroraTestnet),
860            37714555429 => Some(Self::XaiSepolia),
861            _ => None,
862        }
863    }
864
865    /// Returns the string representation of the chain.
866    #[inline]
867    pub const fn as_str(&self) -> &'static str {
868        self.data().name()
869    }
870
871    /// Returns `true` if this chain is Ethereum or an Ethereum testnet.
872    #[inline]
873    pub const fn is_ethereum(&self) -> bool {
874        self.has_flag(FLAG_ETHEREUM)
875    }
876
877    /// Returns true if the chain contains Optimism configuration.
878    #[inline]
879    pub const fn is_optimism(self) -> bool {
880        self.has_flag(FLAG_OPTIMISM)
881    }
882
883    /// Returns true if the chain contains Gnosis configuration.
884    #[inline]
885    pub const fn is_gnosis(self) -> bool {
886        matches!(self, Self::Gnosis | Self::Chiado)
887    }
888
889    /// Returns true if the chain contains Polygon configuration.
890    #[inline]
891    pub const fn is_polygon(self) -> bool {
892        matches!(self, Self::Polygon | Self::PolygonAmoy)
893    }
894
895    /// Returns true if the chain contains Arbitrum configuration.
896    #[inline]
897    pub const fn is_arbitrum(self) -> bool {
898        self.has_flag(FLAG_ARBITRUM)
899    }
900
901    /// Returns true if the chain contains Elastic Network configuration.
902    #[inline]
903    pub const fn is_elastic(self) -> bool {
904        self.has_flag(FLAG_ELASTIC)
905    }
906
907    /// Returns true if the chain contains Tempo configuration.
908    #[inline]
909    pub const fn is_tempo(self) -> bool {
910        self.has_flag(FLAG_TEMPO)
911    }
912
913    /// Returns true if the chain uses a custom Sourcify-compatible API.
914    #[inline]
915    pub const fn is_custom_sourcify(self) -> bool {
916        matches!(self, Self::Tempo | Self::TempoTestnet | Self::TempoModerato)
917    }
918
919    /// Returns whether the chain implements EIP-1559.
920    #[inline]
921    pub const fn is_legacy(self) -> bool {
922        self.has_flag(FLAG_LEGACY)
923    }
924
925    /// Returns whether the chain supports the Shanghai hardfork.
926    #[inline]
927    pub const fn supports_shanghai(self) -> bool {
928        self.has_flag(FLAG_SUPPORTS_SHANGHAI)
929    }
930
931    /// Returns whether the chain is a testnet.
932    #[inline]
933    pub const fn is_testnet(self) -> bool {
934        self.has_flag(FLAG_TESTNET)
935    }
936
937    /// Returns the symbol of the chain's native currency.
938    #[inline]
939    pub const fn native_currency_symbol(self) -> Option<&'static str> {
940        self.data().native_currency_symbol()
941    }
942
943    /// Returns the chain's blockchain explorer and its API URLs.
944    #[inline]
945    pub const fn etherscan_urls(self) -> Option<(&'static str, &'static str)> {
946        let data = self.data();
947        match (data.etherscan_api_url(), data.etherscan_base_url()) {
948            (Some(api), Some(base)) => Some((api, base)),
949            _ => None,
950        }
951    }
952
953    /// Returns the chain's blockchain explorer API key environment variable name.
954    #[inline]
955    pub const fn etherscan_api_key_name(self) -> Option<&'static str> {
956        self.data().etherscan_api_key_name()
957    }
958
959    /// Returns the address of the most popular wrapped native token address.
960    #[inline]
961    pub const fn wrapped_native_token(self) -> Option<Address> {
962        let index = self.data().wrapped_native_token;
963        if index == NO_INDEX { None } else { Some(WRAPPED_NATIVE_TOKENS[index as usize]) }
964    }
965
966    #[inline]
967    pub(crate) const fn average_blocktime_millis(self) -> u16 {
968        self.data().average_blocktime_millis
969    }
970
971    pub(crate) fn from_parse_str(value: &str) -> Option<Self> {
972        PARSE_NAMES.get(value).copied().map(Self::from_index)
973    }
974
975    #[cfg(feature = "serde")]
976    pub(crate) fn from_serde_str(value: &str) -> Option<Self> {
977        PARSE_NAMES.get(value).or_else(|| SERDE_NAMES.get(value)).copied().map(Self::from_index)
978    }
979}
980
981type ChainIndex = u8;
982type ChainFlags = u8;
983
984const FLAG_LEGACY: ChainFlags = 1 << 0;
985const FLAG_SUPPORTS_SHANGHAI: ChainFlags = 1 << 1;
986const FLAG_TESTNET: ChainFlags = 1 << 2;
987const FLAG_ETHEREUM: ChainFlags = 1 << 3;
988const FLAG_OPTIMISM: ChainFlags = 1 << 4;
989const FLAG_ARBITRUM: ChainFlags = 1 << 5;
990const FLAG_ELASTIC: ChainFlags = 1 << 6;
991const FLAG_TEMPO: ChainFlags = 1 << 7;
992const NO_INDEX: u8 = u8::MAX;
993
994#[derive(Clone, Copy)]
995#[repr(C, packed)]
996struct ChainData {
997    name: u8,
998    native_currency_symbol: u8,
999    etherscan_api_url: u8,
1000    etherscan_base_url: u8,
1001    etherscan_api_key_name: u8,
1002    average_blocktime_millis: u16,
1003    flags: ChainFlags,
1004    wrapped_native_token: u8,
1005}
1006
1007impl ChainData {
1008    #[inline]
1009    const fn name(self) -> &'static str {
1010        CHAIN_NAMES[self.name as usize]
1011    }
1012
1013    #[inline]
1014    const fn native_currency_symbol(self) -> Option<&'static str> {
1015        static_str(&NATIVE_CURRENCY_SYMBOLS, self.native_currency_symbol)
1016    }
1017
1018    #[inline]
1019    const fn etherscan_api_url(self) -> Option<&'static str> {
1020        static_str(&ETHERSCAN_API_URLS, self.etherscan_api_url)
1021    }
1022
1023    #[inline]
1024    const fn etherscan_base_url(self) -> Option<&'static str> {
1025        static_str(&ETHERSCAN_BASE_URLS, self.etherscan_base_url)
1026    }
1027
1028    #[inline]
1029    const fn etherscan_api_key_name(self) -> Option<&'static str> {
1030        static_str(&ETHERSCAN_API_KEY_NAMES, self.etherscan_api_key_name)
1031    }
1032}
1033
1034const fn static_str(table: &'static [&'static str], index: u8) -> Option<&'static str> {
1035    if index == NO_INDEX { None } else { Some(table[index as usize]) }
1036}
1037
1038#[cfg(test)]
1039pub(crate) const PARSE_ALIASES: &[(NamedChain, &str)] = &[
1040    (NamedChain::Mainnet, "ethlive"),
1041    (NamedChain::BinanceSmartChain, "binance-smart-chain"),
1042    (NamedChain::BinanceSmartChain, "bnb-smart-chain"),
1043    (NamedChain::BinanceSmartChainTestnet, "binance-smart-chain-testnet"),
1044    (NamedChain::BinanceSmartChainTestnet, "bnb-smart-chain-testnet"),
1045    (NamedChain::Gnosis, "gnosis"),
1046    (NamedChain::Gnosis, "gnosis-chain"),
1047    (NamedChain::Tempo, "tempo-mainnet"),
1048    (NamedChain::AnvilHardhat, "anvil"),
1049    (NamedChain::AnvilHardhat, "hardhat"),
1050    (NamedChain::Curtis, "apechain-testnet"),
1051    (NamedChain::AvalancheFuji, "avalanche-fuji"),
1052    (NamedChain::Formicarium, "memecore-formicarium"),
1053    (NamedChain::Insectarium, "memecore-insectarium"),
1054    (NamedChain::PolygonAmoy, "polygon-amoy"),
1055    (NamedChain::BerachainBepolia, "berachain-bepolia-testnet"),
1056    (NamedChain::TreasureTopaz, "treasure-topaz-testnet"),
1057];
1058
1059#[cfg(all(test, feature = "serde"))]
1060pub(crate) const SERDE_ALIASES: &[(NamedChain, &str)] = &[
1061    (NamedChain::RskTestnet, "rsk_testnet"),
1062    (NamedChain::TelosEvm, "telos_evm"),
1063    (NamedChain::TelosEvmTestnet, "telos_evm_testnet"),
1064    (NamedChain::TelosEvmTestnet, "telos_testnet"),
1065    (NamedChain::TelosEvmTestnet, "telos-evm-testnet"),
1066    (NamedChain::XdcMainnet, "xdc_mainnet"),
1067    (NamedChain::XdcTestnet, "xdc_testnet"),
1068    (NamedChain::BinanceSmartChain, "binance_smart_chain"),
1069    (NamedChain::OptimismKovan, "optimism_kovan"),
1070    (NamedChain::CfxTestnet, "cfx_testnet"),
1071    (NamedChain::CfxTestnet, "conflux-espace-testnet"),
1072    (NamedChain::BinanceSmartChainTestnet, "binance_smart_chain_testnet"),
1073    (NamedChain::BinanceSmartChainTestnet, "bsc_testnet"),
1074    (NamedChain::FlareCoston2, "flare_coston2"),
1075    (NamedChain::RedbellyTestnet, "redbelly_testnet"),
1076    (NamedChain::OpBNBMainnet, "opbnb_mainnet"),
1077    (NamedChain::OpBNBMainnet, "op-bnb-mainnet"),
1078    (NamedChain::HappychainTestnet, "happychain_testnet"),
1079    (NamedChain::ZkSyncTestnet, "zk_sync_testnet"),
1080    (NamedChain::ZkSyncTestnet, "zksync_testnet"),
1081    (NamedChain::FilecoinMainnet, "filecoin_mainnet"),
1082    (NamedChain::ZkSync, "zk_sync"),
1083    (NamedChain::CronosTestnet, "cronos_testnet"),
1084    (NamedChain::OptimismGoerli, "optimism_goerli"),
1085    (NamedChain::World, "worldchain"),
1086    (NamedChain::AcalaMandalaTestnet, "acala_mandala_testnet"),
1087    (NamedChain::KaruraTestnet, "karura_testnet"),
1088    (NamedChain::AcalaTestnet, "acala_testnet"),
1089    (NamedChain::BattleChain, "battle_chain"),
1090    (NamedChain::BattleChainTestnet, "battle_chain_testnet"),
1091    (NamedChain::BattleChainTestnet, "battlechain_testnet"),
1092    (NamedChain::CantoTestnet, "canto_testnet"),
1093    (NamedChain::ModeSepolia, "mode_sepolia"),
1094    (NamedChain::PulsechainTestnet, "pulsechain_testnet"),
1095    (NamedChain::StableMainnet, "stable_mainnet"),
1096    (NamedChain::Cfx, "conflux-espace"),
1097    (NamedChain::MoonbeamDev, "moonbeam_dev"),
1098    (NamedChain::UnichainSepolia, "unichain_sepolia"),
1099    (NamedChain::SeiTestnet, "sei_testnet"),
1100    (NamedChain::InjectiveTestnet, "injective_testnet"),
1101    (NamedChain::GravityAlphaMainnet, "gravity_alpha_mainnet"),
1102    (NamedChain::SoneiumMinatoTestnet, "soneium_minato_testnet"),
1103    (NamedChain::StableTestnet, "stable_testnet"),
1104    (NamedChain::FraxtalTestnet, "fraxtal_testnet"),
1105    (NamedChain::FantomTestnet, "fantom_testnet"),
1106    (NamedChain::MegaEth, "mega_eth"),
1107    (NamedChain::MemeCore, "meme_core"),
1108    (NamedChain::WorldSepolia, "world_sepolia"),
1109    (NamedChain::WorldSepolia, "worldchain-sepolia"),
1110    (NamedChain::MantleSepolia, "mantle_sepolia"),
1111    (NamedChain::OpBNBTestnet, "opbnb_testnet"),
1112    (NamedChain::OpBNBTestnet, "op-bnb-testnet"),
1113    (NamedChain::MegaEthTestnet, "mega_eth_testnet"),
1114    (NamedChain::MegaEthTestnet, "megaeth_testnet"),
1115    (NamedChain::EvmosTestnet, "evmos_testnet"),
1116    (NamedChain::PlasmaTestnet, "plasma_testnet"),
1117    (NamedChain::MonadTestnet, "monad_testnet"),
1118    (NamedChain::AbstractTestnet, "abstract_testnet"),
1119    (NamedChain::ImmutableTestnet, "immutable_testnet"),
1120    (NamedChain::GravityAlphaTestnetSepolia, "gravity_alpha_testnet_sepolia"),
1121    (NamedChain::SignetPecorino, "signet_pecorino"),
1122    (NamedChain::SonicTestnet, "sonic_testnet"),
1123    (NamedChain::FluentDevnet, "fluent_devnet"),
1124    (NamedChain::FluentTestnet, "fluent_testnet"),
1125    (NamedChain::TempoDevnet, "tempo_devnet"),
1126    (NamedChain::AnvilHardhat, "anvil_hardhat"),
1127    (NamedChain::ApeChain, "ape_chain"),
1128    (NamedChain::LensTestnet, "lens_testnet"),
1129    (NamedChain::Arbitrum, "arbitrum_one"),
1130    (NamedChain::Arbitrum, "arbitrum-one"),
1131    (NamedChain::ArbitrumNova, "arbitrum_nova"),
1132    (NamedChain::EmeraldTestnet, "emerald_testnet"),
1133    (NamedChain::TempoTestnet, "tempo_testnet"),
1134    (NamedChain::TempoModerato, "tempo_moderato"),
1135    (NamedChain::AvalancheFuji, "avalanche_fuji"),
1136    (NamedChain::Formicarium, "formicairum"),
1137    (NamedChain::RobinhoodTestnet, "robinhood_testnet"),
1138    (NamedChain::PgnSepolia, "pgn_sepolia"),
1139    (NamedChain::LineaGoerli, "linea_goerli"),
1140    (NamedChain::LineaSepolia, "linea_sepolia"),
1141    (NamedChain::RadiusTestnet, "radius_testnet"),
1142    (NamedChain::PolygonAmoy, "polygon_amoy"),
1143    (NamedChain::BerachainBepolia, "berachain_bepolia"),
1144    (NamedChain::BaseGoerli, "base_goerli"),
1145    (NamedChain::BaseSepolia, "base_sepolia"),
1146    (NamedChain::PlumeTestnet, "plume_testnet"),
1147    (NamedChain::SuperpositionTestnet, "superposition_testnet"),
1148    (NamedChain::Gravity, "gravity"),
1149    (NamedChain::EtherlinkShadownet, "etherlink_shadownet"),
1150    (NamedChain::TaikoHekla, "taiko_hekla"),
1151    (NamedChain::RoninTestnet, "ronin_testnet"),
1152    (NamedChain::FilecoinCalibrationTestnet, "filecoin_calibration_testnet"),
1153    (NamedChain::ArbitrumTestnet, "arbitrum_testnet"),
1154    (NamedChain::ArbitrumGoerli, "arbitrum_goerli"),
1155    (NamedChain::ArbitrumSepolia, "arbitrum_sepolia"),
1156    (NamedChain::SyndrSepolia, "syndr_sepolia"),
1157    (NamedChain::AutonomysNovaTestnet, "autonomys_nova_testnet"),
1158    (NamedChain::ScrollSepolia, "scroll_sepolia"),
1159    (NamedChain::ScrollSepolia, "scroll_sepolia_testnet"),
1160    (NamedChain::PharosTestnet, "pharos_testnet"),
1161    (NamedChain::InkSepolia, "ink_sepolia"),
1162    (NamedChain::InkSepolia, "ink_sepolia_testnet"),
1163    (NamedChain::BobSepolia, "bob_sepolia"),
1164    (NamedChain::TreasureTopaz, "treasure_topaz"),
1165    (NamedChain::ArcTestnet, "arc_testnet"),
1166    (NamedChain::CeloSepolia, "celo_sepolia"),
1167    (NamedChain::OptimismSepolia, "optimism_sepolia"),
1168    (NamedChain::CornTestnet, "corn_testnet"),
1169    (NamedChain::BlastSepolia, "blast_sepolia"),
1170    (NamedChain::SkaleBaseSepoliaTestnet, "skale_base_sepolia_testnet"),
1171    (NamedChain::PolkadotTestnet, "polkadot_testnet"),
1172    (NamedChain::SophonTestnet, "sophon_testnet"),
1173    (NamedChain::ZoraSepolia, "zora_sepolia"),
1174    (NamedChain::SkaleBase, "skale_base"),
1175    (NamedChain::AuroraTestnet, "aurora_testnet"),
1176    (NamedChain::XaiSepolia, "xai_sepolia"),
1177];
1178
1179static CHAIN_NAMES: [&str; 201] = [
1180    "mainnet",
1181    "morden",
1182    "ropsten",
1183    "rinkeby",
1184    "goerli",
1185    "optimism",
1186    "flare",
1187    "elastos",
1188    "cronos",
1189    "rsk",
1190    "rsk-testnet",
1191    "telos",
1192    "telos-testnet",
1193    "kovan",
1194    "crab",
1195    "darwinia",
1196    "xdc-mainnet",
1197    "xdc-testnet",
1198    "bsc",
1199    "optimism-kovan",
1200    "cfx-testnet",
1201    "sokol",
1202    "viction",
1203    "bsc-testnet",
1204    "poa",
1205    "xdai",
1206    "flare-coston2",
1207    "fuse",
1208    "unichain",
1209    "polygon",
1210    "monad",
1211    "sonic",
1212    "shimmer",
1213    "redbelly",
1214    "redbelly-testnet",
1215    "opbnb-mainnet",
1216    "happychain-testnet",
1217    "lens",
1218    "fantom",
1219    "fraxtal",
1220    "boba",
1221    "zksync-testnet",
1222    "filecoin-mainnet",
1223    "zksync",
1224    "cronos-testnet",
1225    "pulsechain",
1226    "syndr",
1227    "optimism-goerli",
1228    "pgn",
1229    "world",
1230    "acala-mandala-testnet",
1231    "karura-testnet",
1232    "acala-testnet",
1233    "battlechain",
1234    "battlechain-testnet",
1235    "karura",
1236    "koi",
1237    "canto-testnet",
1238    "acala",
1239    "mode-sepolia",
1240    "pulsechain-testnet",
1241    "stable-mainnet",
1242    "hyperliquid",
1243    "cfx",
1244    "metis",
1245    "core",
1246    "lisk",
1247    "moonbeam-dev",
1248    "moonbeam",
1249    "moonriver",
1250    "moonbase",
1251    "unichain-sepolia",
1252    "sei-testnet",
1253    "sei",
1254    "dev",
1255    "injective-testnet",
1256    "vana",
1257    "story",
1258    "gravity-alpha-mainnet",
1259    "pharos",
1260    "injective",
1261    "soneium",
1262    "soneium-minato-testnet",
1263    "ronin",
1264    "stable-testnet",
1265    "fraxtal-testnet",
1266    "abstract",
1267    "fantom-testnet",
1268    "merlin",
1269    "tempo",
1270    "megaeth",
1271    "memecore",
1272    "robinhood",
1273    "iotex",
1274    "world-sepolia",
1275    "mantle",
1276    "mantle-sepolia",
1277    "opbnb-testnet",
1278    "megaeth-testnet",
1279    "zeta",
1280    "canto",
1281    "kaia",
1282    "base",
1283    "evmos-testnet",
1284    "evmos",
1285    "plasma",
1286    "plasma-testnet",
1287    "monad-testnet",
1288    "chiado",
1289    "abstract-testnet",
1290    "cannon",
1291    "immutable",
1292    "immutable-testnet",
1293    "gravity-alpha-testnet-sepolia",
1294    "signet-pecorino",
1295    "sonic-testnet",
1296    "holesky",
1297    "fluent-devnet",
1298    "fluent-testnet",
1299    "fluent",
1300    "oasis",
1301    "tempo-devnet",
1302    "anvil-hardhat",
1303    "curtis",
1304    "apechain",
1305    "mode",
1306    "lens-testnet",
1307    "arbitrum",
1308    "arbitrum-nova",
1309    "celo",
1310    "emerald-testnet",
1311    "emerald",
1312    "tempo-testnet",
1313    "tempo-moderato",
1314    "etherlink",
1315    "fuji",
1316    "avalanche",
1317    "formicarium",
1318    "insectarium",
1319    "robinhood-testnet",
1320    "sophon",
1321    "superposition",
1322    "ink",
1323    "pgn-sepolia",
1324    "linea-goerli",
1325    "linea-sepolia",
1326    "linea",
1327    "bob",
1328    "treasure",
1329    "radius-testnet",
1330    "amoy",
1331    "berachain-bepolia",
1332    "berachain",
1333    "blast",
1334    "base-goerli",
1335    "base-sepolia",
1336    "plume",
1337    "plume-testnet",
1338    "superposition-testnet",
1339    "grav",
1340    "etherlink-shadownet",
1341    "taiko",
1342    "taiko-hekla",
1343    "bitlayer",
1344    "ronin-testnet",
1345    "filecoin-calibration-testnet",
1346    "arbitrum-testnet",
1347    "arbitrum-goerli",
1348    "arbitrum-sepolia",
1349    "syndr-sepolia",
1350    "autonomys-nova-testnet",
1351    "scroll-sepolia",
1352    "scroll",
1353    "hoodi",
1354    "xai",
1355    "pharos-testnet",
1356    "radius",
1357    "katana",
1358    "ink-sepolia",
1359    "bob-sepolia",
1360    "odyssey",
1361    "treasure-topaz",
1362    "arc-testnet",
1363    "zora",
1364    "celo-sepolia",
1365    "sepolia",
1366    "optimism-sepolia",
1367    "corn",
1368    "corn-testnet",
1369    "blast-sepolia",
1370    "skale-base-sepolia-testnet",
1371    "polkadot-testnet",
1372    "kusama",
1373    "polkadot",
1374    "sophon-testnet",
1375    "degen",
1376    "zora-sepolia",
1377    "skale-base",
1378    "aurora",
1379    "aurora-testnet",
1380    "xai-sepolia",
1381];
1382
1383static NATIVE_CURRENCY_SYMBOLS: [&str; 64] = [
1384    "ETH", "FLR", "RBTC", "tRBTC", "TLOS", "CRAB", "RING", "XDC", "TXDC", "BNB", "CFX", "C2FLR",
1385    "POL", "MON", "S", "SMR", "RBNT", "HAPPY", "GHO", "PLS", "WRLD", "KRING", "USDT0", "HYPE",
1386    "CORE", "DEV", "GLMR", "MOVR", "SEI", "INJ", "VANA", "IP", "G", "PROS", "RON", "BTC", "USD",
1387    "M", "IOTX", "MNT", "ZETA", "KAIA", "XPL", "IMX", "tIMX", "USDS", "APE", "GRASS", "CELO",
1388    "XTZ", "tM", "SOPH", "MAGIC", "RUSD", "BERA", "PLUME", "XAI", "PHRS", "USDC", "BTCN", "PAS",
1389    "KSM", "DOT", "DEGEN",
1390];
1391
1392static ETHERSCAN_API_URLS: [&str; 161] = [
1393    "https://api.etherscan.io/v2/api?chainid=1",
1394    "https://api.etherscan.io/v2/api?chainid=10",
1395    "https://flare-explorer.flare.network/api",
1396    "https://esc.elastos.io/api",
1397    "https://api.etherscan.io/v2/api?chainid=25",
1398    "https://blockscout.com/rsk/mainnet/api",
1399    "https://rootstock-testnet.blockscout.com/api",
1400    "https://api.teloscan.io/api",
1401    "https://api.testnet.teloscan.io/api",
1402    "https://crab-scan.darwinia.network/api",
1403    "https://explorer.darwinia.network/api",
1404    "https://api.etherscan.io/v2/api?chainid=50",
1405    "https://api.etherscan.io/v2/api?chainid=51",
1406    "https://api.etherscan.io/v2/api?chainid=56",
1407    "https://evmapi-testnet.confluxscan.org/api",
1408    "https://www.vicscan.xyz/api",
1409    "https://api.etherscan.io/v2/api?chainid=97",
1410    "https://api.etherscan.io/v2/api?chainid=100",
1411    "https://coston2-explorer.flare.network/api",
1412    "https://explorer.fuse.io/api",
1413    "https://api.etherscan.io/v2/api?chainid=130",
1414    "https://api.etherscan.io/v2/api?chainid=137",
1415    "https://api.etherscan.io/v2/api?chainid=143",
1416    "https://api.etherscan.io/v2/api?chainid=146",
1417    "https://explorer.evm.shimmer.network/api",
1418    "https://api.routescan.io/v2/network/mainnet/evm/151/etherscan",
1419    "https://api.routescan.io/v2/network/testnet/evm/153/etherscan",
1420    "https://api.etherscan.io/v2/api?chainid=204",
1421    "https://explorer.testnet.happy.tech/api",
1422    "https://explorer-api.lens.xyz",
1423    "https://api.etherscan.io/v2/api?chainid=252",
1424    "https://api.bobascan.com/api",
1425    "https://block-explorer-api.sepolia.zksync.dev/api",
1426    "https://block-explorer-api.mainnet.zksync.io/api",
1427    "https://api.scan.pulsechain.com",
1428    "https://explorer.syndr.com/api",
1429    "https://api.etherscan.io/v2/api?chainid=480",
1430    "https://blockscout.mandala.aca-staging.network/api",
1431    "https://block-explorer-api.battlechain.com/api",
1432    "https://block-explorer-api.testnet.battlechain.com/api",
1433    "https://blockscout.karura.network/api",
1434    "https://blockscout.acala.network/api",
1435    "https://sepolia.explorer.mode.network/api",
1436    "https://api.scan.v4.testnet.pulsechain.com",
1437    "https://api.etherscan.io/v2/api?chainid=988",
1438    "https://api.etherscan.io/v2/api?chainid=999",
1439    "https://evmapi.confluxscan.org/api",
1440    "https://api.routescan.io/v2/network/mainnet/evm/1088/etherscan",
1441    "https://openapi.coredao.org/api",
1442    "https://blockscout.lisk.com/api",
1443    "https://api.etherscan.io/v2/api?chainid=1284",
1444    "https://api.etherscan.io/v2/api?chainid=1285",
1445    "https://api.etherscan.io/v2/api?chainid=1287",
1446    "https://api.etherscan.io/v2/api?chainid=1301",
1447    "https://api.etherscan.io/v2/api?chainid=1328",
1448    "https://api.etherscan.io/v2/api?chainid=1329",
1449    "https://testnet.blockscout-api.injective.network/api",
1450    "https://api.vanascan.io/api",
1451    "https://www.storyscan.xyz/api",
1452    "https://explorer.gravity.xyz/api",
1453    "https://blockscout-api.injective.network/api",
1454    "https://soneium.blockscout.com/api",
1455    "https://soneium-minato.blockscout.com/api",
1456    "https://skynet-api.roninchain.com/ronin",
1457    "https://api.etherscan.io/v2/api?chainid=2201",
1458    "https://api.etherscan.io/v2/api?chainid=2522",
1459    "https://api.etherscan.io/v2/api?chainid=2741",
1460    "https://scan.merlinchain.io/api",
1461    "https://contracts.tempo.xyz",
1462    "https://api.etherscan.io/v2/api?chainid=4326",
1463    "https://api.etherscan.io/v2/api?chainid=4352",
1464    "https://robinhoodchain.blockscout.com/api",
1465    "https://api.etherscan.io/v2/api?chainid=4801",
1466    "https://api.etherscan.io/v2/api?chainid=5000",
1467    "https://api.etherscan.io/v2/api?chainid=5003",
1468    "https://api.etherscan.io/v2/api?chainid=5611",
1469    "https://api.etherscan.io/v2/api?chainid=6343",
1470    "https://zetachain.blockscout.com/api",
1471    "https://mainnet-oapi.kaiascan.io/api",
1472    "https://api.etherscan.io/v2/api?chainid=8453",
1473    "https://api.etherscan.io/v2/api?chainid=9745",
1474    "https://api.etherscan.io/v2/api?chainid=9746",
1475    "https://api.etherscan.io/v2/api?chainid=10143",
1476    "https://gnosis-chiado.blockscout.com/api",
1477    "https://api.etherscan.io/v2/api?chainid=11124",
1478    "https://explorer.immutable.com/api",
1479    "https://explorer.testnet.immutable.com/api",
1480    "https://explorer-sepolia.gravity.xyz/api",
1481    "https://explorer.pecorino.signet.sh/api",
1482    "https://api.etherscan.io/v2/api?chainid=14601",
1483    "https://api.etherscan.io/v2/api?chainid=17000",
1484    "https://api-devnet.fluentscan.xyz/api",
1485    "https://api-testnet.fluentscan.xyz/api",
1486    "https://api.fluentscan.xyz/api",
1487    "https://api.etherscan.io/v2/api?chainid=33111",
1488    "https://api.etherscan.io/v2/api?chainid=33139",
1489    "https://explorer.mode.network/api",
1490    "https://block-explorer-api.staging.lens.zksync.dev",
1491    "https://api.etherscan.io/v2/api?chainid=42161",
1492    "https://api.etherscan.io/v2/api?chainid=42170",
1493    "https://api.etherscan.io/v2/api?chainid=42220",
1494    "https://testnet.explorer.emerald.oasis.dev/api",
1495    "https://explorer.emerald.oasis.dev/api",
1496    "https://explorer.etherlink.com/api",
1497    "https://api.etherscan.io/v2/api?chainid=43113",
1498    "https://api.etherscan.io/v2/api?chainid=43114",
1499    "https://api.etherscan.io/v2/api?chainid=43521",
1500    "https://insectarium.blockscout.memecore.com/api",
1501    "https://explorer.testnet.chain.robinhood.com/api",
1502    "https://api.etherscan.io/v2/api?chainid=50104",
1503    "https://explorer.superposition.so/api",
1504    "https://explorer.inkonchain.com/api/v2",
1505    "https://api.etherscan.io/v2/api?chainid=59141",
1506    "https://api.etherscan.io/v2/api?chainid=59144",
1507    "https://explorer.gobob.xyz/api",
1508    "https://testnet.radiustech.xyz/api",
1509    "https://api.etherscan.io/v2/api?chainid=80002",
1510    "https://api.etherscan.io/v2/api?chainid=80069",
1511    "https://api.etherscan.io/v2/api?chainid=80094",
1512    "https://api.etherscan.io/v2/api?chainid=81457",
1513    "https://api.etherscan.io/v2/api?chainid=84532",
1514    "https://explorer.plume.org/api",
1515    "https://testnet-explorer.plume.org/api",
1516    "https://testnet-explorer.superposition.so/api",
1517    "https://mainnet-explorer.gravity.xyz/api",
1518    "https://shadownet.explorer.etherlink.com/api",
1519    "https://api.etherscan.io/v2/api?chainid=167000",
1520    "https://api.etherscan.io/v2/api?chainid=167009",
1521    "https://api.btrscan.com/scan/api",
1522    "https://api-gateway.skymavis.com/rpc/testnet",
1523    "https://api.calibration.node.glif.io/rpc/v1",
1524    "https://api.etherscan.io/v2/api?chainid=421614",
1525    "https://sepolia-explorer.syndr.com/api",
1526    "https://api.etherscan.io/v2/api?chainid=534351",
1527    "https://api.etherscan.io/v2/api?chainid=534352",
1528    "https://api.etherscan.io/v2/api?chainid=560048",
1529    "https://api.etherscan.io/v2/api?chainid=660279",
1530    "https://network.radiustech.xyz/api",
1531    "https://api.etherscan.io/v2/api?chainid=747474",
1532    "https://explorer-sepolia.inkonchain.com/api/v2",
1533    "https://bob-sepolia.explorer.gobob.xyz/api",
1534    "https://odyssey-explorer.ithaca.xyz/api",
1535    "https://testnet.arcscan.app/api",
1536    "https://explorer.zora.energy/api",
1537    "https://api.etherscan.io/v2/api?chainid=11142220",
1538    "https://api.etherscan.io/v2/api?chainid=11155111",
1539    "https://api.etherscan.io/v2/api?chainid=11155420",
1540    "https://api.routescan.io/v2/network/mainnet/evm/21000000/etherscan/api",
1541    "https://api.routescan.io/v2/network/testnet/evm/21000001/etherscan/api",
1542    "https://api.etherscan.io/v2/api?chainid=168587773",
1543    "https://base-sepolia-testnet-explorer.skalenodes.com/api",
1544    "https://blockscout-testnet.polkadot.io/api",
1545    "https://blockscout-kusama.polkadot.io/api",
1546    "https://blockscout.polkadot.io/api",
1547    "https://api.etherscan.io/v2/api?chainid=531050104",
1548    "https://explorer.degen.tips/api",
1549    "https://sepolia.explorer.zora.energy/api",
1550    "https://skale-base-explorer.skalenodes.com/api",
1551    "https://api.aurorascan.dev/api",
1552    "https://testnet.aurorascan.dev/api",
1553    "https://api.etherscan.io/v2/api?chainid=37714555429",
1554];
1555
1556static ETHERSCAN_BASE_URLS: [&str; 163] = [
1557    "https://etherscan.io",
1558    "https://optimistic.etherscan.io",
1559    "https://flare-explorer.flare.network",
1560    "https://esc.elastos.io",
1561    "https://cronoscan.com",
1562    "https://blockscout.com/rsk/mainnet",
1563    "https://rootstock-testnet.blockscout.com",
1564    "https://teloscan.io",
1565    "https://testnet.teloscan.io",
1566    "https://crab-scan.darwinia.network",
1567    "https://explorer.darwinia.network",
1568    "https://xdcscan.com",
1569    "https://testnet.xdcscan.com",
1570    "https://bscscan.com",
1571    "https://evmtestnet.confluxscan.org",
1572    "https://www.vicscan.xyz",
1573    "https://testnet.bscscan.com",
1574    "https://gnosisscan.io",
1575    "https://coston2-explorer.flare.network",
1576    "https://explorer.fuse.io",
1577    "https://uniscan.xyz",
1578    "https://polygonscan.com",
1579    "https://monadscan.com",
1580    "https://sonicscan.org",
1581    "https://explorer.evm.shimmer.network",
1582    "https://redbelly.routescan.io",
1583    "https://redbelly.testnet.routescan.io",
1584    "https://opbnb.bscscan.com",
1585    "https://explorer.testnet.happy.tech",
1586    "https://explorer.lens.xyz",
1587    "https://fraxscan.com",
1588    "https://bobascan.com",
1589    "https://sepolia.explorer.zksync.io",
1590    "https://explorer.zksync.io",
1591    "https://scan.pulsechain.com",
1592    "https://explorer.syndr.com",
1593    "https://worldscan.org",
1594    "https://blockscout.mandala.aca-staging.network",
1595    "https://explorer.battlechain.com",
1596    "https://explorer.testnet.battlechain.com",
1597    "https://blockscout.karura.network",
1598    "https://blockscout.acala.network",
1599    "https://sepolia.explorer.mode.network",
1600    "https://scan.v4.testnet.pulsechain.com",
1601    "https://stablescan.xyz",
1602    "https://hyperevmscan.io",
1603    "https://evm.confluxscan.org",
1604    "https://explorer.metis.io",
1605    "https://scan.coredao.org",
1606    "https://blockscout.lisk.com",
1607    "https://moonbeam.moonscan.io",
1608    "https://moonriver.moonscan.io",
1609    "https://moonbase.moonscan.io",
1610    "https://sepolia.uniscan.xyz",
1611    "https://testnet.seiscan.io",
1612    "https://seiscan.io",
1613    "https://testnet.blockscout.injective.network",
1614    "https://vanascan.io",
1615    "https://www.storyscan.xyz",
1616    "https://explorer.gravity.xyz",
1617    "https://blockscout.injective.network",
1618    "https://soneium.blockscout.com",
1619    "https://soneium-minato.blockscout.com",
1620    "https://app.roninchain.com",
1621    "https://testnet.stablescan.xyz",
1622    "https://holesky.fraxscan.com",
1623    "https://abscan.org",
1624    "https://scan.merlinchain.io",
1625    "https://explore.tempo.xyz",
1626    "https://mega.etherscan.io",
1627    "https://memecorescan.io",
1628    "https://robinhoodchain.blockscout.com",
1629    "https://sepolia.worldscan.org",
1630    "https://mantlescan.xyz",
1631    "https://sepolia.mantlescan.xyz",
1632    "https://opbnb-testnet.bscscan.com",
1633    "https://megaeth-testnet-v2.blockscout.com",
1634    "https://zetachain.blockscout.com",
1635    "https://kaiascan.io",
1636    "https://basescan.org",
1637    "https://plasmascan.to",
1638    "https://testnet.plasmascan.to",
1639    "https://testnet.monadscan.com",
1640    "https://gnosis-chiado.blockscout.com",
1641    "https://sepolia.abscan.org",
1642    "https://explorer.immutable.com",
1643    "https://explorer.testnet.immutable.com",
1644    "https://explorer-sepolia.gravity.xyz",
1645    "https://explorer.pecorino.signet.sh",
1646    "https://testnet.sonicscan.org",
1647    "https://holesky.etherscan.io",
1648    "https://devnet.fluentscan.xyz",
1649    "https://testnet.fluentscan.xyz",
1650    "https://fluentscan.xyz",
1651    "https://curtis.apescan.io",
1652    "https://apescan.io",
1653    "https://explorer.mode.network",
1654    "https://explorer.testnet.lens.xyz",
1655    "https://arbiscan.io",
1656    "https://nova.arbiscan.io",
1657    "https://celoscan.io",
1658    "https://testnet.explorer.emerald.oasis.dev",
1659    "https://explorer.emerald.oasis.dev",
1660    "https://explore.andantino.tempo.xyz",
1661    "https://explore.moderato.tempo.xyz",
1662    "https://explorer.etherlink.com",
1663    "https://testnet.snowscan.xyz",
1664    "https://snowscan.xyz",
1665    "https://formicarium.memecorescan.io",
1666    "https://insectarium.blockscout.memecore.com",
1667    "https://explorer.testnet.chain.robinhood.com",
1668    "https://sophscan.xyz",
1669    "https://explorer.superposition.so",
1670    "https://explorer.inkonchain.com",
1671    "https://sepolia.lineascan.build",
1672    "https://lineascan.build",
1673    "https://explorer.gobob.xyz",
1674    "https://testnet.radiustech.xyz",
1675    "https://amoy.polygonscan.com",
1676    "https://testnet.berascan.com",
1677    "https://berascan.com",
1678    "https://blastscan.io",
1679    "https://sepolia.basescan.org",
1680    "https://explorer.plume.org",
1681    "https://testnet-explorer.plume.org",
1682    "https://testnet-explorer.superposition.so",
1683    "https://mainnet-explorer.gravity.xyz",
1684    "https://shadownet.explorer.etherlink.com",
1685    "https://taikoscan.io",
1686    "https://hekla.taikoscan.io",
1687    "https://www.btrscan.com",
1688    "https://saigon-explorer.roninchain.com",
1689    "https://calibration.filfox.info/en",
1690    "https://sepolia.arbiscan.io",
1691    "https://sepolia-explorer.syndr.com",
1692    "https://sepolia.scrollscan.com",
1693    "https://scrollscan.com",
1694    "https://hoodi.etherscan.io",
1695    "https://xaiscan.io",
1696    "https://network.radiustech.xyz",
1697    "https://katanascan.com",
1698    "https://explorer-sepolia.inkonchain.com",
1699    "https://bob-sepolia.explorer.gobob.xyz",
1700    "https://odyssey-explorer.ithaca.xyz",
1701    "https://testnet.arcscan.app",
1702    "https://explorer.zora.energy",
1703    "https://sepolia.celoscan.io",
1704    "https://sepolia.etherscan.io",
1705    "https://sepolia-optimism.etherscan.io",
1706    "https://cornscan.io",
1707    "https://testnet.cornscan.io",
1708    "https://sepolia.blastscan.io",
1709    "https://base-sepolia-testnet-explorer.skalenodes.com",
1710    "https://blockscout-testnet.polkadot.io",
1711    "https://blockscout-kusama.polkadot.io",
1712    "https://blockscout.polkadot.io",
1713    "https://testnet.sophscan.xyz",
1714    "https://explorer.degen.tips",
1715    "https://sepolia.explorer.zora.energy",
1716    "https://skale-base-explorer.skalenodes.com",
1717    "https://aurorascan.dev",
1718    "https://testnet.aurorascan.dev",
1719    "https://sepolia.xaiscan.io",
1720];
1721
1722static ETHERSCAN_API_KEY_NAMES: [&str; 12] = [
1723    "ETHERSCAN_API_KEY",
1724    "BLOCKSCOUT_API_KEY",
1725    "ROUTESCAN_API_KEY",
1726    "FTMSCAN_API_KEY",
1727    "BOBASCAN_API_KEY",
1728    "CORESCAN_API_KEY",
1729    "MOONSCAN_API_KEY",
1730    "MERLINSCAN_API_KEY",
1731    "ZETASCAN_API_KEY",
1732    "KAIASCAN_API_KEY",
1733    "BERASCAN_API_KEY",
1734    "BITLAYERSCAN_API_KEY",
1735];
1736
1737static WRAPPED_NATIVE_TOKENS: [Address; 34] = [
1738    address!("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"),
1739    address!("0x4200000000000000000000000000000000000006"),
1740    address!("0x967F8799aF07dF1534d48A95a5C9FEBE92c53AE0"),
1741    address!("0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"),
1742    address!("0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d"),
1743    address!("0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270"),
1744    address!("0x039e2fB66102314Ce7b64Ce5Ce3E5183bc94aD38"),
1745    address!("0x6ed1F491e2d31536D6561f6bdB2AdC8F092a6076"),
1746    address!("0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83"),
1747    address!("0x5AEa5775959fBC2557Cc8789bC1bf90A239D9a91"),
1748    address!("0x5555555555555555555555555555555555555555"),
1749    address!("0x40375C92d9FAf44d2f9db9Bd9ba41a3317a2404f"),
1750    address!("0xE30feDd158A2e3b13e9badaeABaFc5516e95e8C7"),
1751    address!("0x00EDdD9621Fb08436d0331c149D1690909a5906d"),
1752    address!("0x1514000000000000000000000000000000000000"),
1753    address!("0x3439153EB7AF838Ad19d56E1571FBD09333C2809"),
1754    address!("0xF6D226f9Dc15d9bB51182815b320D3fBE324e1bA"),
1755    address!("0x653e645e3d81a72e71328Bc01A04002945E3ef7A"),
1756    address!("0xA00744882684C3e4747faEFD68D283eA44099D03"),
1757    address!("0xdEAddEaDdeadDEadDEADDEAddEADDEAddead1111"),
1758    address!("0x5F0b1a82749cb4E2278EC87F8BF6B618dC71a8bf"),
1759    address!("0x19Aac5f612f524B754CA7e7c41cbFa2E981A4432"),
1760    address!("0x48b62137EdfA95a428D35C09E44256a739F6B557"),
1761    address!("0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"),
1762    address!("0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7"),
1763    address!("0xF1f9E08a0818594FDe4713AE0Db1E46672Ca960E"),
1764    address!("0x1fB719f10b56d7a85DCD32f27f897375fB21cfdd"),
1765    address!("0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f"),
1766    address!("0x263D8f36Bb8d0d9526255E205868C26690b04B88"),
1767    address!("0x6969696969696969696969696969696969696969"),
1768    address!("0x4300000000000000000000000000000000000004"),
1769    address!("0xA51894664A773981C6C112C43ce576f315d5b1B6"),
1770    address!("0xfF204e2681A6fA0e2C3FaDe68a1B28fb90E4Fc5F"),
1771    address!("0x5300000000000000000000000000000000000004"),
1772];
1773
1774static CHAIN_DATA: [ChainData; 201] = {
1775    use FLAG_ARBITRUM as A;
1776    use FLAG_ELASTIC as X;
1777    use FLAG_ETHEREUM as E;
1778    use FLAG_LEGACY as L;
1779    use FLAG_OPTIMISM as O;
1780    use FLAG_SUPPORTS_SHANGHAI as S;
1781    use FLAG_TEMPO as TP;
1782    use FLAG_TESTNET as T;
1783    use NO_INDEX as N;
1784    use NO_INDEX as W;
1785
1786    #[allow(clippy::too_many_arguments)]
1787    const fn d(
1788        name: u8,
1789        native_currency_symbol: u8,
1790        etherscan_api_url: u8,
1791        etherscan_base_url: u8,
1792        etherscan_api_key_name: u8,
1793        average_blocktime_millis: u16,
1794        flags: ChainFlags,
1795        wrapped_native_token: u8,
1796    ) -> ChainData {
1797        ChainData {
1798            name,
1799            native_currency_symbol,
1800            etherscan_api_url,
1801            etherscan_base_url,
1802            etherscan_api_key_name,
1803            average_blocktime_millis,
1804            flags,
1805            wrapped_native_token,
1806        }
1807    }
1808
1809    [
1810        d(0, 0, 0, 0, 0, 12000, S | E, 0),
1811        d(1, 0, N, N, 0, 0, T | E, W),
1812        d(2, 0, N, N, 0, 0, T | E, W),
1813        d(3, 0, N, N, 0, 0, T | E, W),
1814        d(4, 0, N, N, 0, 0, S | T | E, W),
1815        d(5, 0, 1, 1, 0, 2000, S | O, 1),
1816        d(6, 1, 2, 2, 1, 1800, 0, W),
1817        d(7, N, 3, 3, N, 5000, L, W),
1818        d(8, N, 4, 4, 0, 5700, 0, W),
1819        d(9, 2, 5, 5, N, 25000, L | S, 2),
1820        d(10, 3, 6, 6, N, 25000, L | S | T, W),
1821        d(11, 4, 7, 7, N, 500, 0, W),
1822        d(12, 4, 8, 8, N, 500, T, W),
1823        d(13, 0, N, N, 0, 0, T | E, W),
1824        d(14, 5, 9, 9, 1, 6000, S, W),
1825        d(15, 6, 10, 10, 1, 6000, S, W),
1826        d(16, 7, 11, 11, 0, 2400, 0, W),
1827        d(17, 8, 12, 12, 0, 2400, T, W),
1828        d(18, 9, 13, 13, 0, 450, S, 3),
1829        d(19, N, N, N, 0, 0, L | T | O, W),
1830        d(20, 10, 14, 14, N, 500, S | T, W),
1831        d(21, N, N, N, N, 0, 0, W),
1832        d(22, N, 15, 15, N, 2000, L, W),
1833        d(23, 9, 16, 16, 0, 450, S | T, W),
1834        d(24, N, N, N, N, 0, 0, W),
1835        d(25, N, 17, 17, 0, 5000, S, 4),
1836        d(26, 11, 18, 18, 1, 2500, T, W),
1837        d(27, N, 19, 19, 1, 5000, 0, W),
1838        d(28, 0, 20, 20, 0, 1000, S | O, W),
1839        d(29, 12, 21, 21, 0, 2100, S, 5),
1840        d(30, 13, 22, 22, 0, 400, S, W),
1841        d(31, 14, 23, 23, 0, 1000, S, 6),
1842        d(32, 15, 24, 24, 1, 5000, L | S | T, W),
1843        d(33, 16, 25, 25, 2, 60000, S, 7),
1844        d(34, 16, 26, 26, 2, 60000, S | T, W),
1845        d(35, 9, 27, 27, 0, 1000, S | O, 1),
1846        d(36, 17, 28, 28, N, 2000, S | T | O, W),
1847        d(37, 18, 29, 29, N, 1000, X, W),
1848        d(38, N, N, N, 3, 1200, L, 8),
1849        d(39, N, 30, 30, 0, 2000, S | O, W),
1850        d(40, N, 31, 31, 4, 0, 0, W),
1851        d(41, 0, 32, 32, 0, 1000, T | X, W),
1852        d(42, N, N, N, N, 30000, 0, W),
1853        d(43, 0, 33, 33, 0, 1000, X, 9),
1854        d(44, N, N, N, 0, 5700, T, W),
1855        d(45, 19, 34, 34, N, 10000, S, W),
1856        d(46, N, 35, 35, 0, 260, S, W),
1857        d(47, N, N, N, 0, 2000, S | T | O, W),
1858        d(48, N, N, N, 1, 2000, O, W),
1859        d(49, 20, 36, 36, 1, 2000, S | O, W),
1860        d(50, N, 37, 37, 1, 12500, S | T, W),
1861        d(51, N, N, N, 1, 12500, S | T, W),
1862        d(52, N, N, N, 1, 12500, S | T, W),
1863        d(53, 0, 38, 38, N, 250, S | X, W),
1864        d(54, 0, 39, 39, N, 250, S | T | X, W),
1865        d(55, N, 40, 40, 1, 12500, S, W),
1866        d(56, 21, N, N, 1, 6000, S | T, W),
1867        d(57, N, N, N, 1, 5700, T, W),
1868        d(58, N, 41, 41, 1, 12500, S, W),
1869        d(59, N, 42, 42, 1, 2000, S | T | O, W),
1870        d(60, 19, 43, 43, N, 10101, S | T, W),
1871        d(61, 22, 44, 44, 0, 700, S, W),
1872        d(62, 23, 45, 45, 0, 2000, 0, 10),
1873        d(63, 10, 46, 46, N, 500, S, W),
1874        d(64, N, 47, 47, N, 0, 0, W),
1875        d(65, 24, 48, 48, 5, 3000, 0, 11),
1876        d(66, 0, 49, 49, 1, 2000, O, W),
1877        d(67, 25, N, N, 6, 0, S | T, W),
1878        d(68, 26, 50, 50, 6, 6500, S, W),
1879        d(69, 27, 51, 51, 6, 6500, S, W),
1880        d(70, 25, 52, 52, 6, 6500, S | T, W),
1881        d(71, 0, 53, 53, 0, 1000, S | T | O, W),
1882        d(72, 28, 54, 54, 0, 500, T, W),
1883        d(73, 28, 55, 55, 0, 500, S, 12),
1884        d(74, N, N, N, N, 200, T, W),
1885        d(75, 29, 56, 56, 1, 700, S | T, W),
1886        d(76, 30, 57, 57, 1, 6000, 0, 13),
1887        d(77, 31, 58, 58, 1, 2500, 0, 14),
1888        d(78, 32, 59, 59, N, 260, S, W),
1889        d(79, 33, N, N, N, 1000, S, W),
1890        d(80, 29, 60, 60, 1, 700, S, W),
1891        d(81, N, 61, 61, 1, 2000, S | O, W),
1892        d(82, N, 62, 62, 1, 2000, S | T | O, W),
1893        d(83, 34, 63, 63, N, 3000, 0, W),
1894        d(84, 22, 64, 64, 0, 700, S | T, W),
1895        d(85, N, 65, 65, 0, 2000, S | T | O, W),
1896        d(86, 0, 66, 66, 0, 1000, X, 15),
1897        d(87, N, N, N, 3, 1200, L | T, W),
1898        d(88, 35, 67, 67, 7, 3000, 0, 16),
1899        d(89, 36, 68, 68, N, 500, S | TP, W),
1900        d(90, 0, 69, 69, 0, 1000, S, W),
1901        d(91, 37, 70, 70, 0, 7000, S, 17),
1902        d(92, 0, 71, 71, N, 400, S | A, W),
1903        d(93, 38, N, N, N, 5000, S, 18),
1904        d(94, 20, 72, 72, 1, 2000, S | T | O, W),
1905        d(95, 39, 73, 73, 0, 2000, S, 19),
1906        d(96, 39, 74, 74, 0, 2000, S | T, W),
1907        d(97, 9, 75, 75, 0, 1000, S | T | O, W),
1908        d(98, 0, 76, 76, 0, 1000, S | T, W),
1909        d(99, 40, 77, 77, 8, 6000, 0, 20),
1910        d(100, N, N, N, 1, 5700, 0, W),
1911        d(101, 41, 78, 78, 9, 1000, 0, 21),
1912        d(102, 0, 79, 79, 0, 2000, S | O, 1),
1913        d(103, N, N, N, N, 1900, T, W),
1914        d(104, N, N, N, N, 1900, 0, W),
1915        d(105, 42, 80, 80, 0, 1000, 0, W),
1916        d(106, 42, 81, 81, 0, 1000, T, W),
1917        d(107, 13, 82, 82, 0, 400, S | T, W),
1918        d(108, N, 83, 83, N, 5000, S, W),
1919        d(109, N, 84, 84, 0, 1000, T | X, W),
1920        d(110, N, N, N, N, 0, S | T, W),
1921        d(111, 43, 85, 85, 1, 2000, S, W),
1922        d(112, 44, 86, 86, 1, 2000, S | T, W),
1923        d(113, 32, 87, 87, N, 260, S | T, W),
1924        d(114, 45, 88, 88, 1, 12000, S | T, W),
1925        d(115, 14, 89, 89, 0, 1000, T, W),
1926        d(116, 0, 90, 90, 0, 0, S | T | E, W),
1927        d(117, N, 91, 91, N, 3000, S | T, W),
1928        d(118, N, 92, 92, N, 1000, S | T, W),
1929        d(119, N, 93, 93, N, 1000, 0, W),
1930        d(120, N, N, N, N, 5500, 0, W),
1931        d(121, 36, N, N, N, 500, S | T | TP, W),
1932        d(122, N, N, N, N, 200, S | T, W),
1933        d(123, 46, 94, 94, 1, 260, S | T, W),
1934        d(124, 46, 95, 95, 0, 260, S, 22),
1935        d(125, N, 96, 96, 1, 2000, S | O, W),
1936        d(126, 47, 97, 97, N, 1000, T | X, W),
1937        d(127, 0, 98, 98, 0, 260, S | A, 23),
1938        d(128, 0, 99, 99, 0, 260, S | A, W),
1939        d(129, 48, 100, 100, 0, 1000, S | O, W),
1940        d(130, N, 101, 101, N, 0, L | T, W),
1941        d(131, N, 102, 102, N, 6000, L, W),
1942        d(132, 36, 68, 103, N, 500, S | T | TP, W),
1943        d(133, 36, 68, 104, N, 500, S | T | TP, W),
1944        d(134, 49, 103, 105, 1, 5000, S, W),
1945        d(135, N, 104, 106, 0, 2000, S | T, W),
1946        d(136, N, 105, 107, 0, 2000, S, 24),
1947        d(137, 50, 106, 108, 0, 7000, S | T, 17),
1948        d(138, 50, 107, 109, N, 7000, S | T, 17),
1949        d(139, 0, 108, 110, N, 400, S | T | A, W),
1950        d(140, 51, 109, 111, 0, 1000, L | X, 25),
1951        d(141, 0, 110, 112, 1, 260, S, 26),
1952        d(142, 0, 111, 113, 1, 1000, S | O, W),
1953        d(143, N, N, N, 1, 2000, T | O, W),
1954        d(144, N, N, N, N, 2000, T, W),
1955        d(145, N, 112, 114, 0, 2000, T, W),
1956        d(146, 0, 113, 115, 0, 2000, S, 27),
1957        d(147, 0, 114, 116, N, 2000, S, W),
1958        d(148, 52, N, N, N, 0, L, 28),
1959        d(149, 53, 115, 117, N, 500, S | T, W),
1960        d(150, 12, 116, 118, 0, 2100, T, W),
1961        d(151, 54, 117, 119, 10, 2000, S | T, W),
1962        d(152, 54, 118, 120, 10, 2000, S, 29),
1963        d(153, N, 119, 121, 0, 2000, S, 30),
1964        d(154, 0, N, N, 0, 2000, S | T | O, W),
1965        d(155, 0, 120, 122, 0, 2000, S | T | O, W),
1966        d(156, 55, 121, 123, N, 260, S, W),
1967        d(157, 55, 122, 124, N, 260, S | T, W),
1968        d(158, 0, 123, 125, 1, 260, S | T, W),
1969        d(159, 32, 124, 126, N, 260, S, W),
1970        d(160, 49, 125, 127, 1, 5000, S | T, W),
1971        d(161, 0, 126, 128, 0, 12000, S, 31),
1972        d(162, 0, 127, 129, 0, 12000, S | T, W),
1973        d(163, 35, 128, 130, 11, 3000, 0, 32),
1974        d(164, 34, 129, 131, N, 3000, T, W),
1975        d(165, N, 130, 132, N, 30000, T, W),
1976        d(166, N, N, N, 0, 260, T | A, W),
1977        d(167, N, N, N, 0, 260, T | A, W),
1978        d(168, N, 131, 133, 0, 260, S | T | A, W),
1979        d(169, N, 132, 134, 0, 260, S | T, W),
1980        d(170, N, N, N, N, 1000, S | T, W),
1981        d(171, 0, 133, 135, 0, 3000, S | T, W),
1982        d(172, 0, 134, 136, 0, 3000, S, 33),
1983        d(173, N, 135, 137, 0, 0, S | T, W),
1984        d(174, 56, 136, 138, 0, 260, S, W),
1985        d(175, 57, N, N, N, 1000, S | T, W),
1986        d(176, 53, 137, 139, N, 500, S, W),
1987        d(177, 0, 138, 140, 0, 1000, S | O, W),
1988        d(178, N, 139, 141, 1, 1000, S | T | O, W),
1989        d(179, N, 140, 142, N, 2000, S | T, W),
1990        d(180, N, 141, 143, N, 1000, S | T | O, W),
1991        d(181, 52, N, N, N, 0, L | T, W),
1992        d(182, 58, 142, 144, 1, 500, S | T, W),
1993        d(183, N, 143, 145, 1, 2000, O, W),
1994        d(184, 48, 144, 146, 1, 1000, S | T, W),
1995        d(185, 0, 145, 147, 0, 0, S | T | E, W),
1996        d(186, 0, 146, 148, 0, 2000, S | T | O, W),
1997        d(187, 59, 147, 149, 2, 0, S, W),
1998        d(188, 59, 148, 150, 2, 0, S | T, W),
1999        d(189, N, 149, 151, 0, 2000, S | T | O, W),
2000        d(190, N, 150, 152, 1, 1000, T, W),
2001        d(191, 60, 151, 153, 1, 2000, S | T, W),
2002        d(192, 61, 152, 154, 1, 2000, S, W),
2003        d(193, 62, 153, 155, 1, 2000, S, W),
2004        d(194, 51, 154, 156, 0, 1000, L | T | X, W),
2005        d(195, 63, 155, 157, N, 600, 0, W),
2006        d(196, N, 156, 158, 1, 2000, S | T | O, W),
2007        d(197, N, 157, 159, 1, 1000, 0, W),
2008        d(198, N, 158, 160, 0, 1100, 0, W),
2009        d(199, N, 159, 161, 0, 1100, T, W),
2010        d(200, 56, 160, 162, 0, 260, S | T, W),
2011    ]
2012};
2013
2014static PARSE_NAMES: phf::Map<&'static str, ChainIndex> = ::phf::Map {
2015    key: 16287231350648472473,
2016    disps: &[
2017        (0, 3),
2018        (0, 0),
2019        (0, 0),
2020        (0, 11),
2021        (0, 6),
2022        (0, 54),
2023        (0, 3),
2024        (0, 3),
2025        (0, 42),
2026        (0, 23),
2027        (0, 0),
2028        (0, 3),
2029        (0, 3),
2030        (0, 40),
2031        (0, 0),
2032        (0, 42),
2033        (0, 0),
2034        (0, 4),
2035        (0, 13),
2036        (0, 65),
2037        (0, 6),
2038        (0, 2),
2039        (0, 113),
2040        (0, 123),
2041        (0, 14),
2042        (0, 10),
2043        (0, 5),
2044        (0, 13),
2045        (0, 7),
2046        (0, 0),
2047        (0, 2),
2048        (0, 66),
2049        (0, 0),
2050        (0, 49),
2051        (0, 7),
2052        (0, 0),
2053        (0, 74),
2054        (0, 1),
2055        (0, 39),
2056        (0, 27),
2057        (0, 102),
2058        (0, 29),
2059        (0, 38),
2060        (0, 101),
2061        (0, 97),
2062        (0, 9),
2063        (0, 24),
2064        (0, 164),
2065        (0, 9),
2066        (0, 2),
2067        (0, 20),
2068        (0, 18),
2069        (0, 0),
2070        (0, 0),
2071        (0, 26),
2072        (0, 27),
2073        (0, 0),
2074        (1, 87),
2075        (0, 8),
2076        (0, 50),
2077        (0, 41),
2078        (0, 5),
2079        (0, 23),
2080        (0, 0),
2081        (0, 203),
2082        (2, 216),
2083        (0, 191),
2084        (2, 117),
2085        (0, 0),
2086        (0, 1),
2087        (0, 28),
2088        (0, 11),
2089        (0, 0),
2090    ],
2091    entries: &[
2092        ("cronos-testnet", NamedChain::CronosTestnet.index()),
2093        ("degen", NamedChain::Degen.index()),
2094        ("telos", NamedChain::TelosEvm.index()),
2095        ("linea-sepolia", NamedChain::LineaSepolia.index()),
2096        ("unichain", NamedChain::Unichain.index()),
2097        ("battlechain", NamedChain::BattleChain.index()),
2098        ("monad", NamedChain::Monad.index()),
2099        ("karura", NamedChain::Karura.index()),
2100        ("megaeth", NamedChain::MegaEth.index()),
2101        ("filecoin-mainnet", NamedChain::FilecoinMainnet.index()),
2102        ("lens-testnet", NamedChain::LensTestnet.index()),
2103        ("opbnb-testnet", NamedChain::OpBNBTestnet.index()),
2104        ("gnosis-chain", NamedChain::Gnosis.index()),
2105        ("acala-mandala-testnet", NamedChain::AcalaMandalaTestnet.index()),
2106        ("emerald", NamedChain::Emerald.index()),
2107        ("opbnb-mainnet", NamedChain::OpBNBMainnet.index()),
2108        ("polygon-amoy", NamedChain::PolygonAmoy.index()),
2109        ("celo", NamedChain::Celo.index()),
2110        ("avalanche", NamedChain::Avalanche.index()),
2111        ("cannon", NamedChain::Cannon.index()),
2112        ("filecoin-calibration-testnet", NamedChain::FilecoinCalibrationTestnet.index()),
2113        ("skale-base", NamedChain::SkaleBase.index()),
2114        ("zora", NamedChain::Zora.index()),
2115        ("syndr", NamedChain::Syndr.index()),
2116        ("story", NamedChain::Story.index()),
2117        ("karura-testnet", NamedChain::KaruraTestnet.index()),
2118        ("celo-sepolia", NamedChain::CeloSepolia.index()),
2119        ("oasis", NamedChain::Oasis.index()),
2120        ("sepolia", NamedChain::Sepolia.index()),
2121        ("radius", NamedChain::Radius.index()),
2122        ("bsc-testnet", NamedChain::BinanceSmartChainTestnet.index()),
2123        ("pgn", NamedChain::Pgn.index()),
2124        ("stable-mainnet", NamedChain::StableMainnet.index()),
2125        ("katana", NamedChain::Katana.index()),
2126        ("ink-sepolia", NamedChain::InkSepolia.index()),
2127        ("arbitrum-goerli", NamedChain::ArbitrumGoerli.index()),
2128        ("happychain-testnet", NamedChain::HappychainTestnet.index()),
2129        ("plume-testnet", NamedChain::PlumeTestnet.index()),
2130        ("taiko", NamedChain::Taiko.index()),
2131        ("taiko-hekla", NamedChain::TaikoHekla.index()),
2132        ("robinhood-testnet", NamedChain::RobinhoodTestnet.index()),
2133        ("base-sepolia", NamedChain::BaseSepolia.index()),
2134        ("plasma-testnet", NamedChain::PlasmaTestnet.index()),
2135        ("stable-testnet", NamedChain::StableTestnet.index()),
2136        ("fantom-testnet", NamedChain::FantomTestnet.index()),
2137        ("boba", NamedChain::Boba.index()),
2138        ("bob", NamedChain::Bob.index()),
2139        ("corn", NamedChain::Corn.index()),
2140        ("tempo-mainnet", NamedChain::Tempo.index()),
2141        ("shimmer", NamedChain::Shimmer.index()),
2142        ("battlechain-testnet", NamedChain::BattleChainTestnet.index()),
2143        ("tempo", NamedChain::Tempo.index()),
2144        ("gnosis", NamedChain::Gnosis.index()),
2145        ("memecore", NamedChain::MemeCore.index()),
2146        ("injective-testnet", NamedChain::InjectiveTestnet.index()),
2147        ("telos-testnet", NamedChain::TelosEvmTestnet.index()),
2148        ("tempo-testnet", NamedChain::TempoTestnet.index()),
2149        ("autonomys-nova-testnet", NamedChain::AutonomysNovaTestnet.index()),
2150        ("flare-coston2", NamedChain::FlareCoston2.index()),
2151        ("hardhat", NamedChain::AnvilHardhat.index()),
2152        ("xai", NamedChain::Xai.index()),
2153        ("sonic", NamedChain::Sonic.index()),
2154        ("binance-smart-chain-testnet", NamedChain::BinanceSmartChainTestnet.index()),
2155        ("bnb-smart-chain-testnet", NamedChain::BinanceSmartChainTestnet.index()),
2156        ("emerald-testnet", NamedChain::EmeraldTestnet.index()),
2157        ("corn-testnet", NamedChain::CornTestnet.index()),
2158        ("abstract-testnet", NamedChain::AbstractTestnet.index()),
2159        ("sonic-testnet", NamedChain::SonicTestnet.index()),
2160        ("immutable", NamedChain::Immutable.index()),
2161        ("binance-smart-chain", NamedChain::BinanceSmartChain.index()),
2162        ("base", NamedChain::Base.index()),
2163        ("megaeth-testnet", NamedChain::MegaEthTestnet.index()),
2164        ("avalanche-fuji", NamedChain::AvalancheFuji.index()),
2165        ("rsk-testnet", NamedChain::RskTestnet.index()),
2166        ("fluent", NamedChain::Fluent.index()),
2167        ("sei-testnet", NamedChain::SeiTestnet.index()),
2168        ("rinkeby", NamedChain::Rinkeby.index()),
2169        ("linea-goerli", NamedChain::LineaGoerli.index()),
2170        ("berachain-bepolia-testnet", NamedChain::BerachainBepolia.index()),
2171        ("pulsechain", NamedChain::Pulsechain.index()),
2172        ("optimism", NamedChain::Optimism.index()),
2173        ("pharos-testnet", NamedChain::PharosTestnet.index()),
2174        ("mantle", NamedChain::Mantle.index()),
2175        ("mode-sepolia", NamedChain::ModeSepolia.index()),
2176        ("ronin", NamedChain::Ronin.index()),
2177        ("kovan", NamedChain::Kovan.index()),
2178        ("darwinia", NamedChain::Darwinia.index()),
2179        ("canto", NamedChain::Canto.index()),
2180        ("metis", NamedChain::Metis.index()),
2181        ("memecore-formicarium", NamedChain::Formicarium.index()),
2182        ("optimism-kovan", NamedChain::OptimismKovan.index()),
2183        ("anvil-hardhat", NamedChain::AnvilHardhat.index()),
2184        ("sei", NamedChain::Sei.index()),
2185        ("curtis", NamedChain::Curtis.index()),
2186        ("morden", NamedChain::Morden.index()),
2187        ("fuji", NamedChain::AvalancheFuji.index()),
2188        ("xai-sepolia", NamedChain::XaiSepolia.index()),
2189        ("arbitrum-nova", NamedChain::ArbitrumNova.index()),
2190        ("xdc-testnet", NamedChain::XdcTestnet.index()),
2191        ("optimism-goerli", NamedChain::OptimismGoerli.index()),
2192        ("polygon", NamedChain::Polygon.index()),
2193        ("amoy", NamedChain::PolygonAmoy.index()),
2194        ("tempo-moderato", NamedChain::TempoModerato.index()),
2195        ("hyperliquid", NamedChain::Hyperliquid.index()),
2196        ("polkadot", NamedChain::Polkadot.index()),
2197        ("superposition-testnet", NamedChain::SuperpositionTestnet.index()),
2198        ("pgn-sepolia", NamedChain::PgnSepolia.index()),
2199        ("holesky", NamedChain::Holesky.index()),
2200        ("redbelly", NamedChain::Redbelly.index()),
2201        ("ethlive", NamedChain::Mainnet.index()),
2202        ("core", NamedChain::Core.index()),
2203        ("superposition", NamedChain::Superposition.index()),
2204        ("aurora", NamedChain::Aurora.index()),
2205        ("xdai", NamedChain::Gnosis.index()),
2206        ("fluent-testnet", NamedChain::FluentTestnet.index()),
2207        ("world", NamedChain::World.index()),
2208        ("xdc-mainnet", NamedChain::XdcMainnet.index()),
2209        ("cfx-testnet", NamedChain::CfxTestnet.index()),
2210        ("tempo-devnet", NamedChain::TempoDevnet.index()),
2211        ("berachain-bepolia", NamedChain::BerachainBepolia.index()),
2212        ("scroll-sepolia", NamedChain::ScrollSepolia.index()),
2213        ("arbitrum-testnet", NamedChain::ArbitrumTestnet.index()),
2214        ("sophon", NamedChain::Sophon.index()),
2215        ("optimism-sepolia", NamedChain::OptimismSepolia.index()),
2216        ("gravity-alpha-mainnet", NamedChain::GravityAlphaMainnet.index()),
2217        ("poa", NamedChain::Poa.index()),
2218        ("crab", NamedChain::Crab.index()),
2219        ("rsk", NamedChain::Rsk.index()),
2220        ("arbitrum-sepolia", NamedChain::ArbitrumSepolia.index()),
2221        ("sokol", NamedChain::Sokol.index()),
2222        ("pharos", NamedChain::Pharos.index()),
2223        ("vana", NamedChain::Vana.index()),
2224        ("zksync", NamedChain::ZkSync.index()),
2225        ("lisk", NamedChain::Lisk.index()),
2226        ("aurora-testnet", NamedChain::AuroraTestnet.index()),
2227        ("bsc", NamedChain::BinanceSmartChain.index()),
2228        ("bob-sepolia", NamedChain::BobSepolia.index()),
2229        ("scroll", NamedChain::Scroll.index()),
2230        ("blast-sepolia", NamedChain::BlastSepolia.index()),
2231        ("viction", NamedChain::Viction.index()),
2232        ("robinhood", NamedChain::Robinhood.index()),
2233        ("plume", NamedChain::Plume.index()),
2234        ("skale-base-sepolia-testnet", NamedChain::SkaleBaseSepoliaTestnet.index()),
2235        ("cronos", NamedChain::Cronos.index()),
2236        ("arc-testnet", NamedChain::ArcTestnet.index()),
2237        ("acala", NamedChain::Acala.index()),
2238        ("abstract", NamedChain::Abstract.index()),
2239        ("kaia", NamedChain::Kaia.index()),
2240        ("syndr-sepolia", NamedChain::SyndrSepolia.index()),
2241        ("dev", NamedChain::Dev.index()),
2242        ("mantle-sepolia", NamedChain::MantleSepolia.index()),
2243        ("radius-testnet", NamedChain::RadiusTestnet.index()),
2244        ("injective", NamedChain::Injective.index()),
2245        ("mainnet", NamedChain::Mainnet.index()),
2246        ("treasure-topaz-testnet", NamedChain::TreasureTopaz.index()),
2247        ("merlin", NamedChain::Merlin.index()),
2248        ("evmos-testnet", NamedChain::EvmosTestnet.index()),
2249        ("pulsechain-testnet", NamedChain::PulsechainTestnet.index()),
2250        ("fraxtal", NamedChain::Fraxtal.index()),
2251        ("zeta", NamedChain::Zeta.index()),
2252        ("berachain", NamedChain::Berachain.index()),
2253        ("canto-testnet", NamedChain::CantoTestnet.index()),
2254        ("zora-sepolia", NamedChain::ZoraSepolia.index()),
2255        ("apechain-testnet", NamedChain::Curtis.index()),
2256        ("fluent-devnet", NamedChain::FluentDevnet.index()),
2257        ("blast", NamedChain::Blast.index()),
2258        ("base-goerli", NamedChain::BaseGoerli.index()),
2259        ("monad-testnet", NamedChain::MonadTestnet.index()),
2260        ("moonbeam-dev", NamedChain::MoonbeamDev.index()),
2261        ("ronin-testnet", NamedChain::RoninTestnet.index()),
2262        ("chiado", NamedChain::Chiado.index()),
2263        ("formicarium", NamedChain::Formicarium.index()),
2264        ("zksync-testnet", NamedChain::ZkSyncTestnet.index()),
2265        ("kusama", NamedChain::Kusama.index()),
2266        ("memecore-insectarium", NamedChain::Insectarium.index()),
2267        ("etherlink", NamedChain::Etherlink.index()),
2268        ("treasure-topaz", NamedChain::TreasureTopaz.index()),
2269        ("fuse", NamedChain::Fuse.index()),
2270        ("fraxtal-testnet", NamedChain::FraxtalTestnet.index()),
2271        ("unichain-sepolia", NamedChain::UnichainSepolia.index()),
2272        ("ink", NamedChain::Ink.index()),
2273        ("iotex", NamedChain::Iotex.index()),
2274        ("hoodi", NamedChain::Hoodi.index()),
2275        ("mode", NamedChain::Mode.index()),
2276        ("linea", NamedChain::Linea.index()),
2277        ("redbelly-testnet", NamedChain::RedbellyTestnet.index()),
2278        ("odyssey", NamedChain::Odyssey.index()),
2279        ("moonriver", NamedChain::Moonriver.index()),
2280        ("cfx", NamedChain::Cfx.index()),
2281        ("anvil", NamedChain::AnvilHardhat.index()),
2282        ("bnb-smart-chain", NamedChain::BinanceSmartChain.index()),
2283        ("koi", NamedChain::Koi.index()),
2284        ("immutable-testnet", NamedChain::ImmutableTestnet.index()),
2285        ("soneium-minato-testnet", NamedChain::SoneiumMinatoTestnet.index()),
2286        ("grav", NamedChain::Gravity.index()),
2287        ("fantom", NamedChain::Fantom.index()),
2288        ("world-sepolia", NamedChain::WorldSepolia.index()),
2289        ("moonbeam", NamedChain::Moonbeam.index()),
2290        ("evmos", NamedChain::Evmos.index()),
2291        ("goerli", NamedChain::Goerli.index()),
2292        ("treasure", NamedChain::Treasure.index()),
2293        ("polkadot-testnet", NamedChain::PolkadotTestnet.index()),
2294        ("acala-testnet", NamedChain::AcalaTestnet.index()),
2295        ("sophon-testnet", NamedChain::SophonTestnet.index()),
2296        ("bitlayer", NamedChain::Bitlayer.index()),
2297        ("ropsten", NamedChain::Ropsten.index()),
2298        ("apechain", NamedChain::ApeChain.index()),
2299        ("elastos", NamedChain::Elastos.index()),
2300        ("plasma", NamedChain::Plasma.index()),
2301        ("insectarium", NamedChain::Insectarium.index()),
2302        ("moonbase", NamedChain::Moonbase.index()),
2303        ("soneium", NamedChain::Soneium.index()),
2304        ("signet-pecorino", NamedChain::SignetPecorino.index()),
2305        ("gravity-alpha-testnet-sepolia", NamedChain::GravityAlphaTestnetSepolia.index()),
2306        ("flare", NamedChain::Flare.index()),
2307        ("lens", NamedChain::Lens.index()),
2308        ("etherlink-shadownet", NamedChain::EtherlinkShadownet.index()),
2309        ("arbitrum", NamedChain::Arbitrum.index()),
2310    ],
2311};
2312#[cfg(feature = "serde")]
2313static SERDE_NAMES: phf::Map<&'static str, ChainIndex> = ::phf::Map {
2314    key: 16287231350648472473,
2315    disps: &[
2316        (0, 2),
2317        (0, 0),
2318        (0, 22),
2319        (0, 5),
2320        (0, 37),
2321        (0, 77),
2322        (0, 1),
2323        (0, 0),
2324        (0, 11),
2325        (0, 3),
2326        (0, 55),
2327        (0, 0),
2328        (0, 7),
2329        (0, 1),
2330        (0, 0),
2331        (0, 2),
2332        (1, 55),
2333        (1, 0),
2334        (0, 42),
2335        (0, 1),
2336        (0, 1),
2337        (0, 11),
2338        (0, 1),
2339        (0, 1),
2340        (1, 95),
2341        (0, 9),
2342        (0, 89),
2343        (3, 73),
2344        (0, 17),
2345        (0, 23),
2346        (0, 5),
2347        (0, 14),
2348        (0, 34),
2349        (1, 6),
2350        (0, 92),
2351        (0, 61),
2352        (0, 18),
2353        (0, 14),
2354        (2, 56),
2355    ],
2356    entries: &[
2357        ("meme_core", NamedChain::MemeCore.index()),
2358        ("plume_testnet", NamedChain::PlumeTestnet.index()),
2359        ("happychain_testnet", NamedChain::HappychainTestnet.index()),
2360        ("celo_sepolia", NamedChain::CeloSepolia.index()),
2361        ("telos_testnet", NamedChain::TelosEvmTestnet.index()),
2362        ("taiko_hekla", NamedChain::TaikoHekla.index()),
2363        ("karura_testnet", NamedChain::KaruraTestnet.index()),
2364        ("zk_sync", NamedChain::ZkSync.index()),
2365        ("polygon_amoy", NamedChain::PolygonAmoy.index()),
2366        ("base_goerli", NamedChain::BaseGoerli.index()),
2367        ("pharos_testnet", NamedChain::PharosTestnet.index()),
2368        ("rsk_testnet", NamedChain::RskTestnet.index()),
2369        ("moonbeam_dev", NamedChain::MoonbeamDev.index()),
2370        ("sophon_testnet", NamedChain::SophonTestnet.index()),
2371        ("stable_mainnet", NamedChain::StableMainnet.index()),
2372        ("battle_chain", NamedChain::BattleChain.index()),
2373        ("superposition_testnet", NamedChain::SuperpositionTestnet.index()),
2374        ("sonic_testnet", NamedChain::SonicTestnet.index()),
2375        ("telos_evm", NamedChain::TelosEvm.index()),
2376        ("unichain_sepolia", NamedChain::UnichainSepolia.index()),
2377        ("mega_eth", NamedChain::MegaEth.index()),
2378        ("telos_evm_testnet", NamedChain::TelosEvmTestnet.index()),
2379        ("formicairum", NamedChain::Formicarium.index()),
2380        ("soneium_minato_testnet", NamedChain::SoneiumMinatoTestnet.index()),
2381        ("world_sepolia", NamedChain::WorldSepolia.index()),
2382        ("abstract_testnet", NamedChain::AbstractTestnet.index()),
2383        ("aurora_testnet", NamedChain::AuroraTestnet.index()),
2384        ("skale_base", NamedChain::SkaleBase.index()),
2385        ("linea_goerli", NamedChain::LineaGoerli.index()),
2386        ("ronin_testnet", NamedChain::RoninTestnet.index()),
2387        ("tempo_testnet", NamedChain::TempoTestnet.index()),
2388        ("ink_sepolia", NamedChain::InkSepolia.index()),
2389        ("stable_testnet", NamedChain::StableTestnet.index()),
2390        ("blast_sepolia", NamedChain::BlastSepolia.index()),
2391        ("conflux-espace", NamedChain::Cfx.index()),
2392        ("mantle_sepolia", NamedChain::MantleSepolia.index()),
2393        ("optimism_kovan", NamedChain::OptimismKovan.index()),
2394        ("radius_testnet", NamedChain::RadiusTestnet.index()),
2395        ("battlechain_testnet", NamedChain::BattleChainTestnet.index()),
2396        ("arbitrum_testnet", NamedChain::ArbitrumTestnet.index()),
2397        ("skale_base_sepolia_testnet", NamedChain::SkaleBaseSepoliaTestnet.index()),
2398        ("gravity", NamedChain::Gravity.index()),
2399        ("worldchain-sepolia", NamedChain::WorldSepolia.index()),
2400        ("optimism_goerli", NamedChain::OptimismGoerli.index()),
2401        ("mega_eth_testnet", NamedChain::MegaEthTestnet.index()),
2402        ("binance_smart_chain", NamedChain::BinanceSmartChain.index()),
2403        ("scroll_sepolia_testnet", NamedChain::ScrollSepolia.index()),
2404        ("xdc_mainnet", NamedChain::XdcMainnet.index()),
2405        ("pulsechain_testnet", NamedChain::PulsechainTestnet.index()),
2406        ("arbitrum-one", NamedChain::Arbitrum.index()),
2407        ("conflux-espace-testnet", NamedChain::CfxTestnet.index()),
2408        ("cronos_testnet", NamedChain::CronosTestnet.index()),
2409        ("zk_sync_testnet", NamedChain::ZkSyncTestnet.index()),
2410        ("tempo_moderato", NamedChain::TempoModerato.index()),
2411        ("gravity_alpha_testnet_sepolia", NamedChain::GravityAlphaTestnetSepolia.index()),
2412        ("acala_mandala_testnet", NamedChain::AcalaMandalaTestnet.index()),
2413        ("zora_sepolia", NamedChain::ZoraSepolia.index()),
2414        ("emerald_testnet", NamedChain::EmeraldTestnet.index()),
2415        ("fluent_devnet", NamedChain::FluentDevnet.index()),
2416        ("megaeth_testnet", NamedChain::MegaEthTestnet.index()),
2417        ("arc_testnet", NamedChain::ArcTestnet.index()),
2418        ("robinhood_testnet", NamedChain::RobinhoodTestnet.index()),
2419        ("optimism_sepolia", NamedChain::OptimismSepolia.index()),
2420        ("base_sepolia", NamedChain::BaseSepolia.index()),
2421        ("linea_sepolia", NamedChain::LineaSepolia.index()),
2422        ("polkadot_testnet", NamedChain::PolkadotTestnet.index()),
2423        ("xai_sepolia", NamedChain::XaiSepolia.index()),
2424        ("scroll_sepolia", NamedChain::ScrollSepolia.index()),
2425        ("op-bnb-mainnet", NamedChain::OpBNBMainnet.index()),
2426        ("immutable_testnet", NamedChain::ImmutableTestnet.index()),
2427        ("syndr_sepolia", NamedChain::SyndrSepolia.index()),
2428        ("avalanche_fuji", NamedChain::AvalancheFuji.index()),
2429        ("acala_testnet", NamedChain::AcalaTestnet.index()),
2430        ("etherlink_shadownet", NamedChain::EtherlinkShadownet.index()),
2431        ("gravity_alpha_mainnet", NamedChain::GravityAlphaMainnet.index()),
2432        ("treasure_topaz", NamedChain::TreasureTopaz.index()),
2433        ("mode_sepolia", NamedChain::ModeSepolia.index()),
2434        ("ink_sepolia_testnet", NamedChain::InkSepolia.index()),
2435        ("battle_chain_testnet", NamedChain::BattleChainTestnet.index()),
2436        ("autonomys_nova_testnet", NamedChain::AutonomysNovaTestnet.index()),
2437        ("flare_coston2", NamedChain::FlareCoston2.index()),
2438        ("bsc_testnet", NamedChain::BinanceSmartChainTestnet.index()),
2439        ("injective_testnet", NamedChain::InjectiveTestnet.index()),
2440        ("pgn_sepolia", NamedChain::PgnSepolia.index()),
2441        ("plasma_testnet", NamedChain::PlasmaTestnet.index()),
2442        ("worldchain", NamedChain::World.index()),
2443        ("berachain_bepolia", NamedChain::BerachainBepolia.index()),
2444        ("binance_smart_chain_testnet", NamedChain::BinanceSmartChainTestnet.index()),
2445        ("filecoin_calibration_testnet", NamedChain::FilecoinCalibrationTestnet.index()),
2446        ("fluent_testnet", NamedChain::FluentTestnet.index()),
2447        ("arbitrum_nova", NamedChain::ArbitrumNova.index()),
2448        ("zksync_testnet", NamedChain::ZkSyncTestnet.index()),
2449        ("bob_sepolia", NamedChain::BobSepolia.index()),
2450        ("arbitrum_one", NamedChain::Arbitrum.index()),
2451        ("evmos_testnet", NamedChain::EvmosTestnet.index()),
2452        ("op-bnb-testnet", NamedChain::OpBNBTestnet.index()),
2453        ("arbitrum_sepolia", NamedChain::ArbitrumSepolia.index()),
2454        ("signet_pecorino", NamedChain::SignetPecorino.index()),
2455        ("monad_testnet", NamedChain::MonadTestnet.index()),
2456        ("xdc_testnet", NamedChain::XdcTestnet.index()),
2457        ("opbnb_testnet", NamedChain::OpBNBTestnet.index()),
2458        ("telos-evm-testnet", NamedChain::TelosEvmTestnet.index()),
2459        ("cfx_testnet", NamedChain::CfxTestnet.index()),
2460        ("ape_chain", NamedChain::ApeChain.index()),
2461        ("tempo_devnet", NamedChain::TempoDevnet.index()),
2462        ("opbnb_mainnet", NamedChain::OpBNBMainnet.index()),
2463        ("redbelly_testnet", NamedChain::RedbellyTestnet.index()),
2464        ("canto_testnet", NamedChain::CantoTestnet.index()),
2465        ("anvil_hardhat", NamedChain::AnvilHardhat.index()),
2466        ("filecoin_mainnet", NamedChain::FilecoinMainnet.index()),
2467        ("lens_testnet", NamedChain::LensTestnet.index()),
2468        ("fantom_testnet", NamedChain::FantomTestnet.index()),
2469        ("fraxtal_testnet", NamedChain::FraxtalTestnet.index()),
2470        ("sei_testnet", NamedChain::SeiTestnet.index()),
2471        ("corn_testnet", NamedChain::CornTestnet.index()),
2472        ("arbitrum_goerli", NamedChain::ArbitrumGoerli.index()),
2473    ],
2474};
2475
2476#[cfg(test)]
2477mod tests {
2478    use super::*;
2479
2480    #[test]
2481    fn no_index_is_not_used_as_index() {
2482        assert_table_len(CHAIN_NAMES.len());
2483        assert_table_len(NATIVE_CURRENCY_SYMBOLS.len());
2484        assert_table_len(ETHERSCAN_API_URLS.len());
2485        assert_table_len(ETHERSCAN_BASE_URLS.len());
2486        assert_table_len(ETHERSCAN_API_KEY_NAMES.len());
2487        assert_table_len(WRAPPED_NATIVE_TOKENS.len());
2488
2489        for data in CHAIN_DATA.iter().copied() {
2490            assert_index(data.name, CHAIN_NAMES.len());
2491            assert_optional_index(data.native_currency_symbol, NATIVE_CURRENCY_SYMBOLS.len());
2492            assert_optional_index(data.etherscan_api_url, ETHERSCAN_API_URLS.len());
2493            assert_optional_index(data.etherscan_base_url, ETHERSCAN_BASE_URLS.len());
2494            assert_optional_index(data.etherscan_api_key_name, ETHERSCAN_API_KEY_NAMES.len());
2495            assert_optional_index(data.wrapped_native_token, WRAPPED_NATIVE_TOKENS.len());
2496        }
2497    }
2498
2499    fn assert_table_len(len: usize) {
2500        assert!(len <= NO_INDEX as usize);
2501    }
2502
2503    fn assert_index(index: u8, len: usize) {
2504        assert_ne!(index, NO_INDEX);
2505        assert!((index as usize) < len);
2506    }
2507
2508    fn assert_optional_index(index: u8, len: usize) {
2509        if index != NO_INDEX {
2510            assert!((index as usize) < len);
2511        }
2512    }
2513}