Giter VIP home page Giter VIP logo

crowd-funding's Introduction

crowd-funding

This is a program that is crowdfunding which is able to operate in Ethereum network. There are two type of users in this contract, The first one is a Funder who fund for funding success. The second one is a Fundraiser who create a funding for his project.

When Fundraiser create a funding, he needs to set up title, subtitle, content, goalAmount, minAvailableAmount, beginTime, endTime about his funding.

In order to withdraw Ether from a funding as Fundraiser, You need a successful funding that stored in this smart contract.

In order to withdraw Ether from a funding as Funder, A funding state must be failed or progress.

  • The getBalance method that is located in crowdFunding would show you balance of this contract.
  • All of Coin unit is wei.

Requirement

  • node >7.x.x && <17.x.x
  • truffle ^5.5.x (If you want to test on private network or deploy contract.)

Usage

  1. Make .secret file on root directory and put the mnemonic that you set up when you created the Ethereum account in .secret file.
  2. Change account value to yours in /js/CrowdFunding.js.
  3. Refer To the API List below and modify the /app.js for What you want to do.
Method Params Description
getFunding id Return funding that is id that you put funding in contract.
getFundings Return all of Fundings in contract.
createFunding title, subTitle, content, goalAmount, availableMinAmount, beginTime, endTime
fund id, amount
getMyFundingAccountPapers id This method would return receipts that you funded at id.
withdrawAsFunder id This method possible you to get a refund from funding that you funded.
withdrawAsFundraiser id When funding finished successfully, You can withdraw from funding that you made.
setAvailableMinAmount id, amount This method change funding 'available min amount'.

Test Publish

Network Contract Txn Hash
Ropsten 0x8732FE7a3D5337836C85A2CDa5D371Ebc5308780 0xce227e8679e93e5ed3929d4fb40a9e5c1bbfc969941906ff7c832f72af3950c7

Contracts UML

UML

Contracts Description Table

Contract Type Bases
Function Name Visibility Mutability Modifiers
CrowdFunding Implementation FundraiserHandler, FunderHandler
L getBalance Public ❗️ NO❗️
L getFundings external ❗️ 🛑 NO❗️
L getFunding external ❗️ 🛑 NO❗️
FundraiserHandler Implementation FundingHandler
L setAvailableMinAmount External ❗️ 🛑 ownerOfFunding
L withdrawAsFundraiser External ❗️ 🛑 fundingSucceeded
FundingHandler Implementation FundingFactory, FundingCoinManager
FundingFactory Implementation
L createFunding External ❗️ 🛑 NO❗️
FundingCoinManager Implementation
L withdraw Internal 🔒 🛑
FunderHandler Implementation FundingHandler
L fund External ❗️ 💵 availableFund
L withdrawAsFunder External ❗️ 🛑 funded fundingInProgressOrFailed
L getMyFundingAccountPapers External ❗️ NO❗️
L _popAccountPaperAmount Private 🔐 🛑
L _removeMyAccountPaperIds Private 🔐 🛑

Legend

Symbol Meaning
🛑 Function can modify state
💵 Function is payable

crowd-funding's People

Contributors

0vollov0 avatar

Stargazers

Brendon Rofe avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

dashbaord202401

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.