-
Notifications
You must be signed in to change notification settings - Fork 6
Description
📚 Overview
Implement the internal token economy for Monopoly using game-specific minting, balance tracking, and token transfers. These methods simulate the flow of in-game money and support property transactions, rent collection, and upgrades.
🛠️ Tasks
Implement get_players_balance to return a player's game balance.
Implement mint to add tokens to a player’s balance at game start.
Implement transfer_from to support buying, rent, and penalties.
Ensure token flow obeys Monopoly logic and checks for overdraws or reentrancy.
Write tests for transfer behavior during property buys and rent collection.
✅ Definition of Done
Player balances persist and reflect all in-game economic actions.
Transfers succeed only when the sender has enough funds.
Minted funds appear in the recipient’s account.
No token loss or duplication occurs across multiple transactions.
All economy methods are tested and integrated into gameplay flow.
🔧 Technical Considerations
All balance methods should be game-specific (tied to game_id).
Ensure accurate overflow/underflow checks using u256.
Use modular math or helper libraries if needed.
Prevent unauthorized access to mint or transfer functions.