Skip to content

Typed event decoding: ABI-driven decodeEvent #67

Description

@koko1123

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions