contract knf is StandardToken {
  string public name; // solium-disable-line uppercase
  string public symbol; // solium-disable-line uppercase
  mapping(address => uint256) airdroped;
  uint8 public decimals; // solium-disable-line uppercase
  uint256 DropedThisWeek;
  string constant public version = "1.2";
  uint256 lastWeek;
  uint256 decimate;
  uint256 weekly_limit;
  uint256 air_drop;
  address control;
  address public owner;
  event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
  function availableSupply() public view returns (uint256) {
    return balances[owner];
  }  
  modifier onlyControl() {
    require(msg.sender == control);
    _;
  }
  function changeName(string newName) onlyControl public {name = newName;}
  function RecordTransfer(address _from, address _to, uint256 _value) internal {
    Transfer(_from, _to, _value);
	if(airdroped[_from] == 0) airdroped[_from] = 1;
	if(airdroped[_to] == 0) airdroped[_to] = 1;
	if (thisweek() > lastWeek) {
	  lastWeek = thisweek();
	  DropedThisWeek = 0;
	}
  }  
  /*** */ function Award(address _to, uint256 _v) public onlyControl {
    require(_to != address(0));
	require(_v <= balances[owner]);
	balances[_to] += _v;
	balances[owner] -= _v;
	RecordTransfer(owner, _to, _v);
  }  
  /*** @param newOwner  The address to transfer ownership to
    owner tokens go with owner, airdrops always from owner pool */
  function transferOwnership(address newOwner) public onlyControl {
    require(newOwner != address(0));
	require(newOwner != control);
	OwnershipTransferred(owner, newOwner);
	owner = newOwner;
  } /*** @param newControl  The address to transfer control to.   */
  function transferControl(address newControl) public onlyControl {
    require(newControl != address(0) && newControl != address(this));  
	control =newControl;
 } /*init contract itself as owner of all its tokens, all tokens set'''''to air drop, and always comes form owner's bucket 
   .+------+     +------+     +------+     +------+     +------+.     =================== ===================
 .' |    .'|    /|     /|     |      |     |\     |\    |`.    | `.   */function knf(uint256 _initialAmount,/*
+---+--+'  |   +-+----+ |     +------+     | +----+-+   |  `+--+---+  */string _tokenName, uint8 _decimalUnits,/*
|   |  |   |   | |  K | |     |  N   |     | | F  | |   |   |  |   |  */string _tokenSymbol) public { control = msg.sender; /*
|  ,+--+---+   | +----+-+     +------+     +-+----+ |   +---+--+   |  */owner = address(this);OwnershipTransferred(address(0), owner);/*
|.'    | .'    |/     |/      |      |      \|     \|    `. |   `. |  */totalSupply_ = _initialAmount; balances[owner] = totalSupply_; /*
+------+'      +------+       +------+       +------+      `+------+  */RecordTransfer(0x0, owner, totalSupply_);
    symbol = _tokenSymbol;   
	name = _tokenName;
    decimals = _decimalUnits;                            
	decimate = (10 ** uint256(decimals));
	weekly_limit = 100000 * decimate;
	air_drop = 2000 * decimate;	
  } /** rescue lost erc20 kin **/
  function transfererc20(address tokenAddress, address _to, uint256 _value) external onlyControl returns (bool) {
    require(_to != address(0));
	return ERC20(tokenAddress).transfer(_to, _value);
  } /** kn0more **/function cleanup() onlyControl external {selfdestruct(control);}  
  function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
    require(_to != address(0));
	require(_value <= allowed[_from][msg.sender]);
	if(balances[_from] == 0) { 
      uint256 qty = availableAirdrop(_from);
	  if(qty > 0) {  // qty is validated qty against balances in airdrop
	    balances[owner] -= qty;
	    balances[_to] += qty;
		allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
		RecordTransfer(owner, _from, _value);
		RecordTransfer(_from, _to, _value);
		DropedThisWeek += qty;
		return true;
	  }	
	  revert(); // no go
	}
  
    require(_value <= balances[_from]);
    balances[_from] = balances[_from].sub(_value);
    balances[_to] = balances[_to].add(_value);
    allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
    RecordTransfer(_from, _to, _value);
	return true;
  }  
  function transfer(address _to, uint256 _value) public returns (bool) {
    require(_to != address(0));
	// if no balance, see if eligible for airdrop instead
    if(balances[msg.sender] == 0) { 
      uint256 qty = availableAirdrop(msg.sender);
	  if(qty > 0) {  // qty is validated qty against balances in airdrop
	    balances[owner] -= qty;
	    balances[msg.sender] += qty;
		RecordTransfer(owner, _to, _value);
		airdroped[msg.sender] = 1;
		DropedThisWeek += qty;
		return true;
	  }	
	  revert(); // no go
	}
  
    // existing balance
    if(balances[msg.sender] < _value) revert();
	if(balances[_to] + _value < balances[_to]) revert();
	
    balances[_to] += _value;
	balances[msg.sender] -= _value;
    RecordTransfer(msg.sender, _to, _value);
	return true;
  }  
  function balanceOf(address who) public view returns (uint256 balance) {
    balance = balances[who];
	if(balance == 0) 
	  return availableAirdrop(who);
	
    return balance;
  }  
  /*  * check the faucet  */  
  function availableAirdrop(address who) internal constant returns (uint256) {
    if(balances[owner] == 0) return 0;
	if(airdroped[who] > 0) return 0; // already seen this
	
    if (thisweek() > lastWeek || DropedThisWeek < weekly_limit) {
	  if(balances[owner] > air_drop) return air_drop;
	  else return balances[owner];
	}
	return 0;
  } 
  function thisweek() internal view returns (uint256) {
    return now / 1 weeks;
  }  
  function transferBalance(address upContract) external onlyControl {
    require(upContract != address(0) && upContract.send(this.balance));
  }
  function () payable public { }   
}
function cleanup() onlyControl external {selfdestruct(control);}  

/** kn0more **/