Are you a VIP, a Very Important Philanthropist ?

Upcoming challenges and overview of the smart contract

Vincent Le Gallic
charitychain
4 min readJun 14, 2017

--

Since the presentation of Charitychain a few weeks ago on Medium, I have many positive feedback. I am now very motivated to launch the first version of the service in the coming months. Here is a small reminder of the concept :

The first fundraising platform on which fundraisers must give first
  1. The campaign author deposits 50% of the campaign goal.
  2. Contributors try to unblock the initial donation by collecting 50% of the goal.
  3. If they succeed, 100% of the funds go to the NGO, otherwise, everyone is refunded

To successfully launch this service, the following are the main challenges to be addressed in the coming months:

  • Find a major NGO partner to create a movement around a important cause
  • Find a VIP (Very Important Philanthropist) ready to make a high enough initial donation to challenge his community
  • Be technically reliable

Find a partner

Before opening the service to everyone, creating exclusivity seems to me a good idea because in any case, the service will not have an interplanetary success as soon as it is launched. There is nothing worse than a page that would list 3 campaigns in chess … Our goal is to find a courageous NGO partner that understands the extraordinary potential of the blockchain in charity. And cases of concrete use of this technology already exist !

Find a VIP

The initial deposit must be large enough, it must make people want to make a move to unlock the amount. If the initial amount is large and the cause is federative, the campaign will be supported and shared. Again, there are many examples of personalities making use of their notoriety to support humanitarian causes …

“We can use the strength of social networks not to influence but to inspire others”

Be technically reliable

There is an incredible community around Ethereum! I exchanged with several developers these last weeks and Blockchain is a subject as complex as exciting! The campaign smart contract is not finished but it will look like the version below. This version already respects some standards (Pull Payment, Fail as early as possible, Order your function code, State Machine, …) But there is still work (Factory, stopInEmergency, …)

The smart contract

Here is a short (self) review of the code with the recommendations listed in this article.

Fail as early and loudly as possible

With the function modifiers atStage(expectedStage), validContribution(), validRefund(), i think that this recommendation is implemented.

Favor pull over push payments

The idea is to isolate each external call into its own transaction that can be initiated by the recipient of the call. Payments are isolated in payoutToBeneficiary() and withdrawRefundContribution() functions because this external calls can fail.

Order your function code: conditions, actions, interactions

With the modifier functions, this seems ok.

Be aware of platform limits

The types of variable used, the absence of loop and asynchronous payments… These techniques should protect the contract from platform limits.

Write tests

In progress in Solidity with Truffle Framework.

Fault tolerance and Automatic bug bounties

Not yet implemented.

Limit the amount of funds deposited

For now the limit (fundingCap) is hard coded to 10 times the initial goal, but I’m not convinced by this idea, it is a point to improve but the mechanism is ready and if the gap is reached, the contract will reject any direct payments (function modifier validContribution()).

Write simple and modular code

I read the code of several open source crowdfunding projects and I tried to gather the ideas that seemed to me the simplest and logical ones. The “state machine” pattern greatly improves the readability of the code. The function modifiers simplify the code and increase the reusability of the conditions check. I will try to keep functions simple and short so that the smart contract stays easy to understand.

Don’t write all your code from scratch

Not yet implemented, but the contract will inherit from another contract like Ownable.sol.

If you have any questions or ideas to improve Charitychain, please do not hesitate! If you liked this post, hit the ♡ and Stay tuned with the newsletter , No spam, just some good news!

This new article is also an opportunity to thank those who spontaneously spoke of Charitychain as Crypt0 in this video or Griff Green on giveth.io Slack, very nice, thank you! Follow their project, they do an awesome job to develop really useful things.

I attended some interesting Meetups in Paris organized by the association Asseth (which I joined recently) I also had the chance to code with very good developers during a Workshop on security of smart contract at Hacker House Paris, a very good experience too! And thanks Romain Menetrier for reviews and ideas to improve Charitychain.

--

--