kleros / openiico-contract

Contract of Interactive Coin Offering
MIT License
11 stars 5 forks source link

Interactive Coin Offering

This contract implements the Interactive Coin Offering token sale as described in this paper: https://people.cs.uchicago.edu/~teutsch/papers/ico.pdf

Implementation details and modifications compared to the paper:

Security notes:

The LevelWhitelistedIICO contract inherits from the IICO contract. It implements a basic KYC where users individual contributions are capped and a reinforced KYC where contributions are not limited.

Running tests

truffle test

Truffle should be installed: npm install -g truffle

There is also a stress test that handles 5000 bid and takes 20-30 minutes to run and has intermittent failures for no obvious reasons. See this issue. In order to run it:

truffle test test-stress-finalize/StressFinalize.js

Vulnerability bounties (up to 50 ETH)

The bounty program includes contracts develloped by the Kleros team and the third-party ones we will rely upon:

This contract has up to 50 ETH of bug and vulnerabilities bounties attached. Only vulnerabilities which can lead to real issues are covered by the bug bounty program. As an example, finding an addition which can overflow leading to someone else loosing money is a vulnerability, but simply stating "Not using SafeMath is bad" isn't (in our case, we chose not to use SafeMath, as blocking the finalization would be a more critical failure mode than an overflow).

The vulnerability payout ranges from 1 ETH (display issue which is unlikely to lead to any significant loss of funds) to 50 ETH (vulnerabilities which would make someone likely to steal ETH from the bidders or the beneficiary).

The OWASP matrix is used to determine payouts: OWASP

Critical: Up to 50 ETH.

High: Up to 30 ETH.

Medium: Up to 20 ETH.

Low: Up to 4 ETH.

Note: Up to 1 ETH.

The final vulnerability classification belongs to the Kleros team, but we are obviously committed to ensure a fair remuneration for bounty hunters in order to improve the security of the Ethereum ecosystem.

Vulnerabilities should be disclosed to contact@kleros.io, please includes [BUG BOUNTY] in the subject. Note that only the first party to report a vulnerabilty is eligible to bounties. The last submissions are due for May 14 in order for us not to start the sale would a vulnerability be discovered. Later submission would still be eligible but at a reduce payout. Please refrain of any action damaging property that you don't own.

Note that this program is not the only security measure which have been put in place (there was a previous bug bounty program with a lower payout, there are exernal audits and reviews by team members and partners).

Deployment

  1. Deploy a token and IICO contract. Note that you can use the same token contract with multiple IICO contracts.
  2. Use Token.mint(IICOContractAddress) to mint tokens for the IICO contract on the token contract.
  3. Use IICO.setToken(tokenContractAddress) to set the token on the IICO contract.
  4. If you are using the IICO contract with whitelist functionality, you'll also need to call IICO.setWhitelister(whitelisterAddress) so the whitelister can add addresses to the whitelist.

You can also run the deployment script in the repository with openiico dapp

Step-by-step tutorial also available.