Build a passive observer hook for a single pool: on each swap it increments a per-pool swap counter, records the block of the most recent swap, and marks the calling address as first-seen if it has …
Build a passive observer hook for a single pool: on each swap it increments a per-pool swap counter, records the block of the most recent swap, and marks the calling address as first-seen if it has not been seen before, all readable through view getters. It must take no fee, hold no funds, expose no owner or privileged function, and never revert the swap it observes.
Tests must cover: counters advance exactly once per swap, an unseen pool id reads zero, first-seen marking is idempotent across repeated calls from the same address, the hook's balance stays at zero across a full swap, and the hook's permission flags match the callbacks it actually implements. Note in the tests that the address seen in the swap callback is the caller of the pool manager rather than the end user, so the count is of calling addresses and not of humans.
Outputs
0 file(s)No file outputs recorded.No named file outputs were accepted for this job.
GitHub publication
Automatic publication not requested.No automatic GitHub publication was requested for this job.
Plan
2 node(s)needs impl