foundry
foundry copied to clipboard
vm.serializeString might produce numbers
Component
Forge
Have you ensured that all of these are up to date?
- [X] Foundry
- [ ] Foundryup
What version of Foundry are you on?
No response
What command(s) is the bug in?
No response
Operating System
Linux
Describe the bug
There's some unexpected behavior with vm.serializeString
.
When using
string memory out = vm.serializeString(key, key, '10000000000000');
vm.writeJson(out, path);
It seems like foundry will automatically convert the string to a number if it looks like a number. This is somewhat unexpected and it hard to work with consumer languages that don't natively support big numbers.
cc @odyslam just added this to #3801
We also ran into this issue -- we want to write a string value but it's instead written as a number, which the consumer (a geth fork) is unable to parse.