From 857bb7c543f4ff8b3eba160a27e29a9bd693347c Mon Sep 17 00:00:00 2001 From: Avory Date: Sun, 7 Dec 2025 13:59:40 +0200 Subject: [PATCH 01/10] Refactor verification process to use join_all --- crates/script/src/verify.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/script/src/verify.rs b/crates/script/src/verify.rs index ceec637e66661..0d6445f37d214 100644 --- a/crates/script/src/verify.rs +++ b/crates/script/src/verify.rs @@ -11,6 +11,7 @@ use foundry_cli::opts::{EtherscanOpts, ProjectPathOpts}; use foundry_common::ContractsByArtifact; use foundry_compilers::{Project, artifacts::EvmVersion, info::ContractInfo}; use foundry_config::{Chain, Config}; +use futures::future::join_all; use semver::Version; /// State after we have broadcasted the script. @@ -239,10 +240,11 @@ async fn verify_contracts( check_unverified(sequence, unverifiable_contracts, verify); let num_verifications = future_verifications.len(); - let mut num_of_successful_verifications = 0; sh_println!("##\nStart verification for ({num_verifications}) contracts")?; - for verification in future_verifications { - match verification.await { + let results = join_all(future_verifications).await; + let mut num_of_successful_verifications = 0; + for result in results { + match result { Ok(_) => { num_of_successful_verifications += 1; } From 17fd683e1086f4f260660f4425cd1b7ce8f5f5e1 Mon Sep 17 00:00:00 2001 From: Avory Date: Sun, 7 Dec 2025 16:30:46 +0200 Subject: [PATCH 02/10] Add VerificationProgressState for contract verification --- crates/script/src/progress.rs | 86 +++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/crates/script/src/progress.rs b/crates/script/src/progress.rs index 314c4d4983f3a..2349db36a0877 100644 --- a/crates/script/src/progress.rs +++ b/crates/script/src/progress.rs @@ -1,6 +1,7 @@ use crate::receipts::{PendingReceiptError, TxStatus, check_tx_status, format_receipt}; use alloy_chains::Chain; use alloy_primitives::{ + Address, B256, map::{B256HashMap, HashMap}, }; @@ -285,3 +286,88 @@ Add `--resume` to your command to try and continue broadcasting the transactions Ok(()) } } + +/// State of [ProgressBar]s displayed for contract verification. +/// Shows progress of all contracts being verified. +/// For each contract an individual progress bar is displayed. +/// When a contract verification completes, their progress is removed and result summary is displayed. +#[derive(Debug)] +pub struct VerificationProgressState { + /// Main [MultiProgress] instance showing progress for all verifications. + multi: MultiProgress, + /// Progress bar counting completed / remaining verifications. + overall_progress: ProgressBar, + /// Individual contract verification progress. + contracts_progress: HashMap, +} + +impl VerificationProgressState { + /// Creates overall verification progress state. + pub fn new(contracts_len: usize) -> Self { + let multi = MultiProgress::new(); + let overall_progress = multi.add(ProgressBar::new(contracts_len as u64)); + overall_progress.set_style( + indicatif::ProgressStyle::with_template("{bar:40.cyan/blue} {pos:>7}/{len:7} {msg}") + .unwrap() + .progress_chars("##-"), + ); + overall_progress.set_message("verifications completed"); + Self { multi, overall_progress, contracts_progress: HashMap::default() } + } + + /// Creates new contract verification progress and add it to overall progress. + pub fn start_contract_progress(&mut self, address: Address, contract_name: Option<&str>) { + let contract_progress = self.multi.add(ProgressBar::new_spinner()); + contract_progress.set_style( + indicatif::ProgressStyle::with_template("{spinner} {wide_msg:.bold.dim}") + .unwrap() + .tick_chars("⠁⠂⠄⡀⢀⠠⠐⠈ "), + ); + let display_name = contract_name + .map(|n| format!("{n} ({address})")) + .unwrap_or_else(|| format!("{address}")); + contract_progress.set_message(format!("{display_name} ")); + contract_progress.enable_steady_tick(Duration::from_millis(100)); + self.contracts_progress.insert(address, contract_progress); + } + + /// Prints contract verification result summary and removes it from overall progress. + pub fn end_contract_progress(&mut self, address: Address, success: bool, error: Option<&str>) { + if let Some(contract_progress) = self.contracts_progress.remove(&address) { + self.multi.suspend(|| { + let status = if success { + "✓ Verified".green() + } else { + "✗ Failed".red() + }; + if let Some(err) = error { + let _ = sh_println!("{address}\n ↪ {status}: {err}"); + } else { + let _ = sh_println!("{address}\n ↪ {status}"); + } + }); + contract_progress.finish_and_clear(); + // Increment overall progress bar to reflect completed verification. + self.overall_progress.inc(1); + } + } + + /// Removes overall verification progress. + pub fn clear(&mut self) { + self.multi.clear().unwrap(); + } +} + +/// Cloneable wrapper around [VerificationProgressState]. +#[derive(Debug, Clone)] +pub struct VerificationProgress { + pub inner: Arc>, +} + +impl VerificationProgress { + pub fn new(contracts_len: usize) -> Self { + Self { + inner: Arc::new(RwLock::new(VerificationProgressState::new(contracts_len))), + } + } +} From 86f7a0a5ff180c2013fecded5304e904e6eaa0e8 Mon Sep 17 00:00:00 2001 From: Avory Date: Sun, 7 Dec 2025 16:31:04 +0200 Subject: [PATCH 03/10] Update verification process to include contract names --- crates/script/src/verify.rs | 76 ++++++++++++++++++++++++++++++++----- 1 file changed, 67 insertions(+), 9 deletions(-) diff --git a/crates/script/src/verify.rs b/crates/script/src/verify.rs index 0d6445f37d214..a71ebe1aa439a 100644 --- a/crates/script/src/verify.rs +++ b/crates/script/src/verify.rs @@ -1,6 +1,7 @@ use crate::{ ScriptArgs, ScriptConfig, build::LinkedBuildData, + progress::VerificationProgress, sequence::{ScriptSequenceKind, get_commit_hash}, }; use alloy_primitives::{Address, hex}; @@ -103,6 +104,7 @@ impl VerifyBundle { /// Given a `VerifyBundle` and contract details, it tries to generate a valid `VerifyArgs` to /// use against the `contract_address`. + /// Returns both the VerifyArgs and the contract name if found. pub fn get_verify_args( &self, contract_address: Address, @@ -110,7 +112,7 @@ impl VerifyBundle { data: &[u8], libraries: &[String], evm_version: EvmVersion, - ) -> Option { + ) -> Option<(VerifyArgs, String)> { for (artifact, contract) in self.known_contracts.iter() { let Some(bytecode) = contract.bytecode() else { continue }; // If it's a CREATE2, the tx.data comes with a 32-byte salt in the beginning @@ -141,6 +143,7 @@ impl VerifyBundle { artifact.version.patch, ); + let contract_name = contract.name.clone(); let verify = VerifyArgs { address: contract_address, contract: Some(contract), @@ -169,7 +172,7 @@ impl VerifyBundle { creation_transaction_hash: None, }; - return Some(verify); + return Some((verify, contract_name)); } } None @@ -191,7 +194,8 @@ async fn verify_contracts( { trace!(target: "script", "prepare future verifications"); - let mut future_verifications = Vec::with_capacity(sequence.receipts.len()); + // Store verification info: (address, contract_name, future) + let mut verification_tasks = Vec::new(); let mut unverifiable_contracts = vec![]; // Make sure the receipts have the right order first. @@ -215,7 +219,9 @@ async fn verify_contracts( &sequence.libraries, config.evm_version, ) { - Some(verify) => future_verifications.push(verify.run()), + Some((verify_args, contract_name)) => { + verification_tasks.push((address, Some(contract_name), verify_args.run())); + } None => unverifiable_contracts.push(address), }; } @@ -229,31 +235,83 @@ async fn verify_contracts( &sequence.libraries, config.evm_version, ) { - Some(verify) => future_verifications.push(verify.run()), + Some((verify_args, contract_name)) => { + verification_tasks.push((*address, Some(contract_name), verify_args.run())); + } None => unverifiable_contracts.push(*address), }; } } - trace!(target: "script", "collected {} verification jobs and {} unverifiable contracts", future_verifications.len(), unverifiable_contracts.len()); + trace!(target: "script", "collected {} verification jobs and {} unverifiable contracts", verification_tasks.len(), unverifiable_contracts.len()); check_unverified(sequence, unverifiable_contracts, verify); - let num_verifications = future_verifications.len(); + let num_verifications = verification_tasks.len(); + if num_verifications == 0 { + return Ok(()); + } + + // Create progress tracker + let progress = VerificationProgress::new(num_verifications); + let progress_ref = &progress; + + // Start progress for all contracts + for (address, contract_name, _) in &verification_tasks { + progress_ref + .inner + .write() + .start_contract_progress(*address, contract_name.as_deref()); + } + + // Wrap each verification future to track progress + let futures_with_progress: Vec<_> = verification_tasks + .into_iter() + .map(|(address, _contract_name, future)| { + let progress = progress_ref.clone(); + async move { + let result = future.await; + let (success, error) = match &result { + Ok(_) => (true, None), + Err(err) => (false, Some(err.to_string())), + }; + progress + .inner + .write() + .end_contract_progress(address, success, error.as_deref()); + result + } + }) + .collect(); + sh_println!("##\nStart verification for ({num_verifications}) contracts")?; - let results = join_all(future_verifications).await; + let results = join_all(futures_with_progress).await; + + // Collect all errors and successes let mut num_of_successful_verifications = 0; + let mut errors = Vec::new(); + for result in results { match result { Ok(_) => { num_of_successful_verifications += 1; } Err(err) => { - sh_err!("Failed to verify contract: {err:#}")?; + errors.push(err); } } } + // Clear progress display + progress.inner.write().clear(); + + // Report results + if !errors.is_empty() { + for err in &errors { + sh_err!("Failed to verify contract: {err:#}")?; + } + } + if num_of_successful_verifications < num_verifications { return Err(eyre!( "Not all ({num_of_successful_verifications} / {num_verifications}) contracts were verified!" From 2fe76452fdedeccf857f07b87c8af14617cefe5f Mon Sep 17 00:00:00 2001 From: Avory Date: Sun, 7 Dec 2025 16:34:08 +0200 Subject: [PATCH 04/10] fmt --- crates/script/src/verify.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/crates/script/src/verify.rs b/crates/script/src/verify.rs index a71ebe1aa439a..61d74f83b0b43 100644 --- a/crates/script/src/verify.rs +++ b/crates/script/src/verify.rs @@ -258,10 +258,7 @@ async fn verify_contracts( // Start progress for all contracts for (address, contract_name, _) in &verification_tasks { - progress_ref - .inner - .write() - .start_contract_progress(*address, contract_name.as_deref()); + progress_ref.inner.write().start_contract_progress(*address, contract_name.as_deref()); } // Wrap each verification future to track progress @@ -275,10 +272,11 @@ async fn verify_contracts( Ok(_) => (true, None), Err(err) => (false, Some(err.to_string())), }; - progress - .inner - .write() - .end_contract_progress(address, success, error.as_deref()); + progress.inner.write().end_contract_progress( + address, + success, + error.as_deref(), + ); result } }) From 58d47b106de33de37fe56888dd8f4b156699c4c6 Mon Sep 17 00:00:00 2001 From: Avory Date: Sun, 7 Dec 2025 16:34:26 +0200 Subject: [PATCH 05/10] fm --- crates/script/src/progress.rs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/crates/script/src/progress.rs b/crates/script/src/progress.rs index 2349db36a0877..9cf1998aef9e4 100644 --- a/crates/script/src/progress.rs +++ b/crates/script/src/progress.rs @@ -1,8 +1,7 @@ use crate::receipts::{PendingReceiptError, TxStatus, check_tx_status, format_receipt}; use alloy_chains::Chain; use alloy_primitives::{ - Address, - B256, + Address, B256, map::{B256HashMap, HashMap}, }; use eyre::Result; @@ -290,7 +289,8 @@ Add `--resume` to your command to try and continue broadcasting the transactions /// State of [ProgressBar]s displayed for contract verification. /// Shows progress of all contracts being verified. /// For each contract an individual progress bar is displayed. -/// When a contract verification completes, their progress is removed and result summary is displayed. +/// When a contract verification completes, their progress is removed and result summary is +/// displayed. #[derive(Debug)] pub struct VerificationProgressState { /// Main [MultiProgress] instance showing progress for all verifications. @@ -335,11 +335,7 @@ impl VerificationProgressState { pub fn end_contract_progress(&mut self, address: Address, success: bool, error: Option<&str>) { if let Some(contract_progress) = self.contracts_progress.remove(&address) { self.multi.suspend(|| { - let status = if success { - "✓ Verified".green() - } else { - "✗ Failed".red() - }; + let status = if success { "✓ Verified".green() } else { "✗ Failed".red() }; if let Some(err) = error { let _ = sh_println!("{address}\n ↪ {status}: {err}"); } else { @@ -366,8 +362,6 @@ pub struct VerificationProgress { impl VerificationProgress { pub fn new(contracts_len: usize) -> Self { - Self { - inner: Arc::new(RwLock::new(VerificationProgressState::new(contracts_len))), - } + Self { inner: Arc::new(RwLock::new(VerificationProgressState::new(contracts_len))) } } } From af2b0fa751829e8d4e6d8d9f3ead43ef9984ff37 Mon Sep 17 00:00:00 2001 From: Avory Date: Mon, 8 Dec 2025 19:42:36 +0200 Subject: [PATCH 06/10] Enhance contract verification progress tracking Added contract details tracking and inline updates for verification progress. --- crates/script/src/progress.rs | 80 +++++++++++++++++++++++++++++++---- 1 file changed, 72 insertions(+), 8 deletions(-) diff --git a/crates/script/src/progress.rs b/crates/script/src/progress.rs index 9cf1998aef9e4..9eaa365b2cd8b 100644 --- a/crates/script/src/progress.rs +++ b/crates/script/src/progress.rs @@ -6,8 +6,10 @@ use alloy_primitives::{ }; use eyre::Result; use forge_script_sequence::ScriptSequence; +use forge_verify::provider::VerificationProviderType; use foundry_cli::utils::init_progress; use foundry_common::{provider::RetryProvider, shell}; +use foundry_compilers::artifacts::EvmVersion; use futures::StreamExt; use indicatif::{MultiProgress, ProgressBar, ProgressStyle}; use parking_lot::RwLock; @@ -299,6 +301,8 @@ pub struct VerificationProgressState { overall_progress: ProgressBar, /// Individual contract verification progress. contracts_progress: HashMap, + /// Contract details for display. + contract_details: HashMap, } impl VerificationProgressState { @@ -312,36 +316,96 @@ impl VerificationProgressState { .progress_chars("##-"), ); overall_progress.set_message("verifications completed"); - Self { multi, overall_progress, contracts_progress: HashMap::default() } + Self { + multi, + overall_progress, + contracts_progress: HashMap::default(), + contract_details: HashMap::default(), + } } /// Creates new contract verification progress and add it to overall progress. - pub fn start_contract_progress(&mut self, address: Address, contract_name: Option<&str>) { + /// Displays contract details inline. + pub fn start_contract_progress( + &mut self, + address: Address, + contract_name: Option<&str>, + chain: Chain, + evm_version: Option<&EvmVersion>, + compiler_version: Option<&str>, + constructor_args: Option<&str>, + verifier: &VerificationProviderType, + ) { let contract_progress = self.multi.add(ProgressBar::new_spinner()); contract_progress.set_style( indicatif::ProgressStyle::with_template("{spinner} {wide_msg:.bold.dim}") .unwrap() .tick_chars("⠁⠂⠄⡀⢀⠠⠐⠈ "), ); + let display_name = contract_name .map(|n| format!("{n} ({address})")) .unwrap_or_else(|| format!("{address}")); - contract_progress.set_message(format!("{display_name} ")); + + // Build details string + let mut details = format!("{display_name}\n"); + details.push_str(&format!(" - chain: {chain}\n")); + if let Some(evm) = evm_version { + details.push_str(&format!(" - EVM version: {evm}\n")); + } + if let Some(compiler) = compiler_version { + details.push_str(&format!(" - Compiler version: {compiler}\n")); + } + if let Some(args) = constructor_args { + if !args.is_empty() { + details.push_str(&format!(" - Constructor args: {args}\n")); + } + } + details.push_str(&format!(" - verifier: {verifier}")); + + // Store details for later use + self.contract_details.insert(address, details.clone()); + + contract_progress.set_message(details); contract_progress.enable_steady_tick(Duration::from_millis(100)); self.contracts_progress.insert(address, contract_progress); } + /// Updates contract verification progress message inline (as last entry). + /// This can be used to show intermediate progress messages like "Submitted contract for verification" + /// or "Verification Job ID: ..." during the verification process. + #[allow(dead_code)] + pub fn update_contract_progress(&mut self, address: Address, message: &str) { + if let Some(contract_progress) = self.contracts_progress.get(&address) { + if let Some(details) = self.contract_details.get(&address) { + let updated_message = format!("{details}\n - {message}"); + contract_progress.set_message(updated_message); + } else { + contract_progress.set_message(message.to_string()); + } + } + } + /// Prints contract verification result summary and removes it from overall progress. + /// Updates progress message inline instead of using suspend to avoid progress bar flakiness. pub fn end_contract_progress(&mut self, address: Address, success: bool, error: Option<&str>) { if let Some(contract_progress) = self.contracts_progress.remove(&address) { - self.multi.suspend(|| { - let status = if success { "✓ Verified".green() } else { "✗ Failed".red() }; + // Update message inline as last entry + let status = if success { "✓ Verified".green() } else { "✗ Failed".red() }; + let final_message = if let Some(details) = self.contract_details.remove(&address) { if let Some(err) = error { - let _ = sh_println!("{address}\n ↪ {status}: {err}"); + format!("{details}\n - {status}: {err}") } else { - let _ = sh_println!("{address}\n ↪ {status}"); + format!("{details}\n - {status}") } - }); + } else { + if let Some(err) = error { + format!("{address}\n - {status}: {err}") + } else { + format!("{address}\n - {status}") + } + }; + contract_progress.set_message(final_message); contract_progress.finish_and_clear(); // Increment overall progress bar to reflect completed verification. self.overall_progress.inc(1); From a9b5a3437d90e2cafdafb766709828b2c6622f35 Mon Sep 17 00:00:00 2001 From: Avory Date: Mon, 8 Dec 2025 19:48:17 +0200 Subject: [PATCH 07/10] fmt --- crates/script/src/progress.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/script/src/progress.rs b/crates/script/src/progress.rs index 9eaa365b2cd8b..98a5ceacea6e9 100644 --- a/crates/script/src/progress.rs +++ b/crates/script/src/progress.rs @@ -372,8 +372,8 @@ impl VerificationProgressState { } /// Updates contract verification progress message inline (as last entry). - /// This can be used to show intermediate progress messages like "Submitted contract for verification" - /// or "Verification Job ID: ..." during the verification process. + /// This can be used to show intermediate progress messages like "Submitted contract for + /// verification" or "Verification Job ID: ..." during the verification process. #[allow(dead_code)] pub fn update_contract_progress(&mut self, address: Address, message: &str) { if let Some(contract_progress) = self.contracts_progress.get(&address) { From bb33632a0808dcd58e3f1d769d770a10ac7896cb Mon Sep 17 00:00:00 2001 From: Avory Date: Mon, 8 Dec 2025 19:48:38 +0200 Subject: [PATCH 08/10] Update verify.rs --- crates/script/src/verify.rs | 52 ++++++++++++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 7 deletions(-) diff --git a/crates/script/src/verify.rs b/crates/script/src/verify.rs index 61d74f83b0b43..66e3b54d7a2fd 100644 --- a/crates/script/src/verify.rs +++ b/crates/script/src/verify.rs @@ -194,13 +194,15 @@ async fn verify_contracts( { trace!(target: "script", "prepare future verifications"); - // Store verification info: (address, contract_name, future) + // Store verification info: (address, contract_name, contract_details, future) let mut verification_tasks = Vec::new(); let mut unverifiable_contracts = vec![]; // Make sure the receipts have the right order first. sequence.sort_receipts(); + let chain: Chain = sequence.chain.into(); + for (receipt, tx) in sequence.receipts.iter_mut().zip(sequence.transactions.iter()) { // create2 hash offset let mut offset = 0; @@ -220,7 +222,18 @@ async fn verify_contracts( config.evm_version, ) { Some((verify_args, contract_name)) => { - verification_tasks.push((address, Some(contract_name), verify_args.run())); + // Extract details before moving verify_args + let evm_version = verify_args.evm_version.clone(); + let compiler_version = verify_args.compiler_version.clone(); + let constructor_args = verify_args.constructor_args.clone(); + let verifier_type = verify_args.verifier.verifier.clone(); + let future = verify_args.run(); + verification_tasks.push(( + address, + Some(contract_name), + (evm_version, compiler_version, constructor_args, verifier_type), + future, + )); } None => unverifiable_contracts.push(address), }; @@ -236,7 +249,18 @@ async fn verify_contracts( config.evm_version, ) { Some((verify_args, contract_name)) => { - verification_tasks.push((*address, Some(contract_name), verify_args.run())); + // Extract details before moving verify_args + let evm_version = verify_args.evm_version.clone(); + let compiler_version = verify_args.compiler_version.clone(); + let constructor_args = verify_args.constructor_args.clone(); + let verifier_type = verify_args.verifier.verifier.clone(); + let future = verify_args.run(); + verification_tasks.push(( + *address, + Some(contract_name), + (evm_version, compiler_version, constructor_args, verifier_type), + future, + )); } None => unverifiable_contracts.push(*address), }; @@ -256,15 +280,29 @@ async fn verify_contracts( let progress = VerificationProgress::new(num_verifications); let progress_ref = &progress; - // Start progress for all contracts - for (address, contract_name, _) in &verification_tasks { - progress_ref.inner.write().start_contract_progress(*address, contract_name.as_deref()); + // Start progress for all contracts with details + for ( + address, + contract_name, + (evm_version, compiler_version, constructor_args, verifier_type), + _, + ) in &verification_tasks + { + progress_ref.inner.write().start_contract_progress( + *address, + contract_name.as_deref(), + chain, + evm_version.as_ref(), + compiler_version.as_deref(), + constructor_args.as_deref(), + verifier_type, + ); } // Wrap each verification future to track progress let futures_with_progress: Vec<_> = verification_tasks .into_iter() - .map(|(address, _contract_name, future)| { + .map(|(address, _contract_name, _contract_details, future)| { let progress = progress_ref.clone(); async move { let result = future.await; From c07f5d54c900d375b10923758ddf562b487ef216 Mon Sep 17 00:00:00 2001 From: Avory Date: Mon, 8 Dec 2025 20:26:00 +0200 Subject: [PATCH 09/10] Update verify.rs --- crates/script/src/verify.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/script/src/verify.rs b/crates/script/src/verify.rs index 66e3b54d7a2fd..f9b3235294564 100644 --- a/crates/script/src/verify.rs +++ b/crates/script/src/verify.rs @@ -223,7 +223,7 @@ async fn verify_contracts( ) { Some((verify_args, contract_name)) => { // Extract details before moving verify_args - let evm_version = verify_args.evm_version.clone(); + let evm_version = verify_args.evm_version; let compiler_version = verify_args.compiler_version.clone(); let constructor_args = verify_args.constructor_args.clone(); let verifier_type = verify_args.verifier.verifier.clone(); @@ -250,7 +250,7 @@ async fn verify_contracts( ) { Some((verify_args, contract_name)) => { // Extract details before moving verify_args - let evm_version = verify_args.evm_version.clone(); + let evm_version = verify_args.evm_version; let compiler_version = verify_args.compiler_version.clone(); let constructor_args = verify_args.constructor_args.clone(); let verifier_type = verify_args.verifier.verifier.clone(); From 4442812b9c9ec65aa5b1c618c9681b86ee97da29 Mon Sep 17 00:00:00 2001 From: Avory Date: Mon, 8 Dec 2025 20:26:14 +0200 Subject: [PATCH 10/10] Improve contract progress message handling Refactor contract progress message formatting for clarity. --- crates/script/src/progress.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/crates/script/src/progress.rs b/crates/script/src/progress.rs index 98a5ceacea6e9..58d2270a8231e 100644 --- a/crates/script/src/progress.rs +++ b/crates/script/src/progress.rs @@ -326,6 +326,7 @@ impl VerificationProgressState { /// Creates new contract verification progress and add it to overall progress. /// Displays contract details inline. + #[allow(clippy::too_many_arguments)] pub fn start_contract_progress( &mut self, address: Address, @@ -356,10 +357,10 @@ impl VerificationProgressState { if let Some(compiler) = compiler_version { details.push_str(&format!(" - Compiler version: {compiler}\n")); } - if let Some(args) = constructor_args { - if !args.is_empty() { - details.push_str(&format!(" - Constructor args: {args}\n")); - } + if let Some(args) = constructor_args + && !args.is_empty() + { + details.push_str(&format!(" - Constructor args: {args}\n")); } details.push_str(&format!(" - verifier: {verifier}")); @@ -398,12 +399,10 @@ impl VerificationProgressState { } else { format!("{details}\n - {status}") } + } else if let Some(err) = error { + format!("{address}\n - {status}: {err}") } else { - if let Some(err) = error { - format!("{address}\n - {status}: {err}") - } else { - format!("{address}\n - {status}") - } + format!("{address}\n - {status}") }; contract_progress.set_message(final_message); contract_progress.finish_and_clear();