swapExactTokensForTokens Error

Hi everyone,
I’m using NodeJS and ethers.
And I have an issue when trying to swap tokens (WBNB & BUSD) calling swapExactTokensForTokens:
reason: ‘transaction failed’, code: ‘CALL_EXCEPTION’,

I tried to call “approve” before(it works fine), but the problem persists and I’m 99.99% sure my params are ok, so I’m wondering if it couldn’t be a problem from the Moralis endpoint.
Of course, when I call the function, the Transaction Fee works.
my gazprice is 5 converted in Gwei, and Gaslimit is 50000(tried 200000, same pb)

If anyone has some idea…
Thanks in advance.

1 Like

Hi,
Can you give more details, like the transaction ids that failed?

Hi CryptoKid, thanks for your return.
I think I have found the reason. the gas limit was not high enough for some reason.
I put it at 600000 and it works.
What’s the best way to set and deal with that gas limit info?