Skip to content
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

vm.serializeString might produce numbers #4601

Open
1 of 2 tasks
Tracked by #3801
sakulstra opened this issue Mar 19, 2023 · 2 comments
Open
1 of 2 tasks
Tracked by #3801

vm.serializeString might produce numbers #4601

sakulstra opened this issue Mar 19, 2023 · 2 comments
Labels
A-cheatcodes Area: cheatcodes C-forge Command: forge T-bug Type: bug T-to-reproduce Type: requires reproduction
Milestone

Comments

@sakulstra
Copy link
Contributor

Component

Forge

Have you ensured that all of these are up to date?

  • 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.

@mds1
Copy link
Collaborator

mds1 commented Mar 21, 2023

cc @odyslam just added this to #3801

@Thegaram
Copy link

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.

@zerosnacks zerosnacks added this to the v1.0.0 milestone Jul 26, 2024
@grandizzy grandizzy added the T-to-reproduce Type: requires reproduction label Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cheatcodes Area: cheatcodes C-forge Command: forge T-bug Type: bug T-to-reproduce Type: requires reproduction
Projects
Status: Todo
5 participants