1

I am trying to buld ERC721 to my NFT. But the NFT not show in NFT opensea profile Collection. I am using openzeppelin library and the basic project is using Hashlib labs.

The skenario is when i mint token from lagendary collection the token id start from 1 to 22, epic from 56 to 1000, and rare from 1001 to 3000.

the rare is public mint so every one can mint the NFT. you can check my smart contract on arbitrum goerli testnet. here the link: https://goerli.arbiscan.io/address/0x748C39B202bfBeE1ba31b33ddcF78AB46CdE9903

Can you help me what is going on? why my NFT is not show in opensea collection profile?

1 Answer 1

0

I check your contract code..

    function tokenURI(
    uint256 _tokenId
) public view virtual override(ERC721) returns (string memory) {
    if (!_exists(_tokenId)) revert NonExistToken();
    string memory currentBaseURI = _baseUriAvatar;
    return
        bytes(currentBaseURI).length > 0
            ? string(
                abi.encodePacked(
                    currentBaseURI,
                    _tokenId.toString(),
                    ".json"
                )
            )
            : "";
}

string private _baseUriAvatar = ""; // you are passing base_uri as null

So when you mint an NFT, opensea check for TokenUri. The read function which will be null in your case.. so the opensea thinks it as non NFT collection..

1
  • 2
    Thank you for your answer sir, i think i already solve my problem. It is on ownerOf() function that has error stack to deep. So i need to delete it cause ERC721 from openzeppelin is already set to public. Glad to be helped by you. Sep 7, 2023 at 10:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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