Giter Club home page Giter Club logo

meetup-token-mvp's Introduction

Meetup

Meetup Queueing System on a Blockchain

A queueing system on the blockchain for meetups


Table of Contents

About

Solidity to do list

  • Admin rights, create a meetup event
  • Create a user
  • Register a user to a meetup event if there is capacity
  • Join the waiting list if there is no capacity
  • Check in at the gate before the start of the meetup event - check if the user can attend
  • Remove a user
  • Remove a a meetup event
  • Allow people on the waiting list to bid for open spots from cancellations
  • Cancel from the registered list
  • Add and remove food options, vote for food, find winning food option

Purpose

This is an MVP of the meetup-queue repo.

Background

BokkyPooBahs-Ethereum-Workshop has become so popular that the available spots often get fully booked out within a few minutes. Since the meetup is about blockchain, why not solving this problem using blockchain?

UI design

  • /: list of meetups
  • /meetups/new: form to create a new meetup
  • /meetups/0x1234: meetup details for meetup at address 0x1234
  • /meetups/0x1234/events: event details for meetup at address 0x1234
  • /meetups/0x1234/events/new: form to create a new event for meetup at address 0x1234

Reasons for using the Ropsten network

  • No transaction cost (ETH can be obtained for free)
  • Low latency if putting a high enough gas price (low latency is important for event entrance and time dependent late cancellations)

Token distribution

  • 100,000,000 total supply
  • 50% issued to new users
  • 30% community reward pool
  • 10% venture capital investors
  • 10% development team incentive

For the 50% issued to new users, reward early adopters using these multipliers

  • User 1 - 100: 10
  • User 101 - 1,000: 8
  • User 1,001 - 10,000: 5
  • User 10,001 - 100,000: 3
  • User 100,001 - 1,000,000: 2
  • User 1,000,001 -10,000,000: 1

Assuming there are 10m verified unique users 10100 + 8900 + 59000 + 390000+2900000 + 19000000 = 11,123,200 units Total tokens for new users: 50%1000000 = 50000000 50000000 / 11123200 = 4.4951 tokens per unit Round down to 4 tokens per unit (so keeping 10% as reserve) So for user 1 - 100, each is issued 410 = 40 tokens For user 101-1000, each is issued 4*8 = 32 tokens etc.

Verification

Initial registration

We need to move the meetup account database or a form of identity based on it onto the blockchain.

Steps

  • Create a master list of meetup account ID's based on the meetup website
  • Users need to set up a new Ethereum account and get free Ropsten ETH (details to be followed)
  • Users go to the website and register using their meetup account name
  • Users can also deregister them selves in case of mistakes
  • Contract owners can deregister users (e.g. when someone accidentally registers another user's account)

Register for individual meetup events

Accounts are checked against the masterlist

Verification at the door

  • There'll be a smart phone app that users can store their Ethereum public address and present it as QR codes
  • Before each meetup, the organisers will need to use an app to scan users QR codes
  • Only registered people are allowed to enter

Point incentives

Earn tokens (non-event)

  • Every unique account starts with 100 tokens
  • Work on group projects (discretionary, awarded by the meetup owners, maximum 1000 tokens per month)
  • Telegram contribution (sharing resources etc.) (discretionary, awarded by the meetup owners, maximum 1000 tokens per month)

Earn tokens (per event)

  • Organise/assist: +30
  • Presenter: +100
  • Show up: +10

How to lose tokens

  • To participate in events, need to put in a deposit of 50 tokens
  • no show, no cancellation (or cancellation after event start time): -50
  • late penalty:
    • more than 24 hours before the event: 0
    • 12 - 24 hours before the event: -2
    • 6 – 12 hours: -5
    • 3 – 6 hours: -10
    • 0 - 3 hours: -15

Initial Queueing system

  • Based on order of registration
  • If everyone who initially register comes to the event there'll be no auction

Auction system (replacing the waiting list)

  • Spots freed up in the last 24 hours are available for auctions
  • Auction the spots with your tokens
  • Auction starts as spots open up
  • Auction ends 1 hour before the meetup

Replace points with ERC20 tokens

  • Might make it easier to transfer tokens, borrow/lend tokens etc.

ERC721

  • Issue ERC721 tokens for each meetup event and each spot
  • Receive these tokens when entering the venue
  • Use ERC721 to deomstrate skill level
  • Later on: set up blockchain questions, answer them by submitting a transaction, if the answer is correct, receive an ERC721 token

Voting

Vote for

  • Food choice
  • Projects to reward tokens to
  • Proposals

Smart contract design

Contract 1 - meetup base, inherits access control

Variables

  • Meetup owner – multip owners, allow transfers
  • Meetup acconts - Array of addresses, mapped to meetup names
  • Array of meetup events (contract addresses)

Meetup event (struct)

  • Organiser
  • Assistants
  • Presnenters
  • Date and time
  • Maximum capacity
  • Late cancellation period

Boilderplate

http://truffleframework.com/boxes/react-uport

Setup Instructions

Prerequisites

  • Install Node.js 9.x.x with NVM

Development - Installation and Building

Alternative 1

  • Install Truffle, Ganache CLI ethereum client for local development, and Yarn
npm install -g truffle ganache-cli;
brew install yarn
  • Change into the project directory
cd react-uport/
  • Install the node dependencies.
yarn install
  • Run Ganache CLI.
ganache-cli \
  --port="7545" \
  --mnemonic "obey flight jump bean salt female logic inside sugar case venture media" \
  --verbose \
  --networkId=1000 \
  --gasLimit=7984452 \
  --gasPrice=2000000000;
  • Compile and migrate the contracts.
truffle compile;
truffle migrate --network development
  • Run Webpack server for front-end hot reloading
    • Note: Smart contract changes must be manually recompiled and migrated.
yarn start
  • Debug (use Truffle Console after starting Ganache CLI in a separate tab)
truffle console
truffle(development)> for (var i in web3.eth.accounts) { console.log(web3.eth.getBalance(web3.eth.accounts[i])) }

Alternative 2

Go to ganache github and install v1.1.0-beta.1 - Candy Apple

Note: the latest stable release crashes frequently and does not give consistent results

Testing

React Components

  • Jest used to test React components using Truffle
truffle compile;
truffle migrate --network development;
yarn test

Smart Contracts

Truffle used to test Smart Contracts

truffle compile;
truffle migrate --network development;
truffle test

🚀 Front End

1. Clone and Install

*It's recommended that you install React Native Debugger.

# Install dependencies
npm i

2.1. Run the React Native App

# Start the React Native packager
npm start

Instructions are shown in the terminal. You can select to open it in:

  • An emulator (either iOS or Android)
  • Your mobile device with the Expo app. It will reload if you save edits to your files and you will see build errors and logs in the terminal.

2.2. Run the Web App

# Starts are local live-reload server at:
# http://localhost:3001
npm run web-start

Via webpack, starts a localhost server on port 3001 http://localhost:3001.

meetup-token-mvp's People

Contributors

zemingyu avatar rickwxc avatar ltfschoen avatar jonathanfu avatar wizardofaus avatar

Watchers

 avatar James Cloos avatar  avatar

meetup-token-mvp's Issues

Can't create users in bash script

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.