Future upgrades can corrupt storage due to using nested structs
The protocol currently has many libraries with nested structs for example in MarketConfiguration.sol
The issue arises when adding a state variable to the inner struct, this will corrupt the data stored after it in the parent struct
corrupted state post upgrade
Manual Review
The trick to using inner structs and still enable them to be extended is to put them in a mapping. A struct stored in a mapping can be extended in upgrades.
For example in MarketConfiguration.sol
Replace
With
Access it using a constant:
In this way, if there is a need to extend the inner structure in future upgrades, it can be done without the risk of overwriting existing state variables.
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.