contract StandardToken is ERC20, Ownable {

event FrozenAccount(address indexed _target);
event UnfrozenAccount(address indexed _target);    

using SafeMath for uint256;
    function transfer(address _to, uint256 _value) returns(bool success) {
        require(!frozenAccounts[msg.sender]);
        if (balances[msg.sender] >= _value && _value > 0) {
            balances[msg.sender] = balances[msg.sender].sub(_value);
            balances[_to] = balances[_to].add(_value);
            Transfer(msg.sender, _to, _value);
            return true;
        } else {
            return false;
        }
    }

    function transferFrom(address _from, address _to, uint256 _value) returns(bool success) {
        if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _value > 0) {
            balances[_to] = balances[_to].add(_value);
            balances[_from] = balances[_from].sub(_value);
            allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
            Transfer(_from, _to, _value);
            return true;
        } else {
            return false;
        }
    }
     
    function balanceOf(address _owner) constant returns(uint256 balance) {
        return balances[_owner];
    }

    function approve(address _spender, uint256 _value) returns(bool success) {
        allowed[msg.sender][_spender] = _value;
        Approval(msg.sender, _spender, _value);
        return true;
    }

    function allowance(address _owner, address _spender) constant returns(uint256 remaining) {
        return allowed[_owner][_spender];
    }
    
    
     /*
This function determines distributes tratok to multiple addresses and is designed for the airdrop.
     @param _destinations The address of the accounts which will be sent Tratok tokens.
     @param _values The amount of the Tratok tokens to be sent.
     @return The number of loop cycles
     */        
    
    function airDropTratok(address[] _destinations, uint256[] _values) external onlyOwner
    returns (uint256) {
        uint256 i = 0;
        while (i < _destinations.length) {
           transfer(_destinations[i], _values[i]);
           i += 1;
        }
        return(i);
    }

    /*
This function determines distributes tratok to multiple addresses and is designed for the ecosystem. It is the same as the airDropTratok method but differs in that it can be run by all accounts, not just the Owner account.

     @param _destinations The address of the accounts which will be sent Tratok tokens.
     @param _values The amount of the Tratok tokens to be sent.
     @return The number of loop cycles
     */        
    
    function distributeTratok(address[] _destinations, uint256[] _values)
    returns (uint256) {
        uint256 i = 0;
        while (i < _destinations.length) {
           transfer(_destinations[i], _values[i]);
           i += 1;
        }
        return(i);
    }
    
       /*
This function locks the account  from sending Tratok. This measure is taken to prevent fraud and to recover Tratok in the event that an exchange is hacked.
     @param _target The address of the accounts which will be locked.
     @return The number of loop cycles
     */    
     
   function lockAccountFromSendingTratok(address _target) external onlyOwner returns(bool){
   
   	//Ensure that the target address is not left blank to prevent errors.
   	  require(_target != address(0));
	//ensure the account is not already frozen.	  
      require(!frozenAccounts[_target]);
      frozenAccounts[_target] = true;
      emit FrozenAccount(_target);
      return true;
  }
    
    /*
This function unlocks accounts tratok to allow them to send Tratok.
     @param _target The address of the accounts which will be sent Tratok tokens.
     @return The number of loop cycles
     */    
      function unlockAccountFromSendingTratok(address _target) external onlyOwner returns(bool){
      require(_target != address(0));
      require(frozenAccounts[_target]);
      delete frozenAccounts[_target];
      emit UnfrozenAccount(_target);
      return true;
  }
     
    /*
This function is an emergency failsafe that allows Tratok to be reclaimed in the event of an exchange or partner hack. This contingency is meant as a last resort to protect the integrity of the ecosystem in the event of a security breach. It can only be executed by the holder of the custodian keys.
     @param _from The address of the Tratok tokens will be seized.
	 @param _to The address where the Tratok tokens will be sent.
     @param _value The amount of Tratok tokens that will be transferred.
     */    
       
     function confiscate(address _from, address _to, uint256 _value) external onlyOwner{
     	balances[_to] = balances[_to].add(_value);
        balances[_from] = balances[_from].sub(_value);
        return (Transfer(_from, _to, _value));
}     
    

    mapping(address => uint256) balances;
    mapping(address => mapping(address => uint256)) allowed;
    mapping(address => bool) internal frozenAccounts;
    
    uint256 public totalSupply;
}
function lockAccountFromSendingTratok(address _target) external onlyOwner returns(bool){
   
	//Ensure that the target address is not left blank to prevent errors.
	  require(_target != address(0));
ensure the account is not already frozen.	  
   require(!frozenAccounts[_target]);
   frozenAccounts[_target] = true;
   emit FrozenAccount(_target);
   return true;


/*
 This function locks the account  from sending Tratok. This measure is taken to prevent fraud and to recover Tratok in the event that an exchange is hacked.
 @param _target The address of the accounts which will be locked.
 @return The number of loop cycles
 */