Pieces Protocol

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

Duplicate Revert Logic

Summary: There are duplicate checks for to == address(0) in the transferErcTokens function.

Vulnerability Details: The validation for the to address being address(0) is repeated in the transferErcTokens function, which is unnecessary and redundant. Removing the duplicate check will make the function cleaner, more efficient, and easier to read.

Impact: The redundant validation increases the gas cost of the transferErcTokens function.

Tools Used: Foundry

Recommendations: Remove the duplicate to == address(0) validation from the transferErcTokens function.

if(to == address(0)) {
revert TokenDivider__CantTransferToAddressZero();
}
if(amount == 0) {
revert TokenDivider__AmountCantBeZero();
}
ERC20Info memory tokenInfo = nftToErc20Info[nftAddress];
- if(to == address(0)) {
- revert TokenDivider__CantTransferToAddressZero();
- }
Updates

Lead Judging Commences

juan_pedro_ventu 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.