Pieces Protocol

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

Unnecessary modifier in function

The divideNft function in TokenDivider.solredundantly applies the onlyNftOwnermodifier twice.

Impact:
Having the same modifier applied multiple times can lead to unexpected behavior, such as unnecessary gas consumption.

  • Found in src/TokenDivider.sol

function divideNft(
address nftAddress,
uint256 tokenId,
uint256 amount
)
external
onlyNftOwner(nftAddress, tokenId)
-> onlyNftOwner(nftAddress, tokenId)
{
if (nftAddress == address(0)) {
revert TokenDivider__NftAddressIsZero();
}

Recommended Mitigation:
Remove the second occurrence of onlyNftOwner to streamline the function.

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.