When a beneficiary buys an estate NFT through function InheritanceManager::buyOutEstateNFT
, it calculates the amount to be transferred proportionally to the remaining beneficiaries. However, the calculations are incorrect and will result in them receiving less than their fair share of the payment.
The function first calculates the payment amount to distribute finalAmount
as:
Solidity will truncate the result when value
isn't evenly divisible by divisor
and so the fractional value will be lost, leading to incorrect calculation results.
More importantly, each beneficiary receives:
Besides leading to further rounding errors, the division incorrectly takes into account the beneficiary that's purchasing the NFT, further reducing the payment each one receives.
Beneficiaries receive less than their expected share of the funds
Manual Review
Correct both the payment share formula and reduce the rounding errors:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.