frxETH Price: $3,997.96 (-0.06%)

Contract

0x4f37A9d177470499A2dD084621020b023fcffc1F
Transaction Hash
Method
Block
From
To
Exchange72107362024-07-17 16:03:03143 days ago1721232183IN
0x4f37A9d1...23fcffc1F
0 frxETH0.000000240.00100025
Exchange72102372024-07-17 15:46:25143 days ago1721231185IN
0x4f37A9d1...23fcffc1F
0 frxETH0.000000220.00100025
Exchange72052242024-07-17 12:59:19143 days ago1721221159IN
0x4f37A9d1...23fcffc1F
0 frxETH0.000000370.00100025
Exchange71164422024-07-15 11:39:55145 days ago1721043595IN
0x4f37A9d1...23fcffc1F
0 frxETH0.000000440.00100025
Exchange70739082024-07-14 12:02:07146 days ago1720958527IN
0x4f37A9d1...23fcffc1F
0 frxETH0.000000250.0012
Exchange69451382024-07-11 12:29:47149 days ago1720700987IN
0x4f37A9d1...23fcffc1F
0 frxETH0.000000180.00100025
Exchange69451082024-07-11 12:28:47149 days ago1720700927IN
0x4f37A9d1...23fcffc1F
0 frxETH0.000000180.00100025
Exchange69450442024-07-11 12:26:39149 days ago1720700799IN
0x4f37A9d1...23fcffc1F
0 frxETH0.000000180.00100025
Exchange68705002024-07-09 19:01:51151 days ago1720551711IN
0x4f37A9d1...23fcffc1F
0 frxETH0.000000190.00100025
Exchange68625272024-07-09 14:36:05151 days ago1720535765IN
0x4f37A9d1...23fcffc1F
0 frxETH0.000000190.00100025
Exchange68624812024-07-09 14:34:33151 days ago1720535673IN
0x4f37A9d1...23fcffc1F
0 frxETH0.000000230.00100025
Exchange68624692024-07-09 14:34:09151 days ago1720535649IN
0x4f37A9d1...23fcffc1F
0 frxETH0.000000230.00100025
Exchange68566642024-07-09 11:20:39151 days ago1720524039IN
0x4f37A9d1...23fcffc1F
0 frxETH0.000000250.0013
Exchange68566162024-07-09 11:19:03151 days ago1720523943IN
0x4f37A9d1...23fcffc1F
0 frxETH0.000000460.0012
Exchange68561462024-07-09 11:03:23151 days ago1720523003IN
0x4f37A9d1...23fcffc1F
0 frxETH0.00000030.0012
Exchange68551802024-07-09 10:31:11151 days ago1720521071IN
0x4f37A9d1...23fcffc1F
0 frxETH0.000000290.0014
Exchange68536012024-07-09 9:38:33151 days ago1720517913IN
0x4f37A9d1...23fcffc1F
0 frxETH0.000000280.0012
Exchange68533092024-07-09 9:28:49151 days ago1720517329IN
0x4f37A9d1...23fcffc1F
0 frxETH0.000000820.0016
Exchange68532352024-07-09 9:26:21151 days ago1720517181IN
0x4f37A9d1...23fcffc1F
0 frxETH0.000000570.0015
Exchange68532042024-07-09 9:25:19151 days ago1720517119IN
0x4f37A9d1...23fcffc1F
0 frxETH0.000000710.0019
Exchange68531382024-07-09 9:23:07151 days ago1720516987IN
0x4f37A9d1...23fcffc1F
0 frxETH0.000000560.0015
Exchange68530872024-07-09 9:21:25151 days ago1720516885IN
0x4f37A9d1...23fcffc1F
0 frxETH0.00000080.0021
Exchange68530702024-07-09 9:20:51151 days ago1720516851IN
0x4f37A9d1...23fcffc1F
0 frxETH0.000000790.0021
Exchange68530492024-07-09 9:20:09151 days ago1720516809IN
0x4f37A9d1...23fcffc1F
0 frxETH0.000000710.002
Exchange68530252024-07-09 9:19:21151 days ago1720516761IN
0x4f37A9d1...23fcffc1F
0 frxETH0.000000430.0019
View all transactions

Parent Transaction Hash Block From To
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CurveRouterSidechain v1.0

Compiler Version
vyper:0.3.9

Optimization Enabled:
N/A

Other Settings:
None license

Contract Source Code (Vyper language format)

# @version 0.3.9

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

from vyper.interfaces import ERC20

