chore(deps): bump and use workspace dependencies (#2222)
* chore: update all deps * chore: update dependabot * chore: separate ethers package from workspace * chore: package metadata * chore: use package.*.workspace = true * fix: docs.rs build * chore: update examples manifests * chore: use workspace dependencies for ethers-* crates * fix: test * chore: use workspace dependencies for all dependencies * chore: pin rust-crypto * chore: add license field to example crates * fixes * more fixes * fix: test * last fixes * fix: wasm * fix: docs.rs build * fix * fix: wasm-pack error see also https://github.com/rustwasm/wasm-pack/issues/1238 * fix: wasm deps and example * ci: update * fix: wasm tests * fix: eip712 tests * fix: windows ci * fix * chore: update docsrs metadata * chore: bump version to match crates.io * chore: rm bad release.toml config * chore: rm release.toml bad configuration * chore: add exclude to workspace * fix: middleware * fix: solc feature flags * chore: run cargo upgrade * chore: update deps * chore: update remaining deps * undo fix * update lock * bump yubi * fix: update coins-* and fix spki breaking changes
This commit is contained in:
parent
4e6dfe2414
commit
439a0c7de0
|
@ -6,44 +6,3 @@ updates:
|
||||||
interval: daily
|
interval: daily
|
||||||
time: "03:00"
|
time: "03:00"
|
||||||
open-pull-requests-limit: 10
|
open-pull-requests-limit: 10
|
||||||
ignore:
|
|
||||||
- dependency-name: async-trait
|
|
||||||
versions:
|
|
||||||
- 0.1.48
|
|
||||||
- 0.1.49
|
|
||||||
- dependency-name: futures-core
|
|
||||||
versions:
|
|
||||||
- 0.3.13
|
|
||||||
- 0.3.14
|
|
||||||
- dependency-name: futures-channel
|
|
||||||
versions:
|
|
||||||
- 0.3.14
|
|
||||||
- dependency-name: anyhow
|
|
||||||
versions:
|
|
||||||
- 1.0.40
|
|
||||||
- dependency-name: elliptic-curve
|
|
||||||
versions:
|
|
||||||
- 0.9.0
|
|
||||||
- 0.9.2
|
|
||||||
- 0.9.6
|
|
||||||
- dependency-name: pin-project
|
|
||||||
versions:
|
|
||||||
- 1.0.6
|
|
||||||
- dependency-name: arrayvec
|
|
||||||
versions:
|
|
||||||
- 0.6.0
|
|
||||||
- dependency-name: serde
|
|
||||||
versions:
|
|
||||||
- 1.0.125
|
|
||||||
- dependency-name: tokio
|
|
||||||
versions:
|
|
||||||
- 1.3.0
|
|
||||||
- dependency-name: serde_json
|
|
||||||
versions:
|
|
||||||
- 1.0.63
|
|
||||||
- dependency-name: ethereum-types
|
|
||||||
versions:
|
|
||||||
- 0.11.0
|
|
||||||
- dependency-name: yubihsm
|
|
||||||
versions:
|
|
||||||
- 0.38.0
|
|
||||||
|
|
|
@ -17,22 +17,40 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: test ${{ matrix.os }} ${{ matrix.flags }}
|
name: test ${{ matrix.os }} (${{ matrix.flags.name }})
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
|
os: ["ubuntu-latest", "macos-latest"]
|
||||||
flags: ["--workspace", "--workspace --all-features"]
|
flags:
|
||||||
exclude:
|
- name: no default features
|
||||||
# sha2-asm
|
flags: --workspace --no-default-features
|
||||||
- os: windows-latest
|
- name: default features
|
||||||
|
flags: --workspace
|
||||||
|
- name: all features
|
||||||
flags: --workspace --all-features
|
flags: --workspace --all-features
|
||||||
|
include:
|
||||||
|
# not workspace because compiling examples fails for no reason in CI,
|
||||||
|
- os: windows-latest
|
||||||
|
flags:
|
||||||
|
name: no default features
|
||||||
|
flags: -p ethers --no-default-features
|
||||||
|
- os: windows-latest
|
||||||
|
flags:
|
||||||
|
name: default features
|
||||||
|
flags: -p ethers
|
||||||
|
- os: windows-latest
|
||||||
|
flags:
|
||||||
|
name: all features
|
||||||
|
flags: -p ethers --all-features
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
with:
|
||||||
toolchain: ${{ matrix.os == 'windows-latest' && 'stable-x86_64-pc-windows-gnu' || 'stable' }}
|
toolchain:
|
||||||
|
${{ matrix.os == 'windows-latest' && 'stable-x86_64-pc-windows-gnu' ||
|
||||||
|
'stable' }}
|
||||||
- name: Install Anvil
|
- name: Install Anvil
|
||||||
uses: foundry-rs/foundry-toolchain@v1
|
uses: foundry-rs/foundry-toolchain@v1
|
||||||
with:
|
with:
|
||||||
|
@ -43,12 +61,12 @@ jobs:
|
||||||
- name: Install nextest
|
- name: Install nextest
|
||||||
uses: taiki-e/install-action@nextest
|
uses: taiki-e/install-action@nextest
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
- name: test
|
- name: test ${{ matrix.flags.flags }}
|
||||||
shell: bash
|
shell: bash
|
||||||
# skip `ethers_etherscan::it` and `ethers::live`
|
# skip `ethers_etherscan::it` and `ethers::live`
|
||||||
run: |
|
run: |
|
||||||
cargo nextest run \
|
cargo nextest run \
|
||||||
${{ matrix.flags }} \
|
${{ matrix.flags.flags }} \
|
||||||
-E "!binary(~live) & !(deps(ethers-etherscan) & kind(test))"
|
-E "!binary(~live) & !(deps(ethers-etherscan) & kind(test))"
|
||||||
|
|
||||||
etherscan-tests:
|
etherscan-tests:
|
||||||
|
@ -147,9 +165,6 @@ jobs:
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
- name: Check
|
- name: Check
|
||||||
run: cargo check --workspace --target wasm32-unknown-unknown
|
run: cargo check --workspace --target wasm32-unknown-unknown
|
||||||
# TODO: [#2191](https://github.com/gakonst/ethers-rs/issues/2191)
|
|
||||||
# - name: Check all features
|
|
||||||
# run: cargo check --workspace --target wasm32-unknown-unknown --all-features
|
|
||||||
|
|
||||||
- name: Install wasm-pack
|
- name: Install wasm-pack
|
||||||
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
220
Cargo.toml
220
Cargo.toml
|
@ -1,128 +1,134 @@
|
||||||
[package]
|
[workspace.package]
|
||||||
name = "ethers"
|
|
||||||
version = "2.0.0"
|
version = "2.0.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.64" # must also be changed in **/Cargo.toml and .clippy.toml
|
rust-version = "1.64"
|
||||||
authors = ["Georgios Konstantopoulos <me@gakonst.com>"]
|
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
readme = "README.md"
|
|
||||||
documentation = "https://docs.rs/ethers"
|
documentation = "https://docs.rs/ethers"
|
||||||
repository = "https://github.com/gakonst/ethers-rs"
|
repository = "https://github.com/gakonst/ethers-rs"
|
||||||
homepage = "https://docs.rs/ethers"
|
homepage = "https://github.com/gakonst/ethers-rs"
|
||||||
description = "A complete Ethereum and Celo Rust library"
|
categories = ["cryptography::cryptocurrencies"]
|
||||||
|
keywords = ["crypto", "ethers", "ethereum", "web3", "celo"]
|
||||||
[workspace]
|
exclude = [
|
||||||
members = [
|
".github/",
|
||||||
"ethers-addressbook",
|
"bin/",
|
||||||
"ethers-contract",
|
"book/",
|
||||||
"ethers-providers",
|
"**/tests/",
|
||||||
"ethers-signers",
|
"**/test-data/",
|
||||||
"ethers-core",
|
"**/testdata/",
|
||||||
"ethers-middleware",
|
"examples",
|
||||||
"ethers-etherscan",
|
"scripts/",
|
||||||
"ethers-solc",
|
|
||||||
# Example crates
|
|
||||||
"examples/*",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
default-members = [
|
# https://docs.rs/about/metadata
|
||||||
"ethers-addressbook",
|
[workspace.metadata.docs.rs]
|
||||||
"ethers-contract",
|
|
||||||
"ethers-providers",
|
|
||||||
"ethers-signers",
|
|
||||||
"ethers-core",
|
|
||||||
"ethers-middleware",
|
|
||||||
"ethers-etherscan",
|
|
||||||
"ethers-solc",
|
|
||||||
]
|
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
|
||||||
all-features = true
|
all-features = true
|
||||||
rustc-args = ["--cfg", "docsrs"]
|
rustc-args = ["--cfg", "docsrs"]
|
||||||
rustdoc-args = ["--cfg", "docsrs"]
|
rustdoc-args = ["--cfg", "docsrs"]
|
||||||
|
|
||||||
[package.metadata.playground]
|
# https://github.com/integer32llc/rust-playground/blob/c6165a36923db5d99313e6056b5b610a2ede5bb0/top-crates/src/lib.rs#L175-L184
|
||||||
features = ["full"]
|
[workspace.metadata.playground]
|
||||||
|
all-features = true
|
||||||
|
|
||||||
[features]
|
[workspace]
|
||||||
default = ["abigen"]
|
members = [
|
||||||
|
"ethers",
|
||||||
|
"ethers-addressbook",
|
||||||
|
"ethers-contract",
|
||||||
|
"ethers-core",
|
||||||
|
"ethers-etherscan",
|
||||||
|
"ethers-middleware",
|
||||||
|
"ethers-providers",
|
||||||
|
"ethers-signers",
|
||||||
|
"ethers-solc",
|
||||||
|
|
||||||
celo = [
|
# Example crates
|
||||||
"ethers-core/celo",
|
"examples/*",
|
||||||
"ethers-providers/celo",
|
|
||||||
"ethers-signers/celo",
|
|
||||||
"ethers-contract/celo",
|
|
||||||
"ethers-middleware/celo",
|
|
||||||
"legacy",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
legacy = ["ethers-core/legacy", "ethers-contract/legacy"]
|
# Do not include example crates in default members
|
||||||
|
default-members = [
|
||||||
# individual features per sub-crate
|
"ethers",
|
||||||
## core
|
"ethers-addressbook",
|
||||||
eip712 = ["ethers-contract/eip712", "ethers-core/eip712"]
|
"ethers-contract",
|
||||||
## providers
|
"ethers-core",
|
||||||
ws = ["ethers-providers/ws"]
|
"ethers-etherscan",
|
||||||
ipc = ["ethers-providers/ipc"]
|
"ethers-middleware",
|
||||||
rustls = [
|
"ethers-providers",
|
||||||
"ethers-middleware/rustls",
|
"ethers-signers",
|
||||||
"ethers-providers/rustls",
|
"ethers-solc",
|
||||||
"ethers-etherscan/rustls",
|
|
||||||
"ethers-contract/rustls",
|
|
||||||
"ethers-solc/rustls",
|
|
||||||
]
|
]
|
||||||
openssl = [
|
|
||||||
"ethers-middleware/openssl",
|
|
||||||
"ethers-providers/openssl",
|
|
||||||
"ethers-etherscan/openssl",
|
|
||||||
"ethers-contract/openssl",
|
|
||||||
"ethers-solc/openssl",
|
|
||||||
]
|
|
||||||
dev-rpc = ["ethers-providers/dev-rpc"]
|
|
||||||
## signers
|
|
||||||
ledger = ["ethers-signers/ledger"]
|
|
||||||
trezor = ["ethers-signers/trezor"]
|
|
||||||
yubi = ["ethers-signers/yubi"]
|
|
||||||
## contracts
|
|
||||||
abigen = ["ethers-contract/abigen"]
|
|
||||||
### abigen without reqwest
|
|
||||||
abigen-offline = ["ethers-contract/abigen-offline"]
|
|
||||||
## solc
|
|
||||||
ethers-solc = ["dep:ethers-solc", "ethers-etherscan/ethers-solc"]
|
|
||||||
solc-full = ["ethers-solc", "ethers-solc/full"]
|
|
||||||
solc-tests = ["ethers-solc", "ethers-solc/tests"]
|
|
||||||
solc-sha2-asm = ["ethers-solc", "ethers-solc/asm"]
|
|
||||||
|
|
||||||
[dependencies]
|
[workspace.dependencies]
|
||||||
ethers-addressbook = { version = "^2.0.0", default-features = false, path = "./ethers-addressbook" }
|
# workspace crates
|
||||||
ethers-contract = { version = "^2.0.0", default-features = false, path = "./ethers-contract" }
|
ethers = { version = "2.0.0", path = "ethers", default-features = false }
|
||||||
ethers-core = { version = "^2.0.0", default-features = false, path = "./ethers-core" }
|
ethers-addressbook = { version = "2.0.0", path = "ethers-addressbook", default-features = false }
|
||||||
ethers-providers = { version = "^2.0.0", default-features = false, path = "./ethers-providers" }
|
ethers-contract = { version = "2.0.0", path = "ethers-contract", default-features = false }
|
||||||
ethers-signers = { version = "^2.0.0", default-features = false, path = "./ethers-signers" }
|
ethers-core = { version = "2.0.0", path = "ethers-core", default-features = false }
|
||||||
ethers-middleware = { version = "^2.0.0", default-features = false, path = "./ethers-middleware" }
|
ethers-etherscan = { version = "2.0.0", path = "ethers-etherscan", default-features = false }
|
||||||
ethers-solc = { version = "^2.0.0", default-features = false, path = "./ethers-solc", optional = true }
|
ethers-middleware = { version = "2.0.0", path = "ethers-middleware", default-features = false }
|
||||||
ethers-etherscan = { version = "^2.0.0", default-features = false, path = "./ethers-etherscan" }
|
ethers-providers = { version = "2.0.0", path = "ethers-providers", default-features = false }
|
||||||
|
ethers-signers = { version = "2.0.0", path = "ethers-signers", default-features = false }
|
||||||
|
ethers-solc = { version = "2.0.0", path = "ethers-solc", default-features = false }
|
||||||
|
|
||||||
[dev-dependencies]
|
ethers-contract-abigen = { version = "2.0.0", path = "ethers-contract/ethers-contract-abigen", default-features = false }
|
||||||
ethers-contract = { version = "^2.0.0", default-features = false, path = "./ethers-contract", features = [
|
ethers-contract-derive = { version = "2.0.0", path = "ethers-contract/ethers-contract-derive", default-features = false }
|
||||||
"abigen",
|
ethers-derive-eip712 = { version = "2.0.0", path = "ethers-core/ethers-derive-eip712", default-features = false }
|
||||||
"eip712",
|
|
||||||
] }
|
|
||||||
ethers-providers = { version = "^2.0.0", default-features = false, path = "./ethers-providers", features = [
|
|
||||||
"ws",
|
|
||||||
"ipc",
|
|
||||||
] }
|
|
||||||
|
|
||||||
bytes = "1.4.0"
|
# async / async utils
|
||||||
|
tokio = "1.26"
|
||||||
|
tokio-tungstenite = { version = "0.18.0", default-features = false }
|
||||||
|
futures = { version = "0.3.27", default-features = false }
|
||||||
|
futures-core = { version = "0.3.27", default-features = false }
|
||||||
|
futures-util = { version = "0.3.27", default-features = false }
|
||||||
|
futures-executor = { version = "0.3.27", default-features = false }
|
||||||
|
futures-channel = { version = "0.3.27", default-features = false }
|
||||||
|
futures-locks = { version = "0.7.1", default-features = false }
|
||||||
|
futures-timer = { version = "3.0.2", default-features = false, features = ["wasm-bindgen"] }
|
||||||
|
pin-project = "1.0"
|
||||||
|
reqwest = { version = "0.11.14", default-features = false }
|
||||||
|
url = { version = "2.3", default-features = false }
|
||||||
|
|
||||||
|
# crypto
|
||||||
|
elliptic-curve = { version = "0.13.2", default-features = false }
|
||||||
|
generic-array = { version = "0.14.6", default-features = false }
|
||||||
|
k256 = { version = "0.13.0", default-features = false, features = ["ecdsa", "std"] }
|
||||||
|
sha2 = { version = "0.10.6", default-features = false }
|
||||||
|
tiny-keccak = { version = "2.0.2", default-features = false }
|
||||||
|
spki = { version = "0.7.0", default-features = false }
|
||||||
|
|
||||||
|
# serde
|
||||||
|
serde = "1.0"
|
||||||
|
serde_json = "1.0"
|
||||||
|
|
||||||
|
# macros
|
||||||
|
proc-macro2 = "1.0"
|
||||||
|
quote = "1.0"
|
||||||
|
syn = "1.0"
|
||||||
|
async-trait = "0.1.66"
|
||||||
|
auto_impl = "1.0"
|
||||||
|
|
||||||
|
# misc
|
||||||
|
thiserror = "1.0"
|
||||||
|
once_cell = "1.17"
|
||||||
|
hex = "0.4"
|
||||||
eyre = "0.6"
|
eyre = "0.6"
|
||||||
hex = "0.4.3"
|
tempfile = "3.4"
|
||||||
rand = "0.8.5"
|
dunce = "1.0"
|
||||||
serde = { version = "1.0.124", features = ["derive"] }
|
walkdir = "2.3"
|
||||||
serde_json = "1.0.64"
|
regex = "1.7"
|
||||||
tempfile = "3.3.0"
|
toml = "0.7"
|
||||||
tokio = { version = "1.18", features = ["macros", "rt-multi-thread"] }
|
hex-literal = "0.3"
|
||||||
|
rand = "0.8"
|
||||||
|
bytes = "1.4"
|
||||||
|
semver = "1.0"
|
||||||
|
criterion = "0.4"
|
||||||
|
rayon = "1.7"
|
||||||
|
|
||||||
# profile for the wasm example
|
# tracing
|
||||||
[profile.release.package.ethers-wasm]
|
tracing = "0.1.37"
|
||||||
# Tell `rustc` to optimize for small code size.
|
tracing-subscriber = { version = "0.3.16", default-features = false }
|
||||||
opt-level = "s"
|
tracing-futures = "0.2.5"
|
||||||
|
|
||||||
|
# wasm
|
||||||
|
getrandom = { version = "0.2", features = ["js"] }
|
||||||
|
instant = "0.1.12"
|
||||||
|
|
|
@ -1,18 +1,31 @@
|
||||||
[package]
|
[package]
|
||||||
name = "ethers-addressbook"
|
name = "ethers-addressbook"
|
||||||
version = "2.0.0"
|
authors = ["Rohit Narurkar <rohit.narurkar@protonmail.com>"]
|
||||||
edition = "2021"
|
readme = "README.md"
|
||||||
rust-version = "1.64"
|
|
||||||
authors = ["Georgios Konstantopoulos <me@gakonst.com>"]
|
|
||||||
license = "MIT OR Apache-2.0"
|
|
||||||
description = "Common Ethereum name to address mappings"
|
description = "Common Ethereum name to address mappings"
|
||||||
homepage = "https://docs.rs/ethers"
|
|
||||||
repository = "https://github.com/gakonst/ethers-rs"
|
version.workspace = true
|
||||||
keywords = ["ethereum", "web3", "celo", "ethers"]
|
edition.workspace = true
|
||||||
|
rust-version.workspace = true
|
||||||
|
license.workspace = true
|
||||||
|
documentation.workspace = true
|
||||||
|
repository.workspace = true
|
||||||
|
homepage.workspace = true
|
||||||
|
categories.workspace = true
|
||||||
|
keywords.workspace = true
|
||||||
|
exclude.workspace = true
|
||||||
|
|
||||||
|
[package.metadata.docs.rs]
|
||||||
|
all-features = true
|
||||||
|
rustc-args = ["--cfg", "docsrs"]
|
||||||
|
rustdoc-args = ["--cfg", "docsrs"]
|
||||||
|
|
||||||
|
[package.metadata.playground]
|
||||||
|
all-features = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
ethers-core = { version = "^2.0.0", path = "../ethers-core", default-features = false }
|
ethers-core.workspace = true
|
||||||
|
|
||||||
once_cell = "1.17.1"
|
once_cell.workspace = true
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde.workspace = true
|
||||||
serde_json = "1.0"
|
serde_json.workspace = true
|
||||||
|
|
|
@ -1,45 +1,53 @@
|
||||||
[package]
|
[package]
|
||||||
name = "ethers-contract"
|
name = "ethers-contract"
|
||||||
version = "2.0.0"
|
|
||||||
edition = "2021"
|
|
||||||
rust-version = "1.64"
|
|
||||||
authors = ["Georgios Konstantopoulos <me@gakonst.com>"]
|
authors = ["Georgios Konstantopoulos <me@gakonst.com>"]
|
||||||
license = "MIT OR Apache-2.0"
|
readme = "README.md"
|
||||||
description = "Smart contract bindings for the ethers-rs crate"
|
description = "Type-safe abstractions for interacting with Ethereum smart contracts"
|
||||||
homepage = "https://docs.rs/ethers"
|
|
||||||
repository = "https://github.com/gakonst/ethers-rs"
|
version.workspace = true
|
||||||
keywords = ["ethereum", "web3", "celo", "ethers"]
|
edition.workspace = true
|
||||||
|
rust-version.workspace = true
|
||||||
|
license.workspace = true
|
||||||
|
documentation.workspace = true
|
||||||
|
repository.workspace = true
|
||||||
|
homepage.workspace = true
|
||||||
|
categories.workspace = true
|
||||||
|
keywords.workspace = true
|
||||||
|
exclude.workspace = true
|
||||||
|
|
||||||
|
[package.metadata.docs.rs]
|
||||||
|
all-features = true
|
||||||
|
rustc-args = ["--cfg", "docsrs"]
|
||||||
|
rustdoc-args = ["--cfg", "docsrs"]
|
||||||
|
|
||||||
|
[package.metadata.playground]
|
||||||
|
all-features = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
ethers-providers = { version = "^2.0.0", path = "../ethers-providers", default-features = false }
|
ethers-providers.workspace = true
|
||||||
ethers-core = { version = "^2.0.0", path = "../ethers-core", default-features = false }
|
ethers-core.workspace = true
|
||||||
ethers-contract-abigen = { version = "^2.0.0", path = "ethers-contract-abigen", default-features = false, optional = true }
|
|
||||||
ethers-contract-derive = { version = "^2.0.0", path = "ethers-contract-derive", optional = true }
|
|
||||||
ethers-derive-eip712 = { version = "^2.0.0", path = "../ethers-core/ethers-derive-eip712", optional = true }
|
|
||||||
|
|
||||||
serde = { version = "1.0.124", default-features = false }
|
serde.workspace = true
|
||||||
serde_json = { version = "1.0.64", default-features = false }
|
serde_json.workspace = true
|
||||||
thiserror = { version = "1.0", default-features = false }
|
futures-util.workspace = true
|
||||||
once_cell = { version = "1.17.1" }
|
pin-project.workspace = true
|
||||||
pin-project = { version = "1.0.11", default-features = false }
|
thiserror.workspace = true
|
||||||
futures-util = { version = "^0.3" }
|
once_cell.workspace = true
|
||||||
hex = { version = "0.4.3", default-features = false, features = ["std"] }
|
hex.workspace = true
|
||||||
|
|
||||||
|
# abigen
|
||||||
|
ethers-contract-abigen = { workspace = true, optional = true }
|
||||||
|
ethers-contract-derive = { workspace = true, optional = true }
|
||||||
|
|
||||||
|
# eip712
|
||||||
|
ethers-derive-eip712 = { workspace = true, optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
ethers-providers = { version = "^2.0.0", path = "../ethers-providers", default-features = false, features = [
|
ethers-signers.workspace = true
|
||||||
"ws",
|
ethers-solc.workspace = true
|
||||||
] }
|
|
||||||
ethers-signers = { version = "^2.0.0", path = "../ethers-signers" }
|
|
||||||
ethers-contract-abigen = { version = "^2.0.0", path = "ethers-contract-abigen" }
|
|
||||||
ethers-contract-derive = { version = "^2.0.0", path = "ethers-contract-derive" }
|
|
||||||
ethers-core = { version = "^2.0.0", path = "../ethers-core", default-features = false, features = [
|
|
||||||
"eip712",
|
|
||||||
] }
|
|
||||||
ethers-derive-eip712 = { version = "^2.0.0", path = "../ethers-core/ethers-derive-eip712" }
|
|
||||||
ethers-solc = { version = "^2.0.0", path = "../ethers-solc", default-features = false }
|
|
||||||
|
|
||||||
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
|
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
|
||||||
tokio = { version = "1.18", default-features = false, features = ["macros"] }
|
tokio = { workspace = true, features = ["macros"] }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["abigen"]
|
default = ["abigen"]
|
||||||
|
@ -54,8 +62,3 @@ legacy = []
|
||||||
|
|
||||||
rustls = ["ethers-contract-abigen/rustls"]
|
rustls = ["ethers-contract-abigen/rustls"]
|
||||||
openssl = ["ethers-contract-abigen/openssl"]
|
openssl = ["ethers-contract-abigen/openssl"]
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
|
||||||
all-features = true
|
|
||||||
rustc-args = ["--cfg", "docsrs"]
|
|
||||||
rustdoc-args = ["--cfg", "docsrs"]
|
|
||||||
|
|
|
@ -1,59 +1,64 @@
|
||||||
[package]
|
[package]
|
||||||
name = "ethers-contract-abigen"
|
name = "ethers-contract-abigen"
|
||||||
version = "2.0.0"
|
|
||||||
edition = "2021"
|
|
||||||
rust-version = "1.64"
|
|
||||||
authors = [
|
authors = [
|
||||||
"Nicholas Rodrigues Lordello <nlordell@gmail.com>",
|
"Nicholas Rodrigues Lordello <nlordell@gmail.com>",
|
||||||
"Georgios Konstantopoulos <me@gakonst.com>",
|
"Georgios Konstantopoulos <me@gakonst.com>",
|
||||||
]
|
]
|
||||||
license = "MIT OR Apache-2.0"
|
readme = "README.md"
|
||||||
description = "Code generation for type-safe bindings to Ethereum smart contracts"
|
description = "Code generation for type-safe bindings to Ethereum smart contracts"
|
||||||
homepage = "https://docs.rs/ethers"
|
|
||||||
repository = "https://github.com/gakonst/ethers-rs"
|
|
||||||
keywords = ["ethereum", "web3", "celo", "ethers"]
|
|
||||||
|
|
||||||
[dependencies]
|
version.workspace = true
|
||||||
ethers-core = { version = "^2.0.0", path = "../../ethers-core", features = ["macros"] }
|
edition.workspace = true
|
||||||
ethers-etherscan = { version = "^2.0.0", path = "../../ethers-etherscan", default-features = false, optional = true }
|
rust-version.workspace = true
|
||||||
|
license.workspace = true
|
||||||
proc-macro2 = "1.0"
|
documentation.workspace = true
|
||||||
quote = "1.0"
|
repository.workspace = true
|
||||||
syn = { version = "1.0.12", default-features = false, features = ["full", "extra-traits"] }
|
homepage.workspace = true
|
||||||
prettyplease = "0.1.23"
|
categories.workspace = true
|
||||||
|
keywords.workspace = true
|
||||||
Inflector = "0.11"
|
|
||||||
serde_json = "1.0.61"
|
|
||||||
serde = { version = "1.0.124", features = ["derive"] }
|
|
||||||
hex = { version = "0.4.2", default-features = false, features = ["std"] }
|
|
||||||
cfg-if = "1.0.0"
|
|
||||||
dunce = "1.0.2"
|
|
||||||
walkdir = "2.3.2"
|
|
||||||
eyre = "0.6"
|
|
||||||
regex = "1.6.0"
|
|
||||||
toml = "0.5.9"
|
|
||||||
|
|
||||||
reqwest = { version = "0.11.3", default-features = false, features = ["blocking"], optional = true }
|
|
||||||
tokio = { version = "1.0", default-features = false, features = ["sync"], optional = true }
|
|
||||||
url = { version = "2.3.1", default-features = false, optional = true }
|
|
||||||
|
|
||||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
|
||||||
# NOTE: this enables wasm compatibility for getrandom indirectly
|
|
||||||
getrandom = { version = "0.2", features = ["js"] }
|
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
all-features = true
|
all-features = true
|
||||||
rustc-args = ["--cfg", "docsrs"]
|
rustc-args = ["--cfg", "docsrs"]
|
||||||
rustdoc-args = ["--cfg", "docsrs"]
|
rustdoc-args = ["--cfg", "docsrs"]
|
||||||
|
|
||||||
|
[package.metadata.playground]
|
||||||
|
all-features = true
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
ethers-core = { workspace = true, features = ["macros"] }
|
||||||
|
|
||||||
|
proc-macro2.workspace = true
|
||||||
|
quote.workspace = true
|
||||||
|
syn = { workspace = true, features = ["full"] }
|
||||||
|
prettyplease = "0.1.25"
|
||||||
|
|
||||||
|
Inflector = "0.11"
|
||||||
|
serde.workspace = true
|
||||||
|
serde_json.workspace = true
|
||||||
|
hex.workspace = true
|
||||||
|
dunce.workspace = true
|
||||||
|
walkdir.workspace = true
|
||||||
|
eyre.workspace = true
|
||||||
|
regex.workspace = true
|
||||||
|
toml.workspace = true
|
||||||
|
|
||||||
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||||
|
# online
|
||||||
|
ethers-etherscan = { workspace = true, optional = true }
|
||||||
|
reqwest = { workspace = true, features = ["blocking"], optional = true }
|
||||||
|
tokio = { workspace = true, optional = true }
|
||||||
|
url = { workspace = true, optional = true }
|
||||||
|
|
||||||
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||||
|
# NOTE: this enables wasm compatibility for getrandom indirectly
|
||||||
|
getrandom.workspace = true
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
online = ["reqwest", "ethers-etherscan", "url", "tokio"]
|
online = ["reqwest", "ethers-etherscan", "url", "tokio"]
|
||||||
openssl = ["online", "reqwest/native-tls", "ethers-etherscan/openssl"]
|
openssl = ["online", "reqwest/native-tls", "ethers-etherscan/openssl"]
|
||||||
rustls = ["online", "reqwest/rustls-tls", "ethers-etherscan/rustls"]
|
rustls = ["online", "reqwest/rustls-tls", "ethers-etherscan/rustls"]
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tempfile = "3.2.0"
|
tempfile.workspace = true
|
||||||
ethers-solc = { version = "^2.0.0", path = "../../ethers-solc", default-features = false, features = [
|
ethers-solc = { workspace = true, features = ["project-util", "svm-solc"] }
|
||||||
"project-util",
|
|
||||||
"svm-solc",
|
|
||||||
] }
|
|
||||||
|
|
|
@ -1 +1,7 @@
|
||||||
|
# ethers-contract-abigen
|
||||||
|
|
||||||
|
Code generation for type-safe bindings to Ethereum smart contracts.
|
||||||
|
|
||||||
This code generator was adapted from the original [ethcontract-rs repository by Gnosis](https://github.com/gnosis/ethcontract-rs/tree/master/generate).
|
This code generator was adapted from the original [ethcontract-rs repository by Gnosis](https://github.com/gnosis/ethcontract-rs/tree/master/generate).
|
||||||
|
|
||||||
|
For more information, please refer to the [book](https://gakonst.com/ethers-rs).
|
||||||
|
|
|
@ -1,32 +1,31 @@
|
||||||
[package]
|
[package]
|
||||||
name = "ethers-contract-derive"
|
name = "ethers-contract-derive"
|
||||||
version = "2.0.0"
|
|
||||||
edition = "2021"
|
|
||||||
rust-version = "1.64"
|
|
||||||
authors = [
|
authors = [
|
||||||
"Nicholas Rodrigues Lordello <nlordell@gmail.com>",
|
"Nicholas Rodrigues Lordello <nlordell@gmail.com>",
|
||||||
"Georgios Konstantopoulos <me@gakonst.com>",
|
"Georgios Konstantopoulos <me@gakonst.com>",
|
||||||
]
|
]
|
||||||
license = "MIT OR Apache-2.0"
|
readme = "README.md"
|
||||||
description = "Proc macro for type-safe bindings generation to Ethereum and Celo smart contracts"
|
description = "Proc macros for type-safe bindings generation to Ethereum smart contracts"
|
||||||
homepage = "https://docs.rs/ethers"
|
|
||||||
repository = "https://github.com/gakonst/ethers-rs"
|
version.workspace = true
|
||||||
keywords = ["ethereum", "web3", "celo", "ethers"]
|
edition.workspace = true
|
||||||
|
rust-version.workspace = true
|
||||||
|
license.workspace = true
|
||||||
|
documentation.workspace = true
|
||||||
|
repository.workspace = true
|
||||||
|
homepage.workspace = true
|
||||||
|
categories.workspace = true
|
||||||
|
keywords.workspace = true
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
proc-macro = true
|
proc-macro = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
ethers-core = { version = "^2.0.0", path = "../../ethers-core" }
|
ethers-core.workspace = true
|
||||||
ethers-contract-abigen = { version = "^2.0.0", path = "../ethers-contract-abigen", default-features = false }
|
ethers-contract-abigen.workspace = true
|
||||||
|
|
||||||
proc-macro2 = "1.0"
|
proc-macro2.workspace = true
|
||||||
quote = "1.0"
|
quote.workspace = true
|
||||||
syn = "1.0.12"
|
syn.workspace = true
|
||||||
|
|
||||||
hex = { version = "0.4.3", default-features = false, features = ["std"] }
|
hex.workspace = true
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
|
||||||
all-features = true
|
|
||||||
rustc-args = ["--cfg", "docsrs"]
|
|
||||||
rustdoc-args = ["--cfg", "docsrs"]
|
|
||||||
|
|
|
@ -1 +1,7 @@
|
||||||
This proc-macro was adapted from the original [ethcontract-rs repository by Gnosis](https://github.com/gnosis/ethcontract-rs/tree/master/derive).
|
# ethers-contract-derive
|
||||||
|
|
||||||
|
Proc macros for type-safe bindings generation to Ethereum smart contracts.
|
||||||
|
|
||||||
|
Adapted from the original [ethcontract-rs repository by Gnosis](https://github.com/gnosis/ethcontract-rs/tree/master/derive).
|
||||||
|
|
||||||
|
For more information, please refer to the [book](https://gakonst.com/ethers-rs).
|
||||||
|
|
|
@ -275,7 +275,7 @@ where
|
||||||
/// Broadcasts the contract deployment transaction and after waiting for it to
|
/// Broadcasts the contract deployment transaction and after waiting for it to
|
||||||
/// be sufficiently confirmed (default: 1), it returns a tuple with
|
/// be sufficiently confirmed (default: 1), it returns a tuple with
|
||||||
/// the [`Contract`](crate::Contract) struct at the deployed contract's address
|
/// the [`Contract`](crate::Contract) struct at the deployed contract's address
|
||||||
/// and the corresponding [`TransactionReceipt`](ethers_core::types::TransactionReceipt).
|
/// and the corresponding [`TransactionReceipt`].
|
||||||
pub async fn send_with_receipt(
|
pub async fn send_with_receipt(
|
||||||
self,
|
self,
|
||||||
) -> Result<(ContractInstance<B, M>, TransactionReceipt), ContractError<M>> {
|
) -> Result<(ContractInstance<B, M>, TransactionReceipt), ContractError<M>> {
|
||||||
|
@ -290,11 +290,12 @@ where
|
||||||
let receipt = pending_tx
|
let receipt = pending_tx
|
||||||
.confirmations(self.confs)
|
.confirmations(self.confs)
|
||||||
.await
|
.await
|
||||||
.map_err(|_| ContractError::ContractNotDeployed)?
|
.ok()
|
||||||
|
.flatten()
|
||||||
.ok_or(ContractError::ContractNotDeployed)?;
|
.ok_or(ContractError::ContractNotDeployed)?;
|
||||||
let address = receipt.contract_address.ok_or(ContractError::ContractNotDeployed)?;
|
let address = receipt.contract_address.ok_or(ContractError::ContractNotDeployed)?;
|
||||||
|
|
||||||
let contract = ContractInstance::new(address, self.abi.clone(), self.client.clone());
|
let contract = ContractInstance::new(address, self.abi, self.client);
|
||||||
Ok((contract, receipt))
|
Ok((contract, receipt))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,10 +11,9 @@ use ethers_core::{
|
||||||
},
|
},
|
||||||
utils::{keccak256, Anvil},
|
utils::{keccak256, Anvil},
|
||||||
};
|
};
|
||||||
use ethers_derive_eip712::*;
|
|
||||||
use ethers_providers::{Http, Middleware, MiddlewareError, Provider, StreamExt};
|
use ethers_providers::{Http, Middleware, MiddlewareError, Provider, StreamExt};
|
||||||
use ethers_signers::{LocalWallet, Signer};
|
use ethers_signers::{LocalWallet, Signer};
|
||||||
use std::{convert::TryFrom, iter::FromIterator, sync::Arc, time::Duration};
|
use std::{sync::Arc, time::Duration};
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct NonClone<M> {
|
pub struct NonClone<M> {
|
||||||
|
@ -787,7 +786,10 @@ async fn multicall_aggregate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
#[cfg(feature = "eip712")]
|
||||||
async fn test_derive_eip712() {
|
async fn test_derive_eip712() {
|
||||||
|
use ethers_derive_eip712::*;
|
||||||
|
|
||||||
// Generate Contract ABI Bindings
|
// Generate Contract ABI Bindings
|
||||||
abigen!(
|
abigen!(
|
||||||
DeriveEip712Test,
|
DeriveEip712Test,
|
||||||
|
|
|
@ -1,70 +1,77 @@
|
||||||
[package]
|
[package]
|
||||||
name = "ethers-core"
|
name = "ethers-core"
|
||||||
version = "2.0.0"
|
|
||||||
edition = "2021"
|
|
||||||
rust-version = "1.64"
|
|
||||||
authors = ["Georgios Konstantopoulos <me@gakonst.com>"]
|
authors = ["Georgios Konstantopoulos <me@gakonst.com>"]
|
||||||
license = "MIT OR Apache-2.0"
|
readme = "README.md"
|
||||||
description = "Core structures for the ethers-rs crate"
|
description = "Ethereum data types, cryptography and utilities"
|
||||||
homepage = "https://docs.rs/ethers"
|
|
||||||
repository = "https://github.com/gakonst/ethers-rs"
|
version.workspace = true
|
||||||
keywords = ["ethereum", "web3", "celo", "ethers"]
|
edition.workspace = true
|
||||||
|
rust-version.workspace = true
|
||||||
|
license.workspace = true
|
||||||
|
documentation.workspace = true
|
||||||
|
repository.workspace = true
|
||||||
|
homepage.workspace = true
|
||||||
|
categories.workspace = true
|
||||||
|
keywords.workspace = true
|
||||||
|
exclude.workspace = true
|
||||||
|
|
||||||
|
[package.metadata.docs.rs]
|
||||||
|
all-features = true
|
||||||
|
rustc-args = ["--cfg", "docsrs"]
|
||||||
|
rustdoc-args = ["--cfg", "docsrs"]
|
||||||
|
|
||||||
|
[package.metadata.playground]
|
||||||
|
all-features = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
# abi
|
||||||
open-fastrlp = { version = "0.1.4", features = ["std", "derive", "ethereum-types"] }
|
open-fastrlp = { version = "0.1.4", features = ["std", "derive", "ethereum-types"] }
|
||||||
rlp = { version = "0.5.2", default-features = false, features = ["std"] }
|
rlp = { version = "0.5", features = ["derive"] }
|
||||||
ethabi = { version = "18.0.0", default-features = false, features = ["full-serde", "rlp"] }
|
ethabi = { version = "18.0.0", default-features = false, features = ["full-serde", "rlp"] }
|
||||||
arrayvec = { version = "0.7.2", default-features = false }
|
arrayvec = { version = "0.7", default-features = false }
|
||||||
rlp-derive = { version = "0.1.0", default-features = false }
|
|
||||||
|
|
||||||
# crypto
|
# crypto
|
||||||
elliptic-curve = { version = "0.13.2", default-features = false }
|
elliptic-curve.workspace = true
|
||||||
generic-array = { version = "0.14.6", default-features = false }
|
generic-array.workspace = true
|
||||||
k256 = { version = "0.13.0", default-features = false, features = ["ecdsa", "std"] }
|
k256 = { workspace = true, features = ["ecdsa", "std"] }
|
||||||
rand = { version = "0.8.5", default-features = false }
|
tiny-keccak.workspace = true
|
||||||
tiny-keccak = { version = "2.0.2", default-features = false }
|
rand.workspace = true
|
||||||
|
|
||||||
# misc
|
# misc
|
||||||
chrono = { version = "0.4", default-features = false }
|
chrono = { version = "0.4", default-features = false }
|
||||||
serde = { version = "1.0.124", default-features = false, features = ["derive"] }
|
serde.workspace = true
|
||||||
serde_json = { version = "1.0.64", default-features = false, features = ["arbitrary_precision"] }
|
serde_json = { workspace = true, features = ["arbitrary_precision"] }
|
||||||
thiserror = { version = "1.0", default-features = false }
|
thiserror.workspace = true
|
||||||
bytes = { version = "1.4.0", features = ["serde"] }
|
bytes = { workspace = true, features = ["serde"] }
|
||||||
hex = { version = "0.4.3", default-features = false, features = ["std"] }
|
hex.workspace = true
|
||||||
once_cell = { version = "1.17.1", optional = true }
|
once_cell = { workspace = true, optional = true }
|
||||||
unicode-xid = "0.2.4"
|
unicode-xid = "0.2"
|
||||||
strum = { version = "0.24", features = ["derive"] }
|
strum = { version = "0.24", features = ["derive"] }
|
||||||
|
num_enum = "0.5"
|
||||||
|
|
||||||
# macros feature enabled dependencies
|
# macros feature enabled dependencies
|
||||||
cargo_metadata = { version = "0.15.3", optional = true }
|
cargo_metadata = { version = "0.15.3", optional = true }
|
||||||
|
|
||||||
# eip712 feature enabled dependencies
|
# eip712 feature enabled dependencies
|
||||||
convert_case = { version = "0.6.0", optional = true }
|
convert_case = { version = "0.6.0", optional = true }
|
||||||
syn = { version = "1.0.109", optional = true }
|
syn = { workspace = true, optional = true }
|
||||||
proc-macro2 = { version = "1.0.52", optional = true }
|
proc-macro2 = { workspace = true, optional = true }
|
||||||
num_enum = "0.5.11"
|
|
||||||
|
|
||||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||||
tempfile = { version = "3.4.0", default-features = false }
|
tempfile.workspace = true
|
||||||
|
|
||||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||||
# NOTE: this enables wasm compatibility for getrandom indirectly
|
# NOTE: this enables wasm compatibility for getrandom indirectly
|
||||||
getrandom = { version = "0.2", features = ["js"] }
|
getrandom.workspace = true
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
serde_json = { version = "1.0.64", default-features = false }
|
|
||||||
bincode = { version = "1.3.3", default-features = false }
|
bincode = { version = "1.3.3", default-features = false }
|
||||||
once_cell = { version = "1.17.1" }
|
once_cell.workspace = true
|
||||||
hex-literal = "0.3.4"
|
hex-literal.workspace = true
|
||||||
rand = "0.8.5"
|
rand.workspace = true
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
celo = ["legacy"] # celo support extends the transaction format with extra fields
|
celo = ["legacy"] # celo support extends the transaction format with extra fields
|
||||||
legacy = []
|
legacy = []
|
||||||
eip712 = ["convert_case", "syn", "proc-macro2"]
|
eip712 = ["convert_case", "syn", "proc-macro2"]
|
||||||
macros = ["syn", "cargo_metadata", "once_cell"]
|
macros = ["syn", "cargo_metadata", "once_cell"]
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
|
||||||
all-features = true
|
|
||||||
rustc-args = ["--cfg", "docsrs"]
|
|
||||||
rustdoc-args = ["--cfg", "docsrs"]
|
|
||||||
|
|
|
@ -1,23 +1,29 @@
|
||||||
[package]
|
[package]
|
||||||
name = "ethers-derive-eip712"
|
name = "ethers-derive-eip712"
|
||||||
version = "2.0.0"
|
authors = ["Ryan Tate <ryan.michael.tate@gmail.com>"]
|
||||||
edition = "2021"
|
description = "Derive procedural macro for EIP-712 typed data"
|
||||||
rust-version = "1.64"
|
|
||||||
description = "Custom derive macro for EIP-712 typed data"
|
version.workspace = true
|
||||||
license = "MIT OR Apache-2.0"
|
edition.workspace = true
|
||||||
|
rust-version.workspace = true
|
||||||
|
license.workspace = true
|
||||||
|
documentation.workspace = true
|
||||||
|
repository.workspace = true
|
||||||
|
homepage.workspace = true
|
||||||
|
categories.workspace = true
|
||||||
|
keywords.workspace = true
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
proc-macro = true
|
proc-macro = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
quote = "1.0.9"
|
ethers-core = { workspace = true, features = ["eip712", "macros"] }
|
||||||
syn = "1.0.77"
|
|
||||||
ethers-core = { version = "^2.0.0", path = "../", default-features = false, features = [
|
quote.workspace = true
|
||||||
"eip712",
|
syn.workspace = true
|
||||||
"macros",
|
|
||||||
] }
|
hex.workspace = true
|
||||||
hex = "0.4.3"
|
serde_json.workspace = true
|
||||||
serde_json = "1.0.68"
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
ethers-contract-derive = { version = "^2.0.0", path = "../../ethers-contract/ethers-contract-derive" }
|
ethers-contract-derive.workspace = true
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
//! # EIP-712 Derive Macro
|
//! # EIP-712 Derive Macro
|
||||||
|
//!
|
||||||
//! This crate provides a derive macro `Eip712` that is used to encode a rust struct
|
//! This crate provides a derive macro `Eip712` that is used to encode a rust struct
|
||||||
//! into a payload hash, according to [https://eips.ethereum.org/EIPS/eip-712](https://eips.ethereum.org/EIPS/eip-712)
|
//! into a payload hash, according to [https://eips.ethereum.org/EIPS/eip-712](https://eips.ethereum.org/EIPS/eip-712)
|
||||||
//!
|
//!
|
||||||
|
|
|
@ -564,13 +564,14 @@ mod tests {
|
||||||
String::with_capacity(150 * (ethers as usize + dependencies.len()));
|
String::with_capacity(150 * (ethers as usize + dependencies.len()));
|
||||||
|
|
||||||
if ethers {
|
if ethers {
|
||||||
let ethers = format!("ethers = {{ path = {ethers_root:?} }}\n");
|
let path = ethers_root.join("ethers");
|
||||||
|
let ethers = format!("ethers = {{ path = \"{}\" }}\n", path.display());
|
||||||
dependencies_toml.push_str(ðers);
|
dependencies_toml.push_str(ðers);
|
||||||
}
|
}
|
||||||
|
|
||||||
for dep in dependencies.iter() {
|
for dep in dependencies.iter() {
|
||||||
let path = ethers_root.join(dep.fs_path());
|
let path = ethers_root.join(dep.fs_path());
|
||||||
let dep = format!("{dep} = {{ path = {path:?} }}\n");
|
let dep = format!("{dep} = {{ path = \"{}\" }}\n", path.display());
|
||||||
dependencies_toml.push_str(&dep);
|
dependencies_toml.push_str(&dep);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,9 @@ use open_fastrlp::{
|
||||||
RlpDecodable as FastRlpDecodable, RlpDecodableWrapper as FastRlpDecodableWrapper,
|
RlpDecodable as FastRlpDecodable, RlpDecodableWrapper as FastRlpDecodableWrapper,
|
||||||
RlpEncodable as FastRlpEncodable, RlpEncodableWrapper as FastRlpEncodableWrapper,
|
RlpEncodable as FastRlpEncodable, RlpEncodableWrapper as FastRlpEncodableWrapper,
|
||||||
};
|
};
|
||||||
use rlp::{Decodable, RlpStream};
|
use rlp::{
|
||||||
use rlp_derive::{RlpDecodable, RlpDecodableWrapper, RlpEncodable, RlpEncodableWrapper};
|
Decodable, RlpDecodable, RlpDecodableWrapper, RlpEncodable, RlpEncodableWrapper, RlpStream,
|
||||||
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
|
|
|
@ -1,50 +1,55 @@
|
||||||
[package]
|
[package]
|
||||||
name = "ethers-etherscan"
|
name = "ethers-etherscan"
|
||||||
version = "2.0.0"
|
|
||||||
edition = "2021"
|
|
||||||
rust-version = "1.64"
|
|
||||||
authors = [
|
authors = [
|
||||||
"Matthias Seitz <matthias.seitz@outlook.de>",
|
"Matthias Seitz <matthias.seitz@outlook.de>",
|
||||||
"Georgios Konstantopoulos <me@gakonst.com>",
|
"Georgios Konstantopoulos <me@gakonst.com>",
|
||||||
]
|
]
|
||||||
license = "MIT OR Apache-2.0"
|
readme = "README.md"
|
||||||
readme = "../README.md"
|
description = "Bindings for the etherscan.io web API"
|
||||||
documentation = "https://docs.rs/ethers"
|
keywords = ["crypto", "ethers", "ethereum", "web3", "etherscan"]
|
||||||
repository = "https://github.com/gakonst/ethers-rs"
|
|
||||||
homepage = "https://docs.rs/ethers"
|
|
||||||
description = """
|
|
||||||
Rust API bindings for the etherscan.io web API
|
|
||||||
"""
|
|
||||||
keywords = ["ethereum", "web3", "etherscan", "ethers"]
|
|
||||||
|
|
||||||
[dependencies]
|
version.workspace = true
|
||||||
ethers-core = { version = "^2.0.0", path = "../ethers-core", default-features = false }
|
edition.workspace = true
|
||||||
ethers-solc = { version = "^2.0.0", path = "../ethers-solc", default-features = false, optional = true }
|
rust-version.workspace = true
|
||||||
reqwest = { version = "0.11.14", default-features = false, features = ["json"] }
|
license.workspace = true
|
||||||
serde = { version = "1.0.124", default-features = false, features = ["derive"] }
|
documentation.workspace = true
|
||||||
serde_json = { version = "1.0.64", default-features = false }
|
repository.workspace = true
|
||||||
serde-aux = { version = "4.1.2", default-features = false }
|
homepage.workspace = true
|
||||||
thiserror = "1.0"
|
categories.workspace = true
|
||||||
tracing = "0.1.37"
|
exclude.workspace = true
|
||||||
semver = "1.0.17"
|
|
||||||
|
|
||||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
|
||||||
# NOTE: this enables wasm compatibility for getrandom indirectly
|
|
||||||
getrandom = { version = "0.2", features = ["js"] }
|
|
||||||
|
|
||||||
[dev-dependencies]
|
|
||||||
ethers-solc = { version = "^2.0.0", path = "../ethers-solc", default-features = false }
|
|
||||||
|
|
||||||
tempfile = "3.4.0"
|
|
||||||
tokio = { version = "1.18", features = ["macros", "rt-multi-thread", "time"] }
|
|
||||||
serial_test = "1.0.0"
|
|
||||||
tracing-subscriber = { version = "0.3", default-features = false, features = ["env-filter", "fmt"] }
|
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
all-features = true
|
all-features = true
|
||||||
rustc-args = ["--cfg", "docsrs"]
|
rustc-args = ["--cfg", "docsrs"]
|
||||||
rustdoc-args = ["--cfg", "docsrs"]
|
rustdoc-args = ["--cfg", "docsrs"]
|
||||||
|
|
||||||
|
[package.metadata.playground]
|
||||||
|
all-features = true
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
ethers-core.workspace = true
|
||||||
|
|
||||||
|
ethers-solc = { workspace = true, optional = true }
|
||||||
|
|
||||||
|
reqwest = { workspace = true, features = ["json"] }
|
||||||
|
serde = { workspace = true, features = ["derive"] }
|
||||||
|
serde_json.workspace = true
|
||||||
|
thiserror.workspace = true
|
||||||
|
tracing.workspace = true
|
||||||
|
semver.workspace = true
|
||||||
|
|
||||||
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||||
|
# NOTE: this enables wasm compatibility for getrandom indirectly
|
||||||
|
getrandom.workspace = true
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
ethers-solc.workspace = true
|
||||||
|
|
||||||
|
tempfile.workspace = true
|
||||||
|
tokio = { workspace = true, features = ["macros", "rt-multi-thread", "time"] }
|
||||||
|
serial_test = "1.0.0"
|
||||||
|
tracing-subscriber = { workspace = true, features = ["env-filter", "fmt"] }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["rustls"]
|
default = ["rustls"]
|
||||||
openssl = ["reqwest/native-tls"]
|
openssl = ["reqwest/native-tls"]
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
use std::{collections::HashMap, str::FromStr};
|
|
||||||
|
|
||||||
use serde::{de, Deserialize};
|
|
||||||
use serde_aux::prelude::*;
|
|
||||||
|
|
||||||
use ethers_core::types::U256;
|
|
||||||
|
|
||||||
use crate::{Client, EtherscanError, Response, Result};
|
use crate::{Client, EtherscanError, Response, Result};
|
||||||
|
use ethers_core::types::U256;
|
||||||
|
use serde::{de, Deserialize, Deserializer};
|
||||||
|
use std::{collections::HashMap, str::FromStr};
|
||||||
|
|
||||||
#[derive(Deserialize, Clone, Debug)]
|
#[derive(Deserialize, Clone, Debug)]
|
||||||
#[serde(rename_all = "PascalCase")]
|
#[serde(rename_all = "PascalCase")]
|
||||||
|
@ -26,6 +22,25 @@ pub struct GasOracle {
|
||||||
pub gas_used_ratio: Vec<f64>,
|
pub gas_used_ratio: Vec<f64>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn deserialize_number_from_string<'de, T, D>(deserializer: D) -> Result<T, D::Error>
|
||||||
|
where
|
||||||
|
D: Deserializer<'de>,
|
||||||
|
T: FromStr + serde::Deserialize<'de>,
|
||||||
|
<T as FromStr>::Err: std::fmt::Display,
|
||||||
|
{
|
||||||
|
#[derive(Deserialize)]
|
||||||
|
#[serde(untagged)]
|
||||||
|
enum StringOrInt<T> {
|
||||||
|
String(String),
|
||||||
|
Number(T),
|
||||||
|
}
|
||||||
|
|
||||||
|
match StringOrInt::<T>::deserialize(deserializer)? {
|
||||||
|
StringOrInt::String(s) => s.parse::<T>().map_err(serde::de::Error::custom),
|
||||||
|
StringOrInt::Number(i) => Ok(i),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn deserialize_f64_vec<'de, D>(deserializer: D) -> core::result::Result<Vec<f64>, D::Error>
|
fn deserialize_f64_vec<'de, D>(deserializer: D) -> core::result::Result<Vec<f64>, D::Error>
|
||||||
where
|
where
|
||||||
D: de::Deserializer<'de>,
|
D: de::Deserializer<'de>,
|
||||||
|
|
|
@ -27,7 +27,7 @@ pub mod transaction;
|
||||||
pub mod utils;
|
pub mod utils;
|
||||||
pub mod verify;
|
pub mod verify;
|
||||||
|
|
||||||
pub(crate) type Result<T> = std::result::Result<T, EtherscanError>;
|
pub(crate) type Result<T, E = EtherscanError> = std::result::Result<T, E>;
|
||||||
|
|
||||||
/// The Etherscan.io API client.
|
/// The Etherscan.io API client.
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
|
|
|
@ -4,7 +4,7 @@ use ethers_etherscan::contract::SourceCodeMetadata;
|
||||||
use serial_test::serial;
|
use serial_test::serial;
|
||||||
|
|
||||||
/// Abi of [0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413](https://api.etherscan.io/api?module=contract&action=getsourcecode&address=0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413).
|
/// Abi of [0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413](https://api.etherscan.io/api?module=contract&action=getsourcecode&address=0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413).
|
||||||
const DAO_ABI: &str = include!("../../../tests/testdata/the_dao_abi.expr");
|
const DAO_ABI: &str = include!("../../../testdata/the_dao_abi.expr");
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
#[serial]
|
#[serial]
|
||||||
|
|
|
@ -1,62 +1,65 @@
|
||||||
[package]
|
[package]
|
||||||
name = "ethers-middleware"
|
name = "ethers-middleware"
|
||||||
version = "2.0.0"
|
|
||||||
edition = "2021"
|
|
||||||
rust-version = "1.64"
|
|
||||||
authors = ["Georgios Konstantopoulos <me@gakonst.com>"]
|
authors = ["Georgios Konstantopoulos <me@gakonst.com>"]
|
||||||
license = "MIT OR Apache-2.0"
|
readme = "README.md"
|
||||||
description = "Middleware implementations for the ethers-rs crate"
|
description = "Middleware implementations for the ethers-rs crate"
|
||||||
homepage = "https://docs.rs/ethers"
|
|
||||||
repository = "https://github.com/gakonst/ethers-rs"
|
version.workspace = true
|
||||||
keywords = ["ethereum", "web3", "celo", "ethers"]
|
edition.workspace = true
|
||||||
|
rust-version.workspace = true
|
||||||
|
license.workspace = true
|
||||||
|
documentation.workspace = true
|
||||||
|
repository.workspace = true
|
||||||
|
homepage.workspace = true
|
||||||
|
categories.workspace = true
|
||||||
|
keywords.workspace = true
|
||||||
|
exclude.workspace = true
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
all-features = true
|
all-features = true
|
||||||
rustc-args = ["--cfg", "docsrs"]
|
rustc-args = ["--cfg", "docsrs"]
|
||||||
rustdoc-args = ["--cfg", "docsrs"]
|
rustdoc-args = ["--cfg", "docsrs"]
|
||||||
|
|
||||||
[dependencies]
|
[package.metadata.playground]
|
||||||
ethers-contract = { version = "^2.0.0", path = "../ethers-contract", default-features = false, features = [
|
all-features = true
|
||||||
"abigen",
|
|
||||||
] }
|
|
||||||
ethers-core = { version = "^2.0.0", path = "../ethers-core", default-features = false }
|
|
||||||
ethers-etherscan = { version = "^2.0.0", path = "../ethers-etherscan", default-features = false }
|
|
||||||
ethers-providers = { version = "^2.0.0", path = "../ethers-providers", default-features = false }
|
|
||||||
ethers-signers = { version = "^2.0.0", path = "../ethers-signers", default-features = false }
|
|
||||||
|
|
||||||
async-trait = { version = "0.1.50", default-features = false }
|
[dependencies]
|
||||||
auto_impl = { version = "1.0.1", default-features = false }
|
ethers-contract = { workspace = true, features = ["abigen"] }
|
||||||
serde = { version = "1.0.124", default-features = false, features = ["derive"] }
|
ethers-core.workspace = true
|
||||||
thiserror = { version = "1.0", default-features = false }
|
ethers-etherscan.workspace = true
|
||||||
futures-util = { version = "^0.3" }
|
ethers-providers.workspace = true
|
||||||
futures-locks = { version = "0.7", default-features = false }
|
ethers-signers.workspace = true
|
||||||
tracing = { version = "0.1.37", default-features = false }
|
|
||||||
tracing-futures = { version = "0.2.5", default-features = false }
|
async-trait.workspace = true
|
||||||
|
auto_impl.workspace = true
|
||||||
|
serde.workspace = true
|
||||||
|
thiserror.workspace = true
|
||||||
|
futures-util.workspace = true
|
||||||
|
futures-locks.workspace = true
|
||||||
|
tracing.workspace = true
|
||||||
|
tracing-futures.workspace = true
|
||||||
|
instant.workspace = true
|
||||||
|
|
||||||
# for gas oracles
|
# for gas oracles
|
||||||
reqwest = { version = "0.11.14", default-features = false, features = ["json", "rustls-tls"] }
|
reqwest.workspace = true
|
||||||
url = { version = "2.3.1", default-features = false }
|
url.workspace = true
|
||||||
|
|
||||||
serde_json = { version = "1.0.64", default-features = false }
|
serde_json.workspace = true
|
||||||
instant = { version = "0.1.12", features = ["now"] }
|
|
||||||
|
|
||||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||||
tokio = { version = "1.18" }
|
tokio.workspace = true
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
ethers-providers = { version = "^2.0.0", path = "../ethers-providers", default-features = false, features = [
|
ethers-providers = { workspace = true, features = ["ws", "rustls"] }
|
||||||
"ws",
|
ethers-solc.workspace = true
|
||||||
"rustls",
|
|
||||||
] }
|
|
||||||
ethers-solc = { version = "^2.0.0", path = "../ethers-solc" }
|
|
||||||
|
|
||||||
hex = { version = "0.4.3", default-features = false, features = ["std"] }
|
hex.workspace = true
|
||||||
rand = { version = "0.8.5", default-features = false }
|
rand.workspace = true
|
||||||
once_cell = "1.17.1"
|
once_cell.workspace = true
|
||||||
reqwest = { version = "0.11.14", default-features = false, features = ["json", "rustls"] }
|
reqwest = { workspace = true, features = ["json", "rustls"] }
|
||||||
|
|
||||||
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
|
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
|
||||||
tokio = { version = "1.18", default-features = false, features = ["rt", "macros", "time"] }
|
tokio = { workspace = true, features = ["rt", "macros", "time"] }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["rustls"]
|
default = ["rustls"]
|
||||||
|
|
|
@ -2,11 +2,8 @@ use super::{GasOracle, Result};
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use ethers_core::types::U256;
|
use ethers_core::types::U256;
|
||||||
use futures_locks::RwLock;
|
use futures_locks::RwLock;
|
||||||
use std::{
|
use instant::{Duration, Instant};
|
||||||
fmt::Debug,
|
use std::{fmt::Debug, future::Future};
|
||||||
future::Future,
|
|
||||||
time::{Duration, Instant},
|
|
||||||
};
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Cache<T: GasOracle> {
|
pub struct Cache<T: GasOracle> {
|
||||||
|
|
|
@ -12,7 +12,7 @@ use std::sync::Arc;
|
||||||
|
|
||||||
type HttpWallet = SignerMiddleware<Provider<Http>, LocalWallet>;
|
type HttpWallet = SignerMiddleware<Provider<Http>, LocalWallet>;
|
||||||
|
|
||||||
abigen!(SimpleStorage, "../tests/testdata/SimpleStorage.json");
|
abigen!(SimpleStorage, "../testdata/SimpleStorage.json");
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
#[ignore]
|
#[ignore]
|
||||||
|
|
|
@ -1,75 +1,80 @@
|
||||||
[package]
|
[package]
|
||||||
name = "ethers-providers"
|
name = "ethers-providers"
|
||||||
version = "2.0.0"
|
|
||||||
edition = "2021"
|
|
||||||
rust-version = "1.64"
|
|
||||||
authors = ["Georgios Konstantopoulos <me@gakonst.com>"]
|
authors = ["Georgios Konstantopoulos <me@gakonst.com>"]
|
||||||
license = "MIT OR Apache-2.0"
|
readme = "README.md"
|
||||||
description = "Provider implementations for the ethers-rs crate"
|
description = "Clients for interacting with Ethereum nodes"
|
||||||
homepage = "https://docs.rs/ethers"
|
|
||||||
repository = "https://github.com/gakonst/ethers-rs"
|
version.workspace = true
|
||||||
keywords = ["ethereum", "web3", "celo", "ethers"]
|
edition.workspace = true
|
||||||
|
rust-version.workspace = true
|
||||||
|
license.workspace = true
|
||||||
|
documentation.workspace = true
|
||||||
|
repository.workspace = true
|
||||||
|
homepage.workspace = true
|
||||||
|
categories.workspace = true
|
||||||
|
keywords.workspace = true
|
||||||
|
exclude.workspace = true
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
all-features = true
|
all-features = true
|
||||||
rustc-args = ["--cfg", "docsrs"]
|
rustc-args = ["--cfg", "docsrs"]
|
||||||
rustdoc-args = ["--cfg", "docsrs"]
|
rustdoc-args = ["--cfg", "docsrs"]
|
||||||
|
|
||||||
[dependencies]
|
[package.metadata.playground]
|
||||||
ethers-core = { version = "^2.0.0", path = "../ethers-core", default-features = false }
|
all-features = true
|
||||||
|
|
||||||
async-trait = { version = "0.1.50", default-features = false }
|
[dependencies]
|
||||||
hex = { version = "0.4.3", default-features = false, features = ["std"] }
|
ethers-core.workspace = true
|
||||||
reqwest = { version = "0.11.14", default-features = false, features = ["json"] }
|
|
||||||
serde = { version = "1.0.124", default-features = false, features = ["derive"] }
|
serde.workspace = true
|
||||||
serde_json = { version = "1.0.64", default-features = false, features = ["raw_value"] }
|
serde_json = { workspace = true, features = ["raw_value"] }
|
||||||
thiserror = { version = "1.0", default-features = false }
|
|
||||||
url = { version = "2.3.1", default-features = false }
|
http = "0.2"
|
||||||
auto_impl = { version = "1.0.1", default-features = false }
|
reqwest = { workspace = true, features = ["json"] }
|
||||||
http = { version = "0.2" }
|
url.workspace = true
|
||||||
base64 = "0.21"
|
base64 = "0.21"
|
||||||
|
|
||||||
|
async-trait.workspace = true
|
||||||
|
hex.workspace = true
|
||||||
|
thiserror.workspace = true
|
||||||
|
auto_impl.workspace = true
|
||||||
|
once_cell.workspace = true
|
||||||
|
bytes.workspace = true
|
||||||
|
instant.workspace = true
|
||||||
|
hashers = "1.0"
|
||||||
|
|
||||||
# required for implementing stream on the filters
|
# required for implementing stream on the filters
|
||||||
futures-core = { version = "0.3.16", default-features = false }
|
futures-core.workspace = true
|
||||||
futures-util = { version = "^0.3" }
|
futures-util.workspace = true
|
||||||
futures-timer = { version = "3.0.2", default-features = false }
|
futures-timer.workspace = true
|
||||||
futures-channel = { version = "0.3.16", default-features = false, optional = true }
|
futures-channel = { workspace = true, optional = true }
|
||||||
pin-project = { version = "1.0.11", default-features = false }
|
pin-project.workspace = true
|
||||||
|
|
||||||
# peer-related admin namespace
|
# peer-related admin namespace
|
||||||
enr = { version = "0.8.0", default-features = false, features = ["k256", "serde"] }
|
enr = { version = "0.8.0", default-features = false, features = ["k256", "serde"] }
|
||||||
|
|
||||||
# tracing
|
# tracing
|
||||||
tracing = { version = "0.1.37", default-features = false, features = ["attributes"] }
|
tracing = { workspace = true, features = ["attributes"] }
|
||||||
tracing-futures = { version = "0.2.5", default-features = false, features = ["std-future"] }
|
tracing-futures = { workspace = true, features = ["std-future"] }
|
||||||
|
|
||||||
bytes = { version = "1.4.0", default-features = false, optional = true }
|
|
||||||
once_cell = "1.17.1"
|
|
||||||
hashers = "1.0.1"
|
|
||||||
|
|
||||||
[target.'cfg(target_family = "windows")'.dependencies]
|
[target.'cfg(target_family = "windows")'.dependencies]
|
||||||
winapi = { version = "0.3", optional = true }
|
winapi = { version = "0.3", optional = true }
|
||||||
|
|
||||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||||
# tokio
|
# tokio
|
||||||
tokio = { version = "1.18", default-features = false, features = ["time"] }
|
tokio = { workspace = true, features = ["time"] }
|
||||||
tokio-tungstenite = { version = "0.18.0", default-features = false, features = [
|
tokio-tungstenite = { workspace = true, features = ["connect"], optional = true }
|
||||||
"connect",
|
|
||||||
], optional = true }
|
|
||||||
|
|
||||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||||
ws_stream_wasm = "0.7"
|
ws_stream_wasm = "0.7"
|
||||||
wasm-bindgen = "0.2"
|
wasm-bindgen = "0.2"
|
||||||
wasm-bindgen-futures = "0.4"
|
wasm-bindgen-futures = "0.4"
|
||||||
web-sys = { version = "0.3", features = ["console"] }
|
web-sys = { version = "0.3", features = ["console"] }
|
||||||
wasm-timer = "0.2"
|
|
||||||
# this is currently necessary for `wasm-timer::Delay` to work
|
|
||||||
parking_lot = { version = "0.11", features = ["wasm-bindgen"] }
|
|
||||||
# NOTE: this enables wasm compatibility for getrandom indirectly
|
# NOTE: this enables wasm compatibility for getrandom indirectly
|
||||||
getrandom = { version = "0.2", features = ["js"] }
|
getrandom.workspace = true
|
||||||
|
|
||||||
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
|
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
|
||||||
tokio = { version = "1.18", default-features = false, features = ["rt", "macros", "time"] }
|
tokio = { workspace = true, features = ["rt", "macros", "time"] }
|
||||||
tempfile = "3.4.0"
|
tempfile = "3.4.0"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
@ -78,7 +83,7 @@ celo = ["ethers-core/celo"]
|
||||||
|
|
||||||
ws = ["tokio-tungstenite", "futures-channel"]
|
ws = ["tokio-tungstenite", "futures-channel"]
|
||||||
legacy-ws = ["ws"]
|
legacy-ws = ["ws"]
|
||||||
ipc = ["tokio/io-util", "bytes", "futures-channel", "winapi"]
|
ipc = ["tokio/io-util", "futures-channel", "winapi"]
|
||||||
|
|
||||||
openssl = ["tokio-tungstenite/native-tls", "reqwest/native-tls"]
|
openssl = ["tokio-tungstenite/native-tls", "reqwest/native-tls"]
|
||||||
# we use the webpki roots so we can build static binaries w/o any root cert dependencies
|
# we use the webpki roots so we can build static binaries w/o any root cert dependencies
|
||||||
|
|
|
@ -210,8 +210,6 @@ pub enum RetryClientError {
|
||||||
/// (De)Serialization error
|
/// (De)Serialization error
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
SerdeJson(serde_json::Error),
|
SerdeJson(serde_json::Error),
|
||||||
/// TimerError (wasm only)
|
|
||||||
TimerError,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl crate::RpcError for RetryClientError {
|
impl crate::RpcError for RetryClientError {
|
||||||
|
@ -244,7 +242,6 @@ impl From<RetryClientError> for ProviderError {
|
||||||
RetryClientError::ProviderError(err) => err,
|
RetryClientError::ProviderError(err) => err,
|
||||||
RetryClientError::TimeoutError => ProviderError::JsonRpcClientError(Box::new(src)),
|
RetryClientError::TimeoutError => ProviderError::JsonRpcClientError(Box::new(src)),
|
||||||
RetryClientError::SerdeJson(err) => err.into(),
|
RetryClientError::SerdeJson(err) => err.into(),
|
||||||
RetryClientError::TimerError => ProviderError::JsonRpcClientError(Box::new(src)),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -338,9 +335,7 @@ where
|
||||||
trace!("retrying and backing off for {:?}", next_backoff);
|
trace!("retrying and backing off for {:?}", next_backoff);
|
||||||
|
|
||||||
#[cfg(target_arch = "wasm32")]
|
#[cfg(target_arch = "wasm32")]
|
||||||
wasm_timer::Delay::new(next_backoff)
|
futures_timer::Delay::new(next_backoff).await;
|
||||||
.await
|
|
||||||
.map_err(|_| RetryClientError::TimerError)?;
|
|
||||||
|
|
||||||
#[cfg(not(target_arch = "wasm32"))]
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
tokio::time::sleep(next_backoff).await;
|
tokio::time::sleep(next_backoff).await;
|
||||||
|
|
|
@ -178,7 +178,7 @@ mod tests {
|
||||||
utils::Anvil,
|
utils::Anvil,
|
||||||
};
|
};
|
||||||
use futures_util::{FutureExt, StreamExt};
|
use futures_util::{FutureExt, StreamExt};
|
||||||
use std::{collections::HashSet, convert::TryFrom, time::Duration};
|
use std::{collections::HashSet, time::Duration};
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn can_stream_pending_transactions() {
|
async fn can_stream_pending_transactions() {
|
||||||
|
|
|
@ -1,19 +1,11 @@
|
||||||
#![allow(clippy::return_self_not_must_use)]
|
#![allow(clippy::return_self_not_must_use)]
|
||||||
|
|
||||||
use ethers_core::types::{Bytes, TransactionReceipt, H256};
|
use ethers_core::types::{Bytes, TransactionReceipt, H256};
|
||||||
use futures_util::{stream::FuturesUnordered, StreamExt};
|
|
||||||
use pin_project::pin_project;
|
|
||||||
use std::{
|
|
||||||
future::Future,
|
|
||||||
pin::Pin,
|
|
||||||
task::Poll,
|
|
||||||
time::{Duration, Instant},
|
|
||||||
};
|
|
||||||
|
|
||||||
#[cfg(not(target_arch = "wasm32"))]
|
|
||||||
use futures_timer::Delay;
|
use futures_timer::Delay;
|
||||||
#[cfg(target_arch = "wasm32")]
|
use futures_util::{stream::FuturesUnordered, StreamExt};
|
||||||
use wasm_timer::Delay;
|
use instant::{Duration, Instant};
|
||||||
|
use pin_project::pin_project;
|
||||||
|
use std::{future::Future, pin::Pin, task::Poll};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
utils::PinBoxFut, JsonRpcClient, Middleware, PendingTransaction, Provider, ProviderError,
|
utils::PinBoxFut, JsonRpcClient, Middleware, PendingTransaction, Provider, ProviderError,
|
||||||
|
|
|
@ -4,7 +4,9 @@ use crate::{
|
||||||
};
|
};
|
||||||
use ethers_core::types::{Transaction, TransactionReceipt, TxHash, U64};
|
use ethers_core::types::{Transaction, TransactionReceipt, TxHash, U64};
|
||||||
use futures_core::stream::Stream;
|
use futures_core::stream::Stream;
|
||||||
|
use futures_timer::Delay;
|
||||||
use futures_util::stream::StreamExt;
|
use futures_util::stream::StreamExt;
|
||||||
|
use instant::Duration;
|
||||||
use pin_project::pin_project;
|
use pin_project::pin_project;
|
||||||
use std::{
|
use std::{
|
||||||
fmt,
|
fmt,
|
||||||
|
@ -12,14 +14,8 @@ use std::{
|
||||||
ops::Deref,
|
ops::Deref,
|
||||||
pin::Pin,
|
pin::Pin,
|
||||||
task::{Context, Poll},
|
task::{Context, Poll},
|
||||||
time::Duration,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(not(target_arch = "wasm32"))]
|
|
||||||
use futures_timer::Delay;
|
|
||||||
#[cfg(target_arch = "wasm32")]
|
|
||||||
use wasm_timer::Delay;
|
|
||||||
|
|
||||||
/// A pending transaction is a transaction which has been submitted but is not yet mined.
|
/// A pending transaction is a transaction which has been submitted but is not yet mined.
|
||||||
/// `await`'ing on a pending transaction will resolve to a transaction receipt
|
/// `await`'ing on a pending transaction will resolve to a transaction receipt
|
||||||
/// once the transaction has enough `confirmations`. The default number of confirmations
|
/// once the transaction has enough `confirmations`. The default number of confirmations
|
||||||
|
|
|
@ -1,14 +1,9 @@
|
||||||
|
use crate::ProviderError;
|
||||||
use ethers_core::types::U256;
|
use ethers_core::types::U256;
|
||||||
|
use futures_timer::Delay;
|
||||||
use futures_util::{stream, FutureExt, StreamExt};
|
use futures_util::{stream, FutureExt, StreamExt};
|
||||||
use std::{future::Future, pin::Pin};
|
use std::{future::Future, pin::Pin};
|
||||||
|
|
||||||
#[cfg(not(target_arch = "wasm32"))]
|
|
||||||
use futures_timer::Delay;
|
|
||||||
#[cfg(target_arch = "wasm32")]
|
|
||||||
use wasm_timer::Delay;
|
|
||||||
|
|
||||||
use crate::ProviderError;
|
|
||||||
|
|
||||||
/// A simple gas escalation policy
|
/// A simple gas escalation policy
|
||||||
pub type EscalationPolicy = Box<dyn Fn(U256, usize) -> U256 + Send + Sync>;
|
pub type EscalationPolicy = Box<dyn Fn(U256, usize) -> U256 + Send + Sync>;
|
||||||
|
|
||||||
|
@ -34,7 +29,7 @@ where
|
||||||
// https://github.com/tomusdrw/rust-web3/blob/befcb2fb8f3ca0a43e3081f68886fa327e64c8e6/src/api/eth_filter.rs#L20
|
// https://github.com/tomusdrw/rust-web3/blob/befcb2fb8f3ca0a43e3081f68886fa327e64c8e6/src/api/eth_filter.rs#L20
|
||||||
/// Create a stream that emits items at a fixed interval. Used for rate control
|
/// Create a stream that emits items at a fixed interval. Used for rate control
|
||||||
pub fn interval(
|
pub fn interval(
|
||||||
duration: std::time::Duration,
|
duration: instant::Duration,
|
||||||
) -> impl futures_core::stream::Stream<Item = ()> + Send + Unpin {
|
) -> impl futures_core::stream::Stream<Item = ()> + Send + Unpin {
|
||||||
stream::unfold((), move |_| Delay::new(duration).map(|_| Some(((), ())))).map(drop)
|
stream::unfold((), move |_| Delay::new(duration).map(|_| Some(((), ())))).map(drop)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,63 +1,87 @@
|
||||||
[package]
|
[package]
|
||||||
name = "ethers-signers"
|
name = "ethers-signers"
|
||||||
version = "2.0.0"
|
|
||||||
edition = "2021"
|
|
||||||
rust-version = "1.64"
|
|
||||||
authors = ["Georgios Konstantopoulos <me@gakonst.com>"]
|
authors = ["Georgios Konstantopoulos <me@gakonst.com>"]
|
||||||
license = "MIT OR Apache-2.0"
|
readme = "README.md"
|
||||||
description = "Signer implementations for the ethers-rs crate"
|
description = "A unified interface for locally signing Ethereum transactions"
|
||||||
homepage = "https://docs.rs/ethers"
|
|
||||||
repository = "https://github.com/gakonst/ethers-rs"
|
version.workspace = true
|
||||||
keywords = ["ethereum", "web3", "celo", "ethers"]
|
edition.workspace = true
|
||||||
|
rust-version.workspace = true
|
||||||
|
license.workspace = true
|
||||||
|
documentation.workspace = true
|
||||||
|
repository.workspace = true
|
||||||
|
homepage.workspace = true
|
||||||
|
categories.workspace = true
|
||||||
|
keywords.workspace = true
|
||||||
|
exclude.workspace = true
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
all-features = true
|
all-features = true
|
||||||
rustc-args = ["--cfg", "docsrs"]
|
rustc-args = ["--cfg", "docsrs"]
|
||||||
rustdoc-args = ["--cfg", "docsrs"]
|
rustdoc-args = ["--cfg", "docsrs"]
|
||||||
|
|
||||||
|
[package.metadata.playground]
|
||||||
|
all-features = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
ethers-core = { version = "^2.0.0", path = "../ethers-core", features = ["eip712"] }
|
ethers-core = { workspace = true, features = ["eip712"] }
|
||||||
thiserror = { version = "1.0.39", default-features = false }
|
|
||||||
coins-bip32 = "0.8.0"
|
# crypto
|
||||||
coins-bip39 = "0.8.1"
|
coins-bip32 = "0.8.3"
|
||||||
coins-ledger = { version = "0.7.1", default-features = false, optional = true }
|
coins-bip39 = "0.8.3"
|
||||||
hex = { version = "0.4.3", default-features = false, features = ["std"] }
|
elliptic-curve.workspace = true
|
||||||
async-trait = { version = "0.1.50", default-features = false }
|
sha2.workspace = true
|
||||||
elliptic-curve = { version = "0.13.2", default-features = false }
|
rand.workspace = true
|
||||||
sha2 = { version = "0.10.6", default-features = false }
|
|
||||||
rand = { version = "0.8.5", default-features = false }
|
# misc
|
||||||
yubihsm = { version = "0.42.0-pre.0", features = ["secp256k1", "http", "usb"], optional = true }
|
thiserror.workspace = true
|
||||||
futures-util = { version = "^0.3", optional = true }
|
tracing.workspace = true
|
||||||
futures-executor = { version = "^0.3", optional = true }
|
async-trait.workspace = true
|
||||||
semver = { version = "1.0.17", optional = true }
|
hex.workspace = true
|
||||||
tracing = { version = "0.1.37" }
|
|
||||||
trezor-client = { version = "0.0.7", optional = true, default-features = false, features = [
|
# futures
|
||||||
"f_ethereum",
|
futures-util = { workspace = true, optional = true }
|
||||||
] }
|
futures-executor = { workspace = true, optional = true }
|
||||||
|
|
||||||
# aws
|
# aws
|
||||||
rusoto_core = { version = "0.48.0", default-features = false, optional = true }
|
rusoto_core = { version = "0.48.0", default-features = false, optional = true }
|
||||||
rusoto_kms = { version = "0.48.0", default-features = false, optional = true }
|
rusoto_kms = { version = "0.48.0", default-features = false, optional = true }
|
||||||
spki = { version = "0.6.0", optional = true }
|
spki = { workspace = true, optional = true }
|
||||||
|
|
||||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||||
eth-keystore = { version = "0.5.0" }
|
eth-keystore = "0.5.0"
|
||||||
home = { version = "0.5.4", optional = true }
|
home = { version = "0.5.4", optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
# ledger
|
||||||
ethers-contract-derive = { version = "^2.0.0", path = "../ethers-contract/ethers-contract-derive" }
|
coins-ledger = { version = "0.8.3", default-features = false, optional = true }
|
||||||
ethers-derive-eip712 = { version = "^2.0.0", path = "../ethers-core/ethers-derive-eip712" }
|
semver = { workspace = true, optional = true }
|
||||||
|
|
||||||
serde_json = { version = "1.0.64" }
|
# trezor
|
||||||
|
trezor-client = { version = "0.0.7", default-features = false, features = [
|
||||||
|
"f_ethereum",
|
||||||
|
], optional = true }
|
||||||
|
|
||||||
|
# yubi
|
||||||
|
yubihsm = { version = "0.42.0-pre.0", features = ["secp256k1", "http", "usb"], optional = true }
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
ethers-contract-derive.workspace = true
|
||||||
|
ethers-derive-eip712.workspace = true
|
||||||
|
|
||||||
|
serde_json.workspace = true
|
||||||
|
tempfile.workspace = true
|
||||||
|
tracing-subscriber.workspace = true
|
||||||
|
|
||||||
|
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
|
||||||
yubihsm = { version = "0.42.0-pre.0", features = ["secp256k1", "usb", "mockhsm"] }
|
yubihsm = { version = "0.42.0-pre.0", features = ["secp256k1", "usb", "mockhsm"] }
|
||||||
tokio = { version = "1.18", default-features = false, features = ["macros", "rt"] }
|
tokio = { workspace = true, features = ["macros", "rt"] }
|
||||||
tempfile = "3.4.0"
|
|
||||||
tracing-subscriber = "0.3.16"
|
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
futures = ["futures-util", "futures-executor"]
|
futures = ["futures-util", "futures-executor"]
|
||||||
|
|
||||||
celo = ["ethers-core/celo"]
|
celo = ["ethers-core/celo"]
|
||||||
|
|
||||||
ledger = ["coins-ledger", "futures", "semver"]
|
ledger = ["coins-ledger", "futures", "semver"]
|
||||||
yubi = ["yubihsm"]
|
|
||||||
aws = ["rusoto_core/rustls", "rusoto_kms/rustls", "spki"]
|
|
||||||
trezor = ["trezor-client", "futures", "semver", "home"]
|
trezor = ["trezor-client", "futures", "semver", "home"]
|
||||||
|
aws = ["rusoto_core/rustls", "rusoto_kms/rustls", "spki"]
|
||||||
|
yubi = ["yubihsm"]
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# ethers-signers
|
# ethers-signers
|
||||||
|
|
||||||
A unified interface for locally signing transactions.
|
A unified interface for locally signing Ethereum transactions.
|
||||||
|
|
||||||
You can implement the `Signer` trait to extend functionality to other signers
|
You can implement the `Signer` trait to extend functionality to other signers
|
||||||
such as Hardware Security Modules, KMS etc.
|
such as Hardware Security Modules, KMS etc.
|
||||||
|
|
|
@ -71,8 +71,8 @@ pub(super) fn decode_pubkey(resp: GetPublicKeyResponse) -> Result<VerifyingKey,
|
||||||
.public_key
|
.public_key
|
||||||
.ok_or_else(|| AwsSignerError::from("Pubkey not found in response".to_owned()))?;
|
.ok_or_else(|| AwsSignerError::from("Pubkey not found in response".to_owned()))?;
|
||||||
|
|
||||||
let spk = spki::SubjectPublicKeyInfo::try_from(raw.as_ref())?;
|
let spki = spki::SubjectPublicKeyInfoRef::try_from(raw.as_ref())?;
|
||||||
let key = VerifyingKey::from_sec1_bytes(spk.subject_public_key)?;
|
let key = VerifyingKey::from_sec1_bytes(spki.subject_public_key.raw_bytes())?;
|
||||||
|
|
||||||
Ok(key)
|
Ok(key)
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,32 +10,31 @@ pub use coins_bip39;
|
||||||
/// A wallet instantiated with a locally stored private key
|
/// A wallet instantiated with a locally stored private key
|
||||||
pub type LocalWallet = Wallet<ethers_core::k256::ecdsa::SigningKey>;
|
pub type LocalWallet = Wallet<ethers_core::k256::ecdsa::SigningKey>;
|
||||||
|
|
||||||
#[cfg(feature = "yubi")]
|
#[cfg(all(feature = "yubihsm", not(target_arch = "wasm32")))]
|
||||||
/// A wallet instantiated with a YubiHSM
|
/// A wallet instantiated with a YubiHSM
|
||||||
pub type YubiWallet = Wallet<yubihsm::ecdsa::Signer<ethers_core::k256::Secp256k1>>;
|
pub type YubiWallet = Wallet<yubihsm::ecdsa::Signer<ethers_core::k256::Secp256k1>>;
|
||||||
|
|
||||||
#[cfg(feature = "ledger")]
|
#[cfg(all(feature = "ledger", not(target_arch = "wasm32")))]
|
||||||
mod ledger;
|
mod ledger;
|
||||||
#[cfg(feature = "ledger")]
|
#[cfg(all(feature = "ledger", not(target_arch = "wasm32")))]
|
||||||
pub use ledger::{
|
pub use ledger::{
|
||||||
app::LedgerEthereum as Ledger,
|
app::LedgerEthereum as Ledger,
|
||||||
types::{DerivationType as HDPath, LedgerError},
|
types::{DerivationType as HDPath, LedgerError},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(feature = "trezor")]
|
#[cfg(all(feature = "trezor", not(target_arch = "wasm32")))]
|
||||||
mod trezor;
|
mod trezor;
|
||||||
#[cfg(feature = "trezor")]
|
#[cfg(all(feature = "trezor", not(target_arch = "wasm32")))]
|
||||||
pub use trezor::{
|
pub use trezor::{
|
||||||
app::TrezorEthereum as Trezor,
|
app::TrezorEthereum as Trezor,
|
||||||
types::{DerivationType as TrezorHDPath, TrezorError},
|
types::{DerivationType as TrezorHDPath, TrezorError},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(feature = "yubi")]
|
#[cfg(all(feature = "yubihsm", not(target_arch = "wasm32")))]
|
||||||
pub use yubihsm;
|
pub use yubihsm;
|
||||||
|
|
||||||
#[cfg(feature = "aws")]
|
#[cfg(feature = "aws")]
|
||||||
mod aws;
|
mod aws;
|
||||||
|
|
||||||
#[cfg(feature = "aws")]
|
#[cfg(feature = "aws")]
|
||||||
pub use aws::{AwsSigner, AwsSignerError};
|
pub use aws::{AwsSigner, AwsSignerError};
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ pub use mnemonic::{MnemonicBuilder, MnemonicBuilderError};
|
||||||
mod private_key;
|
mod private_key;
|
||||||
pub use private_key::WalletError;
|
pub use private_key::WalletError;
|
||||||
|
|
||||||
#[cfg(feature = "yubihsm")]
|
#[cfg(all(feature = "yubihsm", not(target_arch = "wasm32")))]
|
||||||
mod yubi;
|
mod yubi;
|
||||||
|
|
||||||
use crate::{to_eip155_v, Signer};
|
use crate::{to_eip155_v, Signer};
|
||||||
|
|
|
@ -1,67 +1,82 @@
|
||||||
[package]
|
[package]
|
||||||
name = "ethers-solc"
|
name = "ethers-solc"
|
||||||
version = "2.0.0"
|
|
||||||
edition = "2021"
|
|
||||||
rust-version = "1.64"
|
|
||||||
authors = [
|
authors = [
|
||||||
"Matthias Seitz <matthias.seitz@outlook.de>",
|
"Matthias Seitz <matthias.seitz@outlook.de>",
|
||||||
"Georgios Konstantopoulos <me@gakonst.com>",
|
"Georgios Konstantopoulos <me@gakonst.com>",
|
||||||
]
|
]
|
||||||
license = "MIT OR Apache-2.0"
|
readme = "README.md"
|
||||||
readme = "../README.md"
|
|
||||||
documentation = "https://docs.rs/ethers"
|
|
||||||
repository = "https://github.com/gakonst/ethers-rs"
|
|
||||||
homepage = "https://docs.rs/ethers"
|
|
||||||
description = "Utilites for working with solc"
|
description = "Utilites for working with solc"
|
||||||
keywords = ["ethereum", "web3", "solc", "solidity", "ethers"]
|
keywords = ["ethers", "ethereum", "web3", "solc", "solidity"]
|
||||||
|
|
||||||
|
version.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
rust-version.workspace = true
|
||||||
|
license.workspace = true
|
||||||
|
documentation.workspace = true
|
||||||
|
repository.workspace = true
|
||||||
|
homepage.workspace = true
|
||||||
|
categories.workspace = true
|
||||||
|
exclude.workspace = true
|
||||||
|
|
||||||
|
[package.metadata.docs.rs]
|
||||||
|
all-features = true
|
||||||
|
rustc-args = ["--cfg", "docsrs"]
|
||||||
|
rustdoc-args = ["--cfg", "docsrs"]
|
||||||
|
|
||||||
|
[package.metadata.playground]
|
||||||
|
all-features = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
ethers-core = { version = "^2.0.0", path = "../ethers-core", default-features = false }
|
ethers-core.workspace = true
|
||||||
serde_json = "1.0.68"
|
|
||||||
serde = { version = "1.0.130", features = ["derive", "rc"] }
|
solang-parser = { version = "=0.2.3", default-features = false }
|
||||||
semver = { version = "1.0.17", features = ["serde"] }
|
|
||||||
walkdir = "2.3.2"
|
serde = { workspace = true, features = ["derive", "rc"] }
|
||||||
tokio = { version = "1.18", default-features = false, features = ["rt"] }
|
serde_json.workspace = true
|
||||||
futures-util = { version = "^0.3", optional = true }
|
|
||||||
once_cell = "1.17.1"
|
tiny-keccak = { version = "2.0.2", default-features = false }
|
||||||
regex = "1.7.1"
|
sha2 = { workspace = true, optional = true }
|
||||||
md-5 = "0.10.5"
|
md-5 = "0.10.5"
|
||||||
thiserror = "1.0"
|
|
||||||
hex = "0.4.3"
|
semver = { workspace = true, features = ["serde"] }
|
||||||
|
walkdir.workspace = true
|
||||||
|
once_cell.workspace = true
|
||||||
|
regex.workspace = true
|
||||||
|
thiserror.workspace = true
|
||||||
|
hex.workspace = true
|
||||||
yansi = "0.5.1"
|
yansi = "0.5.1"
|
||||||
glob = "0.3.1"
|
glob = "0.3.1"
|
||||||
tracing = "0.1.37"
|
tracing.workspace = true
|
||||||
num_cpus = "1.15.0"
|
num_cpus = "1.15.0"
|
||||||
tiny-keccak = { version = "2.0.2", default-features = false }
|
dunce.workspace = true
|
||||||
tempfile = { version = "3.4.0", optional = true }
|
rayon.workspace = true
|
||||||
fs_extra = { version = "1.3.0", optional = true }
|
|
||||||
sha2 = { version = "0.10.6", default-features = false, optional = true }
|
|
||||||
dunce = "1.0.3"
|
|
||||||
solang-parser = { default-features = false, version = "=0.2.3" }
|
|
||||||
rayon = "1.7.0"
|
|
||||||
rand = { version = "0.8.5", optional = true }
|
|
||||||
path-slash = "0.2.1"
|
path-slash = "0.2.1"
|
||||||
cfg-if = "1.0.0"
|
cfg-if = "1.0.0"
|
||||||
|
|
||||||
|
tempfile = { version = "3.4.0", optional = true }
|
||||||
|
fs_extra = { version = "1.3.0", optional = true }
|
||||||
|
rand = { workspace = true, optional = true }
|
||||||
|
futures-util = { workspace = true, optional = true }
|
||||||
|
|
||||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||||
home = "0.5.4"
|
home = "0.5.4"
|
||||||
svm = { package = "svm-rs", version = "0.2", default-features = false, optional = true, features = [
|
svm = { package = "svm-rs", version = "0.2", default-features = false, features = [
|
||||||
"blocking",
|
"blocking",
|
||||||
] }
|
], optional = true }
|
||||||
svm-builds = { package = "svm-rs-builds", version = "0.1", optional = true }
|
svm-builds = { package = "svm-rs-builds", version = "0.1", optional = true }
|
||||||
|
tokio = { workspace = true, features = ["rt"] }
|
||||||
|
|
||||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||||
# NOTE: this enables wasm compatibility for getrandom indirectly
|
# NOTE: this enables wasm compatibility for getrandom indirectly
|
||||||
getrandom = { version = "0.2", features = ["js"] }
|
getrandom.workspace = true
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
criterion = { version = "0.4", features = ["async_tokio"] }
|
criterion.workspace = true
|
||||||
env_logger = "0.10.0"
|
env_logger = "0.10.0"
|
||||||
tracing-subscriber = { version = "0.3", default-features = false, features = ["env-filter", "fmt"] }
|
tracing-subscriber = { workspace = true, features = ["env-filter", "fmt"] }
|
||||||
rand = "0.8.5"
|
rand.workspace = true
|
||||||
pretty_assertions = "1.3.0"
|
pretty_assertions = "1.3.0"
|
||||||
tempfile = "3.4.0"
|
tempfile.workspace = true
|
||||||
tokio = { version = "1.18", features = ["full"] }
|
|
||||||
serde_path_to_error = "0.1.10"
|
serde_path_to_error = "0.1.10"
|
||||||
|
|
||||||
[[bench]]
|
[[bench]]
|
||||||
|
@ -85,12 +100,25 @@ required-features = ["full", "project-util"]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["rustls"]
|
default = ["rustls"]
|
||||||
async = ["tokio/process", "tokio/io-util", "tokio/fs", "tokio/time", "futures-util"]
|
|
||||||
full = ["async", "svm-solc"]
|
full = ["async", "svm-solc"]
|
||||||
svm-solc = ["svm/blocking", "svm-builds", "sha2"]
|
|
||||||
|
async = [
|
||||||
|
"tokio/process",
|
||||||
|
"tokio/io-util",
|
||||||
|
"tokio/fs",
|
||||||
|
"tokio/time",
|
||||||
|
"futures-util",
|
||||||
|
"criterion/async_tokio",
|
||||||
|
]
|
||||||
|
svm-solc = ["svm-builds", "sha2"]
|
||||||
|
|
||||||
# Utilities for creating and testing project workspaces
|
# Utilities for creating and testing project workspaces
|
||||||
project-util = ["tempfile", "fs_extra", "rand"]
|
project-util = ["tempfile", "fs_extra", "rand"]
|
||||||
|
|
||||||
tests = []
|
tests = []
|
||||||
openssl = ["svm/openssl"]
|
openssl = ["svm/openssl"]
|
||||||
rustls = ["svm/rustls"]
|
rustls = ["svm/rustls"]
|
||||||
asm = ["sha2/asm", "svm/sha2-asm"]
|
|
||||||
|
# Deprecated
|
||||||
|
asm = []
|
||||||
|
|
|
@ -70,7 +70,7 @@ pub(crate) fn take_solc_installer_lock() -> std::sync::MutexGuard<'static, ()> {
|
||||||
/// A list of upstream Solc releases, used to check which version
|
/// A list of upstream Solc releases, used to check which version
|
||||||
/// we should download.
|
/// we should download.
|
||||||
/// The boolean value marks whether there was an error accessing the release list
|
/// The boolean value marks whether there was an error accessing the release list
|
||||||
#[cfg(all(feature = "svm-solc"))]
|
#[cfg(all(feature = "svm-solc", not(target_arch = "wasm32")))]
|
||||||
pub static RELEASES: once_cell::sync::Lazy<(svm::Releases, Vec<Version>, bool)> =
|
pub static RELEASES: once_cell::sync::Lazy<(svm::Releases, Vec<Version>, bool)> =
|
||||||
once_cell::sync::Lazy::new(|| {
|
once_cell::sync::Lazy::new(|| {
|
||||||
match serde_json::from_str::<svm::Releases>(svm_builds::RELEASE_LIST_JSON) {
|
match serde_json::from_str::<svm::Releases>(svm_builds::RELEASE_LIST_JSON) {
|
||||||
|
@ -240,7 +240,7 @@ impl Solc {
|
||||||
|
|
||||||
/// Returns the list of all versions that are available to download and marking those which are
|
/// Returns the list of all versions that are available to download and marking those which are
|
||||||
/// already installed.
|
/// already installed.
|
||||||
#[cfg(all(feature = "svm-solc"))]
|
#[cfg(all(feature = "svm-solc", not(target_arch = "wasm32")))]
|
||||||
pub fn all_versions() -> Vec<SolcVersion> {
|
pub fn all_versions() -> Vec<SolcVersion> {
|
||||||
let mut all_versions = Self::installed_versions();
|
let mut all_versions = Self::installed_versions();
|
||||||
let mut uniques = all_versions
|
let mut uniques = all_versions
|
||||||
|
@ -324,7 +324,7 @@ impl Solc {
|
||||||
/// to build it, and returns it.
|
/// to build it, and returns it.
|
||||||
///
|
///
|
||||||
/// If the required compiler version is not installed, it also proceeds to install it.
|
/// If the required compiler version is not installed, it also proceeds to install it.
|
||||||
#[cfg(all(feature = "svm-solc"))]
|
#[cfg(all(feature = "svm-solc", not(target_arch = "wasm32")))]
|
||||||
pub fn detect_version(source: &Source) -> Result<Version> {
|
pub fn detect_version(source: &Source) -> Result<Version> {
|
||||||
// detects the required solc version
|
// detects the required solc version
|
||||||
let sol_version = Self::source_version_req(source)?;
|
let sol_version = Self::source_version_req(source)?;
|
||||||
|
@ -335,7 +335,7 @@ impl Solc {
|
||||||
/// used to build it, and returns it.
|
/// used to build it, and returns it.
|
||||||
///
|
///
|
||||||
/// If the required compiler version is not installed, it also proceeds to install it.
|
/// If the required compiler version is not installed, it also proceeds to install it.
|
||||||
#[cfg(all(feature = "svm-solc"))]
|
#[cfg(all(feature = "svm-solc", not(target_arch = "wasm32")))]
|
||||||
pub fn ensure_installed(sol_version: &VersionReq) -> Result<Version> {
|
pub fn ensure_installed(sol_version: &VersionReq) -> Result<Version> {
|
||||||
#[cfg(any(test, feature = "tests"))]
|
#[cfg(any(test, feature = "tests"))]
|
||||||
let _lock = take_solc_installer_lock();
|
let _lock = take_solc_installer_lock();
|
||||||
|
@ -400,7 +400,7 @@ impl Solc {
|
||||||
/// # Ok(())
|
/// # Ok(())
|
||||||
/// # }
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
#[cfg(feature = "svm-solc")]
|
#[cfg(all(feature = "svm-solc", not(target_arch = "wasm32")))]
|
||||||
pub async fn install(version: &Version) -> std::result::Result<Self, svm::SolcVmError> {
|
pub async fn install(version: &Version) -> std::result::Result<Self, svm::SolcVmError> {
|
||||||
tracing::trace!("installing solc version \"{}\"", version);
|
tracing::trace!("installing solc version \"{}\"", version);
|
||||||
crate::report::solc_installation_start(version);
|
crate::report::solc_installation_start(version);
|
||||||
|
@ -410,7 +410,7 @@ impl Solc {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Blocking version of `Self::install`
|
/// Blocking version of `Self::install`
|
||||||
#[cfg(all(feature = "svm-solc"))]
|
#[cfg(all(feature = "svm-solc", not(target_arch = "wasm32")))]
|
||||||
pub fn blocking_install(version: &Version) -> std::result::Result<Self, svm::SolcVmError> {
|
pub fn blocking_install(version: &Version) -> std::result::Result<Self, svm::SolcVmError> {
|
||||||
use crate::utils::RuntimeOrHandle;
|
use crate::utils::RuntimeOrHandle;
|
||||||
|
|
||||||
|
@ -440,7 +440,7 @@ impl Solc {
|
||||||
|
|
||||||
/// Verify that the checksum for this version of solc is correct. We check against the SHA256
|
/// Verify that the checksum for this version of solc is correct. We check against the SHA256
|
||||||
/// checksum from the build information published by [binaries.soliditylang.org](https://binaries.soliditylang.org/)
|
/// checksum from the build information published by [binaries.soliditylang.org](https://binaries.soliditylang.org/)
|
||||||
#[cfg(all(feature = "svm-solc"))]
|
#[cfg(all(feature = "svm-solc", not(target_arch = "wasm32")))]
|
||||||
pub fn verify_checksum(&self) -> Result<()> {
|
pub fn verify_checksum(&self) -> Result<()> {
|
||||||
let version = self.version_short()?;
|
let version = self.version_short()?;
|
||||||
let mut version_path = svm::version_path(version.to_string().as_str());
|
let mut version_path = svm::version_path(version.to_string().as_str());
|
||||||
|
@ -817,7 +817,7 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
// This test might be a bit hard to maintain
|
// This test might be a bit hard to maintain
|
||||||
#[cfg(all(feature = "svm-solc"))]
|
#[cfg(all(feature = "svm-solc", not(target_arch = "wasm32")))]
|
||||||
fn test_detect_version() {
|
fn test_detect_version() {
|
||||||
for (pragma, expected) in [
|
for (pragma, expected) in [
|
||||||
// pinned
|
// pinned
|
||||||
|
@ -862,7 +862,7 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(feature = "svm-solc")]
|
#[cfg(all(feature = "svm-solc", not(target_arch = "wasm32")))]
|
||||||
fn can_install_solc_in_tokio_rt() {
|
fn can_install_solc_in_tokio_rt() {
|
||||||
let version = Version::from_str("0.8.6").unwrap();
|
let version = Version::from_str("0.8.6").unwrap();
|
||||||
let rt = tokio::runtime::Runtime::new().unwrap();
|
let rt = tokio::runtime::Runtime::new().unwrap();
|
||||||
|
|
|
@ -140,7 +140,7 @@ impl<'a, T: ArtifactOutput> ProjectCompiler<'a, T> {
|
||||||
/// let project = Project::builder().build().unwrap();
|
/// let project = Project::builder().build().unwrap();
|
||||||
/// let output = project.compile().unwrap();
|
/// let output = project.compile().unwrap();
|
||||||
/// ```
|
/// ```
|
||||||
#[cfg(all(feature = "svm-solc"))]
|
#[cfg(all(feature = "svm-solc", not(target_arch = "wasm32")))]
|
||||||
pub fn new(project: &'a Project<T>) -> Result<Self> {
|
pub fn new(project: &'a Project<T>) -> Result<Self> {
|
||||||
Self::with_sources(project, project.paths.read_input_files()?)
|
Self::with_sources(project, project.paths.read_input_files()?)
|
||||||
}
|
}
|
||||||
|
@ -151,7 +151,7 @@ impl<'a, T: ArtifactOutput> ProjectCompiler<'a, T> {
|
||||||
///
|
///
|
||||||
/// Multiple (`Solc` -> `Sources`) pairs can be compiled in parallel if the `Project` allows
|
/// Multiple (`Solc` -> `Sources`) pairs can be compiled in parallel if the `Project` allows
|
||||||
/// multiple `jobs`, see [`crate::Project::set_solc_jobs()`].
|
/// multiple `jobs`, see [`crate::Project::set_solc_jobs()`].
|
||||||
#[cfg(all(feature = "svm-solc"))]
|
#[cfg(all(feature = "svm-solc", not(target_arch = "wasm32")))]
|
||||||
pub fn with_sources(project: &'a Project<T>, sources: Sources) -> Result<Self> {
|
pub fn with_sources(project: &'a Project<T>, sources: Sources) -> Result<Self> {
|
||||||
let graph = Graph::resolve_sources(&project.paths, sources)?;
|
let graph = Graph::resolve_sources(&project.paths, sources)?;
|
||||||
let (versions, edges) = graph.into_sources_by_version(project.offline)?;
|
let (versions, edges) = graph.into_sources_by_version(project.offline)?;
|
||||||
|
|
|
@ -40,7 +40,7 @@ pub enum SolcError {
|
||||||
{2:?}"#
|
{2:?}"#
|
||||||
)]
|
)]
|
||||||
FailedResolveImport(Box<SolcError>, PathBuf, PathBuf),
|
FailedResolveImport(Box<SolcError>, PathBuf, PathBuf),
|
||||||
#[cfg(feature = "svm-solc")]
|
#[cfg(all(feature = "svm-solc", not(target_arch = "wasm32")))]
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
SvmError(#[from] svm::SolcVmError),
|
SvmError(#[from] svm::SolcVmError),
|
||||||
#[error("No contracts found at \"{0}\"")]
|
#[error("No contracts found at \"{0}\"")]
|
||||||
|
|
|
@ -267,7 +267,7 @@ impl<T: ArtifactOutput> Project<T> {
|
||||||
let sources = self.paths.read_input_files()?;
|
let sources = self.paths.read_input_files()?;
|
||||||
tracing::trace!("found {} sources to compile: {:?}", sources.len(), sources.keys());
|
tracing::trace!("found {} sources to compile: {:?}", sources.len(), sources.keys());
|
||||||
|
|
||||||
#[cfg(all(feature = "svm-solc"))]
|
#[cfg(all(feature = "svm-solc", not(target_arch = "wasm32")))]
|
||||||
if self.auto_detect {
|
if self.auto_detect {
|
||||||
tracing::trace!("using solc auto detection to compile sources");
|
tracing::trace!("using solc auto detection to compile sources");
|
||||||
return self.svm_compile(sources)
|
return self.svm_compile(sources)
|
||||||
|
@ -299,7 +299,7 @@ impl<T: ArtifactOutput> Project<T> {
|
||||||
/// let output = project.svm_compile(sources).unwrap();
|
/// let output = project.svm_compile(sources).unwrap();
|
||||||
/// # }
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
#[cfg(all(feature = "svm-solc"))]
|
#[cfg(all(feature = "svm-solc", not(target_arch = "wasm32")))]
|
||||||
pub fn svm_compile(&self, sources: Sources) -> Result<ProjectCompileOutput<T>> {
|
pub fn svm_compile(&self, sources: Sources) -> Result<ProjectCompileOutput<T>> {
|
||||||
project::ProjectCompiler::with_sources(self, sources)?.compile()
|
project::ProjectCompiler::with_sources(self, sources)?.compile()
|
||||||
}
|
}
|
||||||
|
@ -316,7 +316,7 @@ impl<T: ArtifactOutput> Project<T> {
|
||||||
/// let output = project.compile_file("example/Greeter.sol").unwrap();
|
/// let output = project.compile_file("example/Greeter.sol").unwrap();
|
||||||
/// # }
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
#[cfg(all(feature = "svm-solc"))]
|
#[cfg(all(feature = "svm-solc", not(target_arch = "wasm32")))]
|
||||||
pub fn compile_file(&self, file: impl Into<PathBuf>) -> Result<ProjectCompileOutput<T>> {
|
pub fn compile_file(&self, file: impl Into<PathBuf>) -> Result<ProjectCompileOutput<T>> {
|
||||||
let file = file.into();
|
let file = file.into();
|
||||||
let source = Source::read(&file)?;
|
let source = Source::read(&file)?;
|
||||||
|
@ -345,7 +345,7 @@ impl<T: ArtifactOutput> Project<T> {
|
||||||
{
|
{
|
||||||
let sources = Source::read_all(files)?;
|
let sources = Source::read_all(files)?;
|
||||||
|
|
||||||
#[cfg(all(feature = "svm-solc"))]
|
#[cfg(all(feature = "svm-solc", not(target_arch = "wasm32")))]
|
||||||
if self.auto_detect {
|
if self.auto_detect {
|
||||||
return project::ProjectCompiler::with_sources(self, sources)?.compile()
|
return project::ProjectCompiler::with_sources(self, sources)?.compile()
|
||||||
}
|
}
|
||||||
|
@ -392,7 +392,7 @@ impl<T: ArtifactOutput> Project<T> {
|
||||||
Source::read_all(self.paths.input_files().into_iter().filter(|p| filter.is_match(p)))?;
|
Source::read_all(self.paths.input_files().into_iter().filter(|p| filter.is_match(p)))?;
|
||||||
let filter: Box<dyn FileFilter> = Box::new(filter);
|
let filter: Box<dyn FileFilter> = Box::new(filter);
|
||||||
|
|
||||||
#[cfg(all(feature = "svm-solc"))]
|
#[cfg(all(feature = "svm-solc", not(target_arch = "wasm32")))]
|
||||||
if self.auto_detect {
|
if self.auto_detect {
|
||||||
return project::ProjectCompiler::with_sources(self, sources)?
|
return project::ProjectCompiler::with_sources(self, sources)?
|
||||||
.with_sparse_output(filter)
|
.with_sparse_output(filter)
|
||||||
|
@ -963,7 +963,7 @@ impl<T: ArtifactOutput> ArtifactOutput for Project<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
#[cfg(all(feature = "svm-solc"))]
|
#[cfg(all(feature = "svm-solc", not(target_arch = "wasm32")))]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::remappings::Remapping;
|
use crate::remappings::Remapping;
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ use crate::{
|
||||||
utils,
|
utils,
|
||||||
utils::tempdir,
|
utils::tempdir,
|
||||||
Artifact, ArtifactOutput, Artifacts, ConfigurableArtifacts, ConfigurableContractArtifact,
|
Artifact, ArtifactOutput, Artifacts, ConfigurableArtifacts, ConfigurableContractArtifact,
|
||||||
FileFilter, PathStyle, Project, ProjectCompileOutput, ProjectPathsConfig, SolFilesCache, Solc,
|
FileFilter, PathStyle, Project, ProjectCompileOutput, ProjectPathsConfig, SolFilesCache,
|
||||||
SolcIoError,
|
SolcIoError,
|
||||||
};
|
};
|
||||||
use fs_extra::{dir, file};
|
use fs_extra::{dir, file};
|
||||||
|
@ -69,8 +69,9 @@ impl<T: ArtifactOutput> TempProject<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Explicitly sets the solc version for the project
|
/// Explicitly sets the solc version for the project
|
||||||
|
#[cfg(all(feature = "svm-solc", not(target_arch = "wasm32")))]
|
||||||
pub fn set_solc(&mut self, solc: impl AsRef<str>) -> &mut Self {
|
pub fn set_solc(&mut self, solc: impl AsRef<str>) -> &mut Self {
|
||||||
self.inner.solc = Solc::find_or_install_svm_version(solc).unwrap();
|
self.inner.solc = crate::Solc::find_or_install_svm_version(solc).unwrap();
|
||||||
self.inner.auto_detect = false;
|
self.inner.auto_detect = false;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
|
@ -437,7 +437,7 @@ impl Graph {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(all(feature = "svm-solc"))]
|
#[cfg(all(feature = "svm-solc", not(target_arch = "wasm32")))]
|
||||||
impl Graph {
|
impl Graph {
|
||||||
/// Consumes the nodes of the graph and returns all input files together with their appropriate
|
/// Consumes the nodes of the graph and returns all input files together with their appropriate
|
||||||
/// version and the edges of the graph
|
/// version and the edges of the graph
|
||||||
|
@ -759,7 +759,7 @@ impl<'a> Iterator for NodesIter<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Container type for solc versions and their compatible sources
|
/// Container type for solc versions and their compatible sources
|
||||||
#[cfg(all(feature = "svm-solc"))]
|
#[cfg(all(feature = "svm-solc", not(target_arch = "wasm32")))]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct VersionedSources {
|
pub struct VersionedSources {
|
||||||
resolved_solc_include_paths: IncludePaths,
|
resolved_solc_include_paths: IncludePaths,
|
||||||
|
@ -767,7 +767,7 @@ pub struct VersionedSources {
|
||||||
offline: bool,
|
offline: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(all(feature = "svm-solc"))]
|
#[cfg(all(feature = "svm-solc", not(target_arch = "wasm32")))]
|
||||||
impl VersionedSources {
|
impl VersionedSources {
|
||||||
/// Resolves or installs the corresponding `Solc` installation.
|
/// Resolves or installs the corresponding `Solc` installation.
|
||||||
///
|
///
|
||||||
|
|
|
@ -0,0 +1,89 @@
|
||||||
|
[package]
|
||||||
|
name = "ethers"
|
||||||
|
authors = ["Georgios Konstantopoulos <me@gakonst.com>"]
|
||||||
|
readme = "../README.md"
|
||||||
|
description = "A complete Ethereum and Celo Rust library"
|
||||||
|
|
||||||
|
version.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
rust-version.workspace = true
|
||||||
|
license.workspace = true
|
||||||
|
documentation.workspace = true
|
||||||
|
repository.workspace = true
|
||||||
|
homepage.workspace = true
|
||||||
|
categories.workspace = true
|
||||||
|
keywords.workspace = true
|
||||||
|
exclude.workspace = true
|
||||||
|
|
||||||
|
[package.metadata.docs.rs]
|
||||||
|
all-features = true
|
||||||
|
rustc-args = ["--cfg", "docsrs"]
|
||||||
|
rustdoc-args = ["--cfg", "docsrs"]
|
||||||
|
|
||||||
|
[package.metadata.playground]
|
||||||
|
all-features = true
|
||||||
|
|
||||||
|
[features]
|
||||||
|
default = ["abigen", "rustls"]
|
||||||
|
|
||||||
|
celo = [
|
||||||
|
"ethers-core/celo",
|
||||||
|
"ethers-providers/celo",
|
||||||
|
"ethers-signers/celo",
|
||||||
|
"ethers-contract/celo",
|
||||||
|
"ethers-middleware/celo",
|
||||||
|
"legacy",
|
||||||
|
]
|
||||||
|
|
||||||
|
legacy = ["ethers-core/legacy", "ethers-contract/legacy"]
|
||||||
|
|
||||||
|
# individual features per sub-crate
|
||||||
|
## core
|
||||||
|
eip712 = ["ethers-contract/eip712", "ethers-core/eip712"]
|
||||||
|
## providers
|
||||||
|
ws = ["ethers-providers/ws"]
|
||||||
|
ipc = ["ethers-providers/ipc"]
|
||||||
|
rustls = [
|
||||||
|
"ethers-middleware/rustls",
|
||||||
|
"ethers-providers/rustls",
|
||||||
|
"ethers-etherscan/rustls",
|
||||||
|
"ethers-contract/rustls",
|
||||||
|
"ethers-solc/rustls",
|
||||||
|
]
|
||||||
|
openssl = [
|
||||||
|
"ethers-middleware/openssl",
|
||||||
|
"ethers-providers/openssl",
|
||||||
|
"ethers-etherscan/openssl",
|
||||||
|
"ethers-contract/openssl",
|
||||||
|
"ethers-solc/openssl",
|
||||||
|
]
|
||||||
|
dev-rpc = ["ethers-providers/dev-rpc"]
|
||||||
|
## signers
|
||||||
|
ledger = ["ethers-signers/ledger"]
|
||||||
|
trezor = ["ethers-signers/trezor"]
|
||||||
|
yubi = ["ethers-signers/yubi"]
|
||||||
|
## contracts
|
||||||
|
abigen = ["ethers-contract/abigen"]
|
||||||
|
### abigen without reqwest
|
||||||
|
abigen-offline = ["ethers-contract/abigen-offline"]
|
||||||
|
## solc
|
||||||
|
ethers-solc = ["dep:ethers-solc", "ethers-etherscan/ethers-solc"]
|
||||||
|
solc-full = ["ethers-solc?/full"]
|
||||||
|
solc-tests = ["ethers-solc?/tests"]
|
||||||
|
|
||||||
|
# Deprecated
|
||||||
|
solc-sha2-asm = []
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
ethers-addressbook.workspace = true
|
||||||
|
ethers-contract.workspace = true
|
||||||
|
ethers-core.workspace = true
|
||||||
|
ethers-etherscan.workspace = true
|
||||||
|
ethers-middleware.workspace = true
|
||||||
|
ethers-providers.workspace = true
|
||||||
|
ethers-signers.workspace = true
|
||||||
|
|
||||||
|
ethers-solc = { workspace = true, optional = true }
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
tokio = { workspace = true, features = ["macros", "rt"] }
|
|
@ -9,5 +9,5 @@
|
||||||
mod celo;
|
mod celo;
|
||||||
|
|
||||||
pub(crate) mod simple_storage {
|
pub(crate) mod simple_storage {
|
||||||
ethers::contract::abigen!(SimpleStorage, "./tests/testdata/SimpleStorage.json");
|
ethers::contract::abigen!(SimpleStorage, "../testdata/SimpleStorage.json");
|
||||||
}
|
}
|
|
@ -1,10 +1,14 @@
|
||||||
[package]
|
[package]
|
||||||
name = "examples-anvil"
|
name = "examples-anvil"
|
||||||
version = "2.0.0"
|
version = "2.0.0"
|
||||||
|
publish = false
|
||||||
authors = ["Andrea Simeoni <andreasimeoni84@gmail.com>"]
|
authors = ["Andrea Simeoni <andreasimeoni84@gmail.com>"]
|
||||||
edition = "2021"
|
|
||||||
|
license.workspace = true
|
||||||
|
rust-version.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
ethers = { path = "../..", version = "2.0.0" }
|
ethers.workspace = true
|
||||||
eyre = "0.6"
|
tokio = { workspace = true, features = ["macros"] }
|
||||||
tokio = { version = "1.18", features = ["full"] }
|
eyre.workspace = true
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
[package]
|
[package]
|
||||||
name = "examples-big-numbers"
|
name = "examples-big-numbers"
|
||||||
version = "2.0.0"
|
version = "2.0.0"
|
||||||
|
publish = false
|
||||||
authors = ["Andrea Simeoni <andreasimeoni84@gmail.com>"]
|
authors = ["Andrea Simeoni <andreasimeoni84@gmail.com>"]
|
||||||
edition = "2021"
|
|
||||||
|
license.workspace = true
|
||||||
|
rust-version.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
#ethers-core = { version = "^1.0.0", path = "../../ethers-core" }
|
ethers.workspace = true
|
||||||
ethers = { path = "../..", version = "2.0.0" }
|
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,23 @@
|
||||||
[package]
|
[package]
|
||||||
name = "examples-contracts"
|
name = "examples-contracts"
|
||||||
version = "2.0.0"
|
version = "2.0.0"
|
||||||
|
publish = false
|
||||||
authors = ["Andrea Simeoni <andreasimeoni84@gmail.com>"]
|
authors = ["Andrea Simeoni <andreasimeoni84@gmail.com>"]
|
||||||
edition = "2021"
|
|
||||||
|
license.workspace = true
|
||||||
|
rust-version.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["legacy"]
|
default = ["legacy"]
|
||||||
legacy = []
|
legacy = ["ethers/legacy"]
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
ethers = { path = "../..", version = "2.0.0", features = ["abigen", "ethers-solc", "legacy", "rustls", "ws"] }
|
ethers = { workspace = true, features = ["abigen", "ethers-solc", "rustls", "ws"] }
|
||||||
|
|
||||||
eyre = "0.6"
|
tokio = { workspace = true, features = ["macros"] }
|
||||||
serde = { version = "1.0.144", features = ["derive"] }
|
|
||||||
serde_json = "1.0.64"
|
|
||||||
tokio = { version = "1.18", features = ["macros"] }
|
|
||||||
|
|
||||||
|
serde.workspace = true
|
||||||
|
serde_json.workspace = true
|
||||||
|
|
||||||
|
eyre.workspace = true
|
||||||
|
|
|
@ -1,15 +1,11 @@
|
||||||
[package]
|
[package]
|
||||||
name = "ethers-wasm"
|
name = "ethers-wasm"
|
||||||
version = "0.1.0"
|
version = "2.0.0"
|
||||||
edition = "2021"
|
|
||||||
rust-version = "1.64"
|
|
||||||
authors = ["Matthias Seitz <matthias.seitz@outlook.de>"]
|
authors = ["Matthias Seitz <matthias.seitz@outlook.de>"]
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
readme = "README.md"
|
|
||||||
documentation = "https://docs.rs/ethers"
|
rust-version.workspace = true
|
||||||
repository = "https://github.com/gakonst/ethers-rs"
|
edition.workspace = true
|
||||||
homepage = "https://docs.rs/ethers"
|
|
||||||
description = "How to use ethers in the browser with WASM."
|
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
crate-type = ["cdylib", "rlib"]
|
crate-type = ["cdylib", "rlib"]
|
||||||
|
@ -18,31 +14,23 @@ crate-type = ["cdylib", "rlib"]
|
||||||
default = ["console_error_panic_hook"]
|
default = ["console_error_panic_hook"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
ethers = { path = "../..", version = "2.0.0", features = ["abigen", "legacy", "ws"] }
|
ethers = { workspace = true, features = ["abigen", "ws"] }
|
||||||
|
|
||||||
|
serde.workspace = true
|
||||||
|
serde_json.workspace = true
|
||||||
|
serde-wasm-bindgen = "0.5.0"
|
||||||
|
hex.workspace = true
|
||||||
|
|
||||||
wasm-bindgen-futures = "0.4.34"
|
wasm-bindgen-futures = "0.4.34"
|
||||||
wasm-bindgen = { version = "0.2.83", features = ["serde-serialize"] }
|
wasm-bindgen = { version = "0.2.84", features = ["serde-serialize"] }
|
||||||
|
|
||||||
serde = { version = "1.0.144", features = ["derive"] }
|
|
||||||
serde_json = "1.0.85"
|
|
||||||
serde-wasm-bindgen = "0.4.5"
|
|
||||||
|
|
||||||
# The `console_error_panic_hook` crate provides better debugging of panics by
|
# The `console_error_panic_hook` crate provides better debugging of panics by
|
||||||
# logging them with `console.error`. This is great for development, but requires
|
# logging them with `console.error`. This is great for development, but requires
|
||||||
# all the `std::fmt` and `std::panicking` infrastructure, so isn't great for
|
# all the `std::fmt` and `std::panicking` infrastructure, so isn't great for
|
||||||
# code size when deploying.
|
# code size when deploying.
|
||||||
console_error_panic_hook = { version = "0.1.6", optional = true }
|
console_error_panic_hook = { version = "0.1.7", optional = true }
|
||||||
|
|
||||||
# `wee_alloc` is a tiny allocator for wasm that is only ~1K in code size
|
|
||||||
# compared to the default allocator's ~10K. It is slower than the default
|
|
||||||
# allocator, however.
|
|
||||||
#
|
|
||||||
# Unfortunately, `wee_alloc` requires nightly Rust when targeting wasm for now.
|
|
||||||
wee_alloc = { version = "0.4.5", optional = true }
|
|
||||||
|
|
||||||
web-sys = { version = "0.3.61", features = ["console"] }
|
web-sys = { version = "0.3.61", features = ["console"] }
|
||||||
|
|
||||||
hex = "0.4.3"
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
wasm-bindgen-test = "0.3.34"
|
wasm-bindgen-test = "0.3.34"
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
{"abi":[{"inputs":[{"internalType":"string","name":"value","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"author","type":"address"},{"indexed":false,"internalType":"string","name":"oldValue","type":"string"},{"indexed":false,"internalType":"string","name":"newValue","type":"string"}],"name":"ValueChanged","type":"event"},{"inputs":[],"name":"getValue","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"value","type":"string"}],"name":"setValue","outputs":[],"stateMutability":"nonpayable","type":"function"}],"bytecode":"608060405234801561001057600080fd5b5060405161073b38038061073b8339818101604052602081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b8382019150602082018581111561006957600080fd5b825186600182028301116401000000008211171561008657600080fd5b8083526020830192505050908051906020019080838360005b838110156100ba57808201518184015260208101905061009f565b50505050905090810190601f1680156100e75780820380516001836020036101000a031916815260200191505b506040525050503373ffffffffffffffffffffffffffffffffffffffff167fe826f71647b8486f2bae59832124c70792fba044036720a54ec8dacdd5df4fcb6000836040518080602001806020018381038352858181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156101b65780601f1061018b576101008083540402835291602001916101b6565b820191906000526020600020905b81548152906001019060200180831161019957829003601f168201915b5050838103825284818151815260200191508051906020019080838360005b838110156101f05780820151818401526020810190506101d5565b50505050905090810190601f16801561021d5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a28060009080519060200190610242929190610249565b50506102e6565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061028a57805160ff19168380011785556102b8565b828001600101855582156102b8579182015b828111156102b757825182559160200191906001019061029c565b5b5090506102c591906102c9565b5090565b5b808211156102e25760008160009055506001016102ca565b5090565b610446806102f56000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063209652551461003b57806393a09352146100be575b600080fd5b610043610179565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610083578082015181840152602081019050610068565b50505050905090810190601f1680156100b05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610177600480360360208110156100d457600080fd5b81019080803590602001906401000000008111156100f157600080fd5b82018360208201111561010357600080fd5b8035906020019184600183028401116401000000008311171561012557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061021b565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102115780601f106101e657610100808354040283529160200191610211565b820191906000526020600020905b8154815290600101906020018083116101f457829003601f168201915b5050505050905090565b3373ffffffffffffffffffffffffffffffffffffffff167fe826f71647b8486f2bae59832124c70792fba044036720a54ec8dacdd5df4fcb6000836040518080602001806020018381038352858181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156102e35780601f106102b8576101008083540402835291602001916102e3565b820191906000526020600020905b8154815290600101906020018083116102c657829003601f168201915b5050838103825284818151815260200191508051906020019080838360005b8381101561031d578082015181840152602081019050610302565b50505050905090810190601f16801561034a5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a2806000908051906020019061036f929190610373565b5050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106103b457805160ff19168380011785556103e2565b828001600101855582156103e2579182015b828111156103e15782518255916020019190600101906103c6565b5b5090506103ef91906103f3565b5090565b5b8082111561040c5760008160009055506001016103f4565b509056fea26469706673582212202d397d3d0e6cf9afdeed7d5192e3abff386699395df0409eb5c3ec494832c57a64736f6c63430007000033"}
|
|
@ -1 +0,0 @@
|
||||||
[{"inputs":[{"internalType":"string","name":"value","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"author","type":"address"},{"indexed":false,"internalType":"string","name":"oldValue","type":"string"},{"indexed":false,"internalType":"string","name":"newValue","type":"string"}],"name":"ValueChanged","type":"event"},{"inputs":[],"name":"getValue","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"value","type":"string"}],"name":"setValue","outputs":[],"stateMutability":"nonpayable","type":"function"}]
|
|
|
@ -1,4 +1,4 @@
|
||||||
const ethers = import('./pkg');
|
const ethers = import("./pkg");
|
||||||
|
|
||||||
ethers
|
ethers
|
||||||
.then(m => {
|
.then(m => {
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
"@wasm-tool/wasm-pack-plugin": "^1.6",
|
"@wasm-tool/wasm-pack-plugin": "^1.6",
|
||||||
"html-webpack-plugin": "^5.5",
|
"html-webpack-plugin": "^5.5",
|
||||||
"text-encoding": "^0.7",
|
"text-encoding": "^0.7",
|
||||||
"webpack": "^5.74",
|
"webpack": "^5.75",
|
||||||
"webpack-cli": "^4.10",
|
"webpack-cli": "^5.0",
|
||||||
"webpack-dev-server": "^4.11",
|
"webpack-dev-server": "^4.11",
|
||||||
"ganache-cli": "^6.12"
|
"ganache-cli": "^6.12"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use crate::utils::SIMPLECONTRACT_BIN;
|
|
||||||
use ethers::{
|
use ethers::{
|
||||||
contract::abigen,
|
contract::abigen,
|
||||||
prelude::{ContractFactory, Provider, SignerMiddleware},
|
prelude::{Provider, SignerMiddleware},
|
||||||
providers::Ws,
|
providers::{Middleware, Ws},
|
||||||
|
signers::Signer,
|
||||||
};
|
};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
@ -10,23 +10,13 @@ use web_sys::console;
|
||||||
|
|
||||||
pub mod utils;
|
pub mod utils;
|
||||||
|
|
||||||
// When the `wee_alloc` feature is enabled, use `wee_alloc` as the global
|
|
||||||
// allocator.
|
|
||||||
#[cfg(feature = "wee_alloc")]
|
|
||||||
#[global_allocator]
|
|
||||||
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
|
|
||||||
|
|
||||||
macro_rules! log {
|
macro_rules! log {
|
||||||
( $( $t:tt )* ) => {
|
( $( $t:tt )* ) => {
|
||||||
web_sys::console::log_1(&format!( $( $t )* ).into());
|
web_sys::console::log_1(&format!( $( $t )* ).into());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
abigen!(
|
abigen!(SimpleContract, "./abi/contract.json", derives(serde::Deserialize, serde::Serialize));
|
||||||
SimpleContract,
|
|
||||||
"./abi/contract_abi.json",
|
|
||||||
event_derives(serde::Deserialize, serde::Serialize)
|
|
||||||
);
|
|
||||||
|
|
||||||
#[wasm_bindgen]
|
#[wasm_bindgen]
|
||||||
pub async fn deploy() {
|
pub async fn deploy() {
|
||||||
|
@ -37,24 +27,21 @@ pub async fn deploy() {
|
||||||
&serde_wasm_bindgen::to_value(&*SIMPLECONTRACT_ABI).unwrap(),
|
&serde_wasm_bindgen::to_value(&*SIMPLECONTRACT_ABI).unwrap(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let wallet = utils::key(0);
|
|
||||||
log!("Wallet: {:?}", wallet);
|
|
||||||
|
|
||||||
let endpoint = "ws://127.0.0.1:8545";
|
let endpoint = "ws://127.0.0.1:8545";
|
||||||
let provider = Provider::<Ws>::connect(endpoint).await.unwrap();
|
let provider = Provider::<Ws>::connect(endpoint).await.unwrap();
|
||||||
let client = Arc::new(SignerMiddleware::new(provider, wallet));
|
log!("Connected to: `{endpoint}`");
|
||||||
log!("Connected to: `{}`", endpoint);
|
|
||||||
|
|
||||||
let bytecode = hex::decode(SIMPLECONTRACT_BIN).unwrap();
|
let chain_id = provider.get_chainid().await.unwrap();
|
||||||
let factory = ContractFactory::new(SIMPLECONTRACT_ABI.clone(), bytecode.into(), client.clone());
|
let wallet = utils::key(0).with_chain_id(chain_id.as_u64());
|
||||||
|
log!("Wallet: {wallet:?}");
|
||||||
|
let client = Arc::new(SignerMiddleware::new(provider, wallet));
|
||||||
|
|
||||||
log!("Deploying contract...");
|
log!("Deploying contract...");
|
||||||
let contract = factory.deploy("hello WASM!".to_string()).unwrap().send().await.unwrap();
|
let deploy_tx = SimpleContract::deploy(client.clone(), "hello WASM!".to_string()).unwrap();
|
||||||
|
let contract: SimpleContract<_> = deploy_tx.send().await.unwrap();
|
||||||
let addr = contract.address();
|
let addr = contract.address();
|
||||||
log!("Deployed contract with address: {:?}", addr);
|
log!("Deployed contract with address: {:?}", addr);
|
||||||
|
|
||||||
let contract = SimpleContract::new(addr, client.clone());
|
|
||||||
|
|
||||||
let value = "bye from WASM!";
|
let value = "bye from WASM!";
|
||||||
log!("Setting value... `{}`", value);
|
log!("Setting value... `{}`", value);
|
||||||
let receipt = contract.set_value(value.to_owned()).send().await.unwrap().await.unwrap();
|
let receipt = contract.set_value(value.to_owned()).send().await.unwrap().await.unwrap();
|
||||||
|
|
|
@ -21,6 +21,3 @@ pub const PHRASE: &str =
|
||||||
pub fn key(index: u32) -> LocalWallet {
|
pub fn key(index: u32) -> LocalWallet {
|
||||||
MnemonicBuilder::<English>::default().phrase(PHRASE).index(index).unwrap().build().unwrap()
|
MnemonicBuilder::<English>::default().phrase(PHRASE).index(index).unwrap().build().unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Bytecode of the `SimpleContract`
|
|
||||||
pub const SIMPLECONTRACT_BIN: &str = "608060405234801561001057600080fd5b5060405161073b38038061073b8339818101604052602081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b8382019150602082018581111561006957600080fd5b825186600182028301116401000000008211171561008657600080fd5b8083526020830192505050908051906020019080838360005b838110156100ba57808201518184015260208101905061009f565b50505050905090810190601f1680156100e75780820380516001836020036101000a031916815260200191505b506040525050503373ffffffffffffffffffffffffffffffffffffffff167fe826f71647b8486f2bae59832124c70792fba044036720a54ec8dacdd5df4fcb6000836040518080602001806020018381038352858181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156101b65780601f1061018b576101008083540402835291602001916101b6565b820191906000526020600020905b81548152906001019060200180831161019957829003601f168201915b5050838103825284818151815260200191508051906020019080838360005b838110156101f05780820151818401526020810190506101d5565b50505050905090810190601f16801561021d5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a28060009080519060200190610242929190610249565b50506102e6565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061028a57805160ff19168380011785556102b8565b828001600101855582156102b8579182015b828111156102b757825182559160200191906001019061029c565b5b5090506102c591906102c9565b5090565b5b808211156102e25760008160009055506001016102ca565b5090565b610446806102f56000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063209652551461003b57806393a09352146100be575b600080fd5b610043610179565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610083578082015181840152602081019050610068565b50505050905090810190601f1680156100b05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610177600480360360208110156100d457600080fd5b81019080803590602001906401000000008111156100f157600080fd5b82018360208201111561010357600080fd5b8035906020019184600183028401116401000000008311171561012557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061021b565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102115780601f106101e657610100808354040283529160200191610211565b820191906000526020600020905b8154815290600101906020018083116101f457829003601f168201915b5050505050905090565b3373ffffffffffffffffffffffffffffffffffffffff167fe826f71647b8486f2bae59832124c70792fba044036720a54ec8dacdd5df4fcb6000836040518080602001806020018381038352858181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156102e35780601f106102b8576101008083540402835291602001916102e3565b820191906000526020600020905b8154815290600101906020018083116102c657829003601f168201915b5050838103825284818151815260200191508051906020019080838360005b8381101561031d578082015181840152602081019050610302565b50505050905090810190601f16801561034a5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a2806000908051906020019061036f929190610373565b5050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106103b457805160ff19168380011785556103e2565b828001600101855582156103e2579182015b828111156103e15782518255916020019190600101906103c6565b5b5090506103ef91906103f3565b5090565b5b8082111561040c5760008160009055506001016103f4565b509056fea26469706673582212202d397d3d0e6cf9afdeed7d5192e3abff386699395df0409eb5c3ec494832c57a64736f6c63430007000033";
|
|
||||||
|
|
|
@ -1,51 +1,42 @@
|
||||||
#![cfg(target_arch = "wasm32")]
|
#![cfg(target_arch = "wasm32")]
|
||||||
|
|
||||||
use ethers::{
|
use ethers::{
|
||||||
prelude::{
|
prelude::{Http, JsonRpcClient, LocalWallet, Provider, SignerMiddleware, Ws},
|
||||||
abigen, ContractFactory, Http, JsonRpcClient, LocalWallet, Provider, SignerMiddleware, Ws,
|
|
||||||
},
|
|
||||||
signers::Signer,
|
signers::Signer,
|
||||||
types::Chain,
|
types::Chain,
|
||||||
};
|
};
|
||||||
use std::{convert::TryFrom, sync::Arc};
|
use ethers_wasm::{utils, SimpleContract};
|
||||||
|
use std::sync::Arc;
|
||||||
use wasm_bindgen_test::*;
|
use wasm_bindgen_test::*;
|
||||||
|
|
||||||
wasm_bindgen_test_configure!(run_in_browser);
|
wasm_bindgen_test_configure!(run_in_browser);
|
||||||
|
|
||||||
// Generate the type-safe contract bindings by providing the ABI
|
|
||||||
// definition in human readable format
|
|
||||||
abigen!(
|
|
||||||
SimpleContract,
|
|
||||||
"./abi/contract_abi.json",
|
|
||||||
event_derives(serde::Deserialize, serde::Serialize)
|
|
||||||
);
|
|
||||||
|
|
||||||
#[wasm_bindgen_test]
|
#[wasm_bindgen_test]
|
||||||
async fn http_connect_and_deploy() {
|
async fn http_connect_and_deploy() {
|
||||||
console_log!("connecting http...");
|
console_log!("connecting http...");
|
||||||
let provider = Provider::<Http>::try_from("http://localhost:8545").unwrap();
|
let provider = Provider::<Http>::try_from("http://localhost:8545").unwrap();
|
||||||
deploy(provider, ethers_wasm::utils::key(0).with_chain_id(Chain::AnvilHardhat)).await;
|
deploy(provider, utils::key(0).with_chain_id(Chain::AnvilHardhat)).await;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[wasm_bindgen_test]
|
#[wasm_bindgen_test]
|
||||||
async fn ws_connect_and_deploy() {
|
async fn ws_connect_and_deploy() {
|
||||||
console_log!("connecting ws...");
|
console_log!("connecting ws...");
|
||||||
let provider = Provider::new(Ws::connect("ws://localhost:8545").await.unwrap());
|
let provider = Provider::new(Ws::connect("ws://localhost:8545").await.unwrap());
|
||||||
deploy(provider, ethers_wasm::utils::key(1).with_chain_id(Chain::AnvilHardhat)).await;
|
deploy(provider, utils::key(1).with_chain_id(Chain::AnvilHardhat)).await;
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn deploy<T: JsonRpcClient>(provider: Provider<T>, wallet: LocalWallet) {
|
async fn deploy<T: JsonRpcClient>(provider: Provider<T>, wallet: LocalWallet) {
|
||||||
let client = Arc::new(SignerMiddleware::new(provider, wallet));
|
let client = Arc::new(SignerMiddleware::new(provider, wallet));
|
||||||
|
|
||||||
let bytecode = hex::decode(ethers_wasm::utils::SIMPLECONTRACT_BIN).unwrap();
|
let expected = "Hello from Contract!";
|
||||||
let factory = ContractFactory::new(SIMPLECONTRACT_ABI.clone(), bytecode.into(), client.clone());
|
let deploy_tx = SimpleContract::deploy(client, expected.to_string()).unwrap();
|
||||||
let contract =
|
let contract: SimpleContract<_> = deploy_tx.send().await.unwrap();
|
||||||
factory.deploy("Hello from Contract!".to_string()).unwrap().send().await.unwrap();
|
|
||||||
let addr = contract.address();
|
let addr = contract.address();
|
||||||
console_log!("deployed to {}", addr);
|
console_log!("deployed to {addr}");
|
||||||
|
|
||||||
let contract = SimpleContract::new(addr, client.clone());
|
|
||||||
let value = contract.get_value().call().await.unwrap();
|
let value = contract.get_value().call().await.unwrap();
|
||||||
|
|
||||||
console_log!("value: {:?}", value);
|
console_log!("value: {value:?}");
|
||||||
|
|
||||||
|
assert_eq!(value, expected);
|
||||||
}
|
}
|
||||||
|
|
|
@ -350,22 +350,20 @@
|
||||||
"@webassemblyjs/ast" "1.11.1"
|
"@webassemblyjs/ast" "1.11.1"
|
||||||
"@xtuc/long" "4.2.2"
|
"@xtuc/long" "4.2.2"
|
||||||
|
|
||||||
"@webpack-cli/configtest@^1.2.0":
|
"@webpack-cli/configtest@^2.0.1":
|
||||||
version "1.2.0"
|
version "2.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.2.0.tgz#7b20ce1c12533912c3b217ea68262365fa29a6f5"
|
resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-2.0.1.tgz#a69720f6c9bad6aef54a8fa6ba9c3533e7ef4c7f"
|
||||||
integrity sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg==
|
integrity sha512-njsdJXJSiS2iNbQVS0eT8A/KPnmyH4pv1APj2K0d1wrZcBLw+yppxOy4CGqa0OxDJkzfL/XELDhD8rocnIwB5A==
|
||||||
|
|
||||||
"@webpack-cli/info@^1.5.0":
|
"@webpack-cli/info@^2.0.1":
|
||||||
version "1.5.0"
|
version "2.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.5.0.tgz#6c78c13c5874852d6e2dd17f08a41f3fe4c261b1"
|
resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-2.0.1.tgz#eed745799c910d20081e06e5177c2b2569f166c0"
|
||||||
integrity sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ==
|
integrity sha512-fE1UEWTwsAxRhrJNikE7v4EotYflkEhBL7EbajfkPlf6E37/2QshOy/D48Mw8G5XMFlQtS6YV42vtbG9zBpIQA==
|
||||||
dependencies:
|
|
||||||
envinfo "^7.7.3"
|
|
||||||
|
|
||||||
"@webpack-cli/serve@^1.7.0":
|
"@webpack-cli/serve@^2.0.1":
|
||||||
version "1.7.0"
|
version "2.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.7.0.tgz#e1993689ac42d2b16e9194376cfb6753f6254db1"
|
resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-2.0.1.tgz#34bdc31727a1889198855913db2f270ace6d7bf8"
|
||||||
integrity sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==
|
integrity sha512-0G7tNyS+yW8TdgHwZKlDWYXFA6OJQnoLCQvYKkQP0Q2X205PSQ6RNUj0M+1OB/9gRQaUZ/ccYfaxd0nhaWKfjw==
|
||||||
|
|
||||||
"@xtuc/ieee754@^1.2.0":
|
"@xtuc/ieee754@^1.2.0":
|
||||||
version "1.2.0"
|
version "1.2.0"
|
||||||
|
@ -740,16 +738,16 @@ commander@^2.20.0:
|
||||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
|
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
|
||||||
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==
|
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==
|
||||||
|
|
||||||
commander@^7.0.0:
|
|
||||||
version "7.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7"
|
|
||||||
integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==
|
|
||||||
|
|
||||||
commander@^8.3.0:
|
commander@^8.3.0:
|
||||||
version "8.3.0"
|
version "8.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66"
|
resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66"
|
||||||
integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==
|
integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==
|
||||||
|
|
||||||
|
commander@^9.4.1:
|
||||||
|
version "9.5.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/commander/-/commander-9.5.0.tgz#bc08d1eb5cedf7ccb797a96199d41c7bc3e60d30"
|
||||||
|
integrity sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==
|
||||||
|
|
||||||
compressible@~2.0.16:
|
compressible@~2.0.16:
|
||||||
version "2.0.18"
|
version "2.0.18"
|
||||||
resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.18.tgz#af53cca6b070d4c3c0750fbd77286a6d7cc46fba"
|
resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.18.tgz#af53cca6b070d4c3c0750fbd77286a6d7cc46fba"
|
||||||
|
@ -1564,10 +1562,10 @@ inherits@2.0.3:
|
||||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
|
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
|
||||||
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
|
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
|
||||||
|
|
||||||
interpret@^2.2.0:
|
interpret@^3.1.1:
|
||||||
version "2.2.0"
|
version "3.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/interpret/-/interpret-2.2.0.tgz#1a78a0b5965c40a5416d007ad6f50ad27c417df9"
|
resolved "https://registry.yarnpkg.com/interpret/-/interpret-3.1.1.tgz#5be0ceed67ca79c6c4bc5cf0d7ee843dcea110c4"
|
||||||
integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==
|
integrity sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==
|
||||||
|
|
||||||
invert-kv@^2.0.0:
|
invert-kv@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
|
@ -2243,12 +2241,12 @@ readdirp@~3.6.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
picomatch "^2.2.1"
|
picomatch "^2.2.1"
|
||||||
|
|
||||||
rechoir@^0.7.0:
|
rechoir@^0.8.0:
|
||||||
version "0.7.1"
|
version "0.8.0"
|
||||||
resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.7.1.tgz#9478a96a1ca135b5e88fc027f03ee92d6c645686"
|
resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.8.0.tgz#49f866e0d32146142da3ad8f0eff352b3215ff22"
|
||||||
integrity sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==
|
integrity sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
resolve "^1.9.0"
|
resolve "^1.20.0"
|
||||||
|
|
||||||
relateurl@^0.2.7:
|
relateurl@^0.2.7:
|
||||||
version "0.2.7"
|
version "0.2.7"
|
||||||
|
@ -2298,7 +2296,7 @@ resolve-from@^5.0.0:
|
||||||
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69"
|
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69"
|
||||||
integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==
|
integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==
|
||||||
|
|
||||||
resolve@^1.9.0:
|
resolve@^1.20.0:
|
||||||
version "1.22.1"
|
version "1.22.1"
|
||||||
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177"
|
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177"
|
||||||
integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==
|
integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==
|
||||||
|
@ -2783,22 +2781,23 @@ wbuf@^1.1.0, wbuf@^1.7.3:
|
||||||
dependencies:
|
dependencies:
|
||||||
minimalistic-assert "^1.0.0"
|
minimalistic-assert "^1.0.0"
|
||||||
|
|
||||||
webpack-cli@^4.10:
|
webpack-cli@^5.0:
|
||||||
version "4.10.0"
|
version "5.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.10.0.tgz#37c1d69c8d85214c5a65e589378f53aec64dab31"
|
resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-5.0.1.tgz#95fc0495ac4065e9423a722dec9175560b6f2d9a"
|
||||||
integrity sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w==
|
integrity sha512-S3KVAyfwUqr0Mo/ur3NzIp6jnerNpo7GUO6so51mxLi1spqsA17YcMXy0WOIJtBSnj748lthxC6XLbNKh/ZC+A==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@discoveryjs/json-ext" "^0.5.0"
|
"@discoveryjs/json-ext" "^0.5.0"
|
||||||
"@webpack-cli/configtest" "^1.2.0"
|
"@webpack-cli/configtest" "^2.0.1"
|
||||||
"@webpack-cli/info" "^1.5.0"
|
"@webpack-cli/info" "^2.0.1"
|
||||||
"@webpack-cli/serve" "^1.7.0"
|
"@webpack-cli/serve" "^2.0.1"
|
||||||
colorette "^2.0.14"
|
colorette "^2.0.14"
|
||||||
commander "^7.0.0"
|
commander "^9.4.1"
|
||||||
cross-spawn "^7.0.3"
|
cross-spawn "^7.0.3"
|
||||||
|
envinfo "^7.7.3"
|
||||||
fastest-levenshtein "^1.0.12"
|
fastest-levenshtein "^1.0.12"
|
||||||
import-local "^3.0.2"
|
import-local "^3.0.2"
|
||||||
interpret "^2.2.0"
|
interpret "^3.1.1"
|
||||||
rechoir "^0.7.0"
|
rechoir "^0.8.0"
|
||||||
webpack-merge "^5.7.3"
|
webpack-merge "^5.7.3"
|
||||||
|
|
||||||
webpack-dev-middleware@^5.3.1:
|
webpack-dev-middleware@^5.3.1:
|
||||||
|
@ -2860,10 +2859,10 @@ webpack-sources@^3.2.3:
|
||||||
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde"
|
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde"
|
||||||
integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==
|
integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==
|
||||||
|
|
||||||
webpack@^5.74:
|
webpack@^5.75:
|
||||||
version "5.74.0"
|
version "5.75.0"
|
||||||
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.74.0.tgz#02a5dac19a17e0bb47093f2be67c695102a55980"
|
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.75.0.tgz#1e440468647b2505860e94c9ff3e44d5b582c152"
|
||||||
integrity sha512-A2InDwnhhGN4LYctJj6M1JEaGL7Luj6LOmyBHjcI8529cm5p6VXiTIW2sn6ffvEAKmveLzvu4jrihwXtPojlAA==
|
integrity sha512-piaIaoVJlqMsPtX/+3KTTO6jfvrSYgauFVdt8cr9LTHKmcq/AMd4mhzsiP7ZF/PGRNPGA8336jldh9l2Kt2ogQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/eslint-scope" "^3.7.3"
|
"@types/eslint-scope" "^3.7.3"
|
||||||
"@types/estree" "^0.0.51"
|
"@types/estree" "^0.0.51"
|
||||||
|
|
|
@ -1,13 +1,19 @@
|
||||||
[package]
|
[package]
|
||||||
name = "examples-events"
|
name = "examples-events"
|
||||||
version = "2.0.0"
|
version = "2.0.0"
|
||||||
|
publish = false
|
||||||
authors = ["Andrea Simeoni <andreasimeoni84@gmail.com>"]
|
authors = ["Andrea Simeoni <andreasimeoni84@gmail.com>"]
|
||||||
edition = "2021"
|
|
||||||
|
license.workspace = true
|
||||||
|
rust-version.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
ethers = { path = "../..", version = "2.0.0" }
|
ethers = { workspace = true, features = ["rustls"] }
|
||||||
|
|
||||||
eyre = "0.6"
|
tokio = { workspace = true, features = ["macros"] }
|
||||||
serde = { version = "1.0.144", features = ["derive"] }
|
|
||||||
serde_json = "1.0.64"
|
serde.workspace = true
|
||||||
tokio = { version = "1.18", features = ["macros"] }
|
serde_json.workspace = true
|
||||||
|
|
||||||
|
eyre.workspace = true
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
[package]
|
||||||
|
name = "examples-geth"
|
||||||
|
version = "0.0.0"
|
||||||
|
publish = false
|
||||||
|
authors = ["Andrea Simeoni <andreasimeoni84@gmail.com>"]
|
||||||
|
|
||||||
|
license.workspace = true
|
||||||
|
rust-version.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
ethers.workspace = true
|
||||||
|
|
||||||
|
tokio = { workspace = true, features = ["macros"] }
|
||||||
|
|
||||||
|
serde.workspace = true
|
||||||
|
serde_json.workspace = true
|
||||||
|
|
||||||
|
eyre.workspace = true
|
||||||
|
tempfile.workspace = true
|
|
@ -1,15 +1,18 @@
|
||||||
[package]
|
[package]
|
||||||
name = "examples-middleware"
|
name = "examples-middleware"
|
||||||
version = "2.0.0"
|
version = "2.0.0"
|
||||||
|
publish = false
|
||||||
authors = ["Andrea Simeoni <andreasimeoni84@gmail.com>"]
|
authors = ["Andrea Simeoni <andreasimeoni84@gmail.com>"]
|
||||||
edition = "2021"
|
|
||||||
|
license.workspace = true
|
||||||
|
rust-version.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
ethers = { path = "../..", version = "2.0.0", features = ["rustls", "ws"] }
|
ethers = { workspace = true, features = ["rustls"] }
|
||||||
|
serde.workspace = true
|
||||||
async-trait = { version = "0.1.50", default-features = false }
|
serde_json.workspace = true
|
||||||
eyre = "0.6"
|
tokio = { workspace = true, features = ["macros"] }
|
||||||
serde_json = "1.0.61"
|
async-trait.workspace = true
|
||||||
thiserror = { version = "1.0", default-features = false }
|
thiserror.workspace = true
|
||||||
tokio = { version = "1.18", features = ["macros", "rt", "rt-multi-thread"] }
|
eyre.workspace = true
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,23 @@
|
||||||
[package]
|
[package]
|
||||||
name = "examples-providers"
|
name = "examples-providers"
|
||||||
version = "2.0.0"
|
version = "2.0.0"
|
||||||
|
publish = false
|
||||||
authors = ["Andrea Simeoni <andreasimeoni84@gmail.com>"]
|
authors = ["Andrea Simeoni <andreasimeoni84@gmail.com>"]
|
||||||
edition = "2021"
|
|
||||||
|
license.workspace = true
|
||||||
|
rust-version.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
ethers = { path = "../..", version = "2.0.0", features = ["abigen", "ipc", "rustls", "ws"] }
|
ethers = { workspace = true, features = ["abigen", "ipc", "rustls", "ws"] }
|
||||||
|
|
||||||
eyre = "0.6"
|
tokio = { workspace = true, features = ["macros"] }
|
||||||
reqwest = { version = "0.11.14", default-features = false }
|
async-trait.workspace = true
|
||||||
serde = { version = "1.0.144", features = ["derive"] }
|
reqwest.workspace = true
|
||||||
serde_json = "1.0.64"
|
url.workspace = true
|
||||||
tokio = { version = "1.18", features = ["macros"] }
|
|
||||||
|
|
||||||
async-trait = "0.1"
|
serde.workspace = true
|
||||||
url = "2.3"
|
serde_json.workspace = true
|
||||||
thiserror = "1.0"
|
|
||||||
|
thiserror.workspace = true
|
||||||
|
eyre.workspace = true
|
||||||
|
|
|
@ -1,13 +1,19 @@
|
||||||
[package]
|
[package]
|
||||||
name = "examples-queries"
|
name = "examples-queries"
|
||||||
version = "2.0.0"
|
version = "2.0.0"
|
||||||
|
publish = false
|
||||||
authors = ["Andrea Simeoni <andreasimeoni84@gmail.com>"]
|
authors = ["Andrea Simeoni <andreasimeoni84@gmail.com>"]
|
||||||
edition = "2021"
|
|
||||||
|
license.workspace = true
|
||||||
|
rust-version.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
ethers = { path = "../..", version = "2.0.0", features = ["abigen", "rustls", "ws"] }
|
ethers = { workspace = true, features = ["abigen", "ws", "rustls"] }
|
||||||
|
|
||||||
eyre = "0.6"
|
tokio = { workspace = true, features = ["macros"] }
|
||||||
serde = { version = "1.0.144", features = ["derive"] }
|
|
||||||
serde_json = "1.0.64"
|
serde.workspace = true
|
||||||
tokio = { version = "1.18", features = ["macros"] }
|
serde_json.workspace = true
|
||||||
|
|
||||||
|
eyre.workspace = true
|
||||||
|
|
|
@ -1,13 +1,19 @@
|
||||||
[package]
|
[package]
|
||||||
name = "examples-subscriptions"
|
name = "examples-subscriptions"
|
||||||
version = "2.0.0"
|
version = "2.0.0"
|
||||||
|
publish = false
|
||||||
authors = ["Andrea Simeoni <andreasimeoni84@gmail.com>"]
|
authors = ["Andrea Simeoni <andreasimeoni84@gmail.com>"]
|
||||||
edition = "2021"
|
|
||||||
|
license.workspace = true
|
||||||
|
rust-version.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
ethers = { path = "../..", version = "2.0.0", features = ["abigen", "rustls", "ws"] }
|
ethers = { workspace = true, features = ["abigen", "ws", "rustls"] }
|
||||||
|
|
||||||
eyre = "0.6"
|
tokio = { workspace = true, features = ["macros"] }
|
||||||
serde = { version = "1.0.144", features = ["derive"] }
|
|
||||||
serde_json = "1.0.64"
|
serde.workspace = true
|
||||||
tokio = { version = "1.18", features = ["macros"] }
|
serde_json.workspace = true
|
||||||
|
|
||||||
|
eyre.workspace = true
|
||||||
|
|
|
@ -1,13 +1,19 @@
|
||||||
[package]
|
[package]
|
||||||
name = "examples-transactions"
|
name = "examples-transactions"
|
||||||
version = "2.0.0"
|
version = "2.0.0"
|
||||||
|
publish = false
|
||||||
authors = ["Andrea Simeoni <andreasimeoni84@gmail.com>"]
|
authors = ["Andrea Simeoni <andreasimeoni84@gmail.com>"]
|
||||||
edition = "2021"
|
|
||||||
|
license.workspace = true
|
||||||
|
rust-version.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
ethers = { path = "../..", version = "2.0.0", features = ["abigen", "rustls", "ws"] }
|
ethers = { workspace = true, features = ["abigen", "ws", "rustls"] }
|
||||||
|
|
||||||
eyre = "0.6"
|
tokio = { workspace = true, features = ["macros"] }
|
||||||
serde = { version = "1.0.144", features = ["derive"] }
|
|
||||||
serde_json = "1.0.64"
|
serde.workspace = true
|
||||||
tokio = { version = "1.18", features = ["macros"] }
|
serde_json.workspace = true
|
||||||
|
|
||||||
|
eyre.workspace = true
|
||||||
|
|
|
@ -1,20 +1,25 @@
|
||||||
[package]
|
[package]
|
||||||
name = "examples-wallets"
|
name = "examples-wallets"
|
||||||
version = "2.0.0"
|
version = "2.0.0"
|
||||||
|
publish = false
|
||||||
authors = ["Andrea Simeoni <andreasimeoni84@gmail.com>"]
|
authors = ["Andrea Simeoni <andreasimeoni84@gmail.com>"]
|
||||||
edition = "2021"
|
|
||||||
|
license.workspace = true
|
||||||
|
rust-version.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["ledger", "trezor", "yubi"]
|
default = ["ledger", "trezor", "yubi"]
|
||||||
ledger = []
|
ledger = ["ethers/ledger"]
|
||||||
trezor = []
|
trezor = ["ethers/trezor"]
|
||||||
yubi = []
|
yubi = ["ethers/yubi"]
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
ethers = { path = "../..", version = "2.0.0", features = ["abigen", "eip712", "ledger", "rustls", "trezor", "ws", "yubi"] }
|
ethers = { workspace = true, features = ["abigen", "eip712", "ws", "rustls"] }
|
||||||
|
|
||||||
eyre = "0.6"
|
tokio = { workspace = true, features = ["macros"] }
|
||||||
serde = { version = "1.0.144", features = ["derive"] }
|
|
||||||
serde_json = "1.0.64"
|
|
||||||
tokio = { version = "1.18", features = ["macros"] }
|
|
||||||
|
|
||||||
|
serde.workspace = true
|
||||||
|
serde_json.workspace = true
|
||||||
|
|
||||||
|
eyre.workspace = true
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
consolidate-commits = false
|
|
||||||
consolidate-pushes = true
|
|
Loading…
Reference in New Issue