Pieces Protocol

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

Redundant Modifier Usage in divideNft Function

Summary

The divideNft function has redundant usage of the onlyNftOwner modifier, which is applied twice on the same function. This duplication does not provide any additional functionality and may confuse developers or auditors.

Vulnerability Details

The function divideNft applies the onlyNftOwner modifier twice on the same function signature: Modifiers are designed to enforce conditions before the function executes.

Impact

While not a major concern in this case, adding unnecessary modifier calls increases the overall complexity of the contract, which may result in slightly higher gas consumption than necessary.

Tools Used

Manual Review / Slither

Recommendations

Remove Duplicate Modifier: To fix the issue, remove one of the onlyNftOwner(nftAddress, tokenId) modifiers from the function. The modifier is only needed once to ensure that the caller is the owner of the NFT.

Updates

Lead Judging Commences

fishy Lead Judge 8 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.