The LevelOne contract's graduateAndUpgrade
function fails to update the bursary
variable after distributing 40% of its value to the principal and teachers. This creates a state inconsistency between the storage variable and the actual token balance, violating the invariant that "remaining 60% should reflect in the bursary after upgrade."
When the graduateAndUpgrade
function is called, it distributes funds to teachers and the principal:
However, the function never updates the bursary
state variable after these transfers. This creates a discrepancy where:
The contract's USDC balance is reduced by the payments
The bursary
variable still reflects the pre-payment amount (100%)
The README explicitly states that "remaining 60% should reflect in the bursary after upgrade," indicating that the bursary
variable should be updated to 60% of its value after payments.
This inconsistency between the contract's state and actual token balance has several consequences:
State Corruption: The bursary
variable doesn't accurately reflect available funds
Future Calculation Errors: Any future calculations based on the bursary
value will be incorrect
Invariant Violation: The system requirement that "60% should reflect in the bursary after upgrade" is not fulfilled
Accounting Issues: If multiple upgrades occur, the discrepancy will compound over time
The bursary
variable should be updated after payments to accurately reflect the remaining funds:
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.