Peer2Play WhitePaper
  • 📜Introduction
  • ⛔Problem Statement
  • đŸ› ī¸Solution
  • đŸŽ¯Mission and Vision
  • ⚡Key Features
    • Game Tokenization
    • Developer On-Boarding
    • Player-Driven Ecosystem
    • Transparent Revenue Sharing
    • On-chain Tournaments
    • Tokenized Economy
    • Cross-Chain Integration
    • Governance and Incentives
      • GameDAO
      • Incentives
    • Co-Ownership Model
      • Tokenized Games
      • Buybacks and Burns
  • 🤖AI Agents
  • Games
    • âœ‚ī¸Punk Paper(LIVE)
    • 🏏Decentralized Cricket League (DCL)(LIVE)
    • đŸ‹ī¸Chain Duel(Coming Soon)
    • đŸ•šī¸Upcoming Games
  • 🧩Use cases
  • đŸ’ĢGetting started
    • Game Developers
    • Influencers
    • Gamers
  • 👨‍đŸ’ģTechnical Architecture
    • MPC Wallet
    • Smart contract Architecture
      • Peer2PlayGenericStakingContract
        • Chess
        • Poker
        • Ludo
      • Peer2PlayGenericNonStakingContract
        • 1. Role-Playing Game (RPG)
        • 2. City-Building Game
        • 3. Farming Simulations
      • Tokenization & Revenue distribution
    • SDKs & APIs
  • 🔐Compliance & Security
  • ❓FAQ & Troubleshooting
  • 🤝Connect with Peer2Play
Powered by GitBook
On this page
  1. Technical Architecture
  2. Smart contract Architecture

Peer2PlayGenericNonStakingContract

The Peer2PlayGenericNonStakingContract is a modular and extensible platform for simulation games.

It allows:

  1. Protocol admins to manage games and token standards dynamically.

  2. Game owners to deploy token contracts, register players, and manage game-specific functionalities.

  3. Players to register, participate, and interact with game assets.

The platform supports multiple token standards, efficient game management, and seamless integration of on-chain and off-chain data.


2. Imports Used & Their Significance

  1. @openzeppelin/contracts/access/Ownable.sol:

    • Provides ownership functionality for access control using onlyOwner.

  2. @openzeppelin/contracts/utils/Pausable.sol:

    • Enables pausing and unpausing of contract operations during emergencies.


3. State Variables

  1. games:

    • Stores game-specific data using the Game struct.

  2. tokenStandardFactories:

    • Maps token standards to their respective factory contracts.

  3. gameCounter:

    • Auto-incrementing counter for assigning unique game IDs.


4. Functions & Their Significance

Protocol Admin Functions

  1. addTokenStandard: Registers a new token standard with its factory.

  2. addGame: Adds a new game with metadata and fee configuration.

  3. pauseGame: Temporarily halts operations for a game.

  4. unpauseGame: Resumes operations for a paused game.

  5. removeGame: Deregisters a game from the platform.


Game Owner Functions

  1. updateGameFee: Updates the fee percentage for a game.

  2. deployTokenContract: Deploys a token contract using a registered factory.


Player Functions

  1. registerOnGame: Allows players to register for a specific game.

PreviousLudoNext1. Role-Playing Game (RPG)

Last updated 4 months ago

👨‍đŸ’ģ