Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: convert to workspace #41

Merged
merged 3 commits into from
Apr 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 8 additions & 47 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,47 +1,8 @@
[package]
name = "foundry-block-explorers"
version = "0.2.6"
edition = "2021"
rust-version = "1.65"
authors = ["Foundry Contributors"]
license = "MIT OR Apache-2.0"
description = "Bindings for Etherscan.io and other block explorer APIs"
keywords = ["crypto", "ethers", "ethereum", "web3", "etherscan"]
homepage = "https://github.com/foundry-rs/block-explorers"
repository = "https://github.com/foundry-rs/block-explorers"
exclude = [".github/", "scripts/", "test-data/"]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[package.metadata.playground]
all-features = true

[dependencies]
alloy-chains = "0.1"
alloy-json-abi = { version = "0.7", default-features = false, features = ["std", "serde_json"] }
alloy-primitives = { version = "0.7", default-features = false, features = ["std", "serde"] }

reqwest = { version = "0.12", default-features = false, features = ["json"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = "1.0"
tracing = "0.1.37"
semver = "1.0"

foundry-compilers = { version = "0.3", optional = true }

[dev-dependencies]
tempfile = "3.8"
tokio = { version = "1.32", features = ["macros", "rt-multi-thread", "time"] }
serial_test = "3.0.0"
tracing-subscriber = { version = "0.3.17", features = ["env-filter", "fmt"] }

[features]
default = ["rustls"]
rustls = ["reqwest/rustls-tls"]
openssl = ["reqwest/native-tls"]

foundry-compilers = ["dep:foundry-compilers"]
compilers-full = ["foundry-compilers?/full"]
[workspace]
members = [
"crates/*"
]

# Explicitly set the resolver to version 2, which is the default for packages with edition >= 2021
# https://doc.rust-lang.org/edition-guide/rust-2021/default-cargo-resolver.html
resolver = "2"
37 changes: 16 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# foundry-block-explorers

Bindings for Etherscan.io and other block explorer APIs.

Originally part of [`ethers-rs`] as [`ethers-etherscan`](https://crates.io/crates/ethers-etherscan).

[`ethers-rs`]: https://github.com/gakonst/ethers-rs
Crates for interacting with explorer APIS.

[![Build Status][actions-badge]][actions-url]
[![Telegram chat][telegram-badge]][telegram-url]
Expand All @@ -14,23 +10,12 @@ Originally part of [`ethers-rs`] as [`ethers-etherscan`](https://crates.io/crate
[telegram-badge]: https://img.shields.io/endpoint?color=neon&style=for-the-badge&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Ffoundry_rs
[telegram-url]: https://t.me/foundry_rs

## Examples
## Overview

```rust,no_run
use alloy_chains::Chain;
use foundry_block_explorers::Client;
This repository contains the following crates:

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())?;
- [`foundry-block-explorers`]: Bindings for etherscan.io API.

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

## Supported Rust Versions

Expand All @@ -41,13 +26,23 @@ When updating this, also update:
- .github/workflows/ci.yml
-->

Foundry will keep a rolling MSRV (minimum supported rust version) policy of **at
We will keep a rolling MSRV (minimum supported rust version) policy of **at
least** 6 months. When increasing the MSRV, the new Rust version must have been
released at least six months ago. The current MSRV is 1.65.0.

Note that the MSRV is not increased automatically, and only as part of a minor
release.

## Contributing

Thanks for your help improving the project! We are so happy to have you! We have
[a contributing guide](./CONTRIBUTING.md) to help you get involved in the
Alloy project.

Pull requests will not be merged unless CI passes, so please ensure that your
contribution follows the linting rules and passes clippy.


#### License

<sup>
Expand All @@ -61,4 +56,4 @@ Licensed under either of <a href="LICENSE-APACHE">Apache License, Version
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in these crates by you, as defined in the Apache-2.0 license,
shall be dual licensed as above, without any additional terms or conditions.
</sub>
</sub>
48 changes: 48 additions & 0 deletions crates/block-explorers/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[package]
name = "foundry-block-explorers"
version = "0.2.6"
edition = "2021"
rust-version = "1.65"
authors = ["Foundry Contributors"]
license = "MIT OR Apache-2.0"
description = "Bindings for Etherscan.io and other block explorer APIs"
keywords = ["crypto", "ethers", "ethereum", "web3", "etherscan"]
homepage = "https://github.com/foundry-rs/block-explorers"
repository = "https://github.com/foundry-rs/block-explorers"
exclude = [".github/", "scripts/", "test-data/"]
readme = "README.md"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[package.metadata.playground]
all-features = true

[dependencies]
alloy-chains = "0.1"
alloy-json-abi = { version = "0.7", default-features = false, features = ["std", "serde_json"] }
alloy-primitives = { version = "0.7", default-features = false, features = ["std", "serde"] }

reqwest = { version = "0.12", default-features = false, features = ["json"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = "1.0"
tracing = "0.1.37"
semver = "1.0"

foundry-compilers = { version = "0.3", optional = true }

[dev-dependencies]
tempfile = "3.8"
tokio = { version = "1.32", features = ["macros", "rt-multi-thread", "time"] }
serial_test = "3.0.0"
tracing-subscriber = { version = "0.3.17", features = ["env-filter", "fmt"] }

[features]
default = ["rustls"]
rustls = ["reqwest/rustls-tls"]
openssl = ["reqwest/native-tls"]

foundry-compilers = ["dep:foundry-compilers"]
compilers-full = ["foundry-compilers?/full"]
1 change: 1 addition & 0 deletions crates/block-explorers/LICENSE-APACHE
1 change: 1 addition & 0 deletions crates/block-explorers/LICENSE-MIT
64 changes: 64 additions & 0 deletions crates/block-explorers/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# foundry-block-explorers

Bindings for Etherscan.io and other block explorer APIs.

Originally part of [`ethers-rs`] as [`ethers-etherscan`](https://crates.io/crates/ethers-etherscan).

[`ethers-rs`]: https://github.com/gakonst/ethers-rs

[![Build Status][actions-badge]][actions-url]
[![Telegram chat][telegram-badge]][telegram-url]

[actions-badge]: https://img.shields.io/github/actions/workflow/status/foundry-rs/block-explorers/ci.yml?branch=main&style=for-the-badge
[actions-url]: https://github.com/foundry-rs/block-explorers/actions?query=branch%3Amain
[telegram-badge]: https://img.shields.io/endpoint?color=neon&style=for-the-badge&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Ffoundry_rs
[telegram-url]: https://t.me/foundry_rs

## Examples

```rust,no_run
use alloy_chains::Chain;
use foundry_block_explorers::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(())
}
```

## Supported Rust Versions

<!--
When updating this, also update:
- clippy.toml
- Cargo.toml
- .github/workflows/ci.yml
-->

Foundry will keep a rolling MSRV (minimum supported rust version) policy of **at
least** 6 months. When increasing the MSRV, the new Rust version must have been
released at least six months ago. The current MSRV is 1.65.0.

Note that the MSRV is not increased automatically, and only as part of a minor
release.

#### License

<sup>
Licensed under either of <a href="LICENSE-APACHE">Apache License, Version
2.0</a> or <a href="LICENSE-MIT">MIT license</a> at your option.
</sup>

<br>

<sub>
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in these crates by you, as defined in the Apache-2.0 license,
shall be dual licensed as above, without any additional terms or conditions.
</sub>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading