full output:
Error: VM Exception while processing transaction: reverted with reason string 'TransferHelper: TRANSFER_FROM_FAILED'
at UniswapV2Router02.safeTransferFrom (contracts/libraries/TransferHelper.sol:22)
at UniswapV2Router02.swapExactTokensForTokensSupportingFeeOnTransferTokens (contracts/UniswapV2Router02.sol:347)
at UniswapV2Router02.swapExactTokensForETHSupportingFeeOnTransferTokens (contracts/UniswapV2Router02.sol:380)
at MyToken.swapTokensForETH (contracts/MyToken.sol:592)
at MyToken.swapAndLiquify (contracts/MyToken.sol:566)
at MyToken._transfer (contracts/MyToken.sol:527)
at MyToken.transfer (contracts/MyToken.sol:450)
Jun 17, 2022, 2:32 PM
where are you getting this? my error traces are always shit and never help me that much haha
Jun 17, 2022, 2:50 PM
scaffold-eth
Jun 18, 2022, 10:29 AM
😄
Jun 18, 2022, 12:12 PM
I'm getting this error when trying to swap my token using locally deployed uniswapv2 contracts
I've tried everything I could think of
wasted a week on this
Jun 18, 2022, 1:23 PM
I can't find "'TransferHelper: TRANSFER_FROM_FAILED" event.
Maybe you changed the code.
If the token which you want to exchange is created by you, see it carefully.
For find bug, i need token and router code.
Maybe you changed the code.
If the token which you want to exchange is created by you, see it carefully.
For find bug, i need token and router code.
the revert event name in git source is 'TransferHelper::transferFrom: transferFrom failed'
Jun 18, 2022, 1:34 PM
.-.
do a pastebin of the contract and the tx to the router
do a pastebin of the contract and the tx to the router
Jun 18, 2022, 2:05 PM
I solved it, will share the solution later
Jun 18, 2022, 5:25 PM
wrong router?
Jun 18, 2022, 5:46 PM
had to change the code hash in UniswapV2Library
Jun 18, 2022, 6:44 PM
👍
Jun 19, 2022, 2:04 AM