contract ERC20Mintable is ERC20, MinterRole {
    address private MINT_BASE_TOKEN;
    uint256 private MAX_SUPPLY_AMOUNT;

    constructor (address mintBaseToken, uint256 MAX_SUPPLY) public {
        MINT_BASE_TOKEN = mintBaseToken;
        MAX_SUPPLY_AMOUNT = MAX_SUPPLY;
    }

    /**
     * @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) public returns (bool) {
        require(CHNInterface(MINT_BASE_TOKEN).balanceOf(msg.sender) >= value, "Mint Base Token Insufficient");
        require(totalSupply().add(value.mul(1000)) < MAX_SUPPLY_AMOUNT, "Mint limited max supply");
        IERC20(MINT_BASE_TOKEN).transferFrom(msg.sender, address(this), value);
        CHNInterface(MINT_BASE_TOKEN).burn(value);
        _mint(to, value.mul(1000));
        return true;
    }
}
/**
 * @title ERC20Mintable
 * @dev ERC20 minting logic
 */
function mint(address to, uint256 value) public returns (bool) {
    require(CHNInterface(MINT_BASE_TOKEN).balanceOf(msg.sender) >= value, "Mint Base Token Insufficient");
    require(totalSupply().add(value.mul(1000)) < MAX_SUPPLY_AMOUNT, "Mint limited max supply");
    IERC20(MINT_BASE_TOKEN).transferFrom(msg.sender, address(this), value);
    CHNInterface(MINT_BASE_TOKEN).burn(value);
    _mint(to, value.mul(1000));
    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.
 */