adding chiado support (#1811)

This commit is contained in:
Alejandro Banzas 2022-10-31 17:01:34 +01:00 committed by GitHub
parent def99318bb
commit 50c7ff1d8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 0 deletions

View File

@ -47,6 +47,7 @@ pub static MULTICALL_SUPPORTED_CHAIN_IDS: Lazy<[U256; 47]> = Lazy::new(|| {
U256::from(Polygon), // Polygon
U256::from(PolygonMumbai), // PolygonMumbai
U256::from(XDai), // XDai
U256::from(Chiado), // ChiadoTestnet
U256::from(Avalanche), // Avalanche
U256::from(AvalancheFuji), // AvalancheFuji
U256::from(FantomTestnet), // FantomTestnet

View File

@ -32,6 +32,7 @@ pub enum Chain {
Kovan = 42,
#[strum(serialize = "xdai")]
XDai = 100,
Chiado = 10200,
Polygon = 137,
Fantom = 250,
Dev = 1337,
@ -103,6 +104,7 @@ impl Chain {
Chain::Goerli |
Chain::Kovan |
Chain::XDai |
Chain::Chiado |
Chain::Sepolia |
Chain::Moonbase |
Chain::MoonbeamDev |
@ -186,6 +188,9 @@ impl Chain {
Chain::XDai => {
("https://blockscout.com/xdai/mainnet/api", "https://blockscout.com/xdai/mainnet")
}
Chain::Chiado => {
("https://blockscout.chiadochain.net/api", "https://blockscout.chiadochain.net")
}
Chain::Sokol => {
("https://blockscout.com/poa/sokol/api", "https://blockscout.com/poa/sokol")
}
@ -230,6 +235,7 @@ impl fmt::Display for Chain {
Chain::Goerli => "goerli",
Chain::Kovan => "kovan",
Chain::XDai => "xdai",
Chain::Chiado => "chiado",
Chain::Polygon => "polygon",
Chain::PolygonMumbai => "mumbai",
Chain::Avalanche => "avalanche",
@ -299,6 +305,7 @@ impl TryFrom<u64> for Chain {
5 => Chain::Goerli,
42 => Chain::Kovan,
100 => Chain::XDai,
10200 => Chain::Chiado,
137 => Chain::Polygon,
1337 => Chain::Dev,
31337 => Chain::AnvilHardhat,
@ -359,6 +366,7 @@ impl FromStr for Chain {
"goerli" => Chain::Goerli,
"kovan" => Chain::Kovan,
"xdai" => Chain::XDai,
"chiado" => Chain::Chiado,
"polygon" => Chain::Polygon,
"mumbai" | "polygon-mumbai" => Chain::PolygonMumbai,
"avalanche" => Chain::Avalanche,

View File

@ -103,6 +103,7 @@ impl Client {
std::env::var("FTMSCAN_API_KEY").or_else(|_| std::env::var("FANTOMSCAN_API_KEY"))?
}
Chain::XDai |
Chain::Chiado |
Chain::Sepolia |
Chain::Rsk |
Chain::Sokol |