We do not live in a country where a state legislature has the ability to invalidate previously entered into contracts on a whim because they don’t like them. That would literally violate the constitution. The only way to invalidate this thing would be to establish that it was illegal either in the manner in which it was entered into, or because it’s terms violated state law at the time the contract was entered into.
Hypothetical ...
The state of Florida has permitted horse racing since 1910. Hundreds of contracts exist between businesses in Florida centered on or concerning horse racing. One contract is between Bob Smith, a race horse owner, and John Doe, a professional horse jockey that was enacted in 2020. The contract says John Doe will ride Bob Smith's horse "Mickey Mouse" once a month at Miami Horse Track every month from January 2020 until December 2025.
On January 1, 2023, the Florida legislature passes (and the governor signs) a law banning all horse racing within 500 yards of a church or a school. This law takes effect immediately. Miami Horse Track has both a school and a church across the street from its main entrance.
QUESTION #1: Has the contract between John Doe and Bob Smith now been invalidated?
QUESTION #2: Has the state legislature violated their constitutional rights?
------------
Additional Hypothetical ...
On December 25, 2022, the Miami Dade County legislature (I really have no idea what type of governing board they have, but it's not important) enters into a development agreement with the Miami Horse Track stating that the Miami Horse Track has the right to run horse races from the date of the contract was enacted until 2052 ... and to set all of its own rules and regulations related to the operation of these horse races at that venue.
QUESTION #3: Has the development agreement between Miami Dade County and Miami Horse Track now been invalidated?
QUESTION #4: Has the state legislature violated the horse track's constitutional rights?