f0dea75219
* feat(ethers-solc): deserialize bytecode as bytes * feat(ethers-solc): add method to fetch compact contract * feat(ethers-solc): use Abi type instead of Vec<serde_json::Value> * test(contract): use new Solc bindings * test(middleware): use new Solc bindings * chore: remove solc from ethers-core * chore: remove concurrent setup code from ethers-core * feat(ethers-solc): add ArtifactOutput::Nothing as a no-op artifact logger * feat: add ethers-solc to top level crate * examples: use new solc building pattern * chore(solc): re-use opt str impl for error code decoding * fix abigen example * chore: fix doctests * chore: remove setup feature * fix: decode string to bytes correctly * chore: clippy lints |
||
---|---|---|
.. | ||
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);
}