♠️
RACE Protocol
NFT PresaleDiscord
  • ❤️Official Docs & Links
  • ⏳Progress Overview
  • RACE Protocol
    • 🏗️System Architecture
      • Components
      • On-chain Accounts
      • Synchronization
      • Randomization
      • Payment
    • 🎲Game Development
      • Game Handler
      • Effect
      • Event Handling
      • Race API
        • Arweave Integration
      • Race JS SDK
        • Installation and Setup
        • Key Components
          • AppClient
          • SubClient
          • Events
          • Game Context
          • Decryption Cache
        • Advanced Features
          • Getting Revealed Knowledge
          • Exiting and Detaching
          • Submitting Messages
          • Sub-game Interaction
        • Best Practices
        • API Reference
        • Troubleshooting
    • 🧪Testing
      • Race Test Kit
      • Unit Testing
      • Integration Testing
      • Additional Considerations
    • 🧱Modules & Features
      • Encryption Methods
      • Command-line Tools
      • Configuration Options
      • Blockchain Transport Implementations
    • 📃Smart Contract
      • Solana Program
    • 🔦Examples and Use Cases
      • Draw Card Game
      • Raffle Game
      • Other Examples
  • RACE Games
    • ♠️RACE Poker app
      • 🎮Start playing in minutes
        • 💰Cash and sit-n-go
        • 🏆Tournaments
      • 🎨Workshop
        • 🏆Create cash games
        • 🏨Create tourneys
      • 💡Concept introduction
      • 🏗️System architecture
      • 👾Game Flow
      • 🎲Cards shuffling
      • ☎️Communication
      • 🔐Key sharing/decryption
      • 💱Cash flow structure
    • ⚡Solfast
      • 🎲Game modes
  • RACE RESEARCH
    • 👾No-Code Development
      • Brainstorming
      • Implementation Approach
      • Project Status
    • 0️⃣Zero-Knowledge Proofs
      • Brainstorming
      • Integration steps
        • Verifiable Randomness Generation
        • Private Game State Updates
        • Verifiable Settlements
        • Private Player Actions
      • Project Status
    • 🛡️Security Audit Report
      • Executive summary
        • Introduction to Race Protocol
        • Audit Methodology
      • Findings
        • Smart Contract Security
        • WebAssembly Security
        • Client-side Security (Race SDK)
        • Server-side Security
        • Randomization and Encryption
        • On-chain Account Management
        • Synchronization Mechanisms
        • Payment Handling
      • Recommendations
      • Conclusion
  • RACE DAO
    • 😎About
    • 🫂Community
    • 🖼️NFT Collection [!]
Powered by GitBook
On this page
  1. RACE Protocol

Smart Contract

The Race Protocol smart contract serves as the trustless and transparent foundation for managing games and assets within the Race ecosystem. It provides a set of instructions that enable various functionalities, including game creation, player interactions, server management, and secure settlements.

Overview of Contract Functionality

The Race contract offers instructions for the following key functionalities:

  • Game Management:

    • Create Game Account: This instruction allows anyone to create a new game account on the blockchain, specifying the game title, bundle address, token used for gameplay, maximum number of players, entry type, and other game-specific data.

    • Close Game Account: This instruction allows the game owner to close an empty game account, retrieving the remaining assets and removing the game from the blockchain.

    • Register Game: This instruction allows the game owner to register their game in a public or private registration account, making it discoverable by players and servers.

    • Unregister Game: This instruction allows the game owner or the registration owner to remove a game from the associated registration account.

  • Player Interactions:

    • Create Player Profile: This instruction allows players to create their on-chain profiles, specifying their nickname and optional avatar NFT.

    • Join Game: This instruction allows players to join a game by depositing the required tokens into the game's stake account.

    • Deposit: This instruction allows players to deposit additional tokens into the game's stake account during gameplay.

  • Server Management:

    • Register Server: This instruction allows server owners to register their servers on-chain, specifying the server's endpoint and other relevant information.

    • Serve Game: This instruction allows a server to declare its intention to serve a specific game, writing its address into the game account and potentially becoming the Transactor.

    • Vote: This instruction allows players and servers to vote on the Transactor's inactivity or misbehavior, potentially triggering a game halt and requiring intervention.

  • Settlements:

    • Settle: This instruction, typically sent by the Transactor, handles the finalization of a game. It processes settlements for players, distributes winnings, handles player exits, and updates the game account with the final state and checkpoint data.

These instructions provide a comprehensive set of tools for managing the lifecycle of Race games, from creation and player interactions to server management and secure settlements.

The following sections will provide detailed descriptions of each instruction, including their specific parameters, required accounts, and expected behavior.

PreviousBlockchain Transport ImplementationsNextSolana Program

Last updated 1 year ago

📃