xDAI Price: $0.999924 (-0.01%)
Gas: 1 GWei

Contract

0xF0d4c12A5768D806021F80a262B4d39d26C58b8D

Overview

xDAI Balance

Gnosis Chain LogoGnosis Chain LogoGnosis Chain Logo0 xDAI

xDAI Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Exchange351966502024-07-28 14:05:00269 days ago1722175500IN
0xF0d4c12A...d26C58b8D
0 xDAI0.000707731.3
Exchange351342722024-07-24 20:37:35272 days ago1721853455IN
0xF0d4c12A...d26C58b8D
0 xDAI0.000198741.1
Exchange351342542024-07-24 20:36:05272 days ago1721853365IN
0xF0d4c12A...d26C58b8D
0 xDAI0.000541811.1
Exchange348990922024-07-10 18:50:15286 days ago1720637415IN
0xF0d4c12A...d26C58b8D
0 xDAI0.001194891.764
Exchange348761312024-07-09 9:55:25288 days ago1720518925IN
0xF0d4c12A...d26C58b8D
0 xDAI0.000536321
Exchange348747312024-07-09 7:56:15288 days ago1720511775IN
0xF0d4c12A...d26C58b8D
0 xDAI0.000040670.09
Exchange348731152024-07-09 5:38:10288 days ago1720503490IN
0xF0d4c12A...d26C58b8D
0 xDAI0.000877733
Exchange348730982024-07-09 5:36:40288 days ago1720503400IN
0xF0d4c12A...d26C58b8D
0 xDAI0.000877763
Exchange348730782024-07-09 5:35:00288 days ago1720503300IN
0xF0d4c12A...d26C58b8D
0 xDAI0.000877793
Exchange348663312024-07-08 19:56:05288 days ago1720468565IN
0xF0d4c12A...d26C58b8D
0 xDAI0.000235371
Exchange348658982024-07-08 19:18:50288 days ago1720466330IN
0xF0d4c12A...d26C58b8D
0 xDAI0.000461051
Exchange348654002024-07-08 18:35:45288 days ago1720463745IN
0xF0d4c12A...d26C58b8D
0 xDAI0.000591211
Exchange348647082024-07-08 17:36:35288 days ago1720460195IN
0xF0d4c12A...d26C58b8D
0 xDAI0.000494251
Exchange348646242024-07-08 17:29:20288 days ago1720459760IN
0xF0d4c12A...d26C58b8D
0 xDAI0.000543883.3
Exchange348645762024-07-08 17:25:10288 days ago1720459510IN
0xF0d4c12A...d26C58b8D
0 xDAI0.002014923.1
Exchange348636762024-07-08 16:08:25288 days ago1720454905IN
0xF0d4c12A...d26C58b8D
0 xDAI0.001565193.4
Exchange348618322024-07-08 13:30:30289 days ago1720445430IN
0xF0d4c12A...d26C58b8D
0 xDAI0.001455023.2
Exchange348593072024-07-08 9:52:55289 days ago1720432375IN
0xF0d4c12A...d26C58b8D
0 xDAI0.002607455.2
Exchange348590582024-07-08 9:31:10289 days ago1720431070IN
0xF0d4c12A...d26C58b8D
0 xDAI0.001783122.94293999
Exchange348590492024-07-08 9:30:25289 days ago1720431025IN
0xF0d4c12A...d26C58b8D
0 xDAI0.001880263.038
Exchange348578222024-07-08 7:45:40289 days ago1720424740IN
0xF0d4c12A...d26C58b8D
0 xDAI0.002751014.5864
Exchange348569022024-07-08 6:26:40289 days ago1720420000IN
0xF0d4c12A...d26C58b8D
0 xDAI0.001340233
Exchange348565602024-07-08 5:57:10289 days ago1720418230IN
0xF0d4c12A...d26C58b8D
0 xDAI0.000906613.1
Exchange348565332024-07-08 5:54:55289 days ago1720418095IN
0xF0d4c12A...d26C58b8D
0 xDAI0.000910553.1
Exchange348511452024-07-07 22:13:05289 days ago1720390385IN
0xF0d4c12A...d26C58b8D
0 xDAI0.000475461
View all transactions

View more zero value Internal Transactions in Advanced View mode

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CurveRouterSidechainTricryptoMeta v1.0

Compiler Version
vyper:0.3.7

Optimization Enabled:
N/A

Other Settings:
default evmVersion, None license

Contract Source Code (Vyper language format)

# @version 0.3.7

"""
@title CurveRouterSidechainTricryptoMeta 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

interface stETH:
    def submit(_refferer: address): payable

interface frxETHMinter:
    def submit(): payable

interface wstETH:
    def getWstETHByStETH(_stETHAmount: uint256) -> uint256: view
    def getStETHByWstETH(_wstETHAmount: uint256) -> uint256: view
    def wrap(_stETHAmount: uint256) -> uint256: nonpayable
    def unwrap(_wstETHAmount: uint256) -> uint256: nonpayable

interface sfrxETH:
    def convertToShares(assets: uint256) -> uint256: view
    def convertToAssets(shares: uint256) -> uint256: view
    def deposit(assets: uint256, receiver: address) -> uint256: nonpayable
    def redeem(shares: uint256, receiver: address, owner: address) -> uint256: nonpayable

interface wBETH:
    def deposit(referral: address): payable
    def exchangeRate() -> uint256: view

# SNX
interface Synthetix:
    def exchangeAtomically(sourceCurrencyKey: bytes32, sourceAmount: uint256, destinationCurrencyKey: bytes32, trackingCode: bytes32, minAmount: uint256) -> uint256: nonpayable

interface SynthetixExchanger:
    def getAmountsForAtomicExchange(sourceAmount: uint256, sourceCurrencyKey: bytes32, destinationCurrencyKey: bytes32) -> AtomicAmountAndFee: view

interface SynthetixAddressResolver:
    def getAddress(name: bytes32) -> address: view

# 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
    def get_dx_tricrypto_meta_underlying(pool: address, i: uint256, j: uint256, dy: uint256, n_coins: uint256, base_pool: address, base_token: address) -> uint256: view
    def get_dx_double_meta_underlying(pool: address, i: uint256, j: uint256, dy: uint256, base_pool: address, base_pool_zap: address, base_pool2: address, base_token2: address) -> uint256: view


struct AtomicAmountAndFee:
    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]]
is_tricrypto_meta: HashMap[address, bool]


@external
@payable
def __default__():
    pass


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

    if _tricrypto_meta_pools[0] != empty(address):
        self.is_tricrypto_meta[_tricrypto_meta_pools[0]] = True
    if _tricrypto_meta_pools[1] != empty(address):
        self.is_tricrypto_meta[_tricrypto_meta_pools[1]] = True


@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, ETH -> stETH or ETH -> frxETH, stETH <-> wstETH, frxETH <-> sfrxETH, ETH -> wBETH

                        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 only needed 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, ETH -> stETH or ETH -> frxETH, stETH <-> wstETH, frxETH <-> sfrxETH, ETH -> wBETH

                        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 only needed 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]),
    _second_base_pools: address[5]=empty(address[5]),
    _second_base_tokens: address[5]=empty(address[5]),
) -> uint256:
    """
    @notice Calculate the input amount required to receive the desired output 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, ETH -> stETH or ETH -> frxETH, stETH <-> wstETH, frxETH <-> sfrxETH, ETH -> wBETH

                        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). Should be a zap address for double meta pools.
    @param _second_base_pools Array of the second base pools (for double meta pools like crv/tricrypto and wmatic/tricrypto).
    @param _second_base_tokens Array of the second base lp tokens (for double meta pools  like crv/tricrypto and wmatic/tricrypto).
    @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]
        second_base_pool: address = _second_base_pools[i-1]
        second_base_token: address = _second_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]:  # SWAP IS ZAP HERE !!!
            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
                if second_base_pool != empty(address):  # double-meta
                    # BASE_TOKEN IS BASE_POOL_ZAP HERE !!!
                    amount = CRYPTO_CALC.get_dx_double_meta_underlying(pool, params[0], params[1], amount, base_pool, base_token, second_base_pool, second_base_token)
                elif self.is_tricrypto_meta[pool]:
                    amount = CRYPTO_CALC.get_dx_tricrypto_meta_underlying(pool, params[0], params[1], amount, n_coins, base_pool, base_token)
                else:
                    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

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"},{"name":"_tricrypto_meta_pools","type":"address[2]"}],"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"}]},{"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]"},{"name":"_second_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]"},{"name":"_second_base_pools","type":"address[5]"},{"name":"_second_base_tokens","type":"address[5]"}],"outputs":[{"name":"","type":"uint256"}]}]

