Hafiz Hamza Javed
Hafiz Hamza Javed

Reputation: 1

Delegate Call to pancakeswap v3 router for exactINput

How can I delegate call from a contract to pancakeswap v3 router for exactInput using abi.encodeWithSignature. I am having a problem sending it to the router here is the code

function exactInputSingle(address token0, address token1, uint256 amountIn, uint24 fee, address recipient) external pure returns (bytes memory){

ExactInputSingleParams memory exactInputSingleParams = ExactInputSingleParams({
            tokenIn : token0,
            tokenOut : token1,
            fee : fee,
            recipient : recipient,
            amountIn : amountIn,
            amountOutMinimum : 0,
            sqrtPriceLimitX96 : 0
        });
    return abi.encodeWithSignature("exactInputSingle(ExactInputSingleParams)", exactInputSingleParams);
}

Upvotes: 0

Views: 98

Answers (0)

Related Questions