📟Roulette

The Roulette smart contract is a part of a decentralized gaming platform, specifically designed to handle the logic and operations related to playing a game of roulette. It leverages the Ethereum blockchain for transparency, fairness, and security. The contract employs Chainlink's Verifiable Random Function (VRF) to ensure the randomness of roulette spins, integrates with a dynamic staking system, and adheres to the game interface standard defined within the platform.

Key Features

  • Implements Chainlink VRF for provably fair randomness.

  • Integrates with a Dynamic staking mechanism for handling bets and payouts.

  • Enforces betting limits and validates bet data.

  • Non-reentrant to prevent re-entrancy attacks.

  • Emits events for key actions: bet placement, spin result, etc.

Variables

  • REQUIRED_FUNDS_COEFFICIENT: Multiplier for validating sufficient balance.

  • subscriptionId, vrfCoordinator, keyHash: Chainlink VRF configuration.

  • limits: Struct mapping defining minimum and maximum bet sizes.

  • staking, core: Addresses for the staking and core contracts.

Functions

Public and External

  • getPossibleWin: Calculates the maximum possible win for given bet data.

  • placeBet: Initiates a roulette spin request for a player. Validates bet data, requests randomness, and records the bet.

  • getAddress, getVersion, getFeeType, getStaking: Interface implementations providing contract details.

  • setLimit: Updates minimum and maximum bet sizes for a specific bet type.

Events

  • Rolled: Emitted when a roulette spin is requested.

  • Landed: Emitted with the result of a roulette spin.

  • LimitChanged: Emitted when bet limits are updated.

Last updated