Hello guys, please tell me what is the correct use of the pancake interface (SwapExactEthForTokens function) in your smart contract? I spent all day searching, got only the TRANSFER_FROM_FAILED error and execution reverted. Thanks

Aug 17, 2022, 6:56 PM
Did you remember to approve the router to spend the tokens?
Aug 17, 2022, 7:06 PM
Yes, I included. Using the SwapTokensForTokens function works better, but is not without bugs. I'm still testing functionality
Aug 17, 2022, 7:55 PM
I typically use swapExactTokensForTokensSupportingFeeOnTransfer regardless of what tokens are being traded. It has the best success rate in my experience
Aug 17, 2022, 8:05 PM
Is it possible to use try 1function catch 2function?
Aug 17, 2022, 8:24 PM

© 2024 Draquery.com All rights reserved.