SmartVote
Create, manage and join voting sessions

What is SmartVote ?
SmartVote allows users to organize their own voting instances, add users to whitelist, create proposals and tally votes. Works on the Polygon and Avalanche blockchains.
In general, SmartVote is designed to work with any EVM (Ethereum Virtual Machine) blockchains, public or private.

Why SmartVote ?
SmartVote uses Blockchain technology via Smart Contracts written in Solidity. The use of the Blockchain allows a perfect traceability of the entire voting session, from the addition of voters to the results of the vote itself.
SmartVote thus allows the creation of totally unforgeable and incensurable voting instances.

SmartVote UX / UI

In order to offer an optimal user experience, SmartVote had to respect two constraints:
- a clean and easily modifiable design to fit the companies that will use this dApp;
- des parcours utilisateurs simples et intuitifs.
Moreover, an interface optimization has been implemented in order to minimize the constraint related to the use of the blockchain: connection to the digital wallet, waiting time during transactions, use on smartphone...

Thus, the SmartVote dApp makes it as easy as possible to connect to numerous wallets in just one click, both on a computer and a smartphone. In addition, a loading indicator is displayed throughout the duration of the transaction, from its initialization to its registration on the blockchain.
Realization of SmartVote
Web 2 technologies
The Next.js framework was chosen for the design of the SmartVote dApp for many reasons, including its powerful and easily implemented routing system. SmartVote allows to create many voting sessions and Next.js allows to simplify their management and display.
On the CSS side, the TailwindCSS framework was chosen for its compatibility with Next.js and for its ease of use. SmartVote interface must be simple and familiar to the user and TailwindCSS perfectly meets this need.
In addition, Toastify was used to make interactions with the Blockchain more fluid. The management of asynchronous requests thanks to Toastify allows instant and precise feedback on the status of a transaction.
Web 3 technologies
Hardhat has been used, together with Ethers.js, to deploy and test the different smart contracts of the dApp. Hardhat allows to estimate the cost of deploying a smart contract and to get a feedback on the coverage of the smart contracts tests.
Concerning the connection with the Blockchain and the users' digital wallet, Rainbow Kit was used, together with Wagmi.sh.
Finally, in order to fluidify the call to events recorded on the Blockchain, The Graph has been added to the project.
Structure of Smart Contracts
The SmartVote dApp is divided into 3 smart contracts:
- VotingFactory.sol: allows to create voting instances respecting the EIP-1167. Although adding an additional cost of 700 gas per iteration, EIP-1167 allows a simplification of the VotingFactory contract and a very large reduction of the deployment costs;
- VotingHandler.sol: serves as a reference to the Clons created by VotingFactory. This smart contract contains all the logic of the voting sessions: adding voters, adding proposals, couting votes, second round... This smart contract is Upgradeable to allow cloning and registration of a new contract owner. Moreover, VotingHandler is Pausable in order to propose to the users of the dApp a "deletion" of a voting instance (classic deletion impossible on the Blockchain);
- InstancesList.sol: this smart contract acts as a bookmark and allows "Non Voters" to follow or stop following a voting instance from their dashboard.
