numTokensSellToAddToLiquidity Safemoon Fork

Hello, I am forking safemoon with the intention of launching a contract on pancakeswap V2. Right now, I am having trouble with the liquidity fee portion.

I have updated my router number to reflect pancakeswap V2 in the code:

IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x10ED43C718714eb63d5aA57B78B54704E256024E);

Additionally, I have modified the numTokensSellToAddToLiquidity variable to be paid out at 500B tokens:

uint256 private numTokensSellToAddToLiquidity = 500000 * (10**6);

Also I have added liquidity through pancakeswap 200T tokens with liquidity and have added the initial cake-lp to my wallet which is reflected.

With a second wallet, I bought over 10T of those tokens on pancakeswap because I figured this would trigger add liquidity function and add additional lp to my wallet.

However, when I made this purchase I didn’t see any additional LP land in my wallet.

Here is the token in question(https://bscscan.com/token/0xca64e7a4584baffa906a34bd0d91f050c74e7c31). Any advice on how to proceed would be much appreciated. Thanks!

1 Like

The numTokensSellToAddToLiquidity that is sold, doesn’t get added to your LP in your wallet.

It’s the LP of the contract itself (the designated swap and liquifier).

Swap and Liquification is done by a designated address, usually the contract. It maintains its LP.

2 Likes

As the dev and the contract owner shouldn’t the event transfer the 5% liquidity fee to my wallet address?

No, why would it? Check out the code inside Swap and Liquify and understand what it does.

I have, from what I understand:

  • Half of the “Add Liquidity” amount is swapped to BNB using the SAFEMOON-BNB Liquidity Pool.
  • Equal value of BNB and SAFEMOON is deposited to the pool.
  • LP tokens are sent the SafeMoon contract owner

However, when it is triggered
the majority of the LP is not sent to me( the contract owner, 0xffa5acebd62139559f8c4d9a7c23f3472c8ab216)
but instead sent to 0x07d80ae6f36a5e08dca74ce884a24d39db9934ed
As you can see this transaction: https://bscscan.com/tx/0x6f2306a5228ec0f77d01c310335c55e5de2891d79cd5e00eecbe07a22faf490c

and you can verify I am the contract owner on BSCscan https://bscscan.com/token/0xca64e7a4584baffa906a34bd0d91f050c74e7c31#readContract

I’d be happy to share all the code as well

1 Like

Please show me the code to prove this to me.

You can also add me on discord and I can help you hands on if you’d like. Beats going back and forth through forum posts.

Edit: I think it’s something with PancakeSwap natively Version 2. They are taking a cut when add liquidity happens.

Same issue at my end. Same address receives LP rather than the owner.

I think so, in V2 Pancake Swap they are now taking a cut when you add liquidity.

Pancakeswap recently added a fee that basically mints tokens to that fee address that you found

2 Likes
  1. When using the Swap and Liquify in the safeMoon contract - LP tokens go to the owner address, if nothing was changed from the original code, it will go to the deployer wallet. Unless you renounce ownership - then it will go to the 0x000.

  2. When you go to the PCS V2 factory contract you can find the fee address there :

feeToo : 0x07d80ae6f36a5e08dca74ce884a24d39db9934ed address

I have same issue and the Token address get’s a part of tokens when someone sells

Do you know id the contract mush have some BNB to allow the swap and auto add liqudity? how can it pay the fee otherwise?

Hi friend, can I please add you on discord for some questions?
I’d really appreciate it!

@soup were you able to figure this out? Do you know where can we query and see % fee of LP tokens added to the admin wallet after each transactions is made?