如何将NFT特征牢固地传递给智能合约

发布于 2025-01-31 18:59:34 字数 234 浏览 2 评论 0原文

我有一份NFT订立合同,该合同根据NFT的财产稀有性而发出奖励。四个属性层是1,2,3和4。

当用户单击“ stakenft”(Tokenid,nfttier)时,我使用Tokenid将元数据JSON属性从IPF中拉出,并将NFT层发送到智能合约。

这里的问题是,当这在我们网站的用户界面上工作时,任何人都可以直接使用etherscan并输入不在其NFT中的层,以赚取更多的奖励。

如何基于代币的链核实NFT层?

I have an NFT staking contract that issues rewards based on the property rarity of the NFT staked. The four property tiers are 1,2,3 and 4.

When a user clicks stakeNFT(tokenId, nftTier), I use the tokenId to pull the metadata json property from IPFS and send the NFT tier to the smart contract.

The issue here is while this works on the user interface of our website, anyone can use Etherscan directly and input an tier that isn’t in their NFT so as to earn more rewards.

How do I verify the NFT tier based on the tokenId onchain?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文