Contract 0x7544fe3d184b6b55d6b36c3fca1157ee0ba30287 1

 
Txn Hash
Block
From
To
Value [Txn Fee]
0x711d77ae3fd9c55f4fdb39f2b2f328e70cf3cd7c7a78470b1dcd2ceae3fe5bb823790832021-10-19 22:01:121 min ago0xb9fdbfb51ee876c0d38f12f18210e128b347b8e1 IN  0x7544fe3d184b6b55d6b36c3fca1157ee0ba302870 ETH0.000746253694 ETH
0x37266adff7a3926c3210ccc24ebabadb6f40fd68cbc03429dba0febc3edc60f023784312021-10-19 21:22:1240 mins ago0x1bb0aabee48cbd8e54811a27016db586a4027375 IN  0x7544fe3d184b6b55d6b36c3fca1157ee0ba302870 ETH0.00055809546 ETH
0x13f99ea04395d6b4ba7ecbe117d54014c833ff27234bd116d7b9b72d0a43aa2923784102021-10-19 21:20:3441 mins ago0xaf6d993795b3d91e881b2ee0ff263bc7047a8a2a IN  0x7544fe3d184b6b55d6b36c3fca1157ee0ba302870 ETH0.000879438149 ETH
0xa6ed66e79b824cd38f95f6258ddb52477a3f273e2907c3aa763ab8b86a7dd5fd23784092021-10-19 21:20:3441 mins ago0x1bb0aabee48cbd8e54811a27016db586a4027375 IN  0x7544fe3d184b6b55d6b36c3fca1157ee0ba302870 ETH0.000751247575 ETH
0xb1f7d2d56833b53e6fd359ce2e099a58be4061602fdfe85c8003cdf122ae4f6723784082021-10-19 21:20:3441 mins ago0xeb14d2fa38168048e4a2044df44f6c7a257d9217 IN  0x7544fe3d184b6b55d6b36c3fca1157ee0ba302870 ETH0.000894142474 ETH
0xd1120c862b4c3c8ce75dde1367364d9ff4cab42632d39c3118f1aee94f6183d623779132021-10-19 20:54:271 hr 7 mins ago0xecfe519ddb077dbbf3e34b6c77c9a9f697a4e2e9 IN  0x7544fe3d184b6b55d6b36c3fca1157ee0ba302870 ETH0.000749248803 ETH
0x1c7d6208a845889b1a1e32794422d1beafa2574f1c75feea066ef5aa094e348823778792021-10-19 20:52:131 hr 10 mins ago0xed9376094ce37635827e0cfddc23bfbb6d788469 IN  0x7544fe3d184b6b55d6b36c3fca1157ee0ba302870 ETH0.000761680156 ETH
0x4de5d344c027cf5b397f8aa03517e527be0b80e63a9d0df5a0ca0bc21f81474323777682021-10-19 20:49:081 hr 13 mins ago0x49e7bdde0e6f366fcc15577ee273af1dd0a578ba IN  0x7544fe3d184b6b55d6b36c3fca1157ee0ba302870 ETH0.000741986837 ETH
0x6d68a50933789c1a480792ae9ea0dd8511ce3111de3b8059a856ab46bda7622f23776592021-10-19 20:45:001 hr 17 mins ago0x8d6c5458a590e2b0ae84c0e1a36a223987bc15c7 IN  0x7544fe3d184b6b55d6b36c3fca1157ee0ba302870 ETH0.000895596455 ETH
0x78b1f49ed11b2d80fe500050129d60acb89c803a33544edbdff7d97320f77ee423772642021-10-19 20:25:311 hr 36 mins ago0x070dcb7ba170091f84783b224489aa8b280c1a30 IN  0x7544fe3d184b6b55d6b36c3fca1157ee0ba302870 ETH0.00089758729 ETH
0xc0003a79ea4ae83af5b6b5933a039e7e162ba36dd99268320d402dfc4874597423771422021-10-19 20:21:191 hr 40 mins ago0x42fd445e08c89e264695e3687d3fd3547c75d6b2 IN  0x7544fe3d184b6b55d6b36c3fca1157ee0ba302870 ETH0.000750162849 ETH
0x20570a66a6b0ca3c56e1a705f7afeda7e32b4aa097466cd5b48efbc84d22389223769752021-10-19 20:14:121 hr 48 mins ago0x70f3dcce849ecb40a4572a66f36c424fb9cf5186 IN  0x7544fe3d184b6b55d6b36c3fca1157ee0ba302870 ETH0.000769777495 ETH
0xaacf356d6385e99536c8c61db9bb676f5a2cd0b0793367766b7c30fc8cbc106723767792021-10-19 20:06:541 hr 55 mins ago0xdb72cfa6d3916869a2f25073634ca298318ea91f IN  0x7544fe3d184b6b55d6b36c3fca1157ee0ba302870 ETH0.000769993435 ETH
0x4a75ff653fb6f0e6343998814ae4821159cb3e776bfb6345e7f2e95675eb3e8a23763112021-10-19 19:51:062 hrs 11 mins ago0x114f717ff555fe0d432556af3d7d1a9db2776e8e IN  0x7544fe3d184b6b55d6b36c3fca1157ee0ba302870 ETH0.000917670578 ETH
0xebf85a08dcf73ce70b26b0bc959f9d77ffd4aca81a8435deb1a3a1d43b9ae97423762492021-10-19 19:48:432 hrs 13 mins ago0x2a62e7671e604fe58f60ddfaaeaea1805167f507 IN  0x7544fe3d184b6b55d6b36c3fca1157ee0ba302870 ETH0.000745503676 ETH
0x733bec3381a53de05f57ed350a5e41b2bf0e4785bb63dd7b0d7a84874131d0cf23759752021-10-19 19:36:522 hrs 25 mins ago0x7d5744c03582c628462bd21d3c8eb06312b28706 IN  0x7544fe3d184b6b55d6b36c3fca1157ee0ba302870 ETH0.000568379675 ETH
0x3c5c5fc01b17443f11e9e43592880fbee01c4b3040ee0453e016bc572dc95e3e23759502021-10-19 19:35:282 hrs 26 mins ago0x7d5744c03582c628462bd21d3c8eb06312b28706 IN  0x7544fe3d184b6b55d6b36c3fca1157ee0ba302870 ETH0.000567369517 ETH
0x0d0cf0035453fa4434731d987f6bd0bac43ed5884013646c44f958abcc33797823759402021-10-19 19:35:282 hrs 26 mins ago0x7d5744c03582c628462bd21d3c8eb06312b28706 IN  0x7544fe3d184b6b55d6b36c3fca1157ee0ba302870 ETH0.000567369517 ETH
0x0a4a0f98f6dd58862dc2276cefee2f1c7034b6eb5b3e58b822111732ed1fd72823759202021-10-19 19:34:472 hrs 27 mins ago0x7d5744c03582c628462bd21d3c8eb06312b28706 IN  0x7544fe3d184b6b55d6b36c3fca1157ee0ba302870 ETH0.000743505318 ETH
0x0add63f8d5710a7d7233f59ccdb6f51623b90f57498901e0df2db0ccac032ddd23759092021-10-19 19:34:472 hrs 27 mins ago0x934c12067f5081df66385e3edc998313e9b0bec2 IN  0x7544fe3d184b6b55d6b36c3fca1157ee0ba302870 ETH0.0006071339 ETH
0x9668a7edd6159036237ab3e346a4882b17284f1d6bc05eedaf69dcc4a3b145c523756472021-10-19 19:25:082 hrs 37 mins ago0x934c12067f5081df66385e3edc998313e9b0bec2 IN  0x7544fe3d184b6b55d6b36c3fca1157ee0ba302870 ETH0.000604238111 ETH
0xed70017872d46d5e475fa58a200510ad622249c31ce33297858b3f99f1ca3da423752172021-10-19 19:08:452 hrs 53 mins ago0xa5ae03278e0533300779936293087fe8196bee6a IN  0x7544fe3d184b6b55d6b36c3fca1157ee0ba302870 ETH0.000760233653 ETH
0x4d1ee9a35cf8d45f9590bce7e6e759e9c6e6a982f42261dbf75db2c0e99c69a423738742021-10-19 18:14:363 hrs 47 mins ago0x6d7ac63aaa7ba8925dcb3e44be6355261dcf688f IN  0x7544fe3d184b6b55d6b36c3fca1157ee0ba302870 ETH0.00075481196 ETH
0xff3d821cb256af2b8b75d6857d42e5b360add727da5369d920d44b1c72ee25ea23736362021-10-19 18:06:323 hrs 55 mins ago0x80b9aa22ccda52f40be998eeb19db4d08fafec3e IN  0x7544fe3d184b6b55d6b36c3fca1157ee0ba302870 ETH0.000744642366 ETH
0x36c7100b70ce2bfb0fba4019cf9523b027b2671bb78e20482ef39f58f1a2dc5d23735092021-10-19 18:02:164 hrs ago0x36fdb65d2d484b036ade6a2a418b05da0c848f1b IN  0x7544fe3d184b6b55d6b36c3fca1157ee0ba302870 ETH0.000766066622 ETH
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Vyper_contract

