sushiswap / sushiswap-interface

🍣 An open source interface for the SushiSwap Protocol
https://app.sushi.com
372 stars 708 forks source link

[bug] SushiSwap Arbitrum cannot detect token with taxes #949

Open AdamK222 opened 1 year ago

AdamK222 commented 1 year ago

Is there an existing issue for this?

πŸ–₯ Browser Version

Brave Browser 109.1.47.186

🚧 Current Behavior

image

SushiSwap interface uses V1 function for token which have taxes on sell implemented: 0x18cbafe5 instead of function 0x791ac947.

image

βœ… Expected Behavior

Interface should automatically detect taxes in token smart contract and allow the swap with appropriate slippage set like all other UniswapV2-like DEXes. Otherwise is shows the error in console: Uniswap: K.

πŸ›  Steps To Reproduce

  1. https://www.sushi.com/swap
  2. Connect to Arbitrum through Metamask
  3. Buy Test Token and adjust slippage: ETH -> 0x2285e14D6E92E2B732feA18d86CCe57D73D205c0 (6% tax)
  4. Approve and try to sell it with adjusted slippage: 0x2285e14D6E92E2B732feA18d86CCe57D73D205c0 -> ETH (also 6% tax)
  5. F12 - Open a console to see it attempts to call incorrect function: 0x18cbafe5

🌐 Link to Minimal Reproducible Example or URL

No response

Anything else?

Full hex encoded function which gives error Uniswap K: 0x18cbafe500000000000000000000000000000000000000000000000001aa535d3d0c000000000000000000000000000000000000000000000000000000000000006205a200000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000163c7b8729198e9ccb912f8e29c0daf9e1367cac0000000000000000000000000000000000000000000000000000000063d8298000000000000000000000000000000000000000000000000000000000000000020000000000000000000000002285e14d6e92e2b732fea18d86cce57d73d205c000000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1