RouterSwapExecutor

Git Source

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

NameTypeDescription
params_SwapAndAddDatastruct containing all the informations for swapping.

Returns

NameTypeDescription
amount0Diffuint256the difference in token0 amount before and after the swap.
amount1Diffuint256the difference in token1 amount before and after the swap.

receive

receive() external payable;