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

feat: add base network #2516

Merged
merged 1 commit into from
Jul 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions ethers-core/src/types/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ pub enum Chain {

Boba = 288,

Base = 8453,
BaseGoerli = 84531,

LineaTestnet = 59140,
Expand Down Expand Up @@ -296,7 +297,7 @@ impl Chain {
ScrollAlphaTestnet => 3_000,
// Explicitly exhaustive. See NB above.
Morden | Ropsten | Rinkeby | Goerli | Kovan | XDai | Chiado | Sepolia | Moonbase |
MoonbeamDev | OptimismKovan | Poa | Sokol | Rsk | EmeraldTestnet | Boba |
MoonbeamDev | OptimismKovan | Poa | Sokol | Rsk | EmeraldTestnet | Boba | Base |
BaseGoerli | ZkSync | ZkSyncTestnet | PolygonZkEvm | PolygonZkEvmTestnet | Metis |
LineaTestnet => return None,
};
Expand Down Expand Up @@ -335,14 +336,15 @@ impl Chain {
Boba |
ZkSync |
ZkSyncTestnet |
BaseGoerli |
PolygonZkEvm |
PolygonZkEvmTestnet => true,

// Known EIP-1559 chains
Mainnet |
Goerli |
Sepolia |
Base |
BaseGoerli |
Optimism |
OptimismGoerli |
Polygon |
Expand Down Expand Up @@ -520,6 +522,8 @@ impl Chain {

Boba => ("https://api.bobascan.com/api", "https://bobascan.com"),

Base => ("https://api.basescan.org/api", "https://basescan.org"),

BaseGoerli => ("https://api-goerli.basescan.org/api", "https://goerli.basescan.org"),

ZkSync => {
Expand Down Expand Up @@ -579,6 +583,7 @@ impl Chain {
Celo |
CeloAlfajores |
CeloBaklava |
Base |
BaseGoerli => "ETHERSCAN_API_KEY",

Avalanche | AvalancheFuji => "SNOWTRACE_API_KEY",
Expand Down