Repository navigation
Conversation
…indFlowInteractive#402, MindFlowInteractive#403) - Add modular Soroban smart contract in contracts/points_ledger - Implement points balance and full historical ledger structure - Support authorized caller access control (admin and whitelisted game contracts) - Implement earn and earn_with_expiry recording amount, player, caller, reason code, and expiry timestamp - Implement spend function with strict First-In First-Out (FIFO) consumption of oldest unexpired points - Exclude expired points from available balance and reject spending when exceeding unexpired balance - Expose read functions for get_balance, get_total_earned, and get_history - Add unit test suite in src/test.rs covering authorized earning, balance invariant, FIFO spend order, and expiration exclusion - Add README.md documentation and workspace entry in Cargo.toml Closes MindFlowInteractive#402 Closes MindFlowInteractive#403
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.
Summary of Changes
This Pull Request provides a comprehensive, production-grade Soroban smart contract for the Achievement Points Ledger lifecycle across Stages 1 and 2, fulfilling all acceptance criteria for both #402 and #403:
Points Ledger & Authorized Earning (Stage 1 - Achievement Points Ledger #402):
FIFO Spending & Expiration Policy (Stage 2 - Achievement Points: Spend and Expiry #403):
spendfunction with balance check for player in-game purchases.InsufficientBalanceerror).Testing & Tooling:
src/test.rspassing with 100% success (covering authorized earning, balance invariant, strict FIFO consumption order, expiration exclusion, and overspend protection).Cargo.toml.contracts/points_ledger/README.md.Closes #402
Closes #403