Contract URI not fetched - shows "Untitled Collection" in metamask

I have created an ERC1155 smart contract which works perfectly fine on opensea - it finds the uri and the contractURI well. However, when I add the NFT on testnet to metamask, while the NFT data is accurate, the collection data seems to not be fetched. It puts the NFT in an Untitled Collection tab.

Here is the smart contract function:

    function contractURI() public view returns (string memory) {
return theContractUri;
}

Here is how the contact URI is formatted:

    {   

"collection" :{

    "name": "Farmverse Farmers",
    "image": "ipfs://bafkreic57ucjp6yrfjg4jt7x2533vm4vismg5gxm4phy4wkhbqlzydfvde/"

},
"collectible" :{

    "name": "Farmverse Farmers",
    "image": "ipfs://bafkreic57ucjp6yrfjg4jt7x2533vm4vismg5gxm4phy4wkhbqlzydfvde/"

},
"contract" :{

    "name": "Farmverse Farmers",
    "image": "ipfs://bafkreic57ucjp6yrfjg4jt7x2533vm4vismg5gxm4phy4wkhbqlzydfvde/"

},
    "name": "Farmverse Farmers",
    "description": "“The Farmers” is an NFT collection that contains 5555 unique, computer-generated little characters.  Besides being collectibles these tokens are also your key to unlocking the wonders of Farmverse – a multiplayer play-to-earn online video game.",
    "image": "ipfs://bafkreic57ucjp6yrfjg4jt7x2533vm4vismg5gxm4phy4wkhbqlzydfvde/",
    "external_link": "https://farm-verse.com"
}

So I do not understand, where is metamask trying to get the collection name from? Where shuld I put it in my contractURI or regular tokenURI in order for the collection name and image to show up in metamask mobile.

Thanks in advance!

Hey @tubvilius, welcome to the MetaMask community! :fox_face:

MetaMask uses third-party APIs to detect NFT metadata. Your NFT is on testnet which OpenSea does not support which is why it does not display on your MetaMask wallet.

1 Like

Hi! It seems that you have misunderstood my question. You are saying that my NFT is on testnet which OpenSea does not support, but clearly I have stated that everything appears well on opensea and it is only MetaMAsk which seems to be problematic.

What did you mean? Did you mean that MetaMask does not support a testnet or what?
thanks

Is your NFT on testnet, and are you looking for your NFT on testnet in MetaMask?

If so, then the NFT will not be displayed because it is on testnet and OpenSea API currently only supports it on Ethereum mainnet.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.