DEV Community

Discussion on: Deploying Regenerative NFTs on Polygon

Collapse
 
benm4nn profile image
benm4nn

After a bit more digging on Polygonscan it looks like the token URI isn't returning the token id when queried...
It seems the tokens ID counter isn't setting a newItemId here in _setTokenURI...?

function mintItem(address player, string memory tokenURI)
public
onlyOwner
returns (uint256)
{
_tokenIds.increment();
uint256 newItemId = _tokenIds.current();
_mint(player, newItemId);
_setTokenURI(newItemId, tokenURI);
return newItemId;
}