一次立即设置多个ERC721 NFT

发布于 2025-01-21 02:03:42 字数 250 浏览 2 评论 0原文

我有一个已部署的 ERC721NFT 合约/集合。 我被要求对它们进行质押,我通过创建一个新合约并实现 onErc721Receive 函数来完成。 到目前为止,一切都很好。 如果您从正确的集合中发送 NFT,它会自动质押它,然后让您随时领取奖励或取消质押您的 NFT。

然而,我被要求同时实施多个 NFT 的质押。 根据我的理解,由于基础合约是基础 erc721 合约,没有多次发送或质押,所以这是不可能的。

有没有办法绕过这个问题,同时质押多个 NFT?

I have an ERC721NFT contract/collection that is already deployed.
I am asked to stake them which i did by creating a new contract and implementing the onErc721Receive function.
So far so good.
If you send a NFT from the right collection it automatically stakes it and then let you claim your rewards or unstake your NFTs at any time.

However I am asked to implement staking of multiple NFTs at once.
From my understanding since the base contract was a base erc721 contract with no multiple send nor staking it shouldn't be possible.

Is there a way to go around that and stake several NFTs at the same time?

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

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

发布评论

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

评论(1

世态炎凉 2025-01-28 02:03:42

你是对的。您不能按照他们描述的方式执行此操作。

如果您在 Google 上找到了此答案并且目前正在开发合约,OpenZeppelin 的 Multicall 是一个有用的帮助合约,它允许您在单个事务中执行多个操作:https://docs.openzeppelin.com/contracts/4.x/utilities#multicall

You are correct. You cannot do this in the manner they have described.

If you're someone who found this answer on Google and are currently developing a contract, OpenZeppelin's Multicall is a useful helper contract that allows you to perform multiple actions in a single transaction: https://docs.openzeppelin.com/contracts/4.x/utilities#multicall

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