Skip to content

0xNilesh/Sunk-Cost-Game-Vite

Repository files navigation

GitHub contributors GitHub issues GitHub forks GitHub stars GitHub license


Sunk Cost Game

Vite Hackathon · View Demo · Request Feature

Table of Contents
  1. About The Project
  2. Structure
  3. Installation

About The Project

Sunk Cost Game is a fun DAPP similar to Fomo3D for rewarding lucky Vite users.

It's a Work In Progress.

Built With

  • Solidity++
  • ViteJS
  • Mocha
  • Chai
  • React

Structure

Contract Details

At the time of contract deployment the owner/creator sets a PotCreation Fee (Amount to be given to create a Pot). This fee can be seen as the protocol incentives.

The contract consists of mainly 3 restricted owner functions

  • setOwner - To change the owner of contract
  • setFee - To change the Pot Creation Fee
  • claimFee - To claim the protocol fee
  • Game Details

    The game mainly consists of 3 functions

  • createPot -To create a pot by any user by spending the Pot Creation Fee
  • buyPot - To buy the pot by spending the current buy in ammount of Pot
  • claimReward - To claim the reward of a Pot by the winner
  • Pot Structure
    struct Pot {
          address PotOwner; //Pot Creator address
          uint256 maxTimerLimit; // max limit by which players can extend the expiration time of Pot by buying in the pot
          uint256 buyInIncrementAmount; //Increment Amount of pot value at each buy in
          uint256 burnAmount; //amount of token burned at each buy in
          uint256 extensionAmount; //Time period extension at each buy in
          address winner; //current winner or buyer of Pot
          uint256 potAmount; //Current Pot Reward
          uint256 currentPrice; //Current Amount required to buy the pot
          vitetoken tokenId; //Token Used for buying the pot
          uint256 start; //start timestamp og Pot
          uint256 end; //end or expiration timestamp of pot
          bool claimed; //claimed status of pot which tells if its reward has been claimed by winner or not
        }
    

    Installation

    Clone the repo

    git clone https://github.com/nilesh46/Sunk-Cost-Game-Vite.git
    Testing Contracts
    npm install
    npm test
    Running Frontend
    cd frontend
    npm install
    npm start

    About

    Sunk Cost Game is a fun DAPP similar to Fomo3D for rewarding lucky Vite users. URL: https://nilesh46.github.io/Sunk-Cost-Game-Vite/

    Resources

    License

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages