There is a critical inconsistency in the storage layout between LevelOne and LevelTwo contracts. While both contracts declare similar state variables, their order and slot assignments differ, which will cause data corruption after an upgrade.
In LevelOne:
In LevelTwo:
Key differences:
LevelOne has schoolFees in slot1, while LevelTwo has sessionEnd in slot1
The slots for all subsequent variables are shifted
LevelTwo is missing reviewCount and lastReviewTime mappings
Array slots are different: listOfStudents is slot10 in LevelOne but slot7 in LevelTwo
The school operates using LevelOne with data stored in specific storage slots
When upgraded to LevelTwo, the proxy's storage remains unchanged
LevelTwo tries to access variables using its own storage layout
This causes data to be read from incorrect slots:
sessionEnd in LevelTwo reads from schoolFees in LevelOne
bursary in LevelTwo reads from sessionEnd in LevelOne
All mappings and arrays are completely misaligned
Complete data corruption after upgrade
Student and teacher records become inaccessible or corrupted
Financial data (bursary) is misinterpreted
The graduate() function in LevelTwo would operate on corrupted data
Students may lose their academic records and status
The entire school system becomes non-functional after upgrade
Ensure storage layout compatibility between implementations by maintaining the same variable order and types
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.