diff --git a/ethers-solc/src/artifacts.rs b/ethers-solc/src/artifacts.rs index 3ba04a3b..cc92aaea 100644 --- a/ethers-solc/src/artifacts.rs +++ b/ethers-solc/src/artifacts.rs @@ -39,6 +39,13 @@ impl CompilerInput { Self { language: "Solidity".to_string(), sources, settings: Default::default() } } + /// Sets the settings for compilation + #[must_use] + pub fn settings(mut self, settings: Settings) -> Self { + self.settings = settings; + self + } + /// Sets the EVM version for compilation #[must_use] pub fn evm_version(mut self, version: EvmVersion) -> Self { diff --git a/ethers-solc/src/lib.rs b/ethers-solc/src/lib.rs index 082f3291..4056f2db 100644 --- a/ethers-solc/src/lib.rs +++ b/ethers-solc/src/lib.rs @@ -335,6 +335,7 @@ impl Project { paths.extend(map); let input = CompilerInput::with_sources(sources) + .settings(self.solc_config.settings.clone()) .normalize_evm_version(&solc.version()?) .with_remappings(self.paths.remappings.clone()); @@ -397,7 +398,7 @@ impl Project { let sources = paths.set_source_names(sources); let input = CompilerInput::with_sources(sources) - .evm_version(self.solc_config.settings.evm_version.unwrap_or_default()) + .settings(self.solc_config.settings.clone()) .normalize_evm_version(&solc.version()?) .with_remappings(self.paths.remappings.clone());