Improper Array Element Deletion Causes Loss of Funds to Zero Address
The removeBeneficiary function deletes an element by using the delete method, which only sets the array element to its default value (address(0)) rather than removing it permanently from the array. When beneficiaries are added and later removed, the position they held still remains in the array, but the address becomes the zero address.
During inheritance distribution, shares intended for removed beneficiaries are sent to the zero address, meaning those funds are lost forever. As a result, the remaining beneficiaries receive less than their expected share of the distributed assets.
Beneficiaries do not receive the correct amount of their share from the asset distribution.
The removeBeneficiary function should implement a proper array deletion method to ensure deleted members are completely removed from the array. This would keep the beneficiaries list clean and prevent it from being bloated with zero addresses of deleted beneficiaries.
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.