Incorrect metadata load

Hello,

I have two problems getting the metadata of some NFTs. The first is with the URL returned by your API. The contract returns a parameterized URL, of type <PROTOCOL>://<DOMAIN>/{id}.

This contract has only two Ids, 1 and 2, but what your api returns is (look at the id part):

https://ipfs.moralis.io:2053/ipfs/bafybeiaooy4z4wh2r4msuil7edzxlo7rp327fdn6henbvue2im3p3q7mlu/0000000000000000000000000000000000000000000000000000000000000001

The second problem is that even if you remove the string of 0s and only leave the 1:

https://ipfs.moralis.io:2053/ipfs/bafybeiaooy4z4wh2r4msuil7edzxlo7rp327fdn6henbvue2im3p3q7mlu/1

I get the following error:

On the other hand, if I try to access with another gateway, for example:

https://gateway.pinata.cloud/ipfs/bafybeiaooy4z4wh2r4msuil7edzxlo7rp327fdn6henbvue2im3p3q7mlu

I get an answer.

Can you fix it please?

Thank you so much

We are intentionally blocking the ipfs urls that start with /ipfs/bafy for our ipfs gateway.
We will have to find a solution for this, I’ll report this to the team.

here the issue is related to ERC1155 standard, the erc1155 standard user that type of id with 64 leading zeros and that is why we consider that as being the token uri

Ok, thank you.

I forgot to put in the previous post, that I think that as a consequence of that, not only can I not access the URL, but also the metadata that comes in the API response is null

ok. you are right. thank you!

When token id is 0, your API return URI without ID (the same contract as before):

what do you get on chain for token id 0 as token uri? (that uri function called with token id 0 as you did in the original post in a block explorer)

Same as for id 1:

can you paste the contract address?

0xa3f967e4941a2a78caf82e18eeb2143188382c74

for tokenUri function I get this error whey I try with token id 0 here (https://polygonscan.com/address/0xa3f967e4941a2a78caf82e18eeb2143188382c74#readContract):

 string Error: Returned error: execution reverted: ERC721: invalid token ID

Sorry, I made a mistake and put the wrong contract. Is this:

0xb033b6D2DEFf926567ccBA11907F2F0d2968Cd07

it looks like it works now if you try resync metadata with token uri parameter

ok, thank yo so much!

1 Like