Skip to content

Commit 67bd90f

Browse files
committed
correct nonce after setUp if necessary
1 parent 8b51055 commit 67bd90f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cli/src/cmd/forge/script/runner.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ impl<DB: DatabaseRef> Runner<DB> {
9696
.extend(setup_traces.map(|traces| (TraceKind::Setup, traces)).into_iter());
9797
logs.extend_from_slice(&setup_logs);
9898

99+
// We call the `setUp()` function with self.sender, and if there haven't been
100+
// any broadcasts, then the EVM cheatcode module hasn't corrected the nonce
101+
if transactions.is_none() || transactions.as_ref().unwrap().is_empty() {
102+
self.executor.set_nonce(self.sender, sender_nonce.as_u64());
103+
}
104+
99105
(
100106
!reverted,
101107
gas,

0 commit comments

Comments
 (0)