Appendix B. Full SimpleCrowdsale application

Listing B.1. Full SimpleCrowdsale application, including crowdsale and coin contracts
pragma solidity ^0.4.24; import "./Listing5_8_SimpleCoin.sol"; import "./Listing6_4_Ownable.sol"; interface ReleasableToken { function mint(address _beneficiary, uint256 _numberOfTokens) external; function release() external; function transfer(address _to, uint256 _amount) external; } contract ReleasableSimpleCoin is ReleasableToken, SimpleCoin { bool public released = false; modifier canTransfer() { if(!released) { revert(); } _; } constructor(uint256 _initialSupply) SimpleCoin(_initialSupply) public {} function release() onlyOwner public { released = true; } function transfer(address _to, uint256 _amount) canTransfer ...

Get Building Ethereum Dapps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.