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

abi: cannot encode/decode tuples #39

Open
mhw0 opened this issue Dec 15, 2023 · 4 comments
Open

abi: cannot encode/decode tuples #39

mhw0 opened this issue Dec 15, 2023 · 4 comments
Milestone

Comments

@mhw0
Copy link
Owner

mhw0 commented Dec 15, 2023

#38

Possible fixes:

  • do not ignore thelen parameter of eth_abi_array on encode. If it's set, just accept it as the actual length.
@mhw0 mhw0 added this to the v1.2.0 milestone Dec 15, 2023
@marcovc
Copy link

marcovc commented Feb 11, 2024

Hi! I am looking for a way to encode tuples. Not sure if this is possible with a simple workaround?

@mhw0
Copy link
Owner Author

mhw0 commented Feb 12, 2024

Hello @marcovc! I'm working on it

@mhw0
Copy link
Owner Author

mhw0 commented Feb 14, 2024

Sorry for the delay. Have you tried encoding it like this? If we had (uint256,uint256,uint256):

eth_abi_uint256(&abi, &uint0);
eth_abi_uint256(&abi, &uint1);
eth_abi_uint256(&abi, &uint2);

@marcovc
Copy link

marcovc commented Feb 14, 2024

I am not sure that leads to a valid encoding, since if I understand correctly the specificattion, a tuple with at least one dynamic element is considered dynamic. This means the entire tuple needs to be encoded differently, and not just the dynamic element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants