Motivation
event.zig matches topics and exposes raw DecodedLog, but users must hand-decode indexed params and data. ethers/viem decode a log into named, typed values given the event ABI — table stakes for app developers.
Scope
decodeEventLog(allocator, event: abi_types.Event, log: Log) !DecodedEvent — indexed params from topics (dynamic indexed types are keccak hashes, surface as such), non-indexed via abi_decode over log.data
DecodedEvent: ordered name/value pairs using the existing decoded-value representation
Pointers
abi_json.zig already parses event definitions with indexed flags; abi_decode.zig handles the data segment. Wire them together; test with an ERC-20 Transfer and a multi-indexed custom event.
Motivation
event.zigmatches topics and exposes rawDecodedLog, but users must hand-decode indexed params and data. ethers/viem decode a log into named, typed values given the event ABI — table stakes for app developers.Scope
decodeEventLog(allocator, event: abi_types.Event, log: Log) !DecodedEvent— indexed params from topics (dynamic indexed types are keccak hashes, surface as such), non-indexed viaabi_decodeoverlog.dataDecodedEvent: ordered name/value pairs using the existing decoded-value representationPointers
abi_json.zigalready parses event definitions withindexedflags;abi_decode.zighandles the data segment. Wire them together; test with an ERC-20 Transfer and a multi-indexed custom event.