I am getting below error while running the smart contract:
DeclarationError: Undeclared identifier. --> @openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol:35:9: | 35 | _requireOwned(tokenId); | ^^^^^^^^^^^^^
Smart contract code:
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
contract RealEstate is ERC721URIStorage {
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
constructor() ERC721("Real Estate", "REAL") {}
function mint(string memory tokenURI) public returns (uint256) {
_tokenIds.increment();
uint256 newItemId = _tokenIds.current();
_mint(msg.sender, newItemId);
_setTokenURI(newItemId, tokenURI);
return newItemId;
}
function totalSupply() public view returns (uint256) {
return _tokenIds.current();
}
}
I tried removing the _requireOwned(tokenId); from ERC721URIStorage.sol but still getting the error.
Any help would be appreciated.
I tried removing the _requireOwned(tokenId); from ERC721URIStorage.sol but still getting the error.
Also tried adding the _requireOwned(tokenId) into my smart contract but it s throwing same error.