You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
block.timestamp is assumed to be constant when --ir-minimum (via IR) is enabled, and this leads to false negative failed tests when running Solidity tests that use the vm.warp cheat in Foundry.
This can easily create hard-to-debug circumstances - tests that normally pass start failing, and debugging via IR-enabled code is not easy.
Solution
Detect the use of block.timestamp in the users' tests, and throw a bespoke warning about it. Recommend using vm.getBlockTimestamp() instead.
Ditto for block.number and vm.roll and vm.getBlockNumber().
Note
The rule should be turned off by default so that users can turn it on in their test/.solhint.json file.