2

I'm attempting to swap BCLNC tokens for ETH on Uniswap, but I get the following error:

The transaction cannot succeed due to error: TransferHelper: TRANSFER_FROM_FAILED. This is probably an issue with one of the tokens you are swapping.

However, it is clear that other transactions are successful such as this one.

I've attempted to perform a swapExactTokensForETH directly on the Uniswap contract replicating the details such as Path and the correct values for amountIn, to and deadline, but it attempts to charge me an excessive gas fee (over $160), and MetaMask displays the following error:

ALERT: Transaction Error. Exception thrown in contract code.

Any idea what the issue could be here?

15
  • This error is usually the result of you not calling approve prior to calling transferFrom. Commented Nov 3, 2020 at 13:11
  • In other words: Commented Nov 3, 2020 at 13:15
  • 2
    @Neo I'm really sorry to inform you that you were a victim of a honeypot contract. Look at the ensure modifier, only the owner can make arbitrary transfers.
    – Ismael
    Commented Nov 3, 2020 at 17:28
  • 2
    @Neo Look at transfer and transferFrom both are guarded by ensure modifier. That modifier prevents arbitrary transfers, you can buy tokens from the owner, and from uniswap's pool, but you can't sell them to anyone but the owner.
    – Ismael
    Commented Nov 4, 2020 at 0:55
  • 2
    @Neo You are correct. Another suspicious function is delegate that allows owner arbitrary code execution.
    – Ismael
    Commented Nov 4, 2020 at 13:22

1 Answer 1

-1

It is because your function needs to be payable if your receiver address is a contract

2
  • Thanks for your answer.. but the question is not to transfer Ether. It is to transfer a Token. and it does not need to have wallet payable. Commented Dec 15, 2020 at 13:25
  • ah maybe you need to approve your tokens in order for unsiwap to spend it? Dunno if your tokens are an ERC20 token
    – Maxstgt
    Commented Dec 28, 2020 at 14:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.