Omniscia Gnosis Guild Audit
BufferPacker Code Style Findings
BufferPacker Code Style Findings
BPR-01C: Loop Iterator Optimization
Type | Severity | Location |
---|---|---|
Gas Optimization | ![]() | BufferPacker.sol:L43 |
Description:
The linked for
loop increments / decrements the iterator "safely" due to Solidity's built-in safe arithmetics (post-0.8.X
).
Example:
packages/evm/contracts/packers/BufferPacker.sol
43for (uint256 i; i < count; ++i) {
Recommendation:
We advise the increment / decrement operation to be performed in an unchecked
code block as the last statement within the for
loop to optimize its execution cost.
Alleviation:
The Gnosis Guild team considered this exhibit but has opted not to apply it to avoid broad usage of the unchecked
paradigm. As such, we consider this exhibit acknowledged.