# 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](https://vrf.chain.link/) for provably fair randomness.
* Integrates with a [Dynamic staking](/smartcontracts-description/dynamic-staking.md) 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](/smartcontracts-description/dynamic-staking.md) and [core](/smartcontracts-description/core.md) 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.celestium.digital/smartcontracts-description/roulette.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
