I am experimenting with Uniswap's swapExactTokensForTokensSupportingFeeOnTransferTokens
method by attempting to swap USDC -> WETH -> UNI-v2
using ethers.js
just for the sake of understanding how the function works.
My transaction fails with error TransferHelper: TRANSFER_FROM_FAILED
that in my experience is almost always caused by not calling the approve
method before the swap. Surely enough, when I check the parity trace on Goerli's etherscan.io I see that the error returned from the last call in my transaction is (ERC20: transfer amount exceeds allowance)
. My question is, which contract must I approve here? Approving Uniswap's v2 router did not work.
Here is such a failed transaction: https://goerli.etherscan.io/tx/0x677fef980f6e7ee813282811cb2edcf8bc71ceb6f61a9969574506084e89b112