Vote in the web3 with 100% confidence
Ellet is a hobby project developed while learning smart contract development and usage in the web3 world. This is inspired from the ballot example from the https://remix.ethereum.org.
There is nothing special but it would serve as a good gist for the new commers to write a smart contract using truffle suite, compile and integrate in a frontend application.
- Deploy the contract as the owner (aka chairperson)
- Add proposols (voters) with maximum limit. By default it's 3
- Get the winner's address
- Update the voting weightage from chairperson's account
- Pre-check and modifiers for role-based access and prevent double voting
- Tamper proof ledger recording on the ethereum blockchain
Click on the image below to check the working video of the project
Like in web2, this is also a role-based application with two major roles: Voter and Chairperson
- Can read the winner details
- Can cast the vote if they have been allowed by the chairperson
All of them from the voters, including the following
- Register the address to the proposals array here
- Adjust the weight of the other voters to allow them to submit the vote.
Note: On deploying the contract, the chairperson will get 2 weightage of the vote. Check here
- Install truffle suite (
yarn global add truffle@latest
) - Clone the repository (
git clone https://github.com/tbhaxor/Ellet.git
) - Install the packages (
yarn install
) - Compile the contracts (
yarn build:sol
) - Start the dev server (
yarn serve
) - In the separate terminal, run
truffle develop
- Serve the development server of vuejs (
yarn serve
)
You can either do this by setting MAX_PROPOSALS
environment variable before deploying the contract or update the default value in the fallback here