Git Product home page Git Product logo

devery_presale's Introduction

Devery Presale Contract

Summary

The Devery presale contract is a combined presale and token contract. Participants contribute ethers (ETH) to the presale / token contract address and tokens are generated for the contributing account at the rate of one token per ETH contributed.

The PREVE Presale EVE Tokens are non-transferable tokens that will later be used in the crowdsale contract to determine the number of crowdsale tokens to mint for each presale contributor.

Mainnet Addresses

TBA


Presale Contract

  • Participants can contribute to the presale contract after the specified start date
  • There is no specified end date for this presale contract. The presale automatically closes when/if the contributed ETH reaches the cap. The presale can also be manually closed by the token contract owner executing the closeSale() function
  • Participants intending to contribute to the presale contract will need to have their ETH account whitelisted by Devery OR the Parity PICOPS system
  • The DeveryPresaleWhitelist contract whitelist entries are used to verify the whitelisted addresses where the max amount is > 0 . The max amount value is not checked against the contributed ETH value
  • There is a minimum contribution amount. The token contract owner is able to change this minimum amount at anytime during the presale period
  • The presale contract has a contribution cap that is specified in USD. The token contract owner is able to change this cap amount at anytime during the presale period
  • The ETH/USD exchange rate is specified in the presale contract, and can be updated by texecuting the setUsdPerKEther(...) function. This function can be executed by the token contract owner at anytime during the presale period
  • The presale contract DeveryPresaleWhitelist contract address can be updated by executing the setWhitelist(...) function. This function can be executed by the token contract owner at anytime during the presale period
  • The presale contract Parity PICOPS Certifier contract address can be updated by executing the setPICOPSCertifier(...) function. This function can be executed by the token contract owner at anytime during the presale period

Token Contract

  • The PREVE token contract implements the recently finalised ERC-20 Token Standard
  • The PREVE tokens have 18 decimal places like the ETH token
  • The PREVE tokens are NOT transferable by default. The token owner can enable transfers by executing the enableTransfers() function, but this is not the intended behaviour for this token contract


Table Of Contents



Requirements



Testing

Test 1 Happy Path

The following functions were tested using the script test/01_test1.sh with the summary results saved in test/test1results.txt and the detailed output saved in test/test1output.txt:

  • Deploy the Devery whitelist contract
  • Whitelist a few contributing addresses
  • Deploy Test PICOPSCertifier contract - address 0xa44a hardcoded to return true
  • Deploy the presale/token contract
  • Set presale/token contract parameters
    • Set ETH min contribution amount
    • Set USD cap
    • Set USD per 1,000 ETH
    • Assign the whitelist
    • Assign the PICOPSCertifier
  • Wait until start date
  • Contribute from whitelisted address below cap
  • Contribute from non-whitelisted address below cap, expecting failure
  • Contribute above cap, excess refunded, presale closed
  • Contribute after presale closed, expecting failure

Details of the testing environment can be found in test.



Code Review

Note that this is a code review by the author of the contracts:



(c) BokkyPooBah / Bok Consulting Pty Ltd for Devery - Dec 02 2017. The MIT Licence.

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.