Skip to content

alexcodeberlin/Dapp-Voting-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Dapp-Voting-System


# Project introduction:
This project aims to develop a decentralized voting application with blockchain technology. Traditional voting systems often face challenges such as security vulnerabilities, lack of transparency and centralized control. By leveraging blockchain technology we have a more secure and transparent voting platform. Cryptographic techniques secure votes and ensure that only authorized individuals create votes. All voting transactions are recorded on the blockchain. Overall, a decentralized voting app offers a more secure and transparent voting process with greater confidence and trust.

Content:

1. Setup Code environment
2. Project Documentation
3. Code Documentation

1. Setup Code environment

Instructions: How to set up a development environment? The easiest way to setup my decentralized application is to start it with https://remix.ethereum.org/. Remix.ethereum.org is an online integrated development environment (IDE) specifically designed for Ethereum smart contract development. It allows developers to write, debug, and deploy solidity smart contracts directly in their web browser. Remix provides built-in access to Ethereum networks for contract deployment and testing for developers.

  1. Open https://remix.ethereum.org/ In the remix Filesystem on the left bar:
  2. Create default workspace
  3. Create File votingDapp.sol on default-workspace/contracts
  4. Paste the code from my github repository "contracts/votingDapp.sol" into votingDapp.sol in "default-workspace/contracts"
  5. When you save it with strg+s it will automatically compile the contract(this step is necessary)

# 2.Project Documentation
1. In the left navigation bar go to deploy and run transactions. Then hit the button "Deploy".

1

  1. Next, hit the recycle bin to delete "Deployed/Unpinned Contracts" in the bottom right corner of the picture.

22

  1. Click on the button "Deploy" again.

  2. After that, open the dropdown menu that appears bellow "Deployed/Unpinned Contracts". The following menu will popup: 33

  3. Press the button "startVoting". Now the voting has started and you can vote all members in the "ACCOUNT" selectbox. (look at console output)

  4. Click on the "ACCOUNT" selectbox. The first account is the account with which you are voting. Copy another account address and paste it in the textfield "address receiver" next to "addVote" Button. The "adress receiver" is the canditate.
    444

  5. Then you need to select in "ACCOUNT" selectbox again the account with which you started.

  6. Click on "addVote". Now you voted the account which you copied before in step 6.
    555

  7. Now choose a third account in the "ACCOUNT" selectbox as a new voter. Don´t change anything else.

  8. Place another vote by clicking on "addVote". Now you voted the account which you copied in step 6 but as a different voter. 666

  9. Click on "removeVote". In the output is nomore a receiverAddress, you can just see the voter who has removed his last vote for the selected candidate. 777

  10. Copy the account from "receiverAddress" into "address voterAddress" beside the button "getVote".

  11. Click on "getVote". In the output you see the address which you voted in step 10.

  12. To stop the voting progress, you need to click on "stopVoting".

3. Code Documentation


The code in the contract "votingDapp.sol" is well documentated. Every action is described in the file with comments. The smart contract is designed to show the voting process on the Ethereum blockchain. It allows users to cast votes for candidates to start and stop the voting process, add and remove votes and retrieve the candidates. Functions in the Contract "votingDapp.sol":
startVoting(): Starts a voting process by setting votingInProgress to true.
stopVoting(): Stops s voting process by setting votingInProgress to false.
addVote(address receiverAddress): Allows a user to cast a vote for a specific candidate identified by receiverAddress.
removeVote(): Allows a user to remove their previously cast vote.
getVote(address voterAddress): Retrieves the address of the candidate voted for by a specific voter identified by voterAddress.

# 4. Software architecture
The Remix IDE used in this project is an online development environment that allows to write, test and debug solidity contracts. Smart contracts are the core components of the Ethereum project. Remix can write and deploy smart contracts. The workspace directories: 'Contracts': Here you can find my contract "votingDapp.sol". The contract is written in solidity and defines the logic of the application.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published