An individual’s liberty to contract is circumscribed by the state’s police power, which allows for regulation in the interest of public health, safety, welfare, and morals. The court often uses the ‘rational basis test’ to determine if the state’s regulation serves a legitimate public interest and whether the means chosen to regulate are not arbitrary or discriminatory.
For example: A law mandating safety equipment for construction workers may be upheld because it reasonably relates to worker safety, despite imposing restrictions on the employer’s freedom to contract.