-
Notifications
You must be signed in to change notification settings - Fork 6
Description
📚 Overview
Implement utility methods for accessing game-related player and user data in the Monopoly game contract. These functions are critical for referencing usernames, retrieving players, and displaying current game states across sessions on Starknet.
🛠️ Tasks
Implement get_username_from_address to resolve usernames from wallet addresses.
Implement retrieve_player to return full player state by address.
Implement retrieve_game to return the current state of a game.
Validate correct deserialization and game_id/address matching in return values.
Ensure these methods are read-only and efficient in gas usage.
✅ Definition of Done
Username resolution and player retrieval are functional and reliable.
Game and player structs returned are accurate reflections of stored state.
All data is queryable without mutating contract storage.
Input parameters are validated to avoid incorrect lookups.
🔧 Technical Considerations
Use @t or view-only refs for functions not mutating state.
Ensure compatibility with frontend and Dojo model schema.
Prevent null or empty results through strong validation logic.
Maintain low gas usage and avoid unnecessary deserialization.