npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

ico-maker

2.3.2 • Public • Published

ICO Maker

NPM Package Build Status Coverage Status MIT licensed

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

Prerequisites

Install Truffle if you want to run your own node

npm install -g truffle

Create your Smart Contracts folder and init truffle

mkdir MyICO
cd MyICO 
truffle init
npm init -y

Install

npm install ico-maker

Usage

BaseERC20Token.sol

BaseERC20Token is an ERC20 token with a lot of stuffs like Capped, Mintable, Burnable behaviours.

pragma solidity ^0.5.10;
 
import "ico-maker/contracts/token/ERC20/BaseERC20Token.sol";
 
contract MyToken is BaseERC20Token {
  constructor(
    string memory name,
    string memory symbol,
    uint8 decimals,
    uint256 cap,
    uint256 initialSupply
  )
    public
    BaseERC20Token(name, symbol, decimals, cap, initialSupply)
  {}
}

BaseERC1363Token.sol

BaseERC1363Token is a BaseERC20Token token with a ERC1363 Payable Token behaviours.

pragma solidity ^0.5.10;
 
import "ico-maker/contracts/token/ERC1363/BaseERC1363Token.sol";
 
contract MyToken is BaseERC1363Token {
  constructor(
    string memory name,
    string memory symbol,
    uint8 decimals,
    uint256 cap,
    uint256 initialSupply
  )
    public
    BaseERC1363Token(name, symbol, decimals, cap, initialSupply)
  {}
}

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.5.10;
 
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.5.10;
 
import "ico-maker/contracts/crowdsale/BaseCrowdsale.sol";
 
contract MyCrowdsale is BaseCrowdsale {
  constructor(
    uint256 openingTime,
    uint256 closingTime,
    uint256 rate,
    address payable wallet,
    uint256 cap,
    uint256 minimumContribution,
    address token,
    address contributions
  )
    public
    BaseCrowdsale(
      openingTime,
      closingTime,
      rate,
      wallet,
      cap,
      minimumContribution,
      token,
      contributions
    )
  {}
}

MintedBaseCrowdsale.sol

MintedBaseCrowdsale is an extensible BaseCrowdsale contract with Minted behaviours.

pragma solidity ^0.5.10;
 
import "ico-maker/contracts/crowdsale/MintedBaseCrowdsale.sol";
 
contract MyCrowdsale is MintedBaseCrowdsale {
  constructor(
    uint256 openingTime,
    uint256 closingTime,
    uint256 rate,
    address payable wallet,
    uint256 cap,
    uint256 minimumContribution,
    address token,
    address contributions
  )
    public
    MintedBaseCrowdsale(
      openingTime,
      closingTime,
      rate,
      wallet,
      cap,
      minimumContribution,
      token,
      contributions
    )
  {}
}

CappedDelivery.sol

CappedDelivery is a Capped Smart Contract to transfer tokens (i.e. for Airdrop or Bounty Program).

pragma solidity ^0.5.10;
 
import "ico-maker/contracts/distribution/CappedDelivery.sol";
 
contract MyAirdrop is CappedDelivery {
  constructor(address token, uint256 cap, bool allowMultipleSend)
    public
    CappedDelivery(token, cap, allowMultipleSend)
  {}
}

MintedCappedDelivery.sol

MintedCappedDelivery is a Capped Smart Contract to mint tokens (i.e. for Airdrop or Bounty Program).

pragma solidity ^0.5.10;
 
import "ico-maker/contracts/distribution/MintedCappedDelivery.sol";
 
contract MyAirdrop is MintedCappedDelivery {
  constructor(address token, uint256 cap, bool allowMultipleSend)
    public
    MintedCappedDelivery(token, cap, allowMultipleSend)
  {}
}

SpenderCappedDelivery.sol

SpenderCappedDelivery is a Capped Smart Contract to transferFrom tokens (i.e. for Airdrop or Bounty Program).

pragma solidity ^0.5.10;
 
import "ico-maker/contracts/distribution/SpenderCappedDelivery.sol";
 
contract MyAirdrop is SpenderCappedDelivery {
  constructor(address token, uint256 cap, bool allowMultipleSend, address wallet)
    public
    SpenderCappedDelivery(token, cap, allowMultipleSend, wallet)
  {}
}

BaseTimelock.sol

BaseTimelock is a TokenTimelock which is a token holder contract that will allow a beneficiary to extract the tokens after a given release time.

pragma solidity ^0.5.10;
 
import "ico-maker/contracts/token/ERC20/BaseTimelock.sol";
 
contract MyTimelock is BaseTimelock {
  constructor(
    IERC20 token,
    address beneficiary,
    uint256 releaseTime
  )
    public
    BaseTimelock(token, beneficiary, releaseTime)
  {}
}

Development

Install dependencies

npm install

Usage

Open the Truffle console

npm run console

Compile

npm run compile

Test

npm run test 

Code Coverage

npm run coverage

Linter

Use Solhint

npm run lint:sol

Use ESLint

npm run lint:js

Use ESLint and fix

npm run lint:fix

License

Code released under the MIT License.

install

npm i ico-maker

Downloadsweekly downloads

2

version

2.3.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability