Scope: contracts/src/TreasureHunt.sol
The Claimed event is declared with an indexed recipient parameter:
…but inside claim() it is emitted with msg.sender in the
recipient slot:
Because the same function explicitly rejects recipient == msg.sender
(line 86, revert InvalidRecipient()), the emitted address is
guaranteed to differ from the actual ETH payout recipient for every
successful claim.
Likelihood: HIGH — every successful claim produces an incorrectly
labeled event.
Impact: LOW — the on-chain ETH transfer is unaffected; only
off-chain consumers (subgraphs, block explorers, payout dashboards,
user-facing UIs) attribute the treasure reward to the submitter
instead of the recipient.
Call hunt.claim(proof, treasureHash, rcpt) from msg.sender == alice
with rcpt = bob.
ETH transfers to bob as expected.
The emitted Claimed event has treasureHash as expected and
recipient = alice (wrong — should be bob).
Any subgraph or explorer that wires {treasureHash -> recipient}
from the event will show Alice as the payout target.
If both the submitter and the recipient are considered useful
off-chain, add a separate indexed submitter field:
This finding was identified and written up with the assistance of an
autonomous AI auditor (Anthropic Claude).
The event is declared as event `Claimed(bytes32 indexed treasureHash, address indexed recipient);`, which clearly indicates that the second indexed field is meant to represent the reward recipient, but `claim()` emits `Claimed(treasureHash, msg.sender)` instead of `Claimed(treasureHash, recipient)`, even though the ETH transfer is sent to recipient and the proof itself is constructed around the public inputs (treasureHash, recipient). As a standalone finding, this is appropriately low severity because it is fundamentally an event/accounting inconsistency rather than a direct loss-of-funds issue: the core state transition and payout still follow the intended recipient, but off-chain consumers reading the event log will observe incorrect metadata about who was associated with the claim.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.