1da62d65d2
* feat: add artifacts trait * add artifactsoutput trait * deprecated old artifactoutput * feat: better artifacts handling * force update * feat: update metadata artifacts * feat: add default to types * feat: make useliteralcontent optional * feat: replace ProjectCompilerOutput with struct * docs * add output function * feat: add Artifact trait for reading Abi/Bytes from an artifact * feat(solc): replace () for empty artifacts with a conditional check As discussed with @mattsse the abstraction here might not be super clean, so we should revisit this if we do not like it * chore: fix doctest Co-authored-by: Georgios Konstantopoulos <me@gakonst.com> |
||
---|---|---|
.. | ||
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);
}