简体   繁体   English

一次质押多个 ERC721 NFT

[英]Staking multiple ERC721 NFTs at once

I have an ERC721NFT contract/collection that is already deployed.我有一个已经部署的 ERC721NFT 合约/集合。 I am asked to stake them which i did by creating a new contract and implementing the onErc721Receive function. So far so good.我被要求通过创建新合同并实施 onErc721Receive function 来抵押它们。到目前为止一切顺利。 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.如果您从正确的收藏中发送 NFT,它会自动对其进行质押,然后让您随时领取奖励或取消质押您的 NFT。

However I am asked to implement staking of multiple NFTs at once.但是,我被要求同时实施多个 NFT 的质押。 From my understanding since the base contract was a base erc721 contract with no multiple send nor staking it shouldn't be possible.根据我的理解,因为基本合同是基本的 erc721 合同,没有多次发送,也没有下注,所以它不应该是可能的。

Is there a way to go around that and stake several NFTs at the same time?有没有办法绕过 go 并同时质押多个 NFT?

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如果您是在 Google 上找到这个答案并且目前正在开发合同的人,OpenZeppelin 的Multicall是一个有用的帮助合同,允许您在单个事务中执行多个操作:https://docs.openzeppelin.com/contracts/4 .x/utilities#multicall

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM