Welcome to the Blockchain Voting Machine! This decentralized voting platform is built on Ethereum layer 2 Base, offering a secure, transparent, gasless, and tamper-proof election experience. With seamless Ethereum wallet integration like Metamask and gasless voting, this platform is designed for the future of voting. 🔒✨
- Ethereum Wallet Integration: Decentralize your voting with ease. 🛡️
- Immutable Voting: Your votes are recorded on the Ethereum blockchain, ensuring they can't be altered. 📜
- Gasless Voting: No need to worry about transaction fees, thanks to relayer to pay on behalf of the user. 🚫💸
- Special SBT (Soulbound Token): Authenticate voters while maintaining privacy. 🔐
- Responsive UI: Enjoy a sleek interface built with React and tailwind. 📱💻
- Frontend: React, Bootstrap 🌐
- Blockchain Interaction: ethers.js, MetaMask 🔗
- Gasless Transactions: EIP-2771: Meta-Transaction Forwarder 💰
- Backend: Ethereum Smart Contracts, Flask 🔒
- Database: SQLite3 🗃️
- Connect Wallet: Click "Connect Wallet" to link your Ethereum wallet. 🔗
- Vote: After connecting, vote by selecting a candidate if you have a special SBT on your wallet. 🗳️
- Complete KYC: If you don’t have an SBT, complete KYC to receive a unique SBT in your wallet. 🆔
- Choose Candidate: Pick your candidate and cast your vote. ✅
- Sign the Transaction: A sign request will pop up in Metamask; sign it to complete your vote. ✍️
Our voting logic is governed by Ethereum smart contracts, ensuring top-notch security and transparency. 🔍
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install
-
Create a
.envfile:
Use the.env.examplefile as a reference. Populate the following variables:- 🛡️ VITE_ADMINADDRESS: Address of the wallet used to deploy the smart contracts.
- 🌐 VITE_API_BASE_URL: Backend server address (e.g., for local development:
127.0.0.1:5000).
-
Create a
.envfile at the project root:
Use the.env.examplefile as a reference. Populate the following variables: -
Install dependencies:
Ensure Python 3.10 is installed, then run:python3 -m pip install -r backend/requirements.txt
-
Set up the database:
python3 backend/database.py
-
Start the backend server:
python3 backend/app.py
-
Deploy contracts:
Use the smart contracts located in thesmart_contracts/contractsfolder. Deploy them via Remix IDE (or your preferred tool). -
Save deployment details:
- Copy the ABI, Bytecode, and Contract Address for each contract.
- Place them in their respective directories.
-
Note:
- While deploying
VotingSystem.sol, set:_relayerto the admin's wallet address._VID_Addressto the contract address of theVoterID.solcontract.
- While deploying
- 🔄 This project used Remix IDE for deploying and managing smart contracts.
- ✅ Ensure all
.envvariables are correctly configured for smooth functionality.