Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: medium
Valid

Contract can't receive NFTs sent with safeTransferFrom method

Summary

Contract can't receive NFTs sent with safeTransferFrom method

Vulnerability Details

The contract under consideration is designed to receive and store ERC721 tokens. However, certain smart wallets or contracts might utilize the safeTransferFrom method to send an NFT. The safeTransferFrom method checks for the implementation of the onERC721Received method when the recipient is a contract. This is to ensure that the recipient contract can appropriately handle ERC721 tokens.

Impact

This might lead to loss of value as NFTs sent wont be received.

Tools Used

Manual

Recommendations

Therefore, it's essential for the contract to extend the ERC721Holder contract from OpenZeppelin. The ERC721Holder contract has the onERC721Received method implemented, which allows the contract to correctly receive and store ERC721 tokens sent using safeTransferFrom. Do note that the current OZ implementation ERC721 includes a safeTransferFrom function.

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

Lacks onERC721Received implementation

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.