# V3SwapRouter

&#x20;This contract is Router for stateless execution of swaps against KLAYswap V3

## Code

Github Link: (Will be updated after official launch)<br>

## Address

* Cypress : [0x6c14e2e4bae412137437a8ec9e57263212d141a0](https://scope.klaytn.com/account/0x6C14E2e4bae412137437A8Ec9e57263212d141A0?tabId=txList)

## Events, Read-Only Functions, and State-Changing Functions

{% tabs %}
{% tab title="Parameter Structs" %}

## Parameter Structs

#### ExactInputSingleParams[​](https://docs.uniswap.org/contracts/v3/reference/periphery/interfaces/ISwapRouter#exactinputsingleparams) <a href="#exactinputsingleparams" id="exactinputsingleparams"></a>

```solidity
struct ExactInputSingleParams {
    address tokenIn;
    address tokenOut;
    uint24 fee;
    address recipient;
    uint256 deadline;
    uint256 amountIn;
    uint256 amountOutMinimum;
    uint160 sqrtPriceLimitX96;
}
```

#### ExactInputParams[​](https://docs.uniswap.org/contracts/v3/reference/periphery/interfaces/ISwapRouter#exactinputparams) <a href="#exactinputparams" id="exactinputparams"></a>

```solidity
struct ExactInputParams {
   bytes path;
   address recipient;
   uint256 deadline;
   uint256 amountIn;
   uint256 amountOutMinimum;
}
```

#### ExactOutputSingleParams[​](https://docs.uniswap.org/contracts/v3/reference/periphery/interfaces/ISwapRouter#exactoutputsingleparams) <a href="#exactoutputsingleparams" id="exactoutputsingleparams"></a>

```solidity
struct ExactOutputSingleParams {
    address tokenIn;
    address tokenOut;
    uint24 fee;
    address recipient;
    uint256 deadline;
    uint256 amountOut;
    uint256 amountInMaximum;
    uint160 sqrtPriceLimitX96;
}
```

#### ExactOutputParams[​](https://docs.uniswap.org/contracts/v3/reference/periphery/interfaces/ISwapRouter#exactoutputparams) <a href="#exactoutputparams" id="exactoutputparams"></a>

```solidity
struct ExactOutputParams {
    bytes path;
    address recipient;
    uint256 deadline;
    uint256 amountOut;
    uint256 amountInMaximum;
}
```

{% endtab %}

{% tab title="State-Changing Functions" %}

## **State-Changing Functions**

#### uniswapV3SwapCallback[​](https://docs.uniswap.org/contracts/v3/reference/periphery/SwapRouter#uniswapv3swapcallback) <a href="#uniswapv3swapcallback" id="uniswapv3swapcallback"></a>

```solidity
function uniswapV3SwapCallback(
    int256 amount0Delta,
    int256 amount1Delta,
    bytes data
) external
```

Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.

In the implementation you must pay the pool tokens owed for the swap. The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory. amount0Delta and amount1Delta can both be 0 if no tokens were swapped.

**Parameters:**[**​**](https://docs.uniswap.org/contracts/v3/reference/periphery/SwapRouter#parameters)

<table><thead><tr><th width="174">Name</th><th width="83">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>amount0Delta</code></td><td>int256</td><td>The amount of token0 that was sent (negative) or must be received (positive) by the pool by the end of the swap. If positive, the callback must send that amount of token0 to the pool.</td></tr><tr><td><code>amount1Delta</code></td><td>int256</td><td>The amount of token1 that was sent (negative) or must be received (positive) by the pool by the end of the swap. If positive, the callback must send that amount of token1 to the pool.</td></tr><tr><td><code>data</code></td><td>bytes</td><td>Any data passed through by the caller via the IUniswapV3PoolActions#swap call</td></tr></tbody></table>

#### exactInputSingle[​](https://docs.uniswap.org/contracts/v3/reference/periphery/SwapRouter#exactinputsingle) <a href="#exactinputsingle" id="exactinputsingle"></a>

```solidity
function exactInputSingle(
    struct ISwapRouter.ExactInputSingleParams params
) external returns (uint256 amountOut)
```

Swaps `amountIn` of one token for as much as possible of another token

**Parameters:**[**​**](https://docs.uniswap.org/contracts/v3/reference/periphery/SwapRouter#parameters-1)

<table><thead><tr><th width="116.66666666666666">Name</th><th width="203">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>params</code></td><td><code>struct ISwapRouter.ExactInputSingleParams</code></td><td>The parameters necessary for the swap, encoded as <code>ExactInputSingleParams</code> in calldata</td></tr></tbody></table>

**Return Values:**[**​**](https://docs.uniswap.org/contracts/v3/reference/periphery/SwapRouter#return-values)

<table><thead><tr><th width="147.66666666666666">Name</th><th width="133">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>amountOut</code></td><td>uint256</td><td>The amount of the received token</td></tr></tbody></table>

#### exactInput[​](https://docs.uniswap.org/contracts/v3/reference/periphery/SwapRouter#exactinput) <a href="#exactinput" id="exactinput"></a>

```solidity
function exactInput(
    struct ISwapRouter.ExactInputParams params
) external returns (uint256 amountOut)
```

Swaps `amountIn` of one token for as much as possible of another along the specified path

**Parameters:**[**​**](https://docs.uniswap.org/contracts/v3/reference/periphery/SwapRouter#parameters-2)

<table><thead><tr><th width="121.66666666666666">Name</th><th width="197">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>params</code></td><td><code>struct ISwapRouter.ExactInputParams</code></td><td>The parameters necessary for the multi-hop swap, encoded as <code>ExactInputParams</code> in calldata</td></tr></tbody></table>

**Return Values:**[**​**](https://docs.uniswap.org/contracts/v3/reference/periphery/SwapRouter#return-values-1)

<table><thead><tr><th width="157.66666666666666">Name</th><th width="123">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>amountOut</code></td><td>uint256</td><td>The amount of the received token</td></tr></tbody></table>

#### exactOutputSingle[​](https://docs.uniswap.org/contracts/v3/reference/periphery/SwapRouter#exactoutputsingle) <a href="#exactoutputsingle" id="exactoutputsingle"></a>

```solidity
function exactOutputSingle(
    struct ISwapRouter.ExactOutputSingleParams params    
) external returns (uint256 amountIn)
```

Swaps as little as possible of one token for `amountOut` of another token

**Parameters:**[**​**](https://docs.uniswap.org/contracts/v3/reference/periphery/SwapRouter#parameters-3)

<table><thead><tr><th width="113.66666666666666">Name</th><th width="225">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>params</code></td><td><code>struct ISwapRouter.ExactOutputSingleParams</code></td><td>The parameters necessary for the swap, encoded as <code>ExactOutputSingleParams</code> in calldata</td></tr></tbody></table>

**Return Values:**[**​**](https://docs.uniswap.org/contracts/v3/reference/periphery/SwapRouter#return-values-2)

<table><thead><tr><th width="137.66666666666666">Name</th><th width="100">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>amountIn</code></td><td>uint256</td><td>The amount of the input token</td></tr></tbody></table>

#### exactOutput[​](https://docs.uniswap.org/contracts/v3/reference/periphery/SwapRouter#exactoutput) <a href="#exactoutput" id="exactoutput"></a>

```solidity
function exactOutput(
    struct ISwapRouter.ExactOutputParams params
) external returns (uint256 amountIn)
```

Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed)

**Parameters:**[**​**](https://docs.uniswap.org/contracts/v3/reference/periphery/SwapRouter#parameters-4)

<table><thead><tr><th width="130.66666666666666">Name</th><th width="199">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>params</code></td><td><code>struct ISwapRouter.ExactOutputParams</code></td><td>The parameters necessary for the multi-hop swap, encoded as <code>ExactOutputParams</code> in calldata</td></tr></tbody></table>

**Return Values:**[**​**](https://docs.uniswap.org/contracts/v3/reference/periphery/SwapRouter#return-values-3)

<table><thead><tr><th width="140.66666666666666">Name</th><th width="114">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>amountIn</code></td><td>uint256</td><td>The amount of the input token</td></tr></tbody></table>
{% endtab %}
{% endtabs %}
