Uniswap / interface

🦄 Open source interfaces for the Uniswap protocol
https://app.uniswap.org
GNU General Public License v3.0
4.94k stars 5.01k forks source link

`Internal JSON-RPC error` when swapping > 0.51 SNX on Optimistic Uniswap #2526

Open platocrat opened 3 years ago

platocrat commented 3 years ago

Bug Description Whenever a user tries to swap > 0.51 SNX for another token, they receive the following error:

Screen Shot 2021-10-11 at 3 44 56 PM

If the user is swapping < 0.51 SNX, this error does not appear.

Steps to Reproduce

  1. Go to https://app.uniswap.org
  2. Switch to Optimistic Ethereum network
  3. Swap 0.51 SNX for ETH
  4. Reject transaction
  5. Swap 0.52 SNX for ETH
  6. See error.

Expected Behavior There shouldn't be a limit to how much SNX users can swap at any time.

Additional Context Someone from Synthetix's discord reported this issue in Optimism's discord.

willhennessy commented 3 years ago

Thanks for the report platocrat! I am seeing sufficient liquidity in the eth/snx pools so I don't know why an STF error would occur. Jordan do you have any ideas?

Screen Shot 2021-10-12 at 11 29 32 PM
thomasWos commented 3 years ago

2243, maybe the issue here

platocrat commented 3 years ago

@willhennessy @thomasWos were you two able to confirm that there is indeed a limit on how much SNX a user can deposit?

This is quite a big user for the Synthetix community

JFrankfurt commented 3 years ago

see

https://github.com/Uniswap/v3-periphery/blob/b23b6cce28ae33548365cef6c1f6d2f94ee4faef/test/NonfungiblePositionManager.spec.ts#L190

and

https://github.com/Uniswap/v3-periphery/blob/9ca9575d09b0b8d985cc4d9a0f689f7a4470ecb7/contracts/libraries/TransferHelper.sol

Looks like these users likely have lower approvals on Optimism than they need to execute their transactions.

@platocrat - is the 0.51 constant across all users, or do they have different thresholds?

Regardless, I'll take a look at the interface approval code to make sure users are seeing the approval UI when they need to.

thomasWos commented 3 years ago

I have the issue even with less than 0.51 SNX. Currently I can't swap any SNX tokens. I have the "Confirm Swap" popup that is looping and these errors in the Chrome console every time I press on the "Confirm Swap" button:

Screen Shot 2021-10-16 at 1 24 11 pm
SamusElderg commented 2 years ago

Any update on this one? Still appears to be an issue (even with amounts below 0.51 SNX)