The Decentralized Lottery System is a blockchain-based application developed using the Move language for smart contracts and the Aptos module for randomness and yield generation. It allows participants to engage in a risk-free lottery while ensuring transparency and security through blockchain technology.
- 100% Return to Player (RTP): Participants receive their principal amount back.
- Yield Generation: Lottery funds are invested in yield farming protocols.
- Actively Validated Service (AVS): Ensures funds are managed according to lottery rules.
- Randomness: Uses the Aptos randomness module for fair lottery drawings.
- Frontend Interface: Web interface built with Next.js for seamless user interaction.
The core logic of the lottery system is implemented in Move language:
- Lottery Contract: Manages ticket purchases, prize distributions, and yield investments.
- Randomness Module: Implements random number generation using the Aptos module.
The frontend provides a user-friendly interface to interact with the lottery system:
- Components: Header, Footer, and Lottery display components.
- Pages: Index, About, and dynamic lottery details pages.
- Styling: Global styles and component-specific CSS Modules.
- API Integration: Fetches lottery data from the blockchain using REST API.
Clone the repository:
git clone https://github.com/arhansuba/lottery-project.git
cd lottery-projectInstall dependencies:
cd frontend
npm installcd ../backend
npm installConfigure environment variables:
Create a .env file in the frontend directory and set necessary variables.
NEXT_PUBLIC_API_URL=https://your-api-url
Build the frontend:
npm run buildStart the development server:
npm run devAccess the application: Open your browser and navigate to http://localhost:3000.
To run tests for Move contracts and frontend components, execute the following:
./scripts/test.shcd frontend
npm testDeploy your application using your preferred hosting platform. Ensure to set up environment variables and configure your deployment pipeline accordingly.
Contributions are welcome! Fork the repository and submit a pull request with your enhancements.
This project is licensed under the MIT License.