Skip to content

Commit

Permalink
check nonzero math impl
Browse files Browse the repository at this point in the history
  • Loading branch information
bout3fiddy committed Nov 23, 2023
1 parent ac588b0 commit 7875cae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion contracts/main/CurveCryptoMathOptimized2.vy
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,6 @@ def get_p(
denominator: uint256 = (GK0 + unsafe_div(unsafe_div(NNAG2 * _xp[0], _D) * K0, 10**36) )

# p_xy = x * (GK0 + NNAG2 * y / D * K0 / 10**36) / y * 10**18 / denominator
# p_xz = x * (GK0 + NNAG2 * z / D * K0 / 10**36) / z * 10**18 / denominator
# p is in 10**18 precision.
return unsafe_div(
_xp[0] * ( GK0 + unsafe_div(unsafe_div(NNAG2 * _xp[1], _D) * K0, 10**36) ) / _xp[1] * 10**18,
Expand Down
3 changes: 2 additions & 1 deletion contracts/main/CurveTwocryptoFactory.vy
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ def deploy_pool(
@return Address of the deployed pool
"""
pool_implementation: address = self.pool_implementations[implementation_id]
_math_implementation: address = self.math_implementation
assert pool_implementation != empty(address), "Pool implementation not set"
assert _math_implementation != empty(address), "Math implementation not set"

assert mid_fee < MAX_FEE-1 # mid_fee can be zero
assert out_fee >= mid_fee
Expand Down Expand Up @@ -183,7 +185,6 @@ def deploy_pool(

# pool is an ERC20 implementation
_salt: bytes32 = block.prevhash
_math_implementation: address = self.math_implementation
pool: address = create_from_blueprint(
pool_implementation,
_name,
Expand Down

0 comments on commit 7875cae

Please sign in to comment.