Skip to content

SoulDev07/Foundry-Lottery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Foundry Lottery 🎰

A decentralized and transparent lottery system built with Solidity and Foundry.

Overview

This project implements a trustless lottery system on the blockchain where:

  • Players can enter by paying a ticket fee
  • A verifiably random winner is selected
  • The winner receives the entire prize pool

Getting Started

Prerequisites

Installation

  1. Clone the repository
git clone https://github.com/SoulDev07/foundry-lottery
cd foundry-lottery
  1. Install dependencies
make install
  1. Build the project
forge build

Usage

Deploy the contract

forge script script/DeployRaffle.s.sol

Testing

Run the full test suite:

forge test

For more verbose output with traces:

forge test -vv  # Logs emitted during tests
forge test -vvv # Stack traces for failures
forge test -vvvv # Full stack traces and setup details

Run specific tests by matching the test name:

forge test --match-test testFunctionName

Generate a test coverage report:

forge coverage
forge coverage --report debug # Generate debug report

Run tests with gas reporting:

forge test --gas-report

About

A decentralized and transparent lottery system built with Solidity and Foundry.

Topics

Resources

License

Stars

Watchers

Forks