Skip to content

Player and Game Access Utilities #12

@aji70

Description

@aji70

📚 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions