Skip to content

Foundry Smart Contract Lottery F23 is a decentralized Ethereum lottery using Chainlink VRF for randomness and Chainlink Automation for draws. Users buy tickets, and winnings are auto-distributed by smart contracts. Secure, transparent, and fair. πŸš€

Notifications You must be signed in to change notification settings

Steiner-254/foundry-smart-contract-lottery-f23

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Foundry Smart Contract Lottery F23 🎲

GitHub last commit GitHub issues GitHub license

Overview

Welcome to the Foundry Smart Contract Lottery F23! This project is designed to create a provably random, fully automated lottery using smart contracts on the Ethereum blockchain.

Key Features:

  • Provably Random Draw: Utilizing Chainlink's VRF (Verifiable Random Function) to ensure randomness.
  • Automated Draws: The lottery winner is automatically selected after a specified period using Chainlink Automation.
  • Decentralized Tickets: Users can enter the raffle by purchasing a ticket. Ticket fees go into the prize pool.
  • Fair & Secure: Built on top of Ethereum, ensuring transparency and security.

How it Works πŸ› οΈ

  1. Enter the Lottery: Users buy tickets by interacting with the smart contract.
  2. Prize Pool: Ticket fees accumulate, forming the prize for the lottery.
  3. Drawing the Winner: Chainlink VRF generates a random number, and Chainlink Automation triggers the lottery at regular intervals.
  4. Winner Receives Prize: The smart contract automatically sends the entire prize pool to the winner.

Tech Stack βš™οΈ

  • Smart Contracts: Written in Solidity, deployed using Foundry.
  • Randomness: Chainlink VRF for provable randomness.
  • Automation: Chainlink Automation for triggering the draw.
  • Testing: Foundry for unit tests.

Directory Structure πŸ“‚

.
β”œβ”€β”€ .github/workflows     # GitHub actions for CI/CD
β”œβ”€β”€ lib                   # External libraries and dependencies
β”œβ”€β”€ script                # Deployment and interaction scripts
β”œβ”€β”€ src                   # Core smart contracts
β”œβ”€β”€ test                  # Unit and integration tests
β”œβ”€β”€ .gitignore            # Ignored files
β”œβ”€β”€ README.md             # Project overview (this file)
β”œβ”€β”€ foundry.toml          # Foundry configuration
β”œβ”€β”€ remappings.txt        # Library remappings

Local Setup πŸ’»

Clone the repository:

git clone https://github.com/Steiner-254/foundry-smart-contract-lottery-f23.git
cd foundry-smart-contract-lottery-f23

Install Dependencies:

  • Ensure you have Foundry installed. If not, install it using:
curl -L https://foundry.paradigm.xyz | bash
foundryup

Compile the Smart Contracts:

forge build

Run Tests:

forge test

Deploy to a Local Network:

forge script script/Deploy.s.sol

License πŸ“œ

Contributing 🀝

  • Project Developed By: Steinet254
  • Feel free to fork this repo, submit issues, or create pull requests! Contributions are welcome.

Acknowledgments πŸ™Œ

  • Chainlink for providing the VRF and Automation tools.
  • Foundry for making smart contract development and testing easy.
  • Cyfrin Updraft for the learning content aiding to this project development.

Happy Coding! πŸš€

Happy Web3 Revolution <3

About

Foundry Smart Contract Lottery F23 is a decentralized Ethereum lottery using Chainlink VRF for randomness and Chainlink Automation for draws. Users buy tickets, and winnings are auto-distributed by smart contracts. Secure, transparent, and fair. πŸš€

Resources

Stars

Watchers

Forks

Packages

No packages published