The withdrawEgg() function in EggVault.sol uses transferFrom to transfer NFTs back to the depositor. If the recipient address is a contract that does not implement onERC721Received, the transfer will silently succeed, but the contract will not be able to receive or interact with the token — causing it to be lost.
The transferFrom function performs a raw transfer of the NFT without checking whether the recipient address can handle ERC721 tokens. This creates a dangerous edge case:
If the depositor is a smart contract that does not implement onERC721Received, the token will be transferred but not safely received, violating the ERC721 standard.
Because the contract marks storedEggs[tokenId] = false and deletes the depositor info before the transfer, the token becomes unrecoverable if the transfer fails silently.
OpenZeppelin recommends using the safeTransferFrom function to ensure that ERC721 tokens are only sent to compliant addresses. This function includes an internal call to onERC721Received and reverts if the recipient doesn't support it.
Tokens can be permanently stuck in the vault.
Off-chain tracking may show the token as withdrawn, but the depositor will not actually receive it.
Users may lose access to assets due to silent failures.
Manual Code Review
Foundry Test Suite
Replace the raw transferFrom with safeTransferFrom in withdrawEgg():
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.