Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add base sepolia #24

Merged
merged 2 commits into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 7 additions & 0 deletions src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,12 @@ impl Chain {
Self::from_named(NamedChain::BaseGoerli)
}

/// Returns the base sepolia chain.
#[inline]
zsluedem marked this conversation as resolved.
Show resolved Hide resolved
pub const fn base_sepolia() -> Self {
Self::from_named(NamedChain::BaseSepolia)
}

/// Returns the base mainnet chain.
#[inline]
pub const fn base_mainnet() -> Self {
Expand Down Expand Up @@ -322,6 +328,7 @@ impl Chain {
| NamedChain::OptimismSepolia
| NamedChain::Base
| NamedChain::BaseGoerli
| NamedChain::BaseSepolia
)
)
}
Expand Down
9 changes: 9 additions & 0 deletions src/named.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ pub enum NamedChain {

Base = 8453,
BaseGoerli = 84531,
BaseSepolia = 84532,

Linea = 59144,
LineaTestnet = 59140,
Expand Down Expand Up @@ -314,6 +315,7 @@ impl NamedChain {
| C::OptimismSepolia
| C::Base
| C::BaseGoerli
| C::BaseSepolia
| C::Zora
| C::ZoraGoerli
| C::ZoraSepolia => 2_000,
Expand Down Expand Up @@ -421,6 +423,7 @@ impl NamedChain {
| C::Holesky
| C::Base
| C::BaseGoerli
| C::BaseSepolia
| C::Optimism
| C::OptimismGoerli
| C::OptimismSepolia
Expand Down Expand Up @@ -480,6 +483,7 @@ impl NamedChain {
| C::OptimismGoerli
| C::OptimismSepolia
| C::BaseGoerli
| C::BaseSepolia
| C::Gnosis
| C::Chiado
| C::ZoraSepolia
Expand Down Expand Up @@ -516,6 +520,7 @@ impl NamedChain {
| C::AuroraTestnet
| C::AvalancheFuji
| C::BaseGoerli
| C::BaseSepolia
| C::BinanceSmartChainTestnet
| C::CantoTestnet
| C::CronosTestnet
Expand Down Expand Up @@ -770,6 +775,9 @@ impl NamedChain {

C::Base => ("https://api.basescan.org/api", "https://basescan.org"),
C::BaseGoerli => ("https://api-goerli.basescan.org/api", "https://goerli.basescan.org"),
C::BaseSepolia => {
("https://api-sepolia.basescan.org/api", "https://sepolia.basescan.org")
}

C::ZkSync => {
("https://zksync2-mainnet-explorer.zksync.io", "https://explorer.zksync.io")
Expand Down Expand Up @@ -846,6 +854,7 @@ impl NamedChain {
| C::Mantle
| C::MantleTestnet
| C::BaseGoerli
| C::BaseSepolia
| C::Gnosis
| C::Scroll
| C::ScrollSepolia => "ETHERSCAN_API_KEY",
Expand Down
Loading