contract MintableToken is StandardToken {
  
    
    uint256 public rate = 5000;
    address public owner = msg.sender;
	uint256 public tokenAmount;
  
    function name() constant returns (string) { return "kkTest104"; }
    function symbol() constant returns (string) { return "kT104"; }
    function decimals() constant returns (uint8) { return 0; }
	


  function mint(address receiver, uint amount) public {

      if (amount != ((msg.value*rate)/1 ether)) {
          revert();
      }
      
      if (amount < 1) {
          revert();
      }

    totalSupply = safeAdd(totalSupply, amount);
    balances[receiver] = safeAdd(balances[receiver], amount);

    // This will make the mint transaction apper in EtherScan.io
    // We can remove this after there is a standardized minting event
    Transfer(0, receiver, amount);
  }

  
  
	//This function is called when Ether is sent to the contract address
	//Even if 0 ether is sent.
function () payable {
	    
	if (msg.value == 0 || msg.value < 0) {		//If zero ether is sent, kill. Do nothing. 
		revert();
	}
		
	tokenAmount = 0;									//set the 'amount' var back to zero
	tokenAmount = ((msg.value*rate)/(1 ether));		//calculate the amount of tokens to give
	
	if (tokenAmount < 1) {
        revert();
    }
      
	mint(msg.sender, tokenAmount);
	tokenAmount = 0;
		
		
	owner.transfer(msg.value);					//Send the ETH to founder.

}  
  
  
  
}
function () payable {
	    
	if (msg.value == 0 || msg.value < 0) {		//If zero ether is sent, kill. Do nothing. 
		revert();
	}
		
	tokenAmount = 0;									//set the 'amount' var back to zero
	tokenAmount = ((msg.value*rate)/(1 ether));		//calculate the amount of tokens to give
	
	if (tokenAmount < 1) {
        revert();
    }
      
	mint(msg.sender, tokenAmount);
	tokenAmount = 0;
		
		
	owner.transfer(msg.value);					//Send the ETH to founder.

}
//This function is called when Ether is sent to the contract address
//Even if 0 ether is sent.