interface ITokenERC20 is IThirdwebContract, IThirdwebPrimarySale, IThirdwebPlatformFee, IERC20Upgradeable {
    /**
     *  @notice The body of a request to mint tokens.
     *
     *  @param to The receiver of the tokens to mint.
     *  @param primarySaleRecipient The receiver of the primary sale funds from the mint.
     *  @param quantity The quantity of tpkens to mint.
     *  @param price Price to pay for minting with the signature.
     *  @param currency The currency in which the price per token must be paid.
     *  @param validityStartTimestamp The unix timestamp after which the request is valid.
     *  @param validityEndTimestamp The unix timestamp after which the request expires.
     *  @param uid A unique identifier for the request.
     */
    struct MintRequest {
        address to;
        address primarySaleRecipient;
        uint256 quantity;
        uint256 price;
        address currency;
        uint128 validityStartTimestamp;
        uint128 validityEndTimestamp;
        bytes32 uid;
    }

    /// @dev Emitted when an account with MINTER_ROLE mints an NFT.
    event TokensMinted(address indexed mintedTo, uint256 quantityMinted);

    /// @dev Emitted when tokens are minted.
    event TokensMintedWithSignature(address indexed signer, address indexed mintedTo, MintRequest mintRequest);

    /// @dev Emitted when a new sale recipient is set.
    event PrimarySaleRecipientUpdated(address indexed recipient);

    /// @dev Emitted when fee on primary sales is updated.
    event PlatformFeeInfoUpdated(address platformFeeRecipient, uint256 platformFeeBps);

    /**
     *  @notice Verifies that a mint request is signed by an account holding
     *         MINTER_ROLE (at the time of the function call).
     *
     *  @param req The mint request.
     *  @param signature The signature produced by an account signing the mint request.
     *
     *  returns (success, signer) Result of verification and the recovered address.
     */
    function verify(MintRequest calldata req, bytes calldata signature)
        external
        view
        returns (bool success, address signer);

    /**
     * @dev Creates `amount` new tokens for `to`.
     *
     * See {ERC20-_mint}.
     *
     * Requirements:
     *
     * - the caller must have the `MINTER_ROLE`.
     */
    function mintTo(address to, uint256 amount) external;

    /**
     *  @notice Mints an NFT according to the provided mint request.
     *
     *  @param req The mint request.
     *  @param signature he signature produced by an account signing the mint request.
     */
    function mintWithSignature(MintRequest calldata req, bytes calldata signature) external payable;
}
function verify(MintRequest calldata req, bytes calldata signature)
    external
    view
    returns (bool success, address signer);

/**
 *  @notice Verifies that a mint request is signed by an account holding
 *         MINTER_ROLE (at the time of the function call).
 *
 *  @param req The mint request.
 *  @param signature The signature produced by an account signing the mint request.
 *
 *  returns (success, signer) Result of verification and the recovered address.
 */