๐ FundChain - Smart Contract (Foundry) This repository contains the Foundry-based smart contracts for FundChain, a decentralized crowdfunding platform.
๐ Table of Contents Overview
Tech Stack
Setup & Installation
Smart Contract Details
Testing
Deployment
Contributing
License
๐ Overview FundChain is a blockchain-powered crowdfunding platform that allows users to create campaigns and receive funds transparently. It utilizes Foundry for smart contract development and Next.js for the frontend.
๐ Tech Stack Solidity โ Smart contract language
Foundry โ Smart contract development framework
Ethers.js โ Blockchain interaction
Hardhat (Optional) โ Testing & Deployment
Next.js + TailwindCSS โ Frontend
๐ฅ Setup & Installation To set up and run this project locally, follow these steps:
1๏ธโฃ Clone the repository sh Copy Edit git clone https://github.com/your-username/fundchain-foundry.git cd fundchain-foundry 2๏ธโฃ Install Foundry sh Copy Edit curl -L https://foundry.paradigm.xyz | bash foundryup 3๏ธโฃ Install dependencies sh Copy Edit forge install 4๏ธโฃ Compile the contracts sh Copy Edit forge build 5๏ธโฃ Run tests sh Copy Edit forge test ๐ Smart Contract Details FundChain.sol (Core Contract) The FundChain contract enables: โ Creating campaigns โ Funding campaigns โ Withdrawing funds โ Refunding contributors
Contract Functions Function Description createCampaign() Creates a new campaign fundCampaign() Allows users to donate withdrawFunds() Campaign owner withdraws funds getCampaigns() Fetches all campaigns ๐ Deployment Deploy your contract using Foundry:
sh Copy Edit forge script script/Deploy.s.sol --rpc-url <RPC_URL> --private-key <PRIVATE_KEY> --broadcast OR using Hardhat (if configured):
sh Copy Edit npx hardhat run scripts/deploy.js --network goerli ๐ค Contributing Feel free to fork the repo, create a pull request, or open an issue. ๐
๐ License This project is MIT Licensed.
You can create a README.md file and paste this content:
sh Copy Edit nano README.md Paste the content and save. Then push it back to GitHub:
sh Copy Edit git add README.md git commit -m "Added README file" git push origin main