Missing Image of NFT collection on opensea

I created an ERC721 token on the Ethereum testnet (Rinkeby), a collection of 20 NFTs for now. I then proceeded to reserve some for myself so I could check it out on Opensea before deploying it to the Ethereum Mainnet. The tokens showed in my collection on Opensea but the images for them were not showing. I checked the CIDs for the images and json files and found them to be correct. The functions used to set the tokenURI are shown below.

 function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
        require(_exists(_tokenId), 'ERC721Metadata: URI query for nonexistent token');
        string memory _tokenURI = _tokenURIs[_tokenId];

        if (revealState == false) {
            return hiddenMetadataUri;
        } else {
            return _tokenURI;
        }

    }

     function setTokenURI(uint256 _tokenId) public virtual onlyOwner{
        require(_exists(_tokenId), 'ERC721Metadata: URI query for nonexistent token');
        uint img_no = _tokenId + 1;
        string memory tokenid = Strings.toString(img_no);
        string memory currentBaseURI = _baseURI();
        string memory result = '';

        if (bytes(currentBaseURI).length > 0) {
            result = string(abi.encodePacked(currentBaseURI, tokenid, uriSuffix));
        } else {
            result = string(abi.encodePacked(tokenid, uriSuffix));
        }

        _tokenURIs[_tokenId] = result;
    }

Any suggestions would be highly appreciated

can you share the opensea path

happily, https://testnets.opensea.io/collection/humaverse-v2

Token Uri is not getting recognized at opensea. There is some issue with the token uri standard.

https://testnets-api.opensea.io/asset/0xbd198a694c5c33db708ad5ed47dc808b80f0be29/0/validate/

Try implementing the contractURI function as shown in this doc

what do you get when you query the contract on chain for the token_uri?

please,
how do you do that?

isnt that the same as tokenURI?

it looks like this is the token_uri returned by the smart contract for token_id 0:

ipfs://QmX6eUiy5ii9b6xnTReR9ni2sbzrHHETcxa8xJZpju4C8G/hidden.json

The revealed state is false, so it led to the hidden metadata. Iโ€™ll set the revealed state to true in a bit. I see the issue wrt to the hidden metadata. The server I used to host the image is down

Iโ€™ve changed the state

by the way, how did you find that out? thatโ€™s impressive. Please check again, thanks a lot

now is: ipfs:/hash/1.json

however, no images are shown in opensea

Can you try to deploy the contract again, with the right url form the first time.