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

Commit

Permalink
feat(chain): add zora networks (#2677)
Browse files Browse the repository at this point in the history
* feat(chain): add zora networks

* chore(chain): format

* chore(chain): nightly format
  • Loading branch information
mattmalec authored Nov 16, 2023
1 parent b4c366c commit b95e785
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions ethers-core/src/types/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ pub enum Chain {
#[strum(to_string = "mantle-testnet")]
#[serde(alias = "mantle_testnet")]
MantleTestnet = 5001,

Zora = 7777777,
ZoraGoerli = 999,
ZoraSepolia = 999999999,
}

// === impl Chain ===
Expand Down Expand Up @@ -312,7 +316,9 @@ impl Chain {
Morden | Ropsten | Rinkeby | Goerli | Kovan | Sepolia | Holesky | Moonbase |
MoonbeamDev | OptimismKovan | Poa | Sokol | Rsk | EmeraldTestnet | Boba | Base |
BaseGoerli | ZkSync | ZkSyncTestnet | PolygonZkEvm | PolygonZkEvmTestnet | Metis |
Linea | LineaTestnet | Mantle | MantleTestnet => return None,
Linea | LineaTestnet | Mantle | MantleTestnet | Zora | ZoraGoerli | ZoraSepolia => {
return None
}
};

Some(Duration::from_millis(ms))
Expand Down Expand Up @@ -378,7 +384,10 @@ impl Chain {
LineaTestnet |
FilecoinCalibrationTestnet |
Gnosis |
Chiado => false,
Chiado |
Zora |
ZoraGoerli |
ZoraSepolia => false,

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

Zora => ("https://explorer.zora.energy/api", "https://explorer.zora.energy"),
ZoraGoerli => {
("https://testnet.explorer.zora.energy/api", "https://testnet.explorer.zora.energy")
}
ZoraSepolia => {
("https://sepolia.explorer.zora.energy/api", "https://sepolia.explorer.zora.energy")
}

AnvilHardhat | Dev | Morden | MoonbeamDev | FilecoinMainnet => {
// this is explicitly exhaustive so we don't forget to add new urls when adding a
// new chain
return None
return None;
}
};

Expand Down Expand Up @@ -636,7 +653,7 @@ impl Chain {

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

Canto | CantoTestnet => "BLOCKSCOUT_API_KEY",
Canto | CantoTestnet | Zora | ZoraGoerli | ZoraSepolia => "BLOCKSCOUT_API_KEY",

Boba => "BOBASCAN_API_KEY",

Expand Down

0 comments on commit b95e785

Please sign in to comment.