Giter VIP home page Giter VIP logo

crowdfundr's Introduction

Crowdfundr Project

Project Spec

  • There should be a ProjectFactory contract with a create method that deploys instances of the Project contract using the factory create pattern.

    • Each Project instance should be able to receive contributions independent of the others.
    • Each project has a goal amount, in ETH, which cannot be changed after a project gets created.
  • The requirements for contributions are as follows:

    • The contribution amount must be at least 0.01 ETH.
    • There is no upper limit on contribution size.
    • Anyone can contribute to the project, including the creator.
    • One address can contribute as many times as they like.
    • No one can withdraw their funds until the project either fails or gets cancelled.
  • The requirements for contributor badges are as follows:

    • Each project should use its own NFT contract.
    • An address earns 1 badge for each 1 ETH in their total contribution for that project.
    • One address can earn multiple badges for a single project, but should only earn 1 badge per 1 ETH.
      • For example, if Alice contributes 0.4 ETH to Project A, she is owed 0 badges. If she then contributes 0.7 ETH to Project A, her total contribution to that project is now 1.1 ETH, so she is owed 1 badge. If she then contributes 1 ETH, her total contribution is now 2.1 ETH, and she has earned 2 badges total.
    • The minting of badges should not happen in the same contract call as the contribution. In other words, there should be a separate function for a user to claim the contributor badges they are owed.
      • When an address calls this claim function, they should receive the correct number of badges based on their total contribution so far, while accounting for any badges that were previously claimed. When the claim function is called by a contract, that contract must indicate it is able to handle NFTs or else the transaction should revert.
    • Regardless of the end result of the crowdfunding effort, the project's badges are left alone. They should still be transferable.
  • The terminal states of a project are as follows:

    • If the project is not fully funded within 30 days:

      • The project goal is considered to have failed.
      • No one can contribute anymore.
      • Contributors can get a refund of their contribution.
    • Once a project becomes fully funded:

      • No one else can contribute (however, the last contribution can go over the goal).
      • The creator cannot cancel the project.
      • The creator can withdraw any amount of contributed funds.
    • Before the 30 days are over and if the project is not yet fully funded, the creator can cancel the project.

      • This should have the same effect as a project failing to reach its goal within the 30 days.

Code Coverage Report

--------------------------|----------|----------|----------|----------|----------------|
File                      |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
--------------------------|----------|----------|----------|----------|----------------|
 contracts/               |      100 |       90 |      100 |    95.35 |                |
  Project.sol             |      100 |       90 |      100 |       95 |         94,116 |
  ProjectFactory.sol      |      100 |      100 |      100 |      100 |                |
 contracts/test/          |       80 |       50 |      100 |    85.71 |                |
  ReentrancyAttempt.t.sol |       80 |       50 |      100 |    85.71 |             26 |
--------------------------|----------|----------|----------|----------|----------------|
All files                 |    97.22 |     87.5 |      100 |       94 |                |
--------------------------|----------|----------|----------|----------|----------------|

crowdfundr's People

Contributors

dianakocsis avatar

Stargazers

 avatar

Watchers

 avatar

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.