Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: high
Valid

Premature Return in NFT Buyout Loop

Summary

The buyOutEstateNFT loop returns immediately upon finding the caller, skipping payments to other beneficiaries.

Vulnerability Details

The loop uses return inside the conditional, terminating execution after transferring to the first non-caller beneficiary.

Impact

Most beneficiaries do not receive their share, violating equitable distribution.

Tools Used

Manual review.

Recommendations

Remove the return statement and use continue to skip the caller:

for (uint256 i = 0; i < beneficiaries.length; i++) {
if (beneficiaries[i] == msg.sender) continue;
IERC20(assetToPay).safeTransfer(beneficiaries[i], finalAmount / (divisor - 1));
}
Updates

Lead Judging Commences

0xtimefliez Lead Judge 6 months ago
Submission Judgement Published
Validated
Assigned finding tags:

buyOutNFT has return instead of continue

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.