The buyOutEstateNFT()
function in ingeritancemanager.sol contains a return statement inside a loop, which prematurely stops the iteration when msg.sender
is found in the beneficiaries
array. As a result, any beneficiaries after msg.sender
in the array do not receive their fair share of the funds, leading to loss of inheritance distribution.
buyOutEstateNFT(``)
The function loops through the beneficiaries to distribute funds.
When msg.sender
(the buyer) is found in the array, the loop stops execution due to the return
statement.
Any beneficiaries after msg.sender
in the list will not receive their share.
This leads to unfair and incomplete inheritance payouts.
If a beneficiary calls buyOutEstateNFT()
to purchase an estate NFT, the loop stops distributing funds once it finds them in the list.
This results in other beneficiaries losing their rightful inheritance.
If the contract has an uneven number of beneficiaries, a portion of the funds may remain unclaimed.
Manuel Review
Let's say:
msg.sender = 0xCCC
(the buyer calling buyOutEstateNFT
).
The loop starts from index 0
.
Step | Current Beneficiary | Action Taken |
---|---|---|
1ļøā£ | 0xAAA |
ā Paid |
2ļøā£ | 0xBBB |
ā Paid |
3ļøā£ | 0xCCC (msg.sender) |
ā Loop Stops! (return executed) |
4ļøā£ | 0xDDD |
ā Never Reached! |
š“ Result: 0xDDD
does not receive their share! The loop stops at 0xCCC
.
Step | Current Beneficiary | Action Taken |
---|---|---|
1ļøā£ | 0xAAA |
ā Paid |
2ļøā£ | 0xBBB |
ā Paid |
3ļøā£ | 0xCCC (msg.sender) |
ā© Skipped (Not Paid) |
4ļøā£ | 0xDDD |
ā Paid! |
š¢ Result: Now all eligible beneficiaries except the buyer receive their fair share.
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.