60206130616000396000518060a01c61305c5760405260206130816000396000518060a01c61305c5760605260206130a16000396000518060a01c61305c5760805260206130c16000396000518060a01c61305c5760a05260206130e16000396000518060a01c61305c5760c0523461305c57604051612f8a52606051612faa52608051612fca5260a051156100a3576001600260a0516020526000526040600020555b60c051156100bf576001600260c0516020526000526040600020555b612f8a6100d161000039612fea610000f36003361161000c57612f76565b60003560e01c63371dc4478118610037576104c43610612f785760a0366101a037336102405261011a565b635c9c18e281186100a5576105643610612f78576104c4358060a01c612f78576101a0526104e4358060a01c612f78576101c052610504358060a01c612f78576101e052610524358060a01c612f785761020052610544358060a01c612f785761022052336102405261011a565b63c872a3c5811861111c576105843610612f78576104c4358060a01c612f78576101a0526104e4358060a01c612f78576101c052610504358060a01c612f78576101e052610524358060a01c612f785761020052610544358060a01c612f785761022052610564358060a01c612f7857610240525b6004358060a01c612f78576040526024358060a01c612f78576060526044358060a01c612f78576080526064358060a01c612f785760a0526084358060a01c612f785760c05260a4358060a01c612f785760e05260c4358060a01c612f78576101005260e4358060a01c612f785761012052610104358060a01c612f785761014052610124358060a01c612f785761016052610144358060a01c612f785761018052600054600114612f7857600160005560405161026052600061028052610484356102a05273eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee610260511861020d576102a0513418612f785761028b565b34612f7857610260516323b872dd6102c052336102e05230610300526102a0516103205260206102c060646102dc6000855af161024f573d600060003e3d6000fd5b3d61026657803b15612f785760016103405261027f565b60203d10612f78576102c0518060011c612f7857610340525b61034090505115612f78575b600160058101905b806102c0526102c0518060011b818160011c18612f7857905060018103818111612f78579050600a8111612f785760051b604001516102e0526102c05160018103818111612f7857905060048111612f785760051b6101a00151610300526102c0518060011b818160011c18612f78579050600a8111612f785760051b604001516102805260a06102c05160018103818111612f7857905060048111612f7857026101640180356103205260208101356103405260408101356103605260608101356103805260808101356103a052506001610260516020526000526040600020806102e0516020526000526040600020905054610436576102605163095ea7b36103c0526102e0516103e0527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6104005260206103c060446103dc6000855af16103e3573d600060003e3d6000fd5b3d6103f357600161042052610404565b6103c0518060011c612f7857610420525b61042090505115612f785760016001610260516020526000526040600020806102e05160205260005260406000209050555b60006103c05273eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102605118610463576102a0516103c0525b600161036051186105da57600161038051186104e1576102e051633df021246103e0526103205180607f1c612f7857610400526103405180607f1c612f7857610420526102a05161044052600061046052803b15612f785760006103e060846103fc6103c051855af16104db573d600060003e3d6000fd5b50610da2565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102605118610506576001610522565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102805118155b61057c576102e051635b41b9086103e052610320516104005261034051610420526102a05161044052600061046052803b15612f785760006103e060846103fc6000855af1610576573d600060003e3d6000fd5b50610da2565b6102e05163394747c56103e052610320516104005261034051610420526102a05161044052600061046052600161048052803b15612f785760006103e060a46103fc6103c051855af16105d4573d600060003e3d6000fd5b50610da2565b600261036051186106b05760016103805118610658576102e05163a6417ed66103e0526103205180607f1c612f7857610400526103405180607f1c612f7857610420526102a05161044052600061046052803b15612f785760006103e060846103fc6103c051855af1610652573d600060003e3d6000fd5b50610da2565b6102e0516365b2489b6103e052610320516104005261034051610420526102a05161044052600061046052803b15612f785760006103e060846103fc6103c051855af16106aa573d600060003e3d6000fd5b50610da2565b600361036051186107e15760016103805118610734576102e051637981c43e6103e05261030051610400526103205180607f1c612f7857610420526103405180607f1c612f7857610440526102a05161046052600061048052803b15612f785760006103e060a46103fc6000855af161072e573d600060003e3d6000fd5b50610da2565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102605118610759576001610775565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102805118155b6103e0526102e051632bf78c61610400526103005161042052610320516104405261034051610460526102a0516104805260006104a0526103e0516104c052803b15612f7857600061040060c461041c6103c051855af16107db573d600060003e3d6000fd5b50610da2565b60046103605118610a045760026103a05118610866576040366103e0376102a0516103205160018111612f785760051b6103e001526102e051630b4c7e4d610420526103e051610440526104005161046052600061048052803b15612f78576000610420606461043c6103c051855af1610860573d600060003e3d6000fd5b50610da2565b60036103a051186108e8576060366103e0376102a0516103205160028111612f785760051b6103e001526102e051634515cef3610440526103e051610460526104005161048052610420516104a05260006104c052803b15612f78576000610440608461045c6103c051855af16108e2573d600060003e3d6000fd5b50610da2565b60046103a05118610972576080366103e0376102a0516103205160038111612f785760051b6103e001526102e05163029b2f34610460526103e05161048052610400516104a052610420516104c052610440516104e052600061050052803b15612f7857600061046060a461047c6103c051855af161096c573d600060003e3d6000fd5b50610da2565b60056103a05118610da25760a0366103e0376102a0516103205160048111612f785760051b6103e001526102e0516384738499610480526103e0516104a052610400516104c052610420516104e05261044051610500526104605161052052600061054052803b15612f7857600061048060c461049c6103c051855af16109fe573d600060003e3d6000fd5b50610da2565b60056103605118610a8c576060366103e0376102a0516103205160028111612f785760051b6103e001526102e051632b6e993a610440526103e051610460526104005161048052610420516104a05260006104c05260016104e052803b15612f7857600061044060a461045c6103c051855af1610a86573d600060003e3d6000fd5b50610da2565b60066103605118610b465760016103805118610af8576102e051631a4d01d26103e0526102a051610400526103405180607f1c612f785761042052600061044052803b15612f785760006103e060646103fc6000855af1610af2573d600060003e3d6000fd5b50610da2565b6102e05163f1dc3cc96103e0526102a051610400526103405161042052600061044052803b15612f785760006103e060646103fc6000855af1610b40573d600060003e3d6000fd5b50610da2565b60076103605118610bb2576102e05163517a55a36103e0526102a051610400526103405180607f1c612f78576104205260006104405260016104605260206103e060846103fc6000855af1610ba0573d600060003e3d6000fd5b60203d10612f78576103e05050610da2565b60086103605118610d3c5773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102605118610bf1576020612f8a600039600051610280511815610bf4565b60005b610d02576020612f8a6000396000516102605118610c2c5773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee610280511815610c2f565b60005b610cc25760246103e0527f5377617020747970652038206973206f6e6c7920666f7220455448203c2d3e20610400527f5745544800000000000000000000000000000000000000000000000000000000610420526103e0506103e0518061040001601f826000031636823750506308c379a06103a05260206103c052601f19601f6103e05101166044016103bcfd610da2565b6102e051632e1a7d4d6103e0526102a05161040052803b15612f785760006103e060246103fc6000855af1610cfc573d600060003e3d6000fd5b50610da2565b6102e05163d0e30db06103e052803b15612f785760006103e060046103fc6102a051855af1610d36573d600060003e3d6000fd5b50610da2565b600d6103e0527f4261642073776170207479706500000000000000000000000000000000000000610400526103e0506103e0518061040001601f826000031636823750506308c379a06103a05260206103c052601f19601f6103e05101166044016103bcfd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102805118610dca57476102a052610e0b565b610280516370a082316103e052306104005260206103e060246103fc845afa610df8573d600060003e3d6000fd5b60203d10612f78576103e09050516102a0525b6102a051610e795760106103e0527f5265636569766564206e6f7468696e6700000000000000000000000000000000610400526103e0506103e0518061040001601f826000031636823750506308c379a06103a05260206103c052601f19601f6103e05101166044016103bcfd5b60056102c05118610e8b576001610ebd565b6102c0518060011b818160011c18612f7857905060018101818110612f78579050600a8111612f785760051b60400151155b15610ec757610eda565b6102805161026052600101818118610293575b50506102a05160018103818111612f785790506102a0526104a4356102a0511015610f655760086102c0527f536c6970706167650000000000000000000000000000000000000000000000006102e0526102c0506102c051806102e001601f826000031636823750506308c379a06102805260206102a052601f19601f6102c051011660440161029cfd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102805118610fb55760006102c0526102c050600060006102c0516102e06102a051610240515af161102c573d600060003e3d6000fd61102c565b6102805163a9059cbb6102c052610240516102e0526102a0516103005260206102c060446102dc6000855af1610ff0573d600060003e3d6000fd5b3d61100757803b15612f7857600161032052611020565b60203d10612f78576102c0518060011c612f7857610320525b61032090505115612f78575b61024051337f56d0661e240dfb199ef196e16e6f42473990366314f0226ac978f7be3cd9ee836040516102c0526060516102e0526080516103005260a0516103205260c0516103405260e051610360526101005161038052610120516103a052610140516103c052610160516103e052610180516104005260a06101646104203760a06102046104c03760a06102a46105603760a06103446106003760a06103e46106a0376101a051610740526101c051610760526101e05161078052610200516107a052610220516107c052610484356107e0526102a051610800526105606102c0a360206102a06000600055f35b6381889a2c811861113c576104a43610612f785760a0366101a0376111a1565b63637653cb8118611d17576105443610612f78576104a4358060a01c612f78576101a0526104c4358060a01c612f78576101c0526104e4358060a01c612f78576101e052610504358060a01c612f785761020052610524358060a01c612f7857610220525b6004358060a01c612f78576040526024358060a01c612f78576060526044358060a01c612f78576080526064358060a01c612f785760a0526084358060a01c612f785760c05260a4358060a01c612f785760e05260c4358060a01c612f78576101005260e4358060a01c612f785761012052610104358060a01c612f785761014052610124358060a01c612f785761016052610144358060a01c612f78576101805234612f7857604051610240526000610260526104843561028052600160058101905b806102a0526102a0518060011b818160011c18612f7857905060018103818111612f78579050600a8111612f785760051b604001516102c0526102a05160018103818111612f7857905060048111612f785760051b6101a001516102e0526102a0518060011b818160011c18612f78579050600a8111612f785760051b604001516102605260a06102a05160018103818111612f7857905060048111612f78570261016401803561030052602081013561032052604081013561034052606081013561036052608081013561038052506001610340511861140b57600161036051186113b3576102c051635e0d443f6103a0526103005180607f1c612f78576103c0526103205180607f1c612f78576103e052610280516104005260206103a060646103bc845afa61139c573d600060003e3d6000fd5b60203d10612f78576103a090505161028052611c98565b6102c05163556d6e9f6103a052610300516103c052610320516103e052610280516104005260206103a060646103bc845afa6113f4573d600060003e3d6000fd5b60203d10612f78576103a090505161028052611c98565b600261034051186114e15760016103605118611489576102c0516307211ef76103a0526103005180607f1c612f78576103c0526103205180607f1c612f78576103e052610280516104005260206103a060646103bc845afa611472573d600060003e3d6000fd5b60203d10612f78576103a090505161028052611c98565b6102c0516385f11d1e6103a052610300516103c052610320516103e052610280516104005260206103a060646103bc845afa6114ca573d600060003e3d6000fd5b60203d10612f78576103a090505161028052611c98565b600361034051186115bf576001610360511861155f576102e0516307211ef76103a0526103005180607f1c612f78576103c0526103205180607f1c612f78576103e052610280516104005260206103a060646103bc845afa611548573d600060003e3d6000fd5b60203d10612f78576103a090505161028052611c98565b6102c05163e9737ee26103a0526102e0516103c052610300516103e0526103205161040052610280516104205260206103a060846103bc845afa6115a8573d600060003e3d6000fd5b60203d10612f78576103a090505161028052611c98565b61034051600481186115d25760016115d8565b60058118155b90506117e95761034051600681186115f15760016115f7565b60078118155b905061173657600861034051186116cc576020612f8a6000396000516102405118611623576001611635565b6020612f8a6000396000516102605118155b611c985760246103a0527f5377617020747970652038206973206f6e6c7920666f7220455448203c2d3e206103c0527f57455448000000000000000000000000000000000000000000000000000000006103e0526103a0506103a051806103c001601f826000031636823750506308c379a061036052602061038052601f19601f6103a051011660440161037cfd611c9856611c98565b600d6103a0527f42616420737761702074797065000000000000000000000000000000000000006103c0526103a0506103a051806103c001601f826000031636823750506308c379a061036052602061038052601f19601f6103a051011660440161037cfd611c98565b60016103605118611799576102c05163cc2b27d76103c052610280516103e0526103205180607f1c612f78576104005260206103c060446103dc845afa611782573d600060003e3d6000fd5b60203d10612f78576103c090505161028052611c98565b6102c051634fb08c5e6103c052610280516103e052610320516104005260206103c060446103dc845afa6117d2573d600060003e3d6000fd5b60203d10612f78576103c090505161028052611c98565b600161036051186118d057610140366103c037610280516103005160098111612f785760051b6103c001526020612faa6000396000516379ccdf49610500526102c0516105205261026051610540526103c051610560526103e05161058052610400516105a052610420516105c052610440516105e052610460516106005261048051610620526104a051610640526104c051610660526104e05161068052610380516106a05260016106c05260016106e05260206105006101e461051c845afa6118b9573d600060003e3d6000fd5b60203d10612f785761050090505161028052611c98565b600261038051186119ab576040366103c037610280516103005160018111612f785760051b6103c0015260026103605118611955576102c051638d8ea727610400526103c051610420526103e051610440526020610400604461041c845afa61193e573d600060003e3d6000fd5b60203d10612f785761040090505161028052611c98565b6102c05163ed8e84f3610400526103c051610420526103e051610440526001610460526020610400606461041c845afa611994573d600060003e3d6000fd5b60203d10612f785761040090505161028052611c98565b60036103805118611a96576060366103c037610280516103005160028111612f785760051b6103c0015260026103605118611a38576102c051635b6f1b5a610420526103c051610440526103e0516104605261040051610480526020610420606461043c845afa611a21573d600060003e3d6000fd5b60203d10612f785761042090505161028052611c98565b6102c051633883e119610420526103c051610440526103e05161046052610400516104805260016104a0526020610420608461043c845afa611a7f573d600060003e3d6000fd5b60203d10612f785761042090505161028052611c98565b60046103805118611b91576080366103c037610280516103005160038111612f785760051b6103c0015260026103605118611b2b576102c051631a805185610440526103c051610460526103e05161048052610400516104a052610420516104c0526020610440608461045c845afa611b14573d600060003e3d6000fd5b60203d10612f785761044090505161028052611c98565b6102c05163cf701ff7610440526103c051610460526103e05161048052610400516104a052610420516104c05260016104e052602061044060a461045c845afa611b7a573d600060003e3d6000fd5b60203d10612f785761044090505161028052611c98565b60056103805118611c985760a0366103c037610280516103005160048111612f785760051b6103c0015260026103605118611c2e576102c0516309379690610460526103c051610480526103e0516104a052610400516104c052610420516104e0526104405161050052602061046060a461047c845afa611c17573d600060003e3d6000fd5b60203d10612f785761046090505161028052611c98565b6102c051637ede89c5610460526103c051610480526103e0516104a052610400516104c052610420516104e0526104405161050052600161052052602061046060c461047c845afa611c85573d600060003e3d6000fd5b60203d10612f7857610460905051610280525b60056102a05118611caa576001611cdc565b6102a0518060011b818160011c18612f7857905060018101818110612f78579050600a8111612f785760051b60400151155b15611ce657611cf9565b6102605161024052600101818118611265575b50506102805160018103818111612f785790506102a05260206102a0f35b63c07b53538118611d38576105443610612f785761028036610240376120cf565b6381fc0ca58118611da9576105e43610612f7857610544358060a01c612f785761024052610564358060a01c612f785761026052610584358060a01c612f7857610280526105a4358060a01c612f78576102a0526105c4358060a01c612f78576102c0526101e0366102e0376120cf565b6390e7e2058118611e6a576106843610612f7857610544358060a01c612f785761024052610564358060a01c612f785761026052610584358060a01c612f7857610280526105a4358060a01c612f78576102a0526105c4358060a01c612f78576102c0526105e4358060a01c612f78576102e052610604358060a01c612f785761030052610624358060a01c612f785761032052610644358060a01c612f785761034052610664358060a01c612f78576103605261014036610380376120cf565b63d10eb3858118611f7a576107243610612f7857610544358060a01c612f785761024052610564358060a01c612f785761026052610584358060a01c612f7857610280526105a4358060a01c612f78576102a0526105c4358060a01c612f78576102c0526105e4358060a01c612f78576102e052610604358060a01c612f785761030052610624358060a01c612f785761032052610644358060a01c612f785761034052610664358060a01c612f785761036052610684358060a01c612f7857610380526106a4358060a01c612f78576103a0526106c4358060a01c612f78576103c0526106e4358060a01c612f78576103e052610704358060a01c612f78576104005260a036610420376120cf565b636d654ccd8118612f74576107c43610612f7857610544358060a01c612f785761024052610564358060a01c612f785761026052610584358060a01c612f7857610280526105a4358060a01c612f78576102a0526105c4358060a01c612f78576102c0526105e4358060a01c612f78576102e052610604358060a01c612f785761030052610624358060a01c612f785761032052610644358060a01c612f785761034052610664358060a01c612f785761036052610684358060a01c612f7857610380526106a4358060a01c612f78576103a0526106c4358060a01c612f78576103c0526106e4358060a01c612f78576103e052610704358060a01c612f785761040052610724358060a01c612f785761042052610744358060a01c612f785761044052610764358060a01c612f785761046052610784358060a01c612f7857610480526107a4358060a01c612f78576104a0525b6004358060a01c612f78576040526024358060a01c612f78576060526044358060a01c612f78576080526064358060a01c612f785760a0526084358060a01c612f785760c05260a4358060a01c612f785760e05260c4358060a01c612f78576101005260e4358060a01c612f785761012052610104358060a01c612f785761014052610124358060a01c612f785761016052610144358060a01c612f7857610180526104a4358060a01c612f78576101a0526104c4358060a01c612f78576101c0526104e4358060a01c612f78576101e052610504358060a01c612f785761020052610524358060a01c612f78576102205234612f7857610484356104c052600160058101905b806104e0526104e0518060060360068111612f7857905061050052610500518060011b818160011c18612f7857905060018103818111612f78579050600a8111612f785760051b60400151610520526105205161223257612f61565b6105005160018103818111612f785790508060011b818160011c18612f78579050600a8111612f785760051b6040015161054052610500518060011b818160011c18612f78579050600a8111612f785760051b60400151610560526105005160018103818111612f7857905060048111612f785760051b6101a00151610580526105005160018103818111612f7857905060048111612f785760051b61024001516105a0526105005160018103818111612f7857905060048111612f785760051b6102e001516105c0526105005160018103818111612f7857905060048111612f785760051b61038001516105e0526105005160018103818111612f7857905060048111612f785760051b61042001516106005260a06105005160018103818111612f7857905060048111612f7857026101640180356106205260208101356106405260408101356106605260608101356106805260808101356106a052506106a0516106c052600161066051186125a357600161068051186124bd576105a051612436576020612faa60003960005163158819d46106e05261058051610700526106205180607f1c612f7857610720526106405180607f1c612f7857610740526104c051610760526106c0516107805260206106e060a46106fc845afa61241f573d600060003e3d6000fd5b60203d10612f78576106e09050516104c052612f61565b6020612faa60003960005163571f00b56106e05261058051610700526106205180607f1c612f7857610720526106405180607f1c612f7857610740526104c051610760526106c051610780526105a0516107a05260206106e060c46106fc845afa6124a6573d600060003e3d6000fd5b60203d10612f78576106e09050516104c052612f61565b61068051600281186124d05760016124d6565b60038118155b905061253457610580516337ed3a7a6106e052610620516107005261064051610720526104c0516107405260206106e060646106fc845afa61251d573d600060003e3d6000fd5b60203d10612f78576106e09050516104c052612f61565b6020612fca60003960005163ca4bc714610700526105805161072052610620516107405261064051610760526104c051610780526106c0516107a052602061070060a461071c845afa61258c573d600060003e3d6000fd5b60203d10612f78576107009050516104c052612f61565b61066051600281186125b65760016125bc565b60038118155b9050612c9f5761066051600481186125d55760016125db565b60058118155b9050612bec5761066051600681186125f45760016125fa565b60078118155b905061273957600861066051186126cf576020612f8a6000396000516105405118612626576001612638565b6020612f8a6000396000516105605118155b612f615760246106e0527f5377617020747970652038206973206f6e6c7920666f7220455448203c2d3e20610700527f5745544800000000000000000000000000000000000000000000000000000000610720526106e0506106e0518061070001601f826000031636823750506308c379a06106a05260206106c052601f19601f6106e05101166044016106bcfd612f6156612f61565b600d6106e0527f4261642073776170207479706500000000000000000000000000000000000000610700526106e0506106e0518061070001601f826000031636823750506308c379a06106a05260206106c052601f19601f6106e05101166044016106bcfd612f61565b600161068051186128205761014036610700376104c0516106405160098111612f785760051b61070001526020612faa6000396000516379ccdf496108405261052051610860526105405161088052610700516108a052610720516108c052610740516108e052610760516109005261078051610920526107a051610940526107c051610960526107e05161098052610800516109a052610820516109c0526106c0516109e0526000610a00526001610a205260206108406101e461085c845afa612809573d600060003e3d6000fd5b60203d10612f78576108409050516104c052612f61565b60026106c051186128fb57604036610700376104c0516106405160018111612f785760051b6107000152600261068051186128a55761052051638d8ea72761074052610700516107605261072051610780526020610740604461075c845afa61288e573d600060003e3d6000fd5b60203d10612f78576107409050516104c052612f61565b6105205163ed8e84f3610740526107005161076052610720516107805260006107a0526020610740606461075c845afa6128e4573d600060003e3d6000fd5b60203d10612f78576107409050516104c052612f61565b60036106c051186129e657606036610700376104c0516106405160028111612f785760051b6107000152600261068051186129885761052051635b6f1b5a610760526107005161078052610720516107a052610740516107c0526020610760606461077c845afa612971573d600060003e3d6000fd5b60203d10612f78576107609050516104c052612f61565b61052051633883e119610760526107005161078052610720516107a052610740516107c05260006107e0526020610760608461077c845afa6129cf573d600060003e3d6000fd5b60203d10612f78576107609050516104c052612f61565b60046106c05118612ae157608036610700376104c0516106405160038111612f785760051b610700015260026106805118612a7b5761052051631a80518561078052610700516107a052610720516107c052610740516107e05261076051610800526020610780608461079c845afa612a64573d600060003e3d6000fd5b60203d10612f78576107809050516104c052612f61565b6105205163cf701ff761078052610700516107a052610720516107c052610740516107e0526107605161080052600061082052602061078060a461079c845afa612aca573d600060003e3d6000fd5b60203d10612f78576107809050516104c052612f61565b60056106c05118612f615760a036610700376104c0516106405160048111612f785760051b610700015260026106805118612b7e576105205163093796906107a052610700516107c052610720516107e05261074051610800526107605161082052610780516108405260206107a060a46107bc845afa612b67573d600060003e3d6000fd5b60203d10612f78576107a09050516104c052612f61565b61052051637ede89c56107a052610700516107c052610720516107e05261074051610800526107605161082052610780516108405260006108605260206107a060c46107bc845afa612bd5573d600060003e3d6000fd5b60203d10612f78576107a09050516104c052612f61565b60016106805118612c4f576105205163cc2b27d7610700526104c051610720526106205180607f1c612f7857610740526020610700604461071c845afa612c38573d600060003e3d6000fd5b60203d10612f78576107009050516104c052612f61565b61052051634fb08c5e610700526104c0516107205261062051610740526020610700604461071c845afa612c88573d600060003e3d6000fd5b60203d10612f78576107009050516104c052612f61565b60016106805118612dc0576105a051612d31576020612faa600039600051638fd3218f6107005261058051610720526106205180607f1c612f7857610740526106405180607f1c612f7857610760526104c051610780526106c0516107a052602061070060a461071c845afa612d1a573d600060003e3d6000fd5b60203d10612f78576107009050516104c052612f61565b6020612faa600039600051634933a8646107005261058051610720526106205180607f1c612f7857610740526106405180607f1c612f7857610760526104c051610780526106c0516107a0526105a0516107c0526105c0516107e052602061070060e461071c845afa612da9573d600060003e3d6000fd5b60203d10612f78576107009050516104c052612f61565b6105e05115612e51576020612fca600039600051635c27cc9c610700526105805161072052610620516107405261064051610760526104c051610780526105a0516107a0526105c0516107c0526105e0516107e0526106005161080052602061070061010461071c845afa612e3a573d600060003e3d6000fd5b60203d10612f78576107009050516104c052612f61565b600261058051602052600052604060002054612ee6576020612fca600039600051638ca15653610700526105805161072052610620516107405261064051610760526104c051610780526106c0516107a0526105a0516107c0526105c0516107e052602061070060e461071c845afa612ecf573d600060003e3d6000fd5b60203d10612f78576107009050516104c052612f61565b6020612fca600039600051634020784b610700526105805161072052610620516107405261064051610760526104c051610780526106c0516107a0526105a0516107c0526105c0516107e052602061070060e461071c845afa612f4e573d600060003e3d6000fd5b60203d10612f78576107009050516104c0525b6001018181186121d657505060206104c0f35b505b005b600080fda165767970657283000307000b005b600080fd000000000000000000000000e91d153e0b41518a2ce8dd3d7944fa863463a97d000000000000000000000000ca8d0747b5573d69653c3ac22242e6341c36e4b4000000000000000000000000a72c85c258a81761433b4e8da60505fe3dd551cc0000000000000000000000005633e00994896d0f472926050ecb32e38bef3e650000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x6003361161000c57612f76565b60003560e01c63371dc4478118610037576104c43610612f785760a0366101a037336102405261011a565b635c9c18e281186100a5576105643610612f78576104c4358060a01c612f78576101a0526104e4358060a01c612f78576101c052610504358060a01c612f78576101e052610524358060a01c612f785761020052610544358060a01c612f785761022052336102405261011a565b63c872a3c5811861111c576105843610612f78576104c4358060a01c612f78576101a0526104e4358060a01c612f78576101c052610504358060a01c612f78576101e052610524358060a01c612f785761020052610544358060a01c612f785761022052610564358060a01c612f7857610240525b6004358060a01c612f78576040526024358060a01c612f78576060526044358060a01c612f78576080526064358060a01c612f785760a0526084358060a01c612f785760c05260a4358060a01c612f785760e05260c4358060a01c612f78576101005260e4358060a01c612f785761012052610104358060a01c612f785761014052610124358060a01c612f785761016052610144358060a01c612f785761018052600054600114612f7857600160005560405161026052600061028052610484356102a05273eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee610260511861020d576102a0513418612f785761028b565b34612f7857610260516323b872dd6102c052336102e05230610300526102a0516103205260206102c060646102dc6000855af161024f573d600060003e3d6000fd5b3d61026657803b15612f785760016103405261027f565b60203d10612f78576102c0518060011c612f7857610340525b61034090505115612f78575b600160058101905b806102c0526102c0518060011b818160011c18612f7857905060018103818111612f78579050600a8111612f785760051b604001516102e0526102c05160018103818111612f7857905060048111612f785760051b6101a00151610300526102c0518060011b818160011c18612f78579050600a8111612f785760051b604001516102805260a06102c05160018103818111612f7857905060048111612f7857026101640180356103205260208101356103405260408101356103605260608101356103805260808101356103a052506001610260516020526000526040600020806102e0516020526000526040600020905054610436576102605163095ea7b36103c0526102e0516103e0527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6104005260206103c060446103dc6000855af16103e3573d600060003e3d6000fd5b3d6103f357600161042052610404565b6103c0518060011c612f7857610420525b61042090505115612f785760016001610260516020526000526040600020806102e05160205260005260406000209050555b60006103c05273eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102605118610463576102a0516103c0525b600161036051186105da57600161038051186104e1576102e051633df021246103e0526103205180607f1c612f7857610400526103405180607f1c612f7857610420526102a05161044052600061046052803b15612f785760006103e060846103fc6103c051855af16104db573d600060003e3d6000fd5b50610da2565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102605118610506576001610522565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102805118155b61057c576102e051635b41b9086103e052610320516104005261034051610420526102a05161044052600061046052803b15612f785760006103e060846103fc6000855af1610576573d600060003e3d6000fd5b50610da2565b6102e05163394747c56103e052610320516104005261034051610420526102a05161044052600061046052600161048052803b15612f785760006103e060a46103fc6103c051855af16105d4573d600060003e3d6000fd5b50610da2565b600261036051186106b05760016103805118610658576102e05163a6417ed66103e0526103205180607f1c612f7857610400526103405180607f1c612f7857610420526102a05161044052600061046052803b15612f785760006103e060846103fc6103c051855af1610652573d600060003e3d6000fd5b50610da2565b6102e0516365b2489b6103e052610320516104005261034051610420526102a05161044052600061046052803b15612f785760006103e060846103fc6103c051855af16106aa573d600060003e3d6000fd5b50610da2565b600361036051186107e15760016103805118610734576102e051637981c43e6103e05261030051610400526103205180607f1c612f7857610420526103405180607f1c612f7857610440526102a05161046052600061048052803b15612f785760006103e060a46103fc6000855af161072e573d600060003e3d6000fd5b50610da2565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102605118610759576001610775565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102805118155b6103e0526102e051632bf78c61610400526103005161042052610320516104405261034051610460526102a0516104805260006104a0526103e0516104c052803b15612f7857600061040060c461041c6103c051855af16107db573d600060003e3d6000fd5b50610da2565b60046103605118610a045760026103a05118610866576040366103e0376102a0516103205160018111612f785760051b6103e001526102e051630b4c7e4d610420526103e051610440526104005161046052600061048052803b15612f78576000610420606461043c6103c051855af1610860573d600060003e3d6000fd5b50610da2565b60036103a051186108e8576060366103e0376102a0516103205160028111612f785760051b6103e001526102e051634515cef3610440526103e051610460526104005161048052610420516104a05260006104c052803b15612f78576000610440608461045c6103c051855af16108e2573d600060003e3d6000fd5b50610da2565b60046103a05118610972576080366103e0376102a0516103205160038111612f785760051b6103e001526102e05163029b2f34610460526103e05161048052610400516104a052610420516104c052610440516104e052600061050052803b15612f7857600061046060a461047c6103c051855af161096c573d600060003e3d6000fd5b50610da2565b60056103a05118610da25760a0366103e0376102a0516103205160048111612f785760051b6103e001526102e0516384738499610480526103e0516104a052610400516104c052610420516104e05261044051610500526104605161052052600061054052803b15612f7857600061048060c461049c6103c051855af16109fe573d600060003e3d6000fd5b50610da2565b60056103605118610a8c576060366103e0376102a0516103205160028111612f785760051b6103e001526102e051632b6e993a610440526103e051610460526104005161048052610420516104a05260006104c05260016104e052803b15612f7857600061044060a461045c6103c051855af1610a86573d600060003e3d6000fd5b50610da2565b60066103605118610b465760016103805118610af8576102e051631a4d01d26103e0526102a051610400526103405180607f1c612f785761042052600061044052803b15612f785760006103e060646103fc6000855af1610af2573d600060003e3d6000fd5b50610da2565b6102e05163f1dc3cc96103e0526102a051610400526103405161042052600061044052803b15612f785760006103e060646103fc6000855af1610b40573d600060003e3d6000fd5b50610da2565b60076103605118610bb2576102e05163517a55a36103e0526102a051610400526103405180607f1c612f78576104205260006104405260016104605260206103e060846103fc6000855af1610ba0573d600060003e3d6000fd5b60203d10612f78576103e05050610da2565b60086103605118610d3c5773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102605118610bf1576020612f8a600039600051610280511815610bf4565b60005b610d02576020612f8a6000396000516102605118610c2c5773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee610280511815610c2f565b60005b610cc25760246103e0527f5377617020747970652038206973206f6e6c7920666f7220455448203c2d3e20610400527f5745544800000000000000000000000000000000000000000000000000000000610420526103e0506103e0518061040001601f826000031636823750506308c379a06103a05260206103c052601f19601f6103e05101166044016103bcfd610da2565b6102e051632e1a7d4d6103e0526102a05161040052803b15612f785760006103e060246103fc6000855af1610cfc573d600060003e3d6000fd5b50610da2565b6102e05163d0e30db06103e052803b15612f785760006103e060046103fc6102a051855af1610d36573d600060003e3d6000fd5b50610da2565b600d6103e0527f4261642073776170207479706500000000000000000000000000000000000000610400526103e0506103e0518061040001601f826000031636823750506308c379a06103a05260206103c052601f19601f6103e05101166044016103bcfd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102805118610dca57476102a052610e0b565b610280516370a082316103e052306104005260206103e060246103fc845afa610df8573d600060003e3d6000fd5b60203d10612f78576103e09050516102a0525b6102a051610e795760106103e0527f5265636569766564206e6f7468696e6700000000000000000000000000000000610400526103e0506103e0518061040001601f826000031636823750506308c379a06103a05260206103c052601f19601f6103e05101166044016103bcfd5b60056102c05118610e8b576001610ebd565b6102c0518060011b818160011c18612f7857905060018101818110612f78579050600a8111612f785760051b60400151155b15610ec757610eda565b6102805161026052600101818118610293575b50506102a05160018103818111612f785790506102a0526104a4356102a0511015610f655760086102c0527f536c6970706167650000000000000000000000000000000000000000000000006102e0526102c0506102c051806102e001601f826000031636823750506308c379a06102805260206102a052601f19601f6102c051011660440161029cfd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6102805118610fb55760006102c0526102c050600060006102c0516102e06102a051610240515af161102c573d600060003e3d6000fd61102c565b6102805163a9059cbb6102c052610240516102e0526102a0516103005260206102c060446102dc6000855af1610ff0573d600060003e3d6000fd5b3d61100757803b15612f7857600161032052611020565b60203d10612f78576102c0518060011c612f7857610320525b61032090505115612f78575b61024051337f56d0661e240dfb199ef196e16e6f42473990366314f0226ac978f7be3cd9ee836040516102c0526060516102e0526080516103005260a0516103205260c0516103405260e051610360526101005161038052610120516103a052610140516103c052610160516103e052610180516104005260a06101646104203760a06102046104c03760a06102a46105603760a06103446106003760a06103e46106a0376101a051610740526101c051610760526101e05161078052610200516107a052610220516107c052610484356107e0526102a051610800526105606102c0a360206102a06000600055f35b6381889a2c811861113c576104a43610612f785760a0366101a0376111a1565b63637653cb8118611d17576105443610612f78576104a4358060a01c612f78576101a0526104c4358060a01c612f78576101c0526104e4358060a01c612f78576101e052610504358060a01c612f785761020052610524358060a01c612f7857610220525b6004358060a01c612f78576040526024358060a01c612f78576060526044358060a01c612f78576080526064358060a01c612f785760a0526084358060a01c612f785760c05260a4358060a01c612f785760e05260c4358060a01c612f78576101005260e4358060a01c612f785761012052610104358060a01c612f785761014052610124358060a01c612f785761016052610144358060a01c612f78576101805234612f7857604051610240526000610260526104843561028052600160058101905b806102a0526102a0518060011b818160011c18612f7857905060018103818111612f78579050600a8111612f785760051b604001516102c0526102a05160018103818111612f7857905060048111612f785760051b6101a001516102e0526102a0518060011b818160011c18612f78579050600a8111612f785760051b604001516102605260a06102a05160018103818111612f7857905060048111612f78570261016401803561030052602081013561032052604081013561034052606081013561036052608081013561038052506001610340511861140b57600161036051186113b3576102c051635e0d443f6103a0526103005180607f1c612f78576103c0526103205180607f1c612f78576103e052610280516104005260206103a060646103bc845afa61139c573d600060003e3d6000fd5b60203d10612f78576103a090505161028052611c98565b6102c05163556d6e9f6103a052610300516103c052610320516103e052610280516104005260206103a060646103bc845afa6113f4573d600060003e3d6000fd5b60203d10612f78576103a090505161028052611c98565b600261034051186114e15760016103605118611489576102c0516307211ef76103a0526103005180607f1c612f78576103c0526103205180607f1c612f78576103e052610280516104005260206103a060646103bc845afa611472573d600060003e3d6000fd5b60203d10612f78576103a090505161028052611c98565b6102c0516385f11d1e6103a052610300516103c052610320516103e052610280516104005260206103a060646103bc845afa6114ca573d600060003e3d6000fd5b60203d10612f78576103a090505161028052611c98565b600361034051186115bf576001610360511861155f576102e0516307211ef76103a0526103005180607f1c612f78576103c0526103205180607f1c612f78576103e052610280516104005260206103a060646103bc845afa611548573d600060003e3d6000fd5b60203d10612f78576103a090505161028052611c98565b6102c05163e9737ee26103a0526102e0516103c052610300516103e0526103205161040052610280516104205260206103a060846103bc845afa6115a8573d600060003e3d6000fd5b60203d10612f78576103a090505161028052611c98565b61034051600481186115d25760016115d8565b60058118155b90506117e95761034051600681186115f15760016115f7565b60078118155b905061173657600861034051186116cc576020612f8a6000396000516102405118611623576001611635565b6020612f8a6000396000516102605118155b611c985760246103a0527f5377617020747970652038206973206f6e6c7920666f7220455448203c2d3e206103c0527f57455448000000000000000000000000000000000000000000000000000000006103e0526103a0506103a051806103c001601f826000031636823750506308c379a061036052602061038052601f19601f6103a051011660440161037cfd611c9856611c98565b600d6103a0527f42616420737761702074797065000000000000000000000000000000000000006103c0526103a0506103a051806103c001601f826000031636823750506308c379a061036052602061038052601f19601f6103a051011660440161037cfd611c98565b60016103605118611799576102c05163cc2b27d76103c052610280516103e0526103205180607f1c612f78576104005260206103c060446103dc845afa611782573d600060003e3d6000fd5b60203d10612f78576103c090505161028052611c98565b6102c051634fb08c5e6103c052610280516103e052610320516104005260206103c060446103dc845afa6117d2573d600060003e3d6000fd5b60203d10612f78576103c090505161028052611c98565b600161036051186118d057610140366103c037610280516103005160098111612f785760051b6103c001526020612faa6000396000516379ccdf49610500526102c0516105205261026051610540526103c051610560526103e05161058052610400516105a052610420516105c052610440516105e052610460516106005261048051610620526104a051610640526104c051610660526104e05161068052610380516106a05260016106c05260016106e05260206105006101e461051c845afa6118b9573d600060003e3d6000fd5b60203d10612f785761050090505161028052611c98565b600261038051186119ab576040366103c037610280516103005160018111612f785760051b6103c0015260026103605118611955576102c051638d8ea727610400526103c051610420526103e051610440526020610400604461041c845afa61193e573d600060003e3d6000fd5b60203d10612f785761040090505161028052611c98565b6102c05163ed8e84f3610400526103c051610420526103e051610440526001610460526020610400606461041c845afa611994573d600060003e3d6000fd5b60203d10612f785761040090505161028052611c98565b60036103805118611a96576060366103c037610280516103005160028111612f785760051b6103c0015260026103605118611a38576102c051635b6f1b5a610420526103c051610440526103e0516104605261040051610480526020610420606461043c845afa611a21573d600060003e3d6000fd5b60203d10612f785761042090505161028052611c98565b6102c051633883e119610420526103c051610440526103e05161046052610400516104805260016104a0526020610420608461043c845afa611a7f573d600060003e3d6000fd5b60203d10612f785761042090505161028052611c98565b60046103805118611b91576080366103c037610280516103005160038111612f785760051b6103c0015260026103605118611b2b576102c051631a805185610440526103c051610460526103e05161048052610400516104a052610420516104c0526020610440608461045c845afa611b14573d600060003e3d6000fd5b60203d10612f785761044090505161028052611c98565b6102c05163cf701ff7610440526103c051610460526103e05161048052610400516104a052610420516104c05260016104e052602061044060a461045c845afa611b7a573d600060003e3d6000fd5b60203d10612f785761044090505161028052611c98565b60056103805118611c985760a0366103c037610280516103005160048111612f785760051b6103c0015260026103605118611c2e576102c0516309379690610460526103c051610480526103e0516104a052610400516104c052610420516104e0526104405161050052602061046060a461047c845afa611c17573d600060003e3d6000fd5b60203d10612f785761046090505161028052611c98565b6102c051637ede89c5610460526103c051610480526103e0516104a052610400516104c052610420516104e0526104405161050052600161052052602061046060c461047c845afa611c85573d600060003e3d6000fd5b60203d10612f7857610460905051610280525b60056102a05118611caa576001611cdc565b6102a0518060011b818160011c18612f7857905060018101818110612f78579050600a8111612f785760051b60400151155b15611ce657611cf9565b6102605161024052600101818118611265575b50506102805160018103818111612f785790506102a05260206102a0f35b63c07b53538118611d38576105443610612f785761028036610240376120cf565b6381fc0ca58118611da9576105e43610612f7857610544358060a01c612f785761024052610564358060a01c612f785761026052610584358060a01c612f7857610280526105a4358060a01c612f78576102a0526105c4358060a01c612f78576102c0526101e0366102e0376120cf565b6390e7e2058118611e6a576106843610612f7857610544358060a01c612f785761024052610564358060a01c612f785761026052610584358060a01c612f7857610280526105a4358060a01c612f78576102a0526105c4358060a01c612f78576102c0526105e4358060a01c612f78576102e052610604358060a01c612f785761030052610624358060a01c612f785761032052610644358060a01c612f785761034052610664358060a01c612f78576103605261014036610380376120cf565b63d10eb3858118611f7a576107243610612f7857610544358060a01c612f785761024052610564358060a01c612f785761026052610584358060a01c612f7857610280526105a4358060a01c612f78576102a0526105c4358060a01c612f78576102c0526105e4358060a01c612f78576102e052610604358060a01c612f785761030052610624358060a01c612f785761032052610644358060a01c612f785761034052610664358060a01c612f785761036052610684358060a01c612f7857610380526106a4358060a01c612f78576103a0526106c4358060a01c612f78576103c0526106e4358060a01c612f78576103e052610704358060a01c612f78576104005260a036610420376120cf565b636d654ccd8118612f74576107c43610612f7857610544358060a01c612f785761024052610564358060a01c612f785761026052610584358060a01c612f7857610280526105a4358060a01c612f78576102a0526105c4358060a01c612f78576102c0526105e4358060a01c612f78576102e052610604358060a01c612f785761030052610624358060a01c612f785761032052610644358060a01c612f785761034052610664358060a01c612f785761036052610684358060a01c612f7857610380526106a4358060a01c612f78576103a0526106c4358060a01c612f78576103c0526106e4358060a01c612f78576103e052610704358060a01c612f785761040052610724358060a01c612f785761042052610744358060a01c612f785761044052610764358060a01c612f785761046052610784358060a01c612f7857610480526107a4358060a01c612f78576104a0525b6004358060a01c612f78576040526024358060a01c612f78576060526044358060a01c612f78576080526064358060a01c612f785760a0526084358060a01c612f785760c05260a4358060a01c612f785760e05260c4358060a01c612f78576101005260e4358060a01c612f785761012052610104358060a01c612f785761014052610124358060a01c612f785761016052610144358060a01c612f7857610180526104a4358060a01c612f78576101a0526104c4358060a01c612f78576101c0526104e4358060a01c612f78576101e052610504358060a01c612f785761020052610524358060a01c612f78576102205234612f7857610484356104c052600160058101905b806104e0526104e0518060060360068111612f7857905061050052610500518060011b818160011c18612f7857905060018103818111612f78579050600a8111612f785760051b60400151610520526105205161223257612f61565b6105005160018103818111612f785790508060011b818160011c18612f78579050600a8111612f785760051b6040015161054052610500518060011b818160011c18612f78579050600a8111612f785760051b60400151610560526105005160018103818111612f7857905060048111612f785760051b6101a00151610580526105005160018103818111612f7857905060048111612f785760051b61024001516105a0526105005160018103818111612f7857905060048111612f785760051b6102e001516105c0526105005160018103818111612f7857905060048111612f785760051b61038001516105e0526105005160018103818111612f7857905060048111612f785760051b61042001516106005260a06105005160018103818111612f7857905060048111612f7857026101640180356106205260208101356106405260408101356106605260608101356106805260808101356106a052506106a0516106c052600161066051186125a357600161068051186124bd576105a051612436576020612faa60003960005163158819d46106e05261058051610700526106205180607f1c612f7857610720526106405180607f1c612f7857610740526104c051610760526106c0516107805260206106e060a46106fc845afa61241f573d600060003e3d6000fd5b60203d10612f78576106e09050516104c052612f61565b6020612faa60003960005163571f00b56106e05261058051610700526106205180607f1c612f7857610720526106405180607f1c612f7857610740526104c051610760526106c051610780526105a0516107a05260206106e060c46106fc845afa6124a6573d600060003e3d6000fd5b60203d10612f78576106e09050516104c052612f61565b61068051600281186124d05760016124d6565b60038118155b905061253457610580516337ed3a7a6106e052610620516107005261064051610720526104c0516107405260206106e060646106fc845afa61251d573d600060003e3d6000fd5b60203d10612f78576106e09050516104c052612f61565b6020612fca60003960005163ca4bc714610700526105805161072052610620516107405261064051610760526104c051610780526106c0516107a052602061070060a461071c845afa61258c573d600060003e3d6000fd5b60203d10612f78576107009050516104c052612f61565b61066051600281186125b65760016125bc565b60038118155b9050612c9f5761066051600481186125d55760016125db565b60058118155b9050612bec5761066051600681186125f45760016125fa565b60078118155b905061273957600861066051186126cf576020612f8a6000396000516105405118612626576001612638565b6020612f8a6000396000516105605118155b612f615760246106e0527f5377617020747970652038206973206f6e6c7920666f7220455448203c2d3e20610700527f5745544800000000000000000000000000000000000000000000000000000000610720526106e0506106e0518061070001601f826000031636823750506308c379a06106a05260206106c052601f19601f6106e05101166044016106bcfd612f6156612f61565b600d6106e0527f4261642073776170207479706500000000000000000000000000000000000000610700526106e0506106e0518061070001601f826000031636823750506308c379a06106a05260206106c052601f19601f6106e05101166044016106bcfd612f61565b600161068051186128205761014036610700376104c0516106405160098111612f785760051b61070001526020612faa6000396000516379ccdf496108405261052051610860526105405161088052610700516108a052610720516108c052610740516108e052610760516109005261078051610920526107a051610940526107c051610960526107e05161098052610800516109a052610820516109c0526106c0516109e0526000610a00526001610a205260206108406101e461085c845afa612809573d600060003e3d6000fd5b60203d10612f78576108409050516104c052612f61565b60026106c051186128fb57604036610700376104c0516106405160018111612f785760051b6107000152600261068051186128a55761052051638d8ea72761074052610700516107605261072051610780526020610740604461075c845afa61288e573d600060003e3d6000fd5b60203d10612f78576107409050516104c052612f61565b6105205163ed8e84f3610740526107005161076052610720516107805260006107a0526020610740606461075c845afa6128e4573d600060003e3d6000fd5b60203d10612f78576107409050516104c052612f61565b60036106c051186129e657606036610700376104c0516106405160028111612f785760051b6107000152600261068051186129885761052051635b6f1b5a610760526107005161078052610720516107a052610740516107c0526020610760606461077c845afa612971573d600060003e3d6000fd5b60203d10612f78576107609050516104c052612f61565b61052051633883e119610760526107005161078052610720516107a052610740516107c05260006107e0526020610760608461077c845afa6129cf573d600060003e3d6000fd5b60203d10612f78576107609050516104c052612f61565b60046106c05118612ae157608036610700376104c0516106405160038111612f785760051b610700015260026106805118612a7b5761052051631a80518561078052610700516107a052610720516107c052610740516107e05261076051610800526020610780608461079c845afa612a64573d600060003e3d6000fd5b60203d10612f78576107809050516104c052612f61565b6105205163cf701ff761078052610700516107a052610720516107c052610740516107e0526107605161080052600061082052602061078060a461079c845afa612aca573d600060003e3d6000fd5b60203d10612f78576107809050516104c052612f61565b60056106c05118612f615760a036610700376104c0516106405160048111612f785760051b610700015260026106805118612b7e576105205163093796906107a052610700516107c052610720516107e05261074051610800526107605161082052610780516108405260206107a060a46107bc845afa612b67573d600060003e3d6000fd5b60203d10612f78576107a09050516104c052612f61565b61052051637ede89c56107a052610700516107c052610720516107e05261074051610800526107605161082052610780516108405260006108605260206107a060c46107bc845afa612bd5573d600060003e3d6000fd5b60203d10612f78576107a09050516104c052612f61565b60016106805118612c4f576105205163cc2b27d7610700526104c051610720526106205180607f1c612f7857610740526020610700604461071c845afa612c38573d600060003e3d6000fd5b60203d10612f78576107009050516104c052612f61565b61052051634fb08c5e610700526104c0516107205261062051610740526020610700604461071c845afa612c88573d600060003e3d6000fd5b60203d10612f78576107009050516104c052612f61565b60016106805118612dc0576105a051612d31576020612faa600039600051638fd3218f6107005261058051610720526106205180607f1c612f7857610740526106405180607f1c612f7857610760526104c051610780526106c0516107a052602061070060a461071c845afa612d1a573d600060003e3d6000fd5b60203d10612f78576107009050516104c052612f61565b6020612faa600039600051634933a8646107005261058051610720526106205180607f1c612f7857610740526106405180607f1c612f7857610760526104c051610780526106c0516107a0526105a0516107c0526105c0516107e052602061070060e461071c845afa612da9573d600060003e3d6000fd5b60203d10612f78576107009050516104c052612f61565b6105e05115612e51576020612fca600039600051635c27cc9c610700526105805161072052610620516107405261064051610760526104c051610780526105a0516107a0526105c0516107c0526105e0516107e0526106005161080052602061070061010461071c845afa612e3a573d600060003e3d6000fd5b60203d10612f78576107009050516104c052612f61565b600261058051602052600052604060002054612ee6576020612fca600039600051638ca15653610700526105805161072052610620516107405261064051610760526104c051610780526106c0516107a0526105a0516107c0526105c0516107e052602061070060e461071c845afa612ecf573d600060003e3d6000fd5b60203d10612f78576107009050516104c052612f61565b6020612fca600039600051634020784b610700526105805161072052610620516107405261064051610760526104c051610780526106c0516107a0526105a0516107c0526105c0516107e052602061070060e461071c845afa612f4e573d600060003e3d6000fd5b60203d10612f78576107009050516104c0525b6001018181186121d657505060206104c0f35b505b005b600080fda165767970657283000307000b000000000000000000000000e91d153e0b41518a2ce8dd3d7944fa863463a97d000000000000000000000000ca8d0747b5573d69653c3ac22242e6341c36e4b4000000000000000000000000a72c85c258a81761433b4e8da60505fe3dd551cc

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

000000000000000000000000e91d153e0b41518a2ce8dd3d7944fa863463a97d000000000000000000000000ca8d0747b5573d69653c3ac22242e6341c36e4b4000000000000000000000000a72c85c258a81761433b4e8da60505fe3dd551cc0000000000000000000000005633e00994896d0f472926050ecb32e38bef3e650000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _weth (address): 0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d
Arg [1] : _stable_calc (address): 0xCA8d0747B5573D69653C3aC22242e6341C36e4b4
Arg [2] : _crypto_calc (address): 0xA72C85C258A81761433B4e8da60505Fe3Dd551CC
Arg [3] : _tricrypto_meta_pools (address[2]): 0x5633E00994896D0F472926050eCb32E38bef3e65,0x0000000000000000000000000000000000000000

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000e91d153e0b41518a2ce8dd3d7944fa863463a97d
Arg [1] : 000000000000000000000000ca8d0747b5573d69653c3ac22242e6341c36e4b4
Arg [2] : 000000000000000000000000a72c85c258a81761433b4e8da60505fe3dd551cc
Arg [3] : 0000000000000000000000005633e00994896d0f472926050ecb32e38bef3e65
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000000


Block Transaction Gas Used Reward
view all blocks validated

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