Skip to content

Implement betting vault logic#277

Open
Dopezapha wants to merge 3 commits intoHahfyeex:Defaultfrom
Dopezapha:feat/issue-5-betting-vault
Open

Implement betting vault logic#277
Dopezapha wants to merge 3 commits intoHahfyeex:Defaultfrom
Dopezapha:feat/issue-5-betting-vault

Conversation

@Dopezapha
Copy link
Copy Markdown
Contributor

Closes #5

Implements the betting vault logic for the [PredictionMarket] Soroban smart contract. Funds are transferred from the bettor into contract escrow upon [place_bet] and held securely until [resolve_market] + [batch_distribute] executes.

Changes

[place_bet] — full implementation

  • Transfers [amount] tokens from bettor to the contract address via token::Client (SEP-41 interface; any Stellar Asset Contract address)
  • Records position in Map<Address, (u32, i128)> persistent storage keyed by bettor address, value = [(option_index, cumulative_stake)]
  • Rejects bets when ledger.timestamp() >= market.deadline
  • Rejects bets on paused or non-active markets
  • Validates amount > 0 and option_index < options.len()

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 26, 2026

@Dopezapha Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Dopezapha Dopezapha closed this Mar 26, 2026
@Hahfyeex Hahfyeex reopened this Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The "Betting Vault" Logic (XLM Escrow)

2 participants