y and its inhabitants through pipes and mains laid in the streets, upon condition of the performance of its service by the grantee, is the grant of a franchise vested in the state in consideration of the performance of a public service, and, after performance by the grantee, is a contract protected by the constitution of the United States against state legislation to impair it.