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

Commit

Permalink
feat: add ZkSync testnet (#2391)
Browse files Browse the repository at this point in the history
* feat: add ZkSync testnet

* chore: fix formatting
  • Loading branch information
agostbiro authored May 6, 2023
1 parent f7454f2 commit 84dda78
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions ethers-core/src/types/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ pub enum Chain {
#[strum(to_string = "zksync")]
#[serde(alias = "zksync")]
ZkSync = 324,
#[strum(to_string = "zksync-testnet")]
#[serde(alias = "zksync_testnet")]
ZkSyncTestnet = 280,
}

// === impl Chain ===
Expand Down Expand Up @@ -288,8 +291,8 @@ impl Chain {
// Explicitly exhaustive. See NB above.
Morden | Ropsten | Rinkeby | Goerli | Kovan | XDai | Chiado | Sepolia | Moonbase |
MoonbeamDev | Optimism | OptimismGoerli | OptimismKovan | Poa | Sokol | Rsk |
EmeraldTestnet | Boba | BaseGoerli | ZkSync | PolygonZkEvm | PolygonZkEvmTestnet |
Metis => return None,
EmeraldTestnet | Boba | BaseGoerli | ZkSync | ZkSyncTestnet | PolygonZkEvm |
PolygonZkEvmTestnet | Metis => return None,
};

Some(Duration::from_millis(ms))
Expand Down Expand Up @@ -330,6 +333,7 @@ impl Chain {
CeloBaklava |
Boba |
ZkSync |
ZkSyncTestnet |
BaseGoerli |
PolygonZkEvm |
PolygonZkEvmTestnet => true,
Expand Down Expand Up @@ -503,6 +507,10 @@ impl Chain {
ZkSync => {
("https://zksync2-mainnet-explorer.zksync.io/", "https://explorer.zksync.io/")
}
ZkSyncTestnet => (
"https://zksync2-testnet-explorer.zksync.dev/",
"https://goerli.explorer.zksync.io/",
),

AnvilHardhat | Dev | Morden | MoonbeamDev | FilecoinMainnet => {
// this is explicitly exhaustive so we don't forget to add new urls when adding a
Expand Down Expand Up @@ -581,6 +589,7 @@ impl Chain {
AnvilHardhat |
Dev |
ZkSync |
ZkSyncTestnet |
FilecoinMainnet |
FilecoinHyperspaceTestnet => return None,
};
Expand Down

0 comments on commit 84dda78

Please sign in to comment.