From 44286615a0e0b0a17892fe83aad96546a6b1aca1 Mon Sep 17 00:00:00 2001 From: Daniel Wang <99078276+dantaik@users.noreply.github.com> Date: Tue, 29 Oct 2024 14:13:25 +0800 Subject: [PATCH] fix(protocol): small fix to 1559 error check (#18339) --- packages/protocol/contracts/layer2/based/Lib1559Math.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/protocol/contracts/layer2/based/Lib1559Math.sol b/packages/protocol/contracts/layer2/based/Lib1559Math.sol index 44f91ff248..99502d13dd 100644 --- a/packages/protocol/contracts/layer2/based/Lib1559Math.sol +++ b/packages/protocol/contracts/layer2/based/Lib1559Math.sol @@ -57,7 +57,7 @@ library Lib1559Math { uint256 f = FixedPointMathLib.WAD; uint256 ratio = f * _newGasTarget / _gasTarget; - if (ratio > uint256(type(int256).max)) revert EIP1559_INVALID_PARAMS(); + if (ratio == 0 || ratio > uint256(type(int256).max)) revert EIP1559_INVALID_PARAMS(); int256 lnRatio = FixedPointMathLib.lnWad(int256(ratio)); // may be negative