Article I, Section 10 of the United States Constitution prohibits a state from passing any law impairing the obligation of contracts. A similar prohibition is found in Article 1, Section 9 of the California Constitution. This prohibition extends to contracts of employment. Cal Fire Loc. 2881 v. California Pub. Employees' Ret. Sys., 6 Cal. 5th 965, 977, 435 P.3d 433, 441 (2019).
The courts have held, however, that not every law that affects a contract constitutes an unconstitutional impairment. The law must operate "as a substantial impairment of a contractual relationship." Allied Structural Steel Co. v. Spannaus, 438 U.S. 234, 244 (1978). California's recently enacted SB 699 appears to cross this line as there can be no greater impairment of a contractual obligation than to declare a contract unenforceable. Certainly, the inability to enforce a contract interferes with a party's reasonable expectations. See Newly Minted California Law Tautologically Declares Void Noncompete Agreements Unenforceable Regardless Of Where They Were Signed. If a contract is substantially impaired by a state law, the courts will assess whether the state law is drawn in an “appropriate” and “reasonable” way to advance “a significant and legitimate public purpose. Sveen v. Melin, 138 S. Ct. 1815, 1822 (2018). Of course, the constitutional issue relates to existing contracts.