A decentralized voting system proposed in NTU DApp course - https://dpolls.netlify.com
- 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 at 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
- 1 ETH for CITIZEN
- Contract administration (smart contract only)
- Set admin
- Withdraw funds from smart contract
- Reclaim ownership of registries in case of new core contract replacement
- smart-contract
- Smart contracts on Ethereum blockchain
- frontend
- User interface
- Truffle - blockchain development framework
- Ganache - private blockchain network
- VotingCore - Core functionality
- VotingHostRegistry - Maintain a list of registered hosts and memberships
- VotingRegistry - Maintain a list of active/inactive polls
- Voting - A poll entity
$ npm ci
$ truffle test
Set all parameters in file .env
(referenced from .env.template
) or as environment variables
MNEMONIC
- Mnemonic seed for use of contract deploymentINFURA_KEY
- Infura Secret Token to get access to networkDEPOSIT_ACCOUNT
- Deposit account for ethers withdrawals from core contract
$ # All required environment parameters in file .env are ready at this point.
$ truffle deploy --network <NETWORK>
Single page application (SPA) bootstrapped with Create React App and integrated with ETH browser wallet - Metamask
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_WEB3_PROVIDER
- Web3 Http(s) Provider URL (Infura is recommended)REACT_APP_VOTING_CORE_ADDRESS
- Voting Core contract addressREACT_APP_NETWORK_ID
- Restrict user's metamask network 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
- except for
$ npm ci
$ npm start
$ npm build
$ ## dist folder: ./build
$ cd build
Place files inside folder build
in static web server (e.g. Nginx)