Skip to content

[contracts] Add re-entrancy guard to claim_winnings() and claim_refund() #968

Description

@Ehonrie

Ensure both claim functions mark the bet as claimed BEFORE transferring any XLM (checks-effects-interactions pattern).

Correct order (must be enforced):

  1. Read and validate state
  2. Set CLAIMED_{bet_id} = true
  3. Transfer XLM — never before step 2

Acceptance Criteria:

  • CLAIMED_{bet_id} set to true on the line immediately before the first transfer()
  • A second call with the same bet_id panics before any transfer occurs
  • Unit test calls claim twice and confirms second call panics

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions