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

Commit

Permalink
Add polygon amoy to chain definitions (#2723)
Browse files Browse the repository at this point in the history
* feat(amoy): add polygon amoy

* feat(amoy): format
  • Loading branch information
0xfourzerofour authored Feb 12, 2024
1 parent ccb6abb commit f851ffe
Showing 1 changed file with 9 additions and 2 deletions.
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 @@ -307,7 +310,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 @@ -389,6 +392,7 @@ impl Chain {
OptimismSepolia |
Polygon |
PolygonMumbai |
PolygonAmoy |
Avalanche |
AvalancheFuji |
Arbitrum |
Expand Down Expand Up @@ -462,6 +466,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 @@ -686,7 +691,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

0 comments on commit f851ffe

Please sign in to comment.