Compiler Version
vyper:0.2.16

Optimization Enabled:
N/A

Other Settings:
, None license

Contract Source Code (Vyper language format)

# @version 0.2.16
"""
@title "Zap" Depositer for permissionless factory metapools
@author Curve.Fi
@license Copyright (c) Curve.Fi, 2021 - all rights reserved
"""

interface ERC20:
    def approve(_spender: address, _amount: uint256): nonpayable
    def balanceOf(_owner: address) -> uint256: view

interface CurveMeta:
    def add_liquidity(amounts: uint256[N_COINS], min_mint_amount: uint256, _receiver: address) -> uint256: nonpayable
    def remove_liquidity(_amount: uint256, min_amounts: uint256[N_COINS]): nonpayable
    def remove_liquidity_one_coin(_token_amount: uint256, i: int128, min_amount: uint256, _receiver: address) -> uint256: nonpayable
    def remove_liquidity_imbalance(amounts: uint256[N_COINS], max_burn_amount: uint256) -> uint256: nonpayable
    def calc_withdraw_one_coin(_token_amount: uint256, i: int128) -> uint256: view
    def calc_token_amount(amounts: uint256[N_COINS], deposit: bool) -> uint256: view
    def coins(i: uint256) -> address: view

interface CurveBase:
    def add_liquidity(amounts: uint256[BASE_N_COINS], min_mint_amount: uint256): nonpayable
    def remove_liquidity(_amount: uint256, min_amounts: uint256[BASE_N_COINS]): nonpayable
    def remove_liquidity_one_coin(_token_amount: uint256, i: int128, min_amount: uint256): nonpayable
    def remove_liquidity_imbalance(amounts: uint256[BASE_N_COINS], max_burn_amount: uint256): nonpayable
    def calc_withdraw_one_coin(_token_amount: uint256, i: int128) -> uint256: view
    def calc_token_amount(amounts: uint256[BASE_N_COINS], deposit: bool) -> uint256: view
    def coins(i: uint256) -> address: view
    def fee() -> uint256: view


