LevelTwo has an incompatible storage layout with LevelOne, causing a severe storage collision that would corrupt contract state during an upgrade. Specifically, LevelTwo's sessionEnd variable would overwrite the same storage slot used by LevelOne's schoolFees.
When upgrading contracts using the UUPS pattern, maintaining the exact same storage layout is critical. The LevelOne and LevelTwo contracts have mismatched storage layouts:
LevelOne storage layout:
LevelTwo storage layout:
This causes two critical problems:
sessionEnd in LevelTwo would read from the storage slot containing schoolFees in LevelOne
bursary in LevelTwo would read from the slot containing sessionEnd in LevelOne
The result is a "shifted" storage layout where all variables after schoolFees would be corrupted after an upgrade.
If an upgrade from LevelOne to LevelTwo were to occur:
Contract state would be corrupted, with sessionEnd reading the incorrect value (previously schoolFees)
The bursary variable would contain the old sessionEnd value, causing financial calculations to be incorrect
All subsequent state variables would be similarly corrupted
The entire behavior of the contract would be unpredictable after upgrade
Financial operations would be compromised, potentially leading to fund loss
Manual storage layout analysis
Contract comparison
Storage slot tracing
Fix the storage layout in LevelTwo to exactly match LevelOne by preserving all state variables in the same order, even if they're unused:
This ensures that all storage slots remain in the exact same positions after the upgrade, preventing any data corruption.
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.