The smart contracts for the Menlo token (ONE) crowdsale.
Please see the contracts/ directory.
# Install local node dependencies:$ npm install
# Test$ npm test
Menlo Token Sale
In this document, we describe the token sale specification and implementation, and give an overview over the smart contracts structure.
The token sale is open only to registered contributors.
In each sale, a bounded number of tokens is offered (e.g., there is hard cap for raised ether).
There will be two funding rounds where Menlo (ONE) tokens may be purchased.
The first round will be in the form of a presale where 10% of the available tokens for sale will be available for purchase with a 35% discount with a lockup period achieved by the
Corresponding token balances can be claimed after the lockup period by calling the
release function from each
The second round will be in the form of the main sale where 90% of the available tokens for sale will be available for purchase at a scheduled bonus rate per week with a bonus power hour from the sale going live.
Preminted tokens are allocated to the company growth fund, team, partners, and advisors. Both the team and advisors' tokens will be timelocked using OpenZeppelin's
Overview of flow
MenloToken.solis deployed and 1 billion ONE tokens are minted to the owner address, growth fund, team, advisors, and partners. This is a fixed supply and no more ONE can ever be created.
MenloTokenPresale.soland list contributors who have been whitelist approved upon passing KYC procedures. The listing is done by us with a whitelisting script.
The presale tokens are transferred to the
MenloTokenPresale.solcontract by calling
MenloToken.solfrom the contract owner.
TokenTimeLock.solcontract is deployed where all presale tokens purchased will be sent to immediately upon purchase and stored on behalf of each contributor. It is required to call
MenloTokenPresale.solonce this contract has been deployed.
The address used for whitelisting is assigned by
Contributors addresses are collected during the KYC process and fed to
4_manage-whitelist.jsvia STDIN, one address per line. By running the
4_manage-whitelist.jsscript with the correct command-line flags, batches of addresses are added as approved (or disapproved) purchasers. Without a whitelisted address, purchasing ONE during the presale will not be possible. Example of how to manage the whitelist:
cat addresses-to-whitelist.txt | truffle exec --network live scripts/4_manage-whitelist.js --contract-name MenloTokenPresale --approve true --contract-address 0xb9155ee6aaef442d8acaee52825b6dd28ba18a7c --whitelister-address 0x8995e3fe58167ee3e33d878e84d807ddfacb6e2b --gas-price 5000000000
This script requires the runner to be connected to the "live" network, as specified in truffle.js.
The presale starts. At this point contributors can buy tokens by sending ETH to the
MenloTokenPresale.solcontract address directly, or alternatively by calling the
buyTokens()function. It is possible to buy several times, as long as cap is not exceeded.
As a result of either the endTime, cap being met, or manual shutdown, unsold tokens are sent back to the company wallet upon calling
MenloToken.solowner address. The company then has the option to burn those tokens.
Token transfers are enabled by calling
The same process will be repeated for deployment of
MenloTokenSale.solusing steps 2, 3, 5, 6, 7, 8 and 9. The tokens allocated for the main sale will be sent to the contract by calling
MenloToken.solfrom the contract owner. All tokens purchased will be sent directly to the beneficiary address immediately upon calling
Contract source code is in contracts.src -
npm run build to make_flat.sh the contracts into /contracts for truffle
Per module description
The system has 3 modules, namely, whitelisting, token, and token sale modules.
MenloTokenPresale.sol (now defunct) and
MenloTokenSale.sol inherit from.
Provides a raw list of addresses approved for purchase.
MenloToken.sol. The token is fully compatible with ERC20 standard.
It is impossible to transfer tokens during the period of the token sale. To be more precise, only the token sale contract is allowed to transfer tokens during the token sale.
The token sale contracts have the roles of:
Verifying that contributors are whitelisted. Implemented in
Distributing tokens to buyers. Implemented in
Use of zeppelin code
We use Open Zeppelin code for