Skip to content

feat(cast): add cast events <txHash> to fetch and format events from receipt #2340

Open
@zobront

Description

@zobront

Component

Cast

Describe the feature you would like

I'm able to call cast receipt [txHash] logs to get the full logs of a transaction, but it's time consuming to manually parse the logs into legible events.

Seems helpful to be able to call cast events [txHash] to get a nicely formatted view of the events.

I'd love to build this out, as soon as we have agreement on the plan below.

Rough Plan

  1. Grab the logs using cast.receipt() with field set to logs.

  2. For each, grab topic[0] and run it against 4byte. If that fails, try pulling interface and comparing to event signatures from abi. If neither works, error out.

  3. Convert topics & data into types defined by the event.

  4. Print pretty output with event signature and correct data.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-tracingArea: tracingC-castCommand: castT-featureType: featurefirst issueA good way to start contributing

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions