Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Commit 2cd287b

Browse files
committed
Patch natspecs for UnoswapRouter-uniswapV3SwapCallback
1 parent 84da126 commit 2cd287b

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

docs/aggregation-protocol/smart-contract/UnoswapRouter.md

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -462,22 +462,7 @@ function uniswapV3SwapCallback(
462462
bytes
463463
) external
464464
```
465-
Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.
465+
See {IUniswapV3SwapCallback-uniswapV3SwapCallback}
466+
Called by UniswapV3 pool during the swap operation initiated by UnoswapRouter's methods with UniswapV3. This callback function ensures the proper transfer of tokens based on the swap's configuration. It handles the transfer of tokens by either directly transferring the tokens from the payer to the recipient, or by using a secondary permit contract to transfer the tokens if required by the pool. It verifies the correct pool is calling the function and uses inline assembly for efficient execution and to access low-level EVM features.
466467

467-
In the implementation you must pay the pool tokens owed for the swap.
468-
The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.
469-
amount0Delta and amount1Delta can both be 0 if no tokens were swapped.
470-
471-
#### Parameters:
472-
| Name | Type | Description |
473-
| :--- | :--- | :------------------------------------------------------------------- |
474-
|`amount0Delta` | int256 | 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.
475-
|`amount1Delta` | int256 | 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.
476-
|`` | bytes | Any data passed through by the caller via the IUniswapV3PoolActions#swap call
477-
478-
479-
#### Return values
480-
| Name | Type | Description |
481-
| :--- | :--- | :------------------------------------------------------------------- |
482-
|`returnAmount` | uint256 | The actual amount of tokens received after the swap through all three pools
483468

0 commit comments

Comments
 (0)