0

I have deployed an NFT collection here and have set the tokenURI of the ERC721 contract using the below code.

var tokenURI = await bento_collection.tokenURI(1, {from: accounts[1]});
console.log("Token URI is " + tokenURI);

The output of the code, for token #1 is:

Token URI is http://sushibento.club/sushis/1

This URL leads to metadata, which should be picked up by Opensea. If you go to the URL in a browser, you can see that valid JSON is given by the URL:

{"name":"Sushi #1", "description":"Fresh Sushi Bento Club Sushi Character #1. The owner of this asset also owns the full commercial rights of the image itself and the original rights in the metaverse.", "image":"https://sushibento.club/assets/img/egg.png", "external_url":"https://sushibento.club/assets/img/egg.png", "attributes":[{"trait_type":"Sushi Type","value":"Unhatched Sushi Egg"}]}

However, opensea is not picking up the metadata. I can see that it isn't because on the Opensea website, the placeholder image is still there, and the NFT attributes are not displayed. I have refreshed the metadata through their site a few times over the last few hours, but it has not yet worked.

I cannot check the metadata using their meta data validator, because it does not support the Polygon chain (No idea why). Why is my metadata not being picked up by opensea? Or is there something wrong with it.

2
  • The URL you linked in "meta data validator" is incorrect Commented Dec 14, 2021 at 14:50
  • It seems the 500 error is gone, but still not compatible with MATIC network annoyingly
    – Dev Oskii
    Commented Dec 14, 2021 at 14:57

2 Answers 2

0

Sometimes OpenSea can even take a few hours to refresh the metadata. Few things you can try -

  1. Upload it to Ethereum Rinkeby testnet where you can use the API to check whether your metadata is valid.

  2. Did you press the "refresh metadata" button on the item at OpenSea?

  3. I would try just as a sanity check having the URI be in HTTPS and not HTTP

  4. Wait more time for OpenSea to update :\

4
  • The URI has to be HTTP. As per their docs ...should return an HTTP or IPFS URL...
    – Dev Oskii
    Commented Dec 14, 2021 at 15:29
  • So I guess HTTP should also work, but personally I think all the URIs I've seen in the past were HTTPS. Commented Dec 14, 2021 at 15:39
  • It says URI must be http or IPFS, not https
    – Dev Oskii
    Commented Dec 14, 2021 at 16:49
  • ...as I said, I've seen contracts with HTTPS, so it can be HTTPS also. Commented Dec 15, 2021 at 1:22
0

It turned out to be a header issue.

I was serving content as HTML, but I needed Content-Type: application/json; charset=utf-8. This is a required header for the server to correctly send the metadata.

This is not mentioned in their documentation for some reason. I am using PHP, so the following line solved the issue for me.

header('Content-Type: application/json; charset=utf-8');

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.