Source Code
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 513499 | 711 days ago | Contract Creation | 0 FRAX |
Cross-Chain Transactions
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
CurveTwocryptoMathOptimized
Compiler Version
vyper:0.3.10
Contract Source Code (Vyper language format)
# pragma version 0.3.10
# pragma optimize gas
# pragma evm-version paris
# (c) Curve.Fi, 2020-2023
# AMM Math for 2-coin Curve Cryptoswap Pools
#
# Unless otherwise agreed on, only contracts owned by Curve DAO or
# Swiss Stake GmbH are allowed to call this contract.
"""
@title CurveTwocryptoMathOptimized
@author Curve.Fi
@license Copyright (c) Curve.Fi, 2020-2023 - all rights reserved
@notice Curve AMM Math for 2 unpegged assets (e.g. ETH <> USD).
"""
N_COINS: constant(uint256) = 2
A_MULTIPLIER: constant(uint256) = 10000
MIN_GAMMA: constant(uint256) = 10**10
MAX_GAMMA: constant(uint256) = 2 * 10**15
MIN_A: constant(uint256) = N_COINS**N_COINS * A_MULTIPLIER / 10
MAX_A: constant(uint256) = N_COINS**N_COINS * A_MULTIPLIER * 1000
version: public(constant(String[8])) = "v2.0.0"
# ------------------------ AMM math functions --------------------------------
@internal
@pure
def _snekmate_log_2(x: uint256, roundup: bool) -> uint256:
"""
@notice An `internal` helper function that returns the log in base 2
of `x`, following the selected rounding direction.
@dev This implementation is derived from Snekmate, which is authored
by pcaversaccio (Snekmate), distributed under the AGPL-3.0 license.
https://github.com/pcaversaccio/snekmate
@dev Note that it returns 0 if given 0. The implementation is
inspired by OpenZeppelin's implementation here:
https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/Math.sol.
@param x The 32-byte variable.
@param roundup The Boolean variable that specifies whether
to round up or not. The default `False` is round down.
@return uint256 The 32-byte calculation result.
"""
value: uint256 = x
result: uint256 = empty(uint256)
# The following lines cannot overflow because we have the well-known
# decay behaviour of `log_2(max_value(uint256)) < max_value(uint256)`.
if x >> 128 != empty(uint256):
value = x >> 128
result = 128
if value >> 64 != empty(uint256):
value = value >> 64
result = unsafe_add(result, 64)
if value >> 32 != empty(uint256):
value = value >> 32
result = unsafe_add(result, 32)
if value >> 16 != empty(uint256):
value = value >> 16
result = unsafe_add(result, 16)
if value >> 8 != empty(uint256):
value = value >> 8
result = unsafe_add(result, 8)
if value >> 4 != empty(uint256):
value = value >> 4
result = unsafe_add(result, 4)
if value >> 2 != empty(uint256):
value = value >> 2
result = unsafe_add(result, 2)
if value >> 1 != empty(uint256):
result = unsafe_add(result, 1)
if (roundup and (1 << result) < x):
result = unsafe_add(result, 1)
return result
@internal
@pure
def _cbrt(x: uint256) -> uint256:
xx: uint256 = 0
if x >= 115792089237316195423570985008687907853269 * 10**18:
xx = x
elif x >= 115792089237316195423570985008687907853269:
xx = unsafe_mul(x, 10**18)
else:
xx = unsafe_mul(x, 10**36)
log2x: int256 = convert(self._snekmate_log_2(xx, False), int256)
# When we divide log2x by 3, the remainder is (log2x % 3).
# So if we just multiply 2**(log2x/3) and discard the remainder to calculate our
# guess, the newton method will need more iterations to converge to a solution,
# since it is missing that precision. It's a few more calculations now to do less
# calculations later:
# pow = log2(x) // 3
# remainder = log2(x) % 3
# initial_guess = 2 ** pow * cbrt(2) ** remainder
# substituting -> 2 = 1.26 ≈ 1260 / 1000, we get:
#
# initial_guess = 2 ** pow * 1260 ** remainder // 1000 ** remainder
remainder: uint256 = convert(log2x, uint256) % 3
a: uint256 = unsafe_div(
unsafe_mul(
pow_mod256(2, unsafe_div(convert(log2x, uint256), 3)), # <- pow
pow_mod256(1260, remainder),
),
pow_mod256(1000, remainder),
)
# Because we chose good initial values for cube roots, 7 newton raphson iterations
# are just about sufficient. 6 iterations would result in non-convergences, and 8
# would be one too many iterations. Without initial values, the iteration count
# can go up to 20 or greater. The iterations are unrolled. This reduces gas costs
# but takes up more bytecode:
a = unsafe_div(unsafe_add(unsafe_mul(2, a), unsafe_div(xx, unsafe_mul(a, a))), 3)
a = unsafe_div(unsafe_add(unsafe_mul(2, a), unsafe_div(xx, unsafe_mul(a, a))), 3)
a = unsafe_div(unsafe_add(unsafe_mul(2, a), unsafe_div(xx, unsafe_mul(a, a))), 3)
a = unsafe_div(unsafe_add(unsafe_mul(2, a), unsafe_div(xx, unsafe_mul(a, a))), 3)
a = unsafe_div(unsafe_add(unsafe_mul(2, a), unsafe_div(xx, unsafe_mul(a, a))), 3)
a = unsafe_div(unsafe_add(unsafe_mul(2, a), unsafe_div(xx, unsafe_mul(a, a))), 3)
a = unsafe_div(unsafe_add(unsafe_mul(2, a), unsafe_div(xx, unsafe_mul(a, a))), 3)
if x >= 115792089237316195423570985008687907853269 * 10**18:
a = unsafe_mul(a, 10**12)
elif x >= 115792089237316195423570985008687907853269:
a = unsafe_mul(a, 10**6)
return a
@internal
@pure
def _newton_y(ANN: uint256, gamma: uint256, x: uint256[N_COINS], D: uint256, i: uint256) -> uint256:
"""
Calculating x[i] given other balances x[0..N_COINS-1] and invariant D
ANN = A * N**N
This is computationally expensive.
"""
x_j: uint256 = x[1 - i]
y: uint256 = D**2 / (x_j * N_COINS**2)
K0_i: uint256 = (10**18 * N_COINS) * x_j / D
assert (K0_i > 10**16*N_COINS - 1) and (K0_i < 10**20*N_COINS + 1) # dev: unsafe values x[i]
convergence_limit: uint256 = max(max(x_j / 10**14, D / 10**14), 100)
for j in range(255):
y_prev: uint256 = y
K0: uint256 = K0_i * y * N_COINS / D
S: uint256 = x_j + y
_g1k0: uint256 = gamma + 10**18
if _g1k0 > K0:
_g1k0 = _g1k0 - K0 + 1
else:
_g1k0 = K0 - _g1k0 + 1
# D / (A * N**N) * _g1k0**2 / gamma**2
mul1: uint256 = 10**18 * D / gamma * _g1k0 / gamma * _g1k0 * A_MULTIPLIER / ANN
# 2*K0 / _g1k0
mul2: uint256 = 10**18 + (2 * 10**18) * K0 / _g1k0
yfprime: uint256 = 10**18 * y + S * mul2 + mul1
_dyfprime: uint256 = D * mul2
if yfprime < _dyfprime:
y = y_prev / 2
continue
else:
yfprime -= _dyfprime
fprime: uint256 = yfprime / y
# y -= f / f_prime; y = (y * fprime - f) / fprime
# y = (yfprime + 10**18 * D - 10**18 * S) // fprime + mul1 // fprime * (10**18 - K0) // K0
y_minus: uint256 = mul1 / fprime
y_plus: uint256 = (yfprime + 10**18 * D) / fprime + y_minus * 10**18 / K0
y_minus += 10**18 * S / fprime
if y_plus < y_minus:
y = y_prev / 2
else:
y = y_plus - y_minus
diff: uint256 = 0
if y > y_prev:
diff = y - y_prev
else:
diff = y_prev - y
if diff < max(convergence_limit, y / 10**14):
return y
raise "Did not converge"
@external
@pure
def newton_y(ANN: uint256, gamma: uint256, x: uint256[N_COINS], D: uint256, i: uint256) -> uint256:
# Safety checks
assert ANN > MIN_A - 1 and ANN < MAX_A + 1 # dev: unsafe values A
assert gamma > MIN_GAMMA - 1 and gamma < MAX_GAMMA + 1 # dev: unsafe values gamma
assert D > 10**17 - 1 and D < 10**15 * 10**18 + 1 # dev: unsafe values D
y: uint256 = self._newton_y(ANN, gamma, x, D, i)
frac: uint256 = y * 10**18 / D
assert (frac >= 10**16 - 1) and (frac < 10**20 + 1) # dev: unsafe value for y
return y
@external
@pure
def get_y(
_ANN: uint256,
_gamma: uint256,
_x: uint256[N_COINS],
_D: uint256,
i: uint256
) -> uint256[2]:
# Safety checks
assert _ANN > MIN_A - 1 and _ANN < MAX_A + 1 # dev: unsafe values A
assert _gamma > MIN_GAMMA - 1 and _gamma < MAX_GAMMA + 1 # dev: unsafe values gamma
assert _D > 10**17 - 1 and _D < 10**15 * 10**18 + 1 # dev: unsafe values D
ANN: int256 = convert(_ANN, int256)
gamma: int256 = convert(_gamma, int256)
D: int256 = convert(_D, int256)
x_j: int256 = convert(_x[1 - i], int256)
gamma2: int256 = unsafe_mul(gamma, gamma)
# savediv by x_j done here:
y: int256 = D**2 / (x_j * N_COINS**2)
# K0_i: int256 = (10**18 * N_COINS) * x_j / D
K0_i: int256 = unsafe_div(10**18 * N_COINS * x_j, D)
assert (K0_i > 10**16 * N_COINS - 1) and (K0_i < 10**20 * N_COINS + 1) # dev: unsafe values x[i]
ann_gamma2: int256 = ANN * gamma2
# a = 10**36 / N_COINS**2
a: int256 = 10**32
# b = ANN*D*gamma2/4/10000/x_j/10**4 - 10**32*3 - 2*gamma*10**14
b: int256 = (
D*ann_gamma2/400000000/x_j
- convert(unsafe_mul(10**32, 3), int256)
- unsafe_mul(unsafe_mul(2, gamma), 10**14)
)
# c = 10**32*3 + 4*gamma*10**14 + gamma2/10**4 + 4*ANN*gamma2*x_j/D/10000/4/10**4 - 4*ANN*gamma2/10000/4/10**4
c: int256 = (
unsafe_mul(10**32, convert(3, int256))
+ unsafe_mul(unsafe_mul(4, gamma), 10**14)
+ unsafe_div(gamma2, 10**4)
+ unsafe_div(unsafe_div(unsafe_mul(4, ann_gamma2), 400000000) * x_j, D)
- unsafe_div(unsafe_mul(4, ann_gamma2), 400000000)
)
# d = -(10**18+gamma)**2 / 10**4
d: int256 = -unsafe_div(unsafe_add(10**18, gamma) ** 2, 10**4)
# delta0: int256 = 3*a*c/b - b
delta0: int256 = 3 * a * c / b - b # safediv by b
# delta1: int256 = 9*a*c/b - 2*b - 27*a**2/b*d/b
delta1: int256 = 3 * delta0 + b - 27*a**2/b*d/b
divider: int256 = 1
threshold: int256 = min(min(abs(delta0), abs(delta1)), a)
if threshold > 10**48:
divider = 10**30
elif threshold > 10**46:
divider = 10**28
elif threshold > 10**44:
divider = 10**26
elif threshold > 10**42:
divider = 10**24
elif threshold > 10**40:
divider = 10**22
elif threshold > 10**38:
divider = 10**20
elif threshold > 10**36:
divider = 10**18
elif threshold > 10**34:
divider = 10**16
elif threshold > 10**32:
divider = 10**14
elif threshold > 10**30:
divider = 10**12
elif threshold > 10**28:
divider = 10**10
elif threshold > 10**26:
divider = 10**8
elif threshold > 10**24:
divider = 10**6
elif threshold > 10**20:
divider = 10**2
a = unsafe_div(a, divider)
b = unsafe_div(b, divider)
c = unsafe_div(c, divider)
d = unsafe_div(d, divider)
# delta0 = 3*a*c/b - b: here we can do more unsafe ops now:
delta0 = unsafe_div(unsafe_mul(unsafe_mul(3, a), c), b) - b
# delta1 = 9*a*c/b - 2*b - 27*a**2/b*d/b
delta1 = 3 * delta0 + b - unsafe_div(unsafe_mul(unsafe_div(unsafe_mul(27, a**2), b), d), b)
# sqrt_arg: int256 = delta1**2 + 4*delta0**2/b*delta0
sqrt_arg: int256 = delta1**2 + unsafe_mul(unsafe_div(4*delta0**2, b), delta0)
sqrt_val: int256 = 0
if sqrt_arg > 0:
sqrt_val = convert(isqrt(convert(sqrt_arg, uint256)), int256)
else:
return [
self._newton_y(_ANN, _gamma, _x, _D, i),
0
]
b_cbrt: int256 = 0
if b > 0:
b_cbrt = convert(self._cbrt(convert(b, uint256)), int256)
else:
b_cbrt = -convert(self._cbrt(convert(-b, uint256)), int256)
second_cbrt: int256 = 0
if delta1 > 0:
# second_cbrt = convert(self._cbrt(convert((delta1 + sqrt_val), uint256) / 2), int256)
second_cbrt = convert(self._cbrt(convert(unsafe_add(delta1, sqrt_val), uint256) / 2), int256)
else:
# second_cbrt = -convert(self._cbrt(convert(unsafe_sub(sqrt_val, delta1), uint256) / 2), int256)
second_cbrt = -convert(self._cbrt(unsafe_div(convert(unsafe_sub(sqrt_val, delta1), uint256), 2)), int256)
# C1: int256 = b_cbrt**2/10**18*second_cbrt/10**18
C1: int256 = unsafe_div(unsafe_mul(unsafe_div(b_cbrt**2, 10**18), second_cbrt), 10**18)
# root: int256 = (10**18*C1 - 10**18*b - 10**18*b*delta0/C1)/(3*a), keep 2 safe ops here.
root: int256 = (unsafe_mul(10**18, C1) - unsafe_mul(10**18, b) - unsafe_mul(10**18, b)/C1*delta0)/unsafe_mul(3, a)
# y_out: uint256[2] = [
# convert(D**2/x_j*root/4/10**18, uint256), # <--- y
# convert(root, uint256) # <----------------------- K0Prev
# ]
y_out: uint256[2] = [convert(unsafe_div(unsafe_div(unsafe_mul(unsafe_div(D**2, x_j), root), 4), 10**18), uint256), convert(root, uint256)]
frac: uint256 = unsafe_div(y_out[0] * 10**18, _D)
assert (frac >= 10**16 - 1) and (frac < 10**20 + 1) # dev: unsafe value for y
return y_out
@external
@view
def newton_D(ANN: uint256, gamma: uint256, x_unsorted: uint256[N_COINS], K0_prev: uint256 = 0) -> uint256:
"""
Finding the invariant using Newton method.
ANN is higher by the factor A_MULTIPLIER
ANN is already A * N**N
"""
# Safety checks
assert ANN > MIN_A - 1 and ANN < MAX_A + 1 # dev: unsafe values A
assert gamma > MIN_GAMMA - 1 and gamma < MAX_GAMMA + 1 # dev: unsafe values gamma
# Initial value of invariant D is that for constant-product invariant
x: uint256[N_COINS] = x_unsorted
if x[0] < x[1]:
x = [x_unsorted[1], x_unsorted[0]]
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 = unsafe_add(x[0], x[1]) # can unsafe add here because we checked x[0] bounds
D: uint256 = 0
if K0_prev == 0:
D = N_COINS * isqrt(unsafe_mul(x[0], x[1]))
else:
# D = isqrt(x[0] * x[1] * 4 / K0_prev * 10**18)
D = isqrt(unsafe_mul(unsafe_div(unsafe_mul(unsafe_mul(4, x[0]), x[1]), K0_prev), 10**18))
if S < D:
D = S
__g1k0: uint256 = gamma + 10**18
diff: uint256 = 0
for i in range(255):
D_prev: uint256 = D
assert D > 0
# Unsafe division by D and D_prev is now safe
# K0: uint256 = 10**18
# for _x in x:
# K0 = K0 * _x * N_COINS / D
# collapsed for 2 coins
K0: uint256 = unsafe_div(unsafe_div((10**18 * N_COINS**2) * x[0], D) * x[1], D)
_g1k0: uint256 = __g1k0
if _g1k0 > K0:
_g1k0 = unsafe_add(unsafe_sub(_g1k0, K0), 1) # > 0
else:
_g1k0 = unsafe_add(unsafe_sub(K0, _g1k0), 1) # > 0
# D / (A * N**N) * _g1k0**2 / gamma**2
mul1: uint256 = unsafe_div(unsafe_div(unsafe_div(10**18 * D, gamma) * _g1k0, gamma) * _g1k0 * A_MULTIPLIER, ANN)
# 2*N*K0 / _g1k0
mul2: uint256 = unsafe_div(((2 * 10**18) * N_COINS) * K0, _g1k0)
# calculate neg_fprime. here K0 > 0 is being validated (safediv).
neg_fprime: uint256 = (S + unsafe_div(S * mul2, 10**18)) + mul1 * N_COINS / K0 - unsafe_div(mul2 * D, 10**18)
# D -= f / fprime; neg_fprime safediv being validated
D_plus: uint256 = D * (neg_fprime + S) / neg_fprime
D_minus: uint256 = unsafe_div(D * D, neg_fprime)
if 10**18 > K0:
D_minus += unsafe_div(unsafe_div(D * unsafe_div(mul1, neg_fprime), 10**18) * unsafe_sub(10**18, K0), K0)
else:
D_minus -= unsafe_div(unsafe_div(D * unsafe_div(mul1, neg_fprime), 10**18) * unsafe_sub(K0, 10**18), K0)
if D_plus > D_minus:
D = unsafe_sub(D_plus, D_minus)
else:
D = unsafe_div(unsafe_sub(D_minus, D_plus), 2)
if D > D_prev:
diff = unsafe_sub(D, D_prev)
else:
diff = unsafe_sub(D_prev, D)
if diff * 10**14 < max(10**16, D): # Could reduce precision for gas efficiency here
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]
return D
raise "Did not converge"
@external
@view
def get_p(
_xp: uint256[N_COINS], _D: uint256, _A_gamma: uint256[N_COINS]
) -> uint256:
"""
@notice Calculates dx/dy.
@dev Output needs to be multiplied with price_scale to get the actual value.
@param _xp Balances of the pool.
@param _D Current value of D.
@param _A_gamma Amplification coefficient and gamma.
"""
assert _D > 10**17 - 1 and _D < 10**15 * 10**18 + 1 # dev: unsafe D values
# K0 = P * N**N / D**N.
# K0 is dimensionless and has 10**36 precision:
K0: uint256 = unsafe_div(
unsafe_div(4 * _xp[0] * _xp[1], _D) * 10**36,
_D
)
# GK0 is in 10**36 precision and is dimensionless.
# GK0 = (
# 2 * _K0 * _K0 / 10**36 * _K0 / 10**36
# + (gamma + 10**18)**2
# - (_K0 * _K0 / 10**36 * (2 * gamma + 3 * 10**18) / 10**18)
# )
# GK0 is always positive. So the following should never revert:
GK0: uint256 = (
unsafe_div(unsafe_div(2 * K0 * K0, 10**36) * K0, 10**36)
+ pow_mod256(unsafe_add(_A_gamma[1], 10**18), 2)
- unsafe_div(
unsafe_div(pow_mod256(K0, 2), 10**36) * unsafe_add(unsafe_mul(2, _A_gamma[1]), 3 * 10**18),
10**18
)
)
# NNAG2 = N**N * A * gamma**2
NNAG2: uint256 = unsafe_div(unsafe_mul(_A_gamma[0], pow_mod256(_A_gamma[1], 2)), A_MULTIPLIER)
# denominator = (GK0 + NNAG2 * x / D * _K0 / 10**36)
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 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,
denominator
)
@external
@pure
def wad_exp(x: int256) -> int256:
"""
@dev Calculates the natural exponential function of a signed integer with
a precision of 1e18.
@notice Note that this function consumes about 810 gas units. The implementation
is inspired by Remco Bloemen's implementation under the MIT license here:
https://xn--2-umb.com/22/exp-ln.
@param x The 32-byte variable.
@return int256 The 32-byte calculation result.
"""
value: int256 = x
# If the result is `< 0.5`, we return zero. This happens when we have the following:
# "x <= floor(log(0.5e18) * 1e18) ~ -42e18".
if (x <= -42_139_678_854_452_767_551):
return empty(int256)
# When the result is "> (2 ** 255 - 1) / 1e18" we cannot represent it as a signed integer.
# This happens when "x >= floor(log((2 ** 255 - 1) / 1e18) * 1e18) ~ 135".
assert x < 135_305_999_368_893_231_589, "Math: wad_exp overflow"
# `x` is now in the range "(-42, 136) * 1e18". Convert to "(-42, 136) * 2 ** 96" for higher
# intermediate precision and a binary base. This base conversion is a multiplication with
# "1e18 / 2 ** 96 = 5 ** 18 / 2 ** 78".
value = unsafe_div(x << 78, 5 ** 18)
# Reduce the range of `x` to "(-½ ln 2, ½ ln 2) * 2 ** 96" by factoring out powers of two
# so that "exp(x) = exp(x') * 2 ** k", where `k` is a signer integer. Solving this gives
# "k = round(x / log(2))" and "x' = x - k * log(2)". Thus, `k` is in the range "[-61, 195]".
k: int256 = unsafe_add(unsafe_div(value << 96, 54_916_777_467_707_473_351_141_471_128), 2 ** 95) >> 96
value = unsafe_sub(value, unsafe_mul(k, 54_916_777_467_707_473_351_141_471_128))
# Evaluate using a "(6, 7)"-term rational approximation. Since `p` is monic,
# we will multiply by a scaling factor later.
y: int256 = unsafe_add(unsafe_mul(unsafe_add(value, 1_346_386_616_545_796_478_920_950_773_328), value) >> 96, 57_155_421_227_552_351_082_224_309_758_442)
p: int256 = unsafe_add(unsafe_mul(unsafe_add(unsafe_mul(unsafe_sub(unsafe_add(y, value), 94_201_549_194_550_492_254_356_042_504_812), y) >> 96,\
28_719_021_644_029_726_153_956_944_680_412_240), value), 4_385_272_521_454_847_904_659_076_985_693_276 << 96)
# We leave `p` in the "2 ** 192" base so that we do not have to scale it up
# again for the division.
q: int256 = unsafe_add(unsafe_mul(unsafe_sub(value, 2_855_989_394_907_223_263_936_484_059_900), value) >> 96, 50_020_603_652_535_783_019_961_831_881_945)
q = unsafe_sub(unsafe_mul(q, value) >> 96, 533_845_033_583_426_703_283_633_433_725_380)
q = unsafe_add(unsafe_mul(q, value) >> 96, 3_604_857_256_930_695_427_073_651_918_091_429)
q = unsafe_sub(unsafe_mul(q, value) >> 96, 14_423_608_567_350_463_180_887_372_962_807_573)
q = unsafe_add(unsafe_mul(q, value) >> 96, 26_449_188_498_355_588_339_934_803_723_976_023)
# The polynomial `q` has no zeros in the range because all its roots are complex.
# No scaling is required, as `p` is already "2 ** 96" too large. Also,
# `r` is in the range "(0.09, 0.25) * 2**96" after the division.
r: int256 = unsafe_div(p, q)
# To finalise the calculation, we have to multiply `r` by:
# - the scale factor "s = ~6.031367120",
# - the factor "2 ** k" from the range reduction, and
# - the factor "1e18 / 2 ** 96" for the base conversion.
# We do this all at once, with an intermediate result in "2**213" base,
# so that the final right shift always gives a positive value.
# Note that to circumvent Vyper's safecast feature for the potentially
# negative parameter value `r`, we first convert `r` to `bytes32` and
# subsequently to `uint256`. Remember that the EVM default behaviour is
# to use two's complement representation to handle signed integers.
return convert(unsafe_mul(convert(convert(r, bytes32), uint256), 3_822_833_074_963_236_453_042_738_258_902_158_003_155_416_615_667) >>\
convert(unsafe_sub(195, k), uint256), int256)Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"stateMutability":"pure","type":"function","name":"newton_y","inputs":[{"name":"ANN","type":"uint256"},{"name":"gamma","type":"uint256"},{"name":"x","type":"uint256[2]"},{"name":"D","type":"uint256"},{"name":"i","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"pure","type":"function","name":"get_y","inputs":[{"name":"_ANN","type":"uint256"},{"name":"_gamma","type":"uint256"},{"name":"_x","type":"uint256[2]"},{"name":"_D","type":"uint256"},{"name":"i","type":"uint256"}],"outputs":[{"name":"","type":"uint256[2]"}]},{"stateMutability":"view","type":"function","name":"newton_D","inputs":[{"name":"ANN","type":"uint256"},{"name":"gamma","type":"uint256"},{"name":"x_unsorted","type":"uint256[2]"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"newton_D","inputs":[{"name":"ANN","type":"uint256"},{"name":"gamma","type":"uint256"},{"name":"x_unsorted","type":"uint256[2]"},{"name":"K0_prev","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"get_p","inputs":[{"name":"_xp","type":"uint256[2]"},{"name":"_D","type":"uint256"},{"name":"_A_gamma","type":"uint256[2]"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"pure","type":"function","name":"wad_exp","inputs":[{"name":"x","type":"int256"}],"outputs":[{"name":"","type":"int256"}]},{"stateMutability":"view","type":"function","name":"version","inputs":[],"outputs":[{"name":"","type":"string"}]}]Contract Creation Code
6126ec610011610000396126ec610000f360003560e01c60026006820660011b6126e001601e39600051565b6354fd4d508118611dd657346126db5760208060805260066040527f76322e302e30000000000000000000000000000000000000000000000000000060605260408160800181518152602082015160208201528051806020830101601f82600003163682375050601f19601f8251602001011690509050810190506080f3611dd6565b6329fcfcf28118611dd65760c4361034176126db57610fa060043510156100c55760006100d0565b6302625a0060043511155b156126db576402540be40060243510156100eb5760006100f9565b66071afd498d000060243511155b156126db5767016345785d8a0000608435101561011757600061012c565b6d314dc6448d9338c15b0a0000000060843511155b156126db5760406004604037604060446080376040608460c037610151610340612107565b610340516103205261032051670de0b6b3a7640000810281670de0b6b3a76400008204186126db57905060843580156126db578082049050905061034052662386f26fc0ffff6103405110156101a85760006101b9565b68056bc75e2d631000006103405111155b156126db576020610320f3611dd6565b6343d188fb8118611dd65760c4361034176126db57610fa060043510156101f15760006101fc565b6302625a0060043511155b156126db576402540be4006024351015610217576000610225565b66071afd498d000060243511155b156126db5767016345785d8a00006084351015610243576000610258565b6d314dc6448d9338c15b0a0000000060843511155b156126db576004358060ff1c6126db57610320526024358060ff1c6126db57610340526084358060ff1c6126db576103605260a43580600103600181116126db579050600181116126db5760051b604401358060ff1c6126db57610380526103405161034051026103a052610360516fb504f333f9de6484597d89b3754abea081127fffffffffffffffffffffffffffffffff4afb0ccc06219b7ba682764c8ab54160821316156126db576002810a9050610380518060021b8160048205186126db57905080156126db57808205600160ff1b83141560001983141517156126db57905090506103c0526103605161038051671bc16d674ec80000810281671bc16d674ec800008205186126db579050056103e05266470de4df8200006103e0511215610386576000610397565b680ad78ebc5ac62000006103e05113155b156126db57610320516103a05180820281191515600160ff1b84141517821584848405141716156126db5790509050610400526d04ee2d6d415b85acef810000000061042052610360516104005180820281191515600160ff1b84141517821584848405141716156126db57905090506317d78400810590506103805180156126db57808205600160ff1b83141560001983141517156126db57905090506d0eca8847c4129106ce8300000000600d0b80820382811360008312186126db5790509050655af3107a40006103405160011b0280820382811360008312186126db579050905061044052655af3107a40006103405160021b02806d0eca8847c4129106ce8300000000016d0eca8847c4129106ce8300000000811260008312186126db5790506127106103a0510580820182811260008312186126db5790509050610360516317d784006104005160021b056103805180820281191515600160ff1b84141517821584848405141716156126db57905090500580820182811260008312186126db57905090506317d784006104005160021b0580820382811360008312186126db57905090506104605261271061034051670de0b6b3a7640000016fb504f333f9de6484597d89b3754abea081127fffffffffffffffffffffffffffffffff4afb0ccc06219b7ba682764c8ab54160821316156126db576002810a9050057f800000000000000000000000000000000000000000000000000000000000000081146126db576000036104805261042051600381028160038205186126db5790506104605180820281191515600160ff1b84141517821584848405141716156126db57905090506104405180156126db57808205600160ff1b83141560001983141517156126db57905090506104405180820382811360008312186126db57905090506104a0526104a051600381028160038205186126db5790506104405180820182811260008312186126db5790509050610420516fb504f333f9de6484597d89b3754abea081127fffffffffffffffffffffffffffffffff4afb0ccc06219b7ba682764c8ab54160821316156126db576002810a9050601b810281601b8205186126db5790506104405180156126db57808205600160ff1b83141560001983141517156126db57905090506104805180820281191515600160ff1b84141517821584848405141716156126db57905090506104405180156126db57808205600160ff1b83141560001983141517156126db579050905080820382811360008312186126db57905090506104c05260016104e0526104a0517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8113156107825780610791565b8060000381146126db57806000035b90506104c0517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8113156107c557806107d4565b8060000381146126db57806000035b90508082811882841202189050905061042051808281188284120218905090506105005273af298d050e4395d69670b12b7f41000000000001610500511215610a3f577301c06a5ec5433c60ddaa16406f5a400000000001610500511215610a295772047bf19673df52e37f2410011d100000000001610500511215610a1457710b7abc627050305adf14a3d9e40000000001610500511215610a0057701d6329f1c35ca4bfabb9f56100000000016105005112156109ec576f4b3b4ca85a86c47a098a2240000000016105005112156109d9576ec097ce7bc90715b34b9f10000000016105005112156109c7576e01ed09bead87c0378d8e64000000016105005112156109b6576d04ee2d6d415b85acef81000000016105005112156109a6576c0c9f2c9cd04674edea40000001610500511215610997576b204fce5e3e25026110000001610500511215610988576a52b7d2dcc80cd2e400000161050051121561097a5769d3c21bcecceda100000161050051121561096d5768056bc75e2d631000016105005112610a525760646104e052610a52565b620f42406104e052610a52565b6305f5e1006104e052610a52565b6402540be4006104e052610a52565b64e8d4a510006104e052610a52565b655af3107a40006104e052610a52565b662386f26fc100006104e052610a52565b670de0b6b3a76400006104e052610a52565b68056bc75e2d631000006104e052610a52565b69021e19e0c9bab24000006104e052610a52565b69d3c21bcecceda10000006104e052610a52565b6a52b7d2dcc80cd2e40000006104e052610a52565b6b204fce5e3e250261100000006104e052610a52565b6c0c9f2c9cd04674edea400000006104e0525b6104e0516104205105610420526104e0516104405105610440526104e0516104605105610460526104e05161048051056104805261044051610460516104205160030202056104405180820382811360008312186126db57905090506104a0526104a051600381028160038205186126db5790506104405180820182811260008312186126db5790509050610440516104805161044051610420516fb504f333f9de6484597d89b3754abea081127fffffffffffffffffffffffffffffffff4afb0ccc06219b7ba682764c8ab54160821316156126db576002810a9050601b0205020580820382811360008312186126db57905090506104c0526104c0516fb504f333f9de6484597d89b3754abea081127fffffffffffffffffffffffffffffffff4afb0ccc06219b7ba682764c8ab54160821316156126db576002810a90506104a051610440516104a0516fb504f333f9de6484597d89b3754abea081127fffffffffffffffffffffffffffffffff4afb0ccc06219b7ba682764c8ab54160821316156126db576002810a90508060021b8160048205186126db579050050280820182811260008312186126db5790509050610520526000610540526001610520511215610c575760406004604037604060446080376040608460c037610c3b610560612107565b610560516105805260006105a05260406105806110bb56610d50565b61052051600081126126db578060b5710100000000000000000000000000000000008210610c8c578160801c91508060401b90505b69010000000000000000008210610caa578160401c91508060201b90505b650100000000008210610cc4578160201c91508060101b90505b63010000008210610cdc578160101c91508060081b90505b620100008201810260121c9050808184040160011c9050808184040160011c9050808184040160011c9050808184040160011c9050808184040160011c9050808184040160011c9050808184040160011c905080830480828118828410021890509050905090508060ff1c6126db57610540525b6000610560526001610440511215610de557610440517f800000000000000000000000000000000000000000000000000000000000000081146126db57600003600081126126db5760c052610da6610580611efa565b610580518060ff1c6126db577f800000000000000000000000000000000000000000000000000000000000000081146126db5760000361056052610e10565b61044051600081126126db5760c052610dff610580611efa565b610580518060ff1c6126db57610560525b60006105805260016104c0511215610e83576104c0516105405103600081126126db5760011c60c052610e446105a0611efa565b6105a0518060ff1c6126db577f800000000000000000000000000000000000000000000000000000000000000081146126db5760000361058052610eb9565b610540516104c05101600081126126db578060011c905060c052610ea86105a0611efa565b6105a0518060ff1c6126db57610580525b670de0b6b3a764000061058051670de0b6b3a7640000610560516fb504f333f9de6484597d89b3754abea081127fffffffffffffffffffffffffffffffff4afb0ccc06219b7ba682764c8ab54160821316156126db576002810a90500502056105a0526105a051670de0b6b3a76400000261044051670de0b6b3a76400000280820382811360008312186126db579050905061044051670de0b6b3a7640000026105a05180156126db57808205600160ff1b83141560001983141517156126db57905090506104a05180820281191515600160ff1b84141517821584848405141716156126db579050905080820382811360008312186126db57905090506104205160030280156126db57808205600160ff1b83141560001983141517156126db57905090506105c052670de0b6b3a764000060046105c05161038051610360516fb504f333f9de6484597d89b3754abea081127fffffffffffffffffffffffffffffffff4afb0ccc06219b7ba682764c8ab54160821316156126db576002810a905005020505600081126126db576105e0526105c051600081126126db57610600526084356105e051670de0b6b3a7640000810281670de0b6b3a76400008204186126db5790500461062052662386f26fc0ffff61062051101561109f5760006110b0565b68056bc75e2d631000006106205111155b156126db5760406105e05bf3611dd6565b63b0872d5d81186110e0576084361034176126db57600060405261137a565b6381d18d878118611dd6576024361034176126db576004356040527ffffffffffffffffffffffffffffffffffffffffffffffffdb731c958f34d94c16004351361113257600060605260206060611358565b680755bf798b4a1bf1e460043513156111a25760166060527f4d6174683a207761645f657870206f766572666c6f770000000000000000000060805260605060605180608001601f826000031636823750506308c379a06020526020604052601f19601f6060510116604401603cfd5b6503782dace9d9600435604e1b056040526b8000000000000000000000006bb17217f7d1cf79abc9e3b39860405160601b050160601d6060526bb17217f7d1cf79abc9e3b39860605102604051036040526d02d16720577bd19bf614176fe9ea6040516c10fe68e7fd37d0007b713f7650604051010260601d0160805279d835ebba824c98fb31b83b2ca45c0000000000000000000000006040516e0587f503bb6ea29d25fcb7401964506080516d04a4fd9f2a8b96949216d2255a6c60405160805101030260601d01020160a0526d0277594991cfc85f6e2461837cd96040516c240c330e9fb2d9cbaf0fd5aafc604051030260601d0160c0526d1a521255e34f6a5061b25ef1c9c460405160c0510260601d0360c0526db1bbb201f443cf962f1a1d3db4a560405160c0510260601d0160c0526e02c72388d9f74f51a9331fed693f1560405160c0510260601d0360c0526e05180bb14799ab47a8a8cb2a527d5760405160c0510260601d0160c05260c05160a0510560e05274029d9dc38563c32e5c2f6dc192ee70ef65f9978af360e0510260605160c303600081126126db571c8060ff1c6126db576101005260206101005bf3611dd6565b63e68647668118611b425760a4361034176126db576084356040525b610fa0600435101561138d576000611398565b6302625a0060043511155b156126db576402540be40060243510156113b35760006113c1565b66071afd498d000060243511155b156126db576040604460603760805160605110156113e6576064356060526044356080525b633b9aca0060605110156113fb576000611410565b6d314dc6448d9338c15b0a0000000060605111155b156126db57655af3107a4000606051608051670de0b6b3a7640000810281670de0b6b3a76400008204186126db57905004106126db576080516060510160a052600060c05260405161155b57608051606051028060b571010000000000000000000000000000000000821061148c578160801c91508060401b90505b690100000000000000000082106114aa578160401c91508060201b90505b6501000000000082106114c4578160201c91508060101b90505b630100000082106114dc578160101c91508060081b90505b620100008201810260121c9050808184040160011c9050808184040160011c9050808184040160011c9050808184040160011c9050808184040160011c9050808184040160011c9050808184040160011c905080830480828118828410021890509050905090508060011b818160011c186126db57905060c052611669565b670de0b6b3a764000060405160805160605160021b0204028060b571010000000000000000000000000000000000821061159c578160801c91508060401b90505b690100000000000000000082106115ba578160401c91508060201b90505b6501000000000082106115d4578160201c91508060101b90505b630100000082106115ec578160101c91508060081b90505b620100008201810260121c9050808184040160011c9050808184040160011c9050808184040160011c9050808184040160011c9050808184040160011c9050808184040160011c9050808184040160011c9050808304808281188284100218905090509050905060c05260c05160a05110156116695760a05160c0525b602435670de0b6b3a764000081018181106126db57905060e052600061010052600060ff905b806101205260c0516101405260c051156126db5760c05160c051606051673782dace9d900000810281673782dace9d9000008204186126db579050046080518082028115838383041417156126db5790509050046101605260e051610180526101605161018051116117105760016101805161016051030161018052611721565b600161016051610180510301610180525b60043560243560243560c051670de0b6b3a7640000810281670de0b6b3a76400008204186126db57905004610180518082028115838383041417156126db579050905004610180518082028115838383041417156126db57905090506127108102816127108204186126db579050046101a0526101805161016051673782dace9d900000810281673782dace9d9000008204186126db579050046101c05260a051670de0b6b3a764000060a0516101c0518082028115838383041417156126db5790509050048082018281106126db57905090506101a0518060011b818160011c186126db5790506101605180156126db57808204905090508082018281106126db5790509050670de0b6b3a76400006101c05160c0518082028115838383041417156126db5790509050048082038281116126db57905090506101e05260c0516101e05160a0518082018281106126db57905090508082028115838383041417156126db57905090506101e05180156126db5780820490509050610200526101e05160c05160c0518082028115838383041417156126db57905090500461022052670de0b6b3a763ffff610160511115611942576102205161016051670de0b6b3a764000060c0516101e0516101a051048082028115838383041417156126db579050905004670de0b6b3a764000061016051038082028115838383041417156126db5790509050048082038281116126db5790509050610220526119aa565b6102205161016051670de0b6b3a764000060c0516101e0516101a051048082028115838383041417156126db57905090500461016051670de0b6b3a7640000038082028115838383041417156126db5790509050048082018281106126db5790509050610220525b6102205161020051116119cb5761020051610220510360011c60c0526119d8565b61022051610200510360c0525b6101405160c051116119f55760c051610140510361010052611a02565b6101405160c05103610100525b60c05180662386f26fc10000811882662386f26fc10000110218905061010051655af3107a4000810281655af3107a40008204186126db5790501015611ad05760006002905b8060051b606001516102405261024051670de0b6b3a7640000810281670de0b6b3a76400008204186126db57905060c05180156126db578082049050905061026052662386f26fc0ffff610260511015611aa3576000611ab4565b68056bc75e2d631000006102605111155b156126db57600101818118611a485750505050602060c0611b40565b60010181811861168f5750506010610120527f446964206e6f7420636f6e7665726765000000000000000000000000000000006101405261012050610120518061014001601f826000031636823750506308c379a060e052602061010052601f19601f61012051011660440160fcfd5bf35b637e0e395e8118611dd65760a4361034176126db5767016345785d8a00006044351015611b70576000611b85565b6d314dc6448d9338c15b0a0000000060443511155b156126db576044356044356004358060021b818160021c186126db5790506024358082028115838383041417156126db5790509050046ec097ce7bc90715b34b9f10000000008102816ec097ce7bc90715b34b9f10000000008204186126db579050046040526ec097ce7bc90715b34b9f10000000006ec097ce7bc90715b34b9f10000000006040518060011b818160011c186126db5790506040518082028115838383041417156126db5790509050046040518082028115838383041417156126db5790509050046002670de0b6b3a7640000608435010a8082018281106126db5790509050670de0b6b3a76400006ec097ce7bc90715b34b9f100000000060026040510a046729a2241af62c000060843560011b018082028115838383041417156126db5790509050048082038281116126db579050905060605261271060026084350a60643502046080526060516ec097ce7bc90715b34b9f10000000006044356080516004358082028115838383041417156126db5790509050046040518082028115838383041417156126db5790509050048082018281106126db579050905060a05260a0516004356060516ec097ce7bc90715b34b9f10000000006044356080516024358082028115838383041417156126db5790509050046040518082028115838383041417156126db5790509050048082018281106126db57905090508082028115838383041417156126db579050905060243580156126db5780820490509050670de0b6b3a7640000810281670de0b6b3a76400008204186126db5790500460c052602060c0f35b60006000fd5b604051608052600060a05260405160801c15611e015760405160801c608052608060a0525b60805160401c15611e1f5760805160401c608052604060a0510160a0525b60805160201c15611e3d5760805160201c608052602060a0510160a0525b60805160101c15611e5b5760805160101c608052601060a0510160a0525b60805160081c15611e795760805160081c608052600860a0510160a0525b60805160041c15611e975760805160041c608052600460a0510160a0525b60805160021c15611eb55760805160021c608052600260a0510160a0525b60805160011c15611eca57600160a0510160a0525b606051611ed8576000611ee3565b604051600160a0511b105b15611ef257600160a0510160a0525b60a051815250565b600060e0527812725dd1d243aba0e75fe645cc4873f9e64d542c5db234000060c0511015611f6f57710154484932d2e725a5bbca17a3aba173d3d560c0511015611f5a576ec097ce7bc90715b34b9f100000000060c0510260e052611f76565b670de0b6b3a764000060c0510260e052611f76565b60c05160e0525b60e0516040526000606052611f8c610120611ddc565b610120518060ff1c6126db576101005261010051600081126126db5760038106905061012052610120516103e80a610120516104ec0a600361010051600081126126db570460020a020461014052600361014051610140510260e051046101405160011b010461014052600361014051610140510260e051046101405160011b010461014052600361014051610140510260e051046101405160011b010461014052600361014051610140510260e051046101405160011b010461014052600361014051610140510260e051046101405160011b010461014052600361014051610140510260e051046101405160011b010461014052600361014051610140510260e051046101405160011b0104610140527812725dd1d243aba0e75fe645cc4873f9e64d542c5db234000060c05110156120ee57710154484932d2e725a5bbca17a3aba173d3d560c051106120fe57620f42406101405102610140526120fe565b64e8d4a510006101405102610140525b61014051815250565b60e05180600103600181116126db579050600181116126db5760051b608001516101005260c0516fffffffffffffffffffffffffffffffff81116126db576002810a9050610100518060021b818160021c186126db57905080156126db57808204905090506101205261010051671bc16d674ec80000810281671bc16d674ec800008204186126db57905060c05180156126db57808204905090506101405266470de4df8200006101405110156121bf5760006121d0565b680ad78ebc5ac62000006101405111155b156126db5761010051655af3107a40008104905060c051655af3107a400081049050808281188284110218905090506064818118606483110218905061016052600060ff905b8061018052610120516101a05261014051610120518082028115838383041417156126db57905090508060011b818160011c186126db57905060c05180156126db57808204905090506101c05261010051610120518082018281106126db57905090506101e052606051670de0b6b3a764000081018181106126db579050610200526101c05161020051116122d1576101c051610200518082038281116126db5790509050600181018181106126db579050610200526122f9565b610200516101c0518082038281116126db5790509050600181018181106126db579050610200525b60c051670de0b6b3a7640000810281670de0b6b3a76400008204186126db57905060605180156126db5780820490509050610200518082028115838383041417156126db579050905060605180156126db5780820490509050610200518082028115838383041417156126db57905090506127108102816127108204186126db57905060405180156126db5780820490509050610220526101c051671bc16d674ec80000810281671bc16d674ec800008204186126db5790506102005180156126db578082049050905080670de0b6b3a764000001670de0b6b3a764000081106126db5790506102405261012051670de0b6b3a7640000810281670de0b6b3a76400008204186126db5790506101e051610240518082028115838383041417156126db57905090508082018281106126db5790509050610220518082018281106126db57905090506102605260c051610240518082028115838383041417156126db5790509050610280526102805161026051106124905761026051610280518082038281116126db5790509050610260526124a3565b6101a0518060011c905061012052612667565b610260516101205180156126db57808204905090506102a052610220516102a05180156126db57808204905090506102c0526102605160c051670de0b6b3a7640000810281670de0b6b3a76400008204186126db5790508082018281106126db57905090506102a05180156126db57808204905090506102c051670de0b6b3a7640000810281670de0b6b3a76400008204186126db5790506101c05180156126db57808204905090508082018281106126db57905090506102e0526102c0516101e051670de0b6b3a7640000810281670de0b6b3a76400008204186126db5790506102a05180156126db57808204905090508082018281106126db57905090506102c0526102c0516102e051106125d3576102e0516102c0518082038281116126db5790509050610120526125e2565b6101a0518060011c9050610120525b6000610300526101a0516101205111612614576101a051610120518082038281116126db57905090506103005261262f565b610120516101a0518082038281116126db5790509050610300525b6101605161012051655af3107a40008104905080828118828411021890509050610300511015612667576101205183525050506126d9565b6001018181186122165750506010610180527f446964206e6f7420636f6e7665726765000000000000000000000000000000006101a0526101805061018051806101a001601f826000031636823750506308c379a061014052602061016052601f19601f61018051011660440161015cfd5b565b600080fd135e1dd6001a01c9009d10c1841926ec810c00a16576797065728300030a0014
Deployed Bytecode
0x60003560e01c60026006820660011b6126e001601e39600051565b6354fd4d508118611dd657346126db5760208060805260066040527f76322e302e30000000000000000000000000000000000000000000000000000060605260408160800181518152602082015160208201528051806020830101601f82600003163682375050601f19601f8251602001011690509050810190506080f3611dd6565b6329fcfcf28118611dd65760c4361034176126db57610fa060043510156100c55760006100d0565b6302625a0060043511155b156126db576402540be40060243510156100eb5760006100f9565b66071afd498d000060243511155b156126db5767016345785d8a0000608435101561011757600061012c565b6d314dc6448d9338c15b0a0000000060843511155b156126db5760406004604037604060446080376040608460c037610151610340612107565b610340516103205261032051670de0b6b3a7640000810281670de0b6b3a76400008204186126db57905060843580156126db578082049050905061034052662386f26fc0ffff6103405110156101a85760006101b9565b68056bc75e2d631000006103405111155b156126db576020610320f3611dd6565b6343d188fb8118611dd65760c4361034176126db57610fa060043510156101f15760006101fc565b6302625a0060043511155b156126db576402540be4006024351015610217576000610225565b66071afd498d000060243511155b156126db5767016345785d8a00006084351015610243576000610258565b6d314dc6448d9338c15b0a0000000060843511155b156126db576004358060ff1c6126db57610320526024358060ff1c6126db57610340526084358060ff1c6126db576103605260a43580600103600181116126db579050600181116126db5760051b604401358060ff1c6126db57610380526103405161034051026103a052610360516fb504f333f9de6484597d89b3754abea081127fffffffffffffffffffffffffffffffff4afb0ccc06219b7ba682764c8ab54160821316156126db576002810a9050610380518060021b8160048205186126db57905080156126db57808205600160ff1b83141560001983141517156126db57905090506103c0526103605161038051671bc16d674ec80000810281671bc16d674ec800008205186126db579050056103e05266470de4df8200006103e0511215610386576000610397565b680ad78ebc5ac62000006103e05113155b156126db57610320516103a05180820281191515600160ff1b84141517821584848405141716156126db5790509050610400526d04ee2d6d415b85acef810000000061042052610360516104005180820281191515600160ff1b84141517821584848405141716156126db57905090506317d78400810590506103805180156126db57808205600160ff1b83141560001983141517156126db57905090506d0eca8847c4129106ce8300000000600d0b80820382811360008312186126db5790509050655af3107a40006103405160011b0280820382811360008312186126db579050905061044052655af3107a40006103405160021b02806d0eca8847c4129106ce8300000000016d0eca8847c4129106ce8300000000811260008312186126db5790506127106103a0510580820182811260008312186126db5790509050610360516317d784006104005160021b056103805180820281191515600160ff1b84141517821584848405141716156126db57905090500580820182811260008312186126db57905090506317d784006104005160021b0580820382811360008312186126db57905090506104605261271061034051670de0b6b3a7640000016fb504f333f9de6484597d89b3754abea081127fffffffffffffffffffffffffffffffff4afb0ccc06219b7ba682764c8ab54160821316156126db576002810a9050057f800000000000000000000000000000000000000000000000000000000000000081146126db576000036104805261042051600381028160038205186126db5790506104605180820281191515600160ff1b84141517821584848405141716156126db57905090506104405180156126db57808205600160ff1b83141560001983141517156126db57905090506104405180820382811360008312186126db57905090506104a0526104a051600381028160038205186126db5790506104405180820182811260008312186126db5790509050610420516fb504f333f9de6484597d89b3754abea081127fffffffffffffffffffffffffffffffff4afb0ccc06219b7ba682764c8ab54160821316156126db576002810a9050601b810281601b8205186126db5790506104405180156126db57808205600160ff1b83141560001983141517156126db57905090506104805180820281191515600160ff1b84141517821584848405141716156126db57905090506104405180156126db57808205600160ff1b83141560001983141517156126db579050905080820382811360008312186126db57905090506104c05260016104e0526104a0517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8113156107825780610791565b8060000381146126db57806000035b90506104c0517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8113156107c557806107d4565b8060000381146126db57806000035b90508082811882841202189050905061042051808281188284120218905090506105005273af298d050e4395d69670b12b7f41000000000001610500511215610a3f577301c06a5ec5433c60ddaa16406f5a400000000001610500511215610a295772047bf19673df52e37f2410011d100000000001610500511215610a1457710b7abc627050305adf14a3d9e40000000001610500511215610a0057701d6329f1c35ca4bfabb9f56100000000016105005112156109ec576f4b3b4ca85a86c47a098a2240000000016105005112156109d9576ec097ce7bc90715b34b9f10000000016105005112156109c7576e01ed09bead87c0378d8e64000000016105005112156109b6576d04ee2d6d415b85acef81000000016105005112156109a6576c0c9f2c9cd04674edea40000001610500511215610997576b204fce5e3e25026110000001610500511215610988576a52b7d2dcc80cd2e400000161050051121561097a5769d3c21bcecceda100000161050051121561096d5768056bc75e2d631000016105005112610a525760646104e052610a52565b620f42406104e052610a52565b6305f5e1006104e052610a52565b6402540be4006104e052610a52565b64e8d4a510006104e052610a52565b655af3107a40006104e052610a52565b662386f26fc100006104e052610a52565b670de0b6b3a76400006104e052610a52565b68056bc75e2d631000006104e052610a52565b69021e19e0c9bab24000006104e052610a52565b69d3c21bcecceda10000006104e052610a52565b6a52b7d2dcc80cd2e40000006104e052610a52565b6b204fce5e3e250261100000006104e052610a52565b6c0c9f2c9cd04674edea400000006104e0525b6104e0516104205105610420526104e0516104405105610440526104e0516104605105610460526104e05161048051056104805261044051610460516104205160030202056104405180820382811360008312186126db57905090506104a0526104a051600381028160038205186126db5790506104405180820182811260008312186126db5790509050610440516104805161044051610420516fb504f333f9de6484597d89b3754abea081127fffffffffffffffffffffffffffffffff4afb0ccc06219b7ba682764c8ab54160821316156126db576002810a9050601b0205020580820382811360008312186126db57905090506104c0526104c0516fb504f333f9de6484597d89b3754abea081127fffffffffffffffffffffffffffffffff4afb0ccc06219b7ba682764c8ab54160821316156126db576002810a90506104a051610440516104a0516fb504f333f9de6484597d89b3754abea081127fffffffffffffffffffffffffffffffff4afb0ccc06219b7ba682764c8ab54160821316156126db576002810a90508060021b8160048205186126db579050050280820182811260008312186126db5790509050610520526000610540526001610520511215610c575760406004604037604060446080376040608460c037610c3b610560612107565b610560516105805260006105a05260406105806110bb56610d50565b61052051600081126126db578060b5710100000000000000000000000000000000008210610c8c578160801c91508060401b90505b69010000000000000000008210610caa578160401c91508060201b90505b650100000000008210610cc4578160201c91508060101b90505b63010000008210610cdc578160101c91508060081b90505b620100008201810260121c9050808184040160011c9050808184040160011c9050808184040160011c9050808184040160011c9050808184040160011c9050808184040160011c9050808184040160011c905080830480828118828410021890509050905090508060ff1c6126db57610540525b6000610560526001610440511215610de557610440517f800000000000000000000000000000000000000000000000000000000000000081146126db57600003600081126126db5760c052610da6610580611efa565b610580518060ff1c6126db577f800000000000000000000000000000000000000000000000000000000000000081146126db5760000361056052610e10565b61044051600081126126db5760c052610dff610580611efa565b610580518060ff1c6126db57610560525b60006105805260016104c0511215610e83576104c0516105405103600081126126db5760011c60c052610e446105a0611efa565b6105a0518060ff1c6126db577f800000000000000000000000000000000000000000000000000000000000000081146126db5760000361058052610eb9565b610540516104c05101600081126126db578060011c905060c052610ea86105a0611efa565b6105a0518060ff1c6126db57610580525b670de0b6b3a764000061058051670de0b6b3a7640000610560516fb504f333f9de6484597d89b3754abea081127fffffffffffffffffffffffffffffffff4afb0ccc06219b7ba682764c8ab54160821316156126db576002810a90500502056105a0526105a051670de0b6b3a76400000261044051670de0b6b3a76400000280820382811360008312186126db579050905061044051670de0b6b3a7640000026105a05180156126db57808205600160ff1b83141560001983141517156126db57905090506104a05180820281191515600160ff1b84141517821584848405141716156126db579050905080820382811360008312186126db57905090506104205160030280156126db57808205600160ff1b83141560001983141517156126db57905090506105c052670de0b6b3a764000060046105c05161038051610360516fb504f333f9de6484597d89b3754abea081127fffffffffffffffffffffffffffffffff4afb0ccc06219b7ba682764c8ab54160821316156126db576002810a905005020505600081126126db576105e0526105c051600081126126db57610600526084356105e051670de0b6b3a7640000810281670de0b6b3a76400008204186126db5790500461062052662386f26fc0ffff61062051101561109f5760006110b0565b68056bc75e2d631000006106205111155b156126db5760406105e05bf3611dd6565b63b0872d5d81186110e0576084361034176126db57600060405261137a565b6381d18d878118611dd6576024361034176126db576004356040527ffffffffffffffffffffffffffffffffffffffffffffffffdb731c958f34d94c16004351361113257600060605260206060611358565b680755bf798b4a1bf1e460043513156111a25760166060527f4d6174683a207761645f657870206f766572666c6f770000000000000000000060805260605060605180608001601f826000031636823750506308c379a06020526020604052601f19601f6060510116604401603cfd5b6503782dace9d9600435604e1b056040526b8000000000000000000000006bb17217f7d1cf79abc9e3b39860405160601b050160601d6060526bb17217f7d1cf79abc9e3b39860605102604051036040526d02d16720577bd19bf614176fe9ea6040516c10fe68e7fd37d0007b713f7650604051010260601d0160805279d835ebba824c98fb31b83b2ca45c0000000000000000000000006040516e0587f503bb6ea29d25fcb7401964506080516d04a4fd9f2a8b96949216d2255a6c60405160805101030260601d01020160a0526d0277594991cfc85f6e2461837cd96040516c240c330e9fb2d9cbaf0fd5aafc604051030260601d0160c0526d1a521255e34f6a5061b25ef1c9c460405160c0510260601d0360c0526db1bbb201f443cf962f1a1d3db4a560405160c0510260601d0160c0526e02c72388d9f74f51a9331fed693f1560405160c0510260601d0360c0526e05180bb14799ab47a8a8cb2a527d5760405160c0510260601d0160c05260c05160a0510560e05274029d9dc38563c32e5c2f6dc192ee70ef65f9978af360e0510260605160c303600081126126db571c8060ff1c6126db576101005260206101005bf3611dd6565b63e68647668118611b425760a4361034176126db576084356040525b610fa0600435101561138d576000611398565b6302625a0060043511155b156126db576402540be40060243510156113b35760006113c1565b66071afd498d000060243511155b156126db576040604460603760805160605110156113e6576064356060526044356080525b633b9aca0060605110156113fb576000611410565b6d314dc6448d9338c15b0a0000000060605111155b156126db57655af3107a4000606051608051670de0b6b3a7640000810281670de0b6b3a76400008204186126db57905004106126db576080516060510160a052600060c05260405161155b57608051606051028060b571010000000000000000000000000000000000821061148c578160801c91508060401b90505b690100000000000000000082106114aa578160401c91508060201b90505b6501000000000082106114c4578160201c91508060101b90505b630100000082106114dc578160101c91508060081b90505b620100008201810260121c9050808184040160011c9050808184040160011c9050808184040160011c9050808184040160011c9050808184040160011c9050808184040160011c9050808184040160011c905080830480828118828410021890509050905090508060011b818160011c186126db57905060c052611669565b670de0b6b3a764000060405160805160605160021b0204028060b571010000000000000000000000000000000000821061159c578160801c91508060401b90505b690100000000000000000082106115ba578160401c91508060201b90505b6501000000000082106115d4578160201c91508060101b90505b630100000082106115ec578160101c91508060081b90505b620100008201810260121c9050808184040160011c9050808184040160011c9050808184040160011c9050808184040160011c9050808184040160011c9050808184040160011c9050808184040160011c9050808304808281188284100218905090509050905060c05260c05160a05110156116695760a05160c0525b602435670de0b6b3a764000081018181106126db57905060e052600061010052600060ff905b806101205260c0516101405260c051156126db5760c05160c051606051673782dace9d900000810281673782dace9d9000008204186126db579050046080518082028115838383041417156126db5790509050046101605260e051610180526101605161018051116117105760016101805161016051030161018052611721565b600161016051610180510301610180525b60043560243560243560c051670de0b6b3a7640000810281670de0b6b3a76400008204186126db57905004610180518082028115838383041417156126db579050905004610180518082028115838383041417156126db57905090506127108102816127108204186126db579050046101a0526101805161016051673782dace9d900000810281673782dace9d9000008204186126db579050046101c05260a051670de0b6b3a764000060a0516101c0518082028115838383041417156126db5790509050048082018281106126db57905090506101a0518060011b818160011c186126db5790506101605180156126db57808204905090508082018281106126db5790509050670de0b6b3a76400006101c05160c0518082028115838383041417156126db5790509050048082038281116126db57905090506101e05260c0516101e05160a0518082018281106126db57905090508082028115838383041417156126db57905090506101e05180156126db5780820490509050610200526101e05160c05160c0518082028115838383041417156126db57905090500461022052670de0b6b3a763ffff610160511115611942576102205161016051670de0b6b3a764000060c0516101e0516101a051048082028115838383041417156126db579050905004670de0b6b3a764000061016051038082028115838383041417156126db5790509050048082038281116126db5790509050610220526119aa565b6102205161016051670de0b6b3a764000060c0516101e0516101a051048082028115838383041417156126db57905090500461016051670de0b6b3a7640000038082028115838383041417156126db5790509050048082018281106126db5790509050610220525b6102205161020051116119cb5761020051610220510360011c60c0526119d8565b61022051610200510360c0525b6101405160c051116119f55760c051610140510361010052611a02565b6101405160c05103610100525b60c05180662386f26fc10000811882662386f26fc10000110218905061010051655af3107a4000810281655af3107a40008204186126db5790501015611ad05760006002905b8060051b606001516102405261024051670de0b6b3a7640000810281670de0b6b3a76400008204186126db57905060c05180156126db578082049050905061026052662386f26fc0ffff610260511015611aa3576000611ab4565b68056bc75e2d631000006102605111155b156126db57600101818118611a485750505050602060c0611b40565b60010181811861168f5750506010610120527f446964206e6f7420636f6e7665726765000000000000000000000000000000006101405261012050610120518061014001601f826000031636823750506308c379a060e052602061010052601f19601f61012051011660440160fcfd5bf35b637e0e395e8118611dd65760a4361034176126db5767016345785d8a00006044351015611b70576000611b85565b6d314dc6448d9338c15b0a0000000060443511155b156126db576044356044356004358060021b818160021c186126db5790506024358082028115838383041417156126db5790509050046ec097ce7bc90715b34b9f10000000008102816ec097ce7bc90715b34b9f10000000008204186126db579050046040526ec097ce7bc90715b34b9f10000000006ec097ce7bc90715b34b9f10000000006040518060011b818160011c186126db5790506040518082028115838383041417156126db5790509050046040518082028115838383041417156126db5790509050046002670de0b6b3a7640000608435010a8082018281106126db5790509050670de0b6b3a76400006ec097ce7bc90715b34b9f100000000060026040510a046729a2241af62c000060843560011b018082028115838383041417156126db5790509050048082038281116126db579050905060605261271060026084350a60643502046080526060516ec097ce7bc90715b34b9f10000000006044356080516004358082028115838383041417156126db5790509050046040518082028115838383041417156126db5790509050048082018281106126db579050905060a05260a0516004356060516ec097ce7bc90715b34b9f10000000006044356080516024358082028115838383041417156126db5790509050046040518082028115838383041417156126db5790509050048082018281106126db57905090508082028115838383041417156126db579050905060243580156126db5780820490509050670de0b6b3a7640000810281670de0b6b3a76400008204186126db5790500460c052602060c0f35b60006000fd5b604051608052600060a05260405160801c15611e015760405160801c608052608060a0525b60805160401c15611e1f5760805160401c608052604060a0510160a0525b60805160201c15611e3d5760805160201c608052602060a0510160a0525b60805160101c15611e5b5760805160101c608052601060a0510160a0525b60805160081c15611e795760805160081c608052600860a0510160a0525b60805160041c15611e975760805160041c608052600460a0510160a0525b60805160021c15611eb55760805160021c608052600260a0510160a0525b60805160011c15611eca57600160a0510160a0525b606051611ed8576000611ee3565b604051600160a0511b105b15611ef257600160a0510160a0525b60a051815250565b600060e0527812725dd1d243aba0e75fe645cc4873f9e64d542c5db234000060c0511015611f6f57710154484932d2e725a5bbca17a3aba173d3d560c0511015611f5a576ec097ce7bc90715b34b9f100000000060c0510260e052611f76565b670de0b6b3a764000060c0510260e052611f76565b60c05160e0525b60e0516040526000606052611f8c610120611ddc565b610120518060ff1c6126db576101005261010051600081126126db5760038106905061012052610120516103e80a610120516104ec0a600361010051600081126126db570460020a020461014052600361014051610140510260e051046101405160011b010461014052600361014051610140510260e051046101405160011b010461014052600361014051610140510260e051046101405160011b010461014052600361014051610140510260e051046101405160011b010461014052600361014051610140510260e051046101405160011b010461014052600361014051610140510260e051046101405160011b010461014052600361014051610140510260e051046101405160011b0104610140527812725dd1d243aba0e75fe645cc4873f9e64d542c5db234000060c05110156120ee57710154484932d2e725a5bbca17a3aba173d3d560c051106120fe57620f42406101405102610140526120fe565b64e8d4a510006101405102610140525b61014051815250565b60e05180600103600181116126db579050600181116126db5760051b608001516101005260c0516fffffffffffffffffffffffffffffffff81116126db576002810a9050610100518060021b818160021c186126db57905080156126db57808204905090506101205261010051671bc16d674ec80000810281671bc16d674ec800008204186126db57905060c05180156126db57808204905090506101405266470de4df8200006101405110156121bf5760006121d0565b680ad78ebc5ac62000006101405111155b156126db5761010051655af3107a40008104905060c051655af3107a400081049050808281188284110218905090506064818118606483110218905061016052600060ff905b8061018052610120516101a05261014051610120518082028115838383041417156126db57905090508060011b818160011c186126db57905060c05180156126db57808204905090506101c05261010051610120518082018281106126db57905090506101e052606051670de0b6b3a764000081018181106126db579050610200526101c05161020051116122d1576101c051610200518082038281116126db5790509050600181018181106126db579050610200526122f9565b610200516101c0518082038281116126db5790509050600181018181106126db579050610200525b60c051670de0b6b3a7640000810281670de0b6b3a76400008204186126db57905060605180156126db5780820490509050610200518082028115838383041417156126db579050905060605180156126db5780820490509050610200518082028115838383041417156126db57905090506127108102816127108204186126db57905060405180156126db5780820490509050610220526101c051671bc16d674ec80000810281671bc16d674ec800008204186126db5790506102005180156126db578082049050905080670de0b6b3a764000001670de0b6b3a764000081106126db5790506102405261012051670de0b6b3a7640000810281670de0b6b3a76400008204186126db5790506101e051610240518082028115838383041417156126db57905090508082018281106126db5790509050610220518082018281106126db57905090506102605260c051610240518082028115838383041417156126db5790509050610280526102805161026051106124905761026051610280518082038281116126db5790509050610260526124a3565b6101a0518060011c905061012052612667565b610260516101205180156126db57808204905090506102a052610220516102a05180156126db57808204905090506102c0526102605160c051670de0b6b3a7640000810281670de0b6b3a76400008204186126db5790508082018281106126db57905090506102a05180156126db57808204905090506102c051670de0b6b3a7640000810281670de0b6b3a76400008204186126db5790506101c05180156126db57808204905090508082018281106126db57905090506102e0526102c0516101e051670de0b6b3a7640000810281670de0b6b3a76400008204186126db5790506102a05180156126db57808204905090508082018281106126db57905090506102c0526102c0516102e051106125d3576102e0516102c0518082038281116126db5790509050610120526125e2565b6101a0518060011c9050610120525b6000610300526101a0516101205111612614576101a051610120518082038281116126db57905090506103005261262f565b610120516101a0518082038281116126db5790509050610300525b6101605161012051655af3107a40008104905080828118828411021890509050610300511015612667576101205183525050506126d9565b6001018181186122165750506010610180527f446964206e6f7420636f6e7665726765000000000000000000000000000000006101a0526101805061018051806101a001601f826000031636823750506308c379a061014052602061016052601f19601f61018051011660440161015cfd5b565b600080fd135e1dd6001a01c9009d10c1
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in FRAX
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.