Supply if a Token Balance Is 0
0x484428507A212cA56D71baa27Ca6089a6dB63a88

What this does

This plug supplies an asset to an Aave market when no aToken position for it yet exists. It asks the caller for the supply token, the Aave market address, the wallet to check, and the amount to supply. It reads that wallet's aToken balance from the reserve and fires only when the balance equals zero. Checking the balance and supplying by hand risks depositing on top of an existing position or acting on a stale reading.

Actions · 6

  • Get asset data
    Get asset data of in
    Reads an Aave reserve's live rates and token addresses, with supply and borrow APYs.
  • Get token balance
    Get balance of held by
    Reads a token balance held by an address, native or ERC-20.
  • Compare two values
    Is
    Compares two values with a chosen operator and returns a boolean.
  • Predicate
    Steers control flow by comparing two values: branch, loop, or require the condition holds.
  • Supply
    Supply to
    Supplies an asset to an Aave market, minting aTokens to the wallet.
  • End block
    End block
    Closes the innermost open block, whether a conditional branch or a loop.

Related plugs · 8