The onlyBeneficiaryWithIsInherited
modifier in the InheritanceManager
contract contains an out-of-bounds error, which causes transactions to revert unexpectedly when executed by a non-beneficiary. This issue prevents intended contract functionality and can disrupt inheritance transfers.
beneficiaries.length + 1
exceeds the array bounds, meaning if no match is found before the last iteration, it will cause an out-of-bounds error and revert the transaction.
Expected Behavior: The loop should iterate up to beneficiaries.length - 1
.
Actual Behavior: The loop goes beyond the array size, triggering a "Panic: Index out of bounds" error.
The modifier loops through the beneficiaries
array incorrectly using beneficiaries.length + 1
.
This always causes an "index out of bounds" error when msg.sender
is not a beneficiary.
As a result, valid function calls will fail, and no beneficiaries will be able to execute inheritance-related functions.
Manual Code
Fix the Modifier by Correcting the Loop Condition
Safer Alternative: Use for
Loop Instead
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.