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

[HUFF X SOLIDITY] ERC721 token does not implement `safeTransferFrom()`

Summary

There is a vulnerability as the codebase does not implement the safeTransferFrom() function, which is a standard in ERC721 contracts to safely transfer tokens.

Vulnerability Details

The vulnerability simply lies in the absence of the safeTransferFrom() function. This function is designed to safely transfer tokens, ensuring that the receiving address is capable of handling the token. A contract is marked as being able to “handle” NFTs if it has a function onERC721Received() which returns the magic bytes4 value 0x150b7a02. This is the function selector of onERC721Received() which not the case in the Huff implementation.

Impact

Without this function, tokens could be transferred to contracts that are not designed to handle them, which could result in the tokens being locked effectively destroying it.

Tools Used

Manual review.

Recommendations

Use ERC721.huff contract from Huffmate.

Updates

Lead Judging Commences

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

Components of ERC721 not properly (or at all) implemented in HUFF

Support

FAQs

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