439a0c7de0
* 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 |
||
---|---|---|
.. | ||
benches | ||
src | ||
test-data | ||
tests | ||
Cargo.toml | ||
README.md |
README.md
ethers-solc
Utilities for working with native solc
and compiling projects.
To also compile contracts during cargo build
(so that ethers abigen!
can pull in updated abi automatically) you can configure a ethers_solc::Project
in your build.rs
file
First add ethers-solc
to your cargo build-dependencies.
Once you compiled the project, you can configure cargo change detection with rerun_if_sources_changed
, so that cargo will execute the build.rs
file if a contract in the sources directory has changed
[build-dependencies]
ethers-solc = { git = "https://github.com/gakonst/ethers-rs" }
use ethers_solc::{Project, ProjectPathsConfig};
fn main() {
// configure the project with all its paths, solc, cache etc.
let project = Project::builder()
.paths(ProjectPathsConfig::hardhat(env!("CARGO_MANIFEST_DIR")).unwrap())
.build()
.unwrap();
let output = project.compile().unwrap();
// Tell Cargo that if a source file changes, to rerun this build script.
project.rerun_if_sources_changed();
}