Open mhw0 opened 9 months ago
Hi! I am looking for a way to encode tuples. Not sure if this is possible with a simple workaround?
Hello @marcovc! I'm working on it
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);
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.
38
Possible fixes:
len
parameter ofeth_abi_array
on encode. If it's set, just accept it as the actual length.