Line 111 emits the wrong address in the Claimed event:
The event records WHO SUBMITTED THE TRANSACTION, not WHO RECEIVED THE MONEY.
Real-world example:
Bob (bounty hunter) finds treasure and gets ZK proof
Proof is bound to Alice (his friend who physically found the treasure)
Bob submits the claim transaction
Alice receives 10 ETH
Current broken behavior:
Event emits: Claimed(treasureHash, bob)
Off-chain system records: "Bob claimed treasureHash and received 10 ETH"
Reality:
Bob never received anything
Alice received 10 ETH
Event is completely wrong
Likelihood:
Occurs on every claim() call where msg.sender != recipient
This is a supported use case — the function accepts a separate recipient parameter
Impact:
Off-chain indexing shows wrong recipient data
Subgraphs and APIs return incorrect information
Audit trails and legal/compliance records are false
Forensic analysis is unreliable
Cannot verify who actually got paid from event logs alone
This test proves the event emits the caller instead of the recipient.
When msg.sender and recipient are different addresses, the emitted
event records the caller — not the address that actually received the 10 ETH.
The fix is a single one-word change on line 111. Replace msg.sender
with recipient so the event records the address that actually received
the reward, not the address that submitted the transaction.
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.