创建自己的NFT只能在自己的市场上出售

发布于 2025-02-12 12:36:45 字数 107 浏览 0 评论 0原文

我的NFT市场项目面临挑战。我如何使用以下规则来创建NFT,即这些NFT只能在我们自己的平台上出售,而可以在我们自己的平台上出售。从技术上讲是可能的,但是,我在这里需要一些帮助。

谢谢。

I'm facing a challenge with my NFT marketplace project. How I can create NFTs with the rule that those NFTs can only be sold on our own platform but others. Technically is possible, however, I need some help here.

Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

强辩 2025-02-19 12:36:45

是的,这可能是您必须在智能合约级别上维护映射或某种逻辑,以跟踪 to 地址属于您的ERC 721合同或不是。

transferFrom(from, to, tokenId)

就像有人在智能合约上铸造NFT时,您可以保存Minter的地址。在销售时,您可以在转换开始时有条件。

require(to == exists[to], "Warning, You are selling outside of the contract")

映射可以是这样的。存在映射(地址=>地址);

Yes this possible For that you have to maintain a mapping or some sort of logic on smart contract level to keep track of whether to and from address belong to your ERC 721 contract or not.

transferFrom(from, to, tokenId)

Like when someone mints NFT on your smart contract you can save the address of the minter. And at the time of selling of you can have a condition at the start of transferFrom like.

require(to == exists[to], "Warning, You are selling outside of the contract")

mapping can be something of like this. mapping(address => address) exists;

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文