Hawk High

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

Incorrect payment distribution (35% to each teacher)

Description:
Teachers receive 35% of the bursary each, which when multiplied by multiple teachers results in more than 35% total being distributed, leaving less than 60% for the bursary.

// all the teachers should shares those 35%
uint256 payPerTeacher = (bursary * TEACHER_WAGE) / PRECISION;
//...
for (uint256 n = 0; n < totalTeachers; n++) {
// each teacher get those 35% !
@> usdc.safeTransfer(listOfTeachers[n], payPerTeacher);
}

Impact:
Significant fund misallocation that could deplete the bursary faster than intended, harming the school's financial stability.

Recommended Mitigation:
Calculate teacher payments as 35% of bursary divided by number of teachers to ensure total teacher share is 35%.

- uint256 payPerTeacher = (bursary * TEACHER_WAGE) / PRECISION;
+ uint256 payPerTeacher = (bursary * TEACHER_WAGE) / (PRECISION * totalTeachers);

Severity: High (Impact: High, Likelihood: High)

Tools Used

  • Manual Review

Updates

Lead Judging Commences

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

incorrect teacher pay calculation

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

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