Skip to content

ritesh-2008/crowd-funding

Repository files navigation

Decentralized Crowdfunding Smart Contract

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.

Features

1. Contribution System

  • Anyone can donate Ether.
  • Enforces a minimum contribution.
  • Tracks each contributor’s total amount.
  • Deadline-based funding window.

2. Target & Refund Logic

  • 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.

3. Spending Requests (DAO-style)

  • Manager creates spending requests with:
    • Description
    • Recipient address
    • Requested amount
  • Each request tracks:
    • List of voters
    • Vote count
    • Completion status

4. Voting Mechanism

  • Only contributors can vote.
  • Each contributor gets one vote per request.
  • Payment is processed only if more than 50% of contributors approve.

5. Manager Permissions

  • Only the manager (contract deployer) can:
    • Create spending requests
    • Execute approved payments

Contract Flow

  1. Deploy contract → set target, deadline, minimum contribution
  2. Users donate Ether → contributions tracked
  3. If target not met → users can refund
  4. If target met → manager creates spending requests
  5. Contributors vote on requests
  6. Once majority approves → manager releases funds to recipient

Tech Stack

  • Solidity ^0.8.x
  • Ethereum Virtual Machine
  • OpenZeppelin (Strings library optional)
  • Remix / Hardhat for deployment

How to Use

  1. Deploy contract
  2. Call donateth() to contribute
  3. After deadline:
    • If goal not reached → call Refund()
    • If goal reached → manager creates requests
  4. Contributors vote using voterequest(requestId)
  5. Manager finalizes payment using makepayment(requestId)

Security Notes

  • Uses mapping inside struct for voter tracking.
  • Prevents double voting.
  • Only manager can execute sensitive actions.
  • Ensures democratic approval before fund release.

About

A decentralized crowdfunding smart contract built in Solidity where contributors can donate Ether, vote on spending requests, and collectively approve fund releases. The contract supports refunds, democratic fund management, and ensures only the project manager can create spending proposals. Designed with transparency, security, and full on-chain g

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors