The implementation of upgradeable contracts is missing the __gap
variable, which is crucial for maintaining storage compatibility across contract upgrades. This oversight could lead to unexpected behavior or state corruption in future contract versions.
https://github.com/Cyfrin/2024-10-swan-dria/blob/main/contracts/llm/LLMOracleCoordinator.sol
https://github.com/Cyfrin/2024-10-swan-dria/blob/main/contracts/swan/Swan.sol
In upgradeable contracts, the __gap variable acts as a buffer to prevent new storage variables from overwriting existing ones, avoiding storage collisions and possible data loss.
If the __gap
variable is not included, future upgrades to the contract may inadvertently overwrite existing state variables. This could lead to:
Data loss or corruption.
Security vulnerabilities as critical state information may be lost or manipulated.
Increased complexity in maintaining the contract and ensuring compatibility with future versions.
manual Review
Add the uint256[50] private __gap;
line to all upgradeable contracts to reserve storage space for future upgrades.
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.