pancakeswap / pancake-frontend

:pancakes: Pancake main features (farms, pools, IFO, lottery, profiles)
https://pancakeswap.finance
GNU General Public License v3.0
2.69k stars 3.55k forks source link

Can't remove liquidity v2 (Bounty $1500) #3480

Closed crowszero12 closed 2 years ago

crowszero12 commented 2 years ago

So I've come accross so many topics over the internet and hit a dead end. this is basically a Token-BNB liquidity and it happened I can't pull it out. Pancakeswap says "ERROR, This transaction would fail", I have almost $30,000 trapped in that liquidity so I'm giving away a bounty - It's better to give something or it might end up trapped forever.

I own the contract and its interacted with PC router and Factory

Tried Solutions : X - Receive WBNB instead of BNB X - Tried it on multiple browsers as well as on metamask app on android X - Tried Approving the owner to the contracts X - Tried increaseallowance

I found someone on an old github post telling setSwapAndLiquifyEnabled set to false but I happen can't find it.

Console error : removeLiquidityETHWithPermit removeLiquidityETHWithPermitSupportingFeeOnTransferTokens

PC router https://bscscan.com/address/0x10ed43c718714eb63d5aa57b78b54704e256024e#code

Factory https://bscscan.com/address/0xca143ce32fe78f1f7019d7d551a6402fc5350c73#code

Kindly DM me your solutions if you have any - Thanks!

zhyd1997 commented 2 years ago

I found the related code here: https://github.com/pancakeswap/pancake-frontend/blob/1e8a4052bde39e4ffdde4fcf3353379dbd5c07a8/src/views/RemoveLiquidity/index.tsx#L252-L256

https://github.com/pancakeswap/pancake-frontend/blob/1e8a4052bde39e4ffdde4fcf3353379dbd5c07a8/src/views/RemoveLiquidity/index.tsx#L292-L309

So I guess the error occurred by estimating the gas fee failed.

zhyd1997 commented 2 years ago

Maybe this is your network issue.

zhyd1997 commented 2 years ago

Check the console carefully and see what else errors are displayed, the 3rd parameter is the real error.

crowszero12 commented 2 years ago

@zhyd1997 so far this is what appears in google chrome inspect Click enable > metamask signature prompt > click remove > this transaction could fail prompts

MetaMask: 'ethereum.send(...)' is deprecated and may be removed in the future. Please use 'ethereum.sendAsync(...)' or 'ethereum.request(...)' instead. For more information, see: https://eips.ethereum.org/EIPS/eip-1193 send @ inpage.js:1 Ee.h.default.createElement.callbacks @ index.js:515 Ee @ index.js:831 (anonymous) @ index.js:408 s @ runtime.js:45 (anonymous) @ runtime.js:274 P.forEach.e. @ runtime.js:97 T @ index.js:30 i @ index.js:48 (anonymous) @ index.js:53 (anonymous) @ index.js:45 he @ index.js:427 ve @ index.js:430 (anonymous) @ index.js:394 s @ runtime.js:45 (anonymous) @ runtime.js:274 P.forEach.e. @ runtime.js:97 T @ index.js:30 i @ index.js:48 Promise.then (async) T @ index.js:39 i @ index.js:48 Promise.then (async) T @ index.js:39 i @ index.js:48 Promise.then (async) T @ index.js:39 i @ index.js:48 (anonymous) @ index.js:53 (anonymous) @ index.js:45 de @ index.js:396 t.initNext @ index.js:399 22870 @ next.js:11 n @ bootstrap:21 (anonymous) @ main-e4a38b069e3e8e20.js:1 n.O @ chunk loaded:25 (anonymous) @ main-e4a38b069e3e8e20.js:1 t @ jsonp chunk loading:73 (anonymous) @ main-e4a38b069e3e8e20.js:1 Show 5 more frames inpage.js:1 MetaMask: The event 'close' is deprecated and may be removed in the future. Please use 'disconnect' instead. For more information, see: https://eips.ethereum.org/EIPS/eip-1193#disconnect _warnOfDeprecation @ inpage.js:1 on @ inpage.js:1 n.activate @ injected-connector.esm.js:287 (anonymous) @ core.esm.js:347 y @ core.esm.js:123 (anonymous) @ core.esm.js:346 (anonymous) @ useAuth.ts:33 s @ runtime.js:45 (anonymous) @ runtime.js:274 P.forEach.e. @ runtime.js:97 b @ _app-156fa8132e0f44ea.js:1 a @ _app-156fa8132e0f44ea.js:1 (anonymous) @ _app-156fa8132e0f44ea.js:1 (anonymous) @ _app-156fa8132e0f44ea.js:1 (anonymous) @ _app-156fa8132e0f44ea.js:1 (anonymous) @ useEagerConnect.ts:43 a @ helpers.js:73 setTimeout (async) (anonymous) @ trycatch.js:94 (anonymous) @ useEagerConnect.ts:42 Promise.then (async) (anonymous) @ useEagerConnect.ts:40 (anonymous) @ react-dom.production.min.js:123 t.unstable_runWithPriority @ scheduler.production.min.js:18 Ql @ react-dom.production.min.js:122 i @ index.js:48 (anonymous) @ index.js:53 (anonymous) @ index.js:45 de @ index.js:396 t.initNext @ index.js:399 22870 @ next.js:11 n @ bootstrap:21 (anonymous) @ main-e4a38b069e3e8e20.js:1 n.O @ chunk loaded:25 (anonymous) @ main-e4a38b069e3e8e20.js:1 t @ jsonp chunk loading:73 (anonymous) @ main-e4a38b069e3e8e20.js:1 Show 21 more frames inpage.js:1 MetaMask: The event 'networkChanged' is deprecated and may be removed in the future. Use 'chainChanged' instead. For more information, see: https://eips.ethereum.org/EIPS/eip-1193#chainchanged _warnOfDeprecation @ inpage.js:1 on @ inpage.js:1 n.activate @ injected-connector.esm.js:288 (anonymous) @ core.esm.js:347 y @ core.esm.js:123 (anonymous) @ core.esm.js:346 setTimeout (async) (anonymous) @ trycatch.js:94 (anonymous) @ useEagerConnect.ts:42 Promise.then (async) (anonymous) @ useEagerConnect.ts:40 Ui @ react-dom.production.min.js:262 t.unstable_runWithPriority @ scheduler.production.min.js:18 Ql @ react-dom.production.min.js:122 Fi @ react-dom.production.min.js:261 t.initNext @ index.js:399 22870 @ next.js:11 n @ bootstrap:21 (anonymous) @ main-e4a38b069e3e8e20.js:1 n.O @ chunk loaded:25 (anonymous) @ main-e4a38b069e3e8e20.js:1 t @ jsonp chunk loading:73 (anonymous) @ main-e4a38b069e3e8e20.js:1 Show 21 more frames inpage.js:1 MetaMask - RPC Error: Internal JSON-RPC error. {code: -32603, message: 'Internal JSON-RPC error.', data: {…}} (anonymous) @ inpage.js:1 (anonymous) @ inpage.js:17 _runReturnHandlers @ inpage.js:17 (anonymous) @ index.js:8 o @ index.js:4 estimateGas @ index.js:48 (anonymous) @ index.js:225 instrument.js:109 estimateGas failed removeLiquidityETHWithPermitSupportingFeeOnTransferTokens (10) ['THISISTHETOKENADDRESS', '14035573325708134392081', '10747326776119330399153795', '14904655489066656975', 'THISISTHEOWNERADDRESS', 1647258361, false, 28, '0xd46ab8d8ae688c75c17882d93ae0702ec142b6d34b99828ee885c7341bf24ac0', '0x42ba1ddb76c5d0bf2e2f26cdf96022d87654b67a8bd02453749e7335a5c49179'] {code: -32603, message: 'Internal JSON-RPC error.', data: {…}, stack: '{\n "code": -32603,\n "message": "Internal JSON-RP…ogaeaoehlefnkodbefgpgknn/background-0.js:1:310932'}

zhyd1997 commented 2 years ago

Try to increment your gas fee.

crowszero12 commented 2 years ago

tried to set the slippage up to 49% still failing.

zhyd1997 commented 2 years ago

@crowszero12 not slippage:

https://user-images.githubusercontent.com/31362988/158165310-3211000b-bcf4-4593-911a-d6de3b02e245.mov

crowszero12 commented 2 years ago

@crowszero12 not slippage: Screen.Recording.2022-03-14.at.19.42.22.mov

I can't get to that part since if I click confirm of removal of liquidity this pops up : https://i.imgur.com/HLdbXci.png

zhyd1997 commented 2 years ago

It's not expected. Could you show a video?

zhyd1997 commented 2 years ago

I confirm that the gas fee can be edited just like the video shows: https://github.com/pancakeswap/pancake-frontend/pull/3166#issuecomment-1058891991

0xjojoex commented 2 years ago

You won't able to show metamask confirm txn (gas fee edit describe above) if we can't estimate gas fee. It usually happens when your signature or amount is incorrect. I can't tell more without the knowing the params maybe try different amount

crowszero12 commented 2 years ago

I won't get through the remove>confirm(which would popup a gas confirmation on metamask) instead I get the "ERROR - This transaction could fail. I even tried to withdraw 1 token = BNB, still the fail pops up.

zhyd1997 commented 2 years ago

@crowszero12 Could record a video?

zhyd1997 commented 2 years ago

I found the signatureData.deadline is 1647258361 from this comment: https://github.com/pancakeswap/pancake-frontend/issues/3480#issuecomment-1066671914.

new Date(1647258361 * 1000).toString()
// 'Mon Mar 14 2022 11:46:01 GMT+0000 (Coordinated Universal Time)'

Does that mean the signatureData is expired?

@chef-jojo what's your idea?

zhyd1997 commented 2 years ago

@crowszero12 Did you try the v1 liquidity?

crowszero12 commented 2 years ago

when I'm trying in : https://v1exchange.pancakeswap.finance/ to the liquidity, it just says "No pool found"

this the router I used : https://bscscan.com/address/0x10ed43c718714eb63d5aa57b78b54704e256024e

zhyd1997 commented 2 years ago

@crowszero12 Have you tried the other wallet instead of MetaMask?

crowszero12 commented 2 years ago

@zhyd1997 I did, I was using binance wallet (browser) but didn't find any luck at all. However unlike metamask it prompted approve/enable button, then same result with the remove/confirm which the same error appeared

0xjojoex commented 2 years ago

I bet you have high fee on transfer?

crowszero12 commented 2 years ago

tax was set high on the contract, I reverted it to 0%, I have taken all of it. It happened to crossed my mind that i set the taxes too high. thanks for your help @chef-jojo @zhyd1997

0xjojoex commented 2 years ago

let's buy $1500 lottery

Sheikhupuri commented 2 years ago

This is due to bug on pancakeswap and I have solution of this.I already helped to recover funds of other Devs . Contact me on Telegram @FiazAhmad

Rema161 commented 2 years ago

I had the same issue you know, Try to increase the slippage to 49% and consider increasing the allowance of the token, if it doesn't work, follow the steps on this video https://www.youtube.com/watch?v=yph8lMt7ojc The problem will definitely be solved

magemore commented 1 year ago

Don't try from youtube link over some IndigoSwap website - it's a scam. What helped me increasing slippage to 49%. It taxed me almost 4% for removing liquidity but it worked from pancake.