#solidity #solc #wrapper

elabs-solc

Elabs Solc: The solc wrapper

2 releases

0.1.1 Feb 9, 2022
0.1.0 Feb 9, 2022

#19 in #solc

GPL-3.0 license

15KB
52 lines

Elabs

Elabs-solc is a wrapper around the Solidity compiler. It is designed to be used as a library, and not as a command line tool. It will wrap solc cli tools, and provide a simple interface to compile solidity contracts.

Usage

To use the library, you need to import it in your project:

[dependencies]
elabs-solc = "0.1"

Example

use elabs_solc::Solc;

fn main() {
	let solc = Solc::new();
	let input_path = "contracts/Simple.sol";
	let output_path = "artifacts";
	match solc.compile(input_path, output_path, vec![]) {
		Ok(_) => println!("{} compiled", input_path),
		Err(e) => panic!("{}", e),
	}
}

lib.rs:

Elabs

Elabs-solc is a wrapper around the Solidity compiler. It is designed to be used as a library, and not as a command line tool. It will wrap solc cli tools, and provide a simple interface to compile solidity contracts.

Usage

To use the library, you need to import it in your project:

[dependencies]
elabs-solc = "0.1"

Example

use elabs_solc::Solc;

fn main() {
       let solc = Solc::new();
       let input_path = "contracts/Simple.sol";
       let output_path = "artifacts";
       match solc.compile(input_path, output_path, vec![]) {
   	    Ok(_) => println!("{} compiled", input_path),
   	    Err(e) => panic!("{}", e),
       }
}

No runtime deps