function () public payable {
        uint256 receivedETH = 0;
        uint256 receivedETHUNIT = 0;
        uint256 sendingSMSToken = 0;
        uint256 sendingSMSBonus = 0;
        Log(msg.value);

        
        if (icoOnSale && !icoOnPaused && msg.sender != owner) {
            if (now <= endDate) {
                
                Log(currentPhase);
                
                receivedETH = msg.value;
                
                
                if ((checkAddress(msg.sender) && checkMinBalance(msg.sender)) || firstMembershipPurchase <= receivedETH) {
                    
                    receivedETHUNIT = receivedETH * UNIT;
                    sendingSMSToken = SMSLIB.safeDiv(receivedETHUNIT, tokenPrice);
                    Log(sendingSMSToken);

                    
                    if (currentPhase == 1 || currentPhase == 2 || currentPhase == 3) {
                        
                        sendingSMSBonus = calcBonus(sendingSMSToken);
                        Log(sendingSMSBonus);
                    }

                    
                    Log(sendingSMSToken);
                    if (!transferTokens(msg.sender, sendingSMSToken, sendingSMSBonus))
                        revert();
                } else {
                    
                    revert();
                }
            } else {
                
                revert();
            }
        } else {
            
            revert();
        }
    }