Skip to content

Indexed arg filters ignore ABI position; non‑first indexed args map to wrong topic offsets #90

@ylembachar

Description

@ylembachar

logPredicates in internal/usecase/eventtrigger.go assigns indexed topic offsets by the order of the provided JSON arguments, not by the ABI input’s actual position, which leads to the incorrect trigger definition, and causes non-first indexed args to be matched against the wrong topic.

In an EventTransfer(indexed address from, indexed address to, unit value), if the user provides a condition on the "to" argument alone, the predicate offset is set to 1 and therefore compared to the first topic in the log. The trigger therefore never fires.

As a workaround for testing, it is possible to provide all indexed arguments in ABI order so offsets are lined up, if the values can be set to one value.

Correction: Derive the indexed argument offset from the ABI input's position, then assign that offset to the corresponding argument predicate. Here we are using an incremented counter: https://github.com/shutter-network/shutter-api/blob/main/internal/usecase/eventtrigger.go#L183

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions