Open c4-bot-2 opened 7 months ago
QA 38 : unchecked loop increments no valid in solidity > v0.8.22
G01 : Update storage variable once outside of the loop instead of updating it every time in loop it saves 1 SSTORE, 1SLOAD per iteration(Saves ~2200 Gas per iteration)
G03 : Call _getMultiOwnableStorage() one time to fetch storage pointer and avoid extra internal function call
G09 : Do not assign a variable with its default value
Gas optimization are correctly implemented as suggested.
From the difference in gas snapshot there is a slightly decrease of gas usage for the patched version which is to be expected.
Successful Mitigation
3docSec marked the issue as satisfactory
Lines of code
Vulnerability details
C4 Issue
QA 38 : unchecked loop increments no valid in solidity > v0.8.22
G01 : Update storage variable once outside of the loop instead of updating it every time in loop it saves 1 SSTORE, 1SLOAD per iteration(Saves ~2200 Gas per iteration)
G03 : Call _getMultiOwnableStorage() one time to fetch storage pointer and avoid extra internal function call
G09 : Do not assign a variable with its default value
Mitigation
Gas optimization are correctly implemented as suggested.
From the difference in gas snapshot there is a slightly decrease of gas usage for the patched version which is to be expected.
Conclusions
Successful Mitigation