2024-08-cork-protocol-0xjoichiro/Depeg-swap/contracts/core/assets/AssetFactory.sol
Replace state variable reads and writes within loops with local variable reads and writes.
Details: https://sg.run/xADy
83┆ Pair storage asset = pairs[i];
⋮┆----------------------------------------
87┆ lv[_idx] = lvs[asset.toId()];
Mammoth Laurel Nightingale
Low/Info
state-variable-read-in-a-loop
Summary
Vulnerability Detail
Impact
Code Snippet
https://github.com/sherlock-audit/2024-08-cork-protocol/blob/main/Depeg-swap/contracts/core/assets/AssetFactory.sol#L83 https://github.com/sherlock-audit/2024-08-cork-protocol/blob/main/Depeg-swap/contracts/core/assets/AssetFactory.sol#L87
Tool used
Manual Review
Recommendation