The payment distribution doesn't account for the remaining 60% that should stay in the bursary, and there's no validation of the payment amounts.
The function fails to verify that bursary >= totalPayouts
and check if payPerTeacher
is fairly distributed.
Exploit Scenario:
If bursary = 99
and TEACHER_WAGE = 35%
:
99 * 35 / 100 = 34.65
→ Rounds down to 34 (loss of 0.65 per teacher)
Teachers receive less than promised, while excess funds remain stuck.
Improper Bursary Deduction
The function does not deduct payments from bursary before transfers, risking:
i. Reentrancy attacks (if usdc.safeTransfer triggers a callback)
ii. Double-spending (if interrupted mid-execution)
iii. Incorrect final balance (funds may be over/under-allocated).
Missing Teacher Count Validation
No check ensures:
i. listOfTeachers.length > 0
(avoid division by zero)
ii. Each teacher still exists (they could be removed mid-payment)
Exploit Scenario:
A malicious principal could:
i. Remove a teacher after payment calculation
ii. Cause payPerTeacher to be incorrectly inflated
iii. Drain the bursary via oversized transfers
Teachers receive incorrect payments due to rounding errors.
bursary
accounting fails, allowing excess withdrawals.
If usdc.safeTransfer
calls back into the contract, funds could be stolen.
Foundry
VS Code
Secure Payment Calculation
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.