-
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
Add serializeUintQuantity cheatcode #7758
Comments
I see, and consider renaming serializeUint into serializeNumber |
Yeah that would make more sense in my mind, the easy work around is something like:
So might not be as much of a pain, but still worth considering. |
wdyt @mds1 @DaniPopes ? imo large uint should be serialized as quantity (hex: 0x..) because even stringified numbers are not ideal |
+1 on serializing large uints as hex. |
I can take this, if everyone is on board. |
assigned |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (63fff35 2024-04-22T00:18:27.941506275Z)
What command(s) is the bug in?
forge script
Operating System
Linux
Describe the bug
When using
serializeUint
to serialize out deployment parameters (wallet address + private key) for end to end testing I noticed when serializing uint256's (frommakeAddrAndKey
) that the JSON output would be invalid and hard to parse with standard tools becauseserializeUint
emits normal JSON integers instead of string-ifed integers in hex or integer representation. Because javascript's (and thus lots of JSON parsers) max int is 2^53 full uint256's can't be held within a normal integer type.Example output from
serializeUint
to json:It would be nice if this was in hex form in a string (like how
serializeAddress
emits things).The text was updated successfully, but these errors were encountered: