Skip to content

Latest commit

 

History

History
62 lines (40 loc) · 1.46 KB

README.md

File metadata and controls

62 lines (40 loc) · 1.46 KB

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