Skip to content

Latest commit

Β 

History

History
112 lines (83 loc) Β· 3.09 KB

File metadata and controls

112 lines (83 loc) Β· 3.09 KB

BlockVote_banner

Built with Ethers.js Powered by Ethereum Hardhat React MetaMask Ethereum Testnet

DApp that allows users to cast votes using blockchain technology, ensuring tamper-proof, one-person-one-vote elections.


πŸŽ₯ Demo

Watch the demo video

πŸ”§ Tech Stack

πŸ–₯️ Frontend

  • React (via Vite)
  • TypeScript
  • Tailwind CSS
  • Lucide React Icons
  • Ethers.js (for blockchain interaction)
  • MetaMask (for wallet authentication)

πŸ”Œ Backend / Smart Contracts

  • Solidity (for voting contract)
  • Hardhat (for local development, testing & deployment)

πŸ”— Blockchain

  • Ethereum Testnet (Sepolia)
  • MetaMask Wallet

πŸ› οΈ Installation

1. Clone the Repository

git clone https://github.com/Gregster31/BlockVote.git
cd BlockVote

2. Install Dependencies

npm install

3. Setup Environment Variables

Create a .env file in the root directory:

SEPOLIA_RPC="YOUR_KEY_HERE"
PRIVATE_KEY="YOUR_KEY_HERE"

4. Compile and Deploy Smart Contract

npm install
npx hardhat compile
npx hardhat run scripts/deploy.js --network sepolia

Copy the deployed contract address and paste it in CONTRACT_ADDRESS

5. Run the Frontend

npm run dev

✨ Features

  • βœ… 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.

🧠 Smart Contract Overview

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