GithubHelp home page GithubHelp logo

kuaiph / ethereum-dapp-voting-dpolls Goto Github PK

View Code? Open in Web Editor NEW

This project forked from junzhli/ethereum-dapp-voting-dpolls

0.0 1.0 0.0 531 KB

dPolls - A decentralized voting system on top of Ethereum

Home Page: https://dpolls.netlify.com

License: MIT License

JavaScript 34.64% HTML 0.44% TypeScript 62.13% CSS 2.79%

ethereum-dapp-voting-dpolls's Introduction

dPolls - Decentralized voting system

Netlify Status

A decentralized voting system proposed in NTU DApp course - https://dpolls.netlify.com

Feature

  • Decentralized voting system on top of Ethereum
    • Anyone can host their own polls
    • Anyone can vote for polls
    • Adding up to 256 options for a poll
    • Poll closed on a specific block number
    • Anyone can view results anytime
  • Be a host by applying for a membership
  • Membership Plan
    • 1 ETH for CITIZEN
      • A max number of 10 times creating a poll
    • 10 ETH for DIAMOND
      • Unlimited
  • Contract administration (smart contract only)
    • Set admin
    • Withdraw funds from smart contract
    • Reclaim ownership of registries in case of new core contract replacement

Table of Contents

Smart Contracts

Prerequisites

  • Truffle - blockchain development framework
  • Ganache - private blockchain network

Components

  • VotingCore - Core functionality
  • VotingHostRegistry - Maintain a list of registered hosts and memberships
  • VotingRegistry - Maintain a list of active/inactive polls
  • Voting - A poll entity

Run testing units

$ truffle test

Deployment

Set all parameters in file .env (referenced from .env.template) or as environment variables

  • MNEMONIC - Mnemonic seed for use of contract deployment
  • INFURA_KEY - Infura Secret Token to get access to network
  • DEPOSIT_ACCOUNT - Deposit account for ethers withdrawals from core contract
$ npm install
$ # All required environment parameters in file .env are ready at this point.
$ truffle deploy --network <NETWORK>

Frontend

Pre-configuration options

To run the frontend, please specify all required values. Set all parameters in file .env (referenced from .env.template) or as environment variables

  • REACT_APP_VOTING_CORE_ADDRESS - Voting Core contract address
  • REACT_APP_NETWORK_ID - Restrict access to a specific Network ID (1: Mainnet, 3: Ropsten..., etc) where the Voting Core deployed (optional - defaults to all network) and provide users with conditional feature enhancements (such as predefined Etherscan links by known network ids)
  • REACT_APP_GOOGLE_ANALYTICS_TRACKING_CODE - Set tracking code for page views (optional - disabled by default)
  • REACT_APP_HOST_ENV - Host environment to build conditional static content (optional - defaults to 'production')
    • except for production - Tell search engine not to index

Run dev server

$ npm start

Build for production environment

$ npm build
$ ## dist folder: ./build
$ cd build

Place files inside folder build in static web server (e.g. Nginx)

ethereum-dapp-voting-dpolls's People

Contributors

zion-server avatar junzhli avatar

Watchers

James Cloos 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.