The minted NFT item and detail not displayed on test net Opensea while rinkeby network working properly . pls kindly advise where gone wrong
https://testnets.opensea.io/collection/squirrel-eqf09pjm5s
https://mumbai.polygonscan.com/address/0xEE21cF8F15e487968706C5bbD15837c50D1aB2a1
contract.sol
constructor() ERC721("Squirrel", "SRL") {
_baseTokenURI = "QmSrH7nkakj9T7FUKSD48ENcJusvnaTdmdJV9AXhLPHNst/"; //metadata url
the ipfs metadata and images file working fine.
json = ipfs/QmSrH7nkakj9T7FUKSD48ENcJusvnaTdmdJV9AXhLPHNst/0
{"name": "Squirrel #0", "description": "Squirrel NFT . limited edition 1,000!", "image": "ipfs://QmczVxRT66QqC7HeYh6ZnT8QLd2qoAiqW8DfhX4ghG7bVw/0.png", "attributes": [{"trait_type": "Background", "value": "blue"}, {"trait_type": "Body", "value": "maroon"}, {"trait_type": "Eyes", "value": "standard"}, {"trait_type": "Clothes", "value": "blue_dot"}, {"trait_type": "Held Item", "value": "nut"}]}
images :
ipfs.io/ipfs/QmczVxRT66QqC7HeYh6ZnT8QLd2qoAiqW8DfhX4ghG7bVw/0.png
Best Answer
Let us first understand how Opensea reads your contract to retrieve the meta-data –
From Opensea's documentation
Further:
Further for IPFS specific
Now let us see what your contract returns the tokenURI for a minted token (in this case, tokenID: 0)
As you can see, your contract is returning
QmSrH7nkakj9T7FUKSD48ENcJusvnaTdmdJV9AXhLPHNst/0
which is incomplete since it does not contain a base (ipfs://
) to resolve from.Your
tokenURI
method should return the complete resolvable IPFS URI to your JSON file:ipfs://QmczVxRT66QqC7HeYh6ZnT8QLd2qoAiqW8DfhX4ghG7bVw/0
Additionally, you should make sure your JSON file is query-ready by manually visiting the IPFS URL through any IPFS enabled browser.
Here's an example of doodle contract returning URI: