Uniswap / interface

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

Unable to add liquidity for some tokens, unable to estimate gas error #1582

Open jab416171 opened 3 years ago

jab416171 commented 3 years ago

Bug Description Unable to add liquidity for some tokens, unable to estimate gas error token address: 0x1faa0c671b6336527efd167f7d1c6fc1b8a05d1a

Steps to Reproduce

  1. Add liquidity for test token on rinkeby (v3), I can send some to a dev to reproduce

Expected Behavior Add liquidity works

Additional Context Deobfuscated stack trace:

Error: cannot estimate gas; transaction may fail or may require manual gas limit (error={"code":-32603,"message":"execution reverted: M0","data":{"originalError":{"code":3,"data":"0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000024d30000000000000000000000000000000000000000000000000000000000000","message":"execution reverted: M0"}}}, method="estimateGas", transaction={"from":"0xcB94D511e7CB16dED7C6168a1626e2cc8A198660","to":"0xC36442b4a4522E871399CD717aBDD847Ab11FE88","value":{"type":"BigNumber","hex":"0x011b002037d797a5"},"data":"0xac9650d8000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000002c0000000000000000000000000000000000000000000000000000000000000008413ead5620000000000000000000000001faa0c671b6336527efd167f7d1c6fc1b8a05d1a000000000000000000000000c778417e063141139fce010982780140aa0cd5ab000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000003e7ffd4aefcd2cf2c91f36b6a74000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000164883164560000000000000000000000001faa0c671b6336527efd167f7d1c6fc1b8a05d1a000000000000000000000000c778417e063141139fce010982780140aa0cd5ab000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000214d00000000000000000000000000000000000000000000000000000000000022470000000000000000000000000000000000000000000000000000000174876e800000000000000000000000000000000000000000000000000011b002037d797a500000000000000000000000000000000000000000000000000000016bc3aa02b00000000000000000000000000000000000000000000000001129997b9f363fa000000000000000000000000cb94d511e7cb16ded7c6168a1626e2cc8a19866000000000000000000000000000000000000000000000000000000000609f0aaa00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000412210e8a00000000000000000000000000000000000000000000000000000000","accessList":null}, code=UNPREDICTABLE_GAS_LIMIT, version=providers/5.1.1)
    at Logger.makeError (index.ts:205)
    at Logger.throwError (index.ts:217)
    at checkError (json-rpc-provider.ts:76)
    at WorkaroundWeb3Provider.<anonymous> (json-rpc-provider.ts:508)
    at Generator.throw (<anonymous>)
    at rejected (json-rpc-provider.ts:2)
willhennessy commented 3 years ago

Thanks jab! You referenced https://github.com/Uniswap/uniswap-interface/issues/1583 as a v2 version of this bug, so I think I can de-dupe this one. Feel free to re-open if this is a distinct issue.

jab416171 commented 3 years ago

Hey Will thanks for responding :) I'm not sure if v2 and v3 have different code paths, but I suppose we can see if this bug gets fixed when the other one does or not :)

willhennessy commented 3 years ago

Ah, I thought you meant that was a new and improve version of the bug :). What makes you think this bug is the same issue as #1583 ? The stack traces look different

jab416171 commented 3 years ago

I'm guessing uniswap v2 and v3 use different code paths, but these two bugs are adding liquidity for the same token, on v2 and v3.

jab416171 commented 3 years ago

one outright crashes, and the other one just shows an error in the dev console

willhennessy commented 3 years ago

Got it. I'll reopen this and ask the team if it's the same or different.

justindomingue commented 3 years ago

seems different. @jab416171 could you only reproduce on rinkeby so far?

jab416171 commented 3 years ago

I've only tired on rinkeby, but I have no reason to believe this bug is specific to rinkeby @justindomingue

aress31 commented 3 years ago

@jab416171 same issue for me, can we please get a quick fix? #1650

justindomingue commented 3 years ago

@jab416171 can you send me some of the test token? maybe add me csharpminor#5602 as friend on discord, I can share my dev address

jab416171 commented 3 years ago

I added you and pinged you in the uniswap discord @justindomingue

aress31 commented 3 years ago

Any news on this issue? I am waiting for it to be fixed to be able to resume my tests, please update us on the progresses.

justindomingue commented 3 years ago

I was able to repro. Hoping to get a fix out tomorrow.

justindomingue commented 3 years ago

The issues seem separate. @aress31 is on adding on v3.

@jab416171 I think the issue you reported may just be insufficient funds. We don't do an amazing job at surfacing those errors onto the interface at the moment though. I can get metamask to show up if i deposit a low enough amount of test tokens. However, metamask still won't let me proceed since I don't have enough funds. I'm requesting more eth to test some more.

juminoz commented 3 years ago

I get the same issue on this pair on V2. https://app.uniswap.org/#/add/v2/0x327673aE6B33Bd3d90f0096870059994f30Dc8AF/0xc690F7C7FcfFA6a82b79faB7508c466FEfdfc8c5

micahriggan commented 3 years ago

I get this same problem when attempting to create the ETH/stETH pool with the ranges of

Min Price 0.997 ETH per STETH

Max Price 1 ETH per STETH

The transaction fails to estimate gas.

Screen Shot 2021-05-31 at 4 31 58 PM Screen Shot 2021-05-31 at 4 32 21 PM
willhennessy commented 3 years ago

@justindomingue what's our next step?

hydris-bessa commented 2 years ago

Anyone found a solution ? I have the same error and no clues to fix it . Thanks

balflear commented 2 years ago

Hi guys, The problem still continues for some tokens on Rinkeby test network. I'm unable to add liquidity to the V3 pool for some test tokens and i don't know why. Does anyone found a solution about that?