Creating my token (BEP20): Error Pancakeswap K "TRANSFER_FAILED"

:computer: Environment
Remix Ethereum
Compile Version: v0.6.12+commit.27d51765

After compiling the contract I added liquidity to the 0.5 BNB pancake and I get the error “TRANSFER_FAILED” when making the purchase.

However, as soon as I added liquidity someone made a purchase in the same second, I don’t know if it was the pancake or some bot. My question is: is there a way to resolve this error?

And if the problem is in the contract, why did someone manage to buy?

Observation: I tried all the slippage.

I cloned a contract similar to Safemoon and decreased the supply to a smaller quantity.

:1234: Code to reproduce

I am willing to pay someone to help me solve this problem.

Hi @brastoken , I have locked this thread because it is dealing with SafeMoon.

Please search the forums first. The solution has already been provided.

Refer to

It’s either SwapAndLiquify needs to be set to False or MaxTxPercent needs to be set to 100.

If you have rejected ownership then you likely cannot get the liquidity back.