Hi,
I found out a potential vulnerability in the contract 'Inheritancemanager.sol' which can leads to the division-by-zero error via functions 'withdrawInheritedFunds' and 'buyOutEstateNFT'.
The key details of this potential vulnerability can be given as follows:
In the contract 'Inheritancemanager.sol', functions 'withdrawInheritedFunds' and 'buyOutEstateNFT' use beneficiaries.length
as divisor without checking if it's 0 or not. Meaning if all beneficiaries are removed, it can cause division-by-zero error.
Locking of funds with no beneficiaries, makes contract unusable.
Manual Code Analysis
Implement check system in the functions 'withdrawInheritedFunds' and 'buyOutEstateNFT' in the contract for beneficiaries available to collect funds from the contract by ensuring beneficiaries.length>0
before performing divison.
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.