一次立即设置多个ERC721 NFT
我有一个已部署的 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你是对的。您不能按照他们描述的方式执行此操作。
如果您在 Google 上找到了此答案并且目前正在开发合约,OpenZeppelin 的
Multicall
是一个有用的帮助合约,它允许您在单个事务中执行多个操作:https://docs.openzeppelin.com/contracts/4.x/utilities#multicallYou 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