npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

menlo-token

v1.0.0

Published

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

Downloads

20

Readme

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.