I'm trying to create a charity coin that auto transfers percentages to BNB to go into the charity and marketing wallets. I saw that Morty Token was doing this. (https://bscscan.com/address/0xb76ec79ca2a3ecbc5f54c77bac782352c118e706#code) However, when I tried to run that contract for myself, I noticed that EVERY sell generates an auto-sell from the Pancakeswap Router. When I look at the Morty Token chart, this is not happening. It's generating sells from the Pancakeswap Router, but NOT every time someone sells. It's very spaced out. How is this being achieved?



They have a condition in _transfer function to do that when the contract's token balance is above numTokensSellToAddToLiquidity.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.