contract MintableToken is StandardToken {
    using SafeMath for uint256;

    event Mint(address indexed to, uint256 amount);
    event MintFinished();

    bool public mintingFinished = false;

    modifier canMint() {
        require(!mintingFinished, "ERC20: mint is finished");
        _;
    }

    /**
    * @dev Internal function that mints an amount of the token and assigns it to
    * an account. This encapsulates the modification of balances such that the
    * proper events are emitted.
    * @param _to The account that will receive the created tokens.
    * @param _value The amount that will be created.
    */
    function _mint(address _to, uint256 _value) internal {
        require(_to != address(0), "ERC20: mint to the zero address");

        totalSupply_ = totalSupply_.add(_value);
        balances[_to] = balances[_to].add(_value);

        emit Mint(_to, _value);
        emit Transfer(address(0), _to, _value);
    }

    /**
    * @dev Function to mint tokens
    * @param _to The address that will receive the minted tokens.
    * @param _value The amount of tokens to mint.
    * @return A boolean that indicates if the operation was successful.
    */
    function mint(address _to, uint256 _value) onlyOwner canMint public returns(bool) {
        _mint(_to, _value);

        return true;
    }

    /**
    * @dev Function to stop minting new tokens.
    * @return True if the operation was successful.
    */
    function finishMinting() onlyOwner canMint public returns(bool) {
        mintingFinished = true;
        MintFinished();
        return true;
    }
}
/**
 * @title Mintable Token
 */
function mint(address _to, uint256 _value) onlyOwner canMint public returns(bool) {
    _mint(_to, _value);

    return true;
}

/**
 * @dev Function to mint tokens
 * @param _to The address that will receive the minted tokens.
 * @param _value The amount of tokens to mint.
 * @return A boolean that indicates if the operation was successful.
 */