23fb877c16
* test: ensure that compilation succeeds * feat: add helper for parsing version req from a source * feat: detect the latest compatible solc version for a VersionReq * default to always enabling svm/async * test: add project with multiple contract versions * fix: always serde-default solc gas estimates * fix: normalize evm version in settings before compiling * feat: auto-detect version and compile if svm+async are on * chore: warnings * test: add a lock to ensure that there are no file conflicts when downloading solc * test: add tests for finding solc installations * chore: add features to ethers-rs config * chore: s/first/latest on finding solc version fn docs Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de> Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de> |
||
---|---|---|
.. | ||
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
[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();
println!("{}", output);
}