Omniscia vfat Audit

UniswapV3Connector Manual Review Findings

UniswapV3Connector Manual Review Findings

UVR-01M: Improper Implementation of Empty Functions

TypeSeverityLocation
Logical FaultUniswapV3Connector.sol:
I-1: L85-L88
I-2: L90-L93

Description:

The referenced functions represent empty implementations meant to satisfy a parent interface that the UniswapV3Connector inherits so that it can be non-abstract.

However, they presently result in no-ops that would seemingly cause them to "succeed" for external observers.

Impact:

The UniswapV3Connector::depositExistingNft and UniswapV3Connector::withdrawNft functions appear to succeed when invoked even though they do not execute any statements.

Example:

contracts/connectors/UniswapV3Connector.sol
85function depositExistingNft(
86 NftPosition calldata, // position,
87 bytes calldata // extraData
88) external payable virtual override { }
89
90function withdrawNft(
91 NftPosition calldata, // position,
92 bytes calldata // extraData
93) external payable virtual override { }

Recommendation:

We advise the code to revert akin to other connector implementations such as SlipstreamNftConnector::swapExactTokensForTokens, properly signaling that those functions are inaccessible in the base UniswapV3Connector implementation.

Alleviation (6ab7af3bb495b817ffec469255ea679b1813eecb):

The vfat team evaluated this exhibit and has opted to acknowledge it in its current implementation so as to maintain compatibility with the NftFarmStrategy implementation.

UVR-02M: Incorrect Approval Target

Description:

The referenced approval operation specifies that the extraData.pool is meant to be approved when in reality the swap.router should be.

Impact:

As there is no other usage of the UniswapV3SwapExtraData structure, we infer that the pool is a misnomer rather than an actual incorrectly approved address and thus consider this exhibit to be of minor severity due to potential misuse of the function.

Example:

contracts/connectors/UniswapV3Connector.sol
66function swapExactTokensForTokens(
67 SwapParams memory swap
68) external payable virtual override {
69 UniswapV3SwapExtraData memory extraData =
70 abi.decode(swap.extraData, (UniswapV3SwapExtraData));
71
72 IERC20(swap.tokenIn).approve(address(extraData.pool), swap.amountIn);
73
74 ISwapRouter(swap.router).exactInput(
75 ISwapRouter.ExactInputParams({
76 path: extraData.path,
77 recipient: address(this),
78 deadline: block.timestamp + 1,
79 amountIn: swap.amountIn,
80 amountOutMinimum: swap.minAmountOut
81 })
82 );
83}

Recommendation:

We advise this to be corrected, ensuring that exact input swaps behave as expected.

Alleviation (6ab7af3bb495b817ffec469255ea679b1813eecb):

The target of the approval operation has been corrected as advised, alleviating this exhibit.