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

Logical and Functional Issues in buyOutEstateNFT Function

Summary

The buyOutEstateNFT function contains several logical and functional issues, including incorrect fund distribution, improper handling of beneficiary conditions, and potential reentrancy risks. These issues could lead to unintended behavior, loss of funds, or exploitation.

Vulnerability Details

  1. Rounding Error: The function calculates finalAmount as (value / divisor) * multiplier, which may result in incorrect fund distribution. For example, if value is not perfectly divisible by divisor, the division will truncate the result, leading to potential loss of precision and incorrect amounts being transferred.

  2. Improper Handling of Beneficiary Conditions: The loop checks if msg.sender is a beneficiary and immediately returns if true, skipping the rest of the logic. This means the function will not distribute funds to other beneficiaries or burn the NFT, which is likely unintended behavior.

Impact

  1. Loss of Funds: Incorrect calculations and improper handling of beneficiary conditions could result in funds being distributed incorrectly or lost.

  2. Functionality Failure: The function may fail to burn the NFT or distribute funds as intended, breaking the contract's core functionality.

Tools Used

Manual

Recommendations

Remove the return statement inside the loop to ensure the function completes all necessary steps (e.g., distributing funds and burning the NFT).

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.