ethers-rs/ethers-solc
Georgios Konstantopoulos b61adcfd30 chore(solc): fix flaky integration test
When running integration tests, the `cfg(test)` is not triggered, so we
added a `tests` feature in the code. However, we did not include it
in the actual features of the crate, so it was not getting triggered
when the `--all-features` tests were running.
2021-11-05 18:23:47 +00:00
..
src fix: failing test and check --all-targets in ci (#560) 2021-11-05 19:58:03 +02:00
test-data feat(solc): Multiple Solc Version detection (#551) 2021-11-03 10:05:09 +02:00
tests feat(solc): Multiple Solc Version detection (#551) 2021-11-03 10:05:09 +02:00
Cargo.toml chore(solc): fix flaky integration test 2021-11-05 18:23:47 +00:00
README.md feat: improved solc management (#539) 2021-10-30 20:59:44 +03:00

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);
}