GithubHelp home page GithubHelp logo

isabella232 / simple-token-sale Goto Github PK

View Code? Open in Web Editor NEW

This project forked from consensys/simple-token-sale

0.0 0.0 0.0 157 KB

Contracts for a fixed-price, finite-supply token sale.

JavaScript 100.00%

simple-token-sale's Introduction

Simple Token Launch

Codeship Status for skmgoldin/simple-token-launch

This codebase can be used to deploy fixed-price, finite-supply token sales. It uses json conf files to specify sale parameters, supports token distributions for pre-sale buyers, and the distribution of timelocked tokens for founders. It also includes a comprehensive test suite.

Initialize

This was developed using Node 8.2.1, Truffle 3.4.5 and TestRPC 4.0.1.

npm install -g truffle
npm install
truffle compile

The tests

To run the tests, simply npm run test.

The parameters tested are the same as those which will be deployed. This means the tests can take a very long time if your start block is up in the millions, and some tests will be skipped if signing keys cannot be unlocked for the required accounts, particularly the final test block for the founder timelocking mechanisms. The owner address in sale.json must be the first address generated by the mnemonic in secrets.json.

Composition of the repo

The repo is composed as a Truffle project. The test suite can be found in test/sale.json. The sale contract is in contracts/Sale.sol. The deployment scripts are in the migrations folder.

The Sale contract deploys the token contract, disburses funds to pre-sale purchasers and then deploys timelock contracts to store the founders tokens. Disbursement.sol and Filter.sol comprise the timelock contracts. Two Disbursement.sol contracts are deployed which unlock funds at a particular date. The Filter.sol contracts sit in front of them and allow particular addresses to withdraw particular amounts of funds.

Using the repo to deploy a real token

Config files where the parameters of your own sale can be filled in are in the conf directory.

Note that the owner in sale.json MUST BE the first address generated by the mnemonic in secrets.json. Note that you MUST change the default mnemonic in secrets.json or you WILL BE PWNED. Once you've done that you MUST NEVER commit your secrets.json. KEEP IT SECRET. It is in the .gitignore. Do not commit it once you've changed it. If your production mnemonic is compromised you are fully pwned.

DO NOT USE THE DEFAULT MNEMONIC. DO NOT SHARE OR COMMIT THE MNEMONIC YOU CHANGE IT TO.

Make sure all the tests pass before deploying. You probably won't have all of your founders' private keys and so expect to see warnings on those tests. It will take a long time for the tests in the "Sale period 0" block to begin since the testRPC has to be force-mined for millions of blocks.

Having done all that you can truffle migrate --network mainnet. Save the contents of your build directory, you'll want to have all that data.

simple-token-sale's People

Contributors

miguelmota avatar skmgoldin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.