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.
These instructions will help you set up the project on your local machine for development and testing purposes.
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)
- Clone the repository:
git clone https://github.com/salahawk/crowdfunding-erc20.git
- Navigate to the project directory and install the dependencies:
cd crowdfunding-erc20
npm install
- 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
- In the project directory, compile the smart contracts:
npx hardhat compile
- 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:
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):
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):
- Solidity - Smart contract programming language
- Hardhat - Ethereum development environment
- OpenZeppelin Contracts - Reusable Solidity components
This project is licensed under the MIT License - see the LICENSE file for details.