If this law is applied prospectively, then this is not an impairment of the obligation of contracts. The very clause first conceives a contract is already in existence and some later act of the legislature seeks to nullify part of the already existing contract or all of it. Article I, section 10, does not, as you assume otherwise, preclude the state from passing legislation which will undoubtedly affect future but presently non-existent contracts.
James Wilson, a Framer, understood this provision to apply prospectivley.
Quote:James Wilson of Pennsylvania noted that the unforeseen circumstance was still within the legislative power since the clause prohibited "retrospective interferences only."
Indeed, the facts of the early cases before the U.S. Supreme Court dealing with Article I, Section 10, dealt with a contract already in existence and subsequent legislation attempting to abrogate all or some of the contract.
This question was decidely answered by the U.S. Supreme Court in the case of
Ogden v. Saunders, 25 U.S. 213 . Article I, Section 10, does not apply prospectively.