/devery_presale

Presale Contract for Devery

Primary LanguageShell

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
  • Increase cap
  • Contribute below cap
  • Manually close sale

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 14 2017. The MIT Licence.