Skip to content

Commit 540c8dc

Browse files
mattsse0xgregthedev
authored andcommitted
fix: set value before estimating gas (foundry-rs#7829)
1 parent 9cebfb5 commit 540c8dc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

crates/forge/bin/cmd/create.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -242,17 +242,17 @@ impl CreateArgs {
242242
provider.get_transaction_count(deployer_address, BlockId::latest()).await
243243
}?);
244244

245+
// set tx value if specified
246+
if let Some(value) = self.tx.value {
247+
deployer.tx.set_value(value);
248+
}
249+
245250
deployer.tx.set_gas_limit(if let Some(gas_limit) = self.tx.gas_limit {
246251
Ok(gas_limit.to())
247252
} else {
248253
provider.estimate_gas(&deployer.tx, BlockId::latest()).await
249254
}?);
250255

251-
// set tx value if specified
252-
if let Some(value) = self.tx.value {
253-
deployer.tx.set_value(value);
254-
}
255-
256256
if is_legacy {
257257
let gas_price = if let Some(gas_price) = self.tx.gas_price {
258258
gas_price.to()

0 commit comments

Comments
 (0)