The InheritanceManager contract handles inheritance-based asset management with NFT-based estate tracking, ERC20/ETH transfers, and ownership transitions based on inactivity. It includes security mechanisms like non-reentrancy guards, modifier-based access control, and on-chain interactions tracking.
Issue : onlyBeneficiaryWithIsInherited() Modifier Causes Out-of-Bounds Error
The while loop condition uses beneficiaries.length + 1, which causes an array out-of-bounds error.
````
modifier onlyBeneficiaryWithIsInherited() {
uint256 i = 0;
while (i < beneficiaries.length + 1) { // ❌ This will access invalid index
if (msg.sender == beneficiaries[i] && isInherited) {
break;
}
i++;
}
_;
}
````
Change while (i < beneficiaries.length + 1) to while (i < beneficiaries.length).
````
modifier onlyBeneficiaryWithIsInherited() {
uint256 i = 0;
while (i < beneficiaries.length) {
if (msg.sender == beneficiaries[i] && isInherited) {
break;
}
i++;
}
_;
}
````
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.