Skip to content

Score based voting dApp using Solidity, React, Truffle, bootstrap, webpack

License

Notifications You must be signed in to change notification settings

shashiks/score-voter-eth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a demo project with samples for :

  • Score based Voting using Ethereum Smart Contracts

It uses ReactJS as the frontend framework, bootstrap for layouts, webpack for packaging.

Truffle is used for communicating with ETH and deploying code to blockchain

MetaMask integration for interacting Rinkeby Test Net

Feel free to use this as a template to get started on these technologies.

It consists of a Voting Contract and a UserRepository interface and its impl.

The interface is defined so that the user repo and the process of registration and validations can be changed in future as required.

The Voting contract expects an address of any Contract implementing the UserRepository interface to be injected for it to validate and get details of voters voting for options.

After the deployment of contracts to the blockchain the flow at a high level is as follows:

  1. Admin creates a list of Options for the survey.
  2. User needs to provide a metamask user account on (Rinkeby for now or any selected network) to the admin before his user account can be created by Admin
  3. Admin creates a list of users using name and user account (should be an ETH address)
  4. User goes to Survey options list. and selects a score for each option. Score to be between 1 and n where 'n' being the number of options available
  5. User can cancel anytime before submitting his survey
  6. User has to use the account provided earlier to admin for voting. Once voted he/she cannot vote again.
  7. Once voting is over. i.e. all users have voted Admin can go and look at results.

A known issue for now would be

The Registration process is manual for now. This can be automated later.

The

tags.js file should contain the random key words from your vault that will be used
to connect to Etehreum via Infura. This file is ignored under ,gitignore to keep your person data 
offline. Make sure you never commit these keywords to your repo

Bootstrap theme template is from https://startbootstrap.com/template-overviews/sb-admin/ This project was created using create-react-app https://github.com/facebookincubator/create-react-app

About

Score based voting dApp using Solidity, React, Truffle, bootstrap, webpack

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published