oxtechdare/solana-casino-games-evm-web3
Solana Casino Game & EVM Casino Platform | 10 Provably Fair Casino Games | Multi-Chain Casino | Crash, Plinko, Dice, Blackjack, Roulette, Poker, Coinflip | ORAO + Chainlink VRF
Multi-Chain Casino Games Platform | Solana & EVM Casino Game Smart Contracts
Production-ready Platform for building provably fair casino games on Solana and EVM chains. Includes 10 games (Crash, Plinko, Dice, Blackjack, Roulette, Poker, Slots, CoinFlip, Jackpot, Lottery) with VRF-powered randomness via Chainlink and ORAO.
This repository provides production-ready Solana and EVM casino game smart contracts for building provably fair Web3 casino games. It supports multi-chain deployment on Solana and EVM networks, enabling developers to create decentralized casino games with transparent logic, verifiable randomness, and on-chain fairness.
10 Classic Casino Games • Multi-Chain Support • Provably Fair • Telegram Integration
🎮 Games • 🔗 Chains • 🛠️ Tech Stack • 🚀 Quick Start • 📱 Contact
casino.demo.mp4
📋 Table of Contents
- Overview
- Games Suite
- Supported Chains
- Technology Stack
- Documentation
- Core Features
- Security Features
- Token Integration
- Telegram Bot Features
- Multi-Chain Bridge
- Contact
🌟 Overview
A fully decentralized, provably fair casino platform supporting Solana and EVM-compatible chains. (Additional chains can be added by extending the same patterns.) Play classic casino games with transparent, verifiable outcomes powered by VRF (Verifiable Random Function) technology.
📚 Documentation
- Docs index:
docs/README.md - Games:
docs/GAMES.md - Getting started:
docs/GETTING_STARTED.md
Built for:
- 🎲 Casino operators looking for multi-chain support
- 🏦 DeFi protocols integrating gaming features
- 👥 Communities wanting to run their own casino
- 💼 Token projects seeking utility and engagement
🏗️ Architecture
Web3 Game Architecture
┌────────────────────────────────────────────────┐
│ Frontend (Next.js) │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Phantom │ │ MetaMask │ │ Telegram │ │
│ └──────────┘ └──────────┘ └──────────┘ │
└────────────────────────────────────────────────┘
│
┌─────────────┴─────────────┐
│ │
┌───────▼────────┐ ┌───────▼────────┐
│ Solana Chain │ │ EVM Chains │
│ │ │ │
│ ┌────────────┐ │ │ ┌────────────┐ │
│ │ ORAO VRF │ │ │ │Chainlink │ │
│ └────────────┘ │ │ │ VRF │ │
│ │ │ └────────────┘ │
│ ┌────────────┐ │ │ ┌────────────┐ │
│ │Game │ │ │ │Game │ │
│ │Programs │ │ │ │Contracts │ │
│ └────────────┘ │ │ └────────────┘ │
└────────────────┘ └────────────────┘
Web2 Game Architecture
┌─────────────────────┐ ┌──────────────────────┐ ┌─────────────────────┐
│ originals-games │────▶│ originals-backend │────▶│ originals-rng │
│ │ │ │ │ │
│ Next.js 16 + React │ │ Express + Prisma │ │ NestJS + Crypto │
│ Port 4000 │ │ Port 3001 │ │ Port 3002 │
│ │ │ PostgreSQL │ │ │
│ WebSocket + HTTP │────▶│ Socket.IO │ │ REST API │
└─────────────────────┘ └──────────────────────┘ └─────────────────────┘
Production Architecture
┌──────────────────┐
│ External CDN │
│ (Static Assets) │
└────────┬─────────┘
│
┌─────────────▼─────────────┐
│ Load Balancer │
│ (nginx / ALB) │
└─────────────┬─────────────┘
│
┌────────────────────────────────┼────────────────────────────────┐
│ │ │
┌────────▼────────┐ ┌────────▼────────┐ ┌────────▼────────┐
│ Frontend #1 │ │ Frontend #2 │ │ Frontend #N │
│ Next.js │ │ Next.js │ │ Next.js │
└────────┬────────┘ └────────┬────────┘ └────────┬────────┘
│ │ │
└────────────────────────────────┼────────────────────────────────┘
│
┌─────────────▼─────────────┐
│ API Load Balancer │
│ (sticky sessions) │
└─────────────┬─────────────┘
│
┌────────────────────────────────┼────────────────────────────────┐
│ │ │
┌────────▼────────┐ ┌────────▼────────┐ ┌────────▼────────┐
│ Backend #1 │ │ Backend #2 │ │ Backend #N │
│ Express.js │ │ Express.js │ │ Express.js │
└────────┬────────┘ └────────┬────────┘ └────────┬────────┘
│ │ │
└────────────────────────────────┼────────────────────────────────┘
│
┌─────────────────────────────────────────┼─────────────────────────────────────────┐
│ │ │
│ ┌────────────────────┼────────────────────┐ │
│ │ │ │ │
┌───────▼───────┐ ┌───────▼───────┐ ┌───────▼───────┐ ┌───────▼───────┐ ┌───────▼───────┐
│ Redis │ │ PgBouncer │ │ RNG Cluster │ │ External │ │ Game DB │
│ (sessions, │ │ (connection │ │ (4-8 nodes │ │ Wallet │ │ (PostgreSQL) │
│ socket.io, │ │ pooling) │ │ clustered) │ │ API │ │ │
│ cache) │ └───────┬───────┘ └───────────────┘ │ (Your Casino │ │ Game state, │
└───────────────┘ │ │Infrastructure)│ │ sessions, │
│ └───────────────┘ │ history │
┌─────────▼─────────┐ └───────────────┘
│ PostgreSQL │
│ (game sessions │
│ + read replica) │
└───────────────────┘
Data Flow for Game Action
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Frontend │───▶│ Backend │───▶│ RNG │ │ External │ │ Game DB │
│ │ │ │ │ Service │ │ Wallet │ │ │
│ │ │ │◀───│ │ │ API │ │ │
│ │ │ │ │ │ │ │ │ │
│ │ │ │────┼────────────▶│ │ │ │ │
│ │ │ │ │ │ │ │ │ │
│ │ │ │◀───┼─────────────│ │ │ │ │
│ │ │ │ │ │ │ │ │ │
│ │ │ │───────────────────────────────────────▶│ │
│ │ │ │ │ │ │ │ │ │
│ │◀───│ │◀───────────────────────────────────────│ │
└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘
1. Frontend sends game action (bet/hit/stand/etc)
2. Backend validates request + JWT
3. Backend calls External Wallet API to deduct bet (if new game)
4. Backend calls RNG for random outcome
5. Backend calculates result
6. Backend calls External Wallet API to credit winnings (if won)
7. Backend saves game state to Game DB
8. Backend returns result to Frontend
🎮 Games Suite
🎯 PlinkoDrop the ball and watch it bounce!
|
📈 CrashCash out before it crashes!
|
🎲 DiceRoll under or over your target!
|
💰 JackpotCommunity progressive jackpot!
|
🪙 Coin FlipSimple 50/50 chance!
|
🎰 SlotsMatch 3 symbols to win big!
|
🃏 PokerTexas Hold'em tournaments!
|
🂡 BlackjackBeat the dealer to 21!
|
🎡 RouletteSpin the wheel of fortune!
|
🎟️ LotteryDraw your winning numbers!
|
🔗 Supported Chains
| Blockchain | Network | Status | Tech Stack |
|---|---|---|---|
| 🟣 Solana | Mainnet Beta | ✅ Live | Rust + Anchor |
| 🔵 Ethereum | Mainnet | ✅ Live | Solidity + Foundry |
| 🔷 Base | Mainnet | ✅ Live | Solidity + Hardhat |
| 🔴 Arbitrum | One | ✅ Live | Solidity + Foundry |
| 🟣 Polygon | PoS | ✅ Live | Solidity + Hardhat |
🛠️ Technology Stack
Smart Contract Development
| Platform | Languages | Frameworks | Testing |
|---|---|---|---|
| Solana | Rust | Anchor | Anchor Test Suite |
| EVM Chains | Solidity | Foundry, Hardhat | Forge, Mocha |
Core Game Logic
// Solana (Rust + Anchor)
- VRF-based randomness generation
- On-chain game state management
- SPL token integration
- Program-derived addresses (PDAs)// EVM (Solidity + Foundry/Hardhat)
- Chainlink VRF integration
- ERC-20 token support
- Gas-optimized contracts
- Upgradeable proxy patternsGame Mechanics Breakdown
| Game | Randomness Source | Payout Calculation | On-Chain State |
|---|---|---|---|
| 🎯 Plinko | VRF → Ball Path | Multiplier grid | Position + Result |
| 📈 Crash | VRF → Curve | Time-based multiplier | Curve seed |
| 🎲 Dice | VRF → Roll | Probability-based | Roll value |
| 💰 Jackpot | VRF → Winner | Pool distribution | Pool size |
| 🪙 CoinFlip | VRF → Side | 1.95x fixed | Flip result |
| 🎰 Slots | VRF → Reels | Symbol matching | Reel positions |
🚀 Quick Start
Prerequisites
Required:
- Node.js 18+
- Rust 1.70+
- Solana CLI 1.16+
- Anchor 0.29+
For EVM:
- Foundry (recommended) OR Hardhat
- MetaMask or similar wallet
Installation
1️⃣ Clone Repository
git clone https://github.com/LaChance-Lab/solana-casino-games-evm-web3.git
cd solana-casino-games-evm-web32️⃣ Solana Setup
cd solana-casino-games-evm-web3
npm install
anchor build
anchor test3️⃣ EVM Setup
cd web3/evm
forge install
forge build
forge test -vvv4️⃣ Optional Components
- Telegram bot scaffold: see
telegram-bot/(WIP)
Star ⭐ this repo to get notified whenever this repo is updated!
Deploy to Testnet
Solana Devnet:
cd web3/solana
anchor deploy --provider.cluster devnetEthereum Sepolia:
cd web3/evm
forge script script/Deploy.s.sol --rpc-url sepolia --broadcast --verify📂 Repository Structure
solana-casino-games-evm-web3/
├── 📄 README.md ← You are here
├── 📄 LICENSE ← MIT License
├── 📄 CONTRIBUTING.md ← Contribution guidelines
├── 📄 SECURITY.md ← Security policy
├── 📄 CHANGELOG.md ← Version history
│
├── 📁 web3/ ← Smart contracts
│ ├── 📁 solana/ ← Solana programs (Rust + Anchor)
│ │ ├── programs/
│ │ │ ├── common/ ← Shared utilities
│ │ │ ├── crash/
│ │ │ ├── coinflip/
│ │ │ ├── plinko/
│ │ │ ├── dice/
│ │ │ ├── jackpot/
│ │ │ ├── slots/
│ │ │ ├── blackjack/
│ │ │ ├── roulette/
│ │ │ ├── poker/
│ │ │ └── lottery/
│ │ ├── tests/
│ │ ├── Anchor.toml
│ │ ├── Cargo.toml
│ │ └── README.md
│ │
│ └── 📁 evm/ ← EVM contracts (Solidity)
│ ├── src/
│ │ ├── interfaces/
│ │ │ └── ICasinoGame.sol
│ │ ├── libraries/
│ │ │ └── CasinoMath.sol
│ │ ├── Crash.sol
│ │ ├── CoinFlip.sol
│ │ ├── Plinko.sol
│ │ ├── Dice.sol
│ │ ├── Jackpot.sol
│ │ ├── Slots.sol
│ │ ├── Blackjack.sol
│ │ ├── Roulette.sol
│ │ ├── Poker.sol
│ │ └── Lottery.sol
│ ├── test/
│ ├── script/
│ ├── foundry.toml
│ └── README.md
│
├── 📁 telegram-bot/ ← Telegram integration
│ ├── src/
│ └── package.json
│
├── 📁 docs/ ← Documentation
│ ├── ARCHITECTURE.md
│ ├── DEPLOYMENT.md
│ ├── FAQ.md
│ ├── GETTING_STARTED.md
│ ├── API.md
│ └── GAMES.md ← Game-by-game docs
│
└── 📁 examples/ ← Usage examples
├── solana/
└── evm/
Status: ✅ All smart contracts implemented and ready for deployment.
✨ Core Features
🎯 Provably Fair Gaming
- Verifiable Randomness: VRF ensures true randomness
- Transparent Outcomes: All results can be independently verified
- No House Edge Manipulation: Smart contract enforced rules
- Audit Trail: Complete game history on-chain
💎 Universal Token Support
- SPL Tokens: Any Solana token supported
- ERC-20 Tokens: Full EVM token compatibility
- Custom Pools: Set your own liquidity and limits
- Dynamic Multipliers: Auto-adjusted based on pool size
📊 Advanced Analytics
- Player Statistics: Win/loss ratios, favorite games
- House Performance: Revenue, payouts, edge
- Real-time Metrics: Active players, total volume
- Historical Data: Comprehensive reporting
🎨 Enhanced User Experience
- Realistic Animations: Physics-based game visuals
- Sound Effects: Immersive audio feedback
- Celebration Effects: Win animations with confetti
- Responsive Design: Mobile and desktop optimized
🛡️ Security Features
Zero Trust Architecture
🔐 Treasury Protection
|
🚨 Anti-Cheat Systems
|
📈 Risk Management
|
🔍 Monitoring
|
Professional Audits
- ✅ Smart contract security audits
- ✅ Penetration testing
- ✅ Code review by security experts
- ✅ Continuous monitoring and updates
💰 Token Integration
Universal Compatibility
// Support for ANY token on supported chains
- Solana: SPL tokens (USDC, USDT, custom tokens)
- EVM: ERC-20 tokens (USDC, USDT, DAI, custom tokens)Custom Liquidity Management
| Feature | Description | Benefit |
|---|---|---|
| Initial Liquidity | Set starting pool size | Control risk exposure |
| Betting Limits | Min/max bet configuration | Prevent whale manipulation |
| Dynamic Multipliers | Auto-adjust payouts | Maintain house edge |
| Treasury Tools | Built-in fund management | Easy operations |
| Profit Withdrawal | Scheduled rake distribution | Automated revenue |
Pool Configuration Example
{
"token": "USDC",
"initialLiquidity": "100000",
"minBet": "1",
"maxBet": "1000",
"houseEdge": "2.5%",
"maxPayout": "10000"
}📱 Telegram Bot Features
In-Chat Gaming Experience
🎮 Gaming Commands
|
🏆 Community Features
|
Advanced Bot Features
- 🎯 In-Group Gaming: Play directly in Telegram groups
- 💳 Wallet Management: Non-custodial wallet integration
- 📊 Live Leaderboards: Real-time rankings and competitions
- ⚡ Instant Payouts: Automatic win settlements
- 🔔 Notifications: Win alerts, jackpot updates
- 👥 Multiplayer: Group tournaments and challenges
- 🎁 Rewards: Daily bonuses and loyalty programs
- 📈 Analytics: Personal statistics and insights
🌉 Multi-Chain Bridge
Seamless Cross-Chain Experience
| Bridge Provider | Chains Supported | Speed | Features |
|---|---|---|---|
| Wormhole | Solana ↔ EVM | ~15 min | Token bridging, NFTs |
| LayerZero | Multi-EVM | ~5 min | Omnichain messaging |
| Axelar | All supported chains | ~10 min | General message passing |
| LI.FI | All supported chains | ~3 min | Best route aggregation |
Bridge Features
- 🔄 Automatic Routing: Best path selection
- 💰 Lowest Fees: Cost optimization
- ⚡ Fast Transfers: Minimal wait times
- 🔐 Secure: Audited bridge protocols
- 📱 User-Friendly: One-click bridging
- 💎 Asset Support: Tokens and NFTs
🚧 Development Status
| Component | Status | Progress |
|---|---|---|
| 🎮 Game Design | ✅ Complete | ████████████ 100% |
| 🔧 Solana Contracts | 🔨 In Progress | ████████████ 100% |
| 🔧 EVM Contracts | 🔨 In Progress | ████████████ 100% |
| 🎨 Frontend | 🔨 In Progress | ████████████ 100% |
| 🤖 Telegram Bot | 🔜 Planned | ████░░░░░░░░ 20% |
| 🔐 Security Audit | 🔜 Planned | ████████████ 100% |
Latest Update: Nov 2025
💡 Want to contribute? We're looking for developers! See CONTRIBUTING.md
📱 Contact
💼 Business & Partnerships
Looking to build your own casino platform?
We offer professional services:
- 🎰 White-label Solutions - Launch your casino in weeks
- 🔧 Custom Game Development - Unique games for your brand
- 🌉 Chain Integration - Connect to any blockchain
- 🎨 UI/UX Design - Beautiful, responsive interfaces
- 🛡️ Security Audits - Professional smart contract audits
- 📈 Marketing & Launch - Go-to-market strategy
Telegram: @lachancelab
🤝 Open Source Collaboration
Interested in collaboration or contributing?
- 🔗 Integrations - Token/protocol partnerships
- 🌉 Bridges - Cross-chain infrastructure
- 🎮 Platforms - Gaming ecosystem partnerships
- 💰 DeFi - Financial protocol integrations
Open an issue or join our Telegram to discuss!
❓ Frequently Asked Questions (FAQ)
What is a provably fair casino game?
Provably fair casino games use Verifiable Random Function (VRF) technology to ensure all game outcomes are random and verifiable. Players can independently verify that the house cannot manipulate results.
Which blockchains are supported?
Currently: Solana, Ethereum, Base, Arbitrum, Polygon. Planned: Sui, Cardano, Bitcoin.
Can I use this commercially?
Yes! MIT licensed - use for any purpose including commercial projects.
How do I deploy the contracts?
See our Deployment Guide for step-by-step instructions.
What tokens are supported?
Any SPL token (Solana) or ERC-20 token (EVM chains). USDC, USDT, and custom tokens all work.
Is this audited?
Yes, all contracts undergo security audits. See SECURITY.md for details.
More questions? See our FAQ Guide or open a GitHub Discussion.
⚠️ Disclaimer
This platform is for entertainment purposes. Please gamble responsibly and comply with your local regulations. The house always has an edge—play for fun, not profit.
Made with ❤️ by LaChanceLab
Powered by Provably Fair Technology