Pieces Protocol

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

Duplicate Modifier in Function Definition

Summary

The divideNft function redundantly applies the onlyNftOwner(nftAddress, tokenId) modifier twice, which is unnecessary and impacts code clarity.

Vulnerability Details

The function has two instances of the onlyNftOwner(nftAddress, tokenId) modifier in its definition:

function divideNft(address nftAddress, uint256 tokenId, uint256 amount)
onlyNftOwner(nftAddress, tokenId)
onlyNftOwner(nftAddress, tokenId)
external {

Applying the same modifier twice does not add additional security but increases the cost of gas and creates confusion for developers and auditors.

Impact

The redundant modifier leads to higher gas usage for users interacting with this function. While it does not create a direct security risk, it decreases the efficiency and maintainability of the code.

Tools Used

Manual code review.

Recommendations

Remove the redundant onlyNftOwner(nftAddress, tokenId) modifier so that the function uses it only once.

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.