When upgrading from LevelOne to LevelTwo, there are serious storage layout inconsistencies that will cause data corruption. Upgradeable contracts must maintain identical storage layouts to ensure state variables are accessed correctly after upgrade.
The following variables from LevelOne do not exist in LevelTwo:
uint256 public immutable reviewTime = 1 weeks; (line 41)
mapping(address => uint256) private reviewCount; (line 48)
mapping(address => uint256) private lastReviewTime; (line 49)
This storage layout mismatch will cause catastrophic data corruption after upgrade:
All variables after inSession will be shifted
LevelTwo will read incorrect data from wrong storage slots
Student scores, teacher lists, and other data will be completely corrupted
The entire system state will become unreliable and unpredictable
In Solidity's storage layout, variables are allocated sequential slots. When upgrading, if you remove variables from the middle of the sequence, all subsequent variables will read from incorrect slots.
For instance, where LevelOne stores reviewTime, LevelTwo will be reading sessionEnd data, creating a cascade of misaligned reads throughout the contract.
Critical (High impact, high likelihood)
Manual review.
The LevelTwo contract must declare exactly the same storage variables in the same order as LevelOne:
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.