The LLMOracleCoordinator and Swan contracts are upgradable smart contracts that inherit from LLMOracleManager and SwanManager contracts, respectively. If storage variables are added to either LLMOracleManager or SwanManager, they will cause a storage collision with the corresponding inherited contracts, potentially resulting in overwritten storage and data corruption.
Taking LLMOracleCoordinator as an example:
Since LLMOracleCoordinator inherits from the LLMOracleManager contract, we can inspect the storage slots as follows using a Foundry command:
The log output:
As shown, the storage slots from 0 to 5 are inherited from LLMOracleManager. The issue arises if any new state variables are added to LLMOracleManager, which could lead to a collision with the existing storage layout of the LLMOracleCoordinator contract.
The same vulnerability occurs in the Swan contract, which is inherited from SwanManager.
Adding new state variables to LLMOracleManager or SwanManager will overwrite existing storage slots in LLMOracleCoordinator and Swan, causing data corruption and disrupting contract functionality.
Foundry, documentation.
Add a storage gap at the end of both LLMOracleManager and SwanManager contracts to reserve slots for future state variables. This will prevent any new variables from colliding with inherited slots in LLMOracleCoordinator and Swan. Example code for adding a storage gap:
This code reserves 50 storage slots, ensuring that future additions to LLMOracleManager or SwanManager do not interfere with inherited storage.
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.