Hawk High

First Flight #39
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Impact: low
Likelihood: low
Invalid

Duplicate HH__ZeroAddress Validations

Functions like addTeacher, removeTeacher, updatePrincipal, etc., all repeat the same check

if (addr == address(0)) {
revert HH__ZeroAddress();
}

That identical revert is copied in multiple places throughout the codebase.

Impact:

-Extra gas in both the bytecode and at runtime — each duplicated if/revert adds roughly 12–15 bytes; with multiple code paths you may exceed the size limit for upgradeable contracts.

-Duplicated maintenance — any change to the error message requires editing every occurrence.

Recommended Mitigation:

Move the check into a single internal function or modifier, for example

modifier nonZero(address _addr) {
if (_addr == address(0)) revert HH__ZeroAddress();
_;
}

Then apply nonZero to all relevant methods

Updates

Lead Judging Commences

yeahchibyke Lead Judge about 2 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.