I'm having an issue with a UUID in bytes16 form being emitted as an indexed event topic, and I'm not sure where in the stack this is originating.
The event being emitted in Solidity looks like the following:
event ObjectOperation (
bytes16 indexed uuid,
ObjectOperationType indexed opType,
Organization indexed organization,
address senderAddress,
uint8 changeScore
);
I can see the event in the log:
"logs": [
{
"logIndex": "0x0",
"transactionIndex": "0x0",
"transactionHash": "0x6cb6eae33b6d0f229cf2b50e5fe1b51e236e6fb951ffe1fec5db21d741478cd9",
"blockHash": "0x7c69af4c298845244007d97e3de292dad1cf1d0ba34e65482fe0d224c6cbb73e",
"blockNumber": "0xc",
"address": "0x6596907f5db0df9330e1bc0d69c967909256a059",
"data": "0x000000000000000000000000da9b53ac0609c634ad9e177c58ea73d043c9e94000000000000000000000000000000000000000000000000000000000000000ff",
"topics": [
"0xeb235a1202ba8b829dff4d9f5fe6160bbe61bf07275989a692c92cbe3a8a3195",
"0x4906bf6a230a11e990653a00205a280100000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000efc927089de2cfb25325c103c1616ca6c7bcd9d4"
],
"type": "mined"
},
Here, "0x4906bf6a230a11e990653a00205a280100000000000000000000000000000000"
is the UUID 4906bf6a-230a-11e9-9065-3a00205a2801
, but I notice this is right padded, as opposed to the other topics that are left padded.
In my application using go-ethereum's abi bindings, I get back a [16]byte of all zeros, which I assume has to do with this padding, based on the go-ethereum code's assumptions.
I've reproduced this behavior in both ganache and parity. Is this a bug in go-ethereum's log parsing, or in solidity (0.5.3)?
topics[0][:arg.Type.Size]
in the line you point to.