A modern, blockchain-based lottery application built with Next.js and the Xian blockchain.
- Buy Tickets: Users can purchase lottery tickets using XIAN tokens
- Real-time Pool: See live lottery pool amounts and ticket counts
- Winner Drawing: Admin can draw winners with deterministic randomness
- User-friendly Interface: Clean, modern UI with Bulma CSS framework
- Wallet Integration: Seamless integration with Xian wallet extension
- Ticket History: View your ticket history and winnings
- Frontend: Next.js 14, React 18
- Styling: Bulma CSS Framework
- State Management: Zustand
- Blockchain: Xian Network
- Wallet: Xian Wallet Extension
- Node.js 18+
- Xian Wallet Extension installed in your browser
- Access to Xian testnet
-
Install Dependencies
npm install
-
Run Development Server
npm run dev
-
Open Browser Navigate to
http://localhost:3001 -
Connect Wallet
- Install the Xian Wallet Extension
- Connect your wallet to the dapp
- Ensure you have some test tokens
- Connect your Xian wallet
- Click "Buy Ticket" button
- Confirm transaction in your wallet
- See your ticket count update in real-time
- Start Lottery: Begin a new lottery round
- Draw Winner: Select a winner using deterministic randomness
- Set Parameters: Adjust ticket price, fee percentage, and limits
- Real-time pool amounts and ticket counts
- Winner announcements with prize breakdowns
- Your ticket history and winnings
The dapp integrates with Xian smart contracts for:
buy_ticket: Purchase lottery ticketsstart_lottery: Begin new lottery roundsdraw: Select winners with deterministic randomnessset_ticket_price: Adjust ticket pricingset_fee_percent: Configure fee percentagesset_max_tickets_per_user: Set purchase limits
- Lottery Dashboard: Main lottery interface with stats and actions
- Admin Panel: Parameter management and lottery control
- Ticket History: View your past tickets and winnings
- Real-time Stats: Live pool amounts and ticket counts
- Blockchain Verification: All transactions recorded on-chain
- Deterministic Randomness: Fair winner selection using block data
- Transparent Results: All data publicly verifiable
- Wallet Authentication: Secure user identification
- Multiple lottery types
- Time-locked lotteries
- Token-weighted lotteries
- Mobile app
- Advanced analytics
- Multi-language support
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is licensed under the MIT License.
For support, please open an issue in the GitHub repository or contact the development team.