ETH Price: $2,950.91 (+0.34%)

Contract

0x2191718CD32d02B8E60BAdFFeA33E4B5DD9A0A0D

Overview

ETH Balance

1 wei

ETH Value

Less Than $0.01 (@ $2,950.91/ETH)

Token Holdings

More Info

Private Name Tags

Transaction Hash
Block
From
To
Exchange3101788102025-02-26 18:24:31332 days ago1740594271IN
Curve: Router
5 ETH0.000004330.014658
Exchange3098898252025-02-25 22:14:08332 days ago1740521648IN
Curve: Router
2.8 ETH0.000005930.012159
Exchange3091891912025-02-23 21:23:20335 days ago1740345800IN
Curve: Router
14.838828 ETH0.000002560.01
Exchange3046481492025-02-10 15:32:41348 days ago1739201561IN
Curve: Router
1.89659098 ETH0.000010550.01
Exchange3045429212025-02-10 8:12:49348 days ago1739175169IN
Curve: Router
5 ETH0.000003730.01
Exchange3029690722025-02-05 18:02:53353 days ago1738778573IN
Curve: Router
3.81 ETH0.000002740.01
Exchange3023518522025-02-03 22:54:37354 days ago1738623277IN
Curve: Router
1.69 ETH0.000006480.017587
Exchange3023393822025-02-03 22:02:36354 days ago1738620156IN
Curve: Router
1.2 ETH0.000028920.228435
Exchange3020625572025-02-03 2:48:29355 days ago1738550909IN
Curve: Router
5 ETH0.000203941.770465
Exchange3017867442025-02-02 7:31:19356 days ago1738481479IN
Curve: Router
5 ETH0.000001240.01
Exchange2983660332025-01-23 7:49:24366 days ago1737618564IN
Curve: Router
2 ETH0.000004070.01
Exchange2954496522025-01-14 20:30:15375 days ago1736886615IN
Curve: Router
1.24 ETH0.000006840.01
Exchange2936273762025-01-09 13:18:59380 days ago1736428739IN
Curve: Router
3 ETH0.000003090.01
Exchange2931777932025-01-08 5:58:17381 days ago1736315897IN
Curve: Router
5.66 ETH0.00000130.01223
Exchange2911389622025-01-02 7:39:24387 days ago1735803564IN
Curve: Router
1.11 ETH0.000001910.01
Exchange2911365662025-01-02 7:29:24387 days ago1735802964IN
Curve: Router
2.50148825 ETH0.000001820.01
Exchange2897503072024-12-29 6:41:30391 days ago1735454490IN
Curve: Router
1 ETH0.000003870.01
Exchange2884953512024-12-25 15:12:45395 days ago1735139565IN
Curve: Router
1.66058025 ETH0.000003810.01
Exchange2873647602024-12-22 8:26:42398 days ago1734856002IN
Curve: Router
2.328 ETH0.000002740.01
Exchange2864656192024-12-19 17:45:43401 days ago1734630343IN
Curve: Router
37 ETH0.000047170.25948
Exchange2855430532024-12-17 1:29:18403 days ago1734398958IN
Curve: Router
3.989 ETH0.000005530.01
Exchange2855308622024-12-17 0:38:05403 days ago1734395885IN
Curve: Router
1.323 ETH0.000005480.01
Exchange2849823402024-12-15 10:27:22405 days ago1734258442IN
Curve: Router
1.578 ETH0.000001620.01
Exchange2849791362024-12-15 10:14:00405 days ago1734257640IN
Curve: Router
4.201 ETH0.000001760.01
Exchange2848533882024-12-15 1:29:46405 days ago1734226186IN
Curve: Router
1.27 ETH0.000004470.01
VIEW ADVANCED FILTER

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To
4247360922026-01-24 13:15:388 hrs ago1769260538
Curve: Router
0.00003381 ETH
4247360922026-01-24 13:15:388 hrs ago1769260538
Curve: Router
0.00003381 ETH
4244233882026-01-23 15:31:3130 hrs ago1769182291
Curve: Router
0.00682303 ETH
4244233882026-01-23 15:31:3130 hrs ago1769182291
Curve: Router
0.00682303 ETH
4243238052026-01-23 8:37:3137 hrs ago1769157451
Curve: Router
0.00169595 ETH
4243238052026-01-23 8:37:3137 hrs ago1769157451
Curve: Router
0.00169595 ETH
4242501602026-01-23 3:30:3842 hrs ago1769139038
Curve: Router
0.00337261 ETH
4242501602026-01-23 3:30:3842 hrs ago1769139038
Curve: Router
0.00337261 ETH
4241182482026-01-22 18:19:292 days ago1769105969
Curve: Router
0.01219336 ETH
4241182482026-01-22 18:19:292 days ago1769105969
Curve: Router
0.01219336 ETH
4239854602026-01-22 9:07:382 days ago1769072858
Curve: Router
0.00334718 ETH
4239854602026-01-22 9:07:382 days ago1769072858
Curve: Router
0.00334718 ETH
4237653132026-01-21 17:49:253 days ago1769017765
Curve: Router
0.0002 ETH
4237571932026-01-21 17:15:473 days ago1769015747
Curve: Router
0.0006517 ETH
4237571932026-01-21 17:15:473 days ago1769015747
Curve: Router
0.0006517 ETH
4237458802026-01-21 16:29:043 days ago1769012944
Curve: Router
0.06005068 ETH
4237458802026-01-21 16:29:043 days ago1769012944
Curve: Router
0.06005068 ETH
4236135022026-01-21 7:19:013 days ago1768979941
Curve: Router
0.00042687 ETH
4236135022026-01-21 7:19:013 days ago1768979941
Curve: Router
0.00042687 ETH
4236029992026-01-21 6:35:173 days ago1768977317
Curve: Router
0.00602821 ETH
4236029992026-01-21 6:35:173 days ago1768977317
Curve: Router
0.00602821 ETH
4236020002026-01-21 6:31:083 days ago1768977068
Curve: Router
0.00000016 ETH
4236020002026-01-21 6:31:083 days ago1768977068
Curve: Router
0.00000016 ETH
4235105022026-01-21 0:10:023 days ago1768954202
Curve: Router
0.00083306 ETH
4235105022026-01-21 0:10:023 days ago1768954202
Curve: Router
0.00083306 ETH
View All Internal Transactions

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CurveRouterSidechain v1.1

Compiler Version
vyper:0.3.10

Optimization Enabled:
N/A

Other Settings:
default evmVersion, None license

Contract Source Code (Vyper language format)

# @version 0.3.10

"""
@title CurveRouterSidechain v1.1
@author Curve.Fi
@license Copyright (c) Curve.Fi, 2020-2024 - all rights reserved
@notice Performs up to 5 swaps in a single transaction, can do estimations with get_dy and get_dx
"""

version: public(constant(String[8])) = "1.1.0"  # ng pools


from vyper.interfaces import ERC20

interface StablePool:
    def get_dy(i: int128, j: int128, amount: uint256) -> uint256: view
    def exchange(i: int128, j: int128, dx: uint256, min_dy: uint256): payable
    def get_dy_underlying(i: int128, j: int128, amount: uint256) -> uint256: view
    def exchange_underlying(i: int128, j: int128, dx: uint256, min_dy: uint256): payable
    def calc_withdraw_one_coin(token_amount: uint256, i: int128) -> uint256: view
    def remove_liquidity_one_coin(token_amount: uint256, i: int128, min_amount: uint256): nonpayable

interface CryptoPool:
    def get_dy(i: uint256, j: uint256, amount: uint256) -> uint256: view
    def exchange(i: uint256, j: uint256, dx: uint256, min_dy: uint256): payable
    def get_dy_underlying(i: uint256, j: uint256, amount: uint256) -> uint256: view
    def exchange_underlying(i: uint256, j: uint256, dx: uint256, min_dy: uint256): payable
    def calc_withdraw_one_coin(token_amount: uint256, i: uint256) -> uint256: view
    def remove_liquidity_one_coin(token_amount: uint256, i: uint256, min_amount: uint256): nonpayable

interface StableNgPool:
    def get_dx(i: int128, j: int128, amount: uint256) -> uint256: view
    def get_dx_underlying(i: int128, j: int128, amount: uint256) -> uint256: view
    def calc_token_amount(_amounts: DynArray[uint256, 8], _is_deposit: bool) -> uint256: view
    def add_liquidity(_amounts: DynArray[uint256, 8], _min_mint_amount: uint256) -> uint256: nonpayable

interface CryptoNgPool:
    def get_dx(i: uint256, j: uint256, out_amount: uint256) -> uint256: view

interface TriCryptoNgETH:
    def add_liquidity(amounts: uint256[3], min_mint_amount: uint256, use_eth: bool) -> uint256: payable
    def remove_liquidity_one_coin(token_amount: uint256, i: uint256, min_amount: uint256, use_eth: bool) -> uint256: nonpayable

interface CryptoPoolETH:
    def exchange(i: uint256, j: uint256, dx: uint256, min_dy: uint256, use_eth: bool): payable

interface LendingBasePoolMetaZap:
    def exchange_underlying(pool: address, i: int128, j: int128, dx: uint256, min_dy: uint256): nonpayable

interface CryptoMetaZap:
    def get_dy(pool: address, i: uint256, j: uint256, dx: uint256) -> uint256: view
    def exchange(pool: address, i: uint256, j: uint256, dx: uint256, min_dy: uint256, use_eth: bool): payable

interface StablePool2Coins:
    def add_liquidity(amounts: uint256[2], min_mint_amount: uint256): payable
    def calc_token_amount(amounts: uint256[2], is_deposit: bool) -> uint256: view

interface CryptoPool2Coins:
    def calc_token_amount(amounts: uint256[2]) -> uint256: view

interface StablePool3Coins:
    def add_liquidity(amounts: uint256[3], min_mint_amount: uint256): payable
    def calc_token_amount(amounts: uint256[3], is_deposit: bool) -> uint256: view

interface CryptoPool3Coins:
    def calc_token_amount(amounts: uint256[3]) -> uint256: view

interface StablePool4Coins:
    def add_liquidity(amounts: uint256[4], min_mint_amount: uint256): payable
    def calc_token_amount(amounts: uint256[4], is_deposit: bool) -> uint256: view

interface CryptoPool4Coins:
    def calc_token_amount(amounts: uint256[4]) -> uint256: view

interface StablePool5Coins:
    def add_liquidity(amounts: uint256[5], min_mint_amount: uint256): payable
    def calc_token_amount(amounts: uint256[5], is_deposit: bool) -> uint256: view

interface CryptoPool5Coins:
    def calc_token_amount(amounts: uint256[5]) -> uint256: view

interface LendingStablePool3Coins:
    def add_liquidity(amounts: uint256[3], min_mint_amount: uint256, use_underlying: bool): payable
    def remove_liquidity_one_coin(token_amount: uint256, i: int128, min_amount: uint256, use_underlying: bool) -> uint256: nonpayable

interface WETH:
    def deposit(): payable
    def withdraw(_amount: uint256): nonpayable

# Calc zaps
interface StableCalc:
    def calc_token_amount(pool: address, token: address, amounts: uint256[10], n_coins: uint256, deposit: bool, use_underlying: bool) -> uint256: view
    def get_dx(pool: address, i: int128, j: int128, dy: uint256, n_coins: uint256) -> uint256: view
    def get_dx_underlying(pool: address, i: int128, j: int128, dy: uint256, n_coins: uint256) -> uint256: view
    def get_dx_meta(pool: address, i: int128, j: int128, dy: uint256, n_coins: uint256, base_pool: address) -> uint256: view
    def get_dx_meta_underlying(pool: address, i: int128, j: int128, dy: uint256, n_coins: uint256, base_pool: address, base_token: address) -> uint256: view

interface CryptoCalc:
    def get_dx(pool: address, i: uint256, j: uint256, dy: uint256, n_coins: uint256) -> uint256: view
    def get_dx_meta_underlying(pool: address, i: uint256, j: uint256, dy: uint256, n_coins: uint256, base_pool: address, base_token: address) -> uint256: view


struct AmountAndFee:
    amountReceived: uint256
    fee: uint256
    exchangeFeeRate: uint256


event Exchange:
    sender: indexed(address)
    receiver: indexed(address)
    route: address[11]
    swap_params: uint256[5][5]
    pools: address[5]
    in_amount: uint256
    out_amount: uint256


ETH_ADDRESS: constant(address) = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE
WETH_ADDRESS: immutable(address)

# Calc zaps
STABLE_CALC: immutable(StableCalc)
CRYPTO_CALC: immutable(CryptoCalc)

is_approved: HashMap[address, HashMap[address, bool]]


@external
@payable
def __default__():
    pass


@external
def __init__( _weth: address, _stable_calc: address, _crypto_calc: address):
    WETH_ADDRESS = _weth
    STABLE_CALC = StableCalc(_stable_calc)
    CRYPTO_CALC = CryptoCalc(_crypto_calc)


@external
@payable
@nonreentrant('lock')
def exchange(
    _route: address[11],
    _swap_params: uint256[5][5],
    _amount: uint256,
    _min_dy: uint256,
    _pools: address[5]=empty(address[5]),
    _receiver: address=msg.sender
) -> uint256:
    """
    @notice Performs up to 5 swaps in a single transaction.
    @dev Routing and swap params must be determined off-chain. This
         functionality is designed for gas efficiency over ease-of-use.
    @param _route Array of [initial token, pool or zap, token, pool or zap, token, ...]
                  The array is iterated until a pool address of 0x00, then the last
                  given token is transferred to `_receiver`
    @param _swap_params Multidimensional array of [i, j, swap_type, pool_type, n_coins] where
                        i is the index of input token
                        j is the index of output token

                        The swap_type should be:
                        1. for `exchange`,
                        2. for `exchange_underlying`,
                        3. for underlying exchange via zap: factory stable metapools with lending base pool `exchange_underlying`
                           and factory crypto-meta pools underlying exchange (`exchange` method in zap)
                        4. for coin -> LP token "exchange" (actually `add_liquidity`),
                        5. for lending pool underlying coin -> LP token "exchange" (actually `add_liquidity`),
                        6. for LP token -> coin "exchange" (actually `remove_liquidity_one_coin`)
                        7. for LP token -> lending or fake pool underlying coin "exchange" (actually `remove_liquidity_one_coin`)
                        8. for ETH <-> WETH

                        pool_type: 1 - stable, 2 - twocrypto, 3 - tricrypto, 4 - llamma
                                   10 - stable-ng, 20 - twocrypto-ng, 30 - tricrypto-ng

                        n_coins is the number of coins in pool

    @param _amount The amount of input token (`_route[0]`) to be sent.
    @param _min_dy The minimum amount received after the final swap.
    @param _pools Array of pools for swaps via zap contracts. This parameter is needed only for swap_type = 3.
    @param _receiver Address to transfer the final output token to.
    @return Received amount of the final output token.
    """
    input_token: address = _route[0]
    output_token: address = empty(address)
    amount: uint256 = _amount

    # validate / transfer initial token
    if input_token == ETH_ADDRESS:
        assert msg.value == amount
    else:
        assert msg.value == 0
        assert ERC20(input_token).transferFrom(msg.sender, self, amount, default_return_value=True)

    for i in range(5):
        # 5 rounds of iteration to perform up to 5 swaps
        swap: address = _route[i * 2 + 1]
        pool: address = _pools[i]  # Only for Polygon meta-factories underlying swap (swap_type == 6)
        output_token = _route[(i + 1) * 2]
        params: uint256[5] = _swap_params[i]  # i, j, swap_type, pool_type, n_coins

        # store the initial balance of the output_token
        output_token_initial_balance: uint256 = self.balance
        if output_token != ETH_ADDRESS:
            output_token_initial_balance = ERC20(output_token).balanceOf(self)

        if not self.is_approved[input_token][swap]:
            assert ERC20(input_token).approve(swap, max_value(uint256), default_return_value=True, skip_contract_check=True)
            self.is_approved[input_token][swap] = True

        eth_amount: uint256 = 0
        if input_token == ETH_ADDRESS:
            eth_amount = amount
        # perform the swap according to the swap type
        if params[2] == 1:
            if params[3] in [1, 10]:  # stable and stable_ng
                StablePool(swap).exchange(convert(params[0], int128), convert(params[1], int128), amount, 0, value=eth_amount)
            else:  # crypto or llamma
                if input_token == ETH_ADDRESS or output_token == ETH_ADDRESS:
                    CryptoPoolETH(swap).exchange(params[0], params[1], amount, 0, True, value=eth_amount)
                else:
                    CryptoPool(swap).exchange(params[0], params[1], amount, 0)
        elif params[2] == 2:
            if params[3] in [1, 10]:  # stable and stable_ng
                StablePool(swap).exchange_underlying(convert(params[0], int128), convert(params[1], int128), amount, 0, value=eth_amount)
            else:  # crypto
                CryptoPool(swap).exchange_underlying(params[0], params[1], amount, 0, value=eth_amount)
        elif params[2] == 3:  # SWAP IS ZAP HERE !!!
            if params[3] in [1, 10]:  # stable and stable_ng
                LendingBasePoolMetaZap(swap).exchange_underlying(pool, convert(params[0], int128), convert(params[1], int128), amount, 0)
            else:  # crypto
                use_eth: bool = input_token == ETH_ADDRESS or output_token == ETH_ADDRESS
                CryptoMetaZap(swap).exchange(pool, params[0], params[1], amount, 0, use_eth, value=eth_amount)
        elif params[2] == 4:
            if params[3] == 10:  # stable_ng
                amounts: DynArray[uint256, 8] = [0, 0, 0, 0, 0, 0, 0, 0]
                amounts[params[0]] = amount
                StableNgPool(swap).add_liquidity(amounts, 0)
            elif params[3] == 30:  # tricrypto-ng
                amounts: uint256[3] = [0, 0, 0]
                amounts[params[0]] = amount
                if eth_amount > 0:
                    TriCryptoNgETH(swap).add_liquidity(amounts, 0, True, value=eth_amount)
                else:
                    StablePool3Coins(swap).add_liquidity(amounts, 0)
            elif params[4] == 2:
                amounts: uint256[2] = [0, 0]
                amounts[params[0]] = amount
                StablePool2Coins(swap).add_liquidity(amounts, 0, value=eth_amount)
            elif params[4] == 3:
                amounts: uint256[3] = [0, 0, 0]
                amounts[params[0]] = amount
                StablePool3Coins(swap).add_liquidity(amounts, 0, value=eth_amount)
            elif params[4] == 4:
                amounts: uint256[4] = [0, 0, 0, 0]
                amounts[params[0]] = amount
                StablePool4Coins(swap).add_liquidity(amounts, 0, value=eth_amount)
            elif params[4] == 5:
                amounts: uint256[5] = [0, 0, 0, 0, 0]
                amounts[params[0]] = amount
                StablePool5Coins(swap).add_liquidity(amounts, 0, value=eth_amount)
        elif params[2] == 5:
            amounts: uint256[3] = [0, 0, 0]
            amounts[params[0]] = amount
            LendingStablePool3Coins(swap).add_liquidity(amounts, 0, True, value=eth_amount) # example: aave on Polygon
        elif params[2] == 6:
            if params[3] in [1, 10]:  # stable and stable_ng
                StablePool(swap).remove_liquidity_one_coin(amount, convert(params[1], int128), 0)
            elif params[3] == 30 and output_token == ETH_ADDRESS:  # tricrypto-ng & ETH
                TriCryptoNgETH(swap).remove_liquidity_one_coin(amount, params[1], 0, True)
            else:  # crypto
                CryptoPool(swap).remove_liquidity_one_coin(amount, params[1], 0)  # example: atricrypto3 on Polygon
        elif params[2] == 7:
            LendingStablePool3Coins(swap).remove_liquidity_one_coin(amount, convert(params[1], int128), 0, True) # example: aave on Polygon
        elif params[2] == 8:
            if input_token == ETH_ADDRESS and output_token == WETH_ADDRESS:
                WETH(swap).deposit(value=amount)
            elif input_token == WETH_ADDRESS and output_token == ETH_ADDRESS:
                WETH(swap).withdraw(amount)
            else:
                raise "Swap type 8 is only for ETH <-> WETH"
        else:
            raise "Bad swap type"

        # update the amount received
        if output_token == ETH_ADDRESS:
            amount = self.balance
        else:
            amount = ERC20(output_token).balanceOf(self)

        # sanity check, if the routing data is incorrect we will have a 0 balance change and that is bad
        assert amount - output_token_initial_balance != 0, "Received nothing"

        # check if this was the last swap
        if i == 4 or _route[i * 2 + 3] == empty(address):
            break
        # if there is another swap, the output token becomes the input for the next round
        input_token = output_token

    amount -= 1  # Change non-zero -> non-zero costs less gas than zero -> non-zero
    assert amount >= _min_dy, "Slippage"

    # transfer the final token to the receiver
    if output_token == ETH_ADDRESS:
        raw_call(_receiver, b"", value=amount)
    else:
        assert ERC20(output_token).transfer(_receiver, amount, default_return_value=True)

    log Exchange(msg.sender, _receiver, _route, _swap_params, _pools, _amount, amount)

    return amount


