This repository contains a Ballot smart contract implemented in Solidity, designed to facilitate a simple and secure voting system on the Ethereum blockchain. This contract enables users to propose candidates, delegate votes, and cast votes with transparency. Once successfully implemented, the voting process can be conducted using a mobile device connected to the blockchain.
- The chairperson (owner) can input multiple candidates' names to be voted on by the voters.
- Each voter is given the Right to Vote, and a weight can be assigned to their vote.
- A voter can only cast a single vote during an election.
- Candidate names are encrypted using Base32 throughout the voting process.
- The winner's name is decrypted and revealed at the end of the election.
- Remix IDE: Remix Ethereum IDE
-
Compiling the Code
Compile the smart contract using Remix IDE. -
Selecting the Chairperson's Account
Select the account to act as the chairperson for the election. -
Encrypting Candidates' Names
Convert the names of the candidates to an encrypted format using Base32. -
Adding Candidates to the Contract
Provide the array of encrypted candidates' names to the contract for voting. -
Granting Voting Rights
Assign the Right to Vote to selected individuals. -
Casting Votes
Voters can cast their votes for the desired candidates. -
Declaring the Winner
The winner is declared, but their name remains encrypted at this stage. -
Decrypting the Winner's Name
The winning candidate's name is decrypted and revealed at the end of the election.
This smart contract enhances the security and transparency of the voting process by utilizing Ethereum blockchain technology, making it highly suitable for digital voting systems.