1

Hey so I'm new to nft dev and decided I'll give it a try. I'm following the Hashlips NFT tutorial however it seems I am not getting the same results as him.

For some reason the "hidden"/"placeholder" image isnt showing up on opensea.

When I use the tokenURI call on remix for nft id: 1 I get this:

{
"0": "string: ipfs://QmWWfLiN8L6Hqa61BjL6aJ8SCTRXQxGfkAcYCvqttZqZ16/hidden.json"
}

Here is a copy of the JSON

    [
      {
        "name": "Best NFT Ever",
        "description": "Just simply the best ever NFT",
        "image": "ipfs://QmY34733FazEVvejVkHMkGXHB5utBZPcj9AtYvXatvTWwx/hidden.png",
        "custom_fields": {
          "total_mining_power": 220,
          "token_award": 696
        },
        "attributes": [],
        "external_url": "https:/bestnftever.com"
      }
    ]

However when I use the token meta validator (https://testnets-api.opensea.io/asset/0x59b5ed04b9bbf36d9522c900d3d2cb10dce7f768/1/validate/) I get:

    HTTP 200 OK
    Allow: OPTIONS, GET
    Content-Type: application/json
    Vary: Accept

    {
        "valid": true,
        "token_uri": null,
        "errors": []
    }

I feel like I'm missing something small and stupid but I can't figure out what it is. Any ideas?

Here is the link to the NFT on OpenSea: https://testnets.opensea.io/assets/goerli/0x59b5ed04b9bbf36d9522c900d3d2cb10dce7f768/1

P.S: I know its the holiday period so I am thankful in advance for the help guys and apologies if its a noobie question/mistake. I would really appreciate detailed answers so I can learn from and understand more how to debug etc...

P.S.S This project is new, however I have been trying this for a few days with different accounts incase opensea took time to get the data however it still isnt

1
  • it's hard to answer if you don't give any real file you uploaded. For privacy concern you can just upload a blank test.jpg img to ipfs instead of an invalid link like that.
    – minhhn2910
    Dec 29, 2022 at 8:47

2 Answers 2

1

With limited information about the real file, I can only think of two possibilities at the moment:

  1. the IPFS file may not work (e.g. the real link of ipfs://..../hidden.png may be invalid or some delay on Opensea side that you have to wait them a bit to fetch the file.
  2. the json format may not be correct: the json string you printed out has array [], are you sure it is a valid format?. A valid BAYC 82 metadata is like this object without array []. You may need to remove the square brackets.
{
 "image":"ipfs://QmQU87VfXFej5WQdP8VUNGf1wrYhykcREPGBo37ox7zcGu",
 "attributes":[
  {"trait_type":"Clothes","value":"Service"},
  {"trait_type":"Earring","value":"Silver Hoop"}, 
  {"trait_type":"Background","value":"Army Green"}, 
  {"trait_type":"Mouth","value":"Jovial"}, 
  {"trait_type":"Fur","value":"Cream"},
  {"trait_type":"Eyes","value":"Sad"}
 ]
}

So your json may need to be like this

   {
        "name": "Best NFT Ever",
        "description": "Just simply the best ever NFT",
        "image": "ipfs://your_ifps_file",
        "custom_fields": {
          "total_mining_power": 220,
          "token_award": 696
        },
        "attributes": [],
        "external_url": "https:/bestnftever.com"
   }
0

It turns out that I should be using:

  {
    "name": "Best NFT Ever",
    "description": "Just simply the best ever NFT",
    "image": "ipfs://QmY34733FazEVvejVkHMkGXHB5utBZPcj9AtYvXatvTWwx/hidden.png",
    "custom_fields": {
      "total_mining_power": 220,
      "token_award": 696
    },
    "attributes": [],
    "external_url": "https:/bestnftever.com"
  }

Not

[
  {
    "name": "Best NFT Ever",
    "description": "Just simply the best ever NFT",
    "image": "ipfs://QmY34733FazEVvejVkHMkGXHB5utBZPcj9AtYvXatvTWwx/hidden.png",
    "custom_fields": {
      "total_mining_power": 220,
      "token_award": 696
    },
    "attributes": [],
    "external_url": "https:/bestnftever.com"
  }
]

My JSON is an array, should have been an object. facepalm

1
  • So my answer was correct and you didn't approve it
    – minhhn2910
    Dec 30, 2022 at 14:58

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.