The bursary of the school is not updated correctly when the contract is upgraded. During the graduation and upgrade process the principal and teachers are paid their share of the bursary, however the bursary value is not updated to reflect this payment. This means that the bursary value will not reflect the correct amount of money left in the contract after the payments have been made.
The vulnerability is located in the graduateAndUpgrade
function of the LevelOne
contract.
We can see that the payments are made to the teachers and principal but the bursary value is not updated accordingly.
The following test will validate that the bursary is equal to the coins in the contract after a graduation and upgrade:
As we can see the bursary value stays the same while the balance of the contract is lowered.
Since the bursary value is not updated correctly on upgrade the next time the payments are calculated it will be based on the old bursary value. This will lead to the teachers and principal being overpaid until all the coins are spent. After this happens the contract will be locked since the payout will be reverted.
Manually reviewed the code and the documentation.
The bursary value should be updated when making payments:
Note that the payPerTeacher
is calculated incorectly but this will be part of an other report. This recomendation makes sure the bursary value and the holdings of the contract stay in sync.
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.