1

I can't figure out why I'm getting this odd string after the Token symbol on Opensea with this NFT that I minted. The smart contract is below.

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";

contract RizerNonRandom is ERC721URIStorage {
    uint256 public tokenCounter;
    constructor () public ERC721 ("RizerSeq", "RZRI"){
        tokenCounter = 0;
    }

    function createRizerNonRandom(string memory tokenURI) public returns (uint256) {
        uint256 newItemId = tokenCounter;
        _safeMint(msg.sender, newItemId);
        _setTokenURI(newItemId, tokenURI);
        tokenCounter = tokenCounter + 1;
        return newItemId;
    }
}

And here is what it looks like on Opensea.
enter image description here

2

This is taken from the token's metadata. You need to call tokenURI on your token, and see what the metadata that is being returned. OpenSea grabs the collection name and token name from there.

So the issue is with the "tokenURI" you supplied to createRizerNonRandom.

6
  • Oh thanks I will try this. How do I call tokenURI? Nov 23 at 3:45
  • 1
    You can go to Etherscan, go to your contract address, and if you verified the source code, in the Contract tab you can use "read contract" and "write contract" to call functions. Nov 23 at 5:56
  • 1
    I think you can use this tool: evmconnector.dev . Regarding verifying after the fact, it's possible but might not work. Try through etherscan website or hardhat-verify plugin. Nov 24 at 1:06
  • 1
    First of all amazing resource! evmconnector.dev was perfect, thank you so much for the link! I got the tokenURI but it looks fine... lol. It's just the perfectly formatted metadata... See: imgur.com/a/Oo7SIas Nov 25 at 10:52
  • 1
    Hmm you're right, it does look OK. Did you yourself add the the smart contract to OpenSea? If yes, you can edit it (pencil icon) and probably change this name. If not, you should add it from the Collections menu I think, you press the dots and do from smart contract. Try this. Nov 25 at 10:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.