Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: medium
Invalid

M-2 Use safeTransferFrom instead of transferFrom for ERC721 transfers

Summary

The transferFrom() method is used instead of safeTransferFrom() in the contract, which is not recommended due to potential safety concerns.

Vulnerability Details

OpenZeppelin's documentation discourages the use of transferFrom() and recommends using safeTransferFrom() whenever possible.
Given that any NFT can be used for the call option, there are a few NFTs that have logic in the onERC721Received() function, which is only triggered in the safeTransferFrom() function and not in transferFrom().

Impact

Using transferFrom() instead of safeTransferFrom() can lead to safety issues and unexpected behavior in certain NFTs that rely on the onERC721Received() function for additional logic.

Tools Used

Manual review

Recommendations

Call the safeTransferFrom() method instead of transferFrom() for NFT transfers. Note that the RapBattle contract should inherit the ERC721TokenReceiver contract as a consequence.

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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