https://github.com/felixkamau/voting-system-smart-contract
A Hardhat project for a decentralized voting system smart contract, allowing for candidate registration, voting, and determining the winner. Includes deployment using Hardhat Ignition.
https://github.com/felixkamau/voting-system-smart-contract
hardhat hardhat-deployment smart-contracts solidity-contracts
Last synced: 12 months ago
JSON representation
A Hardhat project for a decentralized voting system smart contract, allowing for candidate registration, voting, and determining the winner. Includes deployment using Hardhat Ignition.
- Host: GitHub
- URL: https://github.com/felixkamau/voting-system-smart-contract
- Owner: felixkamau
- Created: 2024-08-19T16:11:49.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-19T19:42:11.000Z (almost 2 years ago)
- Last Synced: 2025-01-08T11:47:27.058Z (over 1 year ago)
- Topics: hardhat, hardhat-deployment, smart-contracts, solidity-contracts
- Language: Solidity
- Homepage:
- Size: 64.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Voting Smart Contract Solidity
## Description
This repository contains a Hardhat project for a decentralized voting system smart contract. The `Voting` contract uses OpenZeppelin's `Ownable` for ownership management and supports candidate registration, voting, and winner determination. The project includes deployment scripts using Hardhat Ignition and testing.
## Features
- **Candidate Registration**: Add and manage candidates.
- **Voting**: Users can vote for candidates.
- **Winner Determination**: Determine the candidate with the most votes.
- **Deployment**: Uses Hardhat Ignition for deployment.
- **Testing**: Includes tests to verify contract functionality.
## Getting Started
### Prerequisites
- [Node.js](https://nodejs.org/) (v18 or later recommended)
- [Hardhat](https://hardhat.org/)
- [OpenZeppelin Contracts](https://docs.openzeppelin.com/contracts/4.x/)
### Installation
1. Clone the repository:
```bash
git clone https://github.com/yourusername/hardhat-voting-system.git
cd hardhat-voting-system
```
2. Install dependencies:
```bash
npm install
```
### Running Tests
Run the following command to execute tests:
```bash
npx hardhat test
```
### Deployment
Deploy the contract to a local Hardhat network:
1. Start Hardhat Network:
```bash
npx hardhat node
```
2. Deploy Contract:
In a new terminal, run:
```bash
npx hardhat ignition deploy ./ignition/modules/VotingSystem.js --network localhost
```