5 为什么我绑定了tokenid与上传到ipfs返回的哈希,在钱包中展示不了图片呢?

.png

请先 登录 后评论

最佳答案 2021-12-18 09:38

在ERC721 中, 通常 tokenURI 对应的是一个 JSON 文件,而不是一个图片。

比如以下 ERC721:

https://etherscan.io/address/0x5fba17737ee4809230946115c0e8a418bce70acc#readContract

tokenid 48 对应的信息为:

https://ipfs.io/ipfs/QmUdTKQoPaf4DHqn3yadxfvYpqj17hqJHq4Kuj2ThJ8JUK/48

其内容是

{"description": "Cosmic Cowgirls is a collection of 6,969 randomly generated space cowgirl NFTs on the Ethereum blockchain. The Cosmic Cowgirl collection embraces three prominent themes: cowgirls, space, and anime. Each cowgirl features bright colors, unique traits, and a signature cowgirl hat. The art is manga inspired and out-of-this-world! Visit our terms and conditions [here](https://docs.google.com/document/d/1JFTszqGZL74H8vtbWJWSeJgOdjqPl5il/edit?usp=sharing&ouid=117421707739321385411&rtpof=true&sd=true)", "name": "Cosmic Cowgirls #48", "image": "https://ipfs.io/ipfs/QmY8vfzbCHxCXcfKUSbxrBfZaWhpVeGGDE7dnLMTnLTis1/48.png", "attributes": [{"trait_type": "Background", "value": "Purple"}, {"trait_type": "Skin", "value": "Ivory"}, {"trait_type": "Eyes", "value": "Alien"}, {"trait_type": "Hair", "value": "Lavendar Wavy Bob"}, {"trait_type": "Cowgirl Hat", "value": "Red Zebra"}, {"trait_type": "Body", "value": "White Space Suit"}, {"trait_type": "Accessories", "value": "Neon Cat"}, {"trait_type": "Mouth", "value": "Fangs"}]}

当前没有显示图片,也与钱包本身的实现有关系,你可以联系钱包咨询一下。

请先 登录 后评论

其它 0 个回答

  • 1 关注
  • 0 收藏,2224 浏览
  • 提出于 2021-12-17 16:27