ETH Price: $2,638.18 (+0.82%)

Contract

0xf253f83AcA21aAbD2A20553AE0BF7F65C755A07F
 
Transaction Hash
Method
Block
From
To
Remove_liquidity...205767312024-08-21 11:34:3540 hrs ago1724240075IN
0xf253f83A...5C755A07F
0 ETH0.000077480.76637972
Remove_liquidity203119112024-07-15 12:28:1138 days ago1721046491IN
0xf253f83A...5C755A07F
0 ETH0.000821183.71636167
Remove_liquidity201230682024-06-19 3:19:4765 days ago1718767187IN
0xf253f83A...5C755A07F
0 ETH0.000961575.14922915
Remove_liquidity200549082024-06-09 14:37:1174 days ago1717943831IN
0xf253f83A...5C755A07F
0 ETH0.002031429.96453779
Remove_liquidity...198476332024-05-11 15:17:47103 days ago1715440667IN
0xf253f83A...5C755A07F
0 ETH0.000805436.87
Remove_liquidity...198239612024-05-08 7:49:59106 days ago1715154599IN
0xf253f83A...5C755A07F
0 ETH0.001166085.64643706
Remove_liquidity198163552024-05-07 6:19:11107 days ago1715062751IN
0xf253f83A...5C755A07F
0 ETH0.001258036.25722252
Remove_liquidity198163462024-05-07 6:17:23107 days ago1715062643IN
0xf253f83A...5C755A07F
0 ETH0.001283095.80613899
Exchange198163262024-05-07 6:13:23107 days ago1715062403IN
0xf253f83A...5C755A07F
0 ETH0.001257136.50693757
Exchange198163182024-05-07 6:11:47107 days ago1715062307IN
0xf253f83A...5C755A07F
0 ETH0.00131486.64127048
Remove_liquidity198162552024-05-07 5:58:59107 days ago1715061539IN
0xf253f83A...5C755A07F
0 ETH0.001359376.1513355
Remove_liquidity...198161822024-05-07 5:43:59107 days ago1715060639IN
0xf253f83A...5C755A07F
0 ETH0.000616655.25930881
Exchange198161462024-05-07 5:36:47107 days ago1715060207IN
0xf253f83A...5C755A07F
0 ETH0.000811314.21018466
Remove_liquidity198160782024-05-07 5:22:59107 days ago1715059379IN
0xf253f83A...5C755A07F
0 ETH0.000799583.92213384
Remove_liquidity...198111502024-05-06 12:49:59108 days ago1714999799IN
0xf253f83A...5C755A07F
0 ETH0.001760779.24839027
Remove_liquidity...197953512024-05-04 7:48:47110 days ago1714808927IN
0xf253f83A...5C755A07F
0 ETH0.00073186.2953492
Remove_liquidity...197762532024-05-01 15:43:59113 days ago1714578239IN
0xf253f83A...5C755A07F
0 ETH0.00108128.93399417
Remove_liquidity197468942024-04-27 13:14:23117 days ago1714223663IN
0xf253f83A...5C755A07F
0 ETH0.001443066.61565796
Remove_liquidity...197387832024-04-26 9:57:23118 days ago1714125443IN
0xf253f83A...5C755A07F
0 ETH0.000813947.0776359
Remove_liquidity...197305192024-04-25 6:13:35119 days ago1714025615IN
0xf253f83A...5C755A07F
0 ETH0.000832497.24122783
Remove_liquidity...196969672024-04-20 13:37:35124 days ago1713620255IN
0xf253f83A...5C755A07F
0 ETH0.000900377.83162384
Remove_liquidity...195997392024-04-06 22:44:35138 days ago1712443475IN
0xf253f83A...5C755A07F
0 ETH0.0011725310.2
Remove_liquidity...195958372024-04-06 9:37:47138 days ago1712396267IN
0xf253f83A...5C755A07F
0 ETH0.0014341912.474938
Remove_liquidity194896652024-03-22 10:47:35153 days ago1711104455IN
0xf253f83A...5C755A07F
0 ETH0.0054117224.49133013
Remove_liquidity194895882024-03-22 10:31:59153 days ago1711103519IN
0xf253f83A...5C755A07F
0 ETH0.0048458422.21303698
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Vyper_contract

Compiler Version
vyper:0.3.3

Optimization Enabled:
N/A

Other Settings:
None license

Contract Source Code (Vyper language format)

# @version 0.3.3
"""
@title StableSwap
@author Curve.Fi
@license Copyright (c) Curve.Fi, 2020 - all rights reserved
@notice Minimal pool implementation with no lending
@dev This contract is only a template, pool-specific constants
     must be set prior to compiling
"""

from vyper.interfaces import ERC20

interface CurveToken:
    def totalSupply() -> uint256: view
    def mint(_to: address, _value: uint256) -> bool: nonpayable
    def burnFrom(_to: address, _value: uint256) -> bool: nonpayable


# Events
event TokenExchange:
    buyer: indexed(address)
    sold_id: int128
    tokens_sold: uint256
    bought_id: int128
    tokens_bought: uint256

event AddLiquidity:
    provider: indexed(address)
    token_amounts: uint256[N_COINS]
    fees: uint256[N_COINS]
    invariant: uint256
    token_supply: uint256

event RemoveLiquidity:
    provider: indexed(address)
    token_amounts: uint256[N_COINS]
    fees: uint256[N_COINS]
    token_supply: uint256

event RemoveLiquidityOne:
    provider: indexed(address)
    token_amount: uint256
    coin_amount: uint256
    token_supply: uint256

event RemoveLiquidityImbalance:
    provider: indexed(address)
    token_amounts: uint256[N_COINS]
    fees: uint256[N_COINS]
    invariant: uint256
    token_supply: uint256

event CommitNewAdmin:
    deadline: indexed(uint256)
    admin: indexed(address)

event NewAdmin:
    admin: indexed(address)

event CommitNewFee:
    deadline: indexed(uint256)
    fee: uint256
    admin_fee: uint256

event NewFee:
    fee: uint256
    admin_fee: uint256

event RampA:
    old_A: uint256
    new_A: uint256
    initial_time: uint256
    future_time: uint256

event StopRampA:
    A: uint256
    t: uint256


# These constants must be set prior to compiling
N_COINS: constant(uint256) = 2
N_COINS_128: constant(int128) = 2
PRECISION_MUL: constant(uint256[N_COINS]) = [10000000000, 1]
RATES: constant(uint256[N_COINS]) = [10000000000000000000000000000, 1000000000000000000]

# fixed constants
FEE_DENOMINATOR: constant(uint256) = 10 ** 10
PRECISION: constant(uint256) = 10 ** 18  # The precision to convert to

MAX_ADMIN_FEE: constant(uint256) = 10 * 10 ** 9
MAX_FEE: constant(uint256) = 5 * 10 ** 9
MAX_A: constant(uint256) = 10 ** 6
MAX_A_CHANGE: constant(uint256) = 10

ADMIN_ACTIONS_DELAY: constant(uint256) = 3 * 86400
MIN_RAMP_TIME: constant(uint256) = 86400

coins: public(address[N_COINS])
balances: public(uint256[N_COINS])
fee: public(uint256)  # fee * 1e10
admin_fee: public(uint256)  # admin_fee * 1e10

owner: public(address)
lp_token: public(address)

A_PRECISION: constant(uint256) = 100
initial_A: public(uint256)
future_A: public(uint256)
initial_A_time: public(uint256)
future_A_time: public(uint256)

admin_actions_deadline: public(uint256)
transfer_ownership_deadline: public(uint256)
future_fee: public(uint256)
future_admin_fee: public(uint256)
future_owner: public(address)

is_killed: bool
kill_deadline: uint256
KILL_DEADLINE_DT: constant(uint256) = 2 * 30 * 86400


@external
def __init__(
    _owner: address,
    _coins: address[N_COINS],
    _pool_token: address,
    _A: uint256,
    _fee: uint256,
    _admin_fee: uint256
):
    """
    @notice Contract constructor
    @param _owner Contract owner address
    @param _coins Addresses of ERC20 conracts of coins
    @param _pool_token Address of the token representing LP share
    @param _A Amplification coefficient multiplied by n * (n - 1)
    @param _fee Fee to charge for exchanges
    @param _admin_fee Admin fee
    """
    for i in range(N_COINS):
        assert _coins[i] != ZERO_ADDRESS
    self.coins = _coins
    self.initial_A = _A * A_PRECISION
    self.future_A = _A * A_PRECISION
    self.fee = _fee
    self.admin_fee = _admin_fee
    self.owner = _owner
    self.kill_deadline = block.timestamp + KILL_DEADLINE_DT
    self.lp_token = _pool_token


@view
@internal
def _A() -> uint256:
    """
    Handle ramping A up or down
    """
    t1: uint256 = self.future_A_time
    A1: uint256 = self.future_A

    if block.timestamp < t1:
        A0: uint256 = self.initial_A
        t0: uint256 = self.initial_A_time
        # Expressions in uint256 cannot have negative numbers, thus "if"
        if A1 > A0:
            return A0 + (A1 - A0) * (block.timestamp - t0) / (t1 - t0)
        else:
            return A0 - (A0 - A1) * (block.timestamp - t0) / (t1 - t0)

    else:  # when t1 == 0 or block.timestamp >= t1
        return A1


@view
@external
def A() -> uint256:
    return self._A() / A_PRECISION


@view
@external
def A_precise() -> uint256:
    return self._A()


@view
@internal
def _xp() -> uint256[N_COINS]:
    result: uint256[N_COINS] = RATES
    for i in range(N_COINS):
        result[i] = result[i] * self.balances[i] / PRECISION
    return result


@pure
@internal
def _xp_mem(_balances: uint256[N_COINS]) -> uint256[N_COINS]:
    result: uint256[N_COINS] = RATES
    for i in range(N_COINS):
        result[i] = result[i] * _balances[i] / PRECISION
    return result


@pure
@internal
def _get_D(_xp: uint256[N_COINS], _amp: uint256) -> uint256:
    """
    D invariant calculation in non-overflowing integer operations
    iteratively

    A * sum(x_i) * n**n + D = A * D * n**n + D**(n+1) / (n**n * prod(x_i))

    Converging solution:
    D[j+1] = (A * n**n * sum(x_i) - D[j]**(n+1) / (n**n prod(x_i))) / (A * n**n - 1)
    """
    S: uint256 = 0
    Dprev: uint256 = 0

    for _x in _xp:
        S += _x
    if S == 0:
        return 0

    D: uint256 = S
    Ann: uint256 = _amp * N_COINS
    for _i in range(255):
        D_P: uint256 = D
        for _x in _xp:
            D_P = D_P * D / (_x * N_COINS)  # If division by 0, this will be borked: only withdrawal will work. And that is good
        Dprev = D
        D = (Ann * S / A_PRECISION + D_P * N_COINS) * D / ((Ann - A_PRECISION) * D / A_PRECISION + (N_COINS + 1) * D_P)
        # Equality with the precision of 1
        if D > Dprev:
            if D - Dprev <= 1:
                return D
        else:
            if Dprev - D <= 1:
                return D
    # convergence typically occurs in 4 rounds or less, this should be unreachable!
    # if it does happen the pool is borked and LPs can withdraw via `remove_liquidity`
    raise


@view
@internal
def _get_D_mem(_balances: uint256[N_COINS], _amp: uint256) -> uint256:
    return self._get_D(self._xp_mem(_balances), _amp)


@view
@external
def get_virtual_price() -> uint256:
    """
    @notice The current virtual price of the pool LP token
    @dev Useful for calculating profits
    @return LP token virtual price normalized to 1e18
    """
    D: uint256 = self._get_D(self._xp(), self._A())
    # D is in the units similar to DAI (e.g. converted to precision 1e18)
    # When balanced, D = n * x_u - total virtual value of the portfolio
    token_supply: uint256 = ERC20(self.lp_token).totalSupply()
    return D * PRECISION / token_supply


