Struct ethers_solc::artifacts::CompilerInput
source · [−]Expand description
Input type solc
expects
Fields
language: String
sources: Sources
settings: Settings
Implementations
sourceimpl CompilerInput
impl CompilerInput
sourcepub fn new(path: impl AsRef<Path>) -> Result<Vec<Self>, SolcIoError>
pub fn new(path: impl AsRef<Path>) -> Result<Vec<Self>, SolcIoError>
Reads all contracts found under the path
sourcepub fn with_sources(sources: Sources) -> Vec<Self>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
pub fn with_sources(sources: Sources) -> Vec<Self>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Creates a new CompilerInputs with default settings and the given sources
A CompilerInput expects a language setting, supported by solc are solidity or yul.
In case the sources
is a mix of solidity and yul files, 2 CompilerInputs are returned
sourcepub fn sanitized(self, version: &Version) -> Self
pub fn sanitized(self, version: &Version) -> Self
This will remove/adjust values in the CompilerInput
that are not compatible with this
version
sourcepub fn evm_version(self, version: EvmVersion) -> Self
pub fn evm_version(self, version: EvmVersion) -> Self
Sets the EVM version for compilation
sourcepub fn normalize_evm_version(self, version: &Version) -> Self
pub fn normalize_evm_version(self, version: &Version) -> Self
Normalizes the EVM version used in the settings to be up to the latest one supported by the provided compiler version.
pub fn with_remappings(self, remappings: Vec<Remapping>) -> Self
sourcepub fn join_path(self, root: impl AsRef<Path>) -> Self
pub fn join_path(self, root: impl AsRef<Path>) -> Self
Sets the path of the source files to root
adjoined to the existing path
sourcepub fn strip_prefix(self, base: impl AsRef<Path>) -> Self
pub fn strip_prefix(self, base: impl AsRef<Path>) -> Self
Removes the base
path from all source files
sourcepub fn with_base_path(self, base: impl AsRef<Path>) -> Self
pub fn with_base_path(self, base: impl AsRef<Path>) -> Self
Similar to Self::strip_prefix()
. Remove a base path from all
sources and all paths in solc settings such as remappings
See also solc --base-path
sourcepub fn is_yul(&self) -> bool
pub fn is_yul(&self) -> bool
The flag indicating whether the current CompilerInput is constructed for the yul sources
Trait Implementations
sourceimpl Clone for CompilerInput
impl Clone for CompilerInput
sourcefn clone(&self) -> CompilerInput
fn clone(&self) -> CompilerInput
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more