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 --evm-version to verify-contract #7178

Merged
merged 1 commit into from
Feb 19, 2024
Merged
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
3 changes: 2 additions & 1 deletion crates/cast/bin/cmd/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ pub struct RunArgs {
#[clap(flatten)]
rpc: RpcOpts,

/// The evm version to use.
/// The EVM version to use.
///
/// Overrides the version specified in the config.
#[clap(long, short)]
evm_version: Option<EvmVersion>,

/// Sets the number of assumed available compute units per second for this provider
///
/// default value: 330
Expand Down
2 changes: 2 additions & 0 deletions crates/forge/bin/cmd/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ impl CreateArgs {
root: None,
verifier: self.verifier.clone(),
via_ir: self.opts.via_ir,
evm_version: self.opts.compiler.evm_version,
show_standard_json_input: self.show_standard_json_input,
};

Expand Down Expand Up @@ -334,6 +335,7 @@ impl CreateArgs {
root: None,
verifier: self.verifier,
via_ir: self.opts.via_ir,
evm_version: self.opts.compiler.evm_version,
show_standard_json_input: self.show_standard_json_input,
};
println!("Waiting for {} to detect contract deployment...", verify.verifier.verifier);
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 @@ -114,6 +114,7 @@ impl VerifyBundle {
root: None,
verifier: self.verifier.clone(),
via_ir: self.via_ir,
evm_version: None,
show_standard_json_input: false,
};

Expand Down
11 changes: 10 additions & 1 deletion crates/forge/bin/cmd/verify/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use alloy_primitives::Address;
use clap::{Parser, ValueHint};
use eyre::Result;
use foundry_cli::{opts::EtherscanOpts, utils::LoadConfig};
use foundry_compilers::info::ContractInfo;
use foundry_compilers::{info::ContractInfo, EvmVersion};
use foundry_config::{figment, impl_figment_convert, impl_figment_convert_cast, Config};
use provider::VerificationProviderType;
use reqwest::Url;
Expand Down Expand Up @@ -103,6 +103,12 @@ pub struct VerifyArgs {
#[clap(long)]
pub via_ir: bool,

/// The EVM version to use.
///
/// Overrides the version specified in the config.
#[clap(long)]
pub evm_version: Option<EvmVersion>,

#[clap(flatten)]
pub etherscan: EtherscanOpts,

Expand Down Expand Up @@ -134,6 +140,9 @@ impl figment::Provider for VerifyArgs {
figment::value::Value::serialize(optimizer_runs)?,
);
}
if let Some(evm_version) = self.evm_version {
dict.insert("evm_version".to_string(), figment::value::Value::serialize(evm_version)?);
}
if self.via_ir {
dict.insert("via_ir".to_string(), figment::value::Value::serialize(self.via_ir)?);
}
Expand Down
Loading