interface StablePool:
    def exchange(i: int128, j: int128, dx: uint256, min_dy: uint256): payable
    def exchange_underlying(i: int128, j: int128, dx: uint256, min_dy: uint256): payable
    def get_dy(i: int128, j: int128, amount: uint256) -> uint256: view
    def get_dy_underlying(i: int128, j: int128, amount: uint256) -> uint256: view
    def coins(i: uint256) -> address: view
    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 exchange(i: uint256, j: uint256, dx: uint256, min_dy: uint256): payable
    def exchange_underlying(i: uint256, j: uint256, dx: uint256, min_dy: uint256): payable
    def get_dy(i: uint256, j: uint256, amount: uint256) -> uint256: view
    def get_dy_underlying(i: uint256, j: uint256, amount: uint256) -> uint256: view
    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 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 Llamma:
    def get_dx(i: uint256, j: uint256, out_amount: uint256) -> uint256: view

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,
    _expected: 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 - crypto, 3 - tricrypto, 4 - llamma
                        n_coins is the number of coins in pool
    @param _amount The amount of input token (`_route[0]`) to be sent.
    @param _expected 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(1, 6):
        # 5 rounds of iteration to perform up to 5 swaps
        swap: address = _route[i*2-1]
        pool: address = _pools[i-1] # Only for Polygon meta-factories underlying swap (swap_type == 6)
        output_token = _route[i*2]
        params: uint256[5] = _swap_params[i-1]  # i, j, swap_type, pool_type, n_coins

        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] == 1:  # stable
                StablePool(swap).exchange(convert(params[0], int128), convert(params[1], int128), amount, 0, value=eth_amount)
            else:  # crypto, tricrypto 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] == 1:  # stable
                StablePool(swap).exchange_underlying(convert(params[0], int128), convert(params[1], int128), amount, 0, value=eth_amount)
            else:  # crypto or tricrypto
                CryptoPool(swap).exchange_underlying(params[0], params[1], amount, 0, value=eth_amount)
        elif params[2] == 3:  # SWAP IS ZAP HERE !!!
            if params[3] == 1:  # stable
                LendingBasePoolMetaZap(swap).exchange_underlying(pool, convert(params[0], int128), convert(params[1], int128), amount, 0)
            else:  # crypto or tricrypto
                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[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] == 1:  # stable
                StablePool(swap).remove_liquidity_one_coin(amount, convert(params[1], int128), 0)
            else:  # crypto or tricrypto
                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 and that is bad
        assert amount != 0, "Received nothing"

        # check if this was the last swap
        if i == 5 or _route[i*2+1] == 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 >= _expected, "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 - crypto, 3 - tricrypto, 4 - llamma
                        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(1, 6):
        # 5 rounds of iteration to perform up to 5 swaps
        swap: address = _route[i*2-1]
        pool: address = _pools[i-1] # Only for Polygon meta-factories underlying swap (swap_type == 4)
        output_token = _route[i * 2]
        params: uint256[5] = _swap_params[i-1]  # i, j, swap_type, pool_type, n_coins

        # Calc output amount according to the swap type
        if params[2] == 1:
            if params[3] == 1:  # stable
                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] == 1:  # stable
                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] == 1:  # stable
                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)
            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:  # crypto
                        amount = CryptoPool2Coins(swap).calc_token_amount(amounts)
                    else:  # tricrypto
                        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:  # crypto
                        amount = CryptoPool3Coins(swap).calc_token_amount(amounts)
                    else:  # tricrypto
                        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:  # crypto
                        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:  # crypto
                        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] == 1:  # stable
                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 == 5 or _route[i*2+1] == 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`
    @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 - crypto, 3 - tricrypto, 4 - llamma
                        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(1, 6):
        # 5 rounds of iteration to perform up to 5 swaps
        i: uint256 = 6 - _i
        swap: address = _route[i*2-1]
        if swap == empty(address):
            continue
        input_token: address = _route[(i - 1) * 2]
        output_token: address = _route[i * 2]
        pool: address = _pools[i-1]
        base_pool: address = _base_pools[i-1]
        base_token: address = _base_tokens[i-1]
        params: uint256[5] = _swap_params[i-1]  # 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] in [2, 3]:  # crypto or tricrypto
                amount = CRYPTO_CALC.get_dx(pool, params[0], params[1], amount, n_coins)
            else:  # llamma
                amount = Llamma(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)
            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] == 1:  # stable
                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)
            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:  # crypto
                        amount = CryptoPool2Coins(swap).calc_token_amount(amounts)  # This is not correct
                    else:  # tricrypto
                        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:  # crypto
                        amount = CryptoPool3Coins(swap).calc_token_amount(amounts)  # This is not correct
                    else:  # tricrypto
                        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:  # crypto
                        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:  # crypto
                        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

[{"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":"_expected","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":"_expected","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":"_expected","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"}]}]

612bc851506020612c006000396000518060a01c612bfb576040526020612c206000396000518060a01c612bfb576060526020612c406000396000518060a01c612bfb5760805234612bfb57604051612b8852606051612ba852608051612bc852612b8861007261000039612be8610000f36003361161000c57612b74565b60003560e01c63371dc4478118610037576104c43610612b765760a0366101a037336102405261011a565b635c9c18e281186100a5576105643610612b76576104c4358060a01c612b76576101a0526104e4358060a01c612b76576101c052610504358060a01c612b76576101e052610524358060a01c612b765761020052610544358060a01c612b765761022052336102405261011a565b63c872a3c58118611114576105843610612b76576104c4358060a01c612b76576101a0526104e4358060a01c612b76576101c052610504358060a01c612b76576101e052610524358060a01c612b765761020052610544358060a01c612b765761022052610564358060a01c612b7657610240525b6004358060a01c612b76576040526024358060a01c612b76576060526044358060a01c612b76576080526064358060a01c612b765760a0526084358060a01c612b765760c05260a4358060a01c612b765760e05260c4358060a01c612b76576101005260e4358060a01c612b765761012052610104358060a01c612b765761014052610124358060a01c612b765761016052610144358060a01c612b765761018052600054600114612b7657600160005560405161026052600061028052610484356102a05273eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee610260511861020d576102a0513418612b765761028b565b34612b7657610260516323b872dd6102c052336102e05230610300526102a0516103205260206102c060646102dc6000855af161024f573d600060003e3d6000fd5b3d61026657803b15612b765760016103405261027f565b60203d10612b76576102c0518060011c612b7657610340525b61034090505115612b76575b600160058101905b806102c0526102c0518060011b818160011c18612b7657905060018103818111612b76579050600a8111612b765760051b604001516102e0526102c05160018103818111612b7657905060048111612b765760051b6101a00151610300526102c0518060011b818160011c18612b76579050600a8111612b765760051b604001516102805260a06102c05160018103818111612b7657905060048111612b7657026101640180356103205260208101356103405260408101356103605260608101356103805260808101356103a052506001610260516020526000526040600020806102e0516020526000526040600020905054610436576102605163095ea7b36103c0526102e0516103e0527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6104005260206103c060446103dc6000855af16103e3573d600060003e3d6000fd5b3d6103f357600161042052610404565b6103c0518060011c612b7657610420525b61042090505115612b765760016001610260516020526000526040600020806102e05160205260005260406000209050555b60006103c05273eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102605118610463576102a0516103c0525b600161036051186105da57600161038051186104e1576102e051633df021246103e0526103205180607f1c612b7657610400526103405180607f1c612b7657610420526102a05161044052600061046052803b15612b765760006103e060846103fc6103c051855af16104db573d600060003e3d6000fd5b50610d9e565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102605118610506576001610522565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102805118155b61057c576102e051635b41b9086103e052610320516104005261034051610420526102a05161044052600061046052803b15612b765760006103e060846103fc6000855af1610576573d600060003e3d6000fd5b50610d9e565b6102e05163394747c56103e052610320516104005261034051610420526102a05161044052600061046052600161048052803b15612b765760006103e060a46103fc6103c051855af16105d4573d600060003e3d6000fd5b50610d9e565b600261036051186106b05760016103805118610658576102e05163a6417ed66103e0526103205180607f1c612b7657610400526103405180607f1c612b7657610420526102a05161044052600061046052803b15612b765760006103e060846103fc6103c051855af1610652573d600060003e3d6000fd5b50610d9e565b6102e0516365b2489b6103e052610320516104005261034051610420526102a05161044052600061046052803b15612b765760006103e060846103fc6103c051855af16106aa573d600060003e3d6000fd5b50610d9e565b600361036051186107e15760016103805118610734576102e051637981c43e6103e05261030051610400526103205180607f1c612b7657610420526103405180607f1c612b7657610440526102a05161046052600061048052803b15612b765760006103e060a46103fc6000855af161072e573d600060003e3d6000fd5b50610d9e565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102605118610759576001610775565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102805118155b6103e0526102e051632bf78c61610400526103005161042052610320516104405261034051610460526102a0516104805260006104a0526103e0516104c052803b15612b7657600061040060c461041c6103c051855af16107db573d600060003e3d6000fd5b50610d9e565b60046103605118610a045760026103a05118610866576040366103e0376102a0516103205160018111612b765760051b6103e001526102e051630b4c7e4d610420526103e051610440526104005161046052600061048052803b15612b76576000610420606461043c6103c051855af1610860573d600060003e3d6000fd5b50610d9e565b60036103a051186108e8576060366103e0376102a0516103205160028111612b765760051b6103e001526102e051634515cef3610440526103e051610460526104005161048052610420516104a05260006104c052803b15612b76576000610440608461045c6103c051855af16108e2573d600060003e3d6000fd5b50610d9e565b60046103a05118610972576080366103e0376102a0516103205160038111612b765760051b6103e001526102e05163029b2f34610460526103e05161048052610400516104a052610420516104c052610440516104e052600061050052803b15612b7657600061046060a461047c6103c051855af161096c573d600060003e3d6000fd5b50610d9e565b60056103a05118610d9e5760a0366103e0376102a0516103205160048111612b765760051b6103e001526102e0516384738499610480526103e0516104a052610400516104c052610420516104e05261044051610500526104605161052052600061054052803b15612b7657600061048060c461049c6103c051855af16109fe573d600060003e3d6000fd5b50610d9e565b60056103605118610a8c576060366103e0376102a0516103205160028111612b765760051b6103e001526102e051632b6e993a610440526103e051610460526104005161048052610420516104a05260006104c05260016104e052803b15612b7657600061044060a461045c6103c051855af1610a86573d600060003e3d6000fd5b50610d9e565b60066103605118610b465760016103805118610af8576102e051631a4d01d26103e0526102a051610400526103405180607f1c612b765761042052600061044052803b15612b765760006103e060646103fc6000855af1610af2573d600060003e3d6000fd5b50610d9e565b6102e05163f1dc3cc96103e0526102a051610400526103405161042052600061044052803b15612b765760006103e060646103fc6000855af1610b40573d600060003e3d6000fd5b50610d9e565b60076103605118610bb2576102e05163517a55a36103e0526102a051610400526103405180607f1c612b76576104205260006104405260016104605260206103e060846103fc6000855af1610ba0573d600060003e3d6000fd5b60203d10612b76576103e05050610d9e565b60086103605118610d385773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102605118610bf1576020612b88600039600051610280511815610bf4565b60005b610cfe576020612b886000396000516102605118610c2c5773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee610280511815610c2f565b60005b610cbe5760246103e0527f5377617020747970652038206973206f6e6c7920666f7220455448203c2d3e20610400527f5745544800000000000000000000000000000000000000000000000000000000610420526103e0506103e0518061040001601f826000031636823750506308c379a06103a05260206103c052601f19601f6103e05101166044016103bcfd5b6102e051632e1a7d4d6103e0526102a05161040052803b15612b765760006103e060246103fc6000855af1610cf8573d600060003e3d6000fd5b50610d9e565b6102e05163d0e30db06103e052803b15612b765760006103e060046103fc6102a051855af1610d32573d600060003e3d6000fd5b50610d9e565b600d6103e0527f4261642073776170207479706500000000000000000000000000000000000000610400526103e0506103e0518061040001601f826000031636823750506308c379a06103a05260206103c052601f19601f6103e05101166044016103bcfd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102805118610dc657476102a052610e07565b610280516370a082316103e052306104005260206103e060246103fc845afa610df4573d600060003e3d6000fd5b60203d10612b76576103e09050516102a0525b6102a051610e755760106103e0527f5265636569766564206e6f7468696e6700000000000000000000000000000000610400526103e0506103e0518061040001601f826000031636823750506308c379a06103a05260206103c052601f19601f6103e05101166044016103bcfd5b60056102c05118610e87576001610eb9565b6102c0518060011b818160011c18612b7657905060018101818110612b76579050600a8111612b765760051b60400151155b15610ec357610ed6565b6102805161026052600101818118610293575b50506102a05160018103818111612b765790506102a0526104a4356102a0511015610f615760086102c0527f536c6970706167650000000000000000000000000000000000000000000000006102e0526102c0506102c051806102e001601f826000031636823750506308c379a06102805260206102a052601f19601f6102c051011660440161029cfd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102805118610fad5760006102c0526102c050600060006102c0516102e06102a051610240515af1611024573d600060003e3d6000fd5b6102805163a9059cbb6102c052610240516102e0526102a0516103005260206102c060446102dc6000855af1610fe8573d600060003e3d6000fd5b3d610fff57803b15612b7657600161032052611018565b60203d10612b76576102c0518060011c612b7657610320525b61032090505115612b76575b61024051337f56d0661e240dfb199ef196e16e6f42473990366314f0226ac978f7be3cd9ee836040516102c0526060516102e0526080516103005260a0516103205260c0516103405260e051610360526101005161038052610120516103a052610140516103c052610160516103e052610180516104005260a06101646104203760a06102046104c03760a06102a46105603760a06103446106003760a06103e46106a0376101a051610740526101c051610760526101e05161078052610200516107a052610220516107c052610484356107e0526102a051610800526105606102c0a360206102a06000600055f35b6381889a2c8118611134576104a43610612b765760a0366101a037611199565b63637653cb8118611d03576105443610612b76576104a4358060a01c612b76576101a0526104c4358060a01c612b76576101c0526104e4358060a01c612b76576101e052610504358060a01c612b765761020052610524358060a01c612b7657610220525b6004358060a01c612b76576040526024358060a01c612b76576060526044358060a01c612b76576080526064358060a01c612b765760a0526084358060a01c612b765760c05260a4358060a01c612b765760e05260c4358060a01c612b76576101005260e4358060a01c612b765761012052610104358060a01c612b765761014052610124358060a01c612b765761016052610144358060a01c612b76576101805234612b7657604051610240526000610260526104843561028052600160058101905b806102a0526102a0518060011b818160011c18612b7657905060018103818111612b76579050600a8111612b765760051b604001516102c0526102a05160018103818111612b7657905060048111612b765760051b6101a001516102e0526102a0518060011b818160011c18612b76579050600a8111612b765760051b604001516102605260a06102a05160018103818111612b7657905060048111612b76570261016401803561030052602081013561032052604081013561034052606081013561036052608081013561038052506001610340511861140357600161036051186113ab576102c051635e0d443f6103a0526103005180607f1c612b76576103c0526103205180607f1c612b76576103e052610280516104005260206103a060646103bc845afa611394573d600060003e3d6000fd5b60203d10612b76576103a090505161028052611c84565b6102c05163556d6e9f6103a052610300516103c052610320516103e052610280516104005260206103a060646103bc845afa6113ec573d600060003e3d6000fd5b60203d10612b76576103a090505161028052611c84565b600261034051186114d95760016103605118611481576102c0516307211ef76103a0526103005180607f1c612b76576103c0526103205180607f1c612b76576103e052610280516104005260206103a060646103bc845afa61146a573d600060003e3d6000fd5b60203d10612b76576103a090505161028052611c84565b6102c0516385f11d1e6103a052610300516103c052610320516103e052610280516104005260206103a060646103bc845afa6114c2573d600060003e3d6000fd5b60203d10612b76576103a090505161028052611c84565b600361034051186115b75760016103605118611557576102e0516307211ef76103a0526103005180607f1c612b76576103c0526103205180607f1c612b76576103e052610280516104005260206103a060646103bc845afa611540573d600060003e3d6000fd5b60203d10612b76576103a090505161028052611c84565b6102c05163e9737ee26103a0526102e0516103c052610300516103e0526103205161040052610280516104205260206103a060846103bc845afa6115a0573d600060003e3d6000fd5b60203d10612b76576103a090505161028052611c84565b61034051600481186115ca5760016115d0565b60058118155b90506117d55761034051600681186115e95760016115ef565b60078118155b905061172257600861034051186116bc576020612b88600039600051610240511861161b57600161162d565b6020612b886000396000516102605118155b611c845760246103a0527f5377617020747970652038206973206f6e6c7920666f7220455448203c2d3e206103c0527f57455448000000000000000000000000000000000000000000000000000000006103e0526103a0506103a051806103c001601f826000031636823750506308c379a061036052602061038052601f19601f6103a051011660440161037cfd5b600d6103a0527f42616420737761702074797065000000000000000000000000000000000000006103c0526103a0506103a051806103c001601f826000031636823750506308c379a061036052602061038052601f19601f6103a051011660440161037cfd5b60016103605118611785576102c05163cc2b27d76103c052610280516103e0526103205180607f1c612b76576104005260206103c060446103dc845afa61176e573d600060003e3d6000fd5b60203d10612b76576103c090505161028052611c84565b6102c051634fb08c5e6103c052610280516103e052610320516104005260206103c060446103dc845afa6117be573d600060003e3d6000fd5b60203d10612b76576103c090505161028052611c84565b600161036051186118bc57610140366103c037610280516103005160098111612b765760051b6103c001526020612ba86000396000516379ccdf49610500526102c0516105205261026051610540526103c051610560526103e05161058052610400516105a052610420516105c052610440516105e052610460516106005261048051610620526104a051610640526104c051610660526104e05161068052610380516106a05260016106c05260016106e05260206105006101e461051c845afa6118a5573d600060003e3d6000fd5b60203d10612b765761050090505161028052611c84565b60026103805118611997576040366103c037610280516103005160018111612b765760051b6103c0015260026103605118611941576102c051638d8ea727610400526103c051610420526103e051610440526020610400604461041c845afa61192a573d600060003e3d6000fd5b60203d10612b765761040090505161028052611c84565b6102c05163ed8e84f3610400526103c051610420526103e051610440526001610460526020610400606461041c845afa611980573d600060003e3d6000fd5b60203d10612b765761040090505161028052611c84565b60036103805118611a82576060366103c037610280516103005160028111612b765760051b6103c0015260026103605118611a24576102c051635b6f1b5a610420526103c051610440526103e0516104605261040051610480526020610420606461043c845afa611a0d573d600060003e3d6000fd5b60203d10612b765761042090505161028052611c84565b6102c051633883e119610420526103c051610440526103e05161046052610400516104805260016104a0526020610420608461043c845afa611a6b573d600060003e3d6000fd5b60203d10612b765761042090505161028052611c84565b60046103805118611b7d576080366103c037610280516103005160038111612b765760051b6103c0015260026103605118611b17576102c051631a805185610440526103c051610460526103e05161048052610400516104a052610420516104c0526020610440608461045c845afa611b00573d600060003e3d6000fd5b60203d10612b765761044090505161028052611c84565b6102c05163cf701ff7610440526103c051610460526103e05161048052610400516104a052610420516104c05260016104e052602061044060a461045c845afa611b66573d600060003e3d6000fd5b60203d10612b765761044090505161028052611c84565b60056103805118611c845760a0366103c037610280516103005160048111612b765760051b6103c0015260026103605118611c1a576102c0516309379690610460526103c051610480526103e0516104a052610400516104c052610420516104e0526104405161050052602061046060a461047c845afa611c03573d600060003e3d6000fd5b60203d10612b765761046090505161028052611c84565b6102c051637ede89c5610460526103c051610480526103e0516104a052610400516104c052610420516104e0526104405161050052600161052052602061046060c461047c845afa611c71573d600060003e3d6000fd5b60203d10612b7657610460905051610280525b60056102a05118611c96576001611cc8565b6102a0518060011b818160011c18612b7657905060018101818110612b76579050600a8111612b765760051b60400151155b15611cd257611ce5565b610260516102405260010181811861125d575b50506102805160018103818111612b765790506102a05260206102a0f35b63c07b53538118611d24576105443610612b76576101403661024037611e49565b6381fc0ca58118611d94576105e43610612b7657610544358060a01c612b765761024052610564358060a01c612b765761026052610584358060a01c612b7657610280526105a4358060a01c612b76576102a0526105c4358060a01c612b76576102c05260a0366102e037611e49565b6390e7e2058118612b72576106843610612b7657610544358060a01c612b765761024052610564358060a01c612b765761026052610584358060a01c612b7657610280526105a4358060a01c612b76576102a0526105c4358060a01c612b76576102c0526105e4358060a01c612b76576102e052610604358060a01c612b765761030052610624358060a01c612b765761032052610644358060a01c612b765761034052610664358060a01c612b7657610360525b6004358060a01c612b76576040526024358060a01c612b76576060526044358060a01c612b76576080526064358060a01c612b765760a0526084358060a01c612b765760c05260a4358060a01c612b765760e05260c4358060a01c612b76576101005260e4358060a01c612b765761012052610104358060a01c612b765761014052610124358060a01c612b765761016052610144358060a01c612b7657610180526104a4358060a01c612b76576101a0526104c4358060a01c612b76576101c0526104e4358060a01c612b76576101e052610504358060a01c612b765761020052610524358060a01c612b76576102205234612b76576104843561038052600160058101905b806103a0526103a0518060060360068111612b765790506103c0526103c0518060011b818160011c18612b7657905060018103818111612b76579050600a8111612b765760051b604001516103e0526103e051611fac57612b5f565b6103c05160018103818111612b765790508060011b818160011c18612b76579050600a8111612b765760051b60400151610400526103c0518060011b818160011c18612b76579050600a8111612b765760051b60400151610420526103c05160018103818111612b7657905060048111612b765760051b6101a00151610440526103c05160018103818111612b7657905060048111612b765760051b6102400151610460526103c05160018103818111612b7657905060048111612b765760051b6102e001516104805260a06103c05160018103818111612b7657905060048111612b7657026101640180356104a05260208101356104c05260408101356104e05260608101356105005260808101356105205250610520516105405260016104e051186122d357600161050051186121ed5761046051612166576020612ba860003960005163158819d46105605261044051610580526104a05180607f1c612b76576105a0526104c05180607f1c612b76576105c052610380516105e0526105405161060052602061056060a461057c845afa61214f573d600060003e3d6000fd5b60203d10612b765761056090505161038052612b5f565b6020612ba860003960005163571f00b56105605261044051610580526104a05180607f1c612b76576105a0526104c05180607f1c612b76576105c052610380516105e05261054051610600526104605161062052602061056060c461057c845afa6121d6573d600060003e3d6000fd5b60203d10612b765761056090505161038052612b5f565b6105005160028118612200576001612206565b60038118155b905061226457610440516337ed3a7a610560526104a051610580526104c0516105a052610380516105c0526020610560606461057c845afa61224d573d600060003e3d6000fd5b60203d10612b765761056090505161038052612b5f565b6020612bc860003960005163ca4bc71461058052610440516105a0526104a0516105c0526104c0516105e05261038051610600526105405161062052602061058060a461059c845afa6122bc573d600060003e3d6000fd5b60203d10612b765761058090505161038052612b5f565b6104e051600281186122e65760016122ec565b60038118155b90506129c3576104e0516004811861230557600161230b565b60058118155b9050612910576104e0516006811861232457600161232a565b60078118155b905061245d5760086104e051186123f7576020612b886000396000516104005118612356576001612368565b6020612b886000396000516104205118155b612b5f576024610560527f5377617020747970652038206973206f6e6c7920666f7220455448203c2d3e20610580527f57455448000000000000000000000000000000000000000000000000000000006105a05261056050610560518061058001601f826000031636823750506308c379a061052052602061054052601f19601f61056051011660440161053cfd5b600d610560527f42616420737761702074797065000000000000000000000000000000000000006105805261056050610560518061058001601f826000031636823750506308c379a061052052602061054052601f19601f61056051011660440161053cfd5b60016105005118612544576101403661058037610380516104c05160098111612b765760051b61058001526020612ba86000396000516379ccdf496106c0526103e0516106e052610400516107005261058051610720526105a051610740526105c051610760526105e05161078052610600516107a052610620516107c052610640516107e052610660516108005261068051610820526106a05161084052610540516108605260006108805260016108a05260206106c06101e46106dc845afa61252d573d600060003e3d6000fd5b60203d10612b76576106c090505161038052612b5f565b6002610540511861261f5760403661058037610380516104c05160018111612b765760051b6105800152600261050051186125c9576103e051638d8ea7276105c052610580516105e0526105a0516106005260206105c060446105dc845afa6125b2573d600060003e3d6000fd5b60203d10612b76576105c090505161038052612b5f565b6103e05163ed8e84f36105c052610580516105e0526105a0516106005260006106205260206105c060646105dc845afa612608573d600060003e3d6000fd5b60203d10612b76576105c090505161038052612b5f565b6003610540511861270a5760603661058037610380516104c05160028111612b765760051b6105800152600261050051186126ac576103e051635b6f1b5a6105e05261058051610600526105a051610620526105c0516106405260206105e060646105fc845afa612695573d600060003e3d6000fd5b60203d10612b76576105e090505161038052612b5f565b6103e051633883e1196105e05261058051610600526105a051610620526105c0516106405260006106605260206105e060846105fc845afa6126f3573d600060003e3d6000fd5b60203d10612b76576105e090505161038052612b5f565b600461054051186128055760803661058037610380516104c05160038111612b765760051b61058001526002610500511861279f576103e051631a8051856106005261058051610620526105a051610640526105c051610660526105e051610680526020610600608461061c845afa612788573d600060003e3d6000fd5b60203d10612b765761060090505161038052612b5f565b6103e05163cf701ff76106005261058051610620526105a051610640526105c051610660526105e0516106805260006106a052602061060060a461061c845afa6127ee573d600060003e3d6000fd5b60203d10612b765761060090505161038052612b5f565b60056105405118612b5f5760a03661058037610380516104c05160048111612b765760051b6105800152600261050051186128a2576103e05163093796906106205261058051610640526105a051610660526105c051610680526105e0516106a052610600516106c052602061062060a461063c845afa61288b573d600060003e3d6000fd5b60203d10612b765761062090505161038052612b5f565b6103e051637ede89c56106205261058051610640526105a051610660526105c051610680526105e0516106a052610600516106c05260006106e052602061062060c461063c845afa6128f9573d600060003e3d6000fd5b60203d10612b765761062090505161038052612b5f565b60016105005118612973576103e05163cc2b27d761058052610380516105a0526104a05180607f1c612b76576105c0526020610580604461059c845afa61295c573d600060003e3d6000fd5b60203d10612b765761058090505161038052612b5f565b6103e051634fb08c5e61058052610380516105a0526104a0516105c0526020610580604461059c845afa6129ac573d600060003e3d6000fd5b60203d10612b765761058090505161038052612b5f565b60016105005118612ae45761046051612a55576020612ba8600039600051638fd3218f61058052610440516105a0526104a05180607f1c612b76576105c0526104c05180607f1c612b76576105e05261038051610600526105405161062052602061058060a461059c845afa612a3e573d600060003e3d6000fd5b60203d10612b765761058090505161038052612b5f565b6020612ba8600039600051634933a86461058052610440516105a0526104a05180607f1c612b76576105c0526104c05180607f1c612b76576105e0526103805161060052610540516106205261046051610640526104805161066052602061058060e461059c845afa612acd573d600060003e3d6000fd5b60203d10612b765761058090505161038052612b5f565b6020612bc8600039600051638ca1565361058052610440516105a0526104a0516105c0526104c0516105e0526103805161060052610540516106205261046051610640526104805161066052602061058060e461059c845afa612b4c573d600060003e3d6000fd5b60203d10612b7657610580905051610380525b600101818118611f505750506020610380f35b505b005b600080fda165767970657283000309000b005b600080fd000000000000000000000000fc00000000000000000000000000000000000006000000000000000000000000ca8d0747b5573d69653c3ac22242e6341c36e4b400000000000000000000000069522fb5337663d3b4dfb0030b881c1a750adb4f

Deployed Bytecode

0x6003361161000c57612b74565b60003560e01c63371dc4478118610037576104c43610612b765760a0366101a037336102405261011a565b635c9c18e281186100a5576105643610612b76576104c4358060a01c612b76576101a0526104e4358060a01c612b76576101c052610504358060a01c612b76576101e052610524358060a01c612b765761020052610544358060a01c612b765761022052336102405261011a565b63c872a3c58118611114576105843610612b76576104c4358060a01c612b76576101a0526104e4358060a01c612b76576101c052610504358060a01c612b76576101e052610524358060a01c612b765761020052610544358060a01c612b765761022052610564358060a01c612b7657610240525b6004358060a01c612b76576040526024358060a01c612b76576060526044358060a01c612b76576080526064358060a01c612b765760a0526084358060a01c612b765760c05260a4358060a01c612b765760e05260c4358060a01c612b76576101005260e4358060a01c612b765761012052610104358060a01c612b765761014052610124358060a01c612b765761016052610144358060a01c612b765761018052600054600114612b7657600160005560405161026052600061028052610484356102a05273eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee610260511861020d576102a0513418612b765761028b565b34612b7657610260516323b872dd6102c052336102e05230610300526102a0516103205260206102c060646102dc6000855af161024f573d600060003e3d6000fd5b3d61026657803b15612b765760016103405261027f565b60203d10612b76576102c0518060011c612b7657610340525b61034090505115612b76575b600160058101905b806102c0526102c0518060011b818160011c18612b7657905060018103818111612b76579050600a8111612b765760051b604001516102e0526102c05160018103818111612b7657905060048111612b765760051b6101a00151610300526102c0518060011b818160011c18612b76579050600a8111612b765760051b604001516102805260a06102c05160018103818111612b7657905060048111612b7657026101640180356103205260208101356103405260408101356103605260608101356103805260808101356103a052506001610260516020526000526040600020806102e0516020526000526040600020905054610436576102605163095ea7b36103c0526102e0516103e0527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6104005260206103c060446103dc6000855af16103e3573d600060003e3d6000fd5b3d6103f357600161042052610404565b6103c0518060011c612b7657610420525b61042090505115612b765760016001610260516020526000526040600020806102e05160205260005260406000209050555b60006103c05273eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102605118610463576102a0516103c0525b600161036051186105da57600161038051186104e1576102e051633df021246103e0526103205180607f1c612b7657610400526103405180607f1c612b7657610420526102a05161044052600061046052803b15612b765760006103e060846103fc6103c051855af16104db573d600060003e3d6000fd5b50610d9e565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102605118610506576001610522565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102805118155b61057c576102e051635b41b9086103e052610320516104005261034051610420526102a05161044052600061046052803b15612b765760006103e060846103fc6000855af1610576573d600060003e3d6000fd5b50610d9e565b6102e05163394747c56103e052610320516104005261034051610420526102a05161044052600061046052600161048052803b15612b765760006103e060a46103fc6103c051855af16105d4573d600060003e3d6000fd5b50610d9e565b600261036051186106b05760016103805118610658576102e05163a6417ed66103e0526103205180607f1c612b7657610400526103405180607f1c612b7657610420526102a05161044052600061046052803b15612b765760006103e060846103fc6103c051855af1610652573d600060003e3d6000fd5b50610d9e565b6102e0516365b2489b6103e052610320516104005261034051610420526102a05161044052600061046052803b15612b765760006103e060846103fc6103c051855af16106aa573d600060003e3d6000fd5b50610d9e565b600361036051186107e15760016103805118610734576102e051637981c43e6103e05261030051610400526103205180607f1c612b7657610420526103405180607f1c612b7657610440526102a05161046052600061048052803b15612b765760006103e060a46103fc6000855af161072e573d600060003e3d6000fd5b50610d9e565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102605118610759576001610775565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102805118155b6103e0526102e051632bf78c61610400526103005161042052610320516104405261034051610460526102a0516104805260006104a0526103e0516104c052803b15612b7657600061040060c461041c6103c051855af16107db573d600060003e3d6000fd5b50610d9e565b60046103605118610a045760026103a05118610866576040366103e0376102a0516103205160018111612b765760051b6103e001526102e051630b4c7e4d610420526103e051610440526104005161046052600061048052803b15612b76576000610420606461043c6103c051855af1610860573d600060003e3d6000fd5b50610d9e565b60036103a051186108e8576060366103e0376102a0516103205160028111612b765760051b6103e001526102e051634515cef3610440526103e051610460526104005161048052610420516104a05260006104c052803b15612b76576000610440608461045c6103c051855af16108e2573d600060003e3d6000fd5b50610d9e565b60046103a05118610972576080366103e0376102a0516103205160038111612b765760051b6103e001526102e05163029b2f34610460526103e05161048052610400516104a052610420516104c052610440516104e052600061050052803b15612b7657600061046060a461047c6103c051855af161096c573d600060003e3d6000fd5b50610d9e565b60056103a05118610d9e5760a0366103e0376102a0516103205160048111612b765760051b6103e001526102e0516384738499610480526103e0516104a052610400516104c052610420516104e05261044051610500526104605161052052600061054052803b15612b7657600061048060c461049c6103c051855af16109fe573d600060003e3d6000fd5b50610d9e565b60056103605118610a8c576060366103e0376102a0516103205160028111612b765760051b6103e001526102e051632b6e993a610440526103e051610460526104005161048052610420516104a05260006104c05260016104e052803b15612b7657600061044060a461045c6103c051855af1610a86573d600060003e3d6000fd5b50610d9e565b60066103605118610b465760016103805118610af8576102e051631a4d01d26103e0526102a051610400526103405180607f1c612b765761042052600061044052803b15612b765760006103e060646103fc6000855af1610af2573d600060003e3d6000fd5b50610d9e565b6102e05163f1dc3cc96103e0526102a051610400526103405161042052600061044052803b15612b765760006103e060646103fc6000855af1610b40573d600060003e3d6000fd5b50610d9e565b60076103605118610bb2576102e05163517a55a36103e0526102a051610400526103405180607f1c612b76576104205260006104405260016104605260206103e060846103fc6000855af1610ba0573d600060003e3d6000fd5b60203d10612b76576103e05050610d9e565b60086103605118610d385773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102605118610bf1576020612b88600039600051610280511815610bf4565b60005b610cfe576020612b886000396000516102605118610c2c5773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee610280511815610c2f565b60005b610cbe5760246103e0527f5377617020747970652038206973206f6e6c7920666f7220455448203c2d3e20610400527f5745544800000000000000000000000000000000000000000000000000000000610420526103e0506103e0518061040001601f826000031636823750506308c379a06103a05260206103c052601f19601f6103e05101166044016103bcfd5b6102e051632e1a7d4d6103e0526102a05161040052803b15612b765760006103e060246103fc6000855af1610cf8573d600060003e3d6000fd5b50610d9e565b6102e05163d0e30db06103e052803b15612b765760006103e060046103fc6102a051855af1610d32573d600060003e3d6000fd5b50610d9e565b600d6103e0527f4261642073776170207479706500000000000000000000000000000000000000610400526103e0506103e0518061040001601f826000031636823750506308c379a06103a05260206103c052601f19601f6103e05101166044016103bcfd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102805118610dc657476102a052610e07565b610280516370a082316103e052306104005260206103e060246103fc845afa610df4573d600060003e3d6000fd5b60203d10612b76576103e09050516102a0525b6102a051610e755760106103e0527f5265636569766564206e6f7468696e6700000000000000000000000000000000610400526103e0506103e0518061040001601f826000031636823750506308c379a06103a05260206103c052601f19601f6103e05101166044016103bcfd5b60056102c05118610e87576001610eb9565b6102c0518060011b818160011c18612b7657905060018101818110612b76579050600a8111612b765760051b60400151155b15610ec357610ed6565b6102805161026052600101818118610293575b50506102a05160018103818111612b765790506102a0526104a4356102a0511015610f615760086102c0527f536c6970706167650000000000000000000000000000000000000000000000006102e0526102c0506102c051806102e001601f826000031636823750506308c379a06102805260206102a052601f19601f6102c051011660440161029cfd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102805118610fad5760006102c0526102c050600060006102c0516102e06102a051610240515af1611024573d600060003e3d6000fd5b6102805163a9059cbb6102c052610240516102e0526102a0516103005260206102c060446102dc6000855af1610fe8573d600060003e3d6000fd5b3d610fff57803b15612b7657600161032052611018565b60203d10612b76576102c0518060011c612b7657610320525b61032090505115612b76575b61024051337f56d0661e240dfb199ef196e16e6f42473990366314f0226ac978f7be3cd9ee836040516102c0526060516102e0526080516103005260a0516103205260c0516103405260e051610360526101005161038052610120516103a052610140516103c052610160516103e052610180516104005260a06101646104203760a06102046104c03760a06102a46105603760a06103446106003760a06103e46106a0376101a051610740526101c051610760526101e05161078052610200516107a052610220516107c052610484356107e0526102a051610800526105606102c0a360206102a06000600055f35b6381889a2c8118611134576104a43610612b765760a0366101a037611199565b63637653cb8118611d03576105443610612b76576104a4358060a01c612b76576101a0526104c4358060a01c612b76576101c0526104e4358060a01c612b76576101e052610504358060a01c612b765761020052610524358060a01c612b7657610220525b6004358060a01c612b76576040526024358060a01c612b76576060526044358060a01c612b76576080526064358060a01c612b765760a0526084358060a01c612b765760c05260a4358060a01c612b765760e05260c4358060a01c612b76576101005260e4358060a01c612b765761012052610104358060a01c612b765761014052610124358060a01c612b765761016052610144358060a01c612b76576101805234612b7657604051610240526000610260526104843561028052600160058101905b806102a0526102a0518060011b818160011c18612b7657905060018103818111612b76579050600a8111612b765760051b604001516102c0526102a05160018103818111612b7657905060048111612b765760051b6101a001516102e0526102a0518060011b818160011c18612b76579050600a8111612b765760051b604001516102605260a06102a05160018103818111612b7657905060048111612b76570261016401803561030052602081013561032052604081013561034052606081013561036052608081013561038052506001610340511861140357600161036051186113ab576102c051635e0d443f6103a0526103005180607f1c612b76576103c0526103205180607f1c612b76576103e052610280516104005260206103a060646103bc845afa611394573d600060003e3d6000fd5b60203d10612b76576103a090505161028052611c84565b6102c05163556d6e9f6103a052610300516103c052610320516103e052610280516104005260206103a060646103bc845afa6113ec573d600060003e3d6000fd5b60203d10612b76576103a090505161028052611c84565b600261034051186114d95760016103605118611481576102c0516307211ef76103a0526103005180607f1c612b76576103c0526103205180607f1c612b76576103e052610280516104005260206103a060646103bc845afa61146a573d600060003e3d6000fd5b60203d10612b76576103a090505161028052611c84565b6102c0516385f11d1e6103a052610300516103c052610320516103e052610280516104005260206103a060646103bc845afa6114c2573d600060003e3d6000fd5b60203d10612b76576103a090505161028052611c84565b600361034051186115b75760016103605118611557576102e0516307211ef76103a0526103005180607f1c612b76576103c0526103205180607f1c612b76576103e052610280516104005260206103a060646103bc845afa611540573d600060003e3d6000fd5b60203d10612b76576103a090505161028052611c84565b6102c05163e9737ee26103a0526102e0516103c052610300516103e0526103205161040052610280516104205260206103a060846103bc845afa6115a0573d600060003e3d6000fd5b60203d10612b76576103a090505161028052611c84565b61034051600481186115ca5760016115d0565b60058118155b90506117d55761034051600681186115e95760016115ef565b60078118155b905061172257600861034051186116bc576020612b88600039600051610240511861161b57600161162d565b6020612b886000396000516102605118155b611c845760246103a0527f5377617020747970652038206973206f6e6c7920666f7220455448203c2d3e206103c0527f57455448000000000000000000000000000000000000000000000000000000006103e0526103a0506103a051806103c001601f826000031636823750506308c379a061036052602061038052601f19601f6103a051011660440161037cfd5b600d6103a0527f42616420737761702074797065000000000000000000000000000000000000006103c0526103a0506103a051806103c001601f826000031636823750506308c379a061036052602061038052601f19601f6103a051011660440161037cfd5b60016103605118611785576102c05163cc2b27d76103c052610280516103e0526103205180607f1c612b76576104005260206103c060446103dc845afa61176e573d600060003e3d6000fd5b60203d10612b76576103c090505161028052611c84565b6102c051634fb08c5e6103c052610280516103e052610320516104005260206103c060446103dc845afa6117be573d600060003e3d6000fd5b60203d10612b76576103c090505161028052611c84565b600161036051186118bc57610140366103c037610280516103005160098111612b765760051b6103c001526020612ba86000396000516379ccdf49610500526102c0516105205261026051610540526103c051610560526103e05161058052610400516105a052610420516105c052610440516105e052610460516106005261048051610620526104a051610640526104c051610660526104e05161068052610380516106a05260016106c05260016106e05260206105006101e461051c845afa6118a5573d600060003e3d6000fd5b60203d10612b765761050090505161028052611c84565b60026103805118611997576040366103c037610280516103005160018111612b765760051b6103c0015260026103605118611941576102c051638d8ea727610400526103c051610420526103e051610440526020610400604461041c845afa61192a573d600060003e3d6000fd5b60203d10612b765761040090505161028052611c84565b6102c05163ed8e84f3610400526103c051610420526103e051610440526001610460526020610400606461041c845afa611980573d600060003e3d6000fd5b60203d10612b765761040090505161028052611c84565b60036103805118611a82576060366103c037610280516103005160028111612b765760051b6103c0015260026103605118611a24576102c051635b6f1b5a610420526103c051610440526103e0516104605261040051610480526020610420606461043c845afa611a0d573d600060003e3d6000fd5b60203d10612b765761042090505161028052611c84565b6102c051633883e119610420526103c051610440526103e05161046052610400516104805260016104a0526020610420608461043c845afa611a6b573d600060003e3d6000fd5b60203d10612b765761042090505161028052611c84565b60046103805118611b7d576080366103c037610280516103005160038111612b765760051b6103c0015260026103605118611b17576102c051631a805185610440526103c051610460526103e05161048052610400516104a052610420516104c0526020610440608461045c845afa611b00573d600060003e3d6000fd5b60203d10612b765761044090505161028052611c84565b6102c05163cf701ff7610440526103c051610460526103e05161048052610400516104a052610420516104c05260016104e052602061044060a461045c845afa611b66573d600060003e3d6000fd5b60203d10612b765761044090505161028052611c84565b60056103805118611c845760a0366103c037610280516103005160048111612b765760051b6103c0015260026103605118611c1a576102c0516309379690610460526103c051610480526103e0516104a052610400516104c052610420516104e0526104405161050052602061046060a461047c845afa611c03573d600060003e3d6000fd5b60203d10612b765761046090505161028052611c84565b6102c051637ede89c5610460526103c051610480526103e0516104a052610400516104c052610420516104e0526104405161050052600161052052602061046060c461047c845afa611c71573d600060003e3d6000fd5b60203d10612b7657610460905051610280525b60056102a05118611c96576001611cc8565b6102a0518060011b818160011c18612b7657905060018101818110612b76579050600a8111612b765760051b60400151155b15611cd257611ce5565b610260516102405260010181811861125d575b50506102805160018103818111612b765790506102a05260206102a0f35b63c07b53538118611d24576105443610612b76576101403661024037611e49565b6381fc0ca58118611d94576105e43610612b7657610544358060a01c612b765761024052610564358060a01c612b765761026052610584358060a01c612b7657610280526105a4358060a01c612b76576102a0526105c4358060a01c612b76576102c05260a0366102e037611e49565b6390e7e2058118612b72576106843610612b7657610544358060a01c612b765761024052610564358060a01c612b765761026052610584358060a01c612b7657610280526105a4358060a01c612b76576102a0526105c4358060a01c612b76576102c0526105e4358060a01c612b76576102e052610604358060a01c612b765761030052610624358060a01c612b765761032052610644358060a01c612b765761034052610664358060a01c612b7657610360525b6004358060a01c612b76576040526024358060a01c612b76576060526044358060a01c612b76576080526064358060a01c612b765760a0526084358060a01c612b765760c05260a4358060a01c612b765760e05260c4358060a01c612b76576101005260e4358060a01c612b765761012052610104358060a01c612b765761014052610124358060a01c612b765761016052610144358060a01c612b7657610180526104a4358060a01c612b76576101a0526104c4358060a01c612b76576101c0526104e4358060a01c612b76576101e052610504358060a01c612b765761020052610524358060a01c612b76576102205234612b76576104843561038052600160058101905b806103a0526103a0518060060360068111612b765790506103c0526103c0518060011b818160011c18612b7657905060018103818111612b76579050600a8111612b765760051b604001516103e0526103e051611fac57612b5f565b6103c05160018103818111612b765790508060011b818160011c18612b76579050600a8111612b765760051b60400151610400526103c0518060011b818160011c18612b76579050600a8111612b765760051b60400151610420526103c05160018103818111612b7657905060048111612b765760051b6101a00151610440526103c05160018103818111612b7657905060048111612b765760051b6102400151610460526103c05160018103818111612b7657905060048111612b765760051b6102e001516104805260a06103c05160018103818111612b7657905060048111612b7657026101640180356104a05260208101356104c05260408101356104e05260608101356105005260808101356105205250610520516105405260016104e051186122d357600161050051186121ed5761046051612166576020612ba860003960005163158819d46105605261044051610580526104a05180607f1c612b76576105a0526104c05180607f1c612b76576105c052610380516105e0526105405161060052602061056060a461057c845afa61214f573d600060003e3d6000fd5b60203d10612b765761056090505161038052612b5f565b6020612ba860003960005163571f00b56105605261044051610580526104a05180607f1c612b76576105a0526104c05180607f1c612b76576105c052610380516105e05261054051610600526104605161062052602061056060c461057c845afa6121d6573d600060003e3d6000fd5b60203d10612b765761056090505161038052612b5f565b6105005160028118612200576001612206565b60038118155b905061226457610440516337ed3a7a610560526104a051610580526104c0516105a052610380516105c0526020610560606461057c845afa61224d573d600060003e3d6000fd5b60203d10612b765761056090505161038052612b5f565b6020612bc860003960005163ca4bc71461058052610440516105a0526104a0516105c0526104c0516105e05261038051610600526105405161062052602061058060a461059c845afa6122bc573d600060003e3d6000fd5b60203d10612b765761058090505161038052612b5f565b6104e051600281186122e65760016122ec565b60038118155b90506129c3576104e0516004811861230557600161230b565b60058118155b9050612910576104e0516006811861232457600161232a565b60078118155b905061245d5760086104e051186123f7576020612b886000396000516104005118612356576001612368565b6020612b886000396000516104205118155b612b5f576024610560527f5377617020747970652038206973206f6e6c7920666f7220455448203c2d3e20610580527f57455448000000000000000000000000000000000000000000000000000000006105a05261056050610560518061058001601f826000031636823750506308c379a061052052602061054052601f19601f61056051011660440161053cfd5b600d610560527f42616420737761702074797065000000000000000000000000000000000000006105805261056050610560518061058001601f826000031636823750506308c379a061052052602061054052601f19601f61056051011660440161053cfd5b60016105005118612544576101403661058037610380516104c05160098111612b765760051b61058001526020612ba86000396000516379ccdf496106c0526103e0516106e052610400516107005261058051610720526105a051610740526105c051610760526105e05161078052610600516107a052610620516107c052610640516107e052610660516108005261068051610820526106a05161084052610540516108605260006108805260016108a05260206106c06101e46106dc845afa61252d573d600060003e3d6000fd5b60203d10612b76576106c090505161038052612b5f565b6002610540511861261f5760403661058037610380516104c05160018111612b765760051b6105800152600261050051186125c9576103e051638d8ea7276105c052610580516105e0526105a0516106005260206105c060446105dc845afa6125b2573d600060003e3d6000fd5b60203d10612b76576105c090505161038052612b5f565b6103e05163ed8e84f36105c052610580516105e0526105a0516106005260006106205260206105c060646105dc845afa612608573d600060003e3d6000fd5b60203d10612b76576105c090505161038052612b5f565b6003610540511861270a5760603661058037610380516104c05160028111612b765760051b6105800152600261050051186126ac576103e051635b6f1b5a6105e05261058051610600526105a051610620526105c0516106405260206105e060646105fc845afa612695573d600060003e3d6000fd5b60203d10612b76576105e090505161038052612b5f565b6103e051633883e1196105e05261058051610600526105a051610620526105c0516106405260006106605260206105e060846105fc845afa6126f3573d600060003e3d6000fd5b60203d10612b76576105e090505161038052612b5f565b600461054051186128055760803661058037610380516104c05160038111612b765760051b61058001526002610500511861279f576103e051631a8051856106005261058051610620526105a051610640526105c051610660526105e051610680526020610600608461061c845afa612788573d600060003e3d6000fd5b60203d10612b765761060090505161038052612b5f565b6103e05163cf701ff76106005261058051610620526105a051610640526105c051610660526105e0516106805260006106a052602061060060a461061c845afa6127ee573d600060003e3d6000fd5b60203d10612b765761060090505161038052612b5f565b60056105405118612b5f5760a03661058037610380516104c05160048111612b765760051b6105800152600261050051186128a2576103e05163093796906106205261058051610640526105a051610660526105c051610680526105e0516106a052610600516106c052602061062060a461063c845afa61288b573d600060003e3d6000fd5b60203d10612b765761062090505161038052612b5f565b6103e051637ede89c56106205261058051610640526105a051610660526105c051610680526105e0516106a052610600516106c05260006106e052602061062060c461063c845afa6128f9573d600060003e3d6000fd5b60203d10612b765761062090505161038052612b5f565b60016105005118612973576103e05163cc2b27d761058052610380516105a0526104a05180607f1c612b76576105c0526020610580604461059c845afa61295c573d600060003e3d6000fd5b60203d10612b765761058090505161038052612b5f565b6103e051634fb08c5e61058052610380516105a0526104a0516105c0526020610580604461059c845afa6129ac573d600060003e3d6000fd5b60203d10612b765761058090505161038052612b5f565b60016105005118612ae45761046051612a55576020612ba8600039600051638fd3218f61058052610440516105a0526104a05180607f1c612b76576105c0526104c05180607f1c612b76576105e05261038051610600526105405161062052602061058060a461059c845afa612a3e573d600060003e3d6000fd5b60203d10612b765761058090505161038052612b5f565b6020612ba8600039600051634933a86461058052610440516105a0526104a05180607f1c612b76576105c0526104c05180607f1c612b76576105e0526103805161060052610540516106205261046051610640526104805161066052602061058060e461059c845afa612acd573d600060003e3d6000fd5b60203d10612b765761058090505161038052612b5f565b6020612bc8600039600051638ca1565361058052610440516105a0526104a0516105c0526104c0516105e0526103805161060052610540516106205261046051610640526104805161066052602061058060e461059c845afa612b4c573d600060003e3d6000fd5b60203d10612b7657610580905051610380525b600101818118611f505750506020610380f35b505b005b600080fda165767970657283000309000b000000000000000000000000fc00000000000000000000000000000000000006000000000000000000000000ca8d0747b5573d69653c3ac22242e6341c36e4b400000000000000000000000069522fb5337663d3b4dfb0030b881c1a750adb4f

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

000000000000000000000000fc00000000000000000000000000000000000006000000000000000000000000ca8d0747b5573d69653c3ac22242e6341c36e4b400000000000000000000000069522fb5337663d3b4dfb0030b881c1a750adb4f

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

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000fc00000000000000000000000000000000000006
Arg [1] : 000000000000000000000000ca8d0747b5573d69653c3ac22242e6341c36e4b4
Arg [2] : 00000000000000000000000069522fb5337663d3b4dfb0030b881c1a750adb4f


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
[ 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.