/simpleElectionDapp

A simple decentralized election system running on the Ethereum Blockchain

Primary LanguageJavaScriptMIT LicenseMIT

Simple Election Dapp

The smart contract powering this dapp is voting.sol. It uses RequestNetwork's Safemath library to protect againts overflows for the int256 type, as well as their Ownable contract to enable the owner of the contract to delete candidates (which you probably don't want on a real world Election dapp).
The frontend was made using Vuejs, bootstrap, notifyjs and (of course) Web3js. Note that I used the 1.0.0 beta version of web3js because it allows for ES6 async/await functionality.

How to use

To interact with the dapp, the MetaMask browser extension is required so install it and log in. In order to send transactions you need ether, get some test ether sent to your address here.
Currently the contract is deployed on the ropsten testnet and you can access the frontend here.

Running Locally

With Truffle you can also run this on a local blockchain, I reccomend Ganache. I'm not going to go over the procedure here, given that there are plenty of tutorials explaining it.

Testing

I have also written javascript tests to assure the voting contract works as expected. Use truffle test to run the voting.js unit test which is under test/ .