Where a defendant pled guilty to prior offenses before the enactment of Penal Code section 1170.12, and those offenses were later used to enhance his sentence under that law, the sentence did not implicate or violate the contract clauses of the state or federal constitutions. The defendant argued on appeal that his earlier plea agreements necessarily incorporated the law in effect at that time, which provided for only a five-year enhancement for future serious or violent felonies, and that a later legislative alteration to the effect of those convictions violated constitutional provisions prohibiting the passage of laws impairing the obligation of contracts. (U.S. Const., art I., § 10, cl.1; Cal. Const., art. I, § 9.) The appellate court rejected his contention, holding that contracts are deemed to incorporate and contemplate not only the existing law but the reserve power of the state to amend the law or enact new laws in pursuant of the public good. Since the Three Strikes law was clearly enacted to promote the public good, no unconstitutional interference with contracts is evident in its passage.