In the event that an estate is set up by the owner, any of the beneficiaries should be able to buy out the estate, with the proceeds then shared equally between the remaining beneficiaries.
Logic flaws in the InheritanceManager::buyOutEstateNFT()
function mean that all beneficiaries can buy out the estate at different points in time, and the respective transactions will go through.
This will lead to estate collision, as all beneficiaries can lay claim to the estate with an arguement that their bids(transactions) went through.
And through the test, we figure out that a dubious owner who is aware of this flaw can set up an estate, and steal a large amount of the funds generated from the sales of the estate.
Foundry
Manual Review
Consider this scenario:
Jim sets up the family beach house in Tuscany as an estate for his 3 beneficiaries -wife, son, and daughter- at a value of 150k USDC
Son thinks this is a good opportunity and buys out the estate at 100k USDC
Wife also buys out the estate at 100k USDC
, unaware that her son has already exercised that option. The transaction goes through, so she doesn't any foul play
Daughter discusses with her fiance, and decides to buy out the estate. She goes ahead to pay the 100k USDC
, unsuspectingly because the transaction goes through
The 3 beneficiaries get involved in a battle for who claims ownership of the house
Jim (or whoever is the owner) withdraws the USDC
balance of the portfolio
Add the following test to the InheritanceManagerTest
contract:
Make the following modifications to the ::buyOutEstateNFT()
function:
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.