Skip to content

Commit 95039bc

Browse files
authored
feat(forge): add --evm-version to verify-contract (#7178)
1 parent 2303c2d commit 95039bc

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

crates/cast/bin/cmd/run.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,12 @@ pub struct RunArgs {
5151
#[clap(flatten)]
5252
rpc: RpcOpts,
5353

54-
/// The evm version to use.
54+
/// The EVM version to use.
5555
///
5656
/// Overrides the version specified in the config.
5757
#[clap(long, short)]
5858
evm_version: Option<EvmVersion>,
59+
5960
/// Sets the number of assumed available compute units per second for this provider
6061
///
6162
/// default value: 330

crates/forge/bin/cmd/create.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ impl CreateArgs {
186186
root: None,
187187
verifier: self.verifier.clone(),
188188
via_ir: self.opts.via_ir,
189+
evm_version: self.opts.compiler.evm_version,
189190
show_standard_json_input: self.show_standard_json_input,
190191
};
191192

@@ -334,6 +335,7 @@ impl CreateArgs {
334335
root: None,
335336
verifier: self.verifier,
336337
via_ir: self.opts.via_ir,
338+
evm_version: self.opts.compiler.evm_version,
337339
show_standard_json_input: self.show_standard_json_input,
338340
};
339341
println!("Waiting for {} to detect contract deployment...", verify.verifier.verifier);

crates/forge/bin/cmd/script/verify.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ impl VerifyBundle {
114114
root: None,
115115
verifier: self.verifier.clone(),
116116
via_ir: self.via_ir,
117+
evm_version: None,
117118
show_standard_json_input: false,
118119
};
119120

crates/forge/bin/cmd/verify/mod.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use alloy_primitives::Address;
33
use clap::{Parser, ValueHint};
44
use eyre::Result;
55
use foundry_cli::{opts::EtherscanOpts, utils::LoadConfig};
6-
use foundry_compilers::info::ContractInfo;
6+
use foundry_compilers::{info::ContractInfo, EvmVersion};
77
use foundry_config::{figment, impl_figment_convert, impl_figment_convert_cast, Config};
88
use provider::VerificationProviderType;
99
use reqwest::Url;
@@ -103,6 +103,12 @@ pub struct VerifyArgs {
103103
#[clap(long)]
104104
pub via_ir: bool,
105105

106+
/// The EVM version to use.
107+
///
108+
/// Overrides the version specified in the config.
109+
#[clap(long)]
110+
pub evm_version: Option<EvmVersion>,
111+
106112
#[clap(flatten)]
107113
pub etherscan: EtherscanOpts,
108114

@@ -134,6 +140,9 @@ impl figment::Provider for VerifyArgs {
134140
figment::value::Value::serialize(optimizer_runs)?,
135141
);
136142
}
143+
if let Some(evm_version) = self.evm_version {
144+
dict.insert("evm_version".to_string(), figment::value::Value::serialize(evm_version)?);
145+
}
137146
if self.via_ir {
138147
dict.insert("via_ir".to_string(), figment::value::Value::serialize(self.via_ir)?);
139148
}

0 commit comments

Comments
 (0)