RouterSwapExecutor
Inherits: IRouterSwapExecutor
State Variables
router
address public immutable router;
nativeToken
address public immutable nativeToken;
Functions
onlyRouter
modifier onlyRouter();
constructor
constructor(address router_, address nativeToken_);
swap
function used to swap tokens.
function swap(SwapAndAddData memory params_)
external
payable
onlyRouter
returns (uint256 amount0Diff, uint256 amount1Diff);
Parameters
Name | Type | Description |
---|---|---|
params_ | SwapAndAddData | struct containing all the informations for swapping. |
Returns
Name | Type | Description |
---|---|---|
amount0Diff | uint256 | the difference in token0 amount before and after the swap. |
amount1Diff | uint256 | the difference in token1 amount before and after the swap. |
receive
receive() external payable;