Coder Social home page Coder Social logo

presale-pool's Introduction

PresalePool is a smart contract for pooling together contributions to invest in an ICO.

It supports the following configuration options:

  • minimum contribution threshold applied to each contributor
  • maximum contribution limit applied to each contributor
  • cap on total contributions from the pool
  • whitelist of addresses which are allowed to contribute to the pool

Once deployed, the PresalePool contract can be in one of four states: Open, Failed, Refund, or Paid

In the Open state contributors are able to deposit funds to the pool or withdraw funds from their contributions.

In the Failed or Refund state contributors can only withdraw their funds from the pool.

In the Paid state contributors can withdraw funds which were not included in the pool's overall contribution to the ICO. After the contract creator sets token contract on PresalePool, contributors will able to obtain their tokens. There is also a method for delivering the tokens to all the pool's contributors which can be invoked by the the contract creator.

The operation to transition to a Paid state is O(1). Similarly, the contributor operations (deposit eth, withdraw eth, obtain tokens) are O(1). The operation to deliver tokens to all the pool's contributors is O(n) where n is the number of contributors. This operation is likely to fail for pools consisting of many contributors because of gas limits.

In some cases editing the contribution limits can be an O(n) operation. Adding or removing a whitelist is an O(n) operation. Modifying an existing whitelist is an O(w) operation where w is the sum of additions and deletions on the whitelist.

Development

Requirements

  • node 8.x

Running tests

npm run test npm run test-only "matches test string"

LICENSE

As per GitHub Terms of Service, we allow others to view and fork the repository, but we do not offer any license.

What does it mean?

As stated by GitHub:

If you find software that doesn’t have a license, that generally means you have no permission from the creators of the software to use, modify, or share the software. Although a code host such as GitHub may allow you to view and fork the code, this does not imply that you are permitted to use, modify, or share the software for any purpose.

Source: https://choosealicense.com/no-permission/

presale-pool's People

Contributors

deams51 avatar leftparen avatar

Watchers

James Cloos avatar oneai 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.