diff --git a/crates/artifacts/solc/src/output_selection.rs b/crates/artifacts/solc/src/output_selection.rs index 939ac932..e39e28d0 100644 --- a/crates/artifacts/solc/src/output_selection.rs +++ b/crates/artifacts/solc/src/output_selection.rs @@ -379,7 +379,7 @@ impl FromStr for EvmOutputSelection { match s { "evm" => Ok(Self::All), "asm" | "evm.assembly" => Ok(Self::Assembly), - "evm.legacyAssembly" => Ok(Self::LegacyAssembly), + "legacyAssembly" | "evm.legacyAssembly" => Ok(Self::LegacyAssembly), "methodidentifiers" | "evm.methodIdentifiers" | "evm.methodidentifiers" => { Ok(Self::MethodIdentifiers) } diff --git a/crates/compilers/src/artifact_output/configurable.rs b/crates/compilers/src/artifact_output/configurable.rs index d17e3235..d5724bf2 100644 --- a/crates/compilers/src/artifact_output/configurable.rs +++ b/crates/compilers/src/artifact_output/configurable.rs @@ -751,8 +751,8 @@ impl ExtraOutputFiles { ) -> Result<(), SolcError> { if self.legacy_assembly { if let Some(legacy_asm) = asm { - let file = file.with_extension("legacyAssembly"); - fs::write(&file, legacy_asm.as_str().unwrap_or_default()) + let file = file.with_extension("legacyAssembly.json"); + fs::write(&file, format!("{legacy_asm}")) .map_err(|err| SolcError::io(err, file))? } } @@ -824,6 +824,7 @@ impl ExtraOutputFiles { let evm = contract.evm.as_ref(); self.process_assembly(evm.and_then(|evm| evm.assembly.as_deref()), file)?; + self.process_legacy_assembly(evm.and_then(|evm| evm.legacy_assembly.clone()), file)?; let bytecode = evm.and_then(|evm| evm.bytecode.as_ref()); self.process_generated_sources(bytecode.map(|b| &b.generated_sources), file)?;