Skip to content

A Hardhat project for a decentralized voting system smart contract, allowing for candidate registration, voting, and determining the winner. Includes deployment using Hardhat Ignition.

Notifications You must be signed in to change notification settings

felixkamau/voting-system-smart-contract

Repository files navigation

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

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/hardhat-voting-system.git
    cd hardhat-voting-system
  2. Install dependencies:

    npm install

Running Tests

Run the following command to execute tests:

npx hardhat test

Deployment

Deploy the contract to a local Hardhat network:

  1. Start Hardhat Network:

    npx hardhat node
  2. Deploy Contract:

    In a new terminal, run:

    npx hardhat ignition deploy ./ignition/modules/VotingSystem.js --network localhost

About

A Hardhat project for a decentralized voting system smart contract, allowing for candidate registration, voting, and determining the winner. Includes deployment using Hardhat Ignition.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published