坚固性:从市场合同中调用NFT合同的函数,只有市场才能访问
我正在做一个NFT市场,我必须实施每次将NFT出售时,这些图像随机散发。 市场具有购买NFTS的功能性,因此我们已经参考了NFTS智能合约。当调用函数buy()时,它将调用NFT智能合约中的Tranvers()和Suffle()。但是我只希望市场致电Suffle(),因此我决定添加一个要求检查呼叫的地址是否等于市场地址的要求。 问题在于,为了部署市场,我需要NFT地址,而Deverigig则需要NFT合同,我需要市场地址。 我该如何解决?是智能合约的逻辑问题还是有一种方法可以以这种方式解决它? 谢谢你!!
I'am doing a NFT marketplace, and i have to implement that everytime a NFT is sold the images shuffle.
The Marketplace has the functionallity to buy the NFTs so we have referenciate tha NFTs smart contract. When the function buy() is called, it calls the transfer() and suffle() from NFT smart contract. But i want only the marketplace to call the suffle(), so I decided to add a require that checks if the address that is calling is equal to the Marketplace address.
The problem is that for deploying the Marketplace i need the NFT address and the same for deployig the NFT contract i need the Marketplace address.
How can i solve this? Is a problem of the logic of the smart contract or there is a way to solve it in this way?
Thank you!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用设置器函数在部署后设置依赖项地址。
例子:
You can use a setter function to set the dependency address after deployment.
Example:
我写了一个简单的框架,应该对您有所帮助。 :)
I wrote a simple framework that should help you. :)