Skip to content
This repository has been archived by the owner on Jul 31, 2021. It is now read-only.

Swap safemoon failed #394

Open
xzjcool opened this issue Apr 26, 2021 · 0 comments
Open

Swap safemoon failed #394

xzjcool opened this issue Apr 26, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@xzjcool
Copy link
Contributor

xzjcool commented Apr 26, 2021

Bug Description

Can't swap safemoon token for most of the time, even increase the slippage to 20%.

The root cause is that the swap code will estimate swapExactTokensForETH and swapExactTokensForETHSupportingFeeOnTransferTokens. Sometimes estimate swapExactTokensForETH will succeed because of the high slippage, but can't send the tx to chain. the error is below:
image

The corresponding contract code is:

image
the balance change all the time for this kind of tokens

So tokens which charge fees need to always estimate swapExactTokensForETHSupportingFeeOnTransferTokens and use swapExactTokensForETHSupportingFeeOnTransferTokens to swap.

Steps to Reproduce

Expected Behavior

Additional Context

@xzjcool xzjcool added the bug Something isn't working label Apr 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant