Pieces Protocol

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

Excess gas in `TokenDivider::divideNft()` function due to repeated modifier

Summary

Excess gas in TokenDivider::divideNft() function due to repeated modifier

Vulnerability Details

The onlyNftOwner()modifier conducts checks that verify that only the owner of an NFT can divide it. But, this modifier is repeated in the same function, thus conducting the checks twice.

Impact

Any gas used to conduct the checks in the first modifier run, is used again. basically wasting gas to run the same checks.

Tools Used

Manual review

Recommendations

Remove the extra modifier as it is practically useless at this point:

function divideNft(address nftAddress, uint256 tokenId, uint256 amount)
external
onlyNftOwner(nftAddress, tokenId)
- onlyNftOwner(nftAddress, tokenId)
{
...
...
}
Updates

Lead Judging Commences

fishy Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Appeal created

yeahchibyke Submitter
7 months ago
fishy Lead Judge 7 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.