Encoding the params in swaprouter function error #3480
Unanswered
brinal8055
asked this question in
Q&A
Replies: 3 comments 1 reply
-
Try to debug this with tenderly. Doesn't see that something is wrong or the problem is related to the params. |
Beta Was this translation helpful? Give feedback.
1 reply
-
unfortunately I could not understand your problem, and I have another one that you seem to have solved. |
Beta Was this translation helpful? Give feedback.
0 replies
-
You will not need "from: WALLET_ADDRESS" in txArgs, when you use signer. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I am trying to use multicall function in Uniswap V3 using ethers.js. I am stuck in one problem, my transaction are failing (https://etherscan.io/tx/0xd3b876420f97db7ddaa6309e7fc561906303892319cbf830444023fc5ca9d522). At the moment I am using two function swapExactTokensfortokens and RefundEth. I am encoding both these functions with contract.interface.encodeFunctionData() and again encoding the encoded data with multicall function. I think the problem is because Uniswap is not able to decode the encoded function (swapExactTokensfortokens). Here's my code :
const swapRouterContract = new ethers.Contract(
V3SwapRouterAddress,
V3SwapRouterABI.concat(PeripheryPaymentsABI).concat(MulticallABI).concat(ERC20MinimalABI).concat(V2Router02ABI),
signer
)
const params1 = {
tokenIn: tokenInParsed,
tokenOut: tokenOutParsed,
fee: 3000,
recipient: WALLET_ADDRESS,
deadline: Math.floor(Date.now() / 1000) + (60 * 10),
amountIn: amountInParsed.toHexString(),
amountOutMinimum: 0,
sqrtPriceLimitX96: 0
}
Can anyone please suggest where am I wrong ??
Beta Was this translation helpful? Give feedback.
All reactions