contract ERC20Capped is ERC20Mintable {
    uint256 private _cap;
    uint256 private _totalMinted;

    constructor(uint256 cap)
        public
    {
        require(cap > 0);
        _cap = cap;
    }

    /**
    * @return the cap for the token minting.
    */
    function cap() public view returns(uint256) {
        return _cap;
    }

    /**
    * @return the total minted
    */
    function minted() public view returns(uint256) {
        return _totalMinted;    
    }

    /**
    * @dev Function to mint tokens
    * @param to The address that will receive the minted tokens.
    * @param amount The amount of tokens to mint.
    * @return A boolean that indicates if the operation was successful.
    */
    function mint(
        address to,
        uint256 amount
    )
        public
        returns (bool)
    {
        require(_totalMinted.add(amount) <= _cap);

        _totalMinted = _totalMinted.add(amount);
        return super.mint(to, amount);
    }
}
/* Custom capped version for MoveCoin */
function mint(
    address to,
    uint256 amount
)
    public
    returns (bool)
{
    require(_totalMinted.add(amount) <= _cap);

    _totalMinted = _totalMinted.add(amount);
    return super.mint(to, amount);
}

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