Skip to content

Parsing error while passing array of tuples to cast call #5302

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

Closed
2 tasks done
storojs72 opened this issue Jul 5, 2023 · 1 comment
Closed
2 tasks done

Parsing error while passing array of tuples to cast call #5302

storojs72 opened this issue Jul 5, 2023 · 1 comment
Labels
T-feature Type: feature

Comments

@storojs72
Copy link

Component

Cast

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

cast 0.2.0 (388c3c0 2023-04-12T00:13:21.361610000Z)

What command(s) is the bug in?

cast call

Operating System

macOS (Apple Silicon)

Describe the bug

This works (using decimal representation of uint256):

cast call 0xe7f1725e7734ce288f8367e1bb143e90bb3f0512 "pushToA((uint256,uint256,uint256)[])" "[(1,1,1)]" --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80

But this does not (using hexadecimal representation of uint256):

cast call 0xe7f1725e7734ce288f8367e1bb143e90bb3f0512 "pushToA((uint256,uint256,uint256)[])" "[(0x01,0x01,0x01)]" --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
Error: 
Failed to parse `[(0x01,0x01,0x01)]`, expected value of type: (uint256,uint256,uint256)[]

Sorry, if this might be looking annoying - as one can always use / convert number to decimal representation at client side, but natively supporting both decimal and hexadecimal uint256 values passing seems to be very convenient.

@storojs72 storojs72 added the T-bug Type: bug label Jul 5, 2023
@gakonst gakonst added this to Foundry Jul 5, 2023
@github-project-automation github-project-automation bot moved this to Todo in Foundry Jul 5, 2023
@Evalir Evalir added T-feature Type: feature and removed T-bug Type: bug labels Jul 5, 2023
@Evalir
Copy link
Member

Evalir commented Jul 5, 2023

Right now dealing with either hex or numbers could be a little cumbersome—and not too far in the near future we'll migrate to alloy which might mean reworking yet again this parsing.

Closing for lack of appetite for now. Sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-feature Type: feature
Projects
Archived in project
Development

No branches or pull requests

2 participants