A decentralized and transparent lottery system built with Solidity and Foundry.
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
- Clone the repository
git clone https://github.com/SoulDev07/foundry-lottery
cd foundry-lottery- Install dependencies
make install- Build the project
forge buildDeploy the contract
forge script script/DeployRaffle.s.solRun the full test suite:
forge testFor 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 detailsRun specific tests by matching the test name:
forge test --match-test testFunctionNameGenerate a test coverage report:
forge coverage
forge coverage --report debug # Generate debug reportRun tests with gas reporting:
forge test --gas-report