A fully on-chain crowdfunding system written in Solidity.
Contributors can donate ETH, vote on fund usage, and approve project expenses through a decentralized governance mechanism.
- Anyone can donate Ether.
- Enforces a minimum contribution.
- Tracks each contributor’s total amount.
- Deadline-based funding window.
- Funding target is set at deployment.
- If target is not reached before the deadline:
- Contributors can claim a refund.
- If target is reached:
- Funds are locked for spending requests only.
- Manager creates spending requests with:
- Description
- Recipient address
- Requested amount
- Each request tracks:
- List of voters
- Vote count
- Completion status
- Only contributors can vote.
- Each contributor gets one vote per request.
- Payment is processed only if more than 50% of contributors approve.
- Only the manager (contract deployer) can:
- Create spending requests
- Execute approved payments
- Deploy contract → set target, deadline, minimum contribution
- Users donate Ether → contributions tracked
- If target not met → users can refund
- If target met → manager creates spending requests
- Contributors vote on requests
- Once majority approves → manager releases funds to recipient
- Solidity ^0.8.x
- Ethereum Virtual Machine
- OpenZeppelin (Strings library optional)
- Remix / Hardhat for deployment
- Deploy contract
- Call
donateth()to contribute - After deadline:
- If goal not reached → call
Refund() - If goal reached → manager creates requests
- If goal not reached → call
- Contributors vote using
voterequest(requestId) - Manager finalizes payment using
makepayment(requestId)
- Uses
mappinginside struct for voter tracking. - Prevents double voting.
- Only manager can execute sensitive actions.
- Ensures democratic approval before fund release.