/crowdfunding-erc20

Crowdfunding Campaign using ERC20 Tokens

Primary LanguageTypeScript

Crowdfunding Campaign using ERC20 Tokens

This project implements a crowdfunding platform using Solidity smart contracts and ERC20 tokens. Project owners can create crowdfunding campaigns, users can fund these campaigns, and project owners can withdraw funds if their campaigns reach their funding goals.

Table of Contents

Getting Started

These instructions will help you set up the project on your local machine for development and testing purposes.

Prerequisites

Ensure you have the following software installed on your machine:

  • Node.js v12.0+ and npm (I'm using v18.12.1)
  • Hardhat v2.0+ (for development and testing) (I'm using v2.14.0)
  • An Ethereum wallet such as Metamask (Optional: reuired for testnet/mainnet deployment)

Installation

  1. Clone the repository:
git clone https://github.com/salahawk/crowdfunding-erc20.git
  1. Navigate to the project directory and install the dependencies:
cd crowdfunding-erc20
npm install

Deploying Contracts

  1. Create a .env file in the project root and add your wallet's private key and an Ethereum network RPC URL: (Optional: not required if you want to test locally only)
PRIVATE_KEY=your-private-key
RPC_URL=your-rpc-url
  1. In the project directory, compile the smart contracts:
npx hardhat compile
  1. Deploy the smart contracts to your desired Ethereum network: (or you can deploy locally without specifying the network)
npx hardhat run --network <network-name> scripts/deploy.js

Replace <network-name> with the name of the network you want to deploy to, such as mainnet, goerli, or localhost.

Here's the result of deployment on my end: Test script result

Testing

To run tests on the smart contracts, execute the following command in the project directory:

npx hardhat test

Here's the test result (on my end): Test script result

Security

The smart contracts have been reviewed for security issues, and the code has been analyzed using Slither. However, it's important to conduct a thorough audit before deploying contracts to a production environment.

Here's the security-check result by Slither (on my end): Test script result

Built With

License

This project is licensed under the MIT License - see the LICENSE file for details.