[−][src]Struct ethers_core::utils::Solc
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
impl Solc
[src]
pub fn new(path: &str) -> Self
[src]
Instantiates the Solc builder for the provided paths
pub fn build_raw(
self
) -> Result<HashMap<String, CompiledContractStr>, SolcError>
[src]
self
) -> Result<HashMap<String, CompiledContractStr>, SolcError>
Gets the ABI for the contracts
pub fn build(self) -> Result<HashMap<String, CompiledContract>, SolcError>
[src]
Builds the contracts and returns a hashmap for each named contract
pub fn version() -> String
[src]
pub fn evm_version(self, version: EvmVersion) -> Self
[src]
Sets the EVM version for compilation
pub fn optimizer(self, runs: usize) -> Self
[src]
Sets the optimizer runs (default = 200)
pub fn allowed_paths(self, paths: Vec<PathBuf>) -> Self
[src]
Sets the allowed paths for using files from outside the same directory
Auto Trait Implementations
impl RefUnwindSafe for Solc
impl Send for Solc
impl Sync for Solc
impl Unpin for Solc
impl UnwindSafe for Solc
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,