From 53b487f678f1d965329acd08203ce68010d6aba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Lakhal?= <39790678+clemlak@users.noreply.github.com> Date: Sun, 3 Nov 2024 19:11:56 +0400 Subject: [PATCH] CVF-1, CVF-23 (#180) --- src/Doppler.sol | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Doppler.sol b/src/Doppler.sol index 182c99d9..7b989d83 100644 --- a/src/Doppler.sol +++ b/src/Doppler.sol @@ -112,8 +112,10 @@ contract Doppler is BaseHook { if (_startingTime >= _endingTime) revert InvalidTimeRange(); // Inconsistent gamma, epochs must be long enough such that the upperSlug is at least 1 tick // TODO: Consider whether this should check if the left side is less than tickSpacing - if (int256(FullMath.mulDiv(FullMath.mulDiv(_epochLength, 1e18, timeDelta), uint256(int256(_gamma)), 1e18)) == 0) - { + if ( + _gamma <= 0 + || FullMath.mulDiv(FullMath.mulDiv(_epochLength, 1e18, timeDelta), uint256(int256(_gamma)), 1e18) == 0 + ) { revert InvalidGamma(); } // _endingTime - startingTime must be divisible by epochLength