Contract 0xb7de33440b7171159a9718cbe748086cecdd9685 6

Txn Hash Method
Block
From
To
Value [Txn Fee]
0x51a1a1c388a7b10cc3d2de7253906e93dad7d2bdc534229a5348dd4168c09713Deposit_and_stak...28292472023-01-28 20:00:241 day 11 hrs ago0x9d5f4d9c0651591784f717ff15a4b9c724553f7c IN  0xb7de33440b7171159a9718cbe748086cecdd96850 GLMR0.03205708
0x26e08141f3e645a91b5868d9406481c26961da17c5e4ccebdefc636796ec1c9bDeposit_and_stak...28285982023-01-28 17:48:061 day 14 hrs ago0x9d5f4d9c0651591784f717ff15a4b9c724553f7c IN  0xb7de33440b7171159a9718cbe748086cecdd96850 GLMR0.0320551325
0xa4a86b8f770a7f6c9c012d86627621ba4cb4a4c5fdaf5bcaa3fc52c4b57d7319Deposit_and_stak...28279552023-01-28 15:36:001 day 16 hrs ago0xbfb1ac13b6720bdd7a8a61b949bd3a8b869b871b IN  0xb7de33440b7171159a9718cbe748086cecdd96850 GLMR0.03205708
0x1103c5d882bbda7053bb49f6033e758122a7f2130ad95293ab018dc0aa9e1887Deposit_and_stak...28248312023-01-28 5:00:002 days 2 hrs ago0x5749889a719c87a23f5158856c7899396741a1b8 IN  0xb7de33440b7171159a9718cbe748086cecdd96850 GLMR0.0320551325
0x51bad5f15ff3dfbecb1144298f4ed46dcfabd0ffbfc8743cf4eaf322289a552cDeposit_and_stak...28212342023-01-27 16:49:002 days 15 hrs ago0x9d5f4d9c0651591784f717ff15a4b9c724553f7c IN  0xb7de33440b7171159a9718cbe748086cecdd96850 GLMR0.03205708
0xae5cc6c3bbc2be04f2d935e3518f07e51db13b5d0edf672007afec19dc745a57Deposit_and_stak...28206452023-01-27 14:49:482 days 17 hrs ago0x9d5f4d9c0651591784f717ff15a4b9c724553f7c IN  0xb7de33440b7171159a9718cbe748086cecdd96850 GLMR0.03366141
0x6829f28b17b3e1cc330a9e8a6ef2560781e6fee0f0aec68542d1bd41904037c6Deposit_and_stak...28200332023-01-27 12:45:482 days 19 hrs ago0x6bc7428e0ec2eca50037637cd091bf066cb5b30b IN  0xb7de33440b7171159a9718cbe748086cecdd96850 GLMR0.0320618975
0x68823fb942f7622fe3f9838a9958f9303c680688e178e66a193ae495a86b4dd8Deposit_and_stak...28200272023-01-27 12:44:362 days 19 hrs ago0x6bc7428e0ec2eca50037637cd091bf066cb5b30b IN  0xb7de33440b7171159a9718cbe748086cecdd96850 GLMR0.0320551325
0xe676ab59566f17cef205add5457fe1b9c21a042b526e6eea55ffee62985638b4Deposit_and_stak...28198512023-01-27 12:08:482 days 19 hrs ago0xaa795fbf1c5ab74d117ed813da8d7c418024737a IN  0xb7de33440b7171159a9718cbe748086cecdd96850 GLMR0.0320551325
0x8e152b96e9ae3141cb9298bf8e1320c17c9b9701e372289b5b53a8e1219cbfc6Deposit_and_stak...28153242023-01-26 20:49:123 days 11 hrs ago0xedb28058c696a3bccaf205e9b30f57bddbc95089 IN  0xb7de33440b7171159a9718cbe748086cecdd96850 GLMR0.03749163
0xa3cd9ea2396d42ecba5356de8103acb1d02ccc8b025232c9404c98c9a1a9f82fDeposit_and_stak...28138152023-01-26 15:40:243 days 16 hrs ago0x9d5f4d9c0651591784f717ff15a4b9c724553f7c IN  0xb7de33440b7171159a9718cbe748086cecdd96850 GLMR0.038594735
0xd8053c2550bccff7fe760ae8c58b4646b11f795212822fc798a0ed3c16fffefcDeposit_and_stak...28083372023-01-25 21:05:544 days 10 hrs ago0xa213a08a306b76fd0ba3a3e3abc979d5f3e6a5ec IN  0xb7de33440b7171159a9718cbe748086cecdd96850 GLMR0.039648336
0xf79f9010abacfaf9f4a4a284b37b23eedda945d27815193adf87a7c9499fe295Deposit_and_stak...28081492023-01-25 20:27:364 days 11 hrs ago0xedb28058c696a3bccaf205e9b30f57bddbc95089 IN  0xb7de33440b7171159a9718cbe748086cecdd96850 GLMR0.03205708
0xd32bb3b8824724e547bcc461bdfae00e57b7d41700eb1cbb9c184002216a9567Deposit_and_stak...28059442023-01-25 12:57:184 days 18 hrs ago0x8d01b5109e25fc1f0a7205c33d9cce4e7aa1d8f9 IN  0xb7de33440b7171159a9718cbe748086cecdd96850 GLMR0.0400341425
0x3b78ad1cb98e220cf89856b6ca61d7143a0daa7e6122a36f5e528b516f5c145bDeposit_and_stak...28016422023-01-24 22:20:425 days 9 hrs ago0x924e16deb0eb1164270f0842e57734452b0e03b1 IN  0xb7de33440b7171159a9718cbe748086cecdd96850 GLMR0.0433518625
0x811f265cbf17ea6ddef47f8f6ba8fa49636b533bca05b2f992fca7cab130ce5cDeposit_and_stak...27997062023-01-24 15:44:365 days 16 hrs ago0xd166e7f8ee46e3671de5b7211f9069b0af7490a9 IN  0xb7de33440b7171159a9718cbe748086cecdd96850 GLMR0.03171425353
0xdb3516bd956ab9b1ca7bcb1eaa765b129d8a8753046f3eefb30d422776fd4880Deposit_and_stak...27994832023-01-24 14:58:485 days 16 hrs ago0xec9e4a0ed746b24b0c7ccf22f270be54f725fb4b IN  0xb7de33440b7171159a9718cbe748086cecdd96850 GLMR0.035091695
0x6a1a2e9c3778c0e42f0ca2b85623d3fe4297bf674e340ce0c46187b2e5a5f902Deposit_and_stak...27990802023-01-24 13:37:125 days 18 hrs ago0xbfb1ac13b6720bdd7a8a61b949bd3a8b869b871b IN  0xb7de33440b7171159a9718cbe748086cecdd96850 GLMR0.0374896825
0x559fe021b4f3a6d63980feb99048131a80ab2a1625c5b0d2c027447c9ce731d6Deposit_and_stak...27908492023-01-23 9:43:006 days 22 hrs ago0xd814e1b7cc203ff6ca4358bf4aa3ce9771fedc68 IN  0xb7de33440b7171159a9718cbe748086cecdd96850 GLMR0.0433494025
0x547ab4171cfd752135c9ef5201bf490559441a4175547b35701cad665c37e8a6Deposit_and_stak...27782842023-01-21 15:04:548 days 16 hrs ago0x6bc7428e0ec2eca50037637cd091bf066cb5b30b IN  0xb7de33440b7171159a9718cbe748086cecdd96850 GLMR0.0498515925
0x76c233219fb6a68095417c7f6f9e7bbfd878e4556408be842c3013ea1436e30bDeposit_and_stak...27726582023-01-20 20:02:429 days 11 hrs ago0xb763509d355ce6503d7d4373f078244120efdbeb IN  0xb7de33440b7171159a9718cbe748086cecdd96850 GLMR0.03205708
0x07edd053d583a9ff34ac70ac239b91637edee7bf9884cd34c93a0a2245570857Deposit_and_stak...27610742023-01-19 4:53:0611 days 3 hrs ago0x2d9422b24f0c8f1c438fd61f5e3bb934d1caf468 IN  0xb7de33440b7171159a9718cbe748086cecdd96850 GLMR0.039091625
0xb49d2fc02bbe73308df4a413b148ca1e0cfde5ec2dda5db396b322f45ccfccd9Deposit_and_stak...27599142023-01-19 0:56:5411 days 6 hrs ago0x5749889a719c87a23f5158856c7899396741a1b8 IN  0xb7de33440b7171159a9718cbe748086cecdd96850 GLMR0.0360868675
0x3f86c68edfab34afa0eefb2a0091ac8f2e59565f22bd0ff0924ffb53522caf31Deposit_and_stak...27596202023-01-18 23:57:4811 days 7 hrs ago0xeff3c4ad01b9117ccdc1ef1070f0dbb2a4374982 IN  0xb7de33440b7171159a9718cbe748086cecdd96850 GLMR0.0427764275
0x887412a452bec2459c0dfd93e14f44f6020dccd16340161fec89ca42c9358996Deposit_and_stak...27505552023-01-17 17:11:1812 days 14 hrs ago0xb763509d355ce6503d7d4373f078244120efdbeb IN  0xb7de33440b7171159a9718cbe748086cecdd96850 GLMR0.0320561575
[ 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.3.0

Optimization Enabled:
N/A

Other Settings:
, None license

Contract Source Code (Vyper language format)

# @version ^0.3.0
# A "zap" to add liquidity and deposit into gauge in one transaction
# (c) Curve.Fi, 2022

MAX_COINS: constant(uint256) = 5
ETH_ADDRESS: constant(address) = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE

# External Contracts
interface ERC20:
    def transfer(_receiver: address, _amount: uint256): nonpayable
    def transferFrom(_sender: address, _receiver: address, _amount: uint256): nonpayable
    def approve(_spender: address, _amount: uint256): nonpayable
    def decimals() -> uint256: view
    def balanceOf(_owner: address) -> uint256: view
    def allowance(_owner : address, _spender : address) -> uint256: view

interface Pool2:
    def add_liquidity(amounts: uint256[2], min_mint_amount: uint256): payable

interface Pool3:
    def add_liquidity(amounts: uint256[3], min_mint_amount: uint256): payable

interface Pool4:
    def add_liquidity(amounts: uint256[4], min_mint_amount: uint256): payable

interface Pool5:
    def add_liquidity(amounts: uint256[5], min_mint_amount: uint256): payable

interface PoolUseUnderlying2:
    def add_liquidity(amounts: uint256[2], min_mint_amount: uint256, use_underlying: bool): payable

interface PoolUseUnderlying3:
    def add_liquidity(amounts: uint256[3], min_mint_amount: uint256, use_underlying: bool): payable

interface PoolUseUnderlying4:
    def add_liquidity(amounts: uint256[4], min_mint_amount: uint256, use_underlying: bool): payable

interface PoolUseUnderlying5:
    def add_liquidity(amounts: uint256[5], min_mint_amount: uint256, use_underlying: bool): payable

interface PoolFactory2:
    def add_liquidity(pool: address, amounts: uint256[2], min_mint_amount: uint256): payable

interface PoolFactory3:
    def add_liquidity(pool: address, amounts: uint256[3], min_mint_amount: uint256): payable

interface PoolFactory4:
    def add_liquidity(pool: address, amounts: uint256[4], min_mint_amount: uint256): payable

interface PoolFactory5:
    def add_liquidity(pool: address, amounts: uint256[5], min_mint_amount: uint256): payable

interface Gauge:
    def deposit(lp_token_amount: uint256, addr: address): payable


allowance: public(HashMap[address, HashMap[address, bool]])
gauge_allowance: HashMap[address, bool]


@internal
def _add_liquidity(
        deposit: address,
        n_coins: uint256,
        amounts: uint256[MAX_COINS],
        min_mint_amount: uint256,
        eth_value: uint256,
        use_underlying: bool,
        pool: address
):
    if pool != ZERO_ADDRESS:
        if n_coins == 2:
            PoolFactory2(deposit).add_liquidity(pool, [amounts[0], amounts[1]], min_mint_amount, value=eth_value)
        elif n_coins == 3:
            PoolFactory3(deposit).add_liquidity(pool, [amounts[0], amounts[1], amounts[2]], min_mint_amount, value=eth_value)
        elif n_coins == 4:
            PoolFactory4(deposit).add_liquidity(pool, [amounts[0], amounts[1], amounts[2], amounts[3]], min_mint_amount, value=eth_value)
        elif n_coins == 5:
            PoolFactory5(deposit).add_liquidity(pool, [amounts[0], amounts[1], amounts[2], amounts[3], amounts[4]], min_mint_amount, value=eth_value)
    elif use_underlying:
        if n_coins == 2:
            PoolUseUnderlying2(deposit).add_liquidity([amounts[0], amounts[1]], min_mint_amount, True, value=eth_value)
        elif n_coins == 3:
            PoolUseUnderlying3(deposit).add_liquidity([amounts[0], amounts[1], amounts[2]], min_mint_amount, True, value=eth_value)
        elif n_coins == 4:
            PoolUseUnderlying4(deposit).add_liquidity([amounts[0], amounts[1], amounts[2], amounts[3]], min_mint_amount, True, value=eth_value)
        elif n_coins == 5:
            PoolUseUnderlying5(deposit).add_liquidity([amounts[0], amounts[1], amounts[2], amounts[3], amounts[4]], min_mint_amount, True, value=eth_value)
    else:
        if n_coins == 2:
            Pool2(deposit).add_liquidity([amounts[0], amounts[1]], min_mint_amount, value=eth_value)
        elif n_coins == 3:
            Pool3(deposit).add_liquidity([amounts[0], amounts[1], amounts[2]], min_mint_amount, value=eth_value)
        elif n_coins == 4:
            Pool4(deposit).add_liquidity([amounts[0], amounts[1], amounts[2], amounts[3]], min_mint_amount, value=eth_value)
        elif n_coins == 5:
            Pool5(deposit).add_liquidity([amounts[0], amounts[1], amounts[2], amounts[3], amounts[4]], min_mint_amount, value=eth_value)


@payable
@external
@nonreentrant('lock')
def deposit_and_stake(
        deposit: address,
        lp_token: address,
        gauge: address,
        n_coins: uint256,
        coins: address[MAX_COINS],
        amounts: uint256[MAX_COINS],
        min_mint_amount: uint256,
        use_underlying: bool, # for aave, saave, ib (use_underlying) and crveth, cvxeth (use_eth)
        pool: address = ZERO_ADDRESS, # for factory
):
    assert n_coins >= 2, 'n_coins must be >=2'
    assert n_coins <= MAX_COINS, 'n_coins must be <=MAX_COINS'

    # Ensure allowance for swap or zap
    for i in range(MAX_COINS):
        if i >= n_coins:
            break

        if coins[i] == ETH_ADDRESS or amounts[i] == 0 or self.allowance[deposit][coins[i]]:
            continue

        self.allowance[deposit][coins[i]] = True
        ERC20(coins[i]).approve(deposit, MAX_UINT256)

    # Ensure allowance for gauge
    if not self.gauge_allowance[gauge]:
        self.gauge_allowance[gauge] = True
        ERC20(lp_token).approve(gauge, MAX_UINT256)

    # Transfer coins from owner
    has_eth: bool = False
    for i in range(MAX_COINS):
        if i >= n_coins:
            break

        if coins[i] == ETH_ADDRESS:
            assert msg.value == amounts[i]
            has_eth = True
            continue

        if amounts[i] > 0:
            # "safeTransferFrom" which works for ERC20s which return bool or not
            _response: Bytes[32] = raw_call(
                coins[i],
                concat(
                    method_id("transferFrom(address,address,uint256)"),
                    convert(msg.sender, bytes32),
                    convert(self, bytes32),
                    convert(amounts[i], bytes32),
                ),
                max_outsize=32,
            )  # dev: failed transfer
            if len(_response) > 0:
                assert convert(_response, bool)  # dev: failed transfer

    if not has_eth:
        assert msg.value == 0

    # Reverts if n_coins is wrong
    self._add_liquidity(deposit, n_coins, amounts, min_mint_amount, msg.value, use_underlying, pool)

    lp_token_amount: uint256 = ERC20(lp_token).balanceOf(self)
    assert lp_token_amount > 0 # dev: swap-token mismatch

    Gauge(gauge).deposit(lp_token_amount, msg.sender)


@payable
@external
def __default__():
    pass

Contract ABI

[{"stateMutability":"payable","type":"function","name":"deposit_and_stake","inputs":[{"name":"deposit","type":"address"},{"name":"lp_token","type":"address"},{"name":"gauge","type":"address"},{"name":"n_coins","type":"uint256"},{"name":"coins","type":"address[5]"},{"name":"amounts","type":"uint256[5]"},{"name":"min_mint_amount","type":"uint256"},{"name":"use_underlying","type":"bool"}],"outputs":[],"gas":416901},{"stateMutability":"payable","type":"function","name":"deposit_and_stake","inputs":[{"name":"deposit","type":"address"},{"name":"lp_token","type":"address"},{"name":"gauge","type":"address"},{"name":"n_coins","type":"uint256"},{"name":"coins","type":"address[5]"},{"name":"amounts","type":"uint256[5]"},{"name":"min_mint_amount","type":"uint256"},{"name":"use_underlying","type":"bool"},{"name":"pool","type":"address"}],"outputs":[],"gas":416901},{"stateMutability":"payable","type":"fallback"},{"stateMutability":"view","type":"function","name":"allowance","inputs":[{"name":"arg0","type":"address"},{"name":"arg1","type":"address"}],"outputs":[{"name":"","type":"bool"}],"gas":3190}]

610b9856600436101561000d576106b5565b60046000601c3760005163851ba91181141561002e5760006104c05261004e565b63aba17d9381141561065257610204358060a01c610b8f578090506104c0525b6004358060a01c610b8f578090506103a0526024358060a01c610b8f578090506103c0526044358060a01c610b8f578090506103e0526084358060a01c610b8f578090506104005260a4358060a01c610b8f578090506104205260c4358060a01c610b8f578090506104405260e4358060a01c610b8f5780905061046052610104358060a01c610b8f57809050610480526101e4358060011c610b8f578090506104a052600054610b8f5760016000556002606435101561014e576308c379a06104e0526020610500526013610520527f6e5f636f696e73206d757374206265203e3d3200000000000000000000000000610540526105205060646104fcfd5b6005606435111561019e576308c379a06104e052602061050052601b610520527f6e5f636f696e73206d757374206265203c3d4d41585f434f494e530000000000610540526105205060646104fcfd5b6104e060006005818352015b6064356104e051106101bb57610304565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6104006104e0516005811015610b8f57602002015114156101f257600161023d565b60206104e05102610124013561020957600161023c565b60016103a05160e05260c052604060c0206104006104e0516005811015610b8f57602002015160e05260c052604060c020545b5b15610247576102f4565b600160016103a05160e05260c052604060c0206104006104e0516005811015610b8f57602002015160e05260c052604060c0205563095ea7b3610500526103a051610520527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610540526104006104e0516005811015610b8f5760200201513b15610b8f5760006000604461051c60006104006104e0516005811015610b8f5760200201515af115610b8f575b81516001018083528114156101aa575b505060026103e05160e05260c052604060c0205461038757600160026103e05160e05260c052604060c0205563095ea7b36104e0526103e051610500527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610520526103c0513b15610b8f576000600060446104fc60006103c0515af115610b8f575b60006104e05261050060006005818352015b60643561050051106103aa57610569565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee610400610500516005811015610b8f57602002015114156103f857602061050051026101240135341415610b8f5760016104e052610559565b600060206105005102610124013511156105585760006004610560527f23b872dd00000000000000000000000000000000000000000000000000000000610580526105606004806020846105a001018260208501600060045af1505080518201915050336020826105a0010152602081019050306020826105a00101526020810190506020610500510261012401356020826105a0010152602081019050806105a0526105a090508051602001806106408284600060045af115610b8f5750506020610700610640516106606000610400610500516005811015610b8f5760200201515af115610b8f5760203d808211156104f357806104f5565b815b905090506106e0526106e08051602001806105208284600060045af115610b8f5750506000610520511115610557576105208060200151600082518060209013610b8f5780919012610b8f57806020036101000a820490509050905015610b8f575b5b5b8151600101808352811415610399575b50506104e0516105795734610b8f575b6103a05161014052606435610160526101243561018052610144356101a052610164356101c052610184356101e0526101a435610200526101c4356102205234610240526104a051610260526104c051610280526105d56106b7565b6370a082316105205230610540526020610520602461053c6103c0515afa15610b8f57601f3d1115610b8f5761052051610500526000610500511115610b8f57636e553f6561052052610500516105405233610560526103e0513b15610b8f5760006000604461053c60006103e0515af115610b8f576000600055005b63dd62ed3e8114156106b3576004358060a01c610b8f57809050610140526024358060a01c610b8f578090506101605234610b8f5760016101405160e05260c052604060c0206101605160e05260c052604060c02054610180526020610180f35b505b005b600061028051181561086757600261016051141561071f5763d2fb954c6102a052610280516102c052610180516102e0526101a051610300526102205161032052610140513b15610b8f576000600060846102bc61024051610140515af115610b8f57610862565b60036101605114156107835763a31851796102a052610280516102c052610180516102e0526101a051610300526101c051610320526102205161034052610140513b15610b8f576000600060a46102bc61024051610140515af115610b8f57610861565b60046101605114156107ef5763384e03db6102a052610280516102c052610180516102e0526101a051610300526101c051610320526101e051610340526102205161036052610140513b15610b8f576000600060c46102bc61024051610140515af115610b8f57610860565b600561016051141561085f57631b61222b6102a052610280516102c052610180516102e0526101a051610300526101c051610320526101e0516103405261020051610360526102205161038052610140513b15610b8f576000600060e46102bc61024051610140515af115610b8f575b5b5b5b610b8d565b6102605115610a0c5760026101605114156108ca5763ee22be236102a052610180516102c0526101a0516102e0526102205161030052600161032052610140513b15610b8f576000600060846102bc61024051610140515af115610b8f57610a07565b600361016051141561092c57632b6e993a6102a052610180516102c0526101a0516102e0526101c051610300526102205161032052600161034052610140513b15610b8f576000600060a46102bc61024051610140515af115610b8f57610a06565b60046101605114156109965763dc3a2d816102a052610180516102c0526101a0516102e0526101c051610300526101e051610320526102205161034052600161036052610140513b15610b8f576000600060c46102bc61024051610140515af115610b8f57610a05565b6005610160511415610a045763c25fd5656102a052610180516102c0526101a0516102e0526101c051610300526101e0516103205261020051610340526102205161036052600161038052610140513b15610b8f576000600060e46102bc61024051610140515af115610b8f575b5b5b5b610b8c565b6002610160511415610a6057630b4c7e4d6102a052610180516102c0526101a0516102e0526102205161030052610140513b15610b8f576000600060646102bc61024051610140515af115610b8f57610b8b565b6003610160511415610abc57634515cef36102a052610180516102c0526101a0516102e0526101c051610300526102205161032052610140513b15610b8f576000600060846102bc61024051610140515af115610b8f57610b8a565b6004610160511415610b205763029b2f346102a052610180516102c0526101a0516102e0526101c051610300526101e051610320526102205161034052610140513b15610b8f576000600060a46102bc61024051610140515af115610b8f57610b89565b6005610160511415610b885763847384996102a052610180516102c0526101a0516102e0526101c051610300526101e0516103205261020051610340526102205161036052610140513b15610b8f576000600060c46102bc61024051610140515af115610b8f575b5b5b5b5b5b565b600080fd5b610004610b9803610004600039610004610b98036000f3

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.