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?