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

Add polygon amoy to chain definitions #2723

Merged
merged 2 commits into from
Feb 12, 2024
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
11 changes: 9 additions & 2 deletions ethers-core/src/types/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ pub enum Chain {
#[strum(to_string = "mumbai", serialize = "polygon-mumbai")]
#[serde(alias = "mumbai")]
PolygonMumbai = 80001,
#[strum(to_string = "amoy", serialize = "polygon-amoy")]
#[serde(alias = "amoy")]
PolygonAmoy = 80002,
#[strum(serialize = "polygon-zkevm", serialize = "zkevm")]
#[serde(alias = "zkevm", alias = "polygon_zkevm")]
PolygonZkEvm = 1101,
Expand Down Expand Up @@ -305,7 +308,7 @@ impl Chain {
Mainnet => 12_000,
Arbitrum | ArbitrumTestnet | ArbitrumGoerli | ArbitrumSepolia | ArbitrumNova => 1_300,
Optimism | OptimismGoerli | OptimismSepolia => 2_000,
Polygon | PolygonMumbai => 2_100,
Polygon | PolygonMumbai | PolygonAmoy => 2_100,
Moonbeam | Moonriver => 12_500,
BinanceSmartChain | BinanceSmartChainTestnet => 3_000,
Avalanche | AvalancheFuji => 2_000,
Expand Down Expand Up @@ -386,6 +389,7 @@ impl Chain {
OptimismSepolia |
Polygon |
PolygonMumbai |
PolygonAmoy |
Avalanche |
AvalancheFuji |
Arbitrum |
Expand Down Expand Up @@ -459,6 +463,7 @@ impl Chain {
PolygonMumbai => {
("https://api-testnet.polygonscan.com/api", "https://mumbai.polygonscan.com")
}
PolygonAmoy => ("https://rpc-amoy.polygon.technology", "https://www.oklink.com/amoy"),

PolygonZkEvm => {
("https://api-zkevm.polygonscan.com/api", "https://zkevm.polygonscan.com")
Expand Down Expand Up @@ -677,7 +682,9 @@ impl Chain {

Avalanche | AvalancheFuji => "SNOWTRACE_API_KEY",

Polygon | PolygonMumbai | PolygonZkEvm | PolygonZkEvmTestnet => "POLYGONSCAN_API_KEY",
Polygon | PolygonMumbai | PolygonZkEvm | PolygonZkEvmTestnet | PolygonAmoy => {
"POLYGONSCAN_API_KEY"
}

Fantom | FantomTestnet => "FTMSCAN_API_KEY",

Expand Down
Loading