Uniswap / interface

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

Unknown error: "Internal JSON-RPC error.". Try increasing your slippage tolerance. #2243

Open platocrat opened 3 years ago

platocrat commented 3 years ago

These bugs were surfaced from community members in Optimism's Discord server.

Bug Description On rare occasions when you attempt to make a swap, you will receive an error that says something like:

Unknown error: "Internal JSON-RPC error.". Try increasing your slippage tolerance. Note: fee on transfer and rebase tokens are incompatible with Uniswap V3.

Steps to Reproduce

  1. Go to https://app.uniswap.org
  2. Switch your network to Optimistic Ethereum
  3. Try swapping any token.
  4. Click the Swap button.
  5. Click Confirm Swap.
  6. Reject the transaction in MetaMask.
  7. Repeat steps 3 - 6 until you see the following error.

Expected Behavior Clicking Swap should bring up the Confirm Swap modal.

Additional Context Here are screenshots of the community members sharing the error messages they received.

Screen Shot 2021-08-25 at 8 29 44 AM Screen Shot 2021-08-25 at 8 28 16 AM

On reproducibility

I am able to reproduce this error only rarely. However, I've noticed that it tends to happen after I approve a token for trading, e.g. USDC.

For one of the users in the screenshot above, they say that they still cannot make a swap due to this error showing up incessantly.

zzmp commented 3 years ago

"Try increasing your slippage tolerance" seems to be a default message that doesn't apply here. I think the error message could be clearer - this is probably a problem with the JSON-RPC Provider. The error is coming either from the chain or the provider.

As a first step, I think the error message can be cleaned up. As a second step, this should probably be reproduced to determine why metamask is returning a JSON-RPC error in the first place.

muten85 commented 3 years ago

Just as an FYI, I am getting this error constantly and not just once in a while when trying to swap from SNX-ETH or SNX-sUSD. Does it have to do with the liquidity (it should not for SNX-ETH)?

hpzxk commented 3 years ago

FYI: It happens very constantly when I try SNX-DAI or SNX-sUSD, when I use 1.1 SNX swap DAI, it can works but when I use 1.2 SNX swap to DAI, it always fail and pop up this error.

thomasWos commented 3 years ago

Same error, when I try to swap SNX to ETH or sUSD on Optimism

muten85 commented 3 years ago

No error today. Was able to convert ETH to sUSD, sUSD to ETH and SNX to Eth.

FrenchFryChi commented 3 years ago

I'm dealing with the same error and am not able to swap SNX for anything.

thomasWos commented 3 years ago

can't swap SNX on Optimism

Screen Shot 2021-10-13 at 5 14 11 pm
dOanwts commented 2 years ago

Trying to swap base token "mooncrash" to bnb on pancakeswap but getting the issue Unknown error: "Internal JSON-RPC error.". Try increasing your slippage tolerance. Have changed slippage but does not help?

MyLacrosse commented 2 years ago

Object { code: -32603, message: "Internal JSON-RPC error.", data: {…} } ​ code: -32603 ​ data: Object { code: -32000, message: "execution reverted" } ​ message: "Internal JSON-RPC error."

MyLacrosse commented 2 years ago

how to solve it

fcofilhoeth commented 1 year ago

Hi, I managed to solve my "Internal JSON RPC" problem.

  1. Deletes Metamask's Optimism network.
  2. I added the Optimism network over Optimism's Etherscan. Note: The Chainlist was giving an RPC error when adding the new network.
  3. I did the SNX split transaction, because when I tried to make the maximum number of SNX tokens, the RPC error persisted.

I hope it helped you.