Skip to content

Commit cfce78f

Browse files
committed
fix: use anchor paid_at as canonical double-claim guard in claim_prize
The PrizeClaimed flag (fast-path) can TTL-expire while winner rows stay live from get_winners/winner_at reads. Added && paid_at.is_none() to the anchor scan so a claimed anchor (paid_at: Some(...)) prevents replay even if the separate flag has expired.
1 parent 89db965 commit cfce78f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

contracts/events/src/event_ops.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ pub fn claim_prize(
736736
if w.recipient != recipient || w.position != position {
737737
continue;
738738
}
739-
if w.milestone.is_none() {
739+
if w.milestone.is_none() && w.paid_at.is_none() {
740740
winner_info = Some((idx, w.amount, w.reputation_bump));
741741
break;
742742
}

0 commit comments

Comments
 (0)