Contract 0x3d8eadb739d1ef95dd53d718e4810721837c69c1 3

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xdbe15cfe9d3dd8f108e88ccf90b6fa6a43b19289cf0c6a87de765e301b5be53e0x6020611a87529212022-03-28 9:53:09186 days 5 hrs ago0x71f718d3e4d1449d1502a6a7595eb84ebccb1683 IN  Create: Vyper_contract0 ETH0.007948330633 ETH
[ Download CSV Export 
Latest 6 internal transactions
Parent Txn Hash Block From To Value
0xdbe15cfe9d3dd8f108e88ccf90b6fa6a43b19289cf0c6a87de765e301b5be53e87529212022-03-28 9:53:09186 days 5 hrs ago 0x3d8eadb739d1ef95dd53d718e4810721837c69c1 0x8b194beae1d3e0788a1a35173978001acdfba6680 ETH
0xdbe15cfe9d3dd8f108e88ccf90b6fa6a43b19289cf0c6a87de765e301b5be53e87529212022-03-28 9:53:09186 days 5 hrs ago 0x3d8eadb739d1ef95dd53d718e4810721837c69c1 0x3f770ac673856f105b586bb393d122721265ad460 ETH
0xdbe15cfe9d3dd8f108e88ccf90b6fa6a43b19289cf0c6a87de765e301b5be53e87529212022-03-28 9:53:09186 days 5 hrs ago 0x3d8eadb739d1ef95dd53d718e4810721837c69c1 0xf31e1ae27e7cd057c1d6795a5a083e0453d39b500 ETH
0xdbe15cfe9d3dd8f108e88ccf90b6fa6a43b19289cf0c6a87de765e301b5be53e87529212022-03-28 9:53:09186 days 5 hrs ago 0x3d8eadb739d1ef95dd53d718e4810721837c69c1 0x82af49447d8a07e3bd95bd0d56f35241523fbab10 ETH
0xdbe15cfe9d3dd8f108e88ccf90b6fa6a43b19289cf0c6a87de765e301b5be53e87529212022-03-28 9:53:09186 days 5 hrs ago 0x3d8eadb739d1ef95dd53d718e4810721837c69c10x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f0 ETH
0xdbe15cfe9d3dd8f108e88ccf90b6fa6a43b19289cf0c6a87de765e301b5be53e87529212022-03-28 9:53:09186 days 5 hrs ago 0x3d8eadb739d1ef95dd53d718e4810721837c69c1 0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb90 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Vyper_contract

Compiler Version
vyper:0.3.1

Optimization Enabled:
N/A

Other Settings:
, None license

Contract Source Code (Vyper language format)

# @version 0.3.1
"""
@title Zap for Curve Factory
@license MIT
@author Curve.Fi
@notice Zap for tricrypto metapools created via factory
"""


interface ERC20:  # Custom ERC20 which works for USDT, WETH, WBTC and Curve LP Tokens
    def transfer(_receiver: address, _amount: uint256): nonpayable
    def transferFrom(_sender: address, _receiver: address, _amount: uint256): nonpayable
    def approve(_spender: address, _amount: uint256): nonpayable
    def balanceOf(_owner: address) -> uint256: view


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


# CurveCryptoSwap2ETH from Crypto Factory
interface CurveMeta:
    def coins(i: uint256) -> address: view
    def token() -> address: view
    def get_dy(i: uint256, j: uint256, dx: uint256) -> uint256: view
    def calc_token_amount(amounts: uint256[N_COINS]) -> uint256: view
    def calc_withdraw_one_coin(token_amount: uint256, i: uint256) -> uint256: view
    def exchange(i: uint256, j: uint256, dx: uint256, min_dy: uint256, use_eth: bool = False, receiver: address = msg.sender) -> uint256: payable
    def add_liquidity(amounts: uint256[N_COINS], min_mint_amount: uint256, use_eth: bool = False, receiver: address = msg.sender) -> uint256: payable
    def remove_liquidity(_amount: uint256, min_amounts: uint256[2], use_eth: bool = False, receiver: address = msg.sender): nonpayable
    def remove_liquidity_one_coin(token_amount: uint256, i: uint256, min_amount: uint256, use_eth: bool = False, receiver: address = msg.sender) -> uint256: nonpayable


# TriCrypto pool
interface CurveBase:
    def coins(i: uint256) -> address: view
    def token() -> address: view
    def get_dy(i: uint256, j: uint256, dx: uint256) -> uint256: view
    def calc_token_amount(amounts: uint256[BASE_N_COINS], deposit: bool) -> uint256: view
    def calc_withdraw_one_coin(token_amount: uint256, i: uint256) -> uint256: view
    def exchange(i: uint256, j: uint256, dx: uint256, min_dy: uint256): payable
    def add_liquidity(amounts: uint256[BASE_N_COINS], min_mint_amount: uint256): payable
    def remove_liquidity(_amount: uint256, min_amounts: uint256[BASE_N_COINS]): nonpayable
    def remove_liquidity_one_coin(token_amount: uint256, i: uint256, min_amount: uint256): nonpayable


N_COINS: constant(int128) = 2
MAX_COIN: constant(int128) = N_COINS - 1
BASE_N_COINS: constant(int128) = 3
N_ALL_COINS: constant(int128) = N_COINS + BASE_N_COINS - 1

WETH: immutable(address)

BASE_POOL: immutable(address)
BASE_LP_TOKEN: immutable(address)
BASE_COINS: immutable(address[BASE_N_COINS])
# coin -> pool -> is approved to transfer?
is_approved: HashMap[address, HashMap[address, bool]]


@external
def __init__(_base_pool: address, _base_lp_token: address, _weth: address, _base_coins: address[BASE_N_COINS]):
    """
    @notice Contract constructor
    """
    BASE_POOL = _base_pool
    BASE_LP_TOKEN = _base_lp_token
    BASE_COINS = _base_coins
    WETH = _weth

    for coin in _base_coins:
        ERC20(coin).approve(_base_pool, MAX_UINT256)
        self.is_approved[coin][_base_pool] = True


@payable
@external
def __default__():
    assert msg.sender.is_contract  # dev: receive only from pools and WETH


@internal
def _receive(_coin: address, _amount: uint256, _from: address,
             _eth_value: uint256, _use_eth: bool, _wrap_eth: bool=False) -> uint256:
    """
    Transfer coin to zap
    @param _coin Address of the coin
    @param _amount Amount of coin
    @param _from Sender of the coin
    @param _eth_value Eth value sent
    @param _use_eth Use raw ETH
    @param _wrap_eth Wrap raw ETH
    @return Received ETH amount
    """
    if _use_eth and _coin == WETH:
        assert _eth_value == _amount  # dev: incorrect ETH amount
        if _wrap_eth:
            wETH(WETH).deposit(value=_amount)
        else:
            return _amount
    else:
        response: Bytes[32] = raw_call(
            _coin,
            _abi_encode(
                _from,
                self,
                _amount,
                method_id=method_id("transferFrom(address,address,uint256)"),
            ),
            max_outsize=32,
        )
        if len(response) != 0:
            assert convert(response, bool)  # dev: failed transfer
    return 0


@internal
def _send(_coin: address, _to: address, _use_eth: bool, _withdraw_eth: bool=False) -> uint256:
    """
    Send coin from zap
    @dev Sends all available amount
    @param _coin Address of the coin
    @param _to Sender of the coin
    @param _use_eth Use raw ETH
    @param _withdraw_eth Withdraw raw ETH from wETH
    @return Amount of coin sent
    """
    amount: uint256 = 0
    if _use_eth and _coin == WETH:
        if _withdraw_eth:
            amount = ERC20(_coin).balanceOf(self)
            wETH(WETH).withdraw(amount)
        amount = self.balance
        raw_call(_to, b"", value=amount)
    else:
        amount = ERC20(_coin).balanceOf(self)
        response: Bytes[32] = raw_call(
            _coin,
            _abi_encode(_to, amount, method_id=method_id("transfer(address,uint256)")),
            max_outsize=32,
        )
        if len(response) != 0:
            assert convert(response, bool)  # dev: failed transfer
    return amount


@payable
@external
def exchange(_pool: address, i: uint256, j: uint256, _dx: uint256, _min_dy: uint256,
             _use_eth: bool = False, _receiver: address = msg.sender) -> uint256:
    """
    @notice Exchange using wETH by default
    @dev Index values can be found via the `coins` public getter method
    @param _pool Address of the pool for the exchange
    @param i Index value for the coin to send
    @param j Index value of the coin to receive
    @param _dx Amount of `i` being exchanged
    @param _min_dy Minimum amount of `j` to receive
    @param _use_eth Use raw ETH
    @param _receiver Address that will receive `j`
    @return Actual amount of `j` received
    """
    assert i != j  # dev: indexes are similar
    if not _use_eth:
        assert msg.value == 0  # dev: nonzero ETH amount

    base_coins: address[BASE_N_COINS] = BASE_COINS
    if i < MAX_COIN:  # Swap to LP token and remove from base
        # Receive and swap to LP Token
        coin: address = CurveMeta(_pool).coins(i)
        eth_amount: uint256 = self._receive(coin, _dx, msg.sender, msg.value, _use_eth)
        if not self.is_approved[coin][_pool]:
            ERC20(coin).approve(_pool, MAX_UINT256)
            self.is_approved[coin][_pool] = True
        lp_amount: uint256 = CurveMeta(_pool).exchange(i, MAX_COIN, _dx, 0, _use_eth, value=eth_amount)

        # Remove and send to _receiver
        CurveBase(BASE_POOL).remove_liquidity_one_coin(lp_amount, j - MAX_COIN, _min_dy)

        coin = base_coins[j - MAX_COIN]
        return self._send(coin, _receiver, _use_eth, True)

    # Receive coin i
    base_i: uint256 = i - MAX_COIN
    self._receive(base_coins[base_i], _dx, msg.sender, msg.value, _use_eth, True)

    # Add in base and exchange LP token
    if j < MAX_COIN:
        amounts: uint256[BASE_N_COINS] = empty(uint256[BASE_N_COINS])
        amounts[base_i] = _dx

        CurveBase(BASE_POOL).add_liquidity(amounts, 0)

        if not self.is_approved[BASE_LP_TOKEN][_pool]:
            ERC20(BASE_LP_TOKEN).approve(_pool, MAX_UINT256)
            self.is_approved[BASE_LP_TOKEN][_pool] = True

        lp_amount: uint256 = ERC20(BASE_LP_TOKEN).balanceOf(self)
        return CurveMeta(_pool).exchange(MAX_COIN, j, lp_amount, _min_dy, _use_eth, _receiver)

    base_j: uint256 = j - MAX_COIN

    CurveBase(BASE_POOL).exchange(base_i, base_j, _dx, _min_dy)

    coin: address = base_coins[base_j]
    return self._send(coin, _receiver, _use_eth, True)


@view
@external
def get_dy(_pool: address, i: uint256, j: uint256, _dx: uint256) -> uint256:
    """
    @notice Calculate the amount received in exchange
    @dev Index values can be found via the `coins` public getter method
    @param _pool Address of the pool for the exchange
    @param i Index value for the coin to send
    @param j Index value of the coin to receive
    @param _dx Amount of `i` being exchanged
    @return Expected amount of `j` to receive
    """
    assert i != j  # dev: indexes are similar

    if i < MAX_COIN:  # Swap to LP token and remove from base
        lp_amount: uint256 = CurveMeta(_pool).get_dy(i, MAX_COIN, _dx)

        return CurveBase(BASE_POOL).calc_withdraw_one_coin(lp_amount, j - MAX_COIN)

    # Add in base and exchange LP token
    if j < MAX_COIN:
        amounts: uint256[BASE_N_COINS] = empty(uint256[BASE_N_COINS])
        amounts[i - MAX_COIN] = _dx
        lp_amount: uint256 = CurveBase(BASE_POOL).calc_token_amount(amounts, True)

        return CurveMeta(_pool).get_dy(MAX_COIN, j, lp_amount)

    # Exchange in base
    return CurveBase(BASE_POOL).get_dy(i - MAX_COIN, j - MAX_COIN, _dx)


@payable
@external
def add_liquidity(
    _pool: address,
    _deposit_amounts: uint256[N_ALL_COINS],
    _min_mint_amount: uint256,
    _use_eth: bool = False,
    _receiver: address = msg.sender,
) -> uint256:
    """
    @notice Deposit tokens to base and meta pools
    @param _pool Address of the metapool to deposit into
    @param _deposit_amounts List of amounts of underlying coins to deposit
    @param _min_mint_amount Minimum amount of LP tokens to mint from the deposit
    @param _use_eth Use raw ETH
    @param _receiver Address that receives the LP tokens
    @return Amount of LP tokens received by depositing
    """
    if not _use_eth:
        assert msg.value == 0  # dev: nonzero ETH amount
    meta_amounts: uint256[N_COINS] = empty(uint256[N_COINS])
    base_amounts: uint256[BASE_N_COINS] = empty(uint256[BASE_N_COINS])
    deposit_base: bool = False
    base_coins: address[BASE_N_COINS] = BASE_COINS
    eth_amount: uint256 = 0

    if _deposit_amounts[0] != 0:
        coin: address = CurveMeta(_pool).coins(0)
        eth_amount = self._receive(coin, _deposit_amounts[0], msg.sender, msg.value, _use_eth)
        if not self.is_approved[coin][_pool]:
            ERC20(coin).approve(_pool, MAX_UINT256)
            self.is_approved[coin][_pool] = True
        meta_amounts[0] = _deposit_amounts[0]

    for i in range(MAX_COIN, N_ALL_COINS):
        amount: uint256 = _deposit_amounts[i]
        if amount == 0:
            continue
        deposit_base = True

        base_idx: uint256 = i - MAX_COIN

        coin: address = base_coins[base_idx]
        self._receive(coin, amount, msg.sender, msg.value, _use_eth, True)
        base_amounts[base_idx] = amount

    # Deposit to the base pool
    if deposit_base:
        CurveBase(BASE_POOL).add_liquidity(base_amounts, 0)
        coin: address = BASE_LP_TOKEN
        meta_amounts[MAX_COIN] = ERC20(coin).balanceOf(self)
        if not self.is_approved[coin][_pool]:
            ERC20(coin).approve(_pool, MAX_UINT256)
            self.is_approved[coin][_pool] = True

    # Deposit to the meta pool
    return CurveMeta(_pool).add_liquidity(meta_amounts, _min_mint_amount, _use_eth, _receiver, value=eth_amount)


@view
@external
def calc_token_amount(_pool: address, _amounts: uint256[N_ALL_COINS]) -> uint256:
    """
    @notice Calculate addition or reduction in token supply from a deposit or withdrawal
    @dev This calculation accounts for slippage, but not fees.
         Needed to prevent front-running, not for precise calculations!
    @param _pool Address of the pool to deposit into
    @param _amounts Amount of each underlying coin being deposited
    @return Expected amount of LP tokens received
    """
    meta_amounts: uint256[N_COINS] = empty(uint256[N_COINS])
    base_amounts: uint256[BASE_N_COINS] = empty(uint256[BASE_N_COINS])
    deposit_base: bool = False

    meta_amounts[0] = _amounts[0]
    for i in range(BASE_N_COINS):
        base_amounts[i] = _amounts[i + MAX_COIN]
        if base_amounts[i] > 0:
            deposit_base = True

    if deposit_base:
        base_tokens: uint256 = CurveBase(BASE_POOL).calc_token_amount(base_amounts, True)
        meta_amounts[MAX_COIN] = base_tokens

    return CurveMeta(_pool).calc_token_amount(meta_amounts)


@external
def remove_liquidity(
    _pool: address,
    _burn_amount: uint256,
    _min_amounts: uint256[N_ALL_COINS],
    _use_eth: bool = False,
    _receiver: address = msg.sender,
) -> uint256[N_ALL_COINS]:
    """
    @notice Withdraw and unwrap coins from the pool
    @dev Withdrawal amounts are based on current deposit ratios
    @param _pool Address of the pool to withdraw from
    @param _burn_amount Quantity of LP tokens to burn in the withdrawal
    @param _min_amounts Minimum amounts of underlying coins to receive
    @param _use_eth Use raw ETH
    @param _receiver Address that receives the LP tokens
    @return List of amounts of underlying coins that were withdrawn
    """
    lp_token: address = CurveMeta(_pool).token()
    ERC20(lp_token).transferFrom(msg.sender, self, _burn_amount)

    min_amounts_base: uint256[BASE_N_COINS] = empty(uint256[BASE_N_COINS])
    amounts: uint256[N_ALL_COINS] = empty(uint256[N_ALL_COINS])

    # Withdraw from meta
    CurveMeta(_pool).remove_liquidity(
        _burn_amount,
        [_min_amounts[0], 0],
        _use_eth,
    )
    lp_amount: uint256 = ERC20(BASE_LP_TOKEN).balanceOf(self)

    # Withdraw from base
    for i in range(BASE_N_COINS):
        min_amounts_base[i] = _min_amounts[MAX_COIN + i]
    CurveBase(BASE_POOL).remove_liquidity(lp_amount, min_amounts_base)

    # Transfer all coins out
    coin: address = CurveMeta(_pool).coins(0)
    amounts[0] = self._send(coin, _receiver, _use_eth)

    base_coins: address[BASE_N_COINS] = BASE_COINS
    for i in range(MAX_COIN, N_ALL_COINS):
        coin = base_coins[i - MAX_COIN]
        amounts[i] = self._send(coin, _receiver, _use_eth, True)

    return amounts


@external
def remove_liquidity_one_coin(
    _pool: address,
    _burn_amount: uint256,
    i: uint256,
    _min_amount: uint256,
    _use_eth: bool = False,
    _receiver: address=msg.sender
) -> uint256:
    """
    @notice Withdraw and unwrap a single coin from the pool
    @param _pool Address of the pool to withdraw from
    @param _burn_amount Amount of LP tokens to burn in the withdrawal
    @param i Index value of the coin to withdraw
    @param _min_amount Minimum amount of underlying coin to receive
    @param _use_eth Use raw ETH
    @param _receiver Address that receives the LP tokens
    @return Amount of underlying coin received
    """
    lp_token: address = CurveMeta(_pool).token()
    ERC20(lp_token).transferFrom(msg.sender, self, _burn_amount)

    if i < MAX_COIN:
        return CurveMeta(_pool).remove_liquidity_one_coin(_burn_amount, i, _min_amount, _use_eth, _receiver)

    # Withdraw a base pool coin
    coin_amount: uint256 = CurveMeta(_pool).remove_liquidity_one_coin(_burn_amount, MAX_COIN, 0)

    CurveBase(BASE_POOL).remove_liquidity_one_coin(coin_amount, i - MAX_COIN, _min_amount)

    coin: address = BASE_COINS[i - MAX_COIN]
    return self._send(coin, _receiver, _use_eth, True)


@view
@external
def calc_withdraw_one_coin(_pool: address, _token_amount: uint256, i: uint256) -> uint256:
    """
    @notice Calculate the amount received when withdrawing and unwrapping a single coin
    @param _pool Address of the pool to withdraw from
    @param _token_amount Amount of LP tokens to burn in the withdrawal
    @param i Index value of the underlying coin to withdraw
    @return Amount of coin received
    """
    if i < MAX_COIN:
        return CurveMeta(_pool).calc_withdraw_one_coin(_token_amount, i)

    _base_tokens: uint256 = CurveMeta(_pool).calc_withdraw_one_coin(_token_amount, MAX_COIN)

    return CurveBase(BASE_POOL).calc_withdraw_one_coin(_base_tokens, i - MAX_COIN)

Contract ABI

[{"stateMutability":"nonpayable","type":"constructor","inputs":[{"name":"_base_pool","type":"address"},{"name":"_base_lp_token","type":"address"},{"name":"_weth","type":"address"},{"name":"_base_coins","type":"address[3]"}],"outputs":[]},{"stateMutability":"payable","type":"fallback"},{"stateMutability":"payable","type":"function","name":"exchange","inputs":[{"name":"_pool","type":"address"},{"name":"i","type":"uint256"},{"name":"j","type":"uint256"},{"name":"_dx","type":"uint256"},{"name":"_min_dy","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"payable","type":"function","name":"exchange","inputs":[{"name":"_pool","type":"address"},{"name":"i","type":"uint256"},{"name":"j","type":"uint256"},{"name":"_dx","type":"uint256"},{"name":"_min_dy","type":"uint256"},{"name":"_use_eth","type":"bool"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"payable","type":"function","name":"exchange","inputs":[{"name":"_pool","type":"address"},{"name":"i","type":"uint256"},{"name":"j","type":"uint256"},{"name":"_dx","type":"uint256"},{"name":"_min_dy","type":"uint256"},{"name":"_use_eth","type":"bool"},{"name":"_receiver","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"get_dy","inputs":[{"name":"_pool","type":"address"},{"name":"i","type":"uint256"},{"name":"j","type":"uint256"},{"name":"_dx","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"payable","type":"function","name":"add_liquidity","inputs":[{"name":"_pool","type":"address"},{"name":"_deposit_amounts","type":"uint256[4]"},{"name":"_min_mint_amount","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"payable","type":"function","name":"add_liquidity","inputs":[{"name":"_pool","type":"address"},{"name":"_deposit_amounts","type":"uint256[4]"},{"name":"_min_mint_amount","type":"uint256"},{"name":"_use_eth","type":"bool"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"payable","type":"function","name":"add_liquidity","inputs":[{"name":"_pool","type":"address"},{"name":"_deposit_amounts","type":"uint256[4]"},{"name":"_min_mint_amount","type":"uint256"},{"name":"_use_eth","type":"bool"},{"name":"_receiver","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"calc_token_amount","inputs":[{"name":"_pool","type":"address"},{"name":"_amounts","type":"uint256[4]"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity","inputs":[{"name":"_pool","type":"address"},{"name":"_burn_amount","type":"uint256"},{"name":"_min_amounts","type":"uint256[4]"}],"outputs":[{"name":"","type":"uint256[4]"}]},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity","inputs":[{"name":"_pool","type":"address"},{"name":"_burn_amount","type":"uint256"},{"name":"_min_amounts","type":"uint256[4]"},{"name":"_use_eth","type":"bool"}],"outputs":[{"name":"","type":"uint256[4]"}]},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity","inputs":[{"name":"_pool","type":"address"},{"name":"_burn_amount","type":"uint256"},{"name":"_min_amounts","type":"uint256[4]"},{"name":"_use_eth","type":"bool"},{"name":"_receiver","type":"address"}],"outputs":[{"name":"","type":"uint256[4]"}]},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity_one_coin","inputs":[{"name":"_pool","type":"address"},{"name":"_burn_amount","type":"uint256"},{"name":"i","type":"uint256"},{"name":"_min_amount","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity_one_coin","inputs":[{"name":"_pool","type":"address"},{"name":"_burn_amount","type":"uint256"},{"name":"i","type":"uint256"},{"name":"_min_amount","type":"uint256"},{"name":"_use_eth","type":"bool"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity_one_coin","inputs":[{"name":"_pool","type":"address"},{"name":"_burn_amount","type":"uint256"},{"name":"i","type":"uint256"},{"name":"_min_amount","type":"uint256"},{"name":"_use_eth","type":"bool"},{"name":"_receiver","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"calc_withdraw_one_coin","inputs":[{"name":"_pool","type":"address"},{"name":"_token_amount","type":"uint256"},{"name":"i","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]}]

6020611afa6080396080518060a01c611af55760e05260206020611afa016080396080518060a01c611af5576101005260206040611afa016080396080518060a01c611af557610120526060611afa016020816080396080518060a01c611af557610140526020602082016080396080518060a01c611af557610160526020604082016080396080518060a01c611af557610180525060e0516101a052610100516101c052610140516101e05261016051610200526101805161022052610120516102405261028060006003818352015b6020610280510261014001516102605263095ea7b36102a05260e0516102c0527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6102e052610260513b15611af5576000600060446102bc6000610260515af161013f573d600060003e3d6000fd5b600160006102605160a052608052604060802060e05160a05260805260406080205581516001018083528114156100d0575050611a9b56600436101561000d57611604565b60046000601c376000516364a1455881186100325760006102e0523361030052610080565b632bf78c6181186100565760a4358060011c61191f576102e0523361030052610080565b63b837cc69811861066a5760a4358060011c61191f576102e05260c4358060a01c61191f57610300525b6004358060a01c61191f576102c0526044356024351461191f576102e0516100a8573461191f575b6060380360208160803960805161032052602081602001608039608051610340526020816040016080396080516103605250600160243510156103395763c66106576103a0526024356103c05260206103a060246103bc6102c0515afa610114573d600060003e3d6000fd5b601f3d111561191f576103a0518060a01c61191f57610380526103805160e05260643561010052336101205234610140526102e0516101605260006101805261015e6103c0611610565b6103c0516103a05260006103805160a05260805260406080206102c05160a05260805260406080205461020f5763095ea7b36103c0526102c0516103e0527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61040052610380513b1561191f576000600060446103dc6000610380515af16101eb573d600060003e3d6000fd5b600160006103805160a05260805260406080206102c05160a0526080526040608020555b63394747c56103e05260243561040052600161042052606435610440526000610460526102e0516104805260206103e060a46103fc6103a0516102c0515af161025d573d600060003e3d6000fd5b601f3d111561191f576103e0516103c05263f1dc3cc96103e0526103c05161040052604435600180821061191f57808203905090506104205260843561044052602060a038036080396080513b1561191f576000600060646103fc6000602060a038036080396080515af16102d7573d600060003e3d6000fd5b610320604435600180821061191f5780820390509050600381101561191f576020020151610380526103805160e05261030051610100526102e051610120526001610140526103276103e061174b565b6103e051610400526020610400610668565b602435600180821061191f57808203905090506103805261032061038051600381101561191f57602002015160e05260643561010052336101205234610140526102e051610160526001610180526103926103a0611610565b6103a050600160443510156105a1576060366103a0376064356103a061038051600381101561191f576020020152634515cef3610400526103a051610420526103c051610440526103e05161046052600061048052602060a038036080396080513b1561191f5760006000608461041c6000602060a038036080396080515af1610421573d600060003e3d6000fd5b600060206080380360803960805160a05260805260406080206102c05160a0526080526040608020546104ea5763095ea7b3610400526102c051610420527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610440526020608038036080396080513b1561191f5760006000604461041c60006020608038036080396080515af16104be573d600060003e3d6000fd5b6001600060206080380360803960805160a05260805260406080206102c05160a0526080526040608020555b6370a082316104205230610440526020610420602461043c6020608038036080396080515afa61051f573d600060003e3d6000fd5b601f3d111561191f57610420516104005263ce7d6503610420526001610440526044356104605261040051610480526084356104a0526102e0516104c052610300516104e052602061042060c461043c60006102c0515af1610586573d600060003e3d6000fd5b601f3d111561191f5761042051610500526020610500610668565b604435600180821061191f57808203905090506103a052635b41b9086103c052610380516103e0526103a051610400526064356104205260843561044052602060a038036080396080513b1561191f576000600060846103dc6000602060a038036080396080515af1610619573d600060003e3d6000fd5b6103206103a051600381101561191f5760200201516103c0526103c05160e05261030051610100526102e0516101205260016101405261065a6103e061174b565b6103e0516104005260206104005bf35b63384e03db81186106855760006102e05233610300526106d3565b63c45d79e981186106a95760c4358060011c61191f576102e05233610300526106d3565b63968fe83b8118610af65760c4358060011c61191f576102e05260e4358060a01c61191f57610300525b6004358060a01c61191f576102c0526102e0516106f0573461191f575b60c03661032037606038036020816080396080516103e05260208160200160803960805161040052602081604001608039608051610420525060006104405260006024351461086a5763c66106576104805260006104a0526020610480602461049c6102c0515afa610767573d600060003e3d6000fd5b601f3d111561191f57610480518060a01c61191f57610460526104605160e05260243561010052336101205234610140526102e051610160526000610180526107b1610480611610565b610480516104405260006104605160a05260805260406080206102c05160a0526080526040608020546108625763095ea7b3610480526102c0516104a0527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6104c052610460513b1561191f5760006000604461049c6000610460515af161083e573d600060003e3d6000fd5b600160006104605160a05260805260406080206102c05160a0526080526040608020555b602435610320525b61046060016003818352015b6020610460510260240135610480526104805161089257610919565b60016103c05261046051600180821061191f57808203905090506104a0526103e06104a051600381101561191f5760200201516104c0526104c05160e0526104805161010052336101205234610140526102e051610160526001610180526108fb6104e0611610565b6104e050610480516103606104a051600381101561191f5760200201525b81516001018083528114156108765750506103c05115610a8b57634515cef3610460526103605161048052610380516104a0526103a0516104c05260006104e052602060a038036080396080513b1561191f5760006000608461047c6000602060a038036080396080515af1610994573d600060003e3d6000fd5b602060803803608039608051610460526370a0823161048052306104a0526020610480602461049c610460515afa6109d1573d600060003e3d6000fd5b601f3d111561191f57610480516103405260006104605160a05260805260406080206102c05160a052608052604060802054610a8b5763095ea7b3610480526102c0516104a0527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6104c052610460513b1561191f5760006000604461049c6000610460515af1610a67573d600060003e3d6000fd5b600160006104605160a05260805260406080206102c05160a0526080526040608020555b637328333b610460526103205161048052610340516104a05260a4356104c0526102e0516104e0526103005161050052602061046060a461047c610440516102c0515af1610ade573d600060003e3d6000fd5b601f3d111561191f5761046051610520526020610520f35b63e9737ee28118610d4d576004358060a01c61191f5760e0523461191f576044356024351461191f5760016024351015610be05763556d6e9f6101205260243561014052600161016052606435610180526020610120606461013c60e0515afa610b65573d600060003e3d6000fd5b601f3d111561191f576101205161010052634fb08c5e610120526101005161014052604435600180821061191f5780820390509050610160526020610120604461013c602060a038036080396080515afa610bc5573d600060003e3d6000fd5b601f3d111561191f5761012051610180526020610180610d4b565b60016044351015610ccf5760603661010037606435610100602435600180821061191f5780820390509050600381101561191f576020020152633883e11961018052610100516101a052610120516101c052610140516101e0526001610200526020610180608461019c602060a038036080396080515afa610c67573d600060003e3d6000fd5b601f3d111561191f57610180516101605263556d6e9f6101805260016101a0526044356101c052610160516101e0526020610180606461019c60e0515afa610cb4573d600060003e3d6000fd5b601f3d111561191f5761018051610200526020610200610d4b565b63556d6e9f61010052602435600180821061191f578082039050905061012052604435600180821061191f578082039050905061014052606435610160526020610100606461011c602060a038036080396080515afa610d34573d600060003e3d6000fd5b601f3d111561191f57610100516101805260206101805bf35b63a658d0648118610eac576004358060a01c61191f5760e0523461191f5760c03661010037602435610100526101c060006003818352015b60206101c0516001818183011061191f578082019050905002602401356101406101c051600381101561191f57602002015260006101406101c051600381101561191f5760200201511115610ddb5760016101a0525b8151600101808352811415610d855750506101a05115610e5d57633883e1196101e05261014051610200526101605161022052610180516102405260016102605260206101e060846101fc602060a038036080396080515afa610e43573d600060003e3d6000fd5b601f3d111561191f576101e0516101c0526101c051610120525b638d8ea7276101c052610100516101e052610120516102005260206101c060446101dc60e0515afa610e94573d600060003e3d6000fd5b601f3d111561191f576101c051610220526020610220f35b63ad5cc9188118610ec75760006102a052336102c052610f15565b6352e151b08118610eeb5760c4358060011c61191f576102a052336102c052610f15565b63e0b4940581186112535760c4358060011c61191f576102a05260e4358060a01c61191f576102c0525b6004358060a01c61191f57610280523461191f5763fc0c546a610300526020610300600461031c610280515afa610f51573d600060003e3d6000fd5b601f3d111561191f57610300518060a01c61191f576102e0526323b872dd6103005233610320523061034052602435610360526102e0513b1561191f5760006000606461031c60006102e0515af1610fae573d600060003e3d6000fd5b60e0366103003763269b55816103e05260243561040052604435610420526000610440526102a05161046052610280513b1561191f576000600060846103fc6000610280515af1611004573d600060003e3d6000fd5b6370a082316104005230610420526020610400602461041c6020608038036080396080515afa611039573d600060003e3d6000fd5b601f3d111561191f57610400516103e05261040060006003818352015b6020600161040051818183011061191f5780820190509050026044013561030061040051600381101561191f576020020152815160010180835281141561105657505063ecb586a5610400526103e05161042052610300516104405261032051610460526103405161048052602060a038036080396080513b1561191f5760006000608461041c6000602060a038036080396080515af16110fc573d600060003e3d6000fd5b63c6610657610420526000610440526020610420602461043c610280515afa61112a573d600060003e3d6000fd5b601f3d111561191f57610420518060a01c61191f57610400526104005160e0526102c051610100526102a0516101205260006101405261116b61042061174b565b6104205161036052606038036020816080396080516104205260208160200160803960805161044052602081604001608039608051610460525061048060016003818352015b61042061048051600180821061191f5780820390509050600381101561191f576020020151610400526104005160e0526102c051610100526102a051610120526001610140526112026104a061174b565b6104a05161036061048051600481101561191f57602002015281516001018083528114156111b15750506103605161048052610380516104a0526103a0516104c0526103c0516104e0526080610480f35b63c5bdcd09811861126e5760006102a052336102c0526112bc565b63d69435258118611292576084358060011c61191f576102a052336102c0526112bc565b630664b69381186114dc576084358060011c61191f576102a05260a4358060a01c61191f576102c0525b6004358060a01c61191f57610280523461191f5763fc0c546a610300526020610300600461031c610280515afa6112f8573d600060003e3d6000fd5b601f3d111561191f57610300518060a01c61191f576102e0526323b872dd6103005233610320523061034052602435610360526102e0513b1561191f5760006000606461031c60006102e0515af1611355573d600060003e3d6000fd5b600160443510156113bd576307329bcd6103005260606024610320376102a051610380526102c0516103a052602061030060a461031c6000610280515af16113a2573d600060003e3d6000fd5b601f3d111561191f57610300516103c05260206103c06114da565b63f1dc3cc961032052602435610340526001610360526000610380526020610320606461033c6000610280515af16113fa573d600060003e3d6000fd5b601f3d111561191f57610320516103005263f1dc3cc9610320526103005161034052604435600180821061191f57808203905090506103605260643561038052602060a038036080396080513b1561191f5760006000606461033c6000602060a038036080396080515af1611474573d600060003e3d6000fd5b602060603803604435600180821061191f5780820390509050600381101561191f5760200201608039608051610320526103205160e0526102c051610100526102a051610120526001610140526114cc61034061174b565b610340516103605260206103605bf35b639aed0eea8118611602576004358060a01c61191f5760e0523461191f576001604435101561155557634fb08c5e6101005260243561012052604435610140526020610100604461011c60e0515afa61153a573d600060003e3d6000fd5b601f3d111561191f5761010051610160526020610160611600565b634fb08c5e61012052602435610140526001610160526020610120604461013c60e0515afa611589573d600060003e3d6000fd5b601f3d111561191f576101205161010052634fb08c5e610120526101005161014052604435600180821061191f5780820390509050610160526020610120604461013c602060a038036080396080515afa6115e9573d600060003e3d6000fd5b601f3d111561191f57610120516101805260206101805bf35b505b6000333b111561191f57005b6101605161161f576000611630565b602060c0380360803960805160e051145b6116d9576323b872dd6101e45260046101205161020452306102245261010051610244526060016101e0526101e05060206102a06101e051610200600060e0515af1611681573d600060003e3d6000fd5b61028060203d8082116116945781611696565b805b9050905081528051602001806101a0828460045afa9050505060006101a05114611743576101c0516101a05181816020036008021c905090501561191f57611743565b61010051610140511861191f57610180516116fe576101005181525061174956611743565b63d0e30db06101a052602060c038036080396080513b1561191f576000600060046101bc61010051602060c038036080396080515af1611743573d600060003e3d6000fd5b60008152505b565b60006101605261012051611760576000611771565b602060c0380360803960805160e051145b611852576370a0823161018052306101a0526020610180602461019c60e0515afa6117a1573d600060003e3d6000fd5b601f3d111561191f57610180516101605263a9059cbb6101c4526004610100516101e45261016051610204526040016101c0526101c05060206102606101c0516101e0600060e0515af16117fa573d600060003e3d6000fd5b61024060203d80821161180d578161180f565b805b905090508152805160200180610180828460045afa9050505060006101805114611916576101a0516101805181816020036008021c905090501561191f57611916565b61014051156118e3576370a0823161018052306101a0526020610180602461019c60e0515afa611887573d600060003e3d6000fd5b601f3d111561191f576101805161016052632e1a7d4d61018052610160516101a052602060c038036080396080513b1561191f5760006000602461019c6000602060c038036080396080515af16118e3573d600060003e3d6000fd5b47610160526000610180526101805060006000610180516101a061016051610100515af1611916573d600060003e3d6000fd5b61016051815250565b600080fd5b610177611a9b0361017761026039610177611a9b036101a0518161028001526101c051816102a00152806102c0016101e051815261020051816020015261022051816040015250610240518161026001528060c001610260f35b600080fd000000000000000000000000960ea3e3c7fb317332d990873d354e18d76455900000000000000000000000008e0b8c8bb9db49a46697f3a5bb8a308e744821d200000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1000000000000000000000000fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb90000000000000000000000002f2a2543b76a4166549f7aab2e75bef0aefc5b0f00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1

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

000000000000000000000000960ea3e3c7fb317332d990873d354e18d76455900000000000000000000000008e0b8c8bb9db49a46697f3a5bb8a308e744821d200000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1000000000000000000000000fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb90000000000000000000000002f2a2543b76a4166549f7aab2e75bef0aefc5b0f00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1

-----Decoded View---------------
Arg [0] : _base_pool (address): 0x960ea3e3c7fb317332d990873d354e18d7645590
Arg [1] : _base_lp_token (address): 0x8e0b8c8bb9db49a46697f3a5bb8a308e744821d2
Arg [2] : _weth (address): 0x82af49447d8a07e3bd95bd0d56f35241523fbab1
Arg [3] : _base_coins (address[3]): 0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9,0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f,0x82af49447d8a07e3bd95bd0d56f35241523fbab1

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 000000000000000000000000960ea3e3c7fb317332d990873d354e18d7645590
Arg [1] : 0000000000000000000000008e0b8c8bb9db49a46697f3a5bb8a308e744821d2
Arg [2] : 00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1
Arg [3] : 000000000000000000000000fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9
Arg [4] : 0000000000000000000000002f2a2543b76a4166549f7aab2e75bef0aefc5b0f
Arg [5] : 00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.