UniswapV3的router是不是在sepolia以及op,arb的sepolia实现exactInputSingle不一样了?

例如这是我在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);
    }
请先 登录 后评论

2 个回答

Tiny熊 - 布道者
  擅长:智能合约,以太坊
请先 登录 后评论
? or ?
请先 登录 后评论