Skip to content

Instantly share code, notes, and snippets.

@sevazhidkov
Created January 3, 2024 16:04
Show Gist options
  • Save sevazhidkov/0aaef3621339fa47298aa0ab33570605 to your computer and use it in GitHub Desktop.
Save sevazhidkov/0aaef3621339fa47298aa0ab33570605 to your computer and use it in GitHub Desktop.
use ethers_core::types::Chain;
use ethers_contract::MULTICALL_SUPPORTED_CHAIN_IDS;
#[tokio::main]
async fn main() {
let response: serde_json::Value =
reqwest::get("https://raw.githubusercontent.com/mds1/multicall/main/deployments.json")
.await
.unwrap()
.json()
.await
.unwrap();
for chain in response.as_array().unwrap() {
// Skip chains with custom contract addresses
if chain.as_object().unwrap().contains_key("address") {
continue;
}
let chain_id = chain["chainId"].as_u64().unwrap();
let ethers_chain: Option<Chain> = chain_id.try_into().ok();
if !MULTICALL_SUPPORTED_CHAIN_IDS.contains(&chain_id) && ethers_chain.is_none() {
println!("{}: {:?} {:?}", chain_id, chain, ethers_chain);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment