-
Notifications
You must be signed in to change notification settings - Fork 647
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
docs(chisel
): document uint256
cast quirk of abi.encode(1-2)
causing wrap-around instead of -1
as int256
#1287
Comments
Chisel
]: incorrect result of 1 - 2
Chisel
]: incorrect result of 1 - 2
this can't be for uint256, if you do this might be a limitation due to how the chisel interpreter works, which will use |
maybe we should find a way to avoid it, after all, it is inconsistent with the compiler's behavior |
chisel
): incorrect result of evaluation of 1 - 2
For additional context: I think this ticket can be resolved by documenting this quirk in the Foundry Book: https://book.getfoundry.sh/reference/chisel/ Beyond that I don't see a point of action here |
chisel
): incorrect result of evaluation of 1 - 2
chisel
): document uint256
cast quirk of abi.encode(1-2)
causing wrap-around instead of -1
as int256
What I think is chisel should be as consistent with evm as possible 🤔 |
Component
Chisel
Have you ensured that all of these are up to date?
What version of Foundry are you on?
0.2.0
What command(s) is the bug in?
1 - 2
Operating System
macOS (Intel)
Describe the bug
The result of
1 - 2
in Chisel is the max value ofuint256
, but it's-1
in forge test or remix.Solc version is 0.8.26.
The text was updated successfully, but these errors were encountered: