Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

159
Vistas
Using swapExactTokensForTokens we get TRANSFER_FROM_FAILED error

We are trying to "swapExactTokensforTokens" for swapping any token, and it runs well, but we get this error at the blockchain:

TRANSFER_FROM_FAILED

https://polygonscan.com/tx/0xf584e421990628131b92b22b2aad270e91752287817eeb518a4d9bdb4b37d086

When we use "swapETHForExactTokens" it makes the trade, but can only use MATIC/ETH/BNB as token1, and we want to trade any tokens. Do you know how to solve this?

CODE: (we are not approving contracts in code before, but we are approving them at polygonscan).

const tx = await router.swapExactTokensForTokens(
        amountIn,
        amountOutMin,
        [tokenIn, tokenOut],
        data.recipient,
        Date.now() + 1000 * 60 * 5, //5 minutes
        {
          'gasLimit': data.gasLimit,
          'gasPrice': data.gasPrice
      });

Thanks!

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda