ethers-etherscan

Crates.ioethers-etherscan
lib.rsethers-etherscan
version2.0.14
sourcesrc
created_at2021-10-15 15:43:33.109666
updated_at2024-03-06 17:23:48.739501
descriptionBindings for the etherscan.io web API
homepagehttps://github.com/gakonst/ethers-rs
repositoryhttps://github.com/gakonst/ethers-rs
max_upload_size
id465552
size117,417
Georgios Konstantopoulos (gakonst)

documentation

https://docs.rs/ethers

README

ethers-etherscan

Bindings for the etherscan.io web API.

For more information, please refer to the book.

Warning

This crate is deprecated in favor of foundry-block-explorers (foundry-rs/block-explorers). See #2667 for more information.

Examples

# use ethers_core::types::Chain;
# use ethers_etherscan::Client;
# async fn foo() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new(Chain::Mainnet, "<your_api_key>")?;
// Or using environment variables
let client = Client::new_from_env(Chain::Mainnet)?;

let address = "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413".parse()?;
let metadata = client.contract_source_code(address).await?;
assert_eq!(metadata.items[0].contract_name, "DAO");
# Ok(())
# }
Commit count: 2172

cargo fmt