Skip to content

feat: CrowdFunding Vending Machine smart contract (fixes #7) - #10

Draft
s6pa1rta3n-lab wants to merge 1 commit into
Defiville:mainfrom
s6pa1rta3n-lab:fix-issue
Draft

feat: CrowdFunding Vending Machine smart contract (fixes #7)#10
s6pa1rta3n-lab wants to merge 1 commit into
Defiville:mainfrom
s6pa1rta3n-lab:fix-issue

Conversation

@s6pa1rta3n-lab

Copy link
Copy Markdown

Summary

This pull request implements the CrowdFunding Vending Machine smart contract for presale and crowdfunding campaigns as specified in #7.

Key Capabilities & Implementation

  • Campaign Creation (createCrowdCampaign): Enables creators and organizations to launch crowdfunding campaigns specifying a product metadata URI, funding goal, unit price, campaign duration, and max supply.
  • Supporter Pledges (supportCampaign): Backers purchase and reserve allocations using ETH. Validates exact payments, supply bounds, and deadlines.
  • Product Redemption (redeemProduct): Once the funding goal is reached, contributors can redeem their purchased quantities.
  • Creator Settlement (claimFunds): Campaign managers can withdraw raised proceeds once goals are satisfied.
  • Cancellation & Backer Refunds (cancelCampaign, refund): If a campaign expires without reaching its target or is cancelled by the creator, contributors can withdraw full ETH refunds via a pull-based pattern.
  • Inspection & Helpers: Complete helper views (getCampaign, stateOf, getSupporterInfo) for integrations and UI/subgraph querying.
  • Security & Reliability: Implements ReentrancyGuard, checks-effects-interactions pattern, custom errors for gas efficiency, and comprehensive event emissions.

Verification

  • 32/32 tests passing locally via Hardhat (npx hardhat test).
  • Zero mocked assertions — full state transition and real balance validation on local Ethereum network.

Payout Routing

  • EVM (Base/Arbitrum/Polygon/ETH): 0xF46C9F6d70C50BF81ef3588AB523a90a594a2F89
  • Stellar: GCL6OXAMLD75BMTINA6EMRUDWK5THQUSHMYNLSNBCJAPZJHNYJTUNIBC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant