例如这是我在polygon mumbai上的接入uniswap v3的代码,更换router后在sepolia就出错了,这是什么问题呢?
function v3SwapERC20(
address _tokenIn,
address _tokenOut,
uint256 amount,
uint24 _fee
) external returns (uint256 v3AmountOut) {
IERC20(_tokenIn).transferFrom(msg.sender,address(this),amount);
IERC20(_tokenIn).approve(address(V3Router), amount);
ISwapRouter.ExactInputSingleParams memory params = ISwapRouter
.ExactInputSingleParams({
tokenIn: _tokenIn,
tokenOut: _tokenOut,
fee: _fee,
recipient: msg.sender,
deadline: block.timestamp,
amountIn: amount,
amountOutMinimum: 0,
sqrtPriceLimitX96: sqrt
});
v3AmountOut = V3Router.exactInputSingle(params);
}