Write a self-contained Uniswap v4 hook on the starter's BaseHook that records, per pool, the pool tick observed at the first swap of each block, and exposes those recorded snapshots through read-only …
Write a self-contained Uniswap v4 hook on the starter's BaseHook that records, per pool, the pool tick observed at the first swap of each block, and exposes those recorded snapshots through read-only view functions. Overwrite nothing on later swaps within the same block. The hook must take no fee, hold no privileged role, have no owner or upgrade path, and must not modify anything already present in the tree.
Ship tests using the existing launch-pool harness that cover: the first swap in a block records a tick; a second swap in the same block leaves the record unchanged; a swap in a later block records a new snapshot; and reads for a pool that has never swapped behave sanely rather than reverting ambiguously.
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.