Flash swaps will optimistically send tokens out during swaps before the input tokens are requested. This will enable the output of a swap to be used for payments in other integrated protocols.
Changes:
Adds callbackData argument to swap(). This argument is passed to the callback() to msg.sender. If the length of data is 0, it will not do the callback and instead use _transferFrom().
Adds the ISwapCallback interface to define the callback function.
Re-orders the business logic of the swap token transfers to transfer the tokens to recipient before the input tokens are required/requested.
Concerns:
cross pool interaction using flash swaps
incorrect usage of callback
arbitrary data passed through the swap entrypoint is arbitrary (but only used in the callback call)
Flash swaps will optimistically send tokens out during swaps before the input tokens are requested. This will enable the output of a swap to be used for payments in other integrated protocols.
Changes:
callbackData
argument toswap()
. This argument is passed to the callback() tomsg.sender
. If the length of data is0
, it will not do the callback and instead use_transferFrom()
.ISwapCallback
interface to define the callback function.recipient
before the input tokens are required/requested.Concerns: