如何铸造独特的NFTS
我正在使用ERC721智能合约(带有ERC721URISTROADES扩展名)进行NFT项目,用户可以在其中造成独特的NFT。
我已将NFT的JSON Metadata(用于Tokenuris)上传到IPF。
在DAPP(使用React)中,将有一个薄荷按钮,用户单击它以铸造随机NFT。 尽管开发了薄荷随机NFT的逻辑,但我仍在挣扎。 我已将包含所有Tokenuris的文本文件上传到IPF,然后在我的DAPP中的Mint函数中读取此文件,其中获取随机的Tokenuri然后进行铸造。 这里的问题是,我找不到在IPFS上选择的Tokenuri上放置标志的方法,因此下次称为Mint功能时,它根本不会得到Tokenuri。
我不确定这是否是完成所需的工作(薄荷独特的NFT)的正确方法,
这将不胜感激。
I'm working on a NFT project using ERC721 smart contract (with ERC721URIStorage extension) where user can mint unique NFTs.
I have uploaded NFT's json metadata's (used for TokenURIs) to IPFS.
In the dapp (using react), there will be a mint button where the user clicks on it to mint a random NFT.
I'm struggling though with developing the logic of minting random NFT.
I have uploaded to IPFS a text file containing all the TokenURIs, and then reading this file in the mint function in my dapp where a random TokenURI is fetched and then minted.
The issue here is that I couldn't find a way to put a flag on the selected TokenURI on IPFS so next time mint function is called it will not get this TokenURI at all.
I'm not sure if this is the right way to accomplish what I need (mint unique NFTs)
Any help or hint here will be much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
传统上,令牌是依次铸造的,因此从0、1、2到10,000。许多人只需将
tokenid
附加到指向文件夹或IPFS文件夹的baseuri
。因此,您的令牌将为ipfs://< cid>/0
,ipfs://< cid>/1
,ipfs:// ipfs://< cid>/2
,依此类推。这样,您就不需要标记每个“二手”的tokenuri。
Tokens are traditionally minted sequentially, so from 0, 1, 2 to 10,000 for example. Many people simply append the
tokenId
to abaseURI
that points to a folder or IPFS folder. So your tokens would beipfs://<CID>/0
,ipfs://<CID>/1
,ipfs://<CID>/2
, and so on.This way, you don't need to flag each 'used' tokenURI.