简体   繁体   中英

Opensea not picking up metadata for ERC-1155 contract

I have an ERC-1155 smart contract deployed to the Goerli tes.net. My contract inherits from the OpenZeppelin ERC1155 contract and uses its uri function. The URI I initiated the contract with is of the format https://token-cdn-domain/{id}.json as explained here . I have one minted item with id=1 and the metadata file for this item is served from https://token-cdn-domain/0000000000000000000000000000000000000000000000000000000000000001.json.

Opensea does not pick up the metadata.

When I call the opensea validate endpoint I get the following:

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

The problem was apparently using an Infura URL for my metadata (https://...infura.io/ipfs/...). When I changed my metadata to have the ipfs link directly ( https://ipfs.io/ipfs/... ) it solved the problem.

I'm guessing the reason it wasn't working was the Infura URL redirects the request and Opensea apparently doesn't know how to handle this redirect.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM