Skip to content

Fixed exercises with a maximum number of transaction requirement#108

Open
l4n0r wants to merge 1 commit intotheredguild:masterfrom
l4n0r:master
Open

Fixed exercises with a maximum number of transaction requirement#108
l4n0r wants to merge 1 commit intotheredguild:masterfrom
l4n0r:master

Conversation

@l4n0r
Copy link

@l4n0r l4n0r commented Jul 18, 2025

Some challenges enforce a maximum number of transactions, which is tracked using Foundry's vm.getNonce.

While the current approach uses vm.startPrank to simulate player transactions, this method only sets msg.sender and tx.origin — it does not increment the sender's nonce for each transaction (except for contract creations). As a result, nonce-based checks are not effective in counting regular transactions.

Foundry provides vm.startBroadcast, which is specifically designed to simulate real transactions that do increment the nonce. This pull request replaces vm.startPrank with vm.startBroadcast (only for the selected challenges) to more accurately enforce transaction count limits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant