Inability to call certain functions

I deployed an ERC721A contract that imports OZ's libraries and verified it's source code successfully on HardHat. But the problem is, I can't call the mint function, nor the pause function on Remix. I get this error:

Gas estimation failed
Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending?
Cannot read properties of undefined (reading 'includes')

All other functions work well, except these two. I tried to change my evm version to paris, but it didn't even work.

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.26;

import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/Address.sol";

contract TestMint is ERC721A, Ownable, Pausable, ReentrancyGuard {
    string private _baseTokenURI;
    uint256 public constant maxSupply = 25;
    uint256 public constant maxBatchSize = 7;
    uint256 public constant mintPrice = 0.003 ether; 


    constructor(address initialOwner) ERC721A("TestMint", "TMNT") Ownable(initialOwner) {

    }

    function Mint(uint256 quantity) public payable whenNotPaused {
        require(msg.value >= quantity * mintPrice, "Insufficient Funds");
        require(_numberMinted(msg.sender) + quantity <= maxBatchSize, "Mint Limit");
        require(_totalMinted() + quantity <= maxSupply, "Sold Out");
        _mint(msg.sender,quantity);
    }

    //Withdraw function
    function withdrawFunds() external onlyOwner nonReentrant {
      uint256 balance = address(this).balance;
      Address.sendValue(payable(msg.sender),balance);
    }

    //Metadata settings
    function setBaseURI(string calldata baseURI) external onlyOwner nonReentrant{
        _baseTokenURI = baseURI;
    }

    function _baseURI() internal view virtual override returns (string memory) {
        return _baseTokenURI;
    }

    //Airdrop to an address
    function airdropToAddress(address recipient,uint256 quantity) external onlyOwner {
        _mint(recipient, quantity);    
    }

    //pause the contract
    function pause() external onlyOwner{
        _pause();
    }

    //unpause the contract
    function unpause() external onlyOwner{
        _unpause();
    }
}


Hi, welcome to the community. :wave:

It seems like you do not pass a valid eth value when call the function mint(), and now, it seems like you have found this, and called it successfully. Congrats!

If there are no other more questions, I would like to close this topic.

What do you mean when you say that I don't pass a valid eth value?

Here:

Should call mint() with eth to meet the requirement:
require(msg.value >= quantity * mintPrice, "Insufficient Funds");

Ah! I had minted directly from Etherscan.
Thank you so much for the help, you can close this.

1 Like