Omniscia Boson Protocol Audit
OfferBase Code Style Findings
OfferBase Code Style Findings
OBE-01C: Illegible Representation of Limitation
| Type | Severity | Location |
|---|---|---|
| Code Style | ![]() | OfferBase.sol:L327 |
Description:
The referenced limitation for the _length variable is performed by ensuring it is less-than the value of 1 << 64.
Example:
contracts/protocol/bases/OfferBase.sol
327require(_length < (1 << 64), INVALID_RANGE_LENGTH);Recommendation:
We advise the code to be adjusted to instead evaluate that the _length value is less-than-or-equal-to the value of type(uint64).max, greatly enhancing the legibility of the require check whilst retaining the same logical constraint.
Alleviation (2b9f60b6c3323fd234b570089ceff924cdb5851c):
The _length limitation referenced was updated to properly utilize the type(uint64).max compiler literal and to use a less-than-or-equal-to (<=) comparator, retaining the same gas cost as the original code whilst increasing its legibility greatly.
