Add a verification flag to skip contract is verified check #6461
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Blockscout allows to re-verify partially verified contracts until they are not fully verified. It may be useful in case if the contract has been already verified by blockscout automatically (via finding a verified contract with similar bytecode). Forge does not allow to re-verify such contracts because of the following check - https://github.com/foundry-rs/foundry/blob/master/crates/forge/bin/cmd/verify/etherscan/mod.rs#L60.
Solution
We suggest to add a new flag that should make verification process to ignore the check. Eventually, if the flag is set, verification process just skips the corresponding if branch and sends the verification request anyway
I've added the flag in this PR, but haven't come up what and where corresponding tests should be added. Would be glad to get any guidance