Open code423n4 opened 3 years ago
We are not very interested in saving gas on governance functions that will only be used once in a blue moon. Furthermore, micro and macro window are immutables - so there is no read cost for them.
Whether you want to save gas here or not, the report is valid.
Handle
pauliax
Vulnerability details
Impact
There are places where the same storage variable is accessed multiple times in the same function. It would be more gas efficient to cache these variables and re-use them where necessary. E.g. functions initializeCollateral, enableCollateral, disableCollateral access ovl 4 times, function fetchPricePoint accesses macroWindow 4 times and microWindow 3 times. There are many more places where repeated storage access can be cached.