Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

game-components Reference

Source: game-components

The game-components library provides modular Cairo components for building EGS-compliant contracts on Starknet. Each component is a self-contained unit that can be composed into your contract.

Package Overview

PackageCrate NamePurpose
interfacesgame_components_interfacesAll trait definitions, structs, and interface IDs
embeddable_game_standardgame_components_embeddable_game_standardToken, Minigame, Metagame, Registry components
metagamegame_components_metagameLeaderboard, registration, entry gating, entry fees, prizes, ticket booth
economygame_components_economyTokenomics: buyback (Ekubo TWAMM), stream token
utilitiesgame_components_utilitiesMath, distribution, encoding, SVG rendering
presetsgame_components_presetsReady-to-deploy contracts: LeaderboardPreset, AutonomousBuyback, StreamToken

Dependency Graph

interfaces ◀─── embeddable_game_standard
    ▲                    ▲
    │                    │
    ├── metagame         ├── utilities
    ├── economy          └── presets
    └── utilities

All packages depend on interfaces for trait definitions. The embeddable_game_standard package is the most complex, composing Token, Minigame, Metagame, and Registry components.

Installation

Add the packages you need to your Scarb.toml:

[dependencies]
starknet = "2.15.1"
 
# Core - Token, Minigame, Metagame, Registry
game_components_embeddable_game_standard = { git = "https://github.com/Provable-Games/game-components", tag = "v1.1.0" }
 
# Leaderboard, registration, entry gating, entry fees, prizes
game_components_metagame = { git = "https://github.com/Provable-Games/game-components", tag = "v1.1.0" }
 
# Tokenomics: buyback, stream token
game_components_economy = { git = "https://github.com/Provable-Games/game-components", tag = "v1.1.0" }
 
# Math, distribution, encoding, SVG rendering
game_components_utilities = { git = "https://github.com/Provable-Games/game-components", tag = "v1.1.0" }
 
# Ready-to-deploy contracts
game_components_presets = { git = "https://github.com/Provable-Games/game-components", tag = "v1.1.0" }
 
# OpenZeppelin (required)
openzeppelin_token = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", tag = "v3.0.0" }
openzeppelin_introspection = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", tag = "v3.0.0" }
openzeppelin_access = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", tag = "v3.0.0" }

Reference Pages

Core Components

Metagame Package