libethc
libethc copied to clipboard
abi: cannot encode/decode tuples
#38
Possible fixes:
- do not ignore the
lenparameter ofeth_abi_arrayon encode. If it's set, just accept it as the actual length.
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.