Skip to content

AsyaMaior/foundry-lottery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Raffle smart contract is a lottery that can be participated in by calling the enterRaffle() function and making a contribution in the amount of i_entranceFee. After some i_interval, ChainLink Automation will start the process of selecting a winner. The winner will be selected using ChainLink VRF.

Requirements

Work with project

  1. Clone git repo and build project
    git clone https://github.com/AsyaMaior/foundry-lottery
    cd foundry-fund-me-f23
    forge build
  1. Install the dependencies
    make install
  1. To deploy and interact with the contract, create your .env file; an example is provided in the repository. Than utilize a Makefile .
    #to deploy on anvil
    make deploy

    #to deploy on sepolia
    make deploy ARGS="--network sepolia"

Deploy script automatically creates and configures a VRF subscription. Chainlink Automation subscriptions must be set up independently via the website. You must have some LINK token on the owner address.

  1. To run tests use the following command:
    forge test

To run tests using a forked mainnet network, use the following command:

    make fork-test

Realization on sepolia

Smart contract Raffle: https://sepolia.etherscan.io/address/0x82511ca875ecdf4c9da3da91b2b27aafa712e1ff

ChainLink VRF Subscription: https://vrf.chain.link/sepolia/11713

My subscription to ChainLink VRF: https://vrf.chain.link/sepolia/11713


This project was created and finalized while completing a course on Cyfrin Updraft