Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: low
Invalid

Inefficient onlyBeneficiaryWithIsInherited Modifier

Summary:
The modifier InheritanceManager::onlyBeneficiaryWithIsInherited uses an unbounded loop with an out-of-bound exception to for beneficiaries, leading to high gas usage and potential vulnerabilities.

Vulnerability Details:
Iterating with a loop that exceeds the beneficiaries array bounds is inefficient and may lead to unintended errors.

Code Example
modifier onlyBeneficiaryWithIsInherited() {
uint256 i = 0;
while (i < beneficiaries.length + 1) {
if (msg.sender == beneficiaries[i] && isInherited) {
break;
}
i++;
}
_;
}

Impact:
Low – While not immediately dangerous, it is inefficient and could be optimized.

Tools Used:
slither, aderyn, foundry

Recommendations:
Replace the current logic with custom errors and more efficient checks to avoid potential issues.


Updates

Lead Judging Commences

0xtimefliez Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!