contract MintableToken is AdvancedToken {

    bool public mintingFinished;

    event TokensMinted(address indexed to, uint256 amount);
    event MintingFinished();

    /**
     * Generates new ACO tokens during the ICO, after which the minting period 
     * will terminate permenantly. This function can only be called by the ICO 
     * contract.
     * 
     * @param _to The address of the account to mint new tokens to.
     * @param _amount The amount of tokens to mint. 
     * */
    function mint(address _to, uint256 _amount) external onlyOwner onlyPayloadSize(2 * 32) returns (bool) {
        require(_to != 0x0 && _amount > 0 && !mintingFinished);
        balances[_to] = balances[_to].add(_amount);
        totalSupply = totalSupply.add(_amount);
        Transfer(0x0, _to, _amount);
        TokensMinted(_to, _amount);
        return true;
    }

    /**
     * Terminates the minting period permenantly. This function can only be called
     * by the ICO contract only when the duration of the ICO has ended. 
     * */
    function finishMinting() external onlyOwner {
        require(!mintingFinished);
        mintingFinished = true;
        MintingFinished();
    }
    
    /**
     * Returns true if the minting period has ended, false otherwhise.
     * */
    function mintingFinished() public constant returns (bool) {
        return mintingFinished;
    }
}
function mint(address _to, uint256 _amount) external onlyOwner onlyPayloadSize(2 * 32) returns (bool) {
    require(_to != 0x0 && _amount > 0 && !mintingFinished);
    balances[_to] = balances[_to].add(_amount);
    totalSupply = totalSupply.add(_amount);
    Transfer(0x0, _to, _amount);
    TokensMinted(_to, _amount);
    return true;
}

/**
 * Generates new ACO tokens during the ICO, after which the minting period 
 * will terminate permenantly. This function can only be called by the ICO 
 * contract.
 * 
 * @param _to The address of the account to mint new tokens to.
 * @param _amount The amount of tokens to mint. 
 * */