Lucky Six is a Solidity-based game that features the random selection of 35 numbers from the range of 1 to 48 in each round. The lottery operates automatically, initiating a countdown upon the first ticket played in a round, allowing participation during this period. After the countdown, a request for a random salt is generated, from which random numbers are drawn. The system then initiates a new round, continuing this cycle indefinitely. For more details about the implementation of lottery logic in smart contracts, refer to this link.
- Web interface built using React.js.
- UI design implemented with Material UI.
- Supports multiple networks, dynamically adjusting to the lottery on the selected network.
- Integrates with wagmi and viem interfaces for seamless interaction with the chosen network.
- Hosted on AWS S3 bucket, with automatic builds triggered via GitHub Actions upon deploying to the master branch.
Playing the lottery is straightforward - users only need a browser with a wallet extension installed. The application connects to the InjectedConnector
, supporting wallets that inject an Ethereum Provider, such as the MetaMask browser extension.
The lottery system features two distinct pools: one for collecting owner fees and another for the prize pool, ensuring that the owner cannot 'rug pull'. Check the smart contract code for a more in-depth understanding. After the numbers are drawn, users can easily withdraw their earnings by clicking the 'Redeem' button, triggering a browser notification. The process only requires the user to sign a transaction, and the funds are sent directly to their wallet address, as demonstrated in the gif below.
Sepolia: 0x4153a9Ea482a8cCb1737662FF840def7E087A6c8
Mumbai: 0x86E074017b01541fcb8CB548Cbd61d9fF9D23a9a
Install all the dependencies listed within package.json.
npm install --legacy-peer-deps
Then run with:
npm start
This project is licensed under the Apache License, Version 2.0.