- Solidity programming language.
- Ethereum.
- Remix IDE.
Global Variables :-
- owner -> owner of the contract
- minimumContribution -> minimum contribution required for contributor to do crowd funding.
- deadline -> Final Time to do crowdfunding.
- target -> crowd funding target (How much funds is targeted to be completed in the deadline);
- raisedAmount -> Keep track of the total raised amount.
- totalContributors -> total contributors who have contributed to crowd funding.
- numRequests -> keep track of requets done by owner.
- contributors -> key value pair of contributor to keep track of their address and funds they have contributed.
- allRequests -> All requests done by owner for tranfering money to a perticular address for a perticular reason.
Functions :-
- getBalance
- contribute
- refund
- createRequest
- voteRequest
- Make payment
-
Initially using constructor the owner addres, deadline, target, and minimum contribution to be done by contributor is saved in state variable.
-
The contributor contributes using contribute() function in crowd funding. If the deadline is not over and the funds are meeting the minimum requirements then the address and value is stored in state variable mapping.
-
If the target is not met and contributor wants the refund then he can refund the money by using refund() function.
-
The owner can request the all contributors to withdraw the funds by uing createRequest() function and tell the description, address to which the funds will be sent, and the total funds which to be sent.
-
All the contributors vote using voteRequest() function and if the votes are more than the 50% of contributors then using the makePayment() function the money is sent to the perticular address which owner has provided.