Struct ethers_core::utils::Solc [−][src]
pub struct Solc { pub paths: Vec<String>, pub optimizer: usize, pub evm_version: EvmVersion, pub allowed_paths: Vec<PathBuf>, }
Expand description
Solidity Compiler Bindings
Assumes that solc
is installed and available in the caller’s $PATH. Any calls
will panic otherwise.
By default, it uses 200 optimizer runs and Istanbul as the EVM version
Examples
use ethers::utils::Solc; // Give it a glob let contracts = Solc::new("./contracts/*") .optimizer(200) .build()?; // this will return None if the specified contract did not exist in the compiled // files let contract = contracts.get("SimpleStorage").expect("contract not found");
Fields
paths: Vec<String>
The path where contracts will be read from
optimizer: usize
Number of runs
evm_version: EvmVersion
Evm Version
allowed_paths: Vec<PathBuf>
Paths for importing other libraries
Implementations
Gets the ABI for the contracts
Builds the contracts and returns a hashmap for each named contract
Sets the EVM version for compilation
Sets the allowed paths for using files from outside the same directory