contract IWasFirstServiceToken is StandardToken, Ownable {

    string public constant NAME = "IWasFirstServiceToken"; // solium-disable-line uppercase
    string public constant SYMBOL = "IWF"; // solium-disable-line uppercase
    uint8 public constant DECIMALS = 18; // solium-disable-line uppercase

    uint256 public constant INITIAL_SUPPLY = 10000000 * (10 ** uint256(DECIMALS));
    address fungibleTokenAddress;
    address shareTokenAddress;

    /**
     * @dev Constructor that gives msg.sender all of existing tokens.
     */
    function IWasFirstServiceToken() public {
        totalSupply_ = INITIAL_SUPPLY;
        balances[msg.sender] = INITIAL_SUPPLY;
       emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
    }

    function getFungibleTokenAddress() public view returns (address) {
        return fungibleTokenAddress;
    }

    function setFungibleTokenAddress(address _address) onlyOwner() public {
        require(fungibleTokenAddress == address(0));
        fungibleTokenAddress = _address;
    }

    function getShareTokenAddress() public view returns (address) {
        return shareTokenAddress;
    }

    function setShareTokenAddress(address _address) onlyOwner() public {
        require(shareTokenAddress == address(0));
        shareTokenAddress = _address;
    }

    function transferByRelatedToken(address _from, address _to, uint256 _value) public returns (bool) {
        require(msg.sender == fungibleTokenAddress || msg.sender == shareTokenAddress);
        require(_to != address(0));
        require(_value <= balances[_from]);

        balances[_from] = balances[_from].sub(_value);
        balances[_to] = balances[_to].add(_value);
        emit Transfer(_from, _to, _value);
        return true;
    }
}
function IWasFirstServiceToken() public {
    totalSupply_ = INITIAL_SUPPLY;
    balances[msg.sender] = INITIAL_SUPPLY;
   emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}

/**
 * @dev Constructor that gives msg.sender all of existing tokens.
 */