diff --git a/crates/forge/bin/cmd/create.rs b/crates/forge/bin/cmd/create.rs index 3faa883d0813..745aa390e85f 100644 --- a/crates/forge/bin/cmd/create.rs +++ b/crates/forge/bin/cmd/create.rs @@ -185,6 +185,7 @@ impl CreateArgs { }, flatten: false, force: false, + skip_is_verified_check: false, watch: true, retry: self.retry, libraries: vec![], @@ -324,6 +325,7 @@ impl CreateArgs { etherscan: EtherscanOpts { key: self.eth.etherscan.key, chain: Some(chain.into()) }, flatten: false, force: false, + skip_is_verified_check: false, watch: true, retry: self.retry, libraries: vec![], diff --git a/crates/forge/bin/cmd/script/verify.rs b/crates/forge/bin/cmd/script/verify.rs index 0c17260dd30e..4c0205fcfc34 100644 --- a/crates/forge/bin/cmd/script/verify.rs +++ b/crates/forge/bin/cmd/script/verify.rs @@ -103,6 +103,7 @@ impl VerifyBundle { etherscan: self.etherscan.clone(), flatten: false, force: false, + skip_is_verified_check: false, watch: true, retry: self.retry, libraries: libraries.to_vec(), diff --git a/crates/forge/bin/cmd/verify/etherscan/mod.rs b/crates/forge/bin/cmd/verify/etherscan/mod.rs index e9a72d85abcb..64471ed3fe02 100644 --- a/crates/forge/bin/cmd/verify/etherscan/mod.rs +++ b/crates/forge/bin/cmd/verify/etherscan/mod.rs @@ -57,7 +57,9 @@ impl VerificationProvider for EtherscanVerificationProvider { async fn verify(&mut self, args: VerifyArgs) -> Result<()> { let (etherscan, verify_args) = self.prepare_request(&args).await?; - if self.is_contract_verified(ðerscan, &verify_args).await? { + if !args.skip_is_verified_check && + self.is_contract_verified(ðerscan, &verify_args).await? + { println!( "\nContract [{}] {:?} is already verified. Skipping verification.", verify_args.contract_name, @@ -89,7 +91,10 @@ impl VerificationProvider for EtherscanVerificationProvider { trace!(target: "forge::verify", ?resp, "Received verification response"); if resp.status == "0" { - if resp.result == "Contract source code already verified" { + if resp.result == "Contract source code already verified" + // specific for blockscout response + || resp.result == "Smart-contract already verified." + { return Ok(None) } diff --git a/crates/forge/bin/cmd/verify/mod.rs b/crates/forge/bin/cmd/verify/mod.rs index 5544c12f0508..1bcdd4c8baff 100644 --- a/crates/forge/bin/cmd/verify/mod.rs +++ b/crates/forge/bin/cmd/verify/mod.rs @@ -68,6 +68,10 @@ pub struct VerifyArgs { #[clap(short, long)] pub force: bool, + /// Do not check if the contract is already verified before verifying. + #[clap(long)] + pub skip_is_verified_check: bool, + /// Wait for verification result after submission. #[clap(long)] pub watch: bool,