Pieces Protocol

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

Duplicate Modifier in NFT Division Function

The divideNft function in the TokenDivider contract contains a duplicate onlyNftOwner modifier that unnecessarily performs the same ownership check twice, leading to increased gas costs and potential confusion in access control logic.

Lines of Code

https://github.com/Cyfrin/2025-01-pieces-protocol/blob/4ef5e96fced27334f2a62e388a8a377f97a7f8cb/src/TokenDivider.sol#L109

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