-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave program
Description
Description
release_creation_deposit (Line 211) checks if market.creation_deposit > 0 and then performs a transfer. However, it does not set the market.creation_deposit field to 0 after the transfer. A malicious actor (or even a bug in the loop) could repeatedly call this function as long as the market remains Resolved, draining the contract's balance if multiple depositors are involved.
Requirements and context
- Set the deposit amount in the market struct to 0 immediately after a successful transfer.
- Implement the Checks-Effects-Interactions pattern strictly.
Suggested execution
- Fork the repo and create a branch:
git checkout -b fix/issue-83-double-refund-guard - Update the deposit release logic.
Implementation changes
- Modify
markets.rs(around line 228) to update the market state before or immediately after the transfer.
Test and commit
- Verify that a second call to
release_creation_depositfor the same market returns successfully but performs no transfer.
Example commit message
fix: prevent double-refund of creation deposits by zeroing state after release
Guidelines
- Re-entrancy and double-spend protection.
- Timeframe: 24 hours.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave program