简体   繁体   English

Opensea 未获取 ERC-1155 合约的元数据

[英]Opensea not picking up metadata for ERC-1155 contract

I have an ERC-1155 smart contract deployed to the Goerli tes.net.我在 Goerli tes.net 上部署了一个 ERC-1155 智能合约。 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 .我的合同继承自 OpenZeppelin ERC1155 合同并使用它的 uri function。我发起合同的 URI 的格式为 https://token-cdn-domain/{id}.json,如此所述。 I have one minted item with id=1 and the metadata file for this item is served from https://token-cdn-domain/0000000000000000000000000000000000000000000000000000000000000001.json.我有一个 id=1 的铸造项目,该项目的元数据文件从 https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000000000000000000001.json 提供。

Opensea does not pick up the metadata. Opensea 不获取元数据。

When I call the opensea validate endpoint I get the following:当我调用 opensea验证端点时,我得到以下信息:

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

The problem was apparently using an Infura URL for my metadata (https://...infura.io/ipfs/...).问题显然是使用 Infura URL 作为我的元数据 (https://...infura.io/ipfs/...)。 When I changed my metadata to have the ipfs link directly ( https://ipfs.io/ipfs/... ) it solved the problem.当我更改我的元数据以直接拥有 ipfs 链接( https://ipfs.io/ipfs/... )时,它解决了问题。

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.我猜它不起作用的原因是 Infura URL 重定向了请求,而 Opensea 显然不知道如何处理这个重定向。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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