Withdraw liquidity from PancakeSwap?

Hello. I have created a token(around 7 days ago), added liquidity on PancakeSwap and it was trading, everything was working fine. 23 April morning I withdrew liquidity and added it on PancakeSwap V2. Then, it was announced to withdraw liquidity from V2 PancakeSwap because there was a bug and when I tried to do it nothing happened. PancakeSwap developers said that there is a problem with Hardcode and that my token is linked with PancakeSwapRouter1. What can I do to withdraw liquidity?
Liquidity pair contract: 0x6d4d749c8763bcf4690a10f5e0297194059bb98a
Token contract: 0x1771ad5b28549467ad5fe68e9f271667a5930a2e

Code: https://bscscan.com/address/0x1771ad5b28549467ad5fe68e9f271667a5930a2e#code

Looks like lots of people are having similar problems.

Here are the steps I would take.

First go to your tokens contracts


You will need to approve a lot of the token (as much as you have provided liquidity) using the router address here.

From this contract you will need to try every single Remove Liquidity function.


I don’t think the WithPermit functions apply here, so one of these 3 functions will work.
For deadline you need to get the UNIX timestamp from here.

1 Like

Same issue for me, I hardcoded PS v1 router address in my contract - the v2 address is not to be found anywhere (that’s crazy) not to mention the lack of doc and warning for the devs on their website.

So, I added V2 liquidity for my ERC20 token but no one could swap it! I am now trying to recover the liquidity I injected for the token but it is not possible…

If anyone could help that would be super!

PS: I gave up ownership of the token…

I have the same issue, needs help to recover liquidity!

I checked it and it doesn’t work ;(

Metamask error:
“ALERT: Transaction error. Exception in the contract code.”

So you’re saying none of those functions worked for you? This might be a better question for PancakeSwap itself. These 3 functions should work, but perhaps not with how PancakeSwap has changed.

Can you show me your approval transaction?

I loose 1 BNB with it!
Did you recover something? I don’t know what I need to do!

1 Like

I worked with some people offline, check your MaxTx amount in your code.

If you are able to, set the max tx amount to max when removing liquidity.

2. _maxTxAmount: 1000000000000000000000000 uint256