An open API service indexing awesome lists of open source software.

https://github.com/kaymen99/election-dapp

A Decentralized Blockchain Voting/Election Application
https://github.com/kaymen99/election-dapp

blockchain brownie decentralized-applications election ethereum smart-contracts solidity voting-application

Last synced: 4 months ago
JSON representation

A Decentralized Blockchain Voting/Election Application

Awesome Lists containing this project

README

          

## Election-Dapp

## Overview:

A Decentralized Voting Application built for EVM compatible blockchains (ethereum, polygon, avalanche,...), it has the following features :

Administation functions:



  • Adding new candidates

  • Opening the voting for a giver duration

  • Closing the election after the predermined voting period

Main functions:



  • Allow user to vote only once for a choosen candidate

  • Determine the winner based on highest votes count

  • Give a complete list of all candidates with their data (id, name, votes count)

### Installation & Setup:

1. Installing Brownie: Brownie is a python framework for smart contracts development,testing and deployments. It's quit like [HardHat](https://hardhat.org) but it uses python for writing test and deployements scripts instead of javascript.
Here is a simple way to install brownie.
```sh
pip install --user pipx
pipx ensurepath
# restart your terminal
pipx install eth-brownie
```
Or if you can't get pipx to work, via pip (it's recommended to use pipx)
```sh
pip install eth-brownie
```
Install [ganache-cli](https://www.npmjs.com/package/ganache-cli):
```sh
npm install -g ganache-cli
```

2. Clone the repo:
```sh
git clone https://github.com/kaymen99/Election-Dapp.git
cd Election-Dapp
```
### How to deploy:

To deploy the Election contract on development network, run the command :
```sh
brownie run scripts/deploy_election.py
```
To deploy on real network/testnets, run the command :
```sh
brownie run scripts/deploy_election.py --network=
```

### Testing:

The tests for the Election smart contract can be found in the tests folder, you can run all the tests by :
```sh
brownie test
```
Or you can test each function individualy:
```sh
brownie test -k
```