Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(forge): add --ignore-already-verified flag to verify-contract #6426

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions crates/forge/bin/cmd/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ impl CreateArgs {
root: None,
verifier: self.verifier.clone(),
show_standard_json_input: false,
ignore_already_verified: false,
};
verify.verification_provider()?.preflight_check(verify).await?;
Ok(())
Expand Down Expand Up @@ -323,6 +324,7 @@ impl CreateArgs {
root: None,
verifier: self.verifier,
show_standard_json_input: false,
ignore_already_verified: true,
};
println!("Waiting for {} to detect contract deployment...", verify.verifier.verifier);
verify.run().await
Expand Down
1 change: 1 addition & 0 deletions crates/forge/bin/cmd/script/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ impl VerifyBundle {
root: None,
verifier: self.verifier.clone(),
show_standard_json_input: false,
ignore_already_verified: true,
};

return Some(verify)
Expand Down
4 changes: 3 additions & 1 deletion crates/forge/bin/cmd/verify/etherscan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(&etherscan, &verify_args).await? {
if !args.ignore_already_verified &&
self.is_contract_verified(&etherscan, &verify_args).await?
{
println!(
"\nContract [{}] {:?} is already verified. Skipping verification.",
verify_args.contract_name,
Expand Down
6 changes: 6 additions & 0 deletions crates/forge/bin/cmd/verify/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ pub struct VerifyArgs {

#[clap(flatten)]
pub verifier: VerifierArgs,

/// Attempt to verify the contract even if it is already verified.
///
/// This can be used to fully verify a partially verified contract.
#[clap(long)]
pub ignore_already_verified: bool,
}

impl_figment_convert!(VerifyArgs);
Expand Down