Welcome to the Decentralized Lottery App! This project aims to create a transparent, secure, fair lottery system using blockchain technology. By leveraging smart contracts, we ensure the lottery is tamper-proof and the results are verifiable.
- Introduction
- Features
- Installation
- Usage
- Smart Contract Details
- Technologies Used
- Contributing
- License
- Contact
The Decentralized Lottery App is built on the Ethereum blockchain. It utilizes smart contracts to manage the lottery process, ensuring fairness and transparency. Participants can buy tickets, and a winner is selected randomly through the smart contract.
- Decentralized: Operates on the Ethereum blockchain, removing the need for a central authority.
- Transparent: All transactions and processes are recorded on the blockchain, ensuring transparency.
- Secure: Utilizes smart contracts to manage the lottery, making it tamper-proof.
- Fair: The smart contract handles Random winner selection, ensuring fairness.
To run this project locally, follow these steps:
- Clone the repository:
git clone https://github.com/Jagadeeshftw/Decentralized_Lottery_App.git
cd Decentralized_Lottery_App
- Install dependencies:
npm install
- Set Infura API key:
npx hardhat vars set INFURA_API_KEY
- Set Sepolia private key:
npx hardhat vars set SEPOLIA_PRIVATE_KEY
- Compile the smart contracts:
npx hardhat compile
- Test the smart contracts:
npx hardhat test
- Start a local node & deploy the Hardhat Ignition module in the sepolia network:
npx hardhat node
npx hardhat ignition deploy ./ignition/modules/lottery.ts --network sepolia
- Run the application:
npm run dev
- Buy Tickets: Participants can buy lottery tickets by sending Ether to the smart contract.
- Draw Lottery: The smart contract will randomly select a winner from the participants.
- Claim Winnings: The winner can claim their winnings by interacting with the smart contract.
The smart contract is written in Solidity and deployed on the Ethereum network. It manages the following functions:
- `buyTicket`: Allows users to buy a lottery ticket.
- `drawLottery`: Selects a random winner from the participants.
- `claimWinnings`: The winner can claim their prize.
- Solidity: For writing smart contracts.
- Hardhat & Truffle: Development framework for Ethereum.
- Nextjs: For building the front-end application.
- Web3.js & Ethers.js: For interacting with the Ethereum blockchain.
We welcome contributions to this project. If you would like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch (`git checkout -b feature/your-feature`).
- Commit your changes (`git commit -m 'Add some feature'`).
- Push to the branch (`git push origin feature/your-feature`).
- Open a pull request.
This project is licensed under the MIT License. Please have a look at the LICENSE file for details.
For any questions or feedback, please reach out to:
- Jagadeesh - Jagadeeshftw