DApp that allows users to cast votes using blockchain technology, ensuring tamper-proof, one-person-one-vote elections.
- React (via Vite)
- TypeScript
- Tailwind CSS
- Lucide React Icons
- Ethers.js (for blockchain interaction)
- MetaMask (for wallet authentication)
- Solidity (for voting contract)
- Hardhat (for local development, testing & deployment)
- Ethereum Testnet (Sepolia)
- MetaMask Wallet
git clone https://github.com/Gregster31/BlockVote.git
cd BlockVotenpm installCreate a .env file in the root directory:
SEPOLIA_RPC="YOUR_KEY_HERE"
PRIVATE_KEY="YOUR_KEY_HERE"npm install
npx hardhat compile
npx hardhat run scripts/deploy.js --network sepoliaCopy the deployed contract address and paste it in CONTRACT_ADDRESS
npm run dev- β Wallet Integration β Connect MetaMask to authenticate voters.
- β Candidate Listing β Live data fetched directly from the smart contract.
- β Secure Voting β Vote cast is signed and recorded immutably on the Ethereum blockchain.
- β One Person, One Vote β Each address can vote only once.
- β Live Vote Count β Real-time updates pulled from blockchain.
- β Beautiful UI β Smooth animations and accessible design using Tailwind CSS.
- β Decentralized β No backend server required. All voting data is on-chain.
Written in Solidity, the Voting smart contract:
- Stores candidate info on-chain
- Allows one vote per Ethereum address
- Prevents double voting
- Exposes public functions to retrieve candidates and vote counts
