Skip to content

Latest commit

 

History

History
91 lines (64 loc) · 1.55 KB

README.md

File metadata and controls

91 lines (64 loc) · 1.55 KB

Raffle

Proveably random Lottery contract. Done following this amazing course from Cyfrin!

What does it do

This contract is a Raffle contract. people can buy tickets and participate to win the raffle.

Tools

It uses Chainlink VRF and Automation.

Patterns

I followed the following code layout:

// Layout of Contract:
// version
// imports
// errors
// interfaces, libraries, contracts
// Type declarations
// State variables
// Events
// Modifiers
// Functions

// Layout of Functions:
// constructor
// receive function (if exists)
// fallback function (if exists)
// external
// public
// internal
// private
// internal & private view & pure functions
// external & public view & pure functions

Using CEI pattern for writing functions!

Done some minimal Unit and integration tests.

How To Run Locally

Install dependencies:

make install

Build project:

make build

Run test locally:

make run-test

Run test on Sepolia:

make test-sepolia

Deploy on Anvil:

# On another terminal run
anvil
# then run
make deploy-anvil

Deploy on Sepolia:

# then run
make deploy-sepolia

Contract

Here is the deployed and verified contract:

0xa612988B15f427b8FFAD62828C1A854Ad57a1d4b