Giter Club home page Giter Club logo

donation-crowdfunding's Introduction

Donation Crowd Funding Contract

This contract is implementing a matching donation crowd funding.

The main idea is to encourage donations by matching incoming donations and thus doubling the donations of the public.

Overview

In order to encourage the public to donate we have deposited to the contract wallet 1 million NIS worth of ETH.

Any donation that will be received to the contract will be transferred to the donation beneficiery by the contract. And in addition the donation will be matched by the contract and the same amount of donation will be tranfered to the beneficiery fro mthe pre loaded amount.

So that for every X ETH donated the contract will transfer another X ETH.

The max total of matched donations cannot exceed the deposited amount. The owner can deposit more funds into the contract in order to increase his matching donations.

If the deposited amount is exhausted, donations are still welcome and will be transferred to the beneficiary without the contract matching.

Mainnet Addresses

The donation contract has been deployed to 0x0236DA65D76Ae844aBB81814CeBB6fe9B001d587

Contracts

Please see the contracts/ directory.

Develop

  • Contracts are written in Solidity and tested using Truffle and testrpc.

  • Our smart contract is based on Open Zeppelin smart contracts v1.3.0 (latest OZ commit merged is 8e01dd14f9211239213ae7bd4c6af92dd18d4ab7 from 24.10.2017).

Code

CrowdFunding Functions

deposit

function deposit() onlyOwner isNotFinalized external payable

donate

function donate() isNotFinalized public payable

finalizeDonation

function finalizeDonation(address beneficiary) onlyOwner isNotFinalized public

CrowdFunding Events

DonateAdded

event DonateAdded(address indexed _from, address indexed _to,uint256 _amount);

DonationMatched

event DonationMatched(address indexed _from, address indexed _to,uint256 _amount);

Finalized

event Finalized();

ClaimBalance

event ClaimBalance(address indexed _grantee, uint256 _amount);

Dependencies

# Install Truffle and testrpc packages globally:
$ npm install -g truffle ethereumjs-testrpc

# Install local node dependencies:
$ npm install

Test

$ ./scripts/test.sh

Collaborators

License

Apache License v2.0

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.