From 0cfa9fcc364590633f17d99c16e81af4265e39ec Mon Sep 17 00:00:00 2001 From: crStiv Date: Sat, 19 Jul 2025 19:10:08 +0200 Subject: [PATCH 1/6] Update mod.rs --- crates/verify/src/etherscan/mod.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/crates/verify/src/etherscan/mod.rs b/crates/verify/src/etherscan/mod.rs index 5dbcbf6346963..e9bf3e654831f 100644 --- a/crates/verify/src/etherscan/mod.rs +++ b/crates/verify/src/etherscan/mod.rs @@ -92,7 +92,7 @@ impl VerificationProvider for EtherscanVerificationProvider { .wrap_err_with(|| { // valid json let args = serde_json::to_string(&verify_args).unwrap(); - error!(?args, "Failed to submit verification"); + // Removed error! to avoid duplication - wrap_err_with already provides error context format!("Failed to submit contract verification, payload:\n{args}") })?; @@ -109,14 +109,13 @@ impl VerificationProvider for EtherscanVerificationProvider { if resp.result.starts_with("Unable to locate ContractCode at") || resp.result.starts_with("The address is not a smart contract") { - warn!("{}", resp.result); - return Err(eyre!("Could not detect the deployment.")); + // Removed warn! to avoid duplication - error message already contains the info + return Err(eyre!("Could not detect deployment: {}", resp.result)); } - warn!("Failed verify submission: {:?}", resp); + // Removed warn! to avoid duplication - sh_err! already provides error output sh_err!( - "Encountered an error verifying this contract:\nResponse: `{}`\nDetails: - `{}`", + "Failed to verify contract - Response: `{}`, Details: `{}`", resp.message, resp.result )?; @@ -186,7 +185,7 @@ impl VerificationProvider for EtherscanVerificationProvider { } if resp.status == "0" { - return Err(RetryError::Break(eyre!("Contract failed to verify."))); + return Err(RetryError::Break(eyre!("Contract verification failed - status: {}, result: {}", resp.status, resp.result))); } if resp.result == "Pass - Verified" { From fac907fb33ff7cad759fdd9751d665e580ec67f7 Mon Sep 17 00:00:00 2001 From: crStiv Date: Sat, 26 Jul 2025 17:13:19 +0200 Subject: [PATCH 2/6] Update mod.rs --- crates/verify/src/etherscan/mod.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/crates/verify/src/etherscan/mod.rs b/crates/verify/src/etherscan/mod.rs index e9bf3e654831f..5b151af94fb52 100644 --- a/crates/verify/src/etherscan/mod.rs +++ b/crates/verify/src/etherscan/mod.rs @@ -92,7 +92,6 @@ impl VerificationProvider for EtherscanVerificationProvider { .wrap_err_with(|| { // valid json let args = serde_json::to_string(&verify_args).unwrap(); - // Removed error! to avoid duplication - wrap_err_with already provides error context format!("Failed to submit contract verification, payload:\n{args}") })?; @@ -109,11 +108,9 @@ impl VerificationProvider for EtherscanVerificationProvider { if resp.result.starts_with("Unable to locate ContractCode at") || resp.result.starts_with("The address is not a smart contract") { - // Removed warn! to avoid duplication - error message already contains the info return Err(eyre!("Could not detect deployment: {}", resp.result)); } - // Removed warn! to avoid duplication - sh_err! already provides error output sh_err!( "Failed to verify contract - Response: `{}`, Details: `{}`", resp.message, From 9e357fb43fc91b4b20fd2e5508afe8d496017af6 Mon Sep 17 00:00:00 2001 From: crStiv Date: Sun, 27 Jul 2025 17:49:36 +0200 Subject: [PATCH 3/6] Update mod.rs --- crates/verify/src/etherscan/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/verify/src/etherscan/mod.rs b/crates/verify/src/etherscan/mod.rs index 5b151af94fb52..d068ed389b89b 100644 --- a/crates/verify/src/etherscan/mod.rs +++ b/crates/verify/src/etherscan/mod.rs @@ -108,6 +108,7 @@ impl VerificationProvider for EtherscanVerificationProvider { if resp.result.starts_with("Unable to locate ContractCode at") || resp.result.starts_with("The address is not a smart contract") { + warn!("{}", resp.result); return Err(eyre!("Could not detect deployment: {}", resp.result)); } @@ -116,6 +117,7 @@ impl VerificationProvider for EtherscanVerificationProvider { resp.message, resp.result )?; + warn!("Failed verify submission: {:?}", resp); std::process::exit(1); } From 7ac996e9db5b358b91b1a1c753efd2a10c93c6f2 Mon Sep 17 00:00:00 2001 From: crStiv Date: Tue, 5 Aug 2025 20:21:19 +0200 Subject: [PATCH 4/6] Update crates/verify/src/etherscan/mod.rs Co-authored-by: zerosnacks <95942363+zerosnacks@users.noreply.github.com> --- crates/verify/src/etherscan/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/verify/src/etherscan/mod.rs b/crates/verify/src/etherscan/mod.rs index d068ed389b89b..32bf2a222101b 100644 --- a/crates/verify/src/etherscan/mod.rs +++ b/crates/verify/src/etherscan/mod.rs @@ -113,7 +113,8 @@ impl VerificationProvider for EtherscanVerificationProvider { } sh_err!( - "Failed to verify contract - Response: `{}`, Details: `{}`", + "Encountered an error verifying this contract:\nResponse: `{}`\nDetails: + `{}`", resp.message, resp.result )?; From 92d038525c613ddba02a34ebd753a99175c45299 Mon Sep 17 00:00:00 2001 From: crStiv Date: Tue, 5 Aug 2025 20:21:35 +0200 Subject: [PATCH 5/6] Update crates/verify/src/etherscan/mod.rs Co-authored-by: zerosnacks <95942363+zerosnacks@users.noreply.github.com> --- crates/verify/src/etherscan/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/verify/src/etherscan/mod.rs b/crates/verify/src/etherscan/mod.rs index 32bf2a222101b..885124b29a6c4 100644 --- a/crates/verify/src/etherscan/mod.rs +++ b/crates/verify/src/etherscan/mod.rs @@ -185,7 +185,7 @@ impl VerificationProvider for EtherscanVerificationProvider { } if resp.status == "0" { - return Err(RetryError::Break(eyre!("Contract verification failed - status: {}, result: {}", resp.status, resp.result))); + return Err(RetryError::Break(eyre!("Contract verification failed:\nStatus: `{}`\nResult: `{}`", resp.status, resp.result))); } if resp.result == "Pass - Verified" { From 6073cd422342214edb4765351b8a32ea354af1ad Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Tue, 12 Aug 2025 11:45:57 +0200 Subject: [PATCH 6/6] fmt --- crates/verify/src/etherscan/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/verify/src/etherscan/mod.rs b/crates/verify/src/etherscan/mod.rs index 885124b29a6c4..7cac1dd685dcc 100644 --- a/crates/verify/src/etherscan/mod.rs +++ b/crates/verify/src/etherscan/mod.rs @@ -185,7 +185,11 @@ impl VerificationProvider for EtherscanVerificationProvider { } if resp.status == "0" { - return Err(RetryError::Break(eyre!("Contract verification failed:\nStatus: `{}`\nResult: `{}`", resp.status, resp.result))); + return Err(RetryError::Break(eyre!( + "Contract verification failed:\nStatus: `{}`\nResult: `{}`", + resp.status, + resp.result + ))); } if resp.result == "Pass - Verified" {