Skip to content

smart contract lottery, using chainlink VRF and built in solidity

Notifications You must be signed in to change notification settings

ABFX15/Smart-Lottery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart Lottery Contract

A decentralized and verifiably random lottery system built with Solidity and Chainlink VRF.

Overview

SmartLottery is a decentralized lottery system that allows users to:

  • Create and participate in multiple concurrent lottery instances
  • Enter lotteries by purchasing tickets
  • Have winners selected automatically and fairly using Chainlink's Verifiable Random Function (VRF)
  • Operate lotteries with customizable parameters like ticket price and expiration time

Key Features

  • Multiple Concurrent Lotteries: Support for running multiple lottery instances simultaneously
  • Verifiable Randomness: Uses Chainlink VRF for provably fair winner selection
  • Customizable Parameters: Configurable ticket prices and expiration times
  • Role-Based Access: Lottery operators have special privileges for managing their lotteries
  • Automated Winner Selection: Winners are selected and paid out automatically
  • Gas Efficient: Optimized for minimal gas consumption

Contract Architecture

The system consists of the following main components:

  • SmartLottery.sol: The main contract handling lottery logic
  • HelperConfig.sol: Configuration helper for different networks
  • DeployLottery.s.sol: Deployment script

Technical Details

Key Dependencies

  • Solidity ^0.8.20
  • Chainlink VRF V2 Plus
  • Foundry for development and testing

Network Configurations

  • Supports Sepolia testnet and local development
  • Configurable VRF parameters per network

Development

Prerequisites

  • Foundry
  • Chainlink VRF Subscription (for live networks)

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/smart-lottery
    cd smart-lottery
  2. Install dependencies:

    forge install
  3. Build the project:

    forge build
  4. Run tests:

    forge test

About

smart contract lottery, using chainlink VRF and built in solidity

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published