/web3-lottery

blockchain lottery platform

Primary LanguageTypeScript

Build

Crypto Lottery System - WEB3

this repo is a managment system for any form of lottery games that involves the drawing of numbers at random for a prize and handing out tickets.

the mechanism design based on token economics and insures that no prospective owner-occupant has an unfair advantage in the determination of winner.

Note: This DApp is for interview purposes only. altho it's fully functional, however, used coin has no value.

Built With

BackEnd

Express.js Solidity Ethereum TypeScript Heroku Hyperledger

FrontEnd

Next JS TailwindCSS React JavaScript Figma Netlify Vercel

Demo

Here is a working live demo: Web3-lottery-v1

Login with your Crypto Wallet

Screenshot

Have a look for Deployed backend SmartContract (API) here: BackEnd API

Screenshot 2022-09-07 at 17 07 39

Getting Started

This is how you may set up your project locally. To get a local copy up and running follow these simple steps.

Prerequisites

MetaMask account - cryptocurrency wallet 
MetaMask only supports Chrome, Firefox, Edge, and Brave browsers and is not available on Safari

Installation

  1. Get a free API Key at thirdweb.com
  2. Clone this repo
    git clone https://github.com/omarsa999/web3-lottery.git
    
  3. Install NPM packages
    cd web3-lottery
    npm install
  4. Deploy the Backend on ThirdWeb using Thirdweb's SDK deploy feature, a Powerful SDK to integrate decentralized and Web3 technologies into the backend Read More
    git clone github.com/omarsa999/lottery-smart-contract.git
  5. Enter your API in config.js
    const API_KEY = 'ENTER YOUR API';
    

Usage

wrap your app with thiredweb Provider to establish a connection

Features

Write to BlockChain:

  • BuyTickets
  • DrawWinnerTicket
  • RefundAll
  • WithdrawCommission
  • WithdrawWinnings
  • restartDraw

Read from BlockChain

  • CurrentWinningReward
  • IsWinner
  • RemainingTickets
  • checkWinningsAmount
  • duration
  • expiration
  • getTickets
  • getWinningsForAddress
  • lastWinner
  • operatorTotalCommission
  • and more ..

Contact

[@OmarSa] - hello@omarsa.tech omarsa.tech

This repository was extended from its original smart contract repo: https://github.com/drord9/Lottery

Research inspiration

Web3 Meets Behavioral Economics