BASE_N_COINS: constant(int128) = 2
BASE_POOL: constant(address) = 0x7f90122BF0700F9E7e1F688fe926940E8839F353
BASE_LP_TOKEN: constant(address) = 0x7f90122BF0700F9E7e1F688fe926940E8839F353
BASE_COINS: constant(address[BASE_N_COINS]) =[
    0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8,
    0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9,
]

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

FEE_DENOMINATOR: constant(uint256) = 10 ** 10
FEE_IMPRECISION: constant(uint256) = 100 * 10 ** 8  # % of the fee


# coin -> pool -> is approved to transfer?
is_approved: HashMap[address, HashMap[address, bool]]


@external
def __init__():
    """
    @notice Contract constructor
    """
    for coin in BASE_COINS:
        ERC20(coin).approve(BASE_POOL, MAX_UINT256)


@external
def add_liquidity(
    _pool: address,
    _deposit_amounts: uint256[N_ALL_COINS],
    _min_mint_amount: uint256,
    _receiver: address = msg.sender,
) -> uint256:
    """
    @notice Wrap underlying coins and deposit them into `_pool`
    @param _pool Address of the pool 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 _receiver Address that receives the LP tokens
    @return Amount of LP tokens received by depositing
    """
    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

    if _deposit_amounts[0] != 0:
        coin: address = CurveMeta(_pool).coins(0)
        if not self.is_approved[coin][_pool]:
            ERC20(coin).approve(_pool, MAX_UINT256)
            self.is_approved[coin][_pool] = True
        response: Bytes[32] = raw_call(
            coin,
            _abi_encode(
                msg.sender,
                self,
                _deposit_amounts[0],
                method_id=method_id("transferFrom(address,address,uint256)"),
            ),
            max_outsize=32
        )
        if len(response) != 0:
            assert convert(response, bool)
        # hand fee on transfer
        meta_amounts[0] = ERC20(coin).balanceOf(self)

    for i in range(1, N_ALL_COINS):
        amount: uint256 = _deposit_amounts[i]
        if amount == 0:
            continue
        deposit_base = True
        base_idx: uint256 = i - 1
        coin: address = base_coins[base_idx]

        response: Bytes[32] = raw_call(
            coin,
            _abi_encode(
                msg.sender,
                self,
                amount,
                method_id=method_id("transferFrom(address,address,uint256)"),
            ),
            max_outsize=32
        )
        if len(response) != 0:
            assert convert(response, bool)

        # Handle potential transfer fees (i.e. Tether/renBTC)
        base_amounts[base_idx] = ERC20(coin).balanceOf(self)

    # Deposit to the base pool
    if deposit_base:
        coin: address = BASE_LP_TOKEN
        CurveBase(BASE_POOL).add_liquidity(base_amounts, 0)
        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, _receiver)


