This plug routes a token swap through a solver, selling an input asset for an output asset and verifying the result. It asks the caller for amount_in, token_in, min_out, and token_out. It fires on execution, transferring amount_in of token_in to the solver and reverting unless the token_out balance gained is at least min_out. Running this by hand or against a stale min_out risks settling a swap that returns less output than the floor the caller set.
Actions · 9
Get
Holds an address as a named value that later steps reference.
Getbalanceofheldby
Reads a token balance held by an address, native or ERC-20.
Transferto
Sends a token from the socket to another address, native or ERC-20.
Getsolution
Hands tokens already transferred to the solver over for routing, then verifies the outcome.
Getbalanceofheldby
Reads a token balance held by an address, native or ERC-20.
Calculate
Applies a binary arithmetic operation to two values and returns the result.
Is
Compares two values with a chosen operator and returns a boolean.
Steers control flow by comparing two values: branch, loop, or require the condition holds.
Endblock
Closes the innermost open block, whether a conditional branch or a loop.
Related plugs · 8
Not ready to run as it stands: it waits on values or a position of your own.