@view
@external
def calc_token_amount(_amounts: uint256[N_COINS], _is_deposit: bool) -> uint256:
    """
    @notice Calculate addition or reduction in token supply from a deposit or withdrawal
    @dev This calculation accounts for slippage, but not fees.
         Needed to prevent front-running, not for precise calculations!
    @param _amounts Amount of each coin being deposited
    @param _is_deposit set True for deposits, False for withdrawals
    @return Expected amount of LP tokens received
    """
    amp: uint256 = self._A()
    balances: uint256[N_COINS] = self.balances
    D0: uint256 = self._get_D_mem(balances, amp)
    for i in range(N_COINS):
        if _is_deposit:
            balances[i] += _amounts[i]
        else:
            balances[i] -= _amounts[i]
    D1: uint256 = self._get_D_mem(balances, amp)
    token_amount: uint256 = CurveToken(self.lp_token).totalSupply()
    diff: uint256 = 0
    if _is_deposit:
        diff = D1 - D0
    else:
        diff = D0 - D1
    return diff * token_amount / D0


@external
@nonreentrant('lock')
def add_liquidity(_amounts: uint256[N_COINS], _min_mint_amount: uint256) -> uint256:
    """
    @notice Deposit coins into the pool
    @param _amounts List of amounts of coins to deposit
    @param _min_mint_amount Minimum amount of LP tokens to mint from the deposit
    @return Amount of LP tokens received by depositing
    """
    assert not self.is_killed  # dev: is killed

    amp: uint256 = self._A()
    old_balances: uint256[N_COINS] = self.balances

    # Initial invariant
    D0: uint256 = self._get_D_mem(old_balances, amp)

    lp_token: address = self.lp_token
    token_supply: uint256 = CurveToken(lp_token).totalSupply()
    new_balances: uint256[N_COINS] = old_balances
    for i in range(N_COINS):
        if token_supply == 0:
            assert _amounts[i] > 0  # dev: initial deposit requires all coins
        # balances store amounts of c-tokens
        new_balances[i] += _amounts[i]

    # Invariant after change
    D1: uint256 = self._get_D_mem(new_balances, amp)
    assert D1 > D0

    # We need to recalculate the invariant accounting for fees
    # to calculate fair user's share
    D2: uint256 = D1
    fees: uint256[N_COINS] = empty(uint256[N_COINS])
    mint_amount: uint256 = 0
    if token_supply > 0:
        # Only account for fees if we are not the first to deposit
        fee: uint256 = self.fee * N_COINS / (4 * (N_COINS - 1))
        admin_fee: uint256 = self.admin_fee
        for i in range(N_COINS):
            ideal_balance: uint256 = D1 * old_balances[i] / D0
            difference: uint256 = 0
            new_balance: uint256 = new_balances[i]
            if ideal_balance > new_balance:
                difference = ideal_balance - new_balance
            else:
                difference = new_balance - ideal_balance
            fees[i] = fee * difference / FEE_DENOMINATOR
            self.balances[i] = new_balance - (fees[i] * admin_fee / FEE_DENOMINATOR)
            new_balances[i] -= fees[i]
        D2 = self._get_D_mem(new_balances, amp)
        mint_amount = token_supply * (D2 - D0) / D0
    else:
        self.balances = new_balances
        mint_amount = D1  # Take the dust if there was any
    assert mint_amount >= _min_mint_amount, "Slippage screwed you"

    # Take coins from the sender
    for i in range(N_COINS):
        if _amounts[i] > 0:
            # "safeTransferFrom" which works for ERC20s which return bool or not
            _response: Bytes[32] = raw_call(
                self.coins[i],
                concat(
                    method_id("transferFrom(address,address,uint256)"),
                    convert(msg.sender, bytes32),
                    convert(self, bytes32),
                    convert(_amounts[i], bytes32),
                ),
                max_outsize=32,
            )
            if len(_response) > 0:
                assert convert(_response, bool)  # dev: failed transfer
            # end "safeTransferFrom"

    # Mint pool tokens
    CurveToken(lp_token).mint(msg.sender, mint_amount)

    log AddLiquidity(msg.sender, _amounts, fees, D1, token_supply + mint_amount)

    return mint_amount


@view
@internal
def _get_y(i: int128, j: int128, x: uint256, _xp: uint256[N_COINS]) -> uint256:
    """
    Calculate x[j] if one makes x[i] = x

    Done by solving quadratic equation iteratively.
    x_1**2 + x_1 * (sum' - (A*n**n - 1) * D / (A * n**n)) = D ** (n + 1) / (n ** (2 * n) * prod' * A)
    x_1**2 + b*x_1 = c

    x_1 = (x_1**2 + c) / (2*x_1 + b)
    """
    # x in the input is converted to the same price/precision

    assert i != j       # dev: same coin
    assert j >= 0       # dev: j below zero
    assert j < N_COINS_128  # dev: j above N_COINS

    # should be unreachable, but good for safety
    assert i >= 0
    assert i < N_COINS_128

    A: uint256 = self._A()
    D: uint256 = self._get_D(_xp, A)
    Ann: uint256 = A * N_COINS
    c: uint256 = D
    S: uint256 = 0
    _x: uint256 = 0
    y_prev: uint256 = 0

    for _i in range(N_COINS_128):
        if _i == i:
            _x = x
        elif _i != j:
            _x = _xp[_i]
        else:
            continue
        S += _x
        c = c * D / (_x * N_COINS)
    c = c * D * A_PRECISION / (Ann * N_COINS)
    b: uint256 = S + D * A_PRECISION / Ann  # - D
    y: uint256 = D
    for _i in range(255):
        y_prev = y
        y = (y*y + c) / (2 * y + b - D)
        # Equality with the precision of 1
        if y > y_prev:
            if y - y_prev <= 1:
                return y
        else:
            if y_prev - y <= 1:
                return y
    raise


@view
@external
def get_dy(i: int128, j: int128, _dx: uint256) -> uint256:
    xp: uint256[N_COINS] = self._xp()
    rates: uint256[N_COINS] = RATES

    x: uint256 = xp[i] + (_dx * rates[i] / PRECISION)
    y: uint256 = self._get_y(i, j, x, xp)
    dy: uint256 = xp[j] - y - 1
    fee: uint256 = self.fee * dy / FEE_DENOMINATOR
    return (dy - fee) * PRECISION / rates[j]


@external
@nonreentrant('lock')
def exchange(i: int128, j: int128, _dx: uint256, _min_dy: uint256) -> uint256:
    """
    @notice Perform an exchange between two coins
    @dev Index values can be found via the `coins` public getter method
    @param i Index value for the coin to send
    @param j Index valie of the coin to recieve
    @param _dx Amount of `i` being exchanged
    @param _min_dy Minimum amount of `j` to receive
    @return Actual amount of `j` received
    """
    assert not self.is_killed  # dev: is killed

    old_balances: uint256[N_COINS] = self.balances
    xp: uint256[N_COINS] = self._xp_mem(old_balances)

    rates: uint256[N_COINS] = RATES
    x: uint256 = xp[i] + _dx * rates[i] / PRECISION
    y: uint256 = self._get_y(i, j, x, xp)

    dy: uint256 = xp[j] - y - 1  # -1 just in case there were some rounding errors
    dy_fee: uint256 = dy * self.fee / FEE_DENOMINATOR

    # Convert all to real units
    dy = (dy - dy_fee) * PRECISION / rates[j]
    assert dy >= _min_dy, "Exchange resulted in fewer coins than expected"

    dy_admin_fee: uint256 = dy_fee * self.admin_fee / FEE_DENOMINATOR
    dy_admin_fee = dy_admin_fee * PRECISION / rates[j]

    # Change balances exactly in same way as we change actual ERC20 coin amounts
    self.balances[i] = old_balances[i] + _dx
    # When rounding errors happen, we undercharge admin fee in favor of LP
    self.balances[j] = old_balances[j] - dy - dy_admin_fee

    _response: Bytes[32] = raw_call(
        self.coins[i],
        concat(
            method_id("transferFrom(address,address,uint256)"),
            convert(msg.sender, bytes32),
            convert(self, bytes32),
            convert(_dx, bytes32),
        ),
        max_outsize=32,
    )
    if len(_response) > 0:
        assert convert(_response, bool)

    _response = raw_call(
        self.coins[j],
        concat(
            method_id("transfer(address,uint256)"),
            convert(msg.sender, bytes32),
            convert(dy, bytes32),
        ),
        max_outsize=32,
    )
    if len(_response) > 0:
        assert convert(_response, bool)

    log TokenExchange(msg.sender, i, _dx, j, dy)

    return dy


@external
@nonreentrant('lock')
def remove_liquidity(_amount: uint256, _min_amounts: uint256[N_COINS]) -> uint256[N_COINS]:
    """
    @notice Withdraw coins from the pool
    @dev Withdrawal amounts are based on current deposit ratios
    @param _amount Quantity of LP tokens to burn in the withdrawal
    @param _min_amounts Minimum amounts of underlying coins to receive
    @return List of amounts of coins that were withdrawn
    """
    lp_token: address = self.lp_token
    total_supply: uint256 = CurveToken(lp_token).totalSupply()
    amounts: uint256[N_COINS] = empty(uint256[N_COINS])

    for i in range(N_COINS):
        old_balance: uint256 = self.balances[i]
        value: uint256 = old_balance * _amount / total_supply
        assert value >= _min_amounts[i], "Withdrawal resulted in fewer coins than expected"
        self.balances[i] = old_balance - value
        amounts[i] = value
        _response: Bytes[32] = raw_call(
            self.coins[i],
            concat(
                method_id("transfer(address,uint256)"),
                convert(msg.sender, bytes32),
                convert(value, bytes32),
            ),
            max_outsize=32,
        )
        if len(_response) > 0:
            assert convert(_response, bool)

    CurveToken(lp_token).burnFrom(msg.sender, _amount)  # dev: insufficient funds

    log RemoveLiquidity(msg.sender, amounts, empty(uint256[N_COINS]), total_supply - _amount)

    return amounts


@external
@nonreentrant('lock')
def remove_liquidity_imbalance(_amounts: uint256[N_COINS], _max_burn_amount: uint256) -> uint256:
    """
    @notice Withdraw coins from the pool in an imbalanced amount
    @param _amounts List of amounts of underlying coins to withdraw
    @param _max_burn_amount Maximum amount of LP token to burn in the withdrawal
    @return Actual amount of the LP token burned in the withdrawal
    """
    assert not self.is_killed  # dev: is killed

    amp: uint256 = self._A()
    old_balances: uint256[N_COINS] = self.balances
    D0: uint256 = self._get_D_mem(old_balances, amp)
    new_balances: uint256[N_COINS] = old_balances
    for i in range(N_COINS):
        new_balances[i] -= _amounts[i]
    D1: uint256 = self._get_D_mem(new_balances, amp)

    fee: uint256 = self.fee * N_COINS / (4 * (N_COINS - 1))
    admin_fee: uint256 = self.admin_fee
    fees: uint256[N_COINS] = empty(uint256[N_COINS])
    for i in range(N_COINS):
        new_balance: uint256 = new_balances[i]
        ideal_balance: uint256 = D1 * old_balances[i] / D0
        difference: uint256 = 0
        if ideal_balance > new_balance:
            difference = ideal_balance - new_balance
        else:
            difference = new_balance - ideal_balance
        fees[i] = fee * difference / FEE_DENOMINATOR
        self.balances[i] = new_balance - (fees[i] * admin_fee / FEE_DENOMINATOR)
        new_balances[i] = new_balance - fees[i]
    D2: uint256 = self._get_D_mem(new_balances, amp)

    lp_token: address = self.lp_token
    token_supply: uint256 = CurveToken(lp_token).totalSupply()
    token_amount: uint256 = (D0 - D2) * token_supply / D0
    assert token_amount != 0  # dev: zero tokens burned
    token_amount += 1  # In case of rounding errors - make it unfavorable for the "attacker"
    assert token_amount <= _max_burn_amount, "Slippage screwed you"

    CurveToken(lp_token).burnFrom(msg.sender, token_amount)  # dev: insufficient funds
    for i in range(N_COINS):
        if _amounts[i] != 0:
            _response: Bytes[32] = raw_call(
                self.coins[i],
                concat(
                    method_id("transfer(address,uint256)"),
                    convert(msg.sender, bytes32),
                    convert(_amounts[i], bytes32),
                ),
                max_outsize=32,
            )
            if len(_response) > 0:
                assert convert(_response, bool)

    log RemoveLiquidityImbalance(msg.sender, _amounts, fees, D1, token_supply - token_amount)

    return token_amount


