Code Monkey home page Code Monkey logo

prooftokensale's Introduction

Proof Token Sale Smart Contracts

Public Repository for the proof token sale smart contracts

Contracts

The ProofToken and TokenSale contracts are inspired by open-zeppelin standard and audited contracts.

The Proof Tokens are based on the StandardToken and MintableToken ERC20 contracts. Additional functionality is heavily inspired by the MinimeToken (https://github.com/Giveth/minime/blob/master/contracts/MiniMeToken.sol)

The TokenSale contract is inspired by the open-zeppelin Crowdsale contract with additional functionality mixed in.

Presale and Initial Token Allocations

295,297 tokens have already been issued during the presale. These tokens will be imported before the first presale

How to use the tokensale contract

The following contracts are hosted on this repository.

  • The tokensale contract
  • The Proof token contract
  • The token factory contract
  • Several other interface contracts

ICO team

There are several prerequisites for using the smart contract.

Contract setup :

  1. Compile and migrate the contracts to the network. This can be done with the truffle migrate --network ethereum command. The contract addresses will successively appear on the console.
  2. Import the presale balances You can use the 'scripts/importBalances.js' along with the provided csv file describing the presale balances. This import mechanism differs from the traditional way of importing presale balances via a claim function and makes the process automatic for presale buyers. The counterpart is that this requires more trust in the ICO team. Only the controller of the Proof token contract can call this function
  3. Lock the presale balances Calling the lockPresaleBalances function ensures that no other presale balances can be imported. Only the controller of the Proof token contract can call this function
  4. Transfer the Proof Token control to the Tokensale contract Proof tokens can only be created by the controller contract. The control of the proof Token can be given from the contract creator to the tokensale by calling the changeControl function.
  5. Transfer the ownership of the Tokensale contract to a custom wallet It is better not to use the wallet that created the contract and transfer ownership to a wallet shared by several members of the team

Critical Verifications:

  1. Verify the multisig address The multisig refers to the wallet to which funds from the tokensale are transferred when a investor sends ether
  2. Verify the proof token wallet The proof wallet receives the proof tokens when upon completion of the tokensale
  3. Verify the start date and end date Token purchase can be made only between the start block and the end block
  4. Verify the token the token cap, the cap, and the wei cap The token cap is the maximum number of tokens that can be issued in ERC20 units (= number of tokens times 10^18) The cap is the maximum number of tokens that can be issued
  5. Verify all the rest

Token Sale Finalization:

The token sale can be finalized in different ways.

  • First if the end block is reached, no more tokens can be issued by the token sale. The rest of the functionality of the tokensale contract however remains available. It is necessary to manually enable transfers through the enableTransfers function (can only be called by the owner of the tokensale).

  • The tokensale can be paused with the pause function. In this case, token minting is paused and tokens can not be bought anymore. This does not affect whether tokens are transferable or not. To activate or deactivate token transfers,

  • The last and standard way to finalize the token sale is to call the finalize function. This function can only be called by the owner of the token sale contract and can only be called when the token sale is paused. This automatically finishes the minting of the proof tokens and enables token transfers

Step-by-step instructions to finalize the token sale:

  1. Pause the token sale with the pause function
  2. Finalize the token sale with the finalize function
  3. Optionally, transfer the control of the Proof token to another smart-contract. This smart-contract has to use the same interface as the token sale (onTransfer, onApprove, etc.).

Development and Testing Environment Setup

Requirements :

  • OSX or Linux (Windows setup is likely possible but not covered in this guide)
  • Node (version 8.5.0 required for the testing environment)
  • testrpc / geth

Testing Environment Setup :

  • Clone the repository and install dependencies
git clone https://github.com/ProofSuite/ProofPresaleContract.git
cd ProofPresaleContract
npm install
  • Install the latest version of truffle
npm install -g truffle
  • Compile contracts
truffle compile
  • Initialize testrpc (or geth)
testrpc
  • Migrate contracts to chosen network
truffle migrate --network development
  • Make sure you are using the latest version of node
nvm install 8.5.0
nvm use 8.5.0
  • Fill in truffle.js and deploy_contracts.js with appropriate wallet addresses. Unlock the corresponding accounts.

  • Verify all tests are passing

truffle test
  • You can interact with the contracts via the console
truffle console

prooftokensale's People

Contributors

dvisacker avatar

Watchers

 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.