The withdrawEgg
function calls eggNFT.transferFrom()
to transfer an NFT back to the depositor. However, this is not as safe as using safeTransferFrom()
, which ensures that the recipient can handle ERC721 tokens. If the recipient is a smart contract that does not implement the necessary interface to receive ERC721 tokens, the NFT can be stuck in the contract, leading to permanent loss.
The function withdrawEgg
uses transferFrom()
to transfer the NFT to the depositor. The problem is that transferFrom()
does not check whether the recipient is capable of handling ERC721 tokens. If the recipient is a smart contract that lacks the onERC721Received()
function, the transfer will fail silently, and the NFT will be stuck in that contract.
If the recipient is a smart contract that does not support ERC721 tokens, the NFT will be stuck and cannot be retrieved. This can lead to permanent loss of the token.
Manual Review
Use safeTransferFrom()
instead of transferFrom()
. This function ensures the recipient can handle ERC721 tokens and prevents NFTs from being stuck in incompatible contracts.
NFTs are transferred to contracts without onERC721Received implementation.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.