There is a wrong storage slot calculation which could impact some major parts of the project if optimizations are made based on this.
in DataTypes.sol , there is the MarketConfig Struct which has this bug
Here we can see the issue where the second calculation is made, we have 4 addresses which consume 20 bytes each and 3 uint256 values which contain 32 bytes each. But in the calculation, only 3 addresses were added.
Impact
This could lead to overwriting of values in the same storage slot if assembly is used.
josephdara
medium
Wrong Storage Slot Calculation
Summary
There is a wrong storage slot calculation which could impact some major parts of the project if optimizations are made based on this. in
DataTypes.sol
, there is the MarketConfig Struct which has this bugVulnerability Detail
Here we can see the issue where the second calculation is made, we have 4 addresses which consume 20 bytes each and 3 uint256 values which contain 32 bytes each. But in the calculation, only 3 addresses were added.
Impact
This could lead to overwriting of values in the same storage slot if assembly is used.
Code Snippet
https://github.com/sherlock-audit/2023-05-ironbank/blob/main/ib-v2/src/libraries/DataTypes.sol#L11-L28
Tool used
Manual Review
Recommendation
Storage slots calculations should be verified