Skip to content

SupaMega24/smart-contract-lottery

Repository files navigation

Random Raffle Lottery Contracts

About

This code will create a smart contract that yeilds a random lottery

  1. Users can enter by purchasing a ticket
    1. Ticket fees will go to the winner of the draw
  2. After a period of time, the lottery will automatically draw a winner programatically.
  3. We will be using:
    1. Chainlink VRF for randomness
    2. Chainlink Automation for timed based trigger

Tests!

  1. Write deploy scripts
  2. Write tests
    1. work on local chain
    2. forked testnet
    3. forket mainnet

Foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.

Foundry consists of:

  • Forge: Ethereum testing framework (like Truffle, Hardhat and DappTools).
  • Cast: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
  • Anvil: Local Ethereum node, akin to Ganache, Hardhat Network.
  • Chisel: Fast, utilitarian, and verbose solidity REPL.

Documentation

https://book.getfoundry.sh/

Usage

Build

$ forge build

Test

$ forge test

Format

$ forge fmt

Gas Snapshots

$ forge snapshot

Anvil

$ anvil

Deploy

$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>

Cast

$ cast <subcommand>

Help

$ forge --help
$ anvil --help
$ cast --help

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published