Closed tbuckley54 closed 1 year ago
000000000000000000000000000000000000000000000034e2c0e23567d50000
// uint256
0000000000000000000000000000000000000000000000000000000000000040
// bytes head (offset)
0000000000000000000000000000000000000000000000000000000000000001
// bytes length
00
// bytes data
That doesn't look like a valid encoding to me. The encoding of the data part of a bytes
with length 1 should be 32 bytes long. But here, only 00
is given, which is one byte. There are supposed to be 31 padding bytes after that. All zeroes. If the creator of the data omitted the padding deliberately, I suggest adding the padding back to the data prior to decoding.
stripLeadingHex
might be removing the leading zeroes as well. Leading and trailing zeroes must not be removed before decoding. Try FastHex.decode(str, 2, str.length() - 2)
to ignore only the 0x
prefix.
see #53
When trying to decode the data for this log
using this abi
doing
we see the error
tuple index 1: not enough bytes remaining: 1 < 32
doing
event.getNonIndexedParams.decode
yields a similar result
tuple index 1: unsigned val exceeds bit limit: 254 > 31
i would expect it to be just returning empty for the data bytes parameter instead, any suggestions?