Inspiration
I have been discovering this web3 space for a long time, and till now I have learned about many different use cases and features of blockchains. Saw many innovative projects, but the one feature that fascinates me the most is the concept of 100% transparency. My project is based on the same feature.
Web3 Voting System
This application is a 100% transparent voting system, which is fully secured by blockchain's immutable nature and is impossible to tamper with.
It uses Chainlink keepers to automatically conclude the voting rounds after the preset amount of time is passed. It not only conducts a single voting round but also stores all the winner data of the previous round on the chain. On the front end, the registered candidate data is stored on IPFS using web3.storage for double security.
How I built it
I imitated the current standard voting system and fully implemented it on the smart contract using solidity to deploy it on the chain. I performed extensive testing on the contract to remove any bugs, making the smart contract more reliable.
Challenges we ran into
- As I am primarily a solidity developer, I didn't have prior knowledge of frontend it took little time but I learned basic NextJs to make UI for my smart contract.
- Earlier I decided to build a GRAPH API on top of my smart contract but I was not able to find enough of goerli ETH to test it on testnet due to which I had to limit the entire testing of the smart contract and frontend on the local device.
Accomplishments that I'm proud of
As this is my first hackathon I had to constantly push myself out of my comfort zone and build, while doing so I learned how to connect smart contracts with the front end, and how to upload and access files on IPFS using web3.storage. Finally, I have a complete working product to submit which is my biggest achievement.
What I learned
Along the way, I learned many things, front end integration and using web3.storage being the most prominent among them. On the smart contract development side after testing my contract many times I still found some bugs as a result of which, I now realize the importance of automated testing using chai, ethers.js, and hardhat.
What's next for the Decentralized Voting System
- In the current version of the application, a voter has to manually register on the front end to vote. I would love to change this to an NFT-gated system where a soulbound token is allotted to the voter using which the user can vote in a particular round the NFT is meant for.
- Also currently the voter has to pay for gas to vote, which sometimes becomes unviable due to high gas prices, I would like to implement signature-based voting where the organizer pays all the gas fees, and voters are only needed to sign the transaction.
- If I can find enough amount of goerli ETH to test my smart contract in the future I would love to build a GRAPH API on top of it, which will help to reduce resources used in the current model to fetch all the voter addresses multiple times. With graph indexing events, the voters can be accessed by the event emitted from the smart contract.
Built With
- ethers.js
- hardhat
- ipfs
- javascript
- nextjs
- solidity
- wagmi
- web3.storage
Log in or sign up for Devpost to join the conversation.