menlo-token

1.0.0 • Public • Published

Menlo

The smart contracts for the Menlo token (ONE) crowdsale.

Menlo

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

  1. 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.

  2. 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.

  3. The presale tokens are transferred to the MenloTokenPresale.sol contract by calling initializePresale inside of MenloToken.sol from the contract owner.

  4. 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 call setTokenTimeLock in MenloTokenPresale.sol once this contract has been deployed.

  5. The address used for whitelisting is assigned by setWhitelister in the MenloTokenPresale.sol contract.

  6. Contributors addresses are collected during the KYC process and fed to 4_manage-whitelist.js via STDIN, one address per line. By running the 4_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.

  1. The presale starts. At this point contributors can buy tokens by sending ETH to the MenloTokenPresale.sol contract address directly, or alternatively by calling the buyTokens() function. It is possible to buy several times, as long as cap is not exceeded.

  2. 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 the MenloToken.sol owner address. The company then has the option to burn those tokens.

  3. Token transfers are enabled by calling unpause by the MenloToken.sol owner address.

  4. 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 calling initializeCrowdsale inside of MenloToken.sol from the contract owner. All tokens purchased will be sent directly to the beneficiary address immediately upon calling buyTokens.

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.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    6
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    6

Package Sidebar

Install

npm i menlo-token

Weekly Downloads

6

Version

1.0.0

License

MIT

Unpacked Size

24.8 MB

Total Files

86

Last publish

Collaborators

  • davidmenlo