title: Gas estimation errored with the following message (see below). The transaction execution will likely fail
body: <p>Gas estimation <strong>errored</strong> with the following message <strong>(see below)</strong>. The transaction execution will likely fail. Do you want to force sending?</p>
  <pre><code>Internal JSON-RPC error. { &quot;code&quot;: -32000, &quot;message&quot;: &quot;gas required exceeds allowance (20000000)&quot; }
  </code></pre>
  <p><strong>The SmartContract Program  is</strong></p>
  <pre><code>pragma solidity ^0.8.0;
  //SPDX-License-Identifier: MIT
  
  import &quot;https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol&quot;;
  import &quot;https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol&quot;;
  import &quot;https://github.com/1001-digital/erc721-extensions/blob/main/contracts/RandomlyAssigned.sol&quot;;
  
  contract CrazyBananaUnion is ERC721, Ownable, RandomlyAssigned {
    using Strings for uint256;
    uint256 public currentSupply = 0;
  
    string public baseURI = &quot;https://ipfs.io/ipfs/QmfRTLygidHaaYHKkhcNojm7YdEEmX/&quot;;
  
    constructor() 
  ERC721(&quot;CrazyBananaUnion&quot;, &quot;CBU&quot;)
  RandomlyAssigned(10000,1) // Max. 10000 NFTs available; Start counting from 1 (instead of 0)
  {
     for (uint256 a = 1; a &lt;= 8000; a++) {
          mint(msg.sender);
      }
  }
  
    function _baseURI() internal view virtual override returns (string memory) {
  return baseURI;
    }
  
  
    function mint (address _to)
    public
    payable
    {
    require( tokenCount() + 1 &lt;= totalSupply(), &quot;YOU CAN'T MINT MORE THAN MAXIMUM SUPPLY&quot;);
    require( availableTokenCount() - 1 &gt;= 0, &quot;YOU CAN'T MINT MORE THAN AVALABLE TOKEN COUNT&quot;); 
    require( tx.origin == msg.sender, &quot;CANNOT MINT THROUGH A CUSTOM CONTRACT&quot;);
  
    if (msg.sender != owner()) {  
      require( msg.value &gt;= 0.001 ether);
    }
    
    uint256 id = nextToken();
      _safeMint(_to, id);
      currentSupply++;
    }
  
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
  require(
    _exists(tokenId),
    &quot;ERC721Metadata: URI query for nonexistant token&quot;
  );
  
  string memory currentBaseURI = _baseURI();
  return bytes(currentBaseURI).length &gt; 0
      ? string(abi.encodePacked(currentBaseURI, tokenId.toString(), &quot;.json&quot;))
      : &quot;&quot;;
    }
  
    function withdraw() public payable onlyOwner {
  require(payable(msg.sender).send(address(this).balance));
    }
  }
  </code></pre>