Pieces Protocol

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

Redundant Usage of onlyNftOwner Modifier in divideNft Function

Summary

The divideNft function redundantly applies the onlyNftOwner modifier twice for the same parameters. This duplication serves no additional security purpose, as the modifier is already ensuring the sender is the owner of the specified nftAddress and tokenId. This results in unnecessary gas consumption and an inefficient implementation.

Vulnerability Details

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

Impact

  1. Each call to the onlyNftOwner modifier introduces additional gas consumption.

  2. Users calling this function will incur higher transaction costs.

Tools Used

Manual

Recommendation

Apply only single check in this function.

Updates

Lead Judging Commences

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