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?
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