In the graduateAndUpgrade function of contract LevelOne, the bursary variable is not updated after distributing fees to teachers and principal. This leaves 60% of the funds in the bursary account even after graduation, potentially allowing those funds to be reused in future operations, leading to accounting discrepancies.
When the graduation process occurs, 35% of the bursary is distributed to teachers and 5% to the principal. However, the bursary state variable remains unchanged:
After paying out 40% of the bursary funds (35% to teachers and 5% to the principal), the remaining 60% should either be:
Set aside for the next school session
Clearly accounted for in the state variables
Sent to another account for safekeeping
Instead, the bursary variable remains at its original value, suggesting those funds are still available.
Inconsistent accounting: The system thinks it still has 100% of the bursary when only 60% remains
Potential for double-spending: If the graduation process is somehow repeated (e.g., in a new session), more funds than available might be allocated
Misleading financial reporting: Reports of available funds would be inflated by 40%
Potential loss of funds: The unaccounted 60% might be forgotten or misused
Manual code review
Logic analysis
Update the bursary variable after distributing funds to accurately reflect the remaining amount:
The bursary is not updated after wages have been paid in `graduateAndUpgrade()` function
The bursary is not updated after wages have been paid in `graduateAndUpgrade()` function
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.