Smart Contracts to build your ICO solution and issue your ERC20 Token.
Install truffle.
npm install -g truffle // Version 4.1.14+ required.Create your Smart Contracts folder and init truffle
mkdir MyICO
cd MyICO
truffle initnpm install ico-makerBaseToken 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 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 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 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 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
{}
}Install truffle.
npm install -g truffle // Version 4.1.14+ required.npm installUse Solium
npm run lint:solUse ESLint
npm run lint:jsUse both and fix
npm run lint:fixOpen the Truffle console
truffle developCompile
compile Test
testInstall the truffle-flattener
npm install -g truffle-flattenerUsage
truffle-flattener contracts/token/BaseToken.sol >> dist/BaseToken.dist.solCode released under the MIT License.