diff --git a/crates/cast/bin/cmd/storage.rs b/crates/cast/bin/cmd/storage.rs index 5769360484ad..557b68a1e297 100644 --- a/crates/cast/bin/cmd/storage.rs +++ b/crates/cast/bin/cmd/storage.rs @@ -266,7 +266,7 @@ fn print_storage(layout: StorageLayout, values: Vec, pretty: bool) storage_type.map_or("?", |t| &t.label), &slot.slot, &slot.offset.to_string(), - &storage_type.map_or("?", |t| &t.number_of_bytes), + storage_type.map_or("?", |t| &t.number_of_bytes), &converted_value.to_string(), &value.to_string(), &slot.contract, diff --git a/crates/forge/bin/cmd/inspect.rs b/crates/forge/bin/cmd/inspect.rs index 37912e1c2d98..e85fc37b0972 100644 --- a/crates/forge/bin/cmd/inspect.rs +++ b/crates/forge/bin/cmd/inspect.rs @@ -184,7 +184,7 @@ pub fn print_storage_layout(storage_layout: Option<&StorageLayout>, pretty: bool storage_type.map_or("?", |t| &t.label), &slot.slot, &slot.offset.to_string(), - &storage_type.map_or("?", |t| &t.number_of_bytes), + storage_type.map_or("?", |t| &t.number_of_bytes), &slot.contract, ]); } diff --git a/crates/forge/bin/cmd/test/mod.rs b/crates/forge/bin/cmd/test/mod.rs index 1a8cf9eed418..10d188c4b6a2 100644 --- a/crates/forge/bin/cmd/test/mod.rs +++ b/crates/forge/bin/cmd/test/mod.rs @@ -742,7 +742,7 @@ mod tests { // #[test] - fn issue_5913() { + fn fuzz_seed_exists() { let args: TestArgs = TestArgs::parse_from(["foundry-cli", "-vvv", "--gas-report", "--fuzz-seed", "0x10"]); assert!(args.fuzz_seed.is_some()); diff --git a/crates/forge/src/link.rs b/crates/forge/src/link.rs index 6b67bd03bda3..3779f69caf26 100644 --- a/crates/forge/src/link.rs +++ b/crates/forge/src/link.rs @@ -26,7 +26,7 @@ pub struct Linker { /// Root of the project, used to determine whether artifact/library path can be stripped. pub root: PathBuf, /// Compilation artifacts. - contracts: ArtifactContracts, + pub contracts: ArtifactContracts, } /// Output of the `link_with_nonce_or_address` diff --git a/crates/forge/src/multi_runner.rs b/crates/forge/src/multi_runner.rs index eb68a3067cc4..5cfd59d2752a 100644 --- a/crates/forge/src/multi_runner.rs +++ b/crates/forge/src/multi_runner.rs @@ -10,7 +10,7 @@ use alloy_primitives::{Address, Bytes, U256}; use eyre::{OptionExt, Result}; use foundry_common::{ContractsByArtifact, TestFunctionExt}; use foundry_compilers::{ - artifacts::CompactContractBytecode, Artifact, ArtifactId, ArtifactOutput, ProjectCompileOutput, + contracts::ArtifactContracts, Artifact, ArtifactId, ArtifactOutput, ProjectCompileOutput, }; use foundry_evm::{ backend::Backend, @@ -267,13 +267,12 @@ impl MultiContractRunnerBuilder { { let output = output.with_stripped_file_prefixes(&root); // This is just the contracts compiled, but we need to merge this with the read cached - // artifacts + // artifacts. let contracts = output .into_artifacts() .map(|(i, c)| (i, c.into_contract_bytecode())) - .collect::>(); + .collect::(); - let mut known_contracts = ContractsByArtifact::default(); let source_paths = contracts .iter() .map(|(i, _)| (i.identifier(), root.as_ref().join(&i.source).to_string_lossy().into())) @@ -281,17 +280,16 @@ impl MultiContractRunnerBuilder { // create a mapping of name => (abi, deployment code, Vec) let mut deployable_contracts = DeployableContracts::default(); - let artifact_contracts = contracts.iter().cloned().collect(); - - let linker = Linker::new(root.as_ref(), artifact_contracts); + let linker = Linker::new(root.as_ref(), contracts); - for (id, contract) in contracts { + let mut known_contracts = ContractsByArtifact::default(); + for (id, contract) in &linker.contracts.0 { let abi = contract.abi.as_ref().ok_or_eyre("we should have an abi by now")?; let LinkOutput { libs_to_deploy, libraries } = - linker.link_with_nonce_or_address(Default::default(), evm_opts.sender, 1, &id)?; + linker.link_with_nonce_or_address(Default::default(), evm_opts.sender, 1, id)?; - let linked_contract = linker.link(&id, &libraries)?; + let linked_contract = linker.link(id, &libraries)?; // get bytes if deployable, else add to known contracts and continue. // interfaces and abstract contracts should be known to enable fuzzing of their ABI