@view
@external
def get_dy(
    _route: address[11],
    _swap_params: uint256[5][5],
    _amount: uint256,
    _pools: address[5]=empty(address[5])
) -> uint256:
    """
    @notice Get amount of the final output token received in an exchange
    @dev Routing and swap params must be determined off-chain. This
         functionality is designed for gas efficiency over ease-of-use.
    @param _route Array of [initial token, pool or zap, token, pool or zap, token, ...]
                  The array is iterated until a pool address of 0x00, then the last
                  given token is transferred to `_receiver`
    @param _swap_params Multidimensional array of [i, j, swap_type, pool_type, n_coins] where
                        i is the index of input token
                        j is the index of output token

                        The swap_type should be:
                        1. for `exchange`,
                        2. for `exchange_underlying`,
                        3. for underlying exchange via zap: factory stable metapools with lending base pool `exchange_underlying`
                           and factory crypto-meta pools underlying exchange (`exchange` method in zap)
                        4. for coin -> LP token "exchange" (actually `add_liquidity`),
                        5. for lending pool underlying coin -> LP token "exchange" (actually `add_liquidity`),
                        6. for LP token -> coin "exchange" (actually `remove_liquidity_one_coin`)
                        7. for LP token -> lending or fake pool underlying coin "exchange" (actually `remove_liquidity_one_coin`)
                        8. for ETH <-> WETH

                        pool_type: 1 - stable, 2 - twocrypto, 3 - tricrypto, 4 - llamma
                                   10 - stable-ng, 20 - twocrypto-ng, 30 - tricrypto-ng

                        n_coins is the number of coins in pool
    @param _amount The amount of input token (`_route[0]`) to be sent.
    @param _pools Array of pools for swaps via zap contracts. This parameter is needed only for swap_type = 3.
    @return Expected amount of the final output token.
    """
    input_token: address = _route[0]
    output_token: address = empty(address)
    amount: uint256 = _amount

    for i in range(5):
        # 5 rounds of iteration to perform up to 5 swaps
        swap: address = _route[i * 2 + 1]
        pool: address = _pools[i]  # Only for Polygon meta-factories underlying swap (swap_type == 4)
        output_token = _route[(i + 1) * 2]
        params: uint256[5] = _swap_params[i]  # i, j, swap_type, pool_type, n_coins

        # Calc output amount according to the swap type
        if params[2] == 1:
            if params[3] in [1, 10]:  # stable and stable_ng
                amount = StablePool(swap).get_dy(convert(params[0], int128), convert(params[1], int128), amount)
            else:  # crypto or llamma
                amount = CryptoPool(swap).get_dy(params[0], params[1], amount)
        elif params[2] == 2:
            if params[3] in [1, 10]:  # stable and stable_ng
                amount = StablePool(swap).get_dy_underlying(convert(params[0], int128), convert(params[1], int128), amount)
            else:  # crypto
                amount = CryptoPool(swap).get_dy_underlying(params[0], params[1], amount)
        elif params[2] == 3:  # SWAP IS ZAP HERE !!!
            if params[3] in [1, 10]:  # stable and stable_ng
                amount = StablePool(pool).get_dy_underlying(convert(params[0], int128), convert(params[1], int128), amount)
            else:  # crypto
                amount = CryptoMetaZap(swap).get_dy(pool, params[0], params[1], amount)
        elif params[2] in [4, 5]:
            if params[3] == 1:  # stable
                amounts: uint256[10] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
                amounts[params[0]] = amount
                amount = STABLE_CALC.calc_token_amount(swap, output_token, amounts, params[4], True, True)
            elif params[3] == 10:  # stable_ng
                amounts: DynArray[uint256, 8] = [0, 0, 0, 0, 0, 0, 0, 0]
                amounts[params[0]] = amount
                amount = StableNgPool(swap).calc_token_amount(amounts, True)
            else:
                # Tricrypto pools have stablepool interface for calc_token_amount
                if params[4] == 2:
                    amounts: uint256[2] = [0, 0]
                    amounts[params[0]] = amount
                    if params[3] == 2:  # twocrypto
                        amount = CryptoPool2Coins(swap).calc_token_amount(amounts)
                    else:  # tricrypto, twocrypto-ng
                        amount = StablePool2Coins(swap).calc_token_amount(amounts, True)
                elif params[4] == 3:
                    amounts: uint256[3] = [0, 0, 0]
                    amounts[params[0]] = amount
                    if params[3] == 2:  # twocrypto
                        amount = CryptoPool3Coins(swap).calc_token_amount(amounts)
                    else:  # tricrypto, tricrypto-ng
                        amount = StablePool3Coins(swap).calc_token_amount(amounts, True)
                elif params[4] == 4:
                    amounts: uint256[4] = [0, 0, 0, 0]
                    amounts[params[0]] = amount
                    if params[3] == 2:  # twocrypto
                        amount = CryptoPool4Coins(swap).calc_token_amount(amounts)
                    else:  # tricrypto
                        amount = StablePool4Coins(swap).calc_token_amount(amounts, True)
                elif params[4] == 5:
                    amounts: uint256[5] = [0, 0, 0, 0, 0]
                    amounts[params[0]] = amount
                    if params[3] == 2:  # twocrypto
                        amount = CryptoPool5Coins(swap).calc_token_amount(amounts)
                    else:  # tricrypto
                        amount = StablePool5Coins(swap).calc_token_amount(amounts, True)
        elif params[2] in [6, 7]:
            if params[3] in [1, 10]:  # stable and stable_ng
                amount = StablePool(swap).calc_withdraw_one_coin(amount, convert(params[1], int128))
            else:  # crypto
                amount = CryptoPool(swap).calc_withdraw_one_coin(amount, params[1])
        elif params[2] == 8:
            if input_token == WETH_ADDRESS or output_token == WETH_ADDRESS:
                # ETH <--> WETH rate is 1:1
                pass
            else:
                raise "Swap type 8 is only for ETH <-> WETH"
        else:
            raise "Bad swap type"

        # check if this was the last swap
        if i == 4 or _route[i * 2 + 3] == empty(address):
            break
        # if there is another swap, the output token becomes the input for the next round
        input_token = output_token

    return amount - 1


@view
@external
def get_dx(
    _route: address[11],
    _swap_params: uint256[5][5],
    _out_amount: uint256,
    _pools: address[5],
    _base_pools: address[5]=empty(address[5]),
    _base_tokens: address[5]=empty(address[5]),
) -> uint256:
    """
    @notice Calculate the input amount required to receive the desired `_out_amount`.
            This method is NOT PRECISE for swap_type = 4, 5, 6, 7.
    @dev Routing and swap params must be determined off-chain. This
         functionality is designed for gas efficiency over ease-of-use.
    @param _route Array of [initial token, pool or zap, token, pool or zap, token, ...]
                  The array is iterated until a pool address of 0x00, then the last
                  given token is transferred to `_receiver`
    @param _swap_params Multidimensional array of [i, j, swap_type, pool_type, n_coins] where
                        i is the index of input token
                        j is the index of output token

                        The swap_type should be:
                        1. for `exchange`,
                        2. for `exchange_underlying`,
                        3. for underlying exchange via zap: factory stable metapools with lending base pool `exchange_underlying`
                           and factory crypto-meta pools underlying exchange (`exchange` method in zap)
                        4. for coin -> LP token "exchange" (actually `add_liquidity`),
                        5. for lending pool underlying coin -> LP token "exchange" (actually `add_liquidity`),
                        6. for LP token -> coin "exchange" (actually `remove_liquidity_one_coin`)
                        7. for LP token -> lending or fake pool underlying coin "exchange" (actually `remove_liquidity_one_coin`)
                        8. for ETH <-> WETH

                        pool_type: 1 - stable, 2 - twocrypto, 3 - tricrypto, 4 - llamma
                                   10 - stable-ng, 20 - twocrypto-ng, 30 - tricrypto-ng

                        n_coins is the number of coins in pool

    @param _out_amount The desired amount of output coin to receive.
    @param _pools Array of pools.
    @param _base_pools Array of base pools (for meta pools).
    @param _base_tokens Array of base lp tokens (for meta pools).
    @return Required amount of input token to send.
    """
    amount: uint256 = _out_amount

    for _i in range(5):
        # 5 rounds of iteration to perform up to 5 swaps
        i: uint256 = 4 - _i
        swap: address = _route[i * 2 + 1]
        if swap == empty(address):
            continue
        input_token: address = _route[i * 2]
        output_token: address = _route[(i + 1) * 2]
        pool: address = _pools[i]
        base_pool: address = _base_pools[i]
        base_token: address = _base_tokens[i]
        params: uint256[5] = _swap_params[i]  # i, j, swap_type, pool_type, n_coins
        n_coins: uint256 = params[4]

        # Calc a required input amount according to the swap type
        if params[2] == 1:
            if params[3] == 1:  # stable
                if base_pool == empty(address):  # non-meta
                    amount = STABLE_CALC.get_dx(pool, convert(params[0], int128), convert(params[1], int128), amount, n_coins)
                else:
                    amount = STABLE_CALC.get_dx_meta(pool, convert(params[0], int128), convert(params[1], int128), amount, n_coins, base_pool)
            elif params[3] == 10:  # stable-ng
                amount = StableNgPool(pool).get_dx(convert(params[0], int128), convert(params[1], int128), amount)
            elif params[3] in [2, 3]:  # crypto
                amount = CRYPTO_CALC.get_dx(pool, params[0], params[1], amount, n_coins)
            else:  # llamma, twocrypto-ng, tricrypto-ng
                amount = CryptoNgPool(pool).get_dx(params[0], params[1], amount)
        elif params[2] in [2, 3]:
            if params[3] == 1:  # stable
                if base_pool == empty(address):  # non-meta
                    amount = STABLE_CALC.get_dx_underlying(pool, convert(params[0], int128), convert(params[1], int128), amount, n_coins)
                else:
                    amount = STABLE_CALC.get_dx_meta_underlying(pool, convert(params[0], int128), convert(params[1], int128), amount, n_coins, base_pool, base_token)
            elif params[3] == 10:  # stable-ng
                _n: int128 = convert(params[0], int128)
                _k: int128 = convert(params[1], int128)
                if _n > 0 and _k > 0:
                    amount = STABLE_CALC.get_dx(base_pool, _n - 1, _k - 1, amount, n_coins - 1)
                else:
                    amount = StableNgPool(pool).get_dx_underlying(_n, _k, amount)
            else:  # crypto
                amount = CRYPTO_CALC.get_dx_meta_underlying(pool, params[0], params[1], amount, n_coins, base_pool, base_token)
        elif params[2] in [4, 5]:
            # This is not correct. Should be something like calc_add_one_coin. But tests say that it's precise enough.
            if params[3] in [1, 10]:  # stable and stable_ng
                amount = StablePool(swap).calc_withdraw_one_coin(amount, convert(params[0], int128))
            else:  # crypto
                amount = CryptoPool(swap).calc_withdraw_one_coin(amount, params[0])
        elif params[2] in [6, 7]:
            if params[3] == 1:  # stable
                amounts: uint256[10] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
                amounts[params[1]] = amount
                amount = STABLE_CALC.calc_token_amount(swap, input_token, amounts, n_coins, False, True)
            elif params[3] == 10:  # stable_ng
                amounts: DynArray[uint256, 8] = [0, 0, 0, 0, 0, 0, 0, 0]
                amounts[params[1]] = amount
                amount = StableNgPool(swap).calc_token_amount(amounts, False)
            else:
                # Tricrypto pools have stablepool interface for calc_token_amount
                if n_coins == 2:
                    amounts: uint256[2] = [0, 0]
                    amounts[params[1]] = amount
                    if params[3] == 2:  # twocrypto
                        amount = CryptoPool2Coins(swap).calc_token_amount(amounts)  # This is not correct
                    else:  # tricrypto, twocrypto-ng
                        amount = StablePool2Coins(swap).calc_token_amount(amounts, False)
                elif n_coins == 3:
                    amounts: uint256[3] = [0, 0, 0]
                    amounts[params[1]] = amount
                    if params[3] == 2:  # twocrypto
                        amount = CryptoPool3Coins(swap).calc_token_amount(amounts)  # This is not correct
                    else:  # tricrypto, tricrypto-ng
                        amount = StablePool3Coins(swap).calc_token_amount(amounts, False)
                elif n_coins == 4:
                    amounts: uint256[4] = [0, 0, 0, 0]
                    amounts[params[1]] = amount
                    if params[3] == 2:  # twocrypto
                        amount = CryptoPool4Coins(swap).calc_token_amount(amounts)  # This is not correct
                    else:  # tricrypto
                        amount = StablePool4Coins(swap).calc_token_amount(amounts, False)
                elif n_coins == 5:
                    amounts: uint256[5] = [0, 0, 0, 0, 0]
                    amounts[params[1]] = amount
                    if params[3] == 2:  # twocrypto
                        amount = CryptoPool5Coins(swap).calc_token_amount(amounts)  # This is not correct
                    else:  # tricrypto
                        amount = StablePool5Coins(swap).calc_token_amount(amounts, False)
        elif params[2] == 8:
            if input_token == WETH_ADDRESS or output_token == WETH_ADDRESS:
                # ETH <--> WETH rate is 1:1
                pass
            else:
                raise "Swap type 8 is only for ETH <-> WETH"
        else:
            raise "Bad swap type"

    return amount

Contract Security Audit

Contract ABI

