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; }
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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;
}