function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {
uint256 combineFees = _liquidityFee.add(_MarketingFee); // MarketingFee + liquidity fees
uint256 tokensForLiquidity = contractTokenBalance
.mul(_liquidityFee)
.div(combineFees);

uint256 tokensForMarketingFee = contractTokenBalance.sub(
tokensForLiquidity
);

// split the Liquidity tokens balance into halves
uint256 half = tokensForLiquidity.div(2);
uint256 otherHalf = tokensForLiquidity.sub(half);

// capture the contract's current ETH balance.
// this is so that we can capture exactly the amount of ETH that the
// swap creates, and not make the liquidity event include any ETH that
// has been manually sent to the contract
uint256 initialBalance = address(this).balance;

// swap tokens for ETH
swapTokensForEth(half); // <- this breaks the ETH -> HATE swap when swap+liquify is triggered

// how much ETH did we just swap into?
uint256 newBalance = address(this).balance.sub(initialBalance);

// add liquidity to uniswap
addLiquidity(otherHalf, newBalance);

emit SwapAndLiquify(half, newBalance, otherHalf);

uint256 contractBalance = address(this).balance;
swapTokensForEth(tokensForMarketingFee);
uint256 transferredBalance = address(this).balance.sub(contractBalance);

//Send to MarketingFee address
transferToAddressETH(MarketingWallet, transferredBalance);
}
guys what do this function

May 4, 2022, 3:16 PM
😔any body can help me
May 4, 2022, 3:34 PM

© 2024 Draquery.com All rights reserved.