🎲 Dice Prediction Game Web3 Demo-video
A decentralized dice prediction game built on Ethereum blockchain, combining the excitement of probability-based gaming with Web3 technology. Players can predict dice outcomes and win rewards based on their predictions.
- Decentralized Gaming: Built on Ethereum blockchain for transparency and fairness
- Prediction Mechanics: Users can predict dice roll outcomes and win rewards
- Modern Web3 Integration: Seamless wallet connection and blockchain interaction
- Responsive Design: Beautiful UI/UX with Tailwind CSS and shadcn/ui components
- Real-time Updates: Live game state updates and transaction feedback
Play the Game - Deployed on Vercel
- Solidity - Smart contract development
- Foundry - Development framework and testing
- Next.js 14 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first styling
- shadcn/ui - Modern UI components
- Ethers.js - Ethereum blockchain interaction
0x4nud33p-dice-prediction-game-web3/
├── contracts/ # Smart contract development
│ ├── src/ # Contract source code
│ │ └── DiceGame.sol # Main game contract
│ ├── script/ # Deployment scripts
│ ├── test/ # Contract tests
│ └── foundry.toml # Foundry configuration
└── frontend/ # Next.js frontend application
├── app/ # Next.js 14 app directory
├── components/ # React components
│ ├── ui/ # shadcn/ui components
│ └── providers/ # Context providers
├── contract/ # Contract interaction logic
├── hooks/ # Custom React hooks
└── lib/ # Utility functions
- Node.js 18+ and npm/yarn
- Git
- Foundry (for smart contract development)
git clone https://github.com/0x4nud33p/dice-prediction-game-web3.git
cd dice-prediction-game-web3
cd contracts
forge install
forge build
forge test
cd frontend
npm install
npm run dev
The application will be available at http://localhost:3000
- Connect Wallet: Connect your Ethereum wallet (MetaMask, WalletConnect, etc.)
- Make Prediction: Choose your predicted dice outcome
- Place Bet: Set your wager amount in ETH
- Roll Dice: Execute the transaction and wait for the result
- Collect Rewards: Winners receive their rewards automatically
The DiceGame contract implements:
- Provably fair randomness for dice rolls
- Secure bet placement and reward distribution
- Gas-optimized operations
- Event emissions for frontend integration
cd contracts
forge script script/DiceGame.s.sol --rpc-url $SEPOLIA_RPC_URL --private-key $PRIVATE_KEY --broadcast
The frontend is deployed on Vercel and automatically updates with main branch changes.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
IMPORTANT NOTICE: The smart contracts in this project have NOT been audited for production use. This is a demonstration/educational project and should not be used with real funds on mainnet without proper security audits. Use at your own risk.
- Contracts are deployed on testnets for demonstration purposes
- No guarantee of fund security or contract behavior
- Thoroughly test on testnets before any mainnet deployment
- Consider professional smart contract auditing before production use
- Live Demo: dicegameeth-six.vercel.com
- GitHub Repository: https://github.com/0x4nud33p/dice-prediction-game-web3
- Developer: @0x4nud33p
For questions, suggestions, or collaboration opportunities, feel free to reach out:
- GitHub: @0x4nud33p
- Project Issues: GitHub Issues
⭐ If you found this project helpful or interesting, please consider giving it a star!
Happy Gaming! 🎲