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