Yes, contracts can preempt some aspects of state law. Contracts essentially create laws between the parties to the contract. Most state laws regarding contracts are default rules, that is, if the contract doesn't mention something. In general, the answer is no; courts will enforce a law rather than a conflicting contract.
However, many statutes explicitly or implicitly allow contracts to void them in at least some situations. For example, in the United States, the Federal Arbitration Act states that arbitration contracts take effect even if state laws prohibit them. He argued that there was no general rule that contract termination requirements should always override the common law right of withdrawal. Immeasurability means that a term in the contract or something inherent in or related to the agreement was so surprisingly unfair that the contract simply cannot be allowed to stand as is.
Contracts can be declared unenforceable for public policy reasons, not only to protect one of the parties involved, but also because what the contract represents could harm society as a whole. When contract disputes involve fraudulent transactions such as misrepresentation or non-disclosure, and a party to the agreement has already suffered financial losses as a result, a breach of contract lawsuit can be brought on the matter. For example, if Company A contracts the sale of 20 barrels of its flour to Company B and a natural disaster wipes out all of Company A's flour stock before the sale can be completed, Company A could cause the contract to be declared unenforceable on grounds of impossibility. Vinergy argued that Richmond had no right to rescind under common law and should have followed the provisions of the contract.
The bottom line for cousins and subs at this point is to be prepared for the fact that, despite agreement on specific terms in a subcontract, an instance may arise where a court finds that federal common law applies rather than state law. For example, if a person is an employee and employees are entitled to minimum pay rates, any contract that intends to pay less than that minimum is not a contract.