contract Operator is Ownable {
    mapping(address => bool) public operators;

    event OperatorAddressAdded(address addr);
    event OperatorAddressRemoved(address addr);

    /**
     * @dev Throws if called by any account that's not operator.
     */
    modifier onlyOperator() {
        require(operators[msg.sender]);
        _;
    }

    /**
     * @dev add an address to the operators
     * @param addr address
     * @return true if the address was added to the operators, false if the address was already in the operators
     */
    function addAddressToOperators(address addr) onlyOwner public returns(bool success) {
        if (!operators[addr]) {
            operators[addr] = true;
            emit OperatorAddressAdded(addr);
            success = true;
        }
    }

    /**
     * @dev add addresses to the operators
     * @param addrs addresses
     * @return true if at least one address was added to the operators,
     * false if all addresses were already in the operators
     */
    function addAddressesToOperators(address[] addrs) onlyOwner public returns(bool success) {
        for (uint256 i = 0; i < addrs.length; i++) {
            if (addAddressToOperators(addrs[i])) {
                success = true;
            }
        }
    }

    /**
     * @dev remove an address from the operators
     * @param addr address
     * @return true if the address was removed from the operators,
     * false if the address wasn't in the operators in the first place
     */
    function removeAddressFromOperators(address addr) onlyOwner public returns(bool success) {
        if (operators[addr]) {
            operators[addr] = false;
            emit OperatorAddressRemoved(addr);
            success = true;
        }
    }

    /**
     * @dev remove addresses from the operators
     * @param addrs addresses
     * @return true if at least one address was removed from the operators,
     * false if all addresses weren't in the operators in the first place
     */
    function removeAddressesFromOperators(address[] addrs) onlyOwner public returns(bool success) {
        for (uint256 i = 0; i < addrs.length; i++) {
            if (removeAddressFromOperators(addrs[i])) {
                success = true;
            }
        }
    }
}
function addAddressToOperators(address addr) onlyOwner public returns(bool success) {
    if (!operators[addr]) {
        operators[addr] = true;
        emit OperatorAddressAdded(addr);
        success = true;
    }
}

/**
 * @dev add an address to the operators
 * @param addr address
 * @return true if the address was added to the operators, false if the address was already in the operators
 */