IMilkman
Interface for the Milkman contract that handles async swaps via CoW Protocol
https://github.com/cowdao-grants/milkman/blob/3b02b80a512b30194efc1debe5fcf0747de6b561/src/Milkman.sol
Functions
requestSwapExactTokensForTokens
Request an async swap of exact tokens for tokens
function requestSwapExactTokensForTokens(
uint256 amountIn,
IERC20 fromToken,
IERC20 toToken,
address to,
bytes32 appData,
address priceChecker,
bytes calldata priceCheckerData
)
external;
Parameters
Name | Type | Description |
---|---|---|
amountIn | uint256 | The amount of input tokens to swap |
fromToken | IERC20 | The token to swap from |
toToken | IERC20 | The token to swap to |
to | address | The recipient of the output tokens |
appData | bytes32 | The app data to be used in the CoW Protocol order |
priceChecker | address | The price checker contract to validate the swap |
priceCheckerData | bytes | Data to pass to the price checker |
cancelSwap
Cancel a requested swap
function cancelSwap(
uint256 amountIn,
IERC20 fromToken,
IERC20 toToken,
address to,
bytes32 appData,
address priceChecker,
bytes calldata priceCheckerData
)
external;
Parameters
Name | Type | Description |
---|---|---|
amountIn | uint256 | The amount that was to be swapped |
fromToken | IERC20 | The from token |
toToken | IERC20 | The to token |
to | address | The recipient |
appData | bytes32 | |
priceChecker | address | The price checker that was used |
priceCheckerData | bytes | The price checker data that was used |
Events
SwapRequested
Event emitted when a swap is requested
event SwapRequested(
address orderContract,
address orderCreator,
uint256 amountIn,
address fromToken,
address toToken,
address to,
bytes32 appData,
address priceChecker,
bytes priceCheckerData
);