From f851ffe5ba79baa94ff5aee32e70a13f8a40de21 Mon Sep 17 00:00:00 2001 From: JP <36560907+0xfourzerofour@users.noreply.github.com> Date: Mon, 12 Feb 2024 16:05:41 -0500 Subject: [PATCH] Add polygon amoy to chain definitions (#2723) * feat(amoy): add polygon amoy * feat(amoy): format --- ethers-core/src/types/chain.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ethers-core/src/types/chain.rs b/ethers-core/src/types/chain.rs index 487f353f6..854551ae2 100644 --- a/ethers-core/src/types/chain.rs +++ b/ethers-core/src/types/chain.rs @@ -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, @@ -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, @@ -389,6 +392,7 @@ impl Chain { OptimismSepolia | Polygon | PolygonMumbai | + PolygonAmoy | Avalanche | AvalancheFuji | Arbitrum | @@ -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") @@ -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",