Skip to content

Commit

Permalink
feat: stricter and symmetric checks for newton_D
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertoCentonze committed Apr 17, 2024
1 parent df64fb1 commit acb1874
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/main/CurveCryptoMathOptimized2.vy
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit acb1874

Please sign in to comment.