Currently we're determining whether an indexed parameter is encoded as a hash (B256) by checking whether it is abi-dynamic. However this:
does not account for custom types, so UDVTs are treated as a hash when they shouldn't;
is not entirely correct as it will accept elementary fixed arrays such as address[2].
This is fixed by accounting for custom types and using is_value_type instead of whether it is ABI-dynamic. The Solidity ABI spec states:
For all types of length at most 32 bytes, the EVENT_INDEXED_ARGS array contains the value directly, padded or sign-extended (for signed integers) to 32 bytes, just as for regular ABI encoding. However, for all “complex” types or types of dynamic length, including all arrays, string, bytes and structs, EVENT_INDEXED_ARGS will contain the Keccak hash of a special in-place encoded value (see Encoding of Indexed Event Parameters), rather than the encoded value directly.
Currently we're determining whether an indexed parameter is encoded as a hash (B256) by checking whether it is abi-dynamic. However this:
address[2]
.This is fixed by accounting for custom types and using
is_value_type
instead of whether it is ABI-dynamic. The Solidity ABI spec states:Fixes #734.