This repository contains the smart contract code and front-end application for a decentralized lottery application built on Ethereum. Participants can enter the lottery by paying an entry fee, and a winner is randomly selected to receive the prize amount when the lottery ends.
contracts/
: Solidity smart contracts for the lottery system.Lottery.sol
: Main contract for the lottery logic.
artifacts/
: Contains build artifacts and contract ABIs generated by Hardhat.lottery-dapp/
: Front-end application for interacting with the lottery contract.src/
: Source code for the React application.public/
: Public assets like icons and manifest files.
scripts/
: Deployment scripts for deploying the contracts to a network.test/
: Contains tests for the smart contracts.typechain-types/
: TypeScript typings for the smart contracts, generated by TypeChain.
- Smart Contract Interaction: Users can participate in the lottery, view current participants, and see the winner once the lottery ends.
- Metamask Integration: The front-end application integrates with Metamask for Ethereum transactions.
- Localization Support: The application supports multiple languages, enhancing accessibility for a wider audience.
- Clone the repository:
git clone <repository-url>
- Change to the project directory:
cd lottery-dapp
yarn install
3.Compile the smart contracts:
npx hardhat compile
- Deploy the contracts to a network (e.g., testnet):
npx hardhat run scripts/deploy.ts --network <network-name>
- Start the front-end application:
yarn start
- Testing To run the tests for the smart contracts, use:
npx hardhat test