What is the function of numTokensSellToAddToLiquidity variable?

Studying contracts I have found these two variables:

uint256 public _maxTxAmount = 1000000000000000 * 10**9;
    uint256 private numTokensSellToAddToLiquidity = 500000000000  * 10**9;

The first is clear to me. It is a limit on the amount of purchase and sale of the token.

But the second is related to decentralized exchanges and there I am more lost.

The variable is used in the function transfer:

 bool overMinTokenBalance = contractTokenBalance >= numTokensSellToAddToLiquidity;
        if (
            overMinTokenBalance &&
            !inSwapAndLiquify &&
            from != uniswapV2Pair &&
            swapAndLiquifyEnabled
        ) {
            contractTokenBalance = numTokensSellToAddToLiquidity;
            //add liquidity
            swapAndLiquify(contractTokenBalance);
        }

understand your relationship with uniswap but I don’t understand its role.
What is?

It’s the number of tokens in the contract that will activate Swap And Liquifiy.

It will sell half of that token amount in the contract to the Dex Router you have assigned (pancakeswap) for BNB. It will then re-add it to the LP.

3 Likes

I can use some help with this as well, Does that mean that it pulls tokens from the contract and puts back into the lp?

Yes, that is what it means. Although it really is wherever you’ve decided to store the tokens. By default in SafeMoon clones it’s taxed to the Contract.

This is My issue , Not sure if i messed up. I have a contract deployed
I did 24 bnb presale and created lp
Im afraid that i will run out of tokens because i only have 23trill in the lp
The contract is set to liquify. and pulls 250 billion with every sell
where does that go. Do the tokens go into the lp ?

0x8893b15528e6c893b40e177021e98e576246b106

Any help would be awesome

this types of clones are not necessary if one is looking for a contract that has, for example, passive staking, and a more or less fair distribution of fee. Is it necessary to put this function to send tokens to the swap? If swaps are created manually, why do this?

1 Like

I do not know if I understood you correctly. You have created a presale and you do not see your tokens or your BNBs. What percentage did you put in? 100%? Until the countdown ends, which is at least one month, the tokens will not be unlocked …

1 Like

A post was merged into an existing topic: PSA Regarding SafeMoon Forks on PancakeSwap - Transfers not working? Read This!