feat: implement user balance tracking and management#292
Merged
greatest0fallt1me merged 1 commit intoPredictify-org:masterfrom Jan 31, 2026
Merged
Conversation
- Updated distribute_payouts to credit user Internal Balance using BalanceStorage - Updated claim_winnings to credit Internal Balance instead of direct transfer - Fixed double-counting bug in distribute_payouts for bet stakes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Description
📋 Basic Information
Type: ✨ New feature & 🐛 Bug fix
Issues: Closes #206
Priority: 🟡 High
📝 Description
This PR implements User Balance Management and fixes critical bugs in the payout system.
Key Changes:
BalanceStorageinstead of being transferred immediately to their wallet. This allows users to accumulate funds for future bets.InvalidState (#400)panics inevent_management_testsby ensuring proper mock token initialization in TestSetup.🧪 Testing
balance_testspass (Deposit/Withdraw flows confirmed).event_management_testspass (Payouts and state transitions confirmed).🔍 Review Focus
BalanceStorage::add_balance.