@pure
@internal
def _get_y_D(A: uint256, i: int128, _xp: uint256[N_COINS], D: uint256) -> uint256:
    """
    Calculate x[i] if one reduces D from being calculated for xp to D

    Done by solving quadratic equation iteratively.
    x_1**2 + x_1 * (sum' - (A*n**n - 1) * D / (A * n**n)) = D ** (n + 1) / (n ** (2 * n) * prod' * A)
    x_1**2 + b*x_1 = c

    x_1 = (x_1**2 + c) / (2*x_1 + b)
    """
    # x in the input is converted to the same price/precision

    assert i >= 0  # dev: i below zero
    assert i < N_COINS_128  # dev: i above N_COINS

    Ann: uint256 = A * N_COINS
    c: uint256 = D
    S: uint256 = 0
    _x: uint256 = 0
    y_prev: uint256 = 0

    for _i in range(N_COINS_128):
        if _i != i:
            _x = _xp[_i]
        else:
            continue
        S += _x
        c = c * D / (_x * N_COINS)
    c = c * D * A_PRECISION / (Ann * N_COINS)
    b: uint256 = S + D * A_PRECISION / Ann
    y: uint256 = D

    for _i in range(255):
        y_prev = y
        y = (y*y + c) / (2 * y + b - D)
        # Equality with the precision of 1
        if y > y_prev:
            if y - y_prev <= 1:
                return y
        else:
            if y_prev - y <= 1:
                return y
    raise


@view
@internal
def _calc_withdraw_one_coin(_token_amount: uint256, i: int128) -> (uint256, uint256, uint256):
    # First, need to calculate
    # * Get current D
    # * Solve Eqn against y_i for D - _token_amount
    amp: uint256 = self._A()
    xp: uint256[N_COINS] = self._xp()
    D0: uint256 = self._get_D(xp, amp)

    total_supply: uint256 = CurveToken(self.lp_token).totalSupply()
    D1: uint256 = D0 - _token_amount * D0 / total_supply
    new_y: uint256 = self._get_y_D(amp, i, xp, D1)
    xp_reduced: uint256[N_COINS] = xp
    fee: uint256 = self.fee * N_COINS / (4 * (N_COINS - 1))
    for j in range(N_COINS_128):
        dx_expected: uint256 = 0
        if j == i:
            dx_expected = xp[j] * D1 / D0 - new_y
        else:
            dx_expected = xp[j] - xp[j] * D1 / D0
        xp_reduced[j] -= fee * dx_expected / FEE_DENOMINATOR

    dy: uint256 = xp_reduced[i] - self._get_y_D(amp, i, xp_reduced, D1)
    precisions: uint256[N_COINS] = PRECISION_MUL
    dy = (dy - 1) / precisions[i]  # Withdraw less to account for rounding errors
    dy_0: uint256 = (xp[i] - new_y) / precisions[i]  # w/o fees

    return dy, dy_0 - dy, total_supply


@view
@external
def calc_withdraw_one_coin(_token_amount: uint256, i: int128) -> uint256:
    """
    @notice Calculate the amount received when withdrawing a single coin
    @param _token_amount Amount of LP tokens to burn in the withdrawal
    @param i Index value of the coin to withdraw
    @return Amount of coin received
    """
    return self._calc_withdraw_one_coin(_token_amount, i)[0]


@external
@nonreentrant('lock')
def remove_liquidity_one_coin(_token_amount: uint256, i: int128, _min_amount: uint256) -> uint256:
    """
    @notice Withdraw a single coin from the pool
    @param _token_amount Amount of LP tokens to burn in the withdrawal
    @param i Index value of the coin to withdraw
    @param _min_amount Minimum amount of coin to receive
    @return Amount of coin received
    """
    assert not self.is_killed  # dev: is killed

    dy: uint256 = 0
    dy_fee: uint256 = 0
    total_supply: uint256 = 0
    dy, dy_fee, total_supply = self._calc_withdraw_one_coin(_token_amount, i)
    assert dy >= _min_amount, "Not enough coins removed"

    self.balances[i] -= (dy + dy_fee * self.admin_fee / FEE_DENOMINATOR)
    CurveToken(self.lp_token).burnFrom(msg.sender, _token_amount)  # dev: insufficient funds

    _response: Bytes[32] = raw_call(
        self.coins[i],
        concat(
            method_id("transfer(address,uint256)"),
            convert(msg.sender, bytes32),
            convert(dy, bytes32),
        ),
        max_outsize=32,
    )
    if len(_response) > 0:
        assert convert(_response, bool)

    log RemoveLiquidityOne(msg.sender, _token_amount, dy, total_supply - _token_amount)

    return dy


### Admin functions ###
@external
def ramp_A(_future_A: uint256, _future_time: uint256):
    assert msg.sender == self.owner  # dev: only owner
    assert block.timestamp >= self.initial_A_time + MIN_RAMP_TIME
    assert _future_time >= block.timestamp + MIN_RAMP_TIME  # dev: insufficient time

    initial_A: uint256 = self._A()
    future_A_p: uint256 = _future_A * A_PRECISION

    assert _future_A > 0 and _future_A < MAX_A
    if future_A_p < initial_A:
        assert future_A_p * MAX_A_CHANGE >= initial_A
    else:
        assert future_A_p <= initial_A * MAX_A_CHANGE

    self.initial_A = initial_A
    self.future_A = future_A_p
    self.initial_A_time = block.timestamp
    self.future_A_time = _future_time

    log RampA(initial_A, future_A_p, block.timestamp, _future_time)


@external
def stop_ramp_A():
    assert msg.sender == self.owner  # dev: only owner

    current_A: uint256 = self._A()
    self.initial_A = current_A
    self.future_A = current_A
    self.initial_A_time = block.timestamp
    self.future_A_time = block.timestamp
    # now (block.timestamp < t1) is always False, so we return saved A

    log StopRampA(current_A, block.timestamp)


@external
def commit_new_fee(_new_fee: uint256, _new_admin_fee: uint256):
    assert msg.sender == self.owner  # dev: only owner
    assert self.admin_actions_deadline == 0  # dev: active action
    assert _new_fee <= MAX_FEE  # dev: fee exceeds maximum
    assert _new_admin_fee <= MAX_ADMIN_FEE  # dev: admin fee exceeds maximum

    deadline: uint256 = block.timestamp + ADMIN_ACTIONS_DELAY
    self.admin_actions_deadline = deadline
    self.future_fee = _new_fee
    self.future_admin_fee = _new_admin_fee

    log CommitNewFee(deadline, _new_fee, _new_admin_fee)


@external
def apply_new_fee():
    assert msg.sender == self.owner  # dev: only owner
    assert block.timestamp >= self.admin_actions_deadline  # dev: insufficient time
    assert self.admin_actions_deadline != 0  # dev: no active action

    self.admin_actions_deadline = 0
    fee: uint256 = self.future_fee
    admin_fee: uint256 = self.future_admin_fee
    self.fee = fee
    self.admin_fee = admin_fee

    log NewFee(fee, admin_fee)


@external
def revert_new_parameters():
    assert msg.sender == self.owner  # dev: only owner

    self.admin_actions_deadline = 0


@external
def commit_transfer_ownership(_owner: address):
    assert msg.sender == self.owner  # dev: only owner
    assert self.transfer_ownership_deadline == 0  # dev: active transfer

    deadline: uint256 = block.timestamp + ADMIN_ACTIONS_DELAY
    self.transfer_ownership_deadline = deadline
    self.future_owner = _owner

    log CommitNewAdmin(deadline, _owner)


@external
def apply_transfer_ownership():
    assert msg.sender == self.owner  # dev: only owner
    assert block.timestamp >= self.transfer_ownership_deadline  # dev: insufficient time
    assert self.transfer_ownership_deadline != 0  # dev: no active transfer

    self.transfer_ownership_deadline = 0
    owner: address = self.future_owner
    self.owner = owner

    log NewAdmin(owner)


@external
def revert_transfer_ownership():
    assert msg.sender == self.owner  # dev: only owner

    self.transfer_ownership_deadline = 0


@view
@external
def admin_balances(i: uint256) -> uint256:
    return ERC20(self.coins[i]).balanceOf(self) - self.balances[i]


@external
def withdraw_admin_fees():
    assert msg.sender == self.owner  # dev: only owner

    for i in range(N_COINS):
        coin: address = self.coins[i]
        value: uint256 = ERC20(coin).balanceOf(self) - self.balances[i]
        if value > 0:
            _response: Bytes[32] = raw_call(
                coin,
                concat(
                    method_id("transfer(address,uint256)"),
                    convert(msg.sender, bytes32),
                    convert(value, bytes32),
                ),
                max_outsize=32,
            )  # dev: failed transfer
            if len(_response) > 0:
                assert convert(_response, bool)


@external
def donate_admin_fees():
    assert msg.sender == self.owner  # dev: only owner
    for i in range(N_COINS):
        self.balances[i] = ERC20(self.coins[i]).balanceOf(self)


@external
def kill_me():
    assert msg.sender == self.owner  # dev: only owner
    assert self.kill_deadline > block.timestamp  # dev: deadline has passed
    self.is_killed = True


@external
def unkill_me():
    assert msg.sender == self.owner  # dev: only owner
    self.is_killed = False

Contract Security Audit

Contract ABI

