Ether Lotto is a decentralized lottery application built on Ethereum using Foundry for development and testing. It leverages Chainlink VRF for secure randomness and Chainlink Automation for maintaining the lottery state.
This README provides a comprehensive overview of the Ether Lotto project, including installation instructions, usage guidelines, project structure, and information on testing and deployment.
- Overview
- Features
- Prerequisites
- Installation
- Usage
- Project Structure
- Testing
- Deployment
- Scripts
- Configuration
- Contributing
- License
Ether Lotto is a smart contract-based lottery system that allows users to participate in secure, transparent lottery draws on the Ethereum blockchain. It uses Chainlink VRF (Verifiable Random Function) to ensure fair and verifiable randomness in winner selection.
- Decentralized lottery system
- Chainlink VRF integration for secure randomness
- Chainlink Automation for automatic lottery state management
- Configurable entrance fee and lottery interval
- Support for multiple networks (Sepolia, Fuji, and local development)
- Comprehensive test suite
-
Clone the repository:
git clone https://github.com/Patrick-Ehimen/ether-lotto.git cd ether-lotto
-
Install dependencies:
make install
Compile the smart contracts:
make build
Run the test suite:
make test
Deploy the Ether Lotto contract:
make deploy
src/
: Smart contract source filesEtherLotto.sol
: Main lottery contractconstants/
: Constants used across the project
test/
: Test filesunit/
: Unit tests for the EtherLotto contract
script/
: Deployment and interaction scriptslib/
: External libraries and dependencies
The project includes a comprehensive test suite in the test/unit/EtherLotto.t.sol
file. Run the tests using:
make test
The DeployEtherLotto.s.sol
script handles the deployment of the Ether Lotto contract. It uses the HelperConfig
to manage network-specific configurations.
DeployEtherLotto.s.sol
: Deploys the Ether Lotto contractInteractions.s.sol
: Contains scripts for creating subscriptions, adding consumers, and funding subscriptionsHelperConfig.s.sol
: Manages network-specific configurations
The HelperConfig.s.sol
file contains network-specific configurations for different chains (Fuji, Sepolia, and local development). Update this file to add or modify network configurations.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.