Pieces Protocol

First Flight #32
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: medium
Invalid

Additional check for nftAddress

Summary

There is no check to see if the nftAddress is really linked to a NFT address.

Vulnerability Details

in the divideNft function there is no check of the nftAddress to ensure it is a NFT address or not.

Impact

Invalid Transfers: The safeTransferFrom function call will fail if the address does not support the IERC721 interface, causing the transaction to revert.

Tools Used

N/A

Recommendations

To prevent these issues, you should verify that the provided address supports the IERC721 interface before proceeding with any operations. :

Missing NFT contract validation:

try IERC721(nftAddress).supportsInterface(0x80ac58cd) returns (bool isNFT) {
if(!isNFT) revert TokenDivider__NotAnNFTContract();
} catch {
revert TokenDivider__NotAnNFTContract();
}
Updates

Lead Judging Commences

fishy Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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