@@ -179,7 +179,9 @@ abstract contract HelperClamp is HelperAssert {
179179 function clamp (uint256 value , uint256 low , uint256 high , bool enableLogs ) public returns (uint256 ) {
180180 // Input validation: Ensure low <= high to prevent overflow
181181 // Without this check, (high - low + 1) could wrap around if low > high
182- if (low > high) revert InvalidRange (low, high);
182+ if (low > high) {
183+ revert InvalidRange (low, high);
184+ }
183185
184186 // Return values already in range without modification.
185187 // This optimization also handles the full uint256 range [0, type(uint256).max]
@@ -230,7 +232,9 @@ abstract contract HelperClamp is HelperAssert {
230232 int128 high = FuzzSafeCast.toInt128 (_high);
231233
232234 // Input validation: Ensure low <= high to prevent overflow
233- if (low > high) revert InvalidRangeInt128 (low, high);
235+ if (low > high) {
236+ revert InvalidRangeInt128 (low, high);
237+ }
234238
235239 // Return values already in range without modification.
236240 if (value >= low && value <= high) {
@@ -277,7 +281,9 @@ abstract contract HelperClamp is HelperAssert {
277281 */
278282
279283 function clampLt (uint256 a , uint256 b , bool enableLogs ) public returns (uint256 ) {
280- if (b == 0 ) revert UnsupportedClampLtValue (b);
284+ if (b == 0 ) {
285+ revert UnsupportedClampLtValue (b);
286+ }
281287 return clamp (a, 0 , b - 1 , enableLogs);
282288 }
283289
@@ -292,7 +298,9 @@ abstract contract HelperClamp is HelperAssert {
292298 * @return Clamped value in range [int128.min, b-1] as int256
293299 */
294300 function clampLt (int256 a , int256 b , bool enableLogs ) public returns (int256 ) {
295- if (b <= type (int128 ).min) revert UnsupportedClampLtValue (uint256 (b));
301+ if (b <= type (int128 ).min) {
302+ revert UnsupportedClampLtValue (uint256 (b));
303+ }
296304 return clamp (a, int256 (type (int128 ).min), b - 1 , enableLogs);
297305 }
298306
@@ -331,7 +339,9 @@ abstract contract HelperClamp is HelperAssert {
331339 * @return Clamped value in range [b+1, uint256.max]
332340 */
333341 function clampGt (uint256 a , uint256 b , bool enableLogs ) public returns (uint256 ) {
334- if (b == type (uint256 ).max) revert UnsupportedClampGtValue (b);
342+ if (b == type (uint256 ).max) {
343+ revert UnsupportedClampGtValue (b);
344+ }
335345 return clamp (a, b + 1 , type (uint256 ).max, enableLogs);
336346 }
337347
@@ -346,7 +356,9 @@ abstract contract HelperClamp is HelperAssert {
346356 * @return Clamped value in range [b+1, int128.max] as int256
347357 */
348358 function clampGt (int256 a , int256 b , bool enableLogs ) public returns (int256 ) {
349- if (b >= type (int128 ).max) revert UnsupportedClampGtValue (uint256 (b));
359+ if (b >= type (int128 ).max) {
360+ revert UnsupportedClampGtValue (uint256 (b));
361+ }
350362 return clamp (a, b + 1 , type (int128 ).max, enableLogs);
351363 }
352364
0 commit comments