The buyOutEstateNFT
function in the InheritanceManager
contract has a logic flaw that allows certain beneficiaries to claim estate NFTs for free or at a significant discount when the number of beneficiaries is small. This could result in an unfair distribution of inherited assets.
The formula for finalAmount
is
When there are only two beneficiaries, divisor = 2
, and multiplier = 1
, so:
However, in the loop, the buyer is excluded from receiving the compensation, meaning the remaining one beneficiary only gets half the estate's value.
This results in the buyer paying nothing effectively while taking full ownership of the NFT.
For a single beneficiary (divisor = 1
), the multiplier (0
) makes finalAmount = 0
, allowing a free claim.
When a beneficiary buys out an estate NFT, the function incorrectly calculates the required payment amount.
If there are only two beneficiaries, the buyer effectively pays nothing due to how multiplier
is calculated.
This allows one beneficiary to take full ownership of an estate NFT without compensating the other beneficiaries fairly, leading to financial losses.
Manual Code Review
Fix the Buyout Payment Calculation
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.