Hawk High

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

[L-1] Incorrect payouts if there's no teachers at `LevelOne.sol` contract in `listOfTeachers` array

Description:
The graduateAndUpgrade() logic assumes listOfTeachers.length> 0 , where if its zero, the payout math could fail silently or return nothing.

Impact:
If the number of teachers are zero, the logic will break and leads to math error for the contract

Remediation:
Consider adding the following code inside LevelOne::graduateAndUpgrade()

uint256 totalTeachers = listOfTeachers.length;
if(totalTeachers == 0) {
revert HH__NoTeachersRegistered();
}
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.