-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
bug(cheatcodes
): vm.getNonce(player)
the nonce is incorrect
#8811
Comments
cheatcodes
): vm.getNonce(player)
the nonce is incorrect
@grandizzy it looks like we're not catching the prank during |
I think it's working as expected? external calls shouldn't increase nonce without |
It works like this even with |
Oh really, why is this? It seems preferable for nonces to behave normally. Incrementing them for new contract deploys but not for calls feels like a bug to me I don't like function testFoo() public {
console.log(vm.getNonce(address(this)));
counter.increment();
console.log(vm.getNonce(address(this)));
new Counter();
console.log(vm.getNonce(address(this)));
} Logs:
But I would expect
|
when we were adding though I think it probably makes sense to break this now exclusively for |
reopening as PR was reverted for further improvements |
Discussed in #8584
Originally posted by EthanOK August 2, 2024
In the latest version, it will only be increased in the
new Contract
, but not in the calling contract.Test demo
The text was updated successfully, but these errors were encountered: