Navigation Menu

Skip to content

shawntabrizi/rust_solc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-solc

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

About

easily compile solidity files from rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%