Add Crypto Roulette & Daily Lottery - Dual Gaming System #83
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎰 Crypto Roulette & Daily Lottery
Pyth Entropy Submission - ETH Global Buenos Aires 2025
A dual gaming system demonstrating innovative use of Pyth Entropy V2 for verifiable on-chain randomness.
🎯 Project Overview
Crypto Roulette & Daily Lottery creates an interconnected gaming ecosystem where:
Both games powered by Pyth Entropy V2 for provably fair randomness.
🔮 Innovation: Dual Randomness Patterns
Unlike typical single-game implementations, this project showcases TWO distinct use cases for Pyth Entropy in one ecosystem:
Pattern 1: High-Frequency Randomness (CryptoRoulette)
Pattern 2: Periodic Randomness (DailyLottery)
This dual-pattern approach highlights Pyth Entropy's versatility across different gaming mechanics within a single interconnected economy.
✨ Key Features
🚀 Deployed Contracts (Optimism Sepolia)
0x19aab2239911164c9051ccaed184102a10d7121f0x5149cc9f6c3a4b60cfa84125161e96b0cf677eb4Network: Optimism Sepolia (Chain ID: 11155420)
Deployed Block: 36038675
Status: ✅ Verified and Functional
🛠️ Tech Stack
📊 Technical Implementation
CryptoRoulette.sol
// Request random number
uint64 sequenceNumber = entropy.requestV2{ value: entropyFee }();
// Callback with result
function entropyCallback(uint64 sequenceNumber, address, bytes32 randomNumber) {
uint256 randomIndex = uint256(randomNumber) % 5;
Asset resultAsset = Asset(randomIndex);
// Determine winner and add to lottery if won
}### DailyLottery.sol
// Trigger daily draw
uint64 sequenceNumber = entropy.requestV2{ value: entropyFee }();
// Callback selects winner
function entropyCallback(uint64 sequenceNumber, address, bytes32 randomNumber) {
uint256 winnerIndex = uint256(randomNumber) % whitelist.length;
address winner = whitelist[winnerIndex];
// Transfer prize to winner
}---
📁 Submission Contents
entropy-sdk-solidity/examples/crypto-roulette-lottery/
├── README.md (Comprehensive documentation)
├── DEPLOYMENT.md (Step-by-step deployment guide)
├── contracts/
│ ├── CryptoRoulette.sol (Roulette game contract)
│ ├── DailyLottery.sol (Lottery contract)
│ └── interfaces/
│ └── IDailyLottery.sol (Interface)
└── script/
└── DeployCryptoRoulette.s.sol (Deployment script)
🏆 Built For
ETH Global Buenos Aires Hackathon 2025
Track: DeFi / Gaming
Prize: Pyth Entropy Pool Prize
Qualification Requirements Met:
✅ Uses Pyth Entropy to generate random numbers on-chain
✅ Consumes random numbers in smart contracts via callbacks
✅ Demonstrates innovative use (dual patterns in one ecosystem)
✅ Production-ready deployment with verification
✅ Comprehensive documentation
This project goes beyond basic Pyth Entropy integration by:
Innovation: Demonstrates TWO distinct randomness patterns in a single ecosystem
Complexity: Cross-contract integration with shared state
Production-Ready: Fully deployed, verified, and functional
Documentation: Comprehensive README and deployment guide
Real-World Use: Practical gaming mechanics that users can actually play
The dual-pattern approach showcases Pyth Entropy's versatility: it's not just for one type of randomness, but can power different gaming mechanics working together in harmony.