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

add support for arg names in return type #9415

Open
zhiqiangxu opened this issue Nov 27, 2024 · 5 comments
Open

add support for arg names in return type #9415

zhiqiangxu opened this issue Nov 27, 2024 · 5 comments
Labels
T-feature Type: feature

Comments

@zhiqiangxu
Copy link
Contributor

zhiqiangxu commented Nov 27, 2024

Component

Cast

Describe the feature you would like

Currently cast call doesn't support arg names in the return type, so this works:

image

(it's trying to fetch result from the findLatestGames method)

and this doesn't work(the only difference is: the return type also includes arg names):

image

It would be better and more consistent to support arg names in the return type.

Additional context

No response

@zhiqiangxu zhiqiangxu added T-feature Type: feature T-needs-triage Type: this issue needs to be labelled labels Nov 27, 2024
@github-project-automation github-project-automation bot moved this to Todo in Foundry Nov 27, 2024
@grandizzy
Copy link
Collaborator

@zhiqiangxu please provide steps to reproduce, and where to find the 0x1a1d03c5403aa47d27e8e8c4974b1f675933ebab2 contract deployed. thank you

@grandizzy
Copy link
Collaborator

It actually looks like something with the sig you pass, this works OK

cast call 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 "balanceOf(address owner)(uint256 balance)" 0x.. --rpc-url $RPC_URL
8200000000000000 [8.2e15]

Please check your function sig and reopen with details to repro if still an issue. Thank you

@grandizzy grandizzy closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Foundry Nov 27, 2024
@zhiqiangxu
Copy link
Contributor Author

zhiqiangxu commented Nov 27, 2024

@grandizzy Sorry for the late response, it's deployed on sepolia, and can be reproduced with this command:

cast call 0xa1d03c5403aa47d27e8e8c4974b1f675933ebab2 'findLatestGames(uint32 _gameType,uint256 _start,uint256 _n)((uint256 index,bytes32 metadata,uint64 timestamp,bytes32 rootClaim,bytes extraData)[])' 1 0 1 --json -r http://88.99.30.186:8545/

@grandizzy
Copy link
Collaborator

grandizzy commented Nov 27, 2024

reopenening to investigate per above comment, it happens with array of structs (to be investigated if possible to fix, not sure how we should handle this)

@grandizzy grandizzy reopened this Nov 27, 2024
@yash-atreya
Copy link
Member

yash-atreya commented Nov 27, 2024

reopenening to investigate per above comment, it happens with array of structs (to be investigated if possible to fix, not sure how we should handle this)

Needs to be fixed in alloy-json-abi or sol-type-parser

@DaniPopes DaniPopes removed the T-needs-triage Type: this issue needs to be labelled label Nov 30, 2024
@yash-atreya yash-atreya moved this from Done to Todo in Foundry Dec 2, 2024
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

4 participants