contract Crowdsale is Ownable {

  using SafeMath for uint256;

  // address of erc20 token contract
  MintableToken public token;

  event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 amount);

  constructor() public {
    token = createTokenContract();
  }

  // creates the token to be sold.
  // override this method to have crowdsale of a specific mintable token.
  function createTokenContract() internal returns (MintableToken) {
    return new Token();
  }

  // owner can mint tokens during crowdsale withing defined caps
  function mintTokens(address beneficiary, uint256 tokens) external onlyOwner returns (bool) {
    require(beneficiary != 0x0);
    require(tokens != 0);
    token.mint(beneficiary, tokens);
    emit TokenPurchase(msg.sender, beneficiary, tokens);
  }

  // set token on pause
  function pauseToken() external onlyOwner {
    Token(token).pause();
  }

  // unset token's pause
  function unpauseToken() external onlyOwner {
    Token(token).unpause();
  }

    // set token Ownership
  function transferTokenOwnership(address newOwner) external onlyOwner {
    Token(token).transferOwnership(newOwner);
  }


}
function unpauseToken() external onlyOwner {
  Token(token).unpause();
}

// unset token's pause