Pieces Protocol

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

"nftAddress == address(0)" validation not needed in function divideNft of TokenDivider.sol

Summary

The validation "nftAddress == address(0)" is not needed in function divideNft of TokenDivider.sol

Vulnerability Details

function divideNft already has modifier onlyNftOwner which checks that "msg.sender != IERC721(nft).ownerOf(tokenId)".

In case of address(0) the modifier will not allow user to enter the function.

Hence the validation "nftAddress == address(0)" will not come into play.

Impact

Validation "nftAddress == address(0)" is redundant and doesnt come into play. It can be removed. This will reduce amount of code and save gas.

Tools Used

Manual Inspection.

Recommendations

Remove validation "nftAddress == address(0)" from function divideNft of TokenDivider.sol

Updates

Lead Judging Commences

fishy Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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