menlo-token
v1.0.0
Published
The smart contracts for the [Menlo][menlo] token (ONE) crowdsale.
Downloads
20
Maintainers
Readme
Menlo
The smart contracts for the Menlo token (ONE) crowdsale.
Contracts
Please see the contracts/ directory.
Develop
Contracts are written in Solidity and tested using Truffle and ganache.
Dependencies
# 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.
Informal Specification
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 MenloTokenTimelock.sol
contract.
Corresponding token balances can be claimed after the lockup period by calling the release
function from each msg.sender
.
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 TokenTimeLock.sol
.
Detailed description
Overview of flow
Firstly
MenloToken.sol
is 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.We deploy
MenloTokenPresale.sol
and 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.sol
contract by callinginitializePresale
inside ofMenloToken.sol
from the contract owner.The
TokenTimeLock.sol
contract 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 callsetTokenTimeLock
inMenloTokenPresale.sol
once this contract has been deployed.The address used for whitelisting is assigned by
setWhitelister
in theMenloTokenPresale.sol
contract.Contributors addresses are collected during the KYC process and fed to
4_manage-whitelist.js
via STDIN, one address per line. By running the4_manage-whitelist.js
script 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.sol
contract address directly, or alternatively by calling thebuyTokens()
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
refund
from theMenloToken.sol
owner address. The company then has the option to burn those tokens.Token transfers are enabled by calling
unpause
by theMenloToken.sol
owner address.The same process will be repeated for deployment of
MenloTokenSale.sol
using steps 2, 3, 5, 6, 7, 8 and 9. The tokens allocated for the main sale will be sent to the contract by callinginitializeCrowdsale
inside ofMenloToken.sol
from the contract owner. All tokens purchased will be sent directly to the beneficiary address immediately upon callingbuyTokens
.
Building
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.
Whitelist
Implemented in MenloSaleBase.sol
, which MenloTokenPresale.sol
(now defunct) and MenloTokenSale.sol
inherit from.
Provides a raw list of addresses approved for purchase.
Token
Implemented in 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.
Token sale
The token sale contracts have the roles of:
Verifying that contributors are whitelisted. Implemented in MenloSaleBase.sol
.
Distributing tokens to buyers. Implemented in MenloTokenTimelock.sol
, MenloTokenPresale.sol
and MenloTokenSale.sol
.
Use of zeppelin code
We use Open Zeppelin code for SafeMath
, Ownable
, ERC20Basic
, PausableToken
, BurnableToken
and StandardToken
logic.