Swap at Floor
0x581BEf12967f06f2eBfcabb7504fA61f0326CD9A

What this does

This plug sells sellToken through a solver and requires the buyToken balance held by account to reach the pre-routing balance plus minReceive before settling. It asks the caller for account, sellAmount, sellToken, buyToken, and minReceive. It fires whenever the caller runs it, transferring sellAmount to the solver and reverting if routing returns less than the floor. Running this by hand or against a stale quote risks accepting an output below the minReceive floor and losing the difference.

Actions · 11

  • Get token balance
    Get balance of held by
    Reads a token balance held by an address, native or ERC-20.
  • Get address
    Get
    Holds an address as a named value that later steps reference.
  • Transfer tokens
    Transfer to
    Sends a token from the socket to another address, native or ERC-20.
  • Calculate
    Calculate
    Applies a binary arithmetic operation to two values and returns the result.
  • Get solution
    Get solution
    Hands tokens already transferred to the solver over for routing, then verifies the outcome.
  • 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.
  • End block
    End block
    Closes the innermost open block, whether a conditional branch or a loop.
  • Calculate
    Calculate
    Applies a binary arithmetic operation to two values and returns the result.
  • Bubble
    Bubble
    Surfaces a value as an output of this plug.

Related plugs · 8