Skip to content

Entry Point Contradiction for withdraw_refund #195

@hman38705

Description

@hman38705

Description
The withdraw_refund function exists in both cancellation.rs and bets.rs with slightly different signatures and logic (e.g., SAC safety). This creates two entry points for the same logical operation, leading to confusion for developers and potentially allowing a user to double-refund if the state removal isn't perfectly synchronized across both paths.

Requirements and context

  • Consolidate all refund logic into a single internal utility or a dedicated module.
  • Ensure only one public entry point exists for user refunds.

Suggested execution

  • Fork the repo and create a branch: git checkout -b refactor/issue-92-refund-unification
  • Deprecate the redundant function.

Implementation changes

  • Move the primary refund logic to bets.rs and update cancellation.rs to call it, or remove one entirely.

Test and commit

  • Verify that a user cannot successfully call both refund functions for the same bet.

Example commit message
refactor: unify market refund entry points to prevent duplication and double-spend risks

Guidelines

  • Modular clear design.
  • Timeframe: 24 hours.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions