pancakeswap / pancake-frontend

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

Staking liquidity before approving the contract can make the LP disappear? #442

Closed rutger-s closed 3 years ago

rutger-s commented 3 years ago

Bug Description Staking liquidity to a pool seems possible in the liquidity screen without approving the contract first.

Steps to Reproduce

  1. I bought a smaller coin
  2. Added that with BNB to a liquidity pool
  3. Confirmed
  4. Staked the LP pair directly from the liquidity page
  5. Checked the farms and did not find the LP staked.

Expected Behavior If you have the option to stake it at the liquidity page, you would expect that everything else works. If the contract first should be approved, that should be prompted.

Perhaps I there is another issue but I think I just lost LP tokens.

Additional Context I use Firefox on Ubuntu with the Binance Chain plug-in on the Binance Smart Chain Network.

rutger-s commented 3 years ago

Additional information: I am receiving CAKE for this, but it shows up as 0 LP staked. Therefore, I cannot sell it (if I would want to) or see how much I have of it.

colasin16 commented 3 years ago

It happened to me as well. I will add my Additional Context in case it helps. I use Firefox on Windows 10 with the Metamask plug-in.

I am also receiving CAKE and it also shows 0 as LP staked. If I try to unstake LP tokens the pop up shows 0.00000 balance, but if I click the Max badge suddently it fills with 0.000000037532632241. I haven't click the confirm button so I don't know if I will get the tokens back.

newfie-stack commented 3 years ago

I don’t think this is a bug in the program, more so it’s our error in executing the correct procedure unfortunately. Be nice to have more help with this as we interact with the sites/platforms. If/then programming seems it could be capable of this but I don’t know Solidity so who knows. Anyway, here’s what happened in my case. I provided liquidity before approving the farm and I’ve the exact same thing happen yesterday, I even thought to make sure I approve the farm before providing liquidity but forgot again trying to make sure addresses were right, didn’t want a repeat of yesterday’s $3500 blunder, eyes wide yet, yes this is my second mistake in 2 days costing me 7K in initial capital, and I’ve been into crypto since 2017. Anyway, I’m gettin my CAKE rewards but I don’t know if I’m gonna get my initial deposit back. The contract says I have 0.0004ish LP tokens earning which is somehow worth $3500 of BNB and BLINK tokens. The odd thing is everything is showing up on yieldwatch.net correctly. The amount of money I provided for liquidity equals the amount in the yieldwatch app. If I use farm.army I only see about half the amount of my money. Pancake shows 0 on the farm menu. Just never shut down these farms and were good. ;) I was using a MacBook Pro, metamask ext through chrome.

colasin16 commented 3 years ago

I think this is not a bug. I removed my liquidity and got my LP tokens back and harvested my CAKE correctly. I could then swap my LP tokens back to the original tokens without a problem. Simply the amount of LP tokens you get when providing liquidity looks very small like 0.00000something and therefore you see 0.000 LP staked in the farm but in reality, your LP tokens are staked correctly, they are not gone.

memoyil commented 3 years ago

Liquidity and farming are two different things. You should be able to see your LP's at the bottom of liquidity page which you can access it from trade section. But Farming means you will stake your LP's to Pancake Main Staking contract which you have to approve it first otherwise you can't stake them.

You can check your LP token contract here for example CAKE-BNB

https://bscscan.com/token/0xa527a61703d82139f8a06bc30097cc9caa2df5a6

As you can see in Holders section we have PancakeSwap: Main Staking Contract (which means LP's that staked in Farming) and individual holders.

memoyil commented 3 years ago

@Chef-Chungus we can close this pr since it is not a bug and it is a misunderstanding that we solved by changing "Stake: LP" name in farms details to "Get LP"

Twin365 commented 3 years ago

Did you manage to resolve this? I provided liquidity and than staked the LP in the Farm, now farm shows zero LP tokens. I'm having the same issue with Pancakeswap not showing STAKED LP in ALICE-BNB FARM. BscScan showing all transactions and contract. On Pancakeswap In the Farm menu The Cake Earned keeps earning but "ALICE-BNB LP STAKED shows 0"(zero) Also in the Trade> Liquidity shows no liquidity tokens for the pair and can not import the pair "No liquidity found" / "You don’t have liquidity in this pool yet." Message: "Or, if you staked your LP tokens in a farm, unstake them to see them here." Since the LP Token balance is zero at the Farm (ALICE-BNB) there is no way to remove/unstake Is there a manual way to execute removal of LP from a Farm? If you need the transaction hash let me know. Other apps such as Debank and YieldWatch and Farm.army all show staked ALICE-BNB pair Using TrustWallet Android and Brave Metamask to access pancakeswap with same results. Any help is much appreciated.

guignolinho commented 3 years ago

Same pb with alice-bnb and with tlm-bnb. Its shows 0 lp but it works and I get cake. I double checked with yieldwatch and its shows the lp. So its only a display bug. But i can’t remove the token. Pretty annoying.

guignolinho commented 3 years ago

57504D99-5216-48CB-B36B-8370AAC41BC6 A16EC65A-B8B6-422D-A956-8EC16EF845D9

memoyil commented 3 years ago

How many LP tokens you have?

guignolinho commented 3 years ago

It shows 0 but i have some: 0xe986883f28f01b4f96ce6a5eb23ef52b00c0a90635172119cea6c4b9ba62f617 someone told me its because bnb and tlm doesn’t have the same number of decimal

memoyil commented 3 years ago

Can't you click the unstake (minus) button ? Even if you shows you 0. If you can, Can you share the unstake window please

guignolinho commented 3 years ago

Ok it works when I unstake, so it’s only a matter of display. Thanks for your precious help.

memoyil commented 3 years ago

Display fix is on the way

rutger-s commented 3 years ago

Yeah, I also figured out later it's a display error, unstaked it and then everything worked.

Thanks @memoyil !