Open code423n4 opened 2 years ago
WatchPug
https://github.com/code-423n4/2021-11-streaming/blob/56d81204a00fc949d29ddd277169690318b36821/Streaming/src/Locke.sol#L819-L819
currStreamId += 1;
Using ++currStreamId is more gas efficient than currStreamId += 1 for storage.
++currStreamId
currStreamId += 1
We suggest to use unchecked { ++currStreamId } to even better gas performance.
unchecked { ++currStreamId }
Handle
WatchPug
Vulnerability details
https://github.com/code-423n4/2021-11-streaming/blob/56d81204a00fc949d29ddd277169690318b36821/Streaming/src/Locke.sol#L819-L819
Using
++currStreamId
is more gas efficient thancurrStreamId += 1
for storage.We suggest to use
unchecked { ++currStreamId }
to even better gas performance.