BaseAdapter
has a no storage gap for an upgrade.
https://github.com/Cyfrin/2025-01-zaros-part-2/blob/main/src/utils/dex-adapters/BaseAdapter.sol#L58
For example, let's see CureAdapter
storage layout.
address curveStrategyRouter
comes right after uint256 deadline
without any padding.
https://github.com/Cyfrin/2025-01-zaros-part-2/blob/main/src/utils/dex-adapters/CurveAdapter.sol
The next upgrade cannot add any new storage variables to BaseAdapter
without breaking the storage layout of inheriting contracts like CureAdapter
.
Foundry
Add a storage gap in BaseAdapter
as below.
https://github.com/Cyfrin/2025-01-zaros-part-2/blob/main/src/utils/dex-adapters/BaseAdapter.sol#L58-L59
Reference: https://docs.openzeppelin.com/upgrades-plugins/writing-upgradeable#storage-gaps
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.