[{"name":"TokenExchange","inputs":[{"name":"buyer","type":"address","indexed":true},{"name":"sold_id","type":"int128","indexed":false},{"name":"tokens_sold","type":"uint256","indexed":false},{"name":"bought_id","type":"int128","indexed":false},{"name":"tokens_bought","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"AddLiquidity","inputs":[{"name":"provider","type":"address","indexed":true},{"name":"token_amounts","type":"uint256[2]","indexed":false},{"name":"fees","type":"uint256[2]","indexed":false},{"name":"invariant","type":"uint256","indexed":false},{"name":"token_supply","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"RemoveLiquidity","inputs":[{"name":"provider","type":"address","indexed":true},{"name":"token_amounts","type":"uint256[2]","indexed":false},{"name":"fees","type":"uint256[2]","indexed":false},{"name":"token_supply","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"RemoveLiquidityOne","inputs":[{"name":"provider","type":"address","indexed":true},{"name":"token_amount","type":"uint256","indexed":false},{"name":"coin_amount","type":"uint256","indexed":false},{"name":"token_supply","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"RemoveLiquidityImbalance","inputs":[{"name":"provider","type":"address","indexed":true},{"name":"token_amounts","type":"uint256[2]","indexed":false},{"name":"fees","type":"uint256[2]","indexed":false},{"name":"invariant","type":"uint256","indexed":false},{"name":"token_supply","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"CommitNewAdmin","inputs":[{"name":"deadline","type":"uint256","indexed":true},{"name":"admin","type":"address","indexed":true}],"anonymous":false,"type":"event"},{"name":"NewAdmin","inputs":[{"name":"admin","type":"address","indexed":true}],"anonymous":false,"type":"event"},{"name":"CommitNewFee","inputs":[{"name":"deadline","type":"uint256","indexed":true},{"name":"fee","type":"uint256","indexed":false},{"name":"admin_fee","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"NewFee","inputs":[{"name":"fee","type":"uint256","indexed":false},{"name":"admin_fee","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"RampA","inputs":[{"name":"old_A","type":"uint256","indexed":false},{"name":"new_A","type":"uint256","indexed":false},{"name":"initial_time","type":"uint256","indexed":false},{"name":"future_time","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"StopRampA","inputs":[{"name":"A","type":"uint256","indexed":false},{"name":"t","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"stateMutability":"nonpayable","type":"constructor","inputs":[{"name":"_owner","type":"address"},{"name":"_coins","type":"address[2]"},{"name":"_pool_token","type":"address"},{"name":"_A","type":"uint256"},{"name":"_fee","type":"uint256"},{"name":"_admin_fee","type":"uint256"}],"outputs":[]},{"stateMutability":"view","type":"function","name":"A","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"A_precise","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"get_virtual_price","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"calc_token_amount","inputs":[{"name":"_amounts","type":"uint256[2]"},{"name":"_is_deposit","type":"bool"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"add_liquidity","inputs":[{"name":"_amounts","type":"uint256[2]"},{"name":"_min_mint_amount","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"get_dy","inputs":[{"name":"i","type":"int128"},{"name":"j","type":"int128"},{"name":"_dx","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"exchange","inputs":[{"name":"i","type":"int128"},{"name":"j","type":"int128"},{"name":"_dx","type":"uint256"},{"name":"_min_dy","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity","inputs":[{"name":"_amount","type":"uint256"},{"name":"_min_amounts","type":"uint256[2]"}],"outputs":[{"name":"","type":"uint256[2]"}]},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity_imbalance","inputs":[{"name":"_amounts","type":"uint256[2]"},{"name":"_max_burn_amount","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"calc_withdraw_one_coin","inputs":[{"name":"_token_amount","type":"uint256"},{"name":"i","type":"int128"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity_one_coin","inputs":[{"name":"_token_amount","type":"uint256"},{"name":"i","type":"int128"},{"name":"_min_amount","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"ramp_A","inputs":[{"name":"_future_A","type":"uint256"},{"name":"_future_time","type":"uint256"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"stop_ramp_A","inputs":[],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"commit_new_fee","inputs":[{"name":"_new_fee","type":"uint256"},{"name":"_new_admin_fee","type":"uint256"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"apply_new_fee","inputs":[],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"revert_new_parameters","inputs":[],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"commit_transfer_ownership","inputs":[{"name":"_owner","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"apply_transfer_ownership","inputs":[],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"revert_transfer_ownership","inputs":[],"outputs":[]},{"stateMutability":"view","type":"function","name":"admin_balances","inputs":[{"name":"i","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"withdraw_admin_fees","inputs":[],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"donate_admin_fees","inputs":[],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"kill_me","inputs":[],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"unkill_me","inputs":[],"outputs":[]},{"stateMutability":"view","type":"function","name":"coins","inputs":[{"name":"arg0","type":"uint256"}],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"balances","inputs":[{"name":"arg0","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"fee","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"admin_fee","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"owner","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"lp_token","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"initial_A","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"future_A","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"initial_A_time","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"future_A_time","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"admin_actions_deadline","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"transfer_ownership_deadline","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"future_fee","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"future_admin_fee","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"future_owner","inputs":[],"outputs":[{"name":"","type":"address"}]}]

60206134aa6000396000518060a01c6134a55760405260206134ca6000396000518060a01c6134a55760605260206134ea6000396000518060a01c6134a557608052602061350a6000396000518060a01c6134a55760a05260006002905b8060c0526000602060c05160028110156134a5570260600151146134a55760010181811861005d575050606051600155608051600255602061352a60003960005160648082028215828483041417156134a55790509050600955602061352a60003960005160648082028215828483041417156134a55790509050600a55602061354a600039600051600555602061356a60003960005160065560405160075542624f1a0081818301106134a5578082019050905060135560a0516008556133706101346300000000396133706000016300000000f3600436101561000d57612522565b60003560e01c3461336b5763f446c1d081186100425761002d60c0612528565b60c05160648082049050905060e052602060e0f35b6376a2f0f0811861005d57602061005960c0612528565b60c0f35b63bb7b8b808118610135576100736101a0612653565b6101a0805161022052602081015161024052506100916101e0612528565b6101e051610260526102205160405261024051606052610260516080526100b961020061278e565b61020051610180526318160ddd6101c05260206101c060046101dc6008545afa6100e8573d600060003e3d6000fd5b60203d1061336b576101c0516101a05261018051670de0b6b3a764000080820282158284830414171561336b57905090506101a05180801561336b578204905090506101c05260206101c0f35b63ed8e84f3811861031a576044358060011c61336b576102a05261015a6102e0612528565b6102e0516102c0526003546102e052600454610300526102e05161018052610300516101a0526102c0516101c0526101936103406129c0565b610340516103205260006002905b80610340526102a0516101ee57602061034051600281101561336b57026102e0018051602061034051600281101561336b57026004013580821061336b578082039050905081525061022c565b602061034051600281101561336b57026102e0018051602061034051600281101561336b570260040135818183011061336b57808201905090508152505b6001018181186101a15750506102e05161018052610300516101a0526102c0516101c05261025b6103606129c0565b61036051610340526318160ddd610380526020610380600461039c6008545afa61028a573d600060003e3d6000fd5b60203d1061336b5761038051610360526000610380526102a0516102c757610320516103405180821061336b5780820390509050610380526102e2565b610340516103205180821061336b5780820390509050610380525b610380516103605180820282158284830414171561336b57905090506103205180801561336b578204905090506103a05260206103a0f35b630b4c7e4d81186109675760005461336b57600160005560125461336b576103436102c0612528565b6102c0516102a0526003546102c0526004546102e0526102c051610180526102e0516101a0526102a0516101c05261037c6103206129c0565b6103205161030052600854610320526318160ddd610360526020610360600461037c610320515afa6103b3573d600060003e3d6000fd5b60203d1061336b5761036051610340526102c051610360526102e0516103805260006002905b806103a0526103405161040357600060206103a051600281101561336b570260040135111561336b575b60206103a051600281101561336b570261036001805160206103a051600281101561336b570260040135818183011061336b57808201905090508152506001018181186103d95750506103605161018052610380516101a0526102a0516101c05261046f6103c06129c0565b6103c0516103a052610300516103a051111561336b576103a0516103c0526060366103e037600061034051116104ba5761036051600355610380516004556103a051610420526106ec565b600554600280820282158284830414171561336b5790509050600480820490509050610440526006546104605260006002905b80610480526103a051602061048051600281101561336b57026102c0015180820282158284830414171561336b57905090506103005180801561336b578204905090506104a05260006104c052602061048051600281101561336b570261036001516104e0526104e0516104a0511161057f576104e0516104a05180821061336b57808203905090506104c05261059a565b6104a0516104e05180821061336b57808203905090506104c0525b610440516104c05180820282158284830414171561336b57905090506402540be40080820490509050602061048051600281101561336b57026103e001526104e051602061048051600281101561336b57026103e001516104605180820282158284830414171561336b57905090506402540be4008082049050905080821061336b578082039050905061048051600281101561336b5760030155602061048051600281101561336b5702610360018051602061048051600281101561336b57026103e0015180821061336b57808203905090508152506001018181186104ed5750506103605161018052610380516101a0526102a0516101c0526106a06104806129c0565b610480516103c052610340516103c0516103005180821061336b578082039050905080820282158284830414171561336b57905090506103005180801561336b57820490509050610420525b60443561042051101561075f576014610440527f536c697070616765207363726577656420796f75000000000000000000000000610460526104405061044051806104600181600003601f1636823750506308c379a061040052602061042052601f19601f61044051011660440161041cfd5b60006002905b80610440526000602061044051600281101561336b570260040135111561089257600060046104a0527f23b872dd000000000000000000000000000000000000000000000000000000006104c0526104a08051602082018361050001815181525050808301925050503381610500015260208101905030816105000152602081019050602061044051600281101561336b570260040135816105000152602081019050806104e0526104e0505060206105a06104e051610500600061044051600281101561336b57600101545af1610842573d600060003e3d6000fd5b61058060203d8082116108555781610857565b805b905090508152805180610460526020820180516104805250505060006104605111156108925761048051610460516020036008021c1561336b575b6001018181186107655750506340c10f1961044052336104605261042051610480526020610440604461045c6000610320515af16108d5573d600060003e3d6000fd5b60203d1061336b57610440518060011c61336b576104a0526104a050337f26f55a85081d24974e85c6c00045d0f0453991e95873f52bff0d21af4079a76860043561044052602435610460526103e05161048052610400516104a0526103a0516104c0526103405161042051818183011061336b57808201905090506104e05260c0610440a260206104206000600055f35b635e0d443f8118610b375760043580600f0b811861336b576103605260243580600f0b811861336b576103805261099f6103e0612653565b6103e080516103a05260208101516103c052506b204fce5e3e250261100000006103e052670de0b6b3a764000061040052602061036051600281101561336b57026103a00151604435602061036051600281101561336b57026103e0015180820282158284830414171561336b5790509050670de0b6b3a764000080820490509050818183011061336b5780820190509050610420526103605161018052610380516101a052610420516101c0526103a0516101e0526103c05161020052610a68610460612a1d565b6104605161044052602061038051600281101561336b57026103a001516104405180821061336b5780820390509050600180821061336b5780820390509050610460526005546104605180820282158284830414171561336b57905090506402540be4008082049050905061048052610460516104805180821061336b5780820390509050670de0b6b3a764000080820282158284830414171561336b5790509050602061038051600281101561336b57026103e0015180801561336b578204905090506104a05260206104a0f35b633df0212481186110fa5760043580600f0b811861336b576103605260243580600f0b811861336b576103805260005461336b57600160005560125461336b576003546103a0526004546103c0526103a0516040526103c051606052610b9e6104206126ef565b61042080516103e052602081015161040052506b204fce5e3e2502611000000061042052670de0b6b3a764000061044052602061036051600281101561336b57026103e00151604435602061036051600281101561336b5702610420015180820282158284830414171561336b5790509050670de0b6b3a764000080820490509050818183011061336b5780820190509050610460526103605161018052610380516101a052610460516101c0526103e0516101e0526104005161020052610c676104a0612a1d565b6104a05161048052602061038051600281101561336b57026103e001516104805180821061336b5780820390509050600180821061336b57808203905090506104a0526104a05160055480820282158284830414171561336b57905090506402540be400808204905090506104c0526104a0516104c05180821061336b5780820390509050670de0b6b3a764000080820282158284830414171561336b5790509050602061038051600281101561336b5702610420015180801561336b578204905090506104a0526064356104a0511015610dc757602e6104e0527f45786368616e676520726573756c74656420696e20666577657220636f696e73610500527f207468616e206578706563746564000000000000000000000000000000000000610520526104e0506104e051806105000181600003601f1636823750506308c379a06104a05260206104c052601f19601f6104e05101166044016104bcfd5b6104c05160065480820282158284830414171561336b57905090506402540be400808204905090506104e0526104e051670de0b6b3a764000080820282158284830414171561336b5790509050602061038051600281101561336b5702610420015180801561336b578204905090506104e052602061036051600281101561336b57026103a00151604435818183011061336b578082019050905061036051600281101561336b5760030155602061038051600281101561336b57026103a001516104a05180821061336b57808203905090506104e05180821061336b578082039050905061038051600281101561336b576003015560006004610540527f23b872dd0000000000000000000000000000000000000000000000000000000061056052610540805160208201836105a0018151815250508083019250505033816105a0015260208101905030816105a00152602081019050604435816105a00152602081019050806105805261058050506020610640610580516105a0600061036051600281101561336b57600101545af1610f68573d600060003e3d6000fd5b61062060203d808211610f7b5781610f7d565b805b90509050815280518061050052602082018051610520525050506000610500511115610fb85761052051610500516020036008021c1561336b575b60006004610540527fa9059cbb0000000000000000000000000000000000000000000000000000000061056052610540805160208201836105a0018151815250508083019250505033816105a001526020810190506104a051816105a00152602081019050806105805261058050506020610620610580516105a0600061038051600281101561336b57600101545af1611057573d600060003e3d6000fd5b61060060203d80821161106a578161106c565b805b905090508152805180610500526020820180516105205250505060006105005111156110a75761052051610500516020036008021c1561336b575b337f8b3e96f2b889fa771c53c981b40daf005f63f637f1869f707052d15a3dd9714061036051610540526044356105605261038051610580526104a0516105a0526080610540a260206104a06000600055f35b635b36389c811861141f5760005461336b5760016000556008546040526318160ddd608052602060806004609c6040515afa61113b573d600060003e3d6000fd5b60203d1061336b5760805160605260403660803760006002905b8060c05260c051600281101561336b576003015460e05260e05160043580820282158284830414171561336b579050905060605180801561336b5782049050905061010052602060c051600281101561336b570260240135610100511015611240576030610120527f5769746864726177616c20726573756c74656420696e20666577657220636f69610140527f6e73207468616e20657870656374656400000000000000000000000000000000610160526101205061012051806101400181600003601f1636823750506308c379a060e052602061010052601f19601f61012051011660440160fcfd5b60e0516101005180821061336b578082039050905060c051600281101561336b576003015561010051602060c051600281101561336b57026080015260006004610160527fa9059cbb0000000000000000000000000000000000000000000000000000000061018052610160805160208201836101c0018151815250508083019250505033816101c0015260208101905061010051816101c00152602081019050806101a0526101a0505060206102406101a0516101c0600060c051600281101561336b57600101545af161131a573d600060003e3d6000fd5b61022060203d80821161132d578161132f565b805b9050905081528051806101205260208201805161014052505050600061012051111561136a5761014051610120516020036008021c1561336b575b6001018181186111555750506379cc679060c0523360e05260043561010052602060c0604460dc60006040515af16113a7573d600060003e3d6000fd5b60203d1061336b5760c0518060011c61336b576101205261012050337f7c363854ccf79623411f8995b362bce5eddff18c927edc6f5dbbb5e05819a82c60805160c05260a05160e0526040366101003760605160043580821061336b57808203905090506101405260a060c0a2604060806000600055f35b63e31032738118611a1d5760005461336b57600160005560125461336b576114486102c0612528565b6102c0516102a0526003546102c0526004546102e0526102c051610180526102e0516101a0526102a0516101c0526114816103206129c0565b61032051610300526102c051610320526102e0516103405260006002905b8061036052602061036051600281101561336b5702610320018051602061036051600281101561336b57026004013580821061336b578082039050905081525060010181811861149f5750506103205161018052610340516101a0526102a0516101c05261150e6103806129c0565b6103805161036052600554600280820282158284830414171561336b5790509050600480820490509050610380526006546103a0526040366103c03760006002905b8061040052602061040051600281101561336b570261032001516104205261036051602061040051600281101561336b57026102c0015180820282158284830414171561336b57905090506103005180801561336b57820490509050610440526000610460526104205161044051116115e257610420516104405180821061336b5780820390509050610460526115fd565b610440516104205180821061336b5780820390509050610460525b610380516104605180820282158284830414171561336b57905090506402540be40080820490509050602061040051600281101561336b57026103c0015261042051602061040051600281101561336b57026103c001516103a05180820282158284830414171561336b57905090506402540be4008082049050905080821061336b578082039050905061040051600281101561336b576003015561042051602061040051600281101561336b57026103c0015180821061336b5780820390509050602061040051600281101561336b570261032001526001018181186115505750506103205161018052610340516101a0526102a0516101c0526117036104206129c0565b6104205161040052600854610420526318160ddd610460526020610460600461047c610420515afa61173a573d600060003e3d6000fd5b60203d1061336b576104605161044052610300516104005180821061336b57808203905090506104405180820282158284830414171561336b57905090506103005180801561336b57820490509050610460526000610460511461336b57610460516001818183011061336b578082019050905061046052604435610460511115611825576014610480527f536c697070616765207363726577656420796f750000000000000000000000006104a0526104805061048051806104a00181600003601f1636823750506308c379a061044052602061046052601f19601f61048051011660440161045cfd5b6379cc679061048052336104a052610460516104c0526020610480604461049c6000610420515af161185c573d600060003e3d6000fd5b60203d1061336b57610480518060011c61336b576104e0526104e05060006002905b80610480526000602061048051600281101561336b5702600401351461199d57600060046104e0527fa9059cbb00000000000000000000000000000000000000000000000000000000610500526104e080516020820183610540018151815250508083019250505033816105400152602081019050602061048051600281101561336b5702600401358161054001526020810190508061052052610520505060206105c061052051610540600061048051600281101561336b57600101545af161194d573d600060003e3d6000fd5b6105a060203d8082116119605781611962565b805b9050905081528051806104a0526020820180516104c05250505060006104a051111561199d576104c0516104a0516020036008021c1561336b575b60010181811861187e575050337f2b5508378d7e19e0d5fa338419034731416c4f5b219a10379956f764317fd47e600435610480526024356104a0526103c0516104c0526103e0516104e0526103605161050052610440516104605180821061336b57808203905090506105205260c0610480a260206104606000600055f35b63cc2b27d78118611a5a5760243580600f0b811861336b576103e05260206004356101e0526103e05161020052611a55610400612fd6565b610400f35b631a4d01d28118611d345760243580600f0b811861336b576103e05260005461336b57600160005560125461336b57606036610400376004356101e0526103e05161020052611aaa610460612fd6565b61046080516104005260208101516104205260408101516104405250604435610400511015611b39576018610460527f4e6f7420656e6f75676820636f696e732072656d6f7665640000000000000000610480526104605061046051806104800181600003601f1636823750506308c379a061042052602061044052601f19601f61046051011660440161043cfd5b6103e051600281101561336b576003018054610400516104205160065480820282158284830414171561336b57905090506402540be40080820490509050818183011061336b578082019050905080821061336b57808203905090508155506379cc67906104605233610480526004356104a0526020610460604461047c60006008545af1611bcd573d600060003e3d6000fd5b60203d1061336b57610460518060011c61336b576104c0526104c050600060046104a0527fa9059cbb000000000000000000000000000000000000000000000000000000006104c0526104a08051602082018361050001815181525050808301925050503381610500015260208101905061040051816105000152602081019050806104e0526104e0505060206105806104e05161050060006103e051600281101561336b57600101545af1611c88573d600060003e3d6000fd5b61056060203d808211611c9b5781611c9d565b805b90509050815280518061046052602082018051610480525050506000610460511115611cd85761048051610460516020036008021c1561336b575b337f5ad056f2e28a8cec232015406b843668c1e36cda598127ec3b8c59b8c72773a06004356104a052610400516104c0526104405160043580821061336b57808203905090506104e05260606104a0a260206104006000600055f35b633c157e648118611e7957600754331861336b57600b5462015180818183011061336b5780820190509050421061336b574262015180818183011061336b57808201905090506024351061336b57611d8c60e0612528565b60e05160c052600435606480820282158284830414171561336b579050905060e052600060043511611dbf576000611dc8565b620f4240600435105b1561336b5760c05160e05110611dfe5760c051600a80820282158284830414171561336b579050905060e0511161336b57611e20565b60c05160e051600a80820282158284830414171561336b57905090501061336b575b60c05160095560e051600a5542600b55602435600c557fa2b71ec6df949300b59aab36b55e189697b750119dd349fcfa8c0f779e83c25460c0516101005260e051610120524261014052602435610160526080610100a1005b63551a65888118611ee457600754331861336b57611e9760e0612528565b60e05160c05260c05160095560c051600a5542600b5542600c557f46e22fb3709ad289f62ce63d469248536dbc78d82b84a3d7e74ad606dc20193860c05160e0524261010052604060e0a1005b635b5a14678118611f7c57600754331861336b57600d5461336b5764012a05f2006004351161336b576402540be4006024351161336b57426203f480818183011061336b5780820190509050604052604051600d55600435600f556024356010556040517f351fc5da2fbf480f2225debf3664a4bc90fa9923743aad58b4603f648e931fe060043560605260243560805260406060a2005b634f12fe978118611ff457600754331861336b57600d54421061336b576000600d541461336b576000600d55600f546040526010546060526040516005556060516006557fbe12859b636aed607d5230b2cc2711f68d70e51060e6cca1f575ef5d2fcc95d160405160805260605160a05260406080a1005b63226840fb811861200f57600754331861336b576000600d55005b636b441a40811861208a576004358060a01c61336b57604052600754331861336b57600e5461336b57426203f480818183011061336b5780820190509050606052606051600e556040516011556040516060517f181aa3aa17d4cbf99265dd4443eba009433d3cde79d60164fde1d1a192beb93560006080a3005b636a1c05ae81186120ed57600754331861336b57600e54421061336b576000600e541461336b576000600e556011546040526040516007556040517f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c60006060a2005b6386fbf193811861210857600754331861336b576000600e55005b63e2e7d264811861217a576370a0823160405230606052602060406024605c600435600281101561336b57600101545afa612148573d600060003e3d6000fd5b60203d1061336b57604051600435600281101561336b576003015480821061336b578082039050905060805260206080f35b6330c5408581186122f157600754331861336b5760006002905b80604052604051600281101561336b57600101546060526370a0823160a0523060c052602060a0602460bc6060515afa6121d3573d600060003e3d6000fd5b60203d1061336b5760a051604051600281101561336b576003015480821061336b5780820390509050608052600060805111156122e3576000600460e0527fa9059cbb000000000000000000000000000000000000000000000000000000006101005260e0805160208201836101400181518152505080830192505050338161014001526020810190506080518161014001526020810190508061012052610120505060206101c06101205161014060006060515af1612298573d600060003e3d6000fd5b6101a060203d8082116122ab57816122ad565b805b90509050815280518060a05260208201805160c052505050600060a05111156122e35760c05160a0516020036008021c1561336b575b600101818118612194575050005b63524c3901811861236d57600754331861336b5760006002905b806040526370a0823160605230608052602060606024607c604051600281101561336b57600101545afa612344573d600060003e3d6000fd5b60203d1061336b57606051604051600281101561336b576003015560010181811861230b575050005b63e3698853811861239257600754331861336b5742601354111561336b576001601255005b633046f97281186123ad57600754331861336b576000601255005b63c661065781186123d157600435600281101561336b576001015460405260206040f35b634903b0d181186123f557600435600281101561336b576003015460405260206040f35b63ddca3f43811861240c5760055460405260206040f35b63fee3f7f981186124235760065460405260206040f35b638da5cb5b811861243a5760075460405260206040f35b6382c6306681186124515760085460405260206040f35b635409491a81186124685760095460405260206040f35b63b4b577ad811861247f57600a5460405260206040f35b632081066c811861249657600b5460405260206040f35b631405228881186124ad57600c5460405260206040f35b63405e28f881186124c457600d5460405260206040f35b63e0a0b58681186124db57600e5460405260206040f35b6358680d0b81186124f257600f5460405260206040f35b63e382446281186125095760105460405260206040f35b631ec0cdc181186125205760115460405260206040f35b505b60006000fd5b600c54604052600a54606052604051421061254c5760605181525061265156612651565b600954608052600b5460a052608051606051116125db5760805160805160605180821061336b57808203905090504260a05180821061336b578082039050905080820282158284830414171561336b579050905060405160a05180821061336b578082039050905080801561336b5782049050905080821061336b578082039050905081525061265156612651565b60805160605160805180821061336b57808203905090504260a05180821061336b578082039050905080820282158284830414171561336b579050905060405160a05180821061336b578082039050905080801561336b57820490509050818183011061336b5780820190509050815250612651565b565b6b204fce5e3e25026110000000604052670de0b6b3a764000060605260006002905b806080526020608051600281101561336b570260400151608051600281101561336b576003015480820282158284830414171561336b5790509050670de0b6b3a7640000808204905090506020608051600281101561336b5702604001526001018181186126755750506040518152606051602082015250565b6b204fce5e3e25026110000000608052670de0b6b3a764000060a05260006002905b8060c052602060c051600281101561336b570260800151602060c051600281101561336b57026040015180820282158284830414171561336b5790509050670de0b6b3a764000080820490509050602060c051600281101561336b570260800152600101818118612711575050608051815260a051602082015250565b60403660a03760006002905b602081026040015160e05260a05160e051818183011061336b578082019050905060a05260010181811861279a57505060a0516127db5760008152506129be565b60a05160e052608051600280820282158284830414171561336b579050905061010052600060ff905b806101205260e0516101405260006002905b6020810260400151610160526101405160e05180820282158284830414171561336b579050905061016051600280820282158284830414171561336b579050905080801561336b578204905090506101405260010181811861281657505060e05160c0526101005160a05180820282158284830414171561336b579050905060648082049050905061014051600280820282158284830414171561336b5790509050818183011061336b578082019050905060e05180820282158284830414171561336b579050905061010051606480821061336b578082039050905060e05180820282158284830414171561336b579050905060648082049050905060036101405180820282158284830414171561336b5790509050818183011061336b578082019050905080801561336b5782049050905060e05260c05160e0511161298457600160c05160e05180821061336b5780820390509050116129ac5760e05183525050506129be566129ac565b600160e05160c05180821061336b5780820390509050116129ac5760e05183525050506129be565b60010181811861280457505060006000fd5b565b610180516040526101a0516060526129d96101e06126ef565b6101e0805161024052602081015161026052506101c05161028052610240516040526102605160605261028051608052612a1461022061278e565b61022051815250565b6101a051610180511461336b5760006101a0511261336b5760026101a051121561336b576000610180511261336b57600261018051121561336b57612a63610240612528565b61024051610220526101e0516040526102005160605261022051608052612a8b61026061278e565b610260516102405261022051600280820282158284830414171561336b57905090506102605261024051610280526060366102a03760006002905b8061030052610180516103005118612ae5576101c0516102c052612b16565b6101a051610300511415612afc57612b7a56612b16565b602061030051600281101561336b57026101e001516102c0525b6102a0516102c051818183011061336b57808201905090506102a052610280516102405180820282158284830414171561336b57905090506102c051600280820282158284830414171561336b579050905080801561336b57820490509050610280525b600101818118612ac6575050610280516102405180820282158284830414171561336b5790509050606480820282158284830414171561336b579050905061026051600280820282158284830414171561336b579050905080801561336b57820490509050610280526102a05161024051606480820282158284830414171561336b57905090506102605180801561336b57820490509050818183011061336b5780820190509050610300526102405161032052600060ff905b8061034052610320516102e052610320516103205180820282158284830414171561336b579050905061028051818183011061336b578082019050905060026103205180820282158284830414171561336b579050905061030051818183011061336b57808201905090506102405180821061336b578082039050905080801561336b57820490509050610320526102e0516103205111612cfe5760016102e0516103205180821061336b578082039050905011612d2957610320518352505050612d3b56612d29565b6001610320516102e05180821061336b578082039050905011612d2957610320518352505050612d3b565b600101818118612c3457505060006000fd5b565b60006060511261336b576002606051121561336b57604051600280820282158284830414171561336b579050905060e05260c051610100526060366101203760006002905b8061018052606051610180511415612d9d57612e1956612db6565b602061018051600281101561336b570260800151610140525b6101205161014051818183011061336b5780820190509050610120526101005160c05180820282158284830414171561336b579050905061014051600280820282158284830414171561336b579050905080801561336b57820490509050610100525b600101818118612d825750506101005160c05180820282158284830414171561336b5790509050606480820282158284830414171561336b579050905060e051600280820282158284830414171561336b579050905080801561336b57820490509050610100526101205160c051606480820282158284830414171561336b579050905060e05180801561336b57820490509050818183011061336b57808201905090506101805260c0516101a052600060ff905b806101c0526101a051610160526101a0516101a05180820282158284830414171561336b579050905061010051818183011061336b578082019050905060026101a05180820282158284830414171561336b579050905061018051818183011061336b578082019050905060c05180821061336b578082039050905080801561336b578204905090506101a052610160516101a05111612f97576001610160516101a05180821061336b578082039050905011612fc2576101a0518352505050612fd456612fc2565b60016101a0516101605180821061336b578082039050905011612fc2576101a0518352505050612fd4565b600101818118612ece57505060006000fd5b565b612fe1610240612528565b6102405161022052612ff4610280612653565b610280805161024052602081015161026052506102405160405261026051606052610220516080526130276102a061278e565b6102a051610280526318160ddd6102c05260206102c060046102dc6008545afa613056573d600060003e3d6000fd5b60203d1061336b576102c0516102a052610280516101e0516102805180820282158284830414171561336b57905090506102a05180801561336b5782049050905080821061336b57808203905090506102c0526102205160405261020051606052610240516080526102605160a0526102c05160c0526130d7610300612d3d565b610300516102e05261024051610300526102605161032052600554600280820282158284830414171561336b57905090506004808204905090506103405260006002905b806103605260006103805261020051610360511861318c57602061036051600281101561336b570261024001516102c05180820282158284830414171561336b57905090506102805180801561336b578204905090506102e05180821061336b5780820390509050610380526131f2565b602061036051600281101561336b57026102400151602061036051600281101561336b570261024001516102c05180820282158284830414171561336b57905090506102805180801561336b5782049050905080821061336b5780820390509050610380525b602061036051600281101561336b5702610300018051610340516103805180820282158284830414171561336b57905090506402540be4008082049050905080821061336b578082039050905081525060010181811861311b575050602061020051600281101561336b570261030001516102205160405261020051606052610300516080526103205160a0526102c05160c052613291610380612d3d565b6103805180821061336b5780820390509050610360526402540be4006103805260016103a05261036051600180821061336b5780820390509050602061020051600281101561336b5702610380015180801561336b5782049050905061036052602061020051600281101561336b570261024001516102e05180821061336b5780820390509050602061020051600281101561336b5702610380015180801561336b578204905090506103c0526103605181526103c0516103605180821061336b578082039050905060208201526102a051604082015250565b600080fd005b600080fd000000000000000000000000745748bcfd8f9c2de519a71d789be8a63dd7d66c0000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c599000000000000000000000000fe18be6b3bd88a2d2a7f928d00292e7a9963cfc6000000000000000000000000051d7e5609917bd9b73f04bac0ded8dd46a74301000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000003d0900000000000000000000000000000000000000000000000000000000012a05f200

Deployed Bytecode

0x600436101561000d57612522565b60003560e01c3461336b5763f446c1d081186100425761002d60c0612528565b60c05160648082049050905060e052602060e0f35b6376a2f0f0811861005d57602061005960c0612528565b60c0f35b63bb7b8b808118610135576100736101a0612653565b6101a0805161022052602081015161024052506100916101e0612528565b6101e051610260526102205160405261024051606052610260516080526100b961020061278e565b61020051610180526318160ddd6101c05260206101c060046101dc6008545afa6100e8573d600060003e3d6000fd5b60203d1061336b576101c0516101a05261018051670de0b6b3a764000080820282158284830414171561336b57905090506101a05180801561336b578204905090506101c05260206101c0f35b63ed8e84f3811861031a576044358060011c61336b576102a05261015a6102e0612528565b6102e0516102c0526003546102e052600454610300526102e05161018052610300516101a0526102c0516101c0526101936103406129c0565b610340516103205260006002905b80610340526102a0516101ee57602061034051600281101561336b57026102e0018051602061034051600281101561336b57026004013580821061336b578082039050905081525061022c565b602061034051600281101561336b57026102e0018051602061034051600281101561336b570260040135818183011061336b57808201905090508152505b6001018181186101a15750506102e05161018052610300516101a0526102c0516101c05261025b6103606129c0565b61036051610340526318160ddd610380526020610380600461039c6008545afa61028a573d600060003e3d6000fd5b60203d1061336b5761038051610360526000610380526102a0516102c757610320516103405180821061336b5780820390509050610380526102e2565b610340516103205180821061336b5780820390509050610380525b610380516103605180820282158284830414171561336b57905090506103205180801561336b578204905090506103a05260206103a0f35b630b4c7e4d81186109675760005461336b57600160005560125461336b576103436102c0612528565b6102c0516102a0526003546102c0526004546102e0526102c051610180526102e0516101a0526102a0516101c05261037c6103206129c0565b6103205161030052600854610320526318160ddd610360526020610360600461037c610320515afa6103b3573d600060003e3d6000fd5b60203d1061336b5761036051610340526102c051610360526102e0516103805260006002905b806103a0526103405161040357600060206103a051600281101561336b570260040135111561336b575b60206103a051600281101561336b570261036001805160206103a051600281101561336b570260040135818183011061336b57808201905090508152506001018181186103d95750506103605161018052610380516101a0526102a0516101c05261046f6103c06129c0565b6103c0516103a052610300516103a051111561336b576103a0516103c0526060366103e037600061034051116104ba5761036051600355610380516004556103a051610420526106ec565b600554600280820282158284830414171561336b5790509050600480820490509050610440526006546104605260006002905b80610480526103a051602061048051600281101561336b57026102c0015180820282158284830414171561336b57905090506103005180801561336b578204905090506104a05260006104c052602061048051600281101561336b570261036001516104e0526104e0516104a0511161057f576104e0516104a05180821061336b57808203905090506104c05261059a565b6104a0516104e05180821061336b57808203905090506104c0525b610440516104c05180820282158284830414171561336b57905090506402540be40080820490509050602061048051600281101561336b57026103e001526104e051602061048051600281101561336b57026103e001516104605180820282158284830414171561336b57905090506402540be4008082049050905080821061336b578082039050905061048051600281101561336b5760030155602061048051600281101561336b5702610360018051602061048051600281101561336b57026103e0015180821061336b57808203905090508152506001018181186104ed5750506103605161018052610380516101a0526102a0516101c0526106a06104806129c0565b610480516103c052610340516103c0516103005180821061336b578082039050905080820282158284830414171561336b57905090506103005180801561336b57820490509050610420525b60443561042051101561075f576014610440527f536c697070616765207363726577656420796f75000000000000000000000000610460526104405061044051806104600181600003601f1636823750506308c379a061040052602061042052601f19601f61044051011660440161041cfd5b60006002905b80610440526000602061044051600281101561336b570260040135111561089257600060046104a0527f23b872dd000000000000000000000000000000000000000000000000000000006104c0526104a08051602082018361050001815181525050808301925050503381610500015260208101905030816105000152602081019050602061044051600281101561336b570260040135816105000152602081019050806104e0526104e0505060206105a06104e051610500600061044051600281101561336b57600101545af1610842573d600060003e3d6000fd5b61058060203d8082116108555781610857565b805b905090508152805180610460526020820180516104805250505060006104605111156108925761048051610460516020036008021c1561336b575b6001018181186107655750506340c10f1961044052336104605261042051610480526020610440604461045c6000610320515af16108d5573d600060003e3d6000fd5b60203d1061336b57610440518060011c61336b576104a0526104a050337f26f55a85081d24974e85c6c00045d0f0453991e95873f52bff0d21af4079a76860043561044052602435610460526103e05161048052610400516104a0526103a0516104c0526103405161042051818183011061336b57808201905090506104e05260c0610440a260206104206000600055f35b635e0d443f8118610b375760043580600f0b811861336b576103605260243580600f0b811861336b576103805261099f6103e0612653565b6103e080516103a05260208101516103c052506b204fce5e3e250261100000006103e052670de0b6b3a764000061040052602061036051600281101561336b57026103a00151604435602061036051600281101561336b57026103e0015180820282158284830414171561336b5790509050670de0b6b3a764000080820490509050818183011061336b5780820190509050610420526103605161018052610380516101a052610420516101c0526103a0516101e0526103c05161020052610a68610460612a1d565b6104605161044052602061038051600281101561336b57026103a001516104405180821061336b5780820390509050600180821061336b5780820390509050610460526005546104605180820282158284830414171561336b57905090506402540be4008082049050905061048052610460516104805180821061336b5780820390509050670de0b6b3a764000080820282158284830414171561336b5790509050602061038051600281101561336b57026103e0015180801561336b578204905090506104a05260206104a0f35b633df0212481186110fa5760043580600f0b811861336b576103605260243580600f0b811861336b576103805260005461336b57600160005560125461336b576003546103a0526004546103c0526103a0516040526103c051606052610b9e6104206126ef565b61042080516103e052602081015161040052506b204fce5e3e2502611000000061042052670de0b6b3a764000061044052602061036051600281101561336b57026103e00151604435602061036051600281101561336b5702610420015180820282158284830414171561336b5790509050670de0b6b3a764000080820490509050818183011061336b5780820190509050610460526103605161018052610380516101a052610460516101c0526103e0516101e0526104005161020052610c676104a0612a1d565b6104a05161048052602061038051600281101561336b57026103e001516104805180821061336b5780820390509050600180821061336b57808203905090506104a0526104a05160055480820282158284830414171561336b57905090506402540be400808204905090506104c0526104a0516104c05180821061336b5780820390509050670de0b6b3a764000080820282158284830414171561336b5790509050602061038051600281101561336b5702610420015180801561336b578204905090506104a0526064356104a0511015610dc757602e6104e0527f45786368616e676520726573756c74656420696e20666577657220636f696e73610500527f207468616e206578706563746564000000000000000000000000000000000000610520526104e0506104e051806105000181600003601f1636823750506308c379a06104a05260206104c052601f19601f6104e05101166044016104bcfd5b6104c05160065480820282158284830414171561336b57905090506402540be400808204905090506104e0526104e051670de0b6b3a764000080820282158284830414171561336b5790509050602061038051600281101561336b5702610420015180801561336b578204905090506104e052602061036051600281101561336b57026103a00151604435818183011061336b578082019050905061036051600281101561336b5760030155602061038051600281101561336b57026103a001516104a05180821061336b57808203905090506104e05180821061336b578082039050905061038051600281101561336b576003015560006004610540527f23b872dd0000000000000000000000000000000000000000000000000000000061056052610540805160208201836105a0018151815250508083019250505033816105a0015260208101905030816105a00152602081019050604435816105a00152602081019050806105805261058050506020610640610580516105a0600061036051600281101561336b57600101545af1610f68573d600060003e3d6000fd5b61062060203d808211610f7b5781610f7d565b805b90509050815280518061050052602082018051610520525050506000610500511115610fb85761052051610500516020036008021c1561336b575b60006004610540527fa9059cbb0000000000000000000000000000000000000000000000000000000061056052610540805160208201836105a0018151815250508083019250505033816105a001526020810190506104a051816105a00152602081019050806105805261058050506020610620610580516105a0600061038051600281101561336b57600101545af1611057573d600060003e3d6000fd5b61060060203d80821161106a578161106c565b805b905090508152805180610500526020820180516105205250505060006105005111156110a75761052051610500516020036008021c1561336b575b337f8b3e96f2b889fa771c53c981b40daf005f63f637f1869f707052d15a3dd9714061036051610540526044356105605261038051610580526104a0516105a0526080610540a260206104a06000600055f35b635b36389c811861141f5760005461336b5760016000556008546040526318160ddd608052602060806004609c6040515afa61113b573d600060003e3d6000fd5b60203d1061336b5760805160605260403660803760006002905b8060c05260c051600281101561336b576003015460e05260e05160043580820282158284830414171561336b579050905060605180801561336b5782049050905061010052602060c051600281101561336b570260240135610100511015611240576030610120527f5769746864726177616c20726573756c74656420696e20666577657220636f69610140527f6e73207468616e20657870656374656400000000000000000000000000000000610160526101205061012051806101400181600003601f1636823750506308c379a060e052602061010052601f19601f61012051011660440160fcfd5b60e0516101005180821061336b578082039050905060c051600281101561336b576003015561010051602060c051600281101561336b57026080015260006004610160527fa9059cbb0000000000000000000000000000000000000000000000000000000061018052610160805160208201836101c0018151815250508083019250505033816101c0015260208101905061010051816101c00152602081019050806101a0526101a0505060206102406101a0516101c0600060c051600281101561336b57600101545af161131a573d600060003e3d6000fd5b61022060203d80821161132d578161132f565b805b9050905081528051806101205260208201805161014052505050600061012051111561136a5761014051610120516020036008021c1561336b575b6001018181186111555750506379cc679060c0523360e05260043561010052602060c0604460dc60006040515af16113a7573d600060003e3d6000fd5b60203d1061336b5760c0518060011c61336b576101205261012050337f7c363854ccf79623411f8995b362bce5eddff18c927edc6f5dbbb5e05819a82c60805160c05260a05160e0526040366101003760605160043580821061336b57808203905090506101405260a060c0a2604060806000600055f35b63e31032738118611a1d5760005461336b57600160005560125461336b576114486102c0612528565b6102c0516102a0526003546102c0526004546102e0526102c051610180526102e0516101a0526102a0516101c0526114816103206129c0565b61032051610300526102c051610320526102e0516103405260006002905b8061036052602061036051600281101561336b5702610320018051602061036051600281101561336b57026004013580821061336b578082039050905081525060010181811861149f5750506103205161018052610340516101a0526102a0516101c05261150e6103806129c0565b6103805161036052600554600280820282158284830414171561336b5790509050600480820490509050610380526006546103a0526040366103c03760006002905b8061040052602061040051600281101561336b570261032001516104205261036051602061040051600281101561336b57026102c0015180820282158284830414171561336b57905090506103005180801561336b57820490509050610440526000610460526104205161044051116115e257610420516104405180821061336b5780820390509050610460526115fd565b610440516104205180821061336b5780820390509050610460525b610380516104605180820282158284830414171561336b57905090506402540be40080820490509050602061040051600281101561336b57026103c0015261042051602061040051600281101561336b57026103c001516103a05180820282158284830414171561336b57905090506402540be4008082049050905080821061336b578082039050905061040051600281101561336b576003015561042051602061040051600281101561336b57026103c0015180821061336b5780820390509050602061040051600281101561336b570261032001526001018181186115505750506103205161018052610340516101a0526102a0516101c0526117036104206129c0565b6104205161040052600854610420526318160ddd610460526020610460600461047c610420515afa61173a573d600060003e3d6000fd5b60203d1061336b576104605161044052610300516104005180821061336b57808203905090506104405180820282158284830414171561336b57905090506103005180801561336b57820490509050610460526000610460511461336b57610460516001818183011061336b578082019050905061046052604435610460511115611825576014610480527f536c697070616765207363726577656420796f750000000000000000000000006104a0526104805061048051806104a00181600003601f1636823750506308c379a061044052602061046052601f19601f61048051011660440161045cfd5b6379cc679061048052336104a052610460516104c0526020610480604461049c6000610420515af161185c573d600060003e3d6000fd5b60203d1061336b57610480518060011c61336b576104e0526104e05060006002905b80610480526000602061048051600281101561336b5702600401351461199d57600060046104e0527fa9059cbb00000000000000000000000000000000000000000000000000000000610500526104e080516020820183610540018151815250508083019250505033816105400152602081019050602061048051600281101561336b5702600401358161054001526020810190508061052052610520505060206105c061052051610540600061048051600281101561336b57600101545af161194d573d600060003e3d6000fd5b6105a060203d8082116119605781611962565b805b9050905081528051806104a0526020820180516104c05250505060006104a051111561199d576104c0516104a0516020036008021c1561336b575b60010181811861187e575050337f2b5508378d7e19e0d5fa338419034731416c4f5b219a10379956f764317fd47e600435610480526024356104a0526103c0516104c0526103e0516104e0526103605161050052610440516104605180821061336b57808203905090506105205260c0610480a260206104606000600055f35b63cc2b27d78118611a5a5760243580600f0b811861336b576103e05260206004356101e0526103e05161020052611a55610400612fd6565b610400f35b631a4d01d28118611d345760243580600f0b811861336b576103e05260005461336b57600160005560125461336b57606036610400376004356101e0526103e05161020052611aaa610460612fd6565b61046080516104005260208101516104205260408101516104405250604435610400511015611b39576018610460527f4e6f7420656e6f75676820636f696e732072656d6f7665640000000000000000610480526104605061046051806104800181600003601f1636823750506308c379a061042052602061044052601f19601f61046051011660440161043cfd5b6103e051600281101561336b576003018054610400516104205160065480820282158284830414171561336b57905090506402540be40080820490509050818183011061336b578082019050905080821061336b57808203905090508155506379cc67906104605233610480526004356104a0526020610460604461047c60006008545af1611bcd573d600060003e3d6000fd5b60203d1061336b57610460518060011c61336b576104c0526104c050600060046104a0527fa9059cbb000000000000000000000000000000000000000000000000000000006104c0526104a08051602082018361050001815181525050808301925050503381610500015260208101905061040051816105000152602081019050806104e0526104e0505060206105806104e05161050060006103e051600281101561336b57600101545af1611c88573d600060003e3d6000fd5b61056060203d808211611c9b5781611c9d565b805b90509050815280518061046052602082018051610480525050506000610460511115611cd85761048051610460516020036008021c1561336b575b337f5ad056f2e28a8cec232015406b843668c1e36cda598127ec3b8c59b8c72773a06004356104a052610400516104c0526104405160043580821061336b57808203905090506104e05260606104a0a260206104006000600055f35b633c157e648118611e7957600754331861336b57600b5462015180818183011061336b5780820190509050421061336b574262015180818183011061336b57808201905090506024351061336b57611d8c60e0612528565b60e05160c052600435606480820282158284830414171561336b579050905060e052600060043511611dbf576000611dc8565b620f4240600435105b1561336b5760c05160e05110611dfe5760c051600a80820282158284830414171561336b579050905060e0511161336b57611e20565b60c05160e051600a80820282158284830414171561336b57905090501061336b575b60c05160095560e051600a5542600b55602435600c557fa2b71ec6df949300b59aab36b55e189697b750119dd349fcfa8c0f779e83c25460c0516101005260e051610120524261014052602435610160526080610100a1005b63551a65888118611ee457600754331861336b57611e9760e0612528565b60e05160c05260c05160095560c051600a5542600b5542600c557f46e22fb3709ad289f62ce63d469248536dbc78d82b84a3d7e74ad606dc20193860c05160e0524261010052604060e0a1005b635b5a14678118611f7c57600754331861336b57600d5461336b5764012a05f2006004351161336b576402540be4006024351161336b57426203f480818183011061336b5780820190509050604052604051600d55600435600f556024356010556040517f351fc5da2fbf480f2225debf3664a4bc90fa9923743aad58b4603f648e931fe060043560605260243560805260406060a2005b634f12fe978118611ff457600754331861336b57600d54421061336b576000600d541461336b576000600d55600f546040526010546060526040516005556060516006557fbe12859b636aed607d5230b2cc2711f68d70e51060e6cca1f575ef5d2fcc95d160405160805260605160a05260406080a1005b63226840fb811861200f57600754331861336b576000600d55005b636b441a40811861208a576004358060a01c61336b57604052600754331861336b57600e5461336b57426203f480818183011061336b5780820190509050606052606051600e556040516011556040516060517f181aa3aa17d4cbf99265dd4443eba009433d3cde79d60164fde1d1a192beb93560006080a3005b636a1c05ae81186120ed57600754331861336b57600e54421061336b576000600e541461336b576000600e556011546040526040516007556040517f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c60006060a2005b6386fbf193811861210857600754331861336b576000600e55005b63e2e7d264811861217a576370a0823160405230606052602060406024605c600435600281101561336b57600101545afa612148573d600060003e3d6000fd5b60203d1061336b57604051600435600281101561336b576003015480821061336b578082039050905060805260206080f35b6330c5408581186122f157600754331861336b5760006002905b80604052604051600281101561336b57600101546060526370a0823160a0523060c052602060a0602460bc6060515afa6121d3573d600060003e3d6000fd5b60203d1061336b5760a051604051600281101561336b576003015480821061336b5780820390509050608052600060805111156122e3576000600460e0527fa9059cbb000000000000000000000000000000000000000000000000000000006101005260e0805160208201836101400181518152505080830192505050338161014001526020810190506080518161014001526020810190508061012052610120505060206101c06101205161014060006060515af1612298573d600060003e3d6000fd5b6101a060203d8082116122ab57816122ad565b805b90509050815280518060a05260208201805160c052505050600060a05111156122e35760c05160a0516020036008021c1561336b575b600101818118612194575050005b63524c3901811861236d57600754331861336b5760006002905b806040526370a0823160605230608052602060606024607c604051600281101561336b57600101545afa612344573d600060003e3d6000fd5b60203d1061336b57606051604051600281101561336b576003015560010181811861230b575050005b63e3698853811861239257600754331861336b5742601354111561336b576001601255005b633046f97281186123ad57600754331861336b576000601255005b63c661065781186123d157600435600281101561336b576001015460405260206040f35b634903b0d181186123f557600435600281101561336b576003015460405260206040f35b63ddca3f43811861240c5760055460405260206040f35b63fee3f7f981186124235760065460405260206040f35b638da5cb5b811861243a5760075460405260206040f35b6382c6306681186124515760085460405260206040f35b635409491a81186124685760095460405260206040f35b63b4b577ad811861247f57600a5460405260206040f35b632081066c811861249657600b5460405260206040f35b631405228881186124ad57600c5460405260206040f35b63405e28f881186124c457600d5460405260206040f35b63e0a0b58681186124db57600e5460405260206040f35b6358680d0b81186124f257600f5460405260206040f35b63e382446281186125095760105460405260206040f35b631ec0cdc181186125205760115460405260206040f35b505b60006000fd5b600c54604052600a54606052604051421061254c5760605181525061265156612651565b600954608052600b5460a052608051606051116125db5760805160805160605180821061336b57808203905090504260a05180821061336b578082039050905080820282158284830414171561336b579050905060405160a05180821061336b578082039050905080801561336b5782049050905080821061336b578082039050905081525061265156612651565b60805160605160805180821061336b57808203905090504260a05180821061336b578082039050905080820282158284830414171561336b579050905060405160a05180821061336b578082039050905080801561336b57820490509050818183011061336b5780820190509050815250612651565b565b6b204fce5e3e25026110000000604052670de0b6b3a764000060605260006002905b806080526020608051600281101561336b570260400151608051600281101561336b576003015480820282158284830414171561336b5790509050670de0b6b3a7640000808204905090506020608051600281101561336b5702604001526001018181186126755750506040518152606051602082015250565b6b204fce5e3e25026110000000608052670de0b6b3a764000060a05260006002905b8060c052602060c051600281101561336b570260800151602060c051600281101561336b57026040015180820282158284830414171561336b5790509050670de0b6b3a764000080820490509050602060c051600281101561336b570260800152600101818118612711575050608051815260a051602082015250565b60403660a03760006002905b602081026040015160e05260a05160e051818183011061336b578082019050905060a05260010181811861279a57505060a0516127db5760008152506129be565b60a05160e052608051600280820282158284830414171561336b579050905061010052600060ff905b806101205260e0516101405260006002905b6020810260400151610160526101405160e05180820282158284830414171561336b579050905061016051600280820282158284830414171561336b579050905080801561336b578204905090506101405260010181811861281657505060e05160c0526101005160a05180820282158284830414171561336b579050905060648082049050905061014051600280820282158284830414171561336b5790509050818183011061336b578082019050905060e05180820282158284830414171561336b579050905061010051606480821061336b578082039050905060e05180820282158284830414171561336b579050905060648082049050905060036101405180820282158284830414171561336b5790509050818183011061336b578082019050905080801561336b5782049050905060e05260c05160e0511161298457600160c05160e05180821061336b5780820390509050116129ac5760e05183525050506129be566129ac565b600160e05160c05180821061336b5780820390509050116129ac5760e05183525050506129be565b60010181811861280457505060006000fd5b565b610180516040526101a0516060526129d96101e06126ef565b6101e0805161024052602081015161026052506101c05161028052610240516040526102605160605261028051608052612a1461022061278e565b61022051815250565b6101a051610180511461336b5760006101a0511261336b5760026101a051121561336b576000610180511261336b57600261018051121561336b57612a63610240612528565b61024051610220526101e0516040526102005160605261022051608052612a8b61026061278e565b610260516102405261022051600280820282158284830414171561336b57905090506102605261024051610280526060366102a03760006002905b8061030052610180516103005118612ae5576101c0516102c052612b16565b6101a051610300511415612afc57612b7a56612b16565b602061030051600281101561336b57026101e001516102c0525b6102a0516102c051818183011061336b57808201905090506102a052610280516102405180820282158284830414171561336b57905090506102c051600280820282158284830414171561336b579050905080801561336b57820490509050610280525b600101818118612ac6575050610280516102405180820282158284830414171561336b5790509050606480820282158284830414171561336b579050905061026051600280820282158284830414171561336b579050905080801561336b57820490509050610280526102a05161024051606480820282158284830414171561336b57905090506102605180801561336b57820490509050818183011061336b5780820190509050610300526102405161032052600060ff905b8061034052610320516102e052610320516103205180820282158284830414171561336b579050905061028051818183011061336b578082019050905060026103205180820282158284830414171561336b579050905061030051818183011061336b57808201905090506102405180821061336b578082039050905080801561336b57820490509050610320526102e0516103205111612cfe5760016102e0516103205180821061336b578082039050905011612d2957610320518352505050612d3b56612d29565b6001610320516102e05180821061336b578082039050905011612d2957610320518352505050612d3b565b600101818118612c3457505060006000fd5b565b60006060511261336b576002606051121561336b57604051600280820282158284830414171561336b579050905060e05260c051610100526060366101203760006002905b8061018052606051610180511415612d9d57612e1956612db6565b602061018051600281101561336b570260800151610140525b6101205161014051818183011061336b5780820190509050610120526101005160c05180820282158284830414171561336b579050905061014051600280820282158284830414171561336b579050905080801561336b57820490509050610100525b600101818118612d825750506101005160c05180820282158284830414171561336b5790509050606480820282158284830414171561336b579050905060e051600280820282158284830414171561336b579050905080801561336b57820490509050610100526101205160c051606480820282158284830414171561336b579050905060e05180801561336b57820490509050818183011061336b57808201905090506101805260c0516101a052600060ff905b806101c0526101a051610160526101a0516101a05180820282158284830414171561336b579050905061010051818183011061336b578082019050905060026101a05180820282158284830414171561336b579050905061018051818183011061336b578082019050905060c05180821061336b578082039050905080801561336b578204905090506101a052610160516101a05111612f97576001610160516101a05180821061336b578082039050905011612fc2576101a0518352505050612fd456612fc2565b60016101a0516101605180821061336b578082039050905011612fc2576101a0518352505050612fd4565b600101818118612ece57505060006000fd5b565b612fe1610240612528565b6102405161022052612ff4610280612653565b610280805161024052602081015161026052506102405160405261026051606052610220516080526130276102a061278e565b6102a051610280526318160ddd6102c05260206102c060046102dc6008545afa613056573d600060003e3d6000fd5b60203d1061336b576102c0516102a052610280516101e0516102805180820282158284830414171561336b57905090506102a05180801561336b5782049050905080821061336b57808203905090506102c0526102205160405261020051606052610240516080526102605160a0526102c05160c0526130d7610300612d3d565b610300516102e05261024051610300526102605161032052600554600280820282158284830414171561336b57905090506004808204905090506103405260006002905b806103605260006103805261020051610360511861318c57602061036051600281101561336b570261024001516102c05180820282158284830414171561336b57905090506102805180801561336b578204905090506102e05180821061336b5780820390509050610380526131f2565b602061036051600281101561336b57026102400151602061036051600281101561336b570261024001516102c05180820282158284830414171561336b57905090506102805180801561336b5782049050905080821061336b5780820390509050610380525b602061036051600281101561336b5702610300018051610340516103805180820282158284830414171561336b57905090506402540be4008082049050905080821061336b578082039050905081525060010181811861311b575050602061020051600281101561336b570261030001516102205160405261020051606052610300516080526103205160a0526102c05160c052613291610380612d3d565b6103805180821061336b5780820390509050610360526402540be4006103805260016103a05261036051600180821061336b5780820390509050602061020051600281101561336b5702610380015180801561336b5782049050905061036052602061020051600281101561336b570261024001516102e05180821061336b5780820390509050602061020051600281101561336b5702610380015180801561336b578204905090506103c0526103605181526103c0516103605180821061336b578082039050905060208201526102a051604082015250565b600080fd

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000745748bcfd8f9c2de519a71d789be8a63dd7d66c0000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c599000000000000000000000000fe18be6b3bd88a2d2a7f928d00292e7a9963cfc6000000000000000000000000051d7e5609917bd9b73f04bac0ded8dd46a74301000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000003d0900000000000000000000000000000000000000000000000000000000012a05f200

-----Decoded View---------------
Arg [0] : _owner (address): 0x745748bcFd8F9c2De519a71D789be8A63dd7d66C
Arg [1] : _coins (address[2]): 0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599,0xfE18be6b3Bd88A2D2A7f928d00292E7a9963CfC6
Arg [2] : _pool_token (address): 0x051d7e5609917Bd9b73f04BAc0DED8Dd46a74301
Arg [3] : _A (uint256): 100
Arg [4] : _fee (uint256): 4000000
Arg [5] : _admin_fee (uint256): 5000000000

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 000000000000000000000000745748bcfd8f9c2de519a71d789be8a63dd7d66c
Arg [1] : 0000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c599
Arg [2] : 000000000000000000000000fe18be6b3bd88a2d2a7f928d00292e7a9963cfc6
Arg [3] : 000000000000000000000000051d7e5609917bd9b73f04bac0ded8dd46a74301
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000064
Arg [5] : 00000000000000000000000000000000000000000000000000000000003d0900
Arg [6] : 000000000000000000000000000000000000000000000000000000012a05f200


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.