ethers-rs/ethers-solc
Matthias Seitz 1cb43a3df3
feat: add solc svm find support (#547)
* feat: add solc svm find support

* feat: add svm install

* feat: add full feature

* make home non wasm32 only

* simplify features

* make compile with wasm target

* fix: doctests
2021-10-31 16:41:36 +02:00
..
src feat: add solc svm find support (#547) 2021-10-31 16:41:36 +02:00
test-data feat: improved solc management (#539) 2021-10-30 20:59:44 +03:00
tests feat: improved solc management (#539) 2021-10-30 20:59:44 +03:00
Cargo.toml feat: add solc svm find support (#547) 2021-10-31 16:41:36 +02: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);
}