Search
⌃K

UniV3Wrapper

Methods

name

function name() external view returns (string)
SwapWrapper name.

Returns

Name
Type
Description
_0
string
undefined

swap

function swap(address _tokenIn, address _tokenOut, address _recipient, uint256 _amount, bytes _data) external payable returns (uint256)
swap handles all swaps on Uniswap v3.
In the case of an ERC20 swap, this contract first possesses the _amount via transferFrom and therefore preconditionally requires an ERC20 approval from the caller.

Parameters

Name
Type
Description
_tokenIn
address
Token in (or for ETH, 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE).
_tokenOut
address
Token out (or for ETH, 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE).
_recipient
address
Recipient of the swap output.
_amount
uint256
Amount of _tokenIn.
_data
bytes
Abi encoded fee, deadline, amountOutMinimum, sqrtPriceLimitX96. e.g. bytes memory _data = abi.encode(uint24(3000), uint256(1649787227), uint256(0), uint160(0));

Returns

Name
Type
Description
_0
uint256
undefined

swapRouter

function swapRouter() external view returns (contract ISwapRouter)
A deployed Uniswap v3 SwapRouter. See https://docs.uniswap.org/protocol/reference/deployments.

Returns

Name
Type
Description
_0
contract ISwapRouter
undefined

weth

function weth() external view returns (contract IWETH9)
WETH contract.

Returns

Name
Type
Description
_0
contract IWETH9
undefined

Events

WrapperSwapExecuted

event WrapperSwapExecuted(address indexed tokenIn, address indexed tokenOut, address sender, address indexed recipient, uint256 amountIn, uint256 amountOut)
Event emitted after a successful swap.

Parameters

Name
Type
Description
tokenIn indexed
address
undefined
tokenOut indexed
address
undefined
sender
address
undefined
recipient indexed
address
undefined
amountIn
uint256
undefined
amountOut
uint256
undefined

Errors

ETHAmountInMismatch

error ETHAmountInMismatch()
Last modified 2d ago