Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

157
Views
Usando swapExactTokensForTokens obtenemos el error TRANSFER_FROM_FAILED

Estamos tratando de "intercambiar tokens exactos por tokens" para intercambiar cualquier token, y funciona bien, pero recibimos este error en la cadena de bloques:

TRANSFER_FROM_FAILED

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

Cuando usamos "swapETHForExactTokens", realiza el intercambio, pero solo puede usar MATIC/ETH/BNB como token1, y queremos intercambiar cualquier token. ¿Sabes cómo resolver esto?

CÓDIGO: (no estamos aprobando contratos en código antes, pero los estamos aprobando en el escaneo de polígonos).

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

¡Gracias!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!