From acb1874473611001e102ac8412300a02e8d2fc40 Mon Sep 17 00:00:00 2001 From: Alberto Date: Wed, 17 Apr 2024 21:13:19 +0200 Subject: [PATCH] feat: stricter and symmetric checks for `newton_D` --- contracts/main/CurveCryptoMathOptimized2.vy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/main/CurveCryptoMathOptimized2.vy b/contracts/main/CurveCryptoMathOptimized2.vy index 40c64500..b7205354 100644 --- a/contracts/main/CurveCryptoMathOptimized2.vy +++ b/contracts/main/CurveCryptoMathOptimized2.vy @@ -454,7 +454,7 @@ def newton_D(ANN: uint256, gamma: uint256, x_unsorted: uint256[N_COINS], K0_prev for _x in x: frac: uint256 = _x * 10**18 / D - assert (frac >= 10**16 - 1) and (frac < 10**20 + 1) # dev: unsafe values x[i] + assert (frac > 10**16 / N_COINS - 1) and (frac < 10**20 / N_COINS + 1) # dev: unsafe values x[i] return D raise "Did not converge"