Pieces Protocol

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

Redundant Modifier Application in divideNft Function

Summary

The onlyNftOwner modifier is applied twice in the divideNft function, which results in unnecessary repetition and does not provide any additional functionality. This redundancy can lead to confusion and code maintenance issues.

Vulnerability Details

The onlyNftOwner modifier should only be applied once in the function signature. The modifier checks if the caller is the owner of the specified NFT and prevents unauthorized access. Applying it multiple times does not enhance security or functionality and is unnecessary.

function divideNft(address nftAddress, uint256 tokenId, uint256 amount)
onlyNftOwner(nftAddress, tokenId) onlyNftOwner(nftAddress, tokenId)
external {
// function logic here
}

Impact

The modifier onlyNftOwner is applied twice in the function signature. This is redundant and can lead to confusion for developers working with the codebase.

Tools Used

manual review

Recommendations

Remove the duplicate application of the onlyNftOwner modifier in the function definition.

function divideNft(address nftAddress, uint256 tokenId, uint256 amount)
onlyNftOwner(nftAddress, tokenId) external {
// function logic here
}
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.