bkc

It is a blockchain based voting apo that allows us to vote and get your stake back.

bkc

Created At

HackMoney 2026

Project Description

BlockVote is a blockchain-based voting application that leverages Ethereum smart contracts to provide a transparent, tamper-proof, and decentralized voting system. Built with Solidity and React, this application enables users to create polls and cast votes that are permanently recorded on the blockchain, ensuring complete transparency and immutability. Traditional voting systems often suffer from:

Lack of transparency in vote counting Potential for vote manipulation Centralized control and single points of failure Difficulty in verifying vote authenticity Limited accessibility and real-time results

Our Solution BlockVote addresses these challenges by:

Immutable Vote Recording: All votes are stored on the Ethereum blockchain, making them permanent and tamper-proof Complete Transparency: Anyone can verify vote counts and poll results directly on the blockchain Decentralized Architecture: No central authority controls the voting process Wallet-Based Authentication: Each Ethereum address can vote only once per poll, preventing duplicate voting Real-Time Results: Vote counts update instantly as transactions are confirmed Time-Bound Polls: Automatic poll expiration ensures voting periods are respected

How it's Made

📦 Technology Stack Smart Contracts: Solidity 0.8.19 Blockchain Framework: Hardhat Frontend: React 18 with Vite Web3 Library: ethers.js v6 Styling: Modern CSS with custom design system Local Network: Hardhat Network (Chain ID: 31337) 🔨 Implementation Details Smart Contract Architecture Created Voting.sol with comprehensive functionality:

Key Features:

Poll creation with title, description, options, and duration One vote per address per poll enforcement Vote tracking and counting Poll status management (active/ended) Event emissions for frontend updates Main Functions:

createPoll() - Create new polls vote() - Cast votes with validation getPoll() - Retrieve poll details hasUserVoted() - Check voting status getTotalVotes()

  • Get vote counts closePoll() - Manual poll closure by creator Frontend Components
  1. App.jsx - Main Application Web3 provider initialization Wallet connection management Contract instance creation View routing (polls list vs create poll) Event listener setup for account/chain changes
  2. WalletConnect.jsx - Wallet Integration MetaMask connection button Connected address display with formatting Connection status indicator
  3. CreatePoll.jsx - Poll Creation Interface Dynamic option management (2-10 options) Form validation Duration selection (1 hour to 1 week) Transaction handling with loading states
  4. PollList.jsx - Polls Overview Display all polls with status badges Real-time vote percentages Time remaining calculations Vote status indicators Click-through to detailed view
  5. PollDetail.jsx - Voting Interface Full poll information display Interactive option selection Vote casting with transaction confirmation Results visualization with progress bars Poll metadata (creator, ID, total votes) Design System Created a comprehensive design system in index.css :

Visual Features:

Dark theme with navy background (#0a0e27) Vibrant gradient accents (indigo to purple) Glassmorphism effects with backdrop blur Smooth transitions and hover effects Responsive grid layouts Custom progress bars and badges Pulse animations for status indicators Component Styles:

Cards with hover elevation Modern form inputs with focus states Primary/secondary button variants Alert components (success/error/info) Loading spinner animation Badge system for status display

background image mobile

Join the mailing list

Get the latest news and updates