DVote Horizon is a blockchain-based decentralized voting system that ensures transparency, security, and integrity in the voting process. Built on Ethereum smart contracts, this application eliminates traditional voting vulnerabilities through cryptographic verification and immutable record-keeping.
This project demonstrates the practical implementation of Web3 technologies to solve real-world problems in democratic processes, making elections tamper-proof and fully auditable.
- Blockchain-Based: All votes are recorded on the Ethereum blockchain, ensuring immutability
- Cryptographic Verification: Each vote is cryptographically secured and verifiable
- Anonymous Voting: Voter privacy is maintained while ensuring vote authenticity
- Tamper-Proof: Once cast, votes cannot be altered or deleted
- Real-Time Vote Counting: Instant vote tallying through smart contract logic
- Multiple Candidate Support: Flexible system supporting various election types
- Voter Authentication: Secure wallet-based voter identification
- Transparent Results: All results are publicly verifiable on the blockchain
- Audit Trail: Complete voting history maintained on-chain
- Web3 wallet integration (MetaMask)
- Smart contract interaction through Web3.js
- Responsive UI for desktop and mobile devices
- Real-time blockchain transaction updates
- HTML5 - Semantic markup structure
- CSS3 - Modern styling and animations
- JavaScript (ES6+) - Interactive user interface
- Web3.js - Ethereum blockchain interaction library
- Solidity - Smart contract development
- Ethereum - Blockchain platform
- Hardhat - Development environment and testing framework
- Ethers.js - Ethereum wallet implementation
- GitHub Pages - Frontend hosting
- Ethereum Testnet - Smart contract deployment (Sepolia/Goerli)
DVote-Horizon/
โโโ index.html # Main application interface
โโโ VotingSystem.sol # Ethereum smart contract
โโโ deploy.js # Contract deployment script
โโโ hardhat.config.js # Hardhat configuration
โโโ package.json # Project dependencies
โโโ bg.mp4 # Background video assets
โโโ Dvote.png # Project logo
โโโ .github/
โโโ workflows/
โโโ static.yml # GitHub Actions CI/CD
Before you begin, ensure you have the following installed:
- Node.js (v14 or higher)
- npm or yarn
- MetaMask browser extension
- Git
- Clone the repository
git clone https://github.com/Xavious2604/DVote-Horizon.git
cd DVote-Horizon- Install dependencies
npm install- Configure Hardhat
Edit hardhat.config.js with your network settings:
module.exports = {
solidity: "0.8.19",
networks: {
sepolia: {
url: "YOUR_ALCHEMY_OR_INFURA_URL",
accounts: ["YOUR_PRIVATE_KEY"]
}
}
};- Compile smart contracts
npx hardhat compile- Deploy smart contract
npx hardhat run deploy.js --network sepolia- Update contract address
After deployment, update the contract address in index.html with the deployed address.
- Run locally
Open index.html in your browser or use a local server:
npx serve .- Install MetaMask extension
- Connect your Ethereum wallet to the application
- Ensure you're on the correct network (Sepolia/Goerli testnet)
- Browse available candidates and their information
- Review voting options
- Select your preferred candidate
- Confirm the transaction in MetaMask
- Wait for blockchain confirmation
- Check transaction on Etherscan
- View updated vote counts in real-time
- Deploy Contract: Use Hardhat to deploy a new voting instance
- Add Candidates: Initialize candidates through smart contract
- Set Voting Period: Configure start and end times
- Monitor Results: Track votes in real-time through the dashboard
Run the test suite to verify smart contract functionality:
# Run all tests
npx hardhat test
# Run with gas reporting
REPORT_GAS=true npx hardhat test
# Run local blockchain node
npx hardhat nodeThe VotingSystem.sol smart contract includes:
- Candidate Registration: Add and manage candidates
- Vote Casting: Secure voting mechanism with duplicate prevention
- Result Calculation: Real-time vote counting
- Access Control: Admin functions for election management
- Event Logging: Emit events for all major actions
function vote(uint candidateId) public
function addCandidate(string memory name) public onlyAdmin
function getResults() public view returns (uint[] memory)
function endVoting() public onlyAdmin- Frontend: https://xavious2604.github.io/DVote-Horizon/
- Smart Contract: View on Etherscan (Update with your deployed contract address)
- Government Elections: Local and national voting systems
- Corporate Governance: Shareholder voting and board elections
- Academic Institutions: Student council elections
- DAOs: Decentralized organization decision-making
- Community Polls: Transparent community voting
- Multi-signature voting for enhanced security
- Integration with decentralized identity (DID) systems
- Mobile application (React Native)
- Support for ranked-choice voting
- Integration with IPFS for candidate information storage
- Real-time analytics dashboard
- Multi-language support
- Layer 2 scaling solutions (Polygon, Arbitrum)
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Mohammed Irfan Shaikh
- ๐ GitHub: @Xavious2604
- ๐ผ LinkedIn: Mohammed Irfan Shaikh
- ๐ง Email: 223171@theemcoe.org
- Ethereum Foundation for blockchain infrastructure
- OpenZeppelin for smart contract libraries
- Hardhat for development framework
- MetaMask for wallet integration
Made with โค๏ธ for a transparent and secure voting future
โญ Star this repository if you find it helpful!