API
[{"name":"Exchange","inputs":[{"name":"sender","type":"address","indexed":true},{"name":"receiver","type":"address","indexed":true},{"name":"route","type":"address[11]","indexed":false},{"name":"swap_params","type":"uint256[5][5]","indexed":false},{"name":"pools","type":"address[5]","indexed":false},{"name":"in_amount","type":"uint256","indexed":false},{"name":"out_amount","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"stateMutability":"payable","type":"fallback"},{"stateMutability":"nonpayable","type":"constructor","inputs":[{"name":"_weth","type":"address"},{"name":"_stable_calc","type":"address"},{"name":"_crypto_calc","type":"address"}],"outputs":[]},{"stateMutability":"payable","type":"function","name":"exchange","inputs":[{"name":"_route","type":"address[11]"},{"name":"_swap_params","type":"uint256[5][5]"},{"name":"_amount","type":"uint256"},{"name":"_min_dy","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"payable","type":"function","name":"exchange","inputs":[{"name":"_route","type":"address[11]"},{"name":"_swap_params","type":"uint256[5][5]"},{"name":"_amount","type":"uint256"},{"name":"_min_dy","type":"uint256"},{"name":"_pools","type":"address[5]"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"payable","type":"function","name":"exchange","inputs":[{"name":"_route","type":"address[11]"},{"name":"_swap_params","type":"uint256[5][5]"},{"name":"_amount","type":"uint256"},{"name":"_min_dy","type":"uint256"},{"name":"_pools","type":"address[5]"},{"name":"_receiver","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"get_dy","inputs":[{"name":"_route","type":"address[11]"},{"name":"_swap_params","type":"uint256[5][5]"},{"name":"_amount","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"get_dy","inputs":[{"name":"_route","type":"address[11]"},{"name":"_swap_params","type":"uint256[5][5]"},{"name":"_amount","type":"uint256"},{"name":"_pools","type":"address[5]"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"get_dx","inputs":[{"name":"_route","type":"address[11]"},{"name":"_swap_params","type":"uint256[5][5]"},{"name":"_out_amount","type":"uint256"},{"name":"_pools","type":"address[5]"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"get_dx","inputs":[{"name":"_route","type":"address[11]"},{"name":"_swap_params","type":"uint256[5][5]"},{"name":"_out_amount","type":"uint256"},{"name":"_pools","type":"address[5]"},{"name":"_base_pools","type":"address[5]"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"get_dx","inputs":[{"name":"_route","type":"address[11]"},{"name":"_swap_params","type":"uint256[5][5]"},{"name":"_out_amount","type":"uint256"},{"name":"_pools","type":"address[5]"},{"name":"_base_pools","type":"address[5]"},{"name":"_base_tokens","type":"address[5]"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"version","inputs":[],"outputs":[{"name":"","type":"string"}]}]

61310a51503461006c57602061314f5f395f518060a01c61006c57604052602061316f5f395f518060a01c61006c57606052602061318f5f395f518060a01c61006c576080526040516130ca526060516130ea5260805161310a526130ca6100706100003961312a610000f35b5f80fd5f3560e01c60026007820660011b6130bc01601e395f51565b6354fd4d50811861009657346130b85760208060805260056040527f312e312e3000000000000000000000000000000000000000000000000000000060605260408160800181518152602082015160208201528051806020830101601f825f03163682375050601f19601f8251602001011690509050810190506080f35b635c9c18e281186130b6576105633611156130b8576104c4358060a01c6130b8576101a0526104e4358060a01c6130b8576101c052610504358060a01c6130b8576101e052610524358060a01c6130b85761020052610544358060a01c6130b857610220523361024052610e17566130b6565b63371dc447811861012f576104c33611156130b85760a0366101a0373361024052610e17565b63637653cb81186130b657610544361034176130b8576104a4358060a01c6130b8576101a0526104c4358060a01c6130b8576101c0526104e4358060a01c6130b8576101e052610504358060a01c6130b85761020052610524358060a01c6130b857610220525b6004358060a01c6130b8576040526024358060a01c6130b8576060526044358060a01c6130b8576080526064358060a01c6130b85760a0526084358060a01c6130b85760c05260a4358060a01c6130b85760e05260c4358060a01c6130b8576101005260e4358060a01c6130b85761012052610104358060a01c6130b85761014052610124358060a01c6130b85761016052610144358060a01c6130b85761018052604051610240525f6102605261048435610280525f6005905b806102a0526102a0518060011b818160011c186130b8579050600181018181106130b8579050600a81116130b85760051b604001516102c0526102a051600481116130b85760051b6101a001516102e0526102a051600181018181106130b85790508060011b818160011c186130b8579050600a81116130b85760051b604001516102605260a06102a051600481116130b857026101640180356103005260208101356103205260408101356103405260608101356103605260808101356103805250600161034051186103f8576103605160018118610332576001610338565b600a8118155b9050610393576102c05163556d6e9f6103a052610300516103c052610320516103e052610280516104005260206103a060646103bc845afa61037c573d5f5f3e3d5ffd5b60203d106130b8576103a090505161028052610d1e565b6102c051635e0d443f6103c0526103005180607f1c6130b8576103e0526103205180607f1c6130b85761040052610280516104205260206103c060646103dc845afa6103e1573d5f5f3e3d5ffd5b60203d106130b8576103c090505161028052610d1e565b600261034051186104dc57610360516001811861041657600161041c565b600a8118155b9050610477576102c0516385f11d1e6103a052610300516103c052610320516103e052610280516104005260206103a060646103bc845afa610460573d5f5f3e3d5ffd5b60203d106130b8576103a090505161028052610d1e565b6102c0516307211ef76103c0526103005180607f1c6130b8576103e0526103205180607f1c6130b85761040052610280516104205260206103c060646103dc845afa6104c5573d5f5f3e3d5ffd5b60203d106130b8576103c090505161028052610d1e565b600361034051186105c85761036051600181186104fa576001610500565b600a8118155b9050610563576102c05163e9737ee26103a0526102e0516103c052610300516103e0526103205161040052610280516104205260206103a060846103bc845afa61054c573d5f5f3e3d5ffd5b60203d106130b8576103a090505161028052610d1e565b6102e0516307211ef76103c0526103005180607f1c6130b8576103e0526103205180607f1c6130b85761040052610280516104205260206103c060646103dc845afa6105b1573d5f5f3e3d5ffd5b60203d106130b8576103c090505161028052610d1e565b61034051600481186105db5760016105e1565b60058118155b90506107fa5761034051600681186105fa576001610600565b60078118155b905061073957600861034051186106d05760206130ca5f395f51610240511861062a57600161063a565b60206130ca5f395f516102605118155b610d1e5760246103a0527f5377617020747970652038206973206f6e6c7920666f7220455448203c2d3e206103c0527f57455448000000000000000000000000000000000000000000000000000000006103e0526103a0506103a051806103c001601f825f031636823750506308c379a061036052602061038052601f19601f6103a051011660440161037cfd610d1e56610d1e565b600d6103a0527f42616420737761702074797065000000000000000000000000000000000000006103c0526103a0506103a051806103c001601f825f031636823750506308c379a061036052602061038052601f19601f6103a051011660440161037cfd610d1e565b610360516001811861074c576001610752565b600a8118155b90506107a5576102c051634fb08c5e6103c052610280516103e052610320516104005260206103c060446103dc845afa61078e573d5f5f3e3d5ffd5b60203d106130b8576103c090505161028052610d1e565b6102c05163cc2b27d76103e05261028051610400526103205180607f1c6130b8576104205260206103e060446103fc845afa6107e3573d5f5f3e3d5ffd5b60203d106130b8576103e090505161028052610d1e565b6001610360511861089d57610140366103c0376102805161030051600981116130b85760051b6103c0015260206130ea5f395f516379ccdf49610500526102c0516105205261026051610540526101406105606101406103c060045afa50610380516106a05260016106c05260016106e05260206105006101e461051c845afa610886573d5f5f3e3d5ffd5b60203d106130b85761050090505161028052610d1e565b600a610360511861096e57610100366103e03760086103c05261028051610300516103c0518110156130b85760051b6103e001526102c051633db06dd86104e0526040806105005280610500015f6103c0518083528060051b5f82600881116130b857801561092657905b8060051b6103e001518160051b602088010152600101818118610908575b505082016020019150509050810190506001610520525060206104e06101646104fc845afa610957573d5f5f3e3d5ffd5b60203d106130b8576104e090505161028052610d1e565b60026103805118610a43576040366103c0376102805161030051600181116130b85760051b6103c00152600261036051186109f0576102c051638d8ea727610400526103c051610420526103e051610440526020610400604461041c845afa6109d9573d5f5f3e3d5ffd5b60203d106130b85761040090505161028052610d1e565b6102c05163ed8e84f3610400526103c051610420526103e051610440526001610460526020610400606461041c845afa610a2c573d5f5f3e3d5ffd5b60203d106130b85761040090505161028052610d1e565b60036103805118610b28576060366103c0376102805161030051600281116130b85760051b6103c0015260026103605118610acd576102c051635b6f1b5a610420526103c051610440526103e0516104605261040051610480526020610420606461043c845afa610ab6573d5f5f3e3d5ffd5b60203d106130b85761042090505161028052610d1e565b6102c051633883e119610420526103c051610440526103e05161046052610400516104805260016104a0526020610420608461043c845afa610b11573d5f5f3e3d5ffd5b60203d106130b85761042090505161028052610d1e565b60046103805118610c1d576080366103c0376102805161030051600381116130b85760051b6103c0015260026103605118610bba576102c051631a805185610440526103c051610460526103e05161048052610400516104a052610420516104c0526020610440608461045c845afa610ba3573d5f5f3e3d5ffd5b60203d106130b85761044090505161028052610d1e565b6102c05163cf701ff7610440526103c051610460526103e05161048052610400516104a052610420516104c05260016104e052602061044060a461045c845afa610c06573d5f5f3e3d5ffd5b60203d106130b85761044090505161028052610d1e565b60056103805118610d1e5760a0366103c0376102805161030051600481116130b85760051b6103c0015260026103605118610cb7576102c0516309379690610460526103c051610480526103e0516104a052610400516104c052610420516104e0526104405161050052602061046060a461047c845afa610ca0573d5f5f3e3d5ffd5b60203d106130b85761046090505161028052610d1e565b6102c051637ede89c5610460526103c051610480526103e0516104a052610400516104c052610420516104e0526104405161050052600161052052602061046060c461047c845afa610d0b573d5f5f3e3d5ffd5b60203d106130b857610460905051610280525b60046102a05118610d30576001610d62565b6102a0518060011b818160011c186130b8579050600381018181106130b8579050600a81116130b85760051b60400151155b15610d6c57610d7f565b6102605161024052600101818118610251575b505061028051600181038181116130b85790506102a05260206102a0f36130b6565b63c872a3c58118612042576105833611156130b8576104c4358060a01c6130b8576101a0526104e4358060a01c6130b8576101c052610504358060a01c6130b8576101e052610524358060a01c6130b85761020052610544358060a01c6130b85761022052610564358060a01c6130b857610240525b6004358060a01c6130b8576040526024358060a01c6130b8576060526044358060a01c6130b8576080526064358060a01c6130b85760a0526084358060a01c6130b85760c05260a4358060a01c6130b85760e05260c4358060a01c6130b8576101005260e4358060a01c6130b85761012052610104358060a01c6130b85761014052610124358060a01c6130b85761016052610144358060a01c6130b857610180525f546002146130b85760025f55604051610260525f61028052610484356102a05273eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102605118610f07576102a05134186130b857610f81565b346130b857610260516323b872dd6102c052336102e05230610300526102a0516103205260206102c060646102dc5f855af1610f45573d5f5f3e3d5ffd5b3d610f5c57803b156130b857600161034052610f75565b60203d106130b8576102c0518060011c6130b857610340525b610340905051156130b8575b5f6005905b806102c0526102c0518060011b818160011c186130b8579050600181018181106130b8579050600a81116130b85760051b604001516102e0526102c051600481116130b85760051b6101a00151610300526102c051600181018181106130b85790508060011b818160011c186130b8579050600a81116130b85760051b604001516102805260a06102c051600481116130b857026101640180356103205260208101356103405260408101356103605260608101356103805260808101356103a05250476103c05273eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee61028051146110aa57610280516370a082316103e052306104005260206103e060246103fc845afa611097573d5f5f3e3d5ffd5b60203d106130b8576103e09050516103c0525b6001610260516020525f5260405f20806102e0516020525f5260405f20905054611171576102605163095ea7b36103e0526102e051610400527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6104205260206103e060446103fc5f855af1611122573d5f5f3e3d5ffd5b3d61113257600161044052611143565b6103e0518060011c6130b857610440525b610440905051156130b85760016001610260516020525f5260405f20806102e0516020525f5260405f209050555b5f6103e05273eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee610260511861119d576102a0516103e0525b600161036051186113185761038051600181186111bb5760016111c1565b600a8118155b90506112b55773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee61026051186111ec576001611208565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102805118155b61125c576102e051635b41b90861040052610320516104205261034051610440526102a051610460525f61048052803b156130b8575f610400608461041c5f855af1611256573d5f5f3e3d5ffd5b50611cff565b6102e05163394747c561040052610320516104205261034051610440526102a051610460525f6104805260016104a052803b156130b8575f61040060a461041c6103e051855af16112af573d5f5f3e3d5ffd5b50611cff565b6102e051633df02124610420526103205180607f1c6130b857610440526103405180607f1c6130b857610460526102a051610480525f6104a052803b156130b8575f610420608461043c6103e051855af1611312573d5f5f3e3d5ffd5b50611cff565b600261036051186113f857610380516001811861133657600161133c565b600a8118155b9050611395576102e0516365b2489b61040052610320516104205261034051610440526102a051610460525f61048052803b156130b8575f610400608461041c6103e051855af161138f573d5f5f3e3d5ffd5b50611cff565b6102e05163a6417ed6610420526103205180607f1c6130b857610440526103405180607f1c6130b857610460526102a051610480525f6104a052803b156130b8575f610420608461043c6103e051855af16113f2573d5f5f3e3d5ffd5b50611cff565b6003610360511861153257610380516001811861141657600161141c565b600a8118155b90506114ca5773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102605118611447576001611463565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102805118155b610400526102e051632bf78c61610420526103005161044052610320516104605261034051610480526102a0516104a0525f6104c052610400516104e052803b156130b8575f61042060c461043c6103e051855af16114c4573d5f5f3e3d5ffd5b50611cff565b6102e051637981c43e6104205261030051610440526103205180607f1c6130b857610460526103405180607f1c6130b857610480526102a0516104a0525f6104c052803b156130b8575f61042060a461043c5f855af161152c573d5f5f3e3d5ffd5b50611cff565b600461036051186118ef57600a61038051186116095761010036610420376008610400526102a05161032051610400518110156130b85760051b61042001526102e05163b72df5de610520526040806105405280610540015f610400518083528060051b5f82600881116130b85780156115c657905b8060051b61042001518160051b6020880101526001018181186115a8575b505082016020019150509050810190505f6105605250602061052061016461053c5f855af16115f7573d5f5f3e3d5ffd5b60203d106130b8576105205050611cff565b601e61038051186116eb57606036610400376102a05161032051600281116130b85760051b61040001526103e0511561169b576102e051632b6e993a610460526104005161048052610420516104a052610440516104c0525f6104e052600161050052602061046060a461047c6103e051855af1611689573d5f5f3e3d5ffd5b60203d106130b8576104605050611cff565b6102e051634515cef3610460526104005161048052610420516104a052610440516104c0525f6104e052803b156130b8575f610460608461047c5f855af16116e5573d5f5f3e3d5ffd5b50611cff565b60026103a0511861176057604036610400376102a05161032051600181116130b85760051b61040001526102e051630b4c7e4d61044052610400516104605261042051610480525f6104a052803b156130b8575f610440606461045c6103e051855af161175a573d5f5f3e3d5ffd5b50611cff565b60036103a051186117dd57606036610400376102a05161032051600281116130b85760051b61040001526102e051634515cef3610460526104005161048052610420516104a052610440516104c0525f6104e052803b156130b8575f610460608461047c6103e051855af16117d7573d5f5f3e3d5ffd5b50611cff565b60046103a0511861186257608036610400376102a05161032051600381116130b85760051b61040001526102e05163029b2f3461048052610400516104a052610420516104c052610440516104e05261046051610500525f61052052803b156130b8575f61048060a461049c6103e051855af161185c573d5f5f3e3d5ffd5b50611cff565b60056103a05118611cff5760a036610400376102a05161032051600481116130b85760051b61040001526102e05163847384996104a052610400516104c052610420516104e0526104405161050052610460516105205261048051610540525f61056052803b156130b8575f6104a060c46104bc6103e051855af16118e9573d5f5f3e3d5ffd5b50611cff565b6005610360511861197257606036610400376102a05161032051600281116130b85760051b61040001526102e051632b6e993a610460526104005161048052610420516104a052610440516104c0525f6104e052600161050052803b156130b8575f61046060a461047c6103e051855af161196c573d5f5f3e3d5ffd5b50611cff565b60066103605118611ab9576103805160018118611990576001611996565b600a8118155b9050611a6957601e61038051186119c75773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102805118156119c9565b5f5b611a15576102e05163f1dc3cc9610400526102a0516104205261034051610440525f61046052803b156130b8575f610400606461041c5f855af1611a0f573d5f5f3e3d5ffd5b50611cff565b6102e051638f15b6b5610400526102a0516104205261034051610440525f610460526001610480526020610400608461041c5f855af1611a57573d5f5f3e3d5ffd5b60203d106130b8576104005050611cff565b6102e051631a4d01d2610420526102a051610440526103405180607f1c6130b857610460525f61048052803b156130b8575f610420606461043c5f855af1611ab3573d5f5f3e3d5ffd5b50611cff565b60076103605118611b20576102e05163517a55a3610400526102a051610420526103405180607f1c6130b857610440525f610460526001610480526020610400608461041c5f855af1611b0e573d5f5f3e3d5ffd5b60203d106130b8576104005050611cff565b60086103605118611c9a5773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102605118611b5d5760206130ca5f395f51610280511815611b5f565b5f5b611c645760206130ca5f395f516102605118611b955773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee610280511815611b97565b5f5b611c29576024610400527f5377617020747970652038206973206f6e6c7920666f7220455448203c2d3e20610420527f57455448000000000000000000000000000000000000000000000000000000006104405261040050610400518061042001601f825f031636823750506308c379a06103c05260206103e052601f19601f6104005101166044016103dcfd611cff565b6102e051632e1a7d4d610400526102a05161042052803b156130b8575f610400602461041c5f855af1611c5e573d5f5f3e3d5ffd5b50611cff565b6102e05163d0e30db061040052803b156130b8575f610400600461041c6102a051855af1611c94573d5f5f3e3d5ffd5b50611cff565b600d610400527f42616420737761702074797065000000000000000000000000000000000000006104205261040050610400518061042001601f825f031636823750506308c379a06103c05260206103e052601f19601f6104005101166044016103dcfd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102805118611d2757476102a052611d65565b610280516370a082316104005230610420526020610400602461041c845afa611d52573d5f5f3e3d5ffd5b60203d106130b8576104009050516102a0525b6102a0516103c0518082038281116130b85790509050611de4576010610400527f5265636569766564206e6f7468696e67000000000000000000000000000000006104205261040050610400518061042001601f825f031636823750506308c379a06103c05260206103e052601f19601f6104005101166044016103dcfd5b60046102c05118611df6576001611e28565b6102c0518060011b818160011c186130b8579050600381018181106130b8579050600a81116130b85760051b60400151155b15611e3257611e45565b6102805161026052600101818118610f86575b50506102a051600181038181116130b85790506102a0526104a4356102a0511015611ecf5760086102c0527f536c6970706167650000000000000000000000000000000000000000000000006102e0526102c0506102c051806102e001601f825f031636823750506308c379a06102805260206102a052601f19601f6102c051011660440161029cfd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102805118611f2257610240516102a0515a5f6102c0526102c0505f5f6102c0516102e0858786f1905090509050611f95573d5f5f3e3d5ffd611f95565b6102805163a9059cbb6102c052610240516102e0526102a0516103005260206102c060446102dc5f855af1611f59573d5f5f3e3d5ffd5b3d611f7057803b156130b857600161032052611f89565b60203d106130b8576102c0518060011c6130b857610320525b610320905051156130b8575b61024051337f56d0661e240dfb199ef196e16e6f42473990366314f0226ac978f7be3cd9ee836101606102c0610160604060045afa5060a06101646104203760a06102046104c03760a06102a46105603760a06103446106003760a06103e46106a0376101a051610740526101c051610760526101e05161078052610200516107a052610220516107c052610484356107e0526102a051610800526105606102c0a360206102a060035f55f35b6390e7e20581186130b657610684361034176130b857610544358060a01c6130b85761024052610564358060a01c6130b85761026052610584358060a01c6130b857610280526105a4358060a01c6130b8576102a0526105c4358060a01c6130b8576102c0526105e4358060a01c6130b8576102e052610604358060a01c6130b85761030052610624358060a01c6130b85761032052610644358060a01c6130b85761034052610664358060a01c6130b857610360525b6004358060a01c6130b8576040526024358060a01c6130b8576060526044358060a01c6130b8576080526064358060a01c6130b85760a0526084358060a01c6130b85760c05260a4358060a01c6130b85760e05260c4358060a01c6130b8576101005260e4358060a01c6130b85761012052610104358060a01c6130b85761014052610124358060a01c6130b85761016052610144358060a01c6130b857610180526104a4358060a01c6130b8576101a0526104c4358060a01c6130b8576101c0526104e4358060a01c6130b8576101e052610504358060a01c6130b85761020052610524358060a01c6130b8576102205261048435610380525f6005905b806103a0526103a05180600403600481116130b85790506103c0526103c0518060011b818160011c186130b8579050600181018181106130b8579050600a81116130b85760051b604001516103e0526103e05161225457612fdb565b6103c0518060011b818160011c186130b8579050600a81116130b85760051b60400151610400526103c051600181018181106130b85790508060011b818160011c186130b8579050600a81116130b85760051b60400151610420526103c051600481116130b85760051b6101a00151610440526103c051600481116130b85760051b6102400151610460526103c051600481116130b85760051b6102e001516104805260a06103c051600481116130b857026101640180356104a05260208101356104c05260408101356104e05260608101356105005260808101356105205250610520516105405260016104e051186125a5576001610500511861245757610460516123d55760206130ea5f395f5163158819d46105605261044051610580526104a05180607f1c6130b8576105a0526104c05180607f1c6130b8576105c052610380516105e0526105405161060052602061056060a461057c845afa6123be573d5f5f3e3d5ffd5b60203d106130b85761056090505161038052612fdb565b60206130ea5f395f5163571f00b56105605261044051610580526104a05180607f1c6130b8576105a0526104c05180607f1c6130b8576105c052610380516105e05261054051610600526104605161062052602061056060c461057c845afa612440573d5f5f3e3d5ffd5b60203d106130b85761056090505161038052612fdb565b600a61050051186124c757610440516367df02ca610560526104a05180607f1c6130b857610580526104c05180607f1c6130b8576105a052610380516105c0526020610560606461057c845afa6124b0573d5f5f3e3d5ffd5b60203d106130b85761056090505161038052612fdb565b61050051600281186124da5760016124e0565b60038118155b905061253b57610440516337ed3a7a610560526104a051610580526104c0516105a052610380516105c0526020610560606461057c845afa612524573d5f5f3e3d5ffd5b60203d106130b85761056090505161038052612fdb565b602061310a5f395f5163ca4bc71461058052610440516105a0526104a0516105c0526104c0516105e05261038051610600526105405161062052602061058060a461059c845afa61258e573d5f5f3e3d5ffd5b60203d106130b85761058090505161038052612fdb565b6104e051600281186125b85760016125be565b60038118155b9050612d18576104e051600481186125d75760016125dd565b60058118155b9050612c57576104e051600681186125f65760016125fc565b60078118155b90506127355760086104e051186126cc5760206130ca5f395f516104005118612626576001612636565b60206130ca5f395f516104205118155b612fdb576024610560527f5377617020747970652038206973206f6e6c7920666f7220455448203c2d3e20610580527f57455448000000000000000000000000000000000000000000000000000000006105a05261056050610560518061058001601f825f031636823750506308c379a061052052602061054052601f19601f61056051011660440161053cfd612fdb56612fdb565b600d610560527f42616420737761702074797065000000000000000000000000000000000000006105805261056050610560518061058001601f825f031636823750506308c379a061052052602061054052601f19601f61056051011660440161053cfd612fdb565b600161050051186127d7576101403661058037610380516104c051600981116130b85760051b610580015260206130ea5f395f516379ccdf496106c0526103e0516106e052610400516107005261014061072061014061058060045afa5061054051610860525f6108805260016108a05260206106c06101e46106dc845afa6127c0573d5f5f3e3d5ffd5b60203d106130b8576106c090505161038052612fdb565b600a61050051186128a757610100366105a037600861058052610380516104c051610580518110156130b85760051b6105a001526103e051633db06dd86106a0526040806106c052806106c0015f610580518083528060051b5f82600881116130b857801561286057905b8060051b6105a001518160051b602088010152600101818118612842575b505082016020019150509050810190505f6106e0525060206106a06101646106bc845afa612890573d5f5f3e3d5ffd5b60203d106130b8576106a090505161038052612fdb565b6002610540511861297b5760403661058037610380516104c051600181116130b85760051b610580015260026105005118612929576103e051638d8ea7276105c052610580516105e0526105a0516106005260206105c060446105dc845afa612912573d5f5f3e3d5ffd5b60203d106130b8576105c090505161038052612fdb565b6103e05163ed8e84f36105c052610580516105e0526105a051610600525f6106205260206105c060646105dc845afa612964573d5f5f3e3d5ffd5b60203d106130b8576105c090505161038052612fdb565b60036105405118612a5f5760603661058037610380516104c051600281116130b85760051b610580015260026105005118612a05576103e051635b6f1b5a6105e05261058051610600526105a051610620526105c0516106405260206105e060646105fc845afa6129ee573d5f5f3e3d5ffd5b60203d106130b8576105e090505161038052612fdb565b6103e051633883e1196105e05261058051610600526105a051610620526105c051610640525f6106605260206105e060846105fc845afa612a48573d5f5f3e3d5ffd5b60203d106130b8576105e090505161038052612fdb565b60046105405118612b535760803661058037610380516104c051600381116130b85760051b610580015260026105005118612af1576103e051631a8051856106005261058051610620526105a051610640526105c051610660526105e051610680526020610600608461061c845afa612ada573d5f5f3e3d5ffd5b60203d106130b85761060090505161038052612fdb565b6103e05163cf701ff76106005261058051610620526105a051610640526105c051610660526105e051610680525f6106a052602061060060a461061c845afa612b3c573d5f5f3e3d5ffd5b60203d106130b85761060090505161038052612fdb565b60056105405118612fdb5760a03661058037610380516104c051600481116130b85760051b610580015260026105005118612bed576103e05163093796906106205261058051610640526105a051610660526105c051610680526105e0516106a052610600516106c052602061062060a461063c845afa612bd6573d5f5f3e3d5ffd5b60203d106130b85761062090505161038052612fdb565b6103e051637ede89c56106205261058051610640526105a051610660526105c051610680526105e0516106a052610600516106c0525f6106e052602061062060c461063c845afa612c40573d5f5f3e3d5ffd5b60203d106130b85761062090505161038052612fdb565b6105005160018118612c6a576001612c70565b600a8118155b9050612cc3576103e051634fb08c5e61058052610380516105a0526104a0516105c0526020610580604461059c845afa612cac573d5f5f3e3d5ffd5b60203d106130b85761058090505161038052612fdb565b6103e05163cc2b27d76105a052610380516105c0526104a05180607f1c6130b8576105e05260206105a060446105bc845afa612d01573d5f5f3e3d5ffd5b60203d106130b8576105a090505161038052612fdb565b60016105005118612e2f5761046051612da55760206130ea5f395f51638fd3218f61058052610440516105a0526104a05180607f1c6130b8576105c0526104c05180607f1c6130b8576105e05261038051610600526105405161062052602061058060a461059c845afa612d8e573d5f5f3e3d5ffd5b60203d106130b85761058090505161038052612fdb565b60206130ea5f395f51634933a86461058052610440516105a0526104a05180607f1c6130b8576105c0526104c05180607f1c6130b8576105e0526103805161060052610540516106205261046051610640526104805161066052602061058060e461059c845afa612e18573d5f5f3e3d5ffd5b60203d106130b85761058090505161038052612fdb565b600a6105005118612f65576104a05180607f1c6130b857610580526104c05180607f1c6130b8576105a0526001610580511215612e6c575f612e75565b60016105a05112155b612ece5761044051630e71d1b96105c052610580516105e0526105a05161060052610380516106205260206105c060646105dc845afa612eb7573d5f5f3e3d5ffd5b60203d106130b8576105c090505161038052612fdb565b60206130ea5f395f5163158819d46105c052610460516105e052610580516001810380600f0b81186130b8579050610600526105a0516001810380600f0b81186130b857905061062052610380516106405261054051600181038181116130b85790506106605260206105c060a46105dc845afa612f4e573d5f5f3e3d5ffd5b60203d106130b8576105c090505161038052612fdb565b602061310a5f395f51638ca1565361058052610440516105a0526104a0516105c0526104c0516105e0526103805161060052610540516106205261046051610640526104805161066052602061058060e461059c845afa612fc8573d5f5f3e3d5ffd5b60203d106130b857610580905051610380525b6001018181186121f85750506020610380f36130b6565b6381889a2c81186130b6576104a4361034176130b85760a0366101a037610196566130b6565b63c07b5353811861303b57610544361034176130b85761014036610240376120f9565b6381fc0ca581186130b6576105e4361034176130b857610544358060a01c6130b85761024052610564358060a01c6130b85761026052610584358060a01c6130b857610280526105a4358060a01c6130b8576102a0526105c4358060a01c6130b8576102c05260a0366102e0376120f9566130b6566130b6565b5b005b5f80fd30b530b501090da12ff200183018841930ca810e1860a16576797065728300030a001500000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1000000000000000000000000ca8d0747b5573d69653c3ac22242e6341c36e4b4000000000000000000000000a72c85c258a81761433b4e8da60505fe3dd551cc

Deployed Bytecode

0x5f3560e01c60026007820660011b6130bc01601e395f51565b6354fd4d50811861009657346130b85760208060805260056040527f312e312e3000000000000000000000000000000000000000000000000000000060605260408160800181518152602082015160208201528051806020830101601f825f03163682375050601f19601f8251602001011690509050810190506080f35b635c9c18e281186130b6576105633611156130b8576104c4358060a01c6130b8576101a0526104e4358060a01c6130b8576101c052610504358060a01c6130b8576101e052610524358060a01c6130b85761020052610544358060a01c6130b857610220523361024052610e17566130b6565b63371dc447811861012f576104c33611156130b85760a0366101a0373361024052610e17565b63637653cb81186130b657610544361034176130b8576104a4358060a01c6130b8576101a0526104c4358060a01c6130b8576101c0526104e4358060a01c6130b8576101e052610504358060a01c6130b85761020052610524358060a01c6130b857610220525b6004358060a01c6130b8576040526024358060a01c6130b8576060526044358060a01c6130b8576080526064358060a01c6130b85760a0526084358060a01c6130b85760c05260a4358060a01c6130b85760e05260c4358060a01c6130b8576101005260e4358060a01c6130b85761012052610104358060a01c6130b85761014052610124358060a01c6130b85761016052610144358060a01c6130b85761018052604051610240525f6102605261048435610280525f6005905b806102a0526102a0518060011b818160011c186130b8579050600181018181106130b8579050600a81116130b85760051b604001516102c0526102a051600481116130b85760051b6101a001516102e0526102a051600181018181106130b85790508060011b818160011c186130b8579050600a81116130b85760051b604001516102605260a06102a051600481116130b857026101640180356103005260208101356103205260408101356103405260608101356103605260808101356103805250600161034051186103f8576103605160018118610332576001610338565b600a8118155b9050610393576102c05163556d6e9f6103a052610300516103c052610320516103e052610280516104005260206103a060646103bc845afa61037c573d5f5f3e3d5ffd5b60203d106130b8576103a090505161028052610d1e565b6102c051635e0d443f6103c0526103005180607f1c6130b8576103e0526103205180607f1c6130b85761040052610280516104205260206103c060646103dc845afa6103e1573d5f5f3e3d5ffd5b60203d106130b8576103c090505161028052610d1e565b600261034051186104dc57610360516001811861041657600161041c565b600a8118155b9050610477576102c0516385f11d1e6103a052610300516103c052610320516103e052610280516104005260206103a060646103bc845afa610460573d5f5f3e3d5ffd5b60203d106130b8576103a090505161028052610d1e565b6102c0516307211ef76103c0526103005180607f1c6130b8576103e0526103205180607f1c6130b85761040052610280516104205260206103c060646103dc845afa6104c5573d5f5f3e3d5ffd5b60203d106130b8576103c090505161028052610d1e565b600361034051186105c85761036051600181186104fa576001610500565b600a8118155b9050610563576102c05163e9737ee26103a0526102e0516103c052610300516103e0526103205161040052610280516104205260206103a060846103bc845afa61054c573d5f5f3e3d5ffd5b60203d106130b8576103a090505161028052610d1e565b6102e0516307211ef76103c0526103005180607f1c6130b8576103e0526103205180607f1c6130b85761040052610280516104205260206103c060646103dc845afa6105b1573d5f5f3e3d5ffd5b60203d106130b8576103c090505161028052610d1e565b61034051600481186105db5760016105e1565b60058118155b90506107fa5761034051600681186105fa576001610600565b60078118155b905061073957600861034051186106d05760206130ca5f395f51610240511861062a57600161063a565b60206130ca5f395f516102605118155b610d1e5760246103a0527f5377617020747970652038206973206f6e6c7920666f7220455448203c2d3e206103c0527f57455448000000000000000000000000000000000000000000000000000000006103e0526103a0506103a051806103c001601f825f031636823750506308c379a061036052602061038052601f19601f6103a051011660440161037cfd610d1e56610d1e565b600d6103a0527f42616420737761702074797065000000000000000000000000000000000000006103c0526103a0506103a051806103c001601f825f031636823750506308c379a061036052602061038052601f19601f6103a051011660440161037cfd610d1e565b610360516001811861074c576001610752565b600a8118155b90506107a5576102c051634fb08c5e6103c052610280516103e052610320516104005260206103c060446103dc845afa61078e573d5f5f3e3d5ffd5b60203d106130b8576103c090505161028052610d1e565b6102c05163cc2b27d76103e05261028051610400526103205180607f1c6130b8576104205260206103e060446103fc845afa6107e3573d5f5f3e3d5ffd5b60203d106130b8576103e090505161028052610d1e565b6001610360511861089d57610140366103c0376102805161030051600981116130b85760051b6103c0015260206130ea5f395f516379ccdf49610500526102c0516105205261026051610540526101406105606101406103c060045afa50610380516106a05260016106c05260016106e05260206105006101e461051c845afa610886573d5f5f3e3d5ffd5b60203d106130b85761050090505161028052610d1e565b600a610360511861096e57610100366103e03760086103c05261028051610300516103c0518110156130b85760051b6103e001526102c051633db06dd86104e0526040806105005280610500015f6103c0518083528060051b5f82600881116130b857801561092657905b8060051b6103e001518160051b602088010152600101818118610908575b505082016020019150509050810190506001610520525060206104e06101646104fc845afa610957573d5f5f3e3d5ffd5b60203d106130b8576104e090505161028052610d1e565b60026103805118610a43576040366103c0376102805161030051600181116130b85760051b6103c00152600261036051186109f0576102c051638d8ea727610400526103c051610420526103e051610440526020610400604461041c845afa6109d9573d5f5f3e3d5ffd5b60203d106130b85761040090505161028052610d1e565b6102c05163ed8e84f3610400526103c051610420526103e051610440526001610460526020610400606461041c845afa610a2c573d5f5f3e3d5ffd5b60203d106130b85761040090505161028052610d1e565b60036103805118610b28576060366103c0376102805161030051600281116130b85760051b6103c0015260026103605118610acd576102c051635b6f1b5a610420526103c051610440526103e0516104605261040051610480526020610420606461043c845afa610ab6573d5f5f3e3d5ffd5b60203d106130b85761042090505161028052610d1e565b6102c051633883e119610420526103c051610440526103e05161046052610400516104805260016104a0526020610420608461043c845afa610b11573d5f5f3e3d5ffd5b60203d106130b85761042090505161028052610d1e565b60046103805118610c1d576080366103c0376102805161030051600381116130b85760051b6103c0015260026103605118610bba576102c051631a805185610440526103c051610460526103e05161048052610400516104a052610420516104c0526020610440608461045c845afa610ba3573d5f5f3e3d5ffd5b60203d106130b85761044090505161028052610d1e565b6102c05163cf701ff7610440526103c051610460526103e05161048052610400516104a052610420516104c05260016104e052602061044060a461045c845afa610c06573d5f5f3e3d5ffd5b60203d106130b85761044090505161028052610d1e565b60056103805118610d1e5760a0366103c0376102805161030051600481116130b85760051b6103c0015260026103605118610cb7576102c0516309379690610460526103c051610480526103e0516104a052610400516104c052610420516104e0526104405161050052602061046060a461047c845afa610ca0573d5f5f3e3d5ffd5b60203d106130b85761046090505161028052610d1e565b6102c051637ede89c5610460526103c051610480526103e0516104a052610400516104c052610420516104e0526104405161050052600161052052602061046060c461047c845afa610d0b573d5f5f3e3d5ffd5b60203d106130b857610460905051610280525b60046102a05118610d30576001610d62565b6102a0518060011b818160011c186130b8579050600381018181106130b8579050600a81116130b85760051b60400151155b15610d6c57610d7f565b6102605161024052600101818118610251575b505061028051600181038181116130b85790506102a05260206102a0f36130b6565b63c872a3c58118612042576105833611156130b8576104c4358060a01c6130b8576101a0526104e4358060a01c6130b8576101c052610504358060a01c6130b8576101e052610524358060a01c6130b85761020052610544358060a01c6130b85761022052610564358060a01c6130b857610240525b6004358060a01c6130b8576040526024358060a01c6130b8576060526044358060a01c6130b8576080526064358060a01c6130b85760a0526084358060a01c6130b85760c05260a4358060a01c6130b85760e05260c4358060a01c6130b8576101005260e4358060a01c6130b85761012052610104358060a01c6130b85761014052610124358060a01c6130b85761016052610144358060a01c6130b857610180525f546002146130b85760025f55604051610260525f61028052610484356102a05273eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102605118610f07576102a05134186130b857610f81565b346130b857610260516323b872dd6102c052336102e05230610300526102a0516103205260206102c060646102dc5f855af1610f45573d5f5f3e3d5ffd5b3d610f5c57803b156130b857600161034052610f75565b60203d106130b8576102c0518060011c6130b857610340525b610340905051156130b8575b5f6005905b806102c0526102c0518060011b818160011c186130b8579050600181018181106130b8579050600a81116130b85760051b604001516102e0526102c051600481116130b85760051b6101a00151610300526102c051600181018181106130b85790508060011b818160011c186130b8579050600a81116130b85760051b604001516102805260a06102c051600481116130b857026101640180356103205260208101356103405260408101356103605260608101356103805260808101356103a05250476103c05273eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee61028051146110aa57610280516370a082316103e052306104005260206103e060246103fc845afa611097573d5f5f3e3d5ffd5b60203d106130b8576103e09050516103c0525b6001610260516020525f5260405f20806102e0516020525f5260405f20905054611171576102605163095ea7b36103e0526102e051610400527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6104205260206103e060446103fc5f855af1611122573d5f5f3e3d5ffd5b3d61113257600161044052611143565b6103e0518060011c6130b857610440525b610440905051156130b85760016001610260516020525f5260405f20806102e0516020525f5260405f209050555b5f6103e05273eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee610260511861119d576102a0516103e0525b600161036051186113185761038051600181186111bb5760016111c1565b600a8118155b90506112b55773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee61026051186111ec576001611208565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102805118155b61125c576102e051635b41b90861040052610320516104205261034051610440526102a051610460525f61048052803b156130b8575f610400608461041c5f855af1611256573d5f5f3e3d5ffd5b50611cff565b6102e05163394747c561040052610320516104205261034051610440526102a051610460525f6104805260016104a052803b156130b8575f61040060a461041c6103e051855af16112af573d5f5f3e3d5ffd5b50611cff565b6102e051633df02124610420526103205180607f1c6130b857610440526103405180607f1c6130b857610460526102a051610480525f6104a052803b156130b8575f610420608461043c6103e051855af1611312573d5f5f3e3d5ffd5b50611cff565b600261036051186113f857610380516001811861133657600161133c565b600a8118155b9050611395576102e0516365b2489b61040052610320516104205261034051610440526102a051610460525f61048052803b156130b8575f610400608461041c6103e051855af161138f573d5f5f3e3d5ffd5b50611cff565b6102e05163a6417ed6610420526103205180607f1c6130b857610440526103405180607f1c6130b857610460526102a051610480525f6104a052803b156130b8575f610420608461043c6103e051855af16113f2573d5f5f3e3d5ffd5b50611cff565b6003610360511861153257610380516001811861141657600161141c565b600a8118155b90506114ca5773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102605118611447576001611463565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102805118155b610400526102e051632bf78c61610420526103005161044052610320516104605261034051610480526102a0516104a0525f6104c052610400516104e052803b156130b8575f61042060c461043c6103e051855af16114c4573d5f5f3e3d5ffd5b50611cff565b6102e051637981c43e6104205261030051610440526103205180607f1c6130b857610460526103405180607f1c6130b857610480526102a0516104a0525f6104c052803b156130b8575f61042060a461043c5f855af161152c573d5f5f3e3d5ffd5b50611cff565b600461036051186118ef57600a61038051186116095761010036610420376008610400526102a05161032051610400518110156130b85760051b61042001526102e05163b72df5de610520526040806105405280610540015f610400518083528060051b5f82600881116130b85780156115c657905b8060051b61042001518160051b6020880101526001018181186115a8575b505082016020019150509050810190505f6105605250602061052061016461053c5f855af16115f7573d5f5f3e3d5ffd5b60203d106130b8576105205050611cff565b601e61038051186116eb57606036610400376102a05161032051600281116130b85760051b61040001526103e0511561169b576102e051632b6e993a610460526104005161048052610420516104a052610440516104c0525f6104e052600161050052602061046060a461047c6103e051855af1611689573d5f5f3e3d5ffd5b60203d106130b8576104605050611cff565b6102e051634515cef3610460526104005161048052610420516104a052610440516104c0525f6104e052803b156130b8575f610460608461047c5f855af16116e5573d5f5f3e3d5ffd5b50611cff565b60026103a0511861176057604036610400376102a05161032051600181116130b85760051b61040001526102e051630b4c7e4d61044052610400516104605261042051610480525f6104a052803b156130b8575f610440606461045c6103e051855af161175a573d5f5f3e3d5ffd5b50611cff565b60036103a051186117dd57606036610400376102a05161032051600281116130b85760051b61040001526102e051634515cef3610460526104005161048052610420516104a052610440516104c0525f6104e052803b156130b8575f610460608461047c6103e051855af16117d7573d5f5f3e3d5ffd5b50611cff565b60046103a0511861186257608036610400376102a05161032051600381116130b85760051b61040001526102e05163029b2f3461048052610400516104a052610420516104c052610440516104e05261046051610500525f61052052803b156130b8575f61048060a461049c6103e051855af161185c573d5f5f3e3d5ffd5b50611cff565b60056103a05118611cff5760a036610400376102a05161032051600481116130b85760051b61040001526102e05163847384996104a052610400516104c052610420516104e0526104405161050052610460516105205261048051610540525f61056052803b156130b8575f6104a060c46104bc6103e051855af16118e9573d5f5f3e3d5ffd5b50611cff565b6005610360511861197257606036610400376102a05161032051600281116130b85760051b61040001526102e051632b6e993a610460526104005161048052610420516104a052610440516104c0525f6104e052600161050052803b156130b8575f61046060a461047c6103e051855af161196c573d5f5f3e3d5ffd5b50611cff565b60066103605118611ab9576103805160018118611990576001611996565b600a8118155b9050611a6957601e61038051186119c75773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102805118156119c9565b5f5b611a15576102e05163f1dc3cc9610400526102a0516104205261034051610440525f61046052803b156130b8575f610400606461041c5f855af1611a0f573d5f5f3e3d5ffd5b50611cff565b6102e051638f15b6b5610400526102a0516104205261034051610440525f610460526001610480526020610400608461041c5f855af1611a57573d5f5f3e3d5ffd5b60203d106130b8576104005050611cff565b6102e051631a4d01d2610420526102a051610440526103405180607f1c6130b857610460525f61048052803b156130b8575f610420606461043c5f855af1611ab3573d5f5f3e3d5ffd5b50611cff565b60076103605118611b20576102e05163517a55a3610400526102a051610420526103405180607f1c6130b857610440525f610460526001610480526020610400608461041c5f855af1611b0e573d5f5f3e3d5ffd5b60203d106130b8576104005050611cff565b60086103605118611c9a5773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102605118611b5d5760206130ca5f395f51610280511815611b5f565b5f5b611c645760206130ca5f395f516102605118611b955773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee610280511815611b97565b5f5b611c29576024610400527f5377617020747970652038206973206f6e6c7920666f7220455448203c2d3e20610420527f57455448000000000000000000000000000000000000000000000000000000006104405261040050610400518061042001601f825f031636823750506308c379a06103c05260206103e052601f19601f6104005101166044016103dcfd611cff565b6102e051632e1a7d4d610400526102a05161042052803b156130b8575f610400602461041c5f855af1611c5e573d5f5f3e3d5ffd5b50611cff565b6102e05163d0e30db061040052803b156130b8575f610400600461041c6102a051855af1611c94573d5f5f3e3d5ffd5b50611cff565b600d610400527f42616420737761702074797065000000000000000000000000000000000000006104205261040050610400518061042001601f825f031636823750506308c379a06103c05260206103e052601f19601f6104005101166044016103dcfd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102805118611d2757476102a052611d65565b610280516370a082316104005230610420526020610400602461041c845afa611d52573d5f5f3e3d5ffd5b60203d106130b8576104009050516102a0525b6102a0516103c0518082038281116130b85790509050611de4576010610400527f5265636569766564206e6f7468696e67000000000000000000000000000000006104205261040050610400518061042001601f825f031636823750506308c379a06103c05260206103e052601f19601f6104005101166044016103dcfd5b60046102c05118611df6576001611e28565b6102c0518060011b818160011c186130b8579050600381018181106130b8579050600a81116130b85760051b60400151155b15611e3257611e45565b6102805161026052600101818118610f86575b50506102a051600181038181116130b85790506102a0526104a4356102a0511015611ecf5760086102c0527f536c6970706167650000000000000000000000000000000000000000000000006102e0526102c0506102c051806102e001601f825f031636823750506308c379a06102805260206102a052601f19601f6102c051011660440161029cfd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102805118611f2257610240516102a0515a5f6102c0526102c0505f5f6102c0516102e0858786f1905090509050611f95573d5f5f3e3d5ffd611f95565b6102805163a9059cbb6102c052610240516102e0526102a0516103005260206102c060446102dc5f855af1611f59573d5f5f3e3d5ffd5b3d611f7057803b156130b857600161032052611f89565b60203d106130b8576102c0518060011c6130b857610320525b610320905051156130b8575b61024051337f56d0661e240dfb199ef196e16e6f42473990366314f0226ac978f7be3cd9ee836101606102c0610160604060045afa5060a06101646104203760a06102046104c03760a06102a46105603760a06103446106003760a06103e46106a0376101a051610740526101c051610760526101e05161078052610200516107a052610220516107c052610484356107e0526102a051610800526105606102c0a360206102a060035f55f35b6390e7e20581186130b657610684361034176130b857610544358060a01c6130b85761024052610564358060a01c6130b85761026052610584358060a01c6130b857610280526105a4358060a01c6130b8576102a0526105c4358060a01c6130b8576102c0526105e4358060a01c6130b8576102e052610604358060a01c6130b85761030052610624358060a01c6130b85761032052610644358060a01c6130b85761034052610664358060a01c6130b857610360525b6004358060a01c6130b8576040526024358060a01c6130b8576060526044358060a01c6130b8576080526064358060a01c6130b85760a0526084358060a01c6130b85760c05260a4358060a01c6130b85760e05260c4358060a01c6130b8576101005260e4358060a01c6130b85761012052610104358060a01c6130b85761014052610124358060a01c6130b85761016052610144358060a01c6130b857610180526104a4358060a01c6130b8576101a0526104c4358060a01c6130b8576101c0526104e4358060a01c6130b8576101e052610504358060a01c6130b85761020052610524358060a01c6130b8576102205261048435610380525f6005905b806103a0526103a05180600403600481116130b85790506103c0526103c0518060011b818160011c186130b8579050600181018181106130b8579050600a81116130b85760051b604001516103e0526103e05161225457612fdb565b6103c0518060011b818160011c186130b8579050600a81116130b85760051b60400151610400526103c051600181018181106130b85790508060011b818160011c186130b8579050600a81116130b85760051b60400151610420526103c051600481116130b85760051b6101a00151610440526103c051600481116130b85760051b6102400151610460526103c051600481116130b85760051b6102e001516104805260a06103c051600481116130b857026101640180356104a05260208101356104c05260408101356104e05260608101356105005260808101356105205250610520516105405260016104e051186125a5576001610500511861245757610460516123d55760206130ea5f395f5163158819d46105605261044051610580526104a05180607f1c6130b8576105a0526104c05180607f1c6130b8576105c052610380516105e0526105405161060052602061056060a461057c845afa6123be573d5f5f3e3d5ffd5b60203d106130b85761056090505161038052612fdb565b60206130ea5f395f5163571f00b56105605261044051610580526104a05180607f1c6130b8576105a0526104c05180607f1c6130b8576105c052610380516105e05261054051610600526104605161062052602061056060c461057c845afa612440573d5f5f3e3d5ffd5b60203d106130b85761056090505161038052612fdb565b600a61050051186124c757610440516367df02ca610560526104a05180607f1c6130b857610580526104c05180607f1c6130b8576105a052610380516105c0526020610560606461057c845afa6124b0573d5f5f3e3d5ffd5b60203d106130b85761056090505161038052612fdb565b61050051600281186124da5760016124e0565b60038118155b905061253b57610440516337ed3a7a610560526104a051610580526104c0516105a052610380516105c0526020610560606461057c845afa612524573d5f5f3e3d5ffd5b60203d106130b85761056090505161038052612fdb565b602061310a5f395f5163ca4bc71461058052610440516105a0526104a0516105c0526104c0516105e05261038051610600526105405161062052602061058060a461059c845afa61258e573d5f5f3e3d5ffd5b60203d106130b85761058090505161038052612fdb565b6104e051600281186125b85760016125be565b60038118155b9050612d18576104e051600481186125d75760016125dd565b60058118155b9050612c57576104e051600681186125f65760016125fc565b60078118155b90506127355760086104e051186126cc5760206130ca5f395f516104005118612626576001612636565b60206130ca5f395f516104205118155b612fdb576024610560527f5377617020747970652038206973206f6e6c7920666f7220455448203c2d3e20610580527f57455448000000000000000000000000000000000000000000000000000000006105a05261056050610560518061058001601f825f031636823750506308c379a061052052602061054052601f19601f61056051011660440161053cfd612fdb56612fdb565b600d610560527f42616420737761702074797065000000000000000000000000000000000000006105805261056050610560518061058001601f825f031636823750506308c379a061052052602061054052601f19601f61056051011660440161053cfd612fdb565b600161050051186127d7576101403661058037610380516104c051600981116130b85760051b610580015260206130ea5f395f516379ccdf496106c0526103e0516106e052610400516107005261014061072061014061058060045afa5061054051610860525f6108805260016108a05260206106c06101e46106dc845afa6127c0573d5f5f3e3d5ffd5b60203d106130b8576106c090505161038052612fdb565b600a61050051186128a757610100366105a037600861058052610380516104c051610580518110156130b85760051b6105a001526103e051633db06dd86106a0526040806106c052806106c0015f610580518083528060051b5f82600881116130b857801561286057905b8060051b6105a001518160051b602088010152600101818118612842575b505082016020019150509050810190505f6106e0525060206106a06101646106bc845afa612890573d5f5f3e3d5ffd5b60203d106130b8576106a090505161038052612fdb565b6002610540511861297b5760403661058037610380516104c051600181116130b85760051b610580015260026105005118612929576103e051638d8ea7276105c052610580516105e0526105a0516106005260206105c060446105dc845afa612912573d5f5f3e3d5ffd5b60203d106130b8576105c090505161038052612fdb565b6103e05163ed8e84f36105c052610580516105e0526105a051610600525f6106205260206105c060646105dc845afa612964573d5f5f3e3d5ffd5b60203d106130b8576105c090505161038052612fdb565b60036105405118612a5f5760603661058037610380516104c051600281116130b85760051b610580015260026105005118612a05576103e051635b6f1b5a6105e05261058051610600526105a051610620526105c0516106405260206105e060646105fc845afa6129ee573d5f5f3e3d5ffd5b60203d106130b8576105e090505161038052612fdb565b6103e051633883e1196105e05261058051610600526105a051610620526105c051610640525f6106605260206105e060846105fc845afa612a48573d5f5f3e3d5ffd5b60203d106130b8576105e090505161038052612fdb565b60046105405118612b535760803661058037610380516104c051600381116130b85760051b610580015260026105005118612af1576103e051631a8051856106005261058051610620526105a051610640526105c051610660526105e051610680526020610600608461061c845afa612ada573d5f5f3e3d5ffd5b60203d106130b85761060090505161038052612fdb565b6103e05163cf701ff76106005261058051610620526105a051610640526105c051610660526105e051610680525f6106a052602061060060a461061c845afa612b3c573d5f5f3e3d5ffd5b60203d106130b85761060090505161038052612fdb565b60056105405118612fdb5760a03661058037610380516104c051600481116130b85760051b610580015260026105005118612bed576103e05163093796906106205261058051610640526105a051610660526105c051610680526105e0516106a052610600516106c052602061062060a461063c845afa612bd6573d5f5f3e3d5ffd5b60203d106130b85761062090505161038052612fdb565b6103e051637ede89c56106205261058051610640526105a051610660526105c051610680526105e0516106a052610600516106c0525f6106e052602061062060c461063c845afa612c40573d5f5f3e3d5ffd5b60203d106130b85761062090505161038052612fdb565b6105005160018118612c6a576001612c70565b600a8118155b9050612cc3576103e051634fb08c5e61058052610380516105a0526104a0516105c0526020610580604461059c845afa612cac573d5f5f3e3d5ffd5b60203d106130b85761058090505161038052612fdb565b6103e05163cc2b27d76105a052610380516105c0526104a05180607f1c6130b8576105e05260206105a060446105bc845afa612d01573d5f5f3e3d5ffd5b60203d106130b8576105a090505161038052612fdb565b60016105005118612e2f5761046051612da55760206130ea5f395f51638fd3218f61058052610440516105a0526104a05180607f1c6130b8576105c0526104c05180607f1c6130b8576105e05261038051610600526105405161062052602061058060a461059c845afa612d8e573d5f5f3e3d5ffd5b60203d106130b85761058090505161038052612fdb565b60206130ea5f395f51634933a86461058052610440516105a0526104a05180607f1c6130b8576105c0526104c05180607f1c6130b8576105e0526103805161060052610540516106205261046051610640526104805161066052602061058060e461059c845afa612e18573d5f5f3e3d5ffd5b60203d106130b85761058090505161038052612fdb565b600a6105005118612f65576104a05180607f1c6130b857610580526104c05180607f1c6130b8576105a0526001610580511215612e6c575f612e75565b60016105a05112155b612ece5761044051630e71d1b96105c052610580516105e0526105a05161060052610380516106205260206105c060646105dc845afa612eb7573d5f5f3e3d5ffd5b60203d106130b8576105c090505161038052612fdb565b60206130ea5f395f5163158819d46105c052610460516105e052610580516001810380600f0b81186130b8579050610600526105a0516001810380600f0b81186130b857905061062052610380516106405261054051600181038181116130b85790506106605260206105c060a46105dc845afa612f4e573d5f5f3e3d5ffd5b60203d106130b8576105c090505161038052612fdb565b602061310a5f395f51638ca1565361058052610440516105a0526104a0516105c0526104c0516105e0526103805161060052610540516106205261046051610640526104805161066052602061058060e461059c845afa612fc8573d5f5f3e3d5ffd5b60203d106130b857610580905051610380525b6001018181186121f85750506020610380f36130b6565b6381889a2c81186130b6576104a4361034176130b85760a0366101a037610196566130b6565b63c07b5353811861303b57610544361034176130b85761014036610240376120f9565b6381fc0ca581186130b6576105e4361034176130b857610544358060a01c6130b85761024052610564358060a01c6130b85761026052610584358060a01c6130b857610280526105a4358060a01c6130b8576102a0526105c4358060a01c6130b8576102c05260a0366102e0376120f9566130b6566130b6565b5b005b5f80fd30b530b501090da12ff20018301800000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1000000000000000000000000ca8d0747b5573d69653c3ac22242e6341c36e4b4000000000000000000000000a72c85c258a81761433b4e8da60505fe3dd551cc

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

00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1000000000000000000000000ca8d0747b5573d69653c3ac22242e6341c36e4b4000000000000000000000000a72c85c258a81761433b4e8da60505fe3dd551cc

-----Decoded View---------------
Arg [0] : _weth (address): 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1
Arg [1] : _stable_calc (address): 0xCA8d0747B5573D69653C3aC22242e6341C36e4b4
Arg [2] : _crypto_calc (address): 0xA72C85C258A81761433B4e8da60505Fe3Dd551CC

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1
Arg [1] : 000000000000000000000000ca8d0747b5573d69653c3ac22242e6341c36e4b4
Arg [2] : 000000000000000000000000a72c85c258a81761433b4e8da60505fe3dd551cc


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
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  ]
[ 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.