/ico-maker

Smart Contracts to build your ICO solution and issue your ERC20 Token

Primary LanguageJavaScriptMIT LicenseMIT

ICO Maker

Build Status Coverage Status

Smart Contracts to build your ICO solution and issue your ERC20 Token.

Prerequisites

Install truffle.

npm install -g truffle      // Version 4.1.14+ required.

Create your Smart Contracts folder and init truffle

mkdir MyICO
cd MyICO 
truffle init

Install

npm install ico-maker

Usage

BaseToken.sol

BaseToken is an ERC20 token with a lot of stuffs like Capped, Mintable, Burnable and ERC1363 Payable Token behaviours.

pragma solidity ^0.4.24;

import "ico-maker/contracts/token/BaseToken.sol";


contract MyToken is BaseToken {
  constructor(
    string _name,
    string _symbol,
    uint8 _decimals,
    uint256 _cap
  )
  BaseToken(_name, _symbol, _decimals, _cap)
  public
  {}
}

Contributions.sol

Contributions is an utility Smart Contract where to store additional data about crowdsale like the wei contributed or the token balance of each address.

pragma solidity ^0.4.24;

import "ico-maker/contracts/crowdsale/utils/Contributions.sol";


contract MyContributions is Contributions {}

BaseCrowdsale.sol

BaseCrowdsale is an extensible Crowdsale contract with Timed and Capped behaviours.

pragma solidity ^0.4.24;

import "ico-maker/contracts/crowdsale/BaseCrowdsale.sol";


contract MyCrowdsale is BaseCrowdsale {
  constructor(
    uint256 _openingTime,
    uint256 _closingTime,
    uint256 _rate,
    address _wallet,
    uint256 _cap,
    uint256 _minimumContribution,
    address _token,
    address _contributions
  )
  BaseCrowdsale(
    _openingTime,
    _closingTime,
    _rate,
    _wallet,
    _cap,
    _minimumContribution,
    _token,
    _contributions
  )
  public
  {}
}

Bounty.sol

Bounty is a Capped Smart Contract to mint and distribute tokens for bounty programs.

pragma solidity ^0.4.24;

import "ico-maker/contracts/distribution/Bounty.sol";


contract MyBounty is Bounty {
  constructor(address _token, uint256 _cap)
  Bounty(_token, _cap)
  public
  {}
}

Airdrop.sol

Airdrop is a Smart Contract to distribute tokens for airdrop.

pragma solidity ^0.4.24;

import "ico-maker/contracts/distribution/Airdrop.sol";


contract MyAirdrop is Airdrop {
  constructor(address _token, address _wallet)
  Airdrop(_token, _wallet)
  public
  {}
}

Development

Install truffle.

npm install -g truffle      // Version 4.1.14+ required.

Install dependencies

npm install

Linter

Use Solium

npm run lint:sol

Use ESLint

npm run lint:js

Use both and fix

npm run lint:fix

Compile and test the contracts.

Open the Truffle console

truffle develop

Compile

compile 

Test

test

Optional

Install the truffle-flattener

npm install -g truffle-flattener

Usage

truffle-flattener contracts/token/BaseToken.sol >> dist/BaseToken.dist.sol

License

Code released under the MIT License.