GithubHelp home page GithubHelp logo

e-zbox / first-flight-puppy-raffle Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 669 KB

Cyfrin Updraft Smart Contract Auditing Course for 2023-10-Puppy-Raffle. Refer to findings.md file for my comprehensive audit

Makefile 3.12% Solidity 96.88%

first-flight-puppy-raffle's Introduction

puppy-raffle

Contest Details

Prize Pool

  • High - 100xp

  • Medium - 20xp

  • Low - 2xp

  • Starts: Noon UTC Wednesday, Oct 25 2023

  • Ends: Noon UTC Wednesday, Nov 01 2023

Stats

  • nSLOC: 143
  • Complexity Score: 111

Puppy Raffle

This project is to enter a raffle to win a cute dog NFT. The protocol should do the following:

  1. Call the enterRaffle function with the following parameters:
    1. address[] participants: A list of addresses that enter. You can use this to enter yourself multiple times, or yourself and a group of your friends.
  2. Duplicate addresses are not allowed
  3. Users are allowed to get a refund of their ticket & value if they call the refund function
  4. Every X seconds, the raffle will be able to draw a winner and be minted a random puppy
  5. The owner of the protocol will set a feeAddress to take a cut of the value, and the rest of the funds will be sent to the winner of the puppy.

Getting Started

Requirements

  • git
    • You'll know you did it right if you can run git --version and you see a response like git version x.x.x
  • foundry
    • You'll know you did it right if you can run forge --version and you see a response like forge 0.2.0 (816e00b 2023-03-16T00:05:26.396218Z)

Quickstart

git clone https://github.com/Cyfrin/2023-10-Puppy-Raffle
cd 2023-10-Puppy-Raffle
make

Optional Gitpod

If you can't or don't want to run and install locally, you can work with this repo in Gitpod. If you do this, you can skip the clone this repo part.

Open in Gitpod

Usage

Testing

forge test

Test Coverage

forge coverage

and for coverage based testing:

forge coverage --report debug

Audit Scope Details

  • Commit Hash: 22bbbb2c47f3f2b78c1b134590baf41383fd354f
  • In Scope:
./src/
└── PuppyRaffle.sol

Compatibilities

  • Solc Version: 0.7.6
  • Chain(s) to deploy contract to: Ethereum

Roles

Owner - Deployer of the protocol, has the power to change the wallet address to which fees are sent through the changeFeeAddress function. Player - Participant of the raffle, has the power to enter the raffle with the enterRaffle function and refund value through refund function.

Known Issues

None

first-flight-puppy-raffle's People

Contributors

equious avatar e-zbox avatar patrickalphac avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.