da743fc8b2
* ci: move to scripts directory
* nits
* ci: improve main CI jobs
* fix: install script
* fix
* fix: use curl for windows installation
* fix: wasm typo
* tests: move to single binary
* chore: clippy
* chore: clippy
* chore: clippy
* fix: test command
* fix: quote tests
* update script
* fix: action exclude
* fix: dev deps
* fix: only run wasm in own job
* ci: add aarch64 targets
* test: rm useless test
* ci: update security audit
* ci: add deny CI
* chore: rm unused audit.toml
* chore: update geth.rs
* ci: remove unusable targets
* fix: install script path
* fix: wasm
* improve script
* fix: failing ci
* fix: contract tests
* ci: improve install script
* update middleware tests
* move integration etherscan tests to tests/ dir
* fix: eip2930 access_list field name
* add pendingtransaction must_use
* add random anvil comment
* ci: add miri job
* ci: simplify
* fixci
* Revert "add pendingtransaction must_use"
This reverts commit
|
||
---|---|---|
.. | ||
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();
}