foundry: Cheatcode `vm.setNonce` does not allow for a nonce value of `type(uint64).max`
Component
Forge
Have you ensured that all of these are up to date?
- Foundry
- Foundryup
What version of Foundry are you on?
forge 0.2.0 (0dc266d 2022-08-05T00:05:53.884289904Z)
What command(s) is the bug in?
forge test
Operating System
Linux
Describe the bug
The cheatcode vm.setNonce does not allow for a nonce value of type(uint64).max. It’s the max threshold that is actually allowed in theory. If I substract 1 from the max value it works smoothly. Maybe there are some internal reasons for that but I thought I would quickly raise the issue.

EDIT: The screenshot is from using the Windows version (built from source) but usually I use WSL Ubuntu for foundry and also there is the same error.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (14 by maintainers)
We do, foundryup just doesn’t install them for you
yeh let’s close.
re static builds for windows, not sure if we ship them yet, cc @onbjerg
in release mode. @mds1 I’m currently using this approach here already: https://github.com/pcaversaccio/snekmate/blob/main/test/utils/CreateAddress.t.sol#L218. I mean obviously, it’s an edge case, but if you check the other tests for
uint56etc. you will see why I encountered it. I want to test the RLP encoding scheme against the uint64 max value.