A production‑grade collection of Solana casino game smart contracts, built with Anchor and designed for fairness, security, and composability.
This repository contains multiple on‑chain casino games such as Plinko, Jackpot, Coinflip, Dice, and Roulette, written in Rust and optimized for real‑world deployment on Solana.
Whether you're building a full casino platform, experimenting with on‑chain randomness, or learning advanced Solana patterns (PDAs, CPI, VRF, escrow, vaults), this repo is designed to be a strong foundation.
- 🧠 Provably Fair Game Logic
- 🔐 Secure Vault & Treasury Management
- 🎲 On‑chain Randomness (VRF‑ready)
- ⚡ Low‑latency, high‑throughput Solana execution
- 🧩 Modular & Extensible Architecture
- 🧪 Test‑driven with Anchor test suite
- 🛠 Production‑oriented account design (PDAs, seeds, bumps)
| Game | Description |
|---|---|
| Plinko | Ball drop game with configurable risk and payout multipliers |
| Coinflip | Simple 50/50 wager game |
| Dice | Roll‑based game with adjustable win probability |
| Roulette | Classic roulette mechanics adapted for on‑chain execution |
| Jackpot | Pooled betting game with winner‑takes‑all logic |
Each game is implemented as an independent Anchor program or isolated module, allowing easy reuse or selective deployment.
This repo is designed to support secure randomness, including:
⚠️ Pseudo‑random fallback (for local testing)- 🔮 VRF integration ready (e.g. Orao, Switchboard)
- ⛓ Seed‑based entropy using blockhash + user input (non‑VRF modes)
Important: For mainnet deployment, VRF is strongly recommended to prevent manipulation.
- Player submits bet + parameters
- Funds transferred to game vault PDA
- Random outcome is generated
- Win/loss is calculated on‑chain
- Payout (if any) sent back to player
- House edge retained in treasury
All calculations are performed fully on‑chain.
- ✔ Checked arithmetic (no overflows)
- ✔ PDA‑only vault ownership
- ✔ Explicit signer checks
- ✔ Configurable max bet & limits
⚠️ This repo has not been audited. Use at your own risk for mainnet deployments.
You can easily add new games by:
- Creating a new Anchor program
- Reusing the shared vault & randomness utilities
- Defining game‑specific payout logic
Examples:
- Blackjack
- Baccarat
- Crash game
- Slots
If you find this project useful, consider starring the repo ⭐
Happy building on Solana 🚀