Hawk High

First Flight #39
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: high
Valid

Improper Validation in graduateAndUpgrade Payout Logic

Summary

If multiple teachers exist, the total payPerTeacher * n + principalPay might exceed bursary, especially due to rounding issues.

Vulnerability Details

If multiple teachers exist, the total payPerTeacher * n + principalPay might exceed bursary, especially due to rounding issues.

Impact.

Potential overpayment causing reverts or token loss.

Tools Used

Recommendations

Use cumulative allocation logic and ensure total payouts don’t exceed bursary.

  • Consider: uint256 remaining = bursary - principalPay; uint256 payPerTeacher = remaining / totalTeachers;

Updates

Lead Judging Commences

yeahchibyke Lead Judge 3 months ago
Submission Judgement Published
Validated
Assigned finding tags:

incorrect teacher pay calculation

`payPerTeacher` in `graduateAndUpgrade()` is incorrectly calculated.

yeahchibyke Lead Judge 3 months ago
Submission Judgement Published
Validated
Assigned finding tags:

incorrect teacher pay calculation

`payPerTeacher` in `graduateAndUpgrade()` is incorrectly calculated.

Support

FAQs

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