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

feat: use improved human readable function parser #2151

Merged

Conversation

mattsse
Copy link
Member

@mattsse mattsse commented Jun 28, 2022

Motivation

Closes #670
Closes #2025
Closes #1903

uses an improved human-readable parser that can properly handle complex tuple types.

the reason AbiParserstill exists is because it can resolve custom types as well (used in abigen!), however this is out of scope for the forge/cast commands that need parsing so we use it directly

Solution

cast sig "aggregate((address,bytes)[])"                                                                                                                                                   
0x252dba42

https://www.4byte.directory/signatures/?bytes4_signature=0x252dba42

@mattsse mattsse added the T-bug Type: bug label Jun 28, 2022
@onbjerg
Copy link
Member

onbjerg commented Jun 28, 2022

Does it also solve #1903?

@mattsse
Copy link
Member Author

mattsse commented Jun 28, 2022

it does:

./target/debug/cast 4bd 0x64a3bc15000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000310d12ef15a00640000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000ae347930bd1e7b0f35588b92280f9e750000000000000000000000008d90113a1e286a5ab3e496fbd1853f265e5913c6000000000000000000000000911c2311503c0da6a4d82d40bc3bad4ade10d2380000000000000000000000008d90113a1e286a5ab3e496fbd1853f265e5913c6000000000000000000000000000000000000000000000000000000175336709400000000000000000000000000000000000000000000000310d12ef15a006400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000062a314f40833592b8044884c18244af94f82e7e8e5cb403b567a6aa7402b6560991d0012000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000024f47261b0000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024f47261b0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000581b75ec8514073f54f6cd3e16379482cc8f76e1c47a99282b23283c69999887f0465f64630ec9391a9e3d6fa908f63475bcb3ef11ab702f26c29e2b04ff71cde755911c2311503c0da6a4d82d40bc3bad4ade10d2380012040000000000000000
1) "fillOrKillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)"
(0x00000000ae347930bd1e7b0f35588b92280f9e75, 0x8d90113a1e286a5ab3e496fbd1853f265e5913c6, 0x911c2311503c0da6a4d82d40bc3bad4ade10d238, 0x8d90113a1e286a5ab3e496fbd1853f265e5913c6, 100180324500, 56552033610000000000, 0, 0, 1654854900, 3709227417180565687725420283842435573329641510267313270658188471781665079314, 0xf47261b0000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7, 0xf47261b0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2)
56552033610000000000
0x1b75ec8514073f54f6cd3e16379482cc8f76e1c47a99282b23283c69999887f0465f64630ec9391a9e3d6fa908f63475bcb3ef11ab702f26c29e2b04ff71cde755911c2311503c0da6a4d82d40bc3bad4ade10d238001204

@gakonst
Copy link
Member

gakonst commented Jun 28, 2022

This is a good opportunity for us to add docs to the book about how to call methods with arrays, tuples and structs

@mattsse
Copy link
Member Author

mattsse commented Jun 28, 2022

writing a draft rn @onbjerg

Copy link
Member

@gakonst gakonst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clean otherwise - obvious net positive

@onbjerg
Copy link
Member

onbjerg commented Jun 28, 2022

Docs in book would presumably also close #43 (ref last comment in issue)?

Copy link
Member

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test failure unrelated, some test stalled

needs rebase tho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
None yet
3 participants