code-423n4 / 2024-04-coinbase-mitigation-findings

0 stars 0 forks source link

ADD-02 MitigationConfirmed #11

Open c4-bot-2 opened 7 months ago

c4-bot-2 commented 7 months ago

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

c4-judge commented 7 months ago

3docSec marked the issue as satisfactory