Hawk High

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

[EVMN-HH07] Improper Error Handling in `expel()` Function

Summary

Improper Error Handling in expel() Function

Vulnerability Details

The expel function uses a generic revert() without a message or custom error when checking if the school is in session:

function expel(address \_student) public onlyPrincipal {
if (inSession == false) {
revert();
}
// ...
}

Impact

Low

Tools Used

Manual review.

Recommendations

Use a proper custom error for better error handling and gas efficiency:

error HH__NotInSession();
function expel(address _student) public onlyPrincipal {
if (inSession == false) {
revert HH__NotInSession();
}
// ...
}
Updates

Lead Judging Commences

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