Skip to content
easily compile solidity files from rust
Branch: master
Clone or download
Pull request Compare This branch is even with paritytech:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


this is a work in progress. it works as described in the example. the API might change frequently in the future

Build Status

easily compile solidity files from rust

shells out to solc or solcjs (whichever is available in that order).

either solc (C++) or solcjs (JS) must be installed and in $PATH.
click here to see how to install solc
click here to see how to install solcjs

extern crate solc;

fn main() {
    let input_directory = "./contracts";
    let output_directory = "./contracts";

    // first tries solc
    // then tries solcjs
    // returns error if no compiler available
    solc::compile_dir(&input_directory, &output_directory).unwrap();

    // now `./contracts` contains a `*.bin` and a `*.abi` file
    // for every contract found in `*.sol` file in `./contracts`

this is an early version that likely misses features. open an issue if you're missing something

You can’t perform that action at this time.