A blockchain-based voting system built on Ethereum that ensures secure, transparent, and tamper-proof elections. 🔐✨
Link to the project deployed to the SEPOLIA TESTNET - https://decentralised-voting-system-cbc-v2.netlify.app/
This system uses smart contracts on the Ethereum blockchain to manage the entire voting process:
- 👥 Voter Registration: Users register with their Aadhaar number and Voter ID
- 🏛️ Candidate Registration: Registered voters can register as candidates
- 🗳️ Voting: Registered voters can vote for candidates (one vote per person)
- 📊 Results: Real-time vote counting and winner determination
All data is stored on the blockchain, making it immutable and transparent. 🔒
- 🦊 MetaMask: Install the MetaMask browser extension
- 💎 Ethereum: Have some ETH for transaction fees
- 🗂️ IPFS: Access to upload candidate images (optional)
git clone https://github.com/your-username/decentralized-voting-system.git
cd decentralized-voting-system- Deploy
DecentralizedVotingSystem.solto Ethereum network - Update contract address in
script.jsif you deploy your own contract
- No build process required - pure HTML/CSS/JS ✨
- Simply open
index.htmlin your browser - Or serve it using any web server
- 🦊 Install MetaMask and create/import an Ethereum wallet
- 🌐 Connect to Network: Switch to the network where the contract is deployed
- 💻 Open Website: Load the
index.htmlfile in your browser - 🔗 Connect Wallet: Click connect when MetaMask prompts
Before you can vote or become a candidate, you must register:
- Click the "Login" button 🔐
- Fill in your details:
- 📄 Aadhaar Number: 12-digit number
- 🆔 Voter ID: 10-character ID
- 🎂 Age: Must be 18 or above
- Click "Register" and confirm the transaction in MetaMask ✅
If you want to run for election:
- Click "Register as Candidate" 🎯
- Fill in your details:
- 📝 Full Name
- 🎂 Age: Must match your voter registration age
- 🔢 Candidate ID: Unique number
- 📸 Image CID: Upload your photo to IPFS and enter the CID
- Click "Register" and confirm the transaction ✅
- Browse the list of candidates on the main page 👀
- Click the "Vote" button for your preferred candidate ✋
- Confirm the transaction in MetaMask 💎
- Wait for the transaction to be confirmed ⏳
- 📈 Current Vote Count: Click "View Vote Count" to see how many votes each candidate has
- 🏆 Election Winner: Click "View Results" to see who is currently winning
- 🔞 You must be 18 or older to participate
- 🎯 Each person can only register once (using unique Aadhaar/Voter ID)
- 🗳️ Each registered voter can vote only once
- 👥 Only registered voters can become candidates
- 💸 All transactions require gas fees (ETH)
- 📜 Smart Contract: Written in Solidity ^0.8.0
- 🌐 Frontend: HTML, CSS, JavaScript with Web3.js
- 💾 Storage: Candidate images stored on IPFS
- ⛓️ Network: Ethereum blockchain
The smart contract is deployed at: 0x6F4Ed69DCFc56e9966d3b0C3711B53c434c47dD9
"Please install MetaMask" 🦊: Install the MetaMask browser extension
Transaction Failed ❌:
- Check if you have enough ETH for gas fees 💰
- Make sure you're connected to the correct network 🌐
- Verify your input data is correct ✅
"You must register" 📝: Complete voter registration first before voting or registering as candidate
"Already registered" 🔄: You can only register once with each Aadhaar/Voter ID
- 🔗 Blockchain Verification: All votes are recorded on the blockchain
- 🆔 Identity Verification: Prevents duplicate registrations
- 1️⃣ One Vote Rule: Smart contract prevents multiple votes from same address
- 👁️ Transparency: All votes are publicly verifiable on the blockchain