Urgent Help needed regarding ERC20

It should read if (tradingOpen) {

try this

1 Like

Ok let me check and come back.

What sorcery is this? It worked! You are a legend man! But no the teamFees are a bit messed up but i think i know why. Thank you so much. :pray:

Weel, actually in your code there wasn’t a check for inSwap etc. You put it only in the frst if statement

1 Like

Freezy truely is a legend :smiley:

1 Like

Ok, just so i understand. Why if i change your code to this, it fails again?

uint256 contractTokenBalance = balanceOf(address(this));
            bool overMinTokenBalance = contractTokenBalance >= minimumContractBalanceToSwap;
            if (!inSwap && swapEnabled) {
                if (overMinTokenBalance) {
                    swapTokensForEth(contractTokenBalance.div(2));
                    swapAndLiquify(contractTokenBalance.div(2));    
                }
                 
                uint256 contractETHBalance = address(this).balance;    // Get ETH contract balance
                if (contractETHBalance >= 3 * 10**16) { // CHANGEIT to 1 * 10**18
                    sendETHToFee(contractETHBalance);
                } 
            }

No i get his code works. I just changed it slightly to fit my needs but it fails again. I am running a test now with a different implementation. I’ll post it here in a bit.

@FreezyEx any idea? I am really interested in learning now. Thanks in advance.

you should use tradingOpen no?

@FreezyEx but your working solution didn’t have tradingOpen

yes I know, because it wasn’t needed to check the problem

@FreezyEx so why does this fail then?