Skip to content

Commit

Permalink
add one unsafe add
Browse files Browse the repository at this point in the history
  • Loading branch information
bout3fiddy committed Nov 23, 2023
1 parent 4a95cc1 commit 0692ba9
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 @@ -383,7 +383,7 @@ def newton_D(ANN: uint256, gamma: uint256, x_unsorted: uint256[N_COINS], K0_prev
assert x[0] > 10**9 - 1 and x[0] < 10**15 * 10**18 + 1 # dev: unsafe values x[0]
assert unsafe_div(x[1] * 10**18, x[0]) > 10**14 - 1 # dev: unsafe values x[i] (input)

S: uint256 = x[0] + x[1]
S: uint256 = unsafe_add(x[0], x[1]) # can unsafe add here because we checked x[0] bounds

D: uint256 = 0
if K0_prev == 0:
Expand Down

0 comments on commit 0692ba9

Please sign in to comment.