contract ZTToken is Owned, StandardToken {

    // Ethereum token standard
    string public standard = "Token 0.2";

    // Full name
    string public name = "ZeroTraffic";        
    
    // Symbol
    string public symbol = "ZTT";

    // No decimal points
    uint8 public decimals = 8;

    // Core team insentive distribution
    bool public incentiveDistributed = false;
    uint256 public incentiveDistributionDate = 0;
    uint256 public incentiveDistributionInterval = 2 years;
    
    // Core team incentives
    struct Incentive {
        address recipient;
        uint8 percentage;
    }

    Incentive[] public incentives;
    

    /**
     * Starts with a total supply of zero and the creator starts with 
     * zero tokens (just like everyone else)
     */
    function ZTToken() {  
        balances[msg.sender] = 0;
        totalSupply = 0;
        incentiveDistributionDate = now + incentiveDistributionInterval;
        incentives.push(Incentive(0x3cAf983aCCccc2551195e0809B7824DA6FDe4EC8, 1)); // 0.01 * 10^2 Frank Bonnet
    }


    /**
     * Distributes incentives over the core team members as 
     * described in the whitepaper
     */
    function withdrawIncentives() {
        require(!incentiveDistributed);
        require(now > incentiveDistributionDate);

        incentiveDistributed = true;

        uint256 totalSupplyToDate = totalSupply;
        for (uint256 i = 0; i < incentives.length; i++) {

            // totalSupplyToDate * (percentage * 10^2) / 10^2 / denominator
            uint256 amount = totalSupplyToDate * incentives[i].percentage / 10**2; 
            address recipient = incentives[i].recipient;

            // Create tokens
            balances[recipient] += amount;
            totalSupply += amount;

            // Notify listners
            Transfer(0, this, amount);
            Transfer(this, recipient, amount);
        }
    }


    /**
     * Issues `_value` new tokens to `_recipient` (_value < 0 guarantees that tokens are never removed)
     *
     * @param _recipient The address to which the tokens will be issued
     * @param _value The amount of new tokens to issue
     * @return Whether the approval was successful or not
     */
    function issue(address _recipient, uint256 _value) onlyOwner onlyPayloadSize(2) returns (bool success) {

        // Guarantee positive 
        require(_value > 0);

        // Create tokens
        balances[_recipient] += _value;
        totalSupply += _value;

        // Notify listners 
        Transfer(0, owner, _value);
        Transfer(owner, _recipient, _value);

        return true;
    }


    /**
     * Prevents accidental sending of ether
     */
    function () {
        revert();
    }
}
/**
 * @title ZTT (ZeroTraffic) token
 *
 * Implements ERC 20 Token standard: https://github.com/ethereum/EIPs/issues/20 with the addition 
 * of ownership, a lock and issuing.
 *
 * #created 29/08/2017
 * #author Frank Bonnet
 */
function () {
    revert();
}

/**
 * Prevents accidental sending of ether
 */