Skip to content

sidrahh12/Voting-System-DApp

Repository files navigation

Voting System DApp 🗳️🔗

A decentralized voting application built on Ethereum (Sepolia Testnet) that enables secure, transparent, and tamper-proof elections using modern Web3 tools.

Vote DeCentral Vote DeCentral Vote DeCentral Vote DeCentral Vote DeCentral Vote DeCentral Vote DeCentral Vote DeCentral Vote DeCentral Vote DeCentral

Table of Contents

Description 📖

This Voting System DApp leverages Ethereum's Sepolia Testnet to provide:

  • 🛡️ Immutable vote recording
  • 🔍 Fully transparent voting history
  • 🔒 MetaMask wallet authentication
  • 📊 Real-time results tracking
  • ⏱️ Configurable voting periods

Deployed using Alchemy infrastructure with Foundry for smart contract development.

Features ✨

  • ✅ Vote creation and management
  • ✅ Voter whitelisting system
  • ✅ Time-bound voting sessions
  • ✅ Real-time vote tracking
  • ✅ Results verification

Tech Stack 💻

Frontend:

  • Next.js (React Framework)
  • Tailwind CSS
  • Ethers.js

Smart Contracts:

  • Solidity
  • Foundry (Forge, Cast)
  • OpenZeppelin Contracts

Infrastructure:

  • Sepolia Testnet
  • Alchemy RPC & API
  • Vercel (Frontend Hosting)

Smart Contract Details 📜

Network: Sepolia Testnet
Contract Address: 0x... (Add your contract address here)
Verified on: Etherscan (Add link)

Key contract functions:

  • createVote() - Admin creates new voting session
  • addCandidate() - Add voting options
  • vote() - Cast a vote
  • getResults() - View current results

Installation ⚙️

  1. Clone the repository:
git clone https://github.com/sidrahh12/Voting-System-DApp.git
cd Voting-System-DApp
  1. Install dependencies:
npm install
  1. Set up environment variables:
cp .env.example .env.local
Fill in your:

NEXT_PUBLIC_ALCHEMY_API_KEY

NEXT_PUBLIC_CONTRACT_ADDRESS

NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID

Deployment

Smart Contracts (using Foundry):

forge build
forge script script/DeployVoting.s.sol --rpc-url $SEPOLIA_RPC_URL --broadcast --verify -vvvv

Frontend

npm run build
npm run start
(Or deploy to Vercel via GitHub integration)

Usage 🖥️

Connect your MetaMask wallet to Sepolia Testnet

Get test ETH from Sepolia Faucet

  1. As admin:
  • Create voting sessions

  • Manage candidates

  • Whitelist voters

  1. As voter:
  • View active elections

  • Cast your vote

  • Verify transaction on Etherscan

About

Secure voting DApp on Sepolia Testnet using Next.js & Solidity. Features MetaMask login, tamper-proof votes, and real-time results. Admins manage elections/voters while users verify on Etherscan. Built with Foundry for smart contracts and Alchemy for deployment. Blockchain-powered transparency for trustless elections.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors