https://github.com/roswelly/dice-roller-smart-contract
** 🎲 A simple and fun on-chain dice rolling smart contract built on Solana using the Anchor framework. Perfect for blockchain game development, DApps, and learning Solana smart contracts in Rust.
https://github.com/roswelly/dice-roller-smart-contract
anchor dice-game gambling lottery randomness smart-contract
Last synced: 9 months ago
JSON representation
** 🎲 A simple and fun on-chain dice rolling smart contract built on Solana using the Anchor framework. Perfect for blockchain game development, DApps, and learning Solana smart contracts in Rust.
- Host: GitHub
- URL: https://github.com/roswelly/dice-roller-smart-contract
- Owner: roswelly
- Created: 2025-04-06T05:52:35.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-06T06:11:46.000Z (about 1 year ago)
- Last Synced: 2025-08-12T23:40:14.804Z (11 months ago)
- Topics: anchor, dice-game, gambling, lottery, randomness, smart-contract
- Language: Rust
- Homepage:
- Size: 120 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🎲 Solana Dice Roll Smart Contract (Anchor Framework)
A simple, fun, and fully on-chain **Dice Rolling Game built on Solana** using the **Anchor framework**. This smart contract allows users to roll a dice and win rewards based on random outcomes — all deployed on the fast and low-cost Solana blockchain.
---
## 🚀 Features
- **Fair Dice Roll Logic** using pseudo-randomness
- **Solana Native Token Integration** (SOL / SPL)
- Built with the **Anchor Framework**
- Secure on-chain logic for provable outcomes
- Ready for frontend integration (React / Next.js)
- Includes unit tests and localnet setup
---
## Tech Stack
- **Solana Blockchain**
- **Rust / Anchor Framework**
- **Solana CLI & Anchor CLI**
- **Mocha for Testing**
- **TypeScript (for tests)**
---
## Installation
```bash
git clone https://github.com/love-luca/dice-roller-smart-contract.git
cd solana-dice-roll
anchor build
anchor test
## How It Works
Players call the roll_dice function.
The contract generates a random number between 1 and 6.
Rewards are distributed if the outcome matches certain conditions (e.g., roll a 6).
## Project Structure
├── programs/
│ └── dice_roll/
│ └── src/lib.rs # Main Solana smart contract
├── tests/
│ └── dice-roll.ts # Anchor tests
├── migrations/
├── Anchor.toml
├── Cargo.toml
└── README.md
## Contact
-Twitter [@defai_maxi](https://x.com/defai_maxi)
-Telegram [@rhettjel](https://t.me/rhettjel)