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

Exit Condition Prevents Fund Distribution in buyOutEstateNFT

Summary

The buyOutEstateNFT function exits early if msg.sender is found in the beneficiaries array, preventing fund distribution and NFT burning. This results in a logical failure where neither the intended payments are executed nor the NFT is properly transferred or burned.

Vulnerability Details

In the for loop, the condition:

if (msg.sender == beneficiaries[i]) {
return;
}

immediately exits the function if the sender is in the beneficiaries list. As a result:

• The funds are never transferred to other beneficiaries.

• The NFT is never burned.

• The buyout process is left incomplete, leading to a broken state.

Impact

• Funds Lockup: Other beneficiaries do not receive their share of the buyout amount.

• Failed NFT Transfer: The NFT remains in existence despite a buyout attempt, leading to inconsistencies in the contract state.

Tools Used

Manual review

Recommendations

• Remove the return; statement to ensure that the function continues executing.

• Instead, modify the loop to skip transferring funds to msg.sender:

if (msg.sender != beneficiaries[i]) {
IERC20(assetToPay).safeTransfer(beneficiaries[i], finalAmount / divisor);
}
Updates

Lead Judging Commences

0xtimefliez Lead Judge 9 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.

Give us feedback!