Skip to content

kryan19k/FoMoXD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧁 FoMoXD - Blockchain Dapp

A Lottery Ponzi Game

Rules

  • Winner is the last person to purchase Puffs — a lottery ticket — using ETH before the countdown timer runs down to zero.
  • During games every player has chance to get ETH, NFT airdrops

Feature

  • Integrated Profit-sharing token, NFTs, DAO, Multi-sig wallet
  • Utilizes the hardhat framework for development and testing
  • As supply for Pufss increases, the price will rise

Steps for E2E test

  • Run the hardhat node
npx hardhat node
  • Add the test network and account to Metamak

    • Import hardhat test private key
    • Import hardhat network
  • Deploy contracts with Hardhat

npm run deploy
  • Update Contract Address in config file
vi webapp/.env
# Add the address
REACT_APP_FOMO_CONTRACT_ADDRESS=YOUR_FOMO_CONTRACT_ADDRESS
REACT_APP_FOMOERC721_CONTRACT_ADDRESS=YOUR_FOMO_NFT_CONTRACT_ADDRESS
  • Run the web server with docker
docker build -t fomoxd . --no-cache
docker run -p 3000:3000 fomoxd

Steps for Integration Test

cd chain
npm i 
npx hardhat node
npm run test

Game Flow

stateDiagram
    direction LR
    [*] --> Have_Time: Purchase puffs 🧁
    state Have_Time {
      Player_ --> NFT_Winner: Airdrop NFT reward 🖼️
      Player_ --> ETH_Winner: Airdrop ETH reward 🪙
      Player_ --> Affiliate_Winner: Get affiliate reward 👥
    }
    Have_Time --> ⏱️Add_Time
Loading
stateDiagram
      direction LR
    [*] --> No_Time: Time's Up ⏱️
    state No_Time{
      Player_  --> GeneralPotWinner: Team share 🧑‍🤝‍🧑
      Player_  --> PickWinner: Final pot winner 💰
      Player_  --> NFTWinner: Reveal mystery NFTS 🖼️
    }
    No_Time --> 🏁New_Round
Loading

Smart Contract Modules

    stateDiagram-v2
      FOMOXD --> PlayerBook
      note left of FOMOXD
          對接使用者
        end note
        note right of PlayerBook
          Leaderboard
        end note
      FOMOXD --> FOMOERC721
        note right of FOMOERC721
          Airdrop NFT
        end note
      FOMOXD --> PXD
        note right of PXD
          Profit-sharing token
        end note
      FOMOXD --> Comminuty
        note right of Comminuty
          DAO/multi-sig wallet
        end note
      FOMOXD --> Devide
        note right of Devide
          profit-sharing tokens
        end note
      FOMOXD --> Oracle
        note right of Oracle
          random number genarator
        end note
Loading
  1. Player Book: A ledger of all games' leaderboard of recommended players.
  2. FoMoERC721: Airdrop NFT mystery box during each round and reveal NFTs of the round at the end of the round.
  3. PXD: A profit-sharing tokens that allows holders to share in the profits generated by the underlying games.
  4. Comminuty: A decentralized governance system that uses a multi-sig wallet which decisions are made and actions are taken based on the consensus of multiple parties.
  5. Devide: Responsible for calculating and distributing profits to the holders of the tokens
  6. Oracle: Obtaining a random number from an Oracle. Once the random number has been generated, the game then use it to determine whether or not a player is a airdrop winner.

Profit-sharing System

Internal

User Vault

  • Team Vault
  • Affiliate Vault
  • Winning Vault
flowchart LR
    1[User Vault] --o 2[Winnings vault]
    1 --o 3[General vault]
    1 --o 4[Affiliate vault]
    
Loading

External

  • PXD
  • Community

Todo

[ ] Decentralize Governance system

[ ] Profit-sharing Token

Credits

NFT Images

Music Credit