The addBeneficiary()
function allows adding the same address multiple times to the beneficiaries array without any duplication checks:
If the owner accidentally enters two or more identical addresses, this lack of duplicate checking will affect critical functions throughout the contract, particularly those related to asset distribution and inheritance activation.
1) This leads to unfair asset distribution in the withdrawInheritedFunds function:
An address that appears multiple times in the array receives multiple shares
For example, if an address is added twice to a three-address array, it receives 2/3 of all assets
The distribution is based on raw array positions rather than unique beneficiaries:
2) Issues with the inherit function:
A contract with a single unique beneficiary added multiple times incorrectly activates multi-beneficiary mode
This prevents proper ownership transfer that should occur with a single beneficiary:
Add duplicate checking to addBeneficiary()
Consider using a mapping for more efficient beneficiary tracking:
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.