GithubHelp home page GithubHelp logo

e-zbox / first-flight-2024-02-one-shot Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 3.3 MB

First Flight #10: One Shot When opportunity knocks, you gunna answer it? One Shot lets a user mint a rapper NFT, have it gain experience in the streets (staking) and Rap Battle against other NFTs for Cred.

Makefile 0.07% Nix 0.01% Solidity 62.04% Python 0.70% JavaScript 30.85% Ruby 6.09% Shell 0.25%

first-flight-2024-02-one-shot's Introduction

OneShot

Contest Details

Prize Pool

  • High - 100xp

  • Medium - 20xp

  • Low - 2xp

  • Starts: February 22, 2024 Noon UTC

  • Ends: February 29, 2024 Noon UTC

Stats

  • nSLOC: 201
  • Complexity Score: 143

One Shot

Disclaimer

This code was created for Codehawks as the first flight. It is made with bugs and flaws on purpose. Don't use any part of this code without reviewing it and audit it.

Created by equious.eth

About

When opportunity knocks, you gunna answer it? One Shot lets a user mint a rapper NFT, have it gain experience in the streets (staking) and Rap Battle against other NFTs for Cred.

OneShot.sol

The Rapper NFT.

Users mint a rapper that begins with all the flaws and self-doubt we all experience. NFT Mints with the following properties:

  • weakKnees - True
  • heavyArms - True
  • spaghettiSweater - True
  • calmandReady - False
  • battlesWon - 0

The only way to improve these stats is by staking in the Streets.sol:

Streets.sol

Experience on the streets will earn you Cred and remove your rapper's doubts.

  • Staked Rapper NFTs will earn 1 Cred ERC20/day staked up to 4 maximum
  • Each day staked a Rapper will have properties change that will help them in their next Rap Battle

RapBattle.sol

Users can put their Cred on the line to step on stage and battle their Rappers. A base skill of 50 is applied to all rappers in battle, and this is modified by the properties the rapper holds.

  • WeakKnees - False = +5
  • HeavyArms - False = +5
  • SpaghettiSweater - False = +5
  • CalmAndReady - True = +10

Each rapper's skill is then used to weight their likelihood of randomly winning the battle!

  • Winner is given the total of both bets

CredToken.sol

ERC20 token that represents a Rapper's credibility and time on the streets. The primary currency at risk in a rap battle.

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)

Usage

Testing

forge test

Test Coverage

forge coverage

and for coverage based testing:

forge coverage --report debug

Audit Scope Details

  • In Scope:
├── src
│   ├── CredToken.sol
│   ├── OneShot.sol
│   ├── RapBattle.sol
│   ├── Streets.sol

Compatibilities

  • Solc Version: ^0.8.20
  • Chain(s) to deploy contract to:
    • Ethereum
    • Arbitrum

Roles

User - Should be able to mint a rapper, stake and unstake their rapper and go on stage/battle

Known Issues

None

first-flight-2024-02-one-shot's People

Contributors

e-zbox avatar equious 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.