Skip to content

Commit

Permalink
feat: add viaIR to etherscan verification input (#6846)
Browse files Browse the repository at this point in the history
* feat: add viaIR to etherscan verification input

* chore: set via ir to true if provided

---------

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
  • Loading branch information
DaniPopes and mattsse authored Jan 18, 2024
1 parent 8fc9f36 commit 2335dea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions crates/forge/bin/cmd/verify/etherscan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,14 @@ impl EtherscanVerificationProvider {
.constructor_arguments(constructor_args)
.code_format(code_format);

if args.via_ir {
// we explicitly set this __undocumented__ argument to true if provided by the user,
// though this info is also available in the compiler settings of the standard json
// object if standard json is used
// unclear how etherscan interprets this field in standard-json mode
verify_args = verify_args.via_ir(true);
}

if code_format == CodeFormat::SingleFile {
verify_args = if let Some(optimizations) = args.num_of_optimizations {
verify_args.optimized().runs(optimizations as u32)
Expand Down

0 comments on commit 2335dea

Please sign in to comment.