@external
def remove_liquidity(
    _pool: address,
    _burn_amount: uint256,
    _min_amounts: uint256[N_ALL_COINS],
    _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 deposit into
    @param _burn_amount Quantity of LP tokens to burn in the withdrawal
    @param _min_amounts Minimum amounts of underlying coins to receive
    @param _receiver Address that receives the LP tokens
    @return List of amounts of underlying coins that were withdrawn
    """
    response: Bytes[32] = raw_call(
        _pool,
        _abi_encode(
            msg.sender,
            self,
            _burn_amount,
            method_id=method_id("transferFrom(address,address,uint256)"),
        ),
        max_outsize=32
    )
    if len(response) != 0:
        assert convert(response, bool)

    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
    meta_received: uint256[N_COINS] = empty(uint256[N_COINS])
    CurveMeta(_pool).remove_liquidity(_burn_amount, [_min_amounts[0], convert(0, uint256)])

    coins: address[N_COINS] = empty(address[N_COINS])
    for i in range(N_COINS):
        coin: address = CurveMeta(_pool).coins(i)
        coins[i] = coin
        # Handle fee on transfer for the first coin
        meta_received[i] = ERC20(coin).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(meta_received[MAX_COIN], min_amounts_base)

    # Transfer all coins out
    response = raw_call(
        coins[0],  # metapool coin 0
        _abi_encode(
            _receiver,
            meta_received[0],
            method_id=method_id("transfer(address,uint256)"),
        ),
        max_outsize=32
    )
    if len(response) != 0:
        assert convert(response, bool)

    amounts[0] = meta_received[0]

    base_coins: address[BASE_N_COINS] = BASE_COINS
    for i in range(1, N_ALL_COINS):
        coin: address = base_coins[i-1]
        # handle potential fee on transfer
        amounts[i] = ERC20(coin).balanceOf(self)
        response = raw_call(
            coin,
            _abi_encode(
                _receiver,
                amounts[i],
                method_id=method_id("transfer(address,uint256)"),
            ),
            max_outsize=32
        )
        if len(response) != 0:
            assert convert(response, bool)


    return amounts


@external
def remove_liquidity_one_coin(
    _pool: address,
    _burn_amount: uint256,
    i: int128,
    _min_amount: uint256,
    _receiver: address=msg.sender
) -> uint256:
    """
    @notice Withdraw and unwrap a single coin from the pool
    @param _pool Address of the pool to deposit into
    @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 _receiver Address that receives the LP tokens
    @return Amount of underlying coin received
    """
    response: Bytes[32] = raw_call(
        _pool,
        _abi_encode(
            msg.sender,
            self,
            _burn_amount,
            method_id=method_id("transferFrom(address,address,uint256)"),
        ),
        max_outsize=32
    )
    if len(response) != 0:
        assert convert(response, bool)


    coin_amount: uint256 = 0
    if i == 0:
        coin_amount = CurveMeta(_pool).remove_liquidity_one_coin(_burn_amount, i, _min_amount, _receiver)
    else:
        base_coins: address[BASE_N_COINS] = BASE_COINS
        coin: address = base_coins[i - MAX_COIN]
        # Withdraw a base pool coin
        coin_amount = CurveMeta(_pool).remove_liquidity_one_coin(_burn_amount, MAX_COIN, 0, self)
        CurveBase(BASE_POOL).remove_liquidity_one_coin(coin_amount, i-MAX_COIN, _min_amount)
        coin_amount = ERC20(coin).balanceOf(self)
        response = raw_call(
            coin,
            _abi_encode(
                _receiver,
                coin_amount,
                method_id=method_id("transfer(address,uint256)"),
            ),
            max_outsize=32
        )
        if len(response) != 0:
            assert convert(response, bool)


    return coin_amount


@external
def remove_liquidity_imbalance(
    _pool: address,
    _amounts: uint256[N_ALL_COINS],
    _max_burn_amount: uint256,
    _receiver: address=msg.sender
) -> uint256:
    """
    @notice Withdraw coins from the pool in an imbalanced amount
    @param _pool Address of the pool to deposit into
    @param _amounts List of amounts of underlying coins to withdraw
    @param _max_burn_amount Maximum amount of LP token to burn in the withdrawal
    @param _receiver Address that receives the LP tokens
    @return Actual amount of the LP token burned in the withdrawal
    """
    fee: uint256 = CurveBase(BASE_POOL).fee() * BASE_N_COINS / (4 * (BASE_N_COINS - 1))
    fee += fee * FEE_IMPRECISION / FEE_DENOMINATOR  # Overcharge to account for imprecision

    # Transfer the LP token in
    response: Bytes[32] = raw_call(
        _pool,
        _abi_encode(
            msg.sender,
            self,
            _max_burn_amount,
            method_id=method_id("transferFrom(address,address,uint256)"),
        ),
        max_outsize=32
    )
    if len(response) != 0:
        assert convert(response, bool)

    withdraw_base: bool = False
    amounts_base: uint256[BASE_N_COINS] = empty(uint256[BASE_N_COINS])
    amounts_meta: uint256[N_COINS] = empty(uint256[N_COINS])

    # determine amounts to withdraw from base pool
    for i in range(BASE_N_COINS):
        amount: uint256 = _amounts[MAX_COIN + i]
        if amount != 0:
            amounts_base[i] = amount
            withdraw_base = True

    # determine amounts to withdraw from metapool
    amounts_meta[0] = _amounts[0]
    if withdraw_base:
        amounts_meta[MAX_COIN] = CurveBase(BASE_POOL).calc_token_amount(amounts_base, False)
        amounts_meta[MAX_COIN] += amounts_meta[MAX_COIN] * fee / FEE_DENOMINATOR + 1

    # withdraw from metapool and return the remaining LP tokens
    burn_amount: uint256 = CurveMeta(_pool).remove_liquidity_imbalance(amounts_meta, _max_burn_amount)
    response = raw_call(
        _pool,
        _abi_encode(
            msg.sender,
            _max_burn_amount - burn_amount,
            method_id=method_id("transfer(address,uint256)"),
        ),
        max_outsize=32
    )
    if len(response) != 0:
        assert convert(response, bool)


    # withdraw from base pool
    if withdraw_base:
        CurveBase(BASE_POOL).remove_liquidity_imbalance(amounts_base, amounts_meta[MAX_COIN])
        coin: address = BASE_LP_TOKEN
        leftover: uint256 = ERC20(coin).balanceOf(self)

        if leftover > 0:
            # if some base pool LP tokens remain, re-deposit them for the caller
            if not self.is_approved[coin][_pool]:
                ERC20(coin).approve(_pool, MAX_UINT256)
                self.is_approved[coin][_pool] = True
            burn_amount -= CurveMeta(_pool).add_liquidity([convert(0, uint256), leftover], 0, msg.sender)

        # transfer withdrawn base pool tokens to caller
        base_coins: address[BASE_N_COINS] = BASE_COINS
        for i in range(BASE_N_COINS):
            response = raw_call(
                base_coins[i],
                _abi_encode(
                    _receiver,
                    ERC20(base_coins[i]).balanceOf(self),  # handle potential transfer fees
                    method_id=method_id("transfer(address,uint256)"),
                ),
                max_outsize=32
            )
            if len(response) != 0:
                assert convert(response, bool)


    # transfer withdrawn metapool tokens to caller
    if _amounts[0] > 0:
        coin: address = CurveMeta(_pool).coins(0)
        response = raw_call(
            coin,
            _abi_encode(
                _receiver,
                ERC20(coin).balanceOf(self),  # handle potential fees
                method_id=method_id("transfer(address,uint256)"),
            ),
            max_outsize=32
        )
        if len(response) != 0:
            assert convert(response, bool)


    return burn_amount


@view
@external
def calc_withdraw_one_coin(_pool: address, _token_amount: uint256, i: int128) -> uint256:
    """
    @notice Calculate the amount received when withdrawing and unwrapping a single coin
    @param _pool Address of the pool to deposit into
    @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)
    else:
        _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)


@view
@external
def calc_token_amount(_pool: address, _amounts: uint256[N_ALL_COINS], _is_deposit: bool) -> uint256:
    """
    @notice Calculate addition or reduction in token supply from a deposit or withdrawal
    @dev This calculation accounts for slippage, but not fees.
         Needed to prevent front-running, not for precise calculations!
    @param _pool Address of the pool to deposit into
    @param _amounts Amount of each underlying coin being deposited
    @param _is_deposit set True for deposits, False for withdrawals
    @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])

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

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

    return CurveMeta(_pool).calc_token_amount(meta_amounts, _is_deposit)

Contract ABI

[{"stateMutability":"nonpayable","type":"constructor","inputs":[],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"add_liquidity","inputs":[{"name":"_pool","type":"address"},{"name":"_deposit_amounts","type":"uint256[3]"},{"name":"_min_mint_amount","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"add_liquidity","inputs":[{"name":"_pool","type":"address"},{"name":"_deposit_amounts","type":"uint256[3]"},{"name":"_min_mint_amount","type":"uint256"},{"name":"_receiver","type":"address"}],"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[3]"}],"outputs":[{"name":"","type":"uint256[3]"}]},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity","inputs":[{"name":"_pool","type":"address"},{"name":"_burn_amount","type":"uint256"},{"name":"_min_amounts","type":"uint256[3]"},{"name":"_receiver","type":"address"}],"outputs":[{"name":"","type":"uint256[3]"}]},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity_one_coin","inputs":[{"name":"_pool","type":"address"},{"name":"_burn_amount","type":"uint256"},{"name":"i","type":"int128"},{"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":"int128"},{"name":"_min_amount","type":"uint256"},{"name":"_receiver","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity_imbalance","inputs":[{"name":"_pool","type":"address"},{"name":"_amounts","type":"uint256[3]"},{"name":"_max_burn_amount","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity_imbalance","inputs":[{"name":"_pool","type":"address"},{"name":"_amounts","type":"uint256[3]"},{"name":"_max_burn_amount","type":"uint256"},{"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":"int128"}],"outputs":[{"name":"","type":"uint256"}],"gas":5753},{"stateMutability":"view","type":"function","name":"calc_token_amount","inputs":[{"name":"_pool","type":"address"},{"name":"_amounts","type":"uint256[3]"},{"name":"_is_deposit","type":"bool"}],"outputs":[{"name":"","type":"uint256"}],"gas":6289}]

73ff970a61a04b1ca14834a43f5de4533ebddb5cc86101805273fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb96101a05261016060006002818352015b60206101605102610180015161014052610140513b15611baf5760006000604463095ea7b36101c052737f90122bf0700f9e7e1f688fe926940e8839f3536101e0527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610200526101dc6000610140515af115611baf575b815160010180835281141561003d575b5050611b9756600436101561000d57611ac0565b600035601c5260005134611ac65763a318517981141561003157336101405261005c565b63e07a10368114156100575760a43560a01c611ac657602060a46101403760005061005c565b6105f3565b60043560a01c611ac65760a0366101603773ff970a61a04b1ca14834a43f5de4533ebddb5cc86102005273fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9610220526000602435181561029b5760206102e0602463c66106576102605260006102805261027c6004355afa15611ac657601f3d1115611ac6576000506102e0516102405260006102405160e05260c052604060c02060043560e05260c052604060c0205461017d57610240513b15611ac65760006000604463095ea7b361026052600435610280527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6102a05261027c6000610240515af115611ac657600160006102405160e05260c052604060c02060043560e05260c052604060c020555b6323b872dd6102c45260046102e4808080338152505060208101905080803081525050602081019050808060243581525050606090509050016102c0526102c08051602001806103608284600060045af115611ac65750506020610420610360516103806000610240515af115611ac65760203d808211156101ff5780610201565b815b90509050610400526104008051602001806102608284600060045af115611ac65750506000610260511815610263576102608060200151600082518060209013611ac65780919012611ac657806020036101000a820490509050905015611ac6575b602061034060246370a082316102c052306102e0526102dc610240515afa15611ac657601f3d1115611ac65760005061034051610160525b61024060016002818352015b6024610240516003811015611ac657602002013561026052610260516102cc57610433565b60016101e052610240516001808210611ac6578082039050905061028052610200610280516002811015611ac65760200201516102a0526323b872dd6103245260046103448080803381525050602081019050808030815250506020810190508080610260518152505060609050905001610320526103208051602001806103c08284600060045af115611ac657505060206104806103c0516103e060006102a0515af115611ac65760203d808211156103865780610388565b815b90509050610460526104608051602001806102c08284600060045af115611ac657505060006102c05118156103ea576102c08060200151600082518060209013611ac65780919012611ac657806020036101000a820490509050905015611ac6575b60206103a060246370a0823161032052306103405261033c6102a0515afa15611ac657601f3d1115611ac6576000506103a0516101a0610280516002811015611ac65760200201525b81516001018083528114156102a7575b50506101e0511561059c57737f90122bf0700f9e7e1f688fe926940e8839f35361024052737f90122bf0700f9e7e1f688fe926940e8839f3533b15611ac657600060006064630b4c7e4d610260526101a051610280526101c0516102a05260006102c05261027c6000737f90122bf0700f9e7e1f688fe926940e8839f3535af115611ac65760206102e060246370a0823161026052306102805261027c610240515afa15611ac657601f3d1115611ac6576000506102e0516101805260006102405160e05260c052604060c02060043560e05260c052604060c0205461059b57610240513b15611ac65760006000604463095ea7b361026052600435610280527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6102a05261027c6000610240515af115611ac657600160006102405160e05260c052604060c02060043560e05260c052604060c020555b5b60206103206084630c3e4b5461024052610160516102605261018051610280526084356102a052610140516102c05261025c60006004355af115611ac657601f3d1115611ac6576000506103205160005260206000f35b638fa892a6811415610609573361014052610634565b6311d4b6aa81141561062f5760a43560a01c611ac657602060a461014037600050610634565b610b86565b60043560a01c611ac6576323b872dd6101c45260046101e4808080338152505060208101905080803081525050602081019050808060243581525050606090509050016101c0526101c08051602001806102608284600060045af115611ac657505060206103206102605161028060006004355af115611ac65760203d808211156106bf57806106c1565b815b90509050610300526103008051602001806101608284600060045af115611ac65750506000610160511815610723576101608060200151600082518060209013611ac65780919012611ac657806020036101000a820490509050905015611ac6575b60e0366101c0376004353b15611ac657600060006064635b36389c6102c0526024356102e05260006102a052604435610300526102a051610320526102dc60006004355af115611ac6576040366102a0376102e060006002818352015b60206103a0602463c6610657610320526102e0516103405261033c6004355afa15611ac657601f3d1115611ac6576000506103a05161030052610300516102a06102e0516002811015611ac657602002015260206103a060246370a0823161032052306103405261033c610300515afa15611ac657601f3d1115611ac6576000506103a0516102606102e0516002811015611ac65760200201525b8151600101808352811415610780575b50506102e060006002818352015b604460016102e0518181830110611ac657808201905090506003811015611ac65760200201356101c06102e0516002811015611ac65760200201525b8151600101808352811415610839575b5050737f90122bf0700f9e7e1f688fe926940e8839f3533b15611ac657600060006064635b36389c6102e05261028051610300526101c051610320526101e051610340526102fc6000737f90122bf0700f9e7e1f688fe926940e8839f3535af115611ac65763a9059cbb6102e4526004610304808080610140518152505060208101905080806102605181525050604090509050016102e0526102e08051602001806103608284600060045af115611ac657505060206104006103605161038060006102a0515af115611ac65760203d808211156109635780610965565b815b905090506103e0526103e08051602001806101608284600060045af115611ac657505060006101605118156109c7576101608060200151600082518060209013611ac65780919012611ac657806020036101000a820490509050905015611ac6575b610260516102005273ff970a61a04b1ca14834a43f5de4533ebddb5cc86102e05273fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb96103005261032060016002818352015b6102e0610320516001808210611ac657808203905090506002811015611ac65760200201516103405260206103e060246370a0823161036052306103805261037c610340515afa15611ac657601f3d1115611ac6576000506103e051610200610320516003811015611ac657602002015263a9059cbb61036452600461038480808061014051815250506020810190508080610200610320516003811015611ac65760200201518152505060409050905001610360526103608051602001806103e08284600060045af115611ac657505060206104806103e0516104006000610340515af115611ac65760203d80821115610b085780610b0a565b815b90509050610460526104608051602001806101608284600060045af115611ac65750506000610160511815610b6c576101608060200151600082518060209013611ac65780919012611ac657806020036101000a820490509050905015611ac6575b5b8151600101808352811415610a0d575b50506060610200f35b6329ed2862811415610b9c573361014052610bc7565b631e700cbb811415610bc25760843560a01c611ac6576020608461014037600050610bc7565b610f6c565b60043560a01c611ac65760443580607f1d8160801d1415611ac657809050506323b872dd6101c45260046101e4808080338152505060208101905080803081525050602081019050808060243581525050606090509050016101c0526101c08051602001806102608284600060045af115611ac657505060206103206102605161028060006004355af115611ac65760203d80821115610c675780610c69565b815b90509050610300526103008051602001806101608284600060045af115611ac65750506000610160511815610ccb576101608060200151600082518060209013611ac65780919012611ac657806020036101000a820490509050905015611ac6575b60006101c052604435610d205760206102c0608463081579a56101e052606060246102003761014051610260526101fc60006004355af115611ac657601f3d1115611ac6576000506102c0516101c052610f5f565b73ff970a61a04b1ca14834a43f5de4533ebddb5cc86101e05273fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9610200526101e0604435600180820380607f1d8160801d1415611ac657809050905090506002811015611ac6576020020151610220526020610320608463081579a5610240526024356102605260016102805260006102a052306102c05261025c60006004355af115611ac657601f3d1115611ac657600050610320516101c052737f90122bf0700f9e7e1f688fe926940e8839f3533b15611ac657600060006064631a4d01d2610240526101c05161026052604435600180820380607f1d8160801d1415611ac65780905090509050610280526064356102a05261025c6000737f90122bf0700f9e7e1f688fe926940e8839f3535af115611ac65760206102c060246370a0823161024052306102605261025c610220515afa15611ac657601f3d1115611ac6576000506102c0516101c05263a9059cbb610244526004610264808080610140518152505060208101905080806101c0518152505060409050905001610240526102408051602001806102c08284600060045af115611ac657505060206103606102c0516102e06000610220515af115611ac65760203d80821115610efa5780610efc565b815b90509050610340526103408051602001806101608284600060045af115611ac65750506000610160511815610f5e576101608060200151600082518060209013611ac65780919012611ac657806020036101000a820490509050905015611ac6575b5b6101c05160005260206000f35b6343d532a7811415610f82573361014052610fad565b636755b454811415610fa85760a43560a01c611ac657602060a461014037600050610fad565b61185e565b60043560a01c611ac65760206101e0600463ddca3f436101805261019c737f90122bf0700f9e7e1f688fe926940e8839f3535afa15611ac657601f3d1115611ac6576000506101e0516002808202821582848304141715611ac65780905090509050600480820490509050610160526101608051610160516402540be400808202821582848304141715611ac657809050905090506402540be400808204905090508181830110611ac657808201905090508152506323b872dd6101e4526004610204808080338152505060208101905080803081525050602081019050808060843581525050606090509050016101e0526101e08051602001806102808284600060045af115611ac65750506020610340610280516102a060006004355af115611ac65760203d808211156110e357806110e5565b815b90509050610320526103208051602001806101808284600060045af115611ac65750506000610180511815611147576101808060200151600082518060209013611ac65780919012611ac657806020036101000a820490509050905015611ac6575b60a0366101e03761028060006002818352015b60246001610280518181830110611ac657808201905090506003811015611ac65760200201356102a05260006102a05118156111b0576102a051610200610280516002811015611ac657602002015260016101e0525b5b815160010180835281141561115a575b5050602435610240526101e05115611283576020610340606463ed8e84f361028052610200516102a052610220516102c05260006102e05261029c737f90122bf0700f9e7e1f688fe926940e8839f3535afa15611ac657601f3d1115611ac657600050610340516102605261026080516102605161016051808202821582848304141715611ac657809050905090506402540be4008082049050905060018181830110611ac657808201905090508181830110611ac657808201905090508152505b6020610360606463e31032736102a052610240516102c052610260516102e052608435610300526102bc60006004355af115611ac657601f3d1115611ac657600050610360516102805263a9059cbb6102a45260046102c48080803381525050602081019050808060843561028051808210611ac6578082039050905081525050604090509050016102a0526102a08051602001806103208284600060045af115611ac657505060206103c06103205161034060006004355af115611ac65760203d808211156113535780611355565b815b905090506103a0526103a08051602001806101808284600060045af115611ac657505060006101805118156113b7576101808060200151600082518060209013611ac65780919012611ac657806020036101000a820490509050905015611ac6575b6101e0511561170257737f90122bf0700f9e7e1f688fe926940e8839f3533b15611ac65760006000606463e31032736102a052610200516102c052610220516102e05261026051610300526102bc6000737f90122bf0700f9e7e1f688fe926940e8839f3535af115611ac657737f90122bf0700f9e7e1f688fe926940e8839f3536102a052602061036060246370a082316102e05230610300526102fc6102a0515afa15611ac657601f3d1115611ac657600050610360516102c05260006102c05111156115825760006102a05160e05260c052604060c02060043560e05260c052604060c0205461151b576102a0513b15611ac65760006000604463095ea7b36102e052600435610300527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610320526102fc60006102a0515af115611ac657600160006102a05160e05260c052604060c02060043560e05260c052604060c020555b610280805160206103e06084630c3e4b546103005260006102e0526102e051610320526102c05161034052600061036052336103805261031c60006004355af115611ac657601f3d1115611ac6576000506103e051808210611ac657808203905090508152505b73ff970a61a04b1ca14834a43f5de4533ebddb5cc86102e05273fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb96103005261032060006002818352015b63a9059cbb6103e45260046104048080806101405181525050602081019050808060206103c060246370a0823161034052306103605261035c6102e0610320516002811015611ac65760200201515afa15611ac657601f3d1115611ac6576000506103c05181525050604090509050016103e0526103e08051602001806104608284600060045af115611ac657505060206105006104605161048060006102e0610320516002811015611ac65760200201515af115611ac65760203d8082111561168a578061168c565b815b905090506104e0526104e08051602001806101808284600060045af115611ac657505060006101805118156116ee576101808060200151600082518060209013611ac65780919012611ac657806020036101000a820490509050905015611ac6575b5b81516001018083528114156115c0575b50505b60006024351115611851576020610340602463c66106576102c05260006102e0526102dc6004355afa15611ac657601f3d1115611ac657600050610340516102a05263a9059cbb61036452600461038480808061014051815250506020810190508080602061034060246370a082316102c052306102e0526102dc6102a0515afa15611ac657601f3d1115611ac657600050610340518152505060409050905001610360526103608051602001806103e08284600060045af115611ac657505060206104806103e05161040060006102a0515af115611ac65760203d808211156117ec57806117ee565b815b90509050610460526104608051602001806101808284600060045af115611ac65750506000610180511815611850576101808060200151600082518060209013611ac65780919012611ac657806020036101000a820490509050905015611ac6575b5b6102805160005260206000f35b6341b028f38114156119875760043560a01c611ac65760443580607f1d8160801d1415611ac65780905050600160443512156118d65760206101e0604463cc2b27d761014052604060246101603761015c6004355afa15611ac657601f3d1115611ac6576000506101e05160005260206000f3611985565b6020610200604463cc2b27d7610160526024356101805260016101a05261017c6004355afa15611ac657601f3d1115611ac65760005061020051610140526020610200604463cc2b27d7610160526101405161018052604435600180820380607f1d8160801d1415611ac657809050905090506101a05261017c737f90122bf0700f9e7e1f688fe926940e8839f3535afa15611ac657601f3d1115611ac6576000506102005160005260206000f35b005b6343bff3cc811415611abe5760043560a01c611ac65760843560011c611ac65760803661014037602435610140526101c060006002818352015b60246101c05160018181830110611ac657808201905090506003811015611ac65760200201356101806101c0516002811015611ac65760200201525b81516001018083528114156119c1575b505060206102a0606463ed8e84f36101e05261018051610200526101a05161022052608435610240526101fc737f90122bf0700f9e7e1f688fe926940e8839f3535afa15611ac657601f3d1115611ac6576000506102a0516101c0526101c0516101605260206102a0606463ed8e84f36101e05261014051610200526101605161022052608435610240526101fc6004355afa15611ac657601f3d1115611ac6576000506102a05160005260206000f35b505b60006000fd5b600080fd5b6100cc611b97036100cc6000396100cc611b97036000f35b600080fd

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