Skip to content
This repository was archived by the owner on Oct 19, 2024. It is now read-only.

Commit b95e785

Browse files
authored
feat(chain): add zora networks (#2677)
* feat(chain): add zora networks * chore(chain): format * chore(chain): nightly format
1 parent b4c366c commit b95e785

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

ethers-core/src/types/chain.rs

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ pub enum Chain {
174174
#[strum(to_string = "mantle-testnet")]
175175
#[serde(alias = "mantle_testnet")]
176176
MantleTestnet = 5001,
177+
178+
Zora = 7777777,
179+
ZoraGoerli = 999,
180+
ZoraSepolia = 999999999,
177181
}
178182

179183
// === impl Chain ===
@@ -312,7 +316,9 @@ impl Chain {
312316
Morden | Ropsten | Rinkeby | Goerli | Kovan | Sepolia | Holesky | Moonbase |
313317
MoonbeamDev | OptimismKovan | Poa | Sokol | Rsk | EmeraldTestnet | Boba | Base |
314318
BaseGoerli | ZkSync | ZkSyncTestnet | PolygonZkEvm | PolygonZkEvmTestnet | Metis |
315-
Linea | LineaTestnet | Mantle | MantleTestnet => return None,
319+
Linea | LineaTestnet | Mantle | MantleTestnet | Zora | ZoraGoerli | ZoraSepolia => {
320+
return None
321+
}
316322
};
317323

318324
Some(Duration::from_millis(ms))
@@ -378,7 +384,10 @@ impl Chain {
378384
LineaTestnet |
379385
FilecoinCalibrationTestnet |
380386
Gnosis |
381-
Chiado => false,
387+
Chiado |
388+
Zora |
389+
ZoraGoerli |
390+
ZoraSepolia => false,
382391

383392
// Unknown / not applicable, default to false for backwards compatibility
384393
Dev | AnvilHardhat | Morden | Ropsten | Rinkeby | Cronos | CronosTestnet | Kovan |
@@ -571,10 +580,18 @@ impl Chain {
571580
("https://explorer.testnet.mantle.xyz/api", "https://explorer.testnet.mantle.xyz")
572581
}
573582

583+
Zora => ("https://explorer.zora.energy/api", "https://explorer.zora.energy"),
584+
ZoraGoerli => {
585+
("https://testnet.explorer.zora.energy/api", "https://testnet.explorer.zora.energy")
586+
}
587+
ZoraSepolia => {
588+
("https://sepolia.explorer.zora.energy/api", "https://sepolia.explorer.zora.energy")
589+
}
590+
574591
AnvilHardhat | Dev | Morden | MoonbeamDev | FilecoinMainnet => {
575592
// this is explicitly exhaustive so we don't forget to add new urls when adding a
576593
// new chain
577-
return None
594+
return None;
578595
}
579596
};
580597

@@ -636,7 +653,7 @@ impl Chain {
636653

637654
Moonbeam | Moonbase | MoonbeamDev | Moonriver => "MOONSCAN_API_KEY",
638655

639-
Canto | CantoTestnet => "BLOCKSCOUT_API_KEY",
656+
Canto | CantoTestnet | Zora | ZoraGoerli | ZoraSepolia => "BLOCKSCOUT_API_KEY",
640657

641658
Boba => "BOBASCAN_API_KEY",
642659

0 commit comments

Comments
 (0)