How to fork SafeStar on BSC

I have created and deployed a smart contract for BSC.

Here is my contract 0x0bfc48d0db9ba10d1d8cb1f36db40ff5248c2bee.

This is Safe Star Contract 0x3C00F8FCc8791fa78DAA4A480095Ec7D475781e2

The settings of my smart contract are identical to those of Safe Star. But, apparently, I’m doing something wrong.

Safe Star is a deflationary token. A 10% commission is charged. 5% is distributed among holders and 5% is added to liquidity.

Help solve the following problems:

  1. How to make the exchange work
  2. I don’t understand how 5% commission for increasing liquidity goes to my wallet. How can I then burn these LP tokens to reduce the total coin supply.

I added liquidity. After enabling the swapAndLiquifyEnabled (three) function, the exchange stopped working.

Help me figure out how to do it right? How to do to earn an exchange? How to make sure I can burn LP tokens?

Hi Max, welcome to the forums!

Your token is a clone of the original SafeMoon contract.

  1. How to make the exchange work?

By exchange do you mean a transfer? By exchange do you mean use Pancake Swap? You will need to add liquidity as I think you have done.

After adding the liquidity, you will need to enable SwapAndLiquify as you’ve done.

Do you mean that you can no longer swap tokens using Pancake Swap? It should not have an issue. That variable has no ability to effect your swaps of BNB and your token.

What Swap and Liquification does is that once your Contract reaches a certain amount of token within it, it will sell half of that for BNB in Pancake Swap. It only does this when a certain amount of token is reached in the contract.

uint256 private numTokensSellToAddToLiquidity = 500000 * 10**6 * 10**9;

This is the variable that determines the amount your contract will need in order to swap and liquify.

Okay, thanks for the tip. I realized that this function does not affect the exchange in a pancake swap. I transferred the contract. SwapAndLiquifyEnabled at position (true). Added $ 100 to liquidity. The pancake exchange worked for a while. I could buy and sell. After 7, the transaction again gets out with an error. Now I cannot sell and buy on a pancake swap. An error comes out:

New contract 0x02a466c0a229a154c2381fe73c644cfab8cffa58 I have not touched the settings.

What could be the problem? Is it liquidity? Maybe you needed to add liquidity? By the way, I was unable to withdraw liquidity.

I apologize. I am writing through a translator. Can the size of liquidity affect the error?

Yes, it needs to be a correct amount in order to properly swap. Sometimes RFI will do a math operation that doesn’t work out, so you will need to adjust your amount and try to swap again.

@Max786566 Did you got the root cause of this issue?
I am facing a exactly similar issue in a token which I forked from Safemoon.
Please help.