Swap
0x62180042606624f02D8A130dA8A3171e9b33894d

What this does

This plug swaps one token for another by transferring the input to the solver, routing it, and verifying the received amount. It asks the caller for amount_in, token_in, min_out, and token_out at execution time. It fires whenever called, but reverts unless the post-routing token_out balance gain is greater than or equal to min_out. Running this by hand or against a stale min_out floor risks accepting an output below the intended minimum.

Actions · 9

  • Get address
    Get
    Holds an address as a named value that later steps reference.
  • Get token balance
    Get balance of held by
    Reads a token balance held by an address, native or ERC-20.
  • Transfer tokens
    Transfer to
    Sends a token from the socket to another address, native or ERC-20.
  • 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.
  • Calculate
    Calculate
    Applies a binary arithmetic operation to two values and returns the result.
  • 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.

Related plugs · 8