From fb81c058d6cc3c09884aebff69c1018047dad919 Mon Sep 17 00:00:00 2001 From: Nisheeth Barthwal Date: Tue, 9 Jul 2024 17:00:52 +0200 Subject: [PATCH] fix create --- crates/forge/bin/cmd/create.rs | 5 +++-- crates/forge/bin/cmd/test/mod.rs | 5 +++-- crates/forge/src/multi_runner.rs | 5 +++-- crates/script/src/receipts.rs | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/crates/forge/bin/cmd/create.rs b/crates/forge/bin/cmd/create.rs index 3c01a4cec..6bcbec051 100644 --- a/crates/forge/bin/cmd/create.rs +++ b/crates/forge/bin/cmd/create.rs @@ -118,7 +118,8 @@ impl CreateArgs { let config = self.opts.try_load_config_emit_warnings()?; let zk_project = foundry_zksync_compiler::create_project(&config, config.cache, false)?; let zk_compiler = ProjectCompiler::new().quiet(self.json || self.opts.silent); - let mut zk_output = zk_compiler.zksync_compile(&zk_project)?; + let mut zk_output = + zk_compiler.zksync_compile(&zk_project, config.zksync.avoid_contracts())?; let artifact = remove_zk_contract(&mut zk_output, &target_path, &self.contract.name)?; @@ -650,6 +651,7 @@ impl CreateArgs { evm_version: self.opts.compiler.evm_version, show_standard_json_input: self.show_standard_json_input, guess_constructor_args: false, + zksync: true, }; println!("Waiting for {} to detect contract deployment...", verify.verifier.verifier); verify.run().await @@ -765,7 +767,6 @@ where P: Provider, T: Transport + Clone, { - /// Set zksync's factory deps. pub fn set_zk_factory_deps(mut self, deps: Vec>) -> Self { self.zk_factory_deps = Some(deps); diff --git a/crates/forge/bin/cmd/test/mod.rs b/crates/forge/bin/cmd/test/mod.rs index cfa88d6f7..66ed97a34 100644 --- a/crates/forge/bin/cmd/test/mod.rs +++ b/crates/forge/bin/cmd/test/mod.rs @@ -282,8 +282,9 @@ impl TestArgs { .quiet_if(self.json || self.opts.silent) .files(sources_to_compile); - let zk_output = zk_compiler.zksync_compile(&zk_project)?; - let dual_compiled_contracts = DualCompiledContracts::new(&output, &zk_output, &project.paths); + let zk_output = zk_compiler.zksync_compile(&zk_project, None)?; + let dual_compiled_contracts = + DualCompiledContracts::new(&output, &zk_output, &project.paths); (Some(zk_output), Some(dual_compiled_contracts)) } else { (None, None) diff --git a/crates/forge/src/multi_runner.rs b/crates/forge/src/multi_runner.rs index 772ffece0..489705dab 100644 --- a/crates/forge/src/multi_runner.rs +++ b/crates/forge/src/multi_runner.rs @@ -9,8 +9,9 @@ use alloy_primitives::{Address, Bytes, U256}; use eyre::Result; use foundry_common::{get_contract_name, ContractsByArtifact, TestFunctionExt}; use foundry_compilers::{ - artifacts::Libraries, compilers::Compiler, Artifact, ArtifactId, ProjectCompileOutput, - zksync::compile::output::ProjectCompileOutput as ZkProjectCompileOutput, + artifacts::Libraries, compilers::Compiler, + zksync::compile::output::ProjectCompileOutput as ZkProjectCompileOutput, Artifact, ArtifactId, + ProjectCompileOutput, }; use foundry_config::Config; use foundry_evm::{ diff --git a/crates/script/src/receipts.rs b/crates/script/src/receipts.rs index c8582ef9e..a080e2e0d 100644 --- a/crates/script/src/receipts.rs +++ b/crates/script/src/receipts.rs @@ -2,7 +2,7 @@ use alloy_chains::Chain; use alloy_primitives::{utils::format_units, TxHash, U256}; use alloy_provider::{PendingTransactionBuilder, Provider}; use alloy_rpc_types::AnyTransactionReceipt; -use eyre::{Context, Result}; +use eyre::Result; use foundry_common::provider::RetryProvider; use std::time::Duration;