How do the Uniswap Router contract functions ending in "SupportingFeeOnTransferTokens" work?

Viewed 506

The Uniswap router contract has a few methods ending in *SupportingFeeOnTransferTokens, e.g. swapExactTokensForETHSupportingFeeOnTransferTokens.

https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/UniswapV2Router02.sol

I vaguely (think I) understand that these methods are supposed to be called for swapping tokens that somehow take a tax/rake during transfers.

I have a few questions regarding these:

  1. In a nutshell, what is the difference in behavior for these functions different from the regular swap functions? Do they somehow interact with the minOut parameters?

  2. How does the Dex UI know which method to call? How does it know the SupportingFee version needs to be called instead of the standard swap?

  3. What happens if my web3 script calls the wrong version of the method? Failures? Wrong amounts out?

Thanks in advance!

0 Answers
Related