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

`buyOutEstateNFT` failed from early return

Summary

buyOutEstateNFT failed from early return. resulting in fund transferred to contract but it doesn't burn

Vulnerability Details

In the loop in buyOutEstateNFT to skip beneficary that send the fund, the contract use return instead of continue which ended the execution before burning NFT. If beneficary is in front of array then fund will not send to others too.

Impact

High, as business logic is completely wrong.

Tools Used

Foundry

Recommendations

Change into

for (uint256 i = 0; i < beneficiaries.length; i++) {
if (msg.sender == beneficiaries[i]) {
-- return;
++ continue;
} else {
IERC20(assetToPay).safeTransfer(beneficiaries[i], finalAmount / divisor);
}
}
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.