The defendant, Ristorante Toscano, Inc. (Toscano), appeals from summary judgment entered in favor of *319the Beacon Hill Civic Association (Association). A Superior Court judge ruled that Toscano, by applying to the Boston licensing board for an all alcohol license, violated a 1984 contract with the Association, in which the Association agreed not to oppose Toscano’s application for a beer and wine license in exchange for Toscano’s promise not to apply in the future for an all alcohol license.1 We transferred the appeal here on our own motion. We conclude that the 1984 contract is unenforceable on public policy grounds. We reverse the judgment entered in the Superior Court, and conclude that Toscano is entitled to entry of summary judgment in its favor.
Facts. On April 11, 1984, the licensing board of Boston (board) held a hearing to determine whether Toscano, an Italian restaurant located on Charles Street in the Beacon Hill section of Boston, should have a license to sell beer and wine. Shortly before the hearing, representatives of the Association approached representatives of Toscano and informed them that the Association would oppose Toscano’s application, unless Toscano executed a contract under seal in which it promised, among other things, not to apply for an all alcohol license in the future.2 Toscano executed the contract.
At the hearing, the Association urged the board to incorporate the terms of the contract into the license itself. The board did incorporate a number of those terms, but not the restriction on Toscano’s future license applications. Regarding that term, the board stated that “the licensee’s agreement with the Beacon Hill Civic Association is decreed illegal by the Board.” No one appealed from that 1984 decision. Nine years later, in response to customer demand, Toscano applied for an all alcohol license. In August, 1993, over the Association’s opposition, the board voted to give Toscano an all alcohol license.
Pursuant to G. L. c. 138, § 67 (1994 ed.), twenty-five *320taxpayers (all members of the Association) appealed from the board’s decision to the Alcoholic Beverages Control Commission (ABCC). The ABCC conducted a public hearing in which it received testimony and documentary evidence. On Februaiy 23, 1994, the ABCC formally approved the board’s decision. As to the 1984 contract, the ABCC agreed with the board that it was illegal.
The Association then filed suit against Toscano, alleging breach of contract and (in the alternative) detrimental reliance and promissory estoppel, and seeking damages and injunctive relief. Toscano and the Association filed cross motions for summary judgment. A judge in the Superior Court entered judgment in the Association’s favor on the breach of contract claim.3 Toscano appealed.
Breach of contract. We agree with the Association that “[t]he general rule of our law is freedom of contract . . . .” Smith v. The Ferncliff, 306 U.S. 444, 450 (1939), quoting The Ferncliff, 22 F. Supp. 728, 742 (D. Md. 1938). That principle “rests on the premise that it is in the public interest to accord individuals broad powers to order their affairs through legally enforceable agreements.” E.A. Farnsworth, Contracts § 5.1, at 345 (2d ed. 1990). See Hartford Fire Ins. Co. v. Chicago, Milwaukee & St. Paul Ry., 175 U.S. 91, 106 (1899); Bates v. Southgate, 308 Mass. 170, 182 (1941); United Shoe Mach. Co. v. Kimball, 193 Mass. 351, 358 (1907). However, “[a]s was early recognized . . . contract rights are [not] absolute; for government cannot exist if the citizen may at will . . . exercise his freedom of contract to work . . . harm [to his fellow citizens]. Equally fundamental with the private right is [the right] of the public to regulate it in the common interest.” Commonwealth v. Henry’s Drywall Co., 366 Mass. 539, 543 (1974), quoting Nebbia v. New York, 291 U.S. 502, 523 (1934). Although “[c]ourts do not go out of their way to discover some illegal element in a contract or to impose hardship upon the parties beyond that which is necessary to uphold the policy of the law,” Nussenbaum v. Chambers & *321Chambers Inc., 322 Mass. 419, 422 (1948), it is a principle universally accepted that the public interest in freedom of contract is sometimes outweighed by public policy, and in such cases the contract will not be enforced. See Spence v. Reeder, 382 Mass. 398, 413 (1981); Broussard v. Melong, 322 Mass. 560, 561 (1948); Restatement (Second) of Contracts § 179 (1981); 6A A. Corbin, Contracts § 1375 (1962); 6 S. Williston, Contracts § 12:4 (R. Lord 4th ed. 1995).
“Public policy” in this context refers to a court’s conviction, grounded in legislation and precedent, that denying enforcement of a contractual term is necessary to protect some aspect of the public welfare. See Somerset Sav. Bank v. Chicago Title Ins. Co., 420 Mass. 422, 431 (1995); Begelfer v. Najarian, 381 Mass. 177, 189 (1980); Bates, supra; Adams v. East Boston Co., 236 Mass. 121, 128 (1920) (“The test is, whether the underlying tendency of the contract under the conditions described was manifestly injurious to the public interest and welfare”). See also Restatement (Second) of Contracts § 179 comment a (1981). In determining the public interest and welfare in these circumstances, we look to the Legislature’s statutory enactment. Although the policy that induced the enactment may not be set out in terms, “[t]he Legislature has the power to decide what the policy of the law shall be, and if it has intimated its will, however indirectly, that will should be recognized and obeyed.” United States v. Atlantic Mut. Ins. Co., 343 U.S. 236, 245 (1952) (Frankfurter, J., dissenting), quoting Johnson v. United States, 163 F. 30, 32 (1st Cir. 1908) (Holmes, J.).
General Laws c. 138 (1994 ed.) sets out the procedure for the issuance of licenses to serve alcoholic beverages. Sections 12 and 67 provide that such licenses must be approved by both the local licensing authorities (here, the board) and the ABCC. Selectmen of Barnstable v. Alcoholic Beverages Control Comm’n, 373 Mass. 708, 714 (1977). Applications are initially submitted to the local licensing authorities, who are required by § 15A to publish notice thereof “in a newspaper . . . providing general circulation .... The notice shall set forth the name of the applicant in full, the kind of license applied for, a description of the location and area where the license is intended to be exercised . . . .” Section 15A further provides that “[n]o application shall be acted upon by the local licensing authorities except after hearing thereon which shall be *322held not sooner than ten calendar days after the publication of such notice.” Licenses are then issued or denied “with a view only to serve the public need ... in such a manner as to protect the common good.” G. L. c. 138, § 23. If the local authorities grant a license, § 67 provides that “[u]pan the petition of twenty-five persons who are taxpayers of the city or town in which a license has been granted ... or who are registered voters in the voting precinct or district wherein the licensed premises are situated, the commission shall . . . investigate the granting of such a license . . . and shall, after a hearing, modify, suspend, revoke or cancel such license if, in its opinion, circumstances warrant.” In seeking to “serve the public need ... in such a manner as to protect the common good,” it is obvious that this statutory scheme assumes free and open discussion before the licensing officials. In other words, a public policy of open public participation is implicit in the statutory scheme.4
The Association argues that Toscano contractually waived its right to participate. We agree with the Association that such a waiver appears to be “similar to a settlement — a surrender of certain rights ... in exchange for certain benefits.” Spence, supra at 412. Nevertheless, the right to participate in licensing proceedings is created by statute, and “whether the effect of any specific statute can be avoided by contract depends upon the purpose for which the statute was enacted .... ‘[W]here laws are enacted on grounds of general policy their uniform application for the protection of all citizens alike is desirable, and an agreement to waive their provisions is generally declared invalid, but where they are designed solely for the protection of rights of private property, a party who may be affected can consent to a course of action, which if taken against his will, would not be valid.’ ” Continental Corp. v. Gowdy, 283 Mass. 204, 217 (1933) (creditor’s waiver of directors’ liability protects only private *323rights and is enforceable), quoting Washington Nat’l Bank v. Williams, 188 Mass. 103, 107 (1905). See Metz Co. v. Boston & Me. R.R., 227 Mass. 307, 308-310 (1917) (waiver of rights in contravention of interstate commerce act not enforceable).5 Because the application review provisions of c. 138 are grounded in general policy concerns rather than protection of private property rights, we hold that Toscano’s contractual waiver of the right to apply for a license, and the Association’s contractual waiver of the right to oppose the issuance of a license, are unenforceable. “To accept such . . . waiver[s] as valid would destroy the very purpose of the statute.” Spence, supra at 413.
Our view is in harmony with other cases involving contracts to withdraw opposition to an application for a government permit. Old Colony R.R. v. New Bedford, 188 Mass. 234 (1905), involved a hearing before county commissioners deciding whether to approve a city council’s plan to establish a new railroad crossing. The railroad initially opposed the plan, but withdrew its opposition after the town contracted to pay certain expenses aimed at minimizing the railroad’s liability. We said that “[vjiewed . . . as an attempt to influence the decision of the county commissioners by paying an objecting party to withdraw his opposition to a petition, we think it plain that it is not within the powers conferred . . . upon cities and towns. Such a contract, made for no other purpose, in reference to a matter like the laying out of a highway, would be against public policy.” Id. at 236.
Similarly, in New York City Transit Auth. v. Jamaica Buses, Inc., 20 Misc. 2d 659, aff'd, 16 A.D. 2d 959 (N.Y. 1962), a bus company applied to the New York State Transit Commission for a certificate to operate buses along certain streets. A competing bus company opposed the application, then withdrew its opposition in exchange for the applicant’s promise to pay it five cents for each passenger carried. Years later, the applicant stopped paying and the competing company sued. The court refused to award dam*324ages, stating: “The State of New York controls common carriers for the general protection and safety of the public. The State, through the legislature, requires transportation corporations to secure Certificates . . . pursuant to [the statutory process and] . . . after a hearing upon notice. ... No private agreement with respect to the issuance of a Certificate . . . can thus be binding.” Id. at 660. We think the same principles apply here.6
In sum, where a “statute . . . rests upon grounds of public policy, it is not in the power of one who may be directly affected by it to contract in advance that it may be disregarded.” Desseau v. Holmes, 187 Mass. 486, 488 (1905). Accord Canal Elec. Co. v. Westinghouse Elec. Corp., 406 Mass. 369, 377-378 (1990); New England Tel. & Tel. Co. v. Brockton, 332 Mass. 662, 666 (1955), quoting Hudson County Water Co. v. McCarter, 209 U.S. 349, 357 (1908) (“One whose rights, such as they are, are subject to state restriction, cannot remove them from the power of the State by making a contract about them”).
Estoppel. In its complaint, the Association asserted that the contract should be enforced because the Association reasonably and detrimentally relied on Toscano’s promise. The Legislature has, however, by enacting the application review provisions of G. L. c. 138, declared public policy. “The public policy thus declared supersedes the ordinary doctrine of estoppel, so far as that would interfere with the accomplishment of the dominant purpose” of those provisions. Haverhill Gas Co. v. Findlen, 357 Mass. 417, 420 (1970), quoting New York, N.H. & H.R.R. v. York & Whitney Co., 215 Mass. 36, 40 (1913). In short, “[e]stoppel cannot rest on an illegal contract.” New York, N.H. & H.R.R., supra.
*325Accordingly, we vacate the judgment entered in the Superior Court and remand this case for entry of judgment in favor of Toscano.
So ordered.
General Laws c. 138, § 12 (1994 ed.), provides for the issuance of licenses “to sell all alcoholic beverages or only wines and malt beverages.” We refer to these respectively as “all alcohol licenses” and “beer and wine licenses,” as did the Superior Court judge and the Alcoholic Beverages Control Commission (ABCC).
The contract, entitled “Conditions Relating to Ristorante Toscano (41 Charles Street) Seven-Day Malt and Wine License,” included eight other conditions not at issue here.
As part of the same action, “Twenty-Five Voters and/or Taxpayers of Beacon Hill” (taxpayers) sought review of the ABCC’s decision pursuant to G. L. c. 30A, § 14 (1994 ed.). On the c. 30A claim, the judge below granted summary judgment “in favor of the ABCC ... on grounds of mootness.” That ruling is contradictory, because a court may not enter judgment for a party on a moot claim. See Matter of Sturtz, 410 Mass. 58, 59-60 (1991) (courts decline to decide hypothetical disputes). The taxpayers, however, have not challenged that ruling here.
The ABCC described the process as follows: “In reviewing an application for a license, the local licensing authority and [the] Commission consider a wide range of factors in determining public need and fitness and suitability of the applicant before making the ultimate determination as to whether to grant the license. The input of local residents, individually and through civic organizations^] is common in deciding the issue and when appropriate in setting conditions on the license. If local residents wish to have conditions placed on the licensee, the time for seeking such conditions is at the hearing and the place for such conditions is on the license itself.”
See also Canal Elec. Co. v. Westinghouse Elec. Corp., 406 Mass. 369, 378-379 (1990) (enforcing utility company’s waiver of G. L. c. 93A claims, but stating “we ordinarily would not effectuate a consumer’s waiver of rights under c. 93A” [emphasis in original]); Spence v. Reeder, 382 Mass. 398, 412-413 (1981) (tenant’s waiver of right to hearing before housing authority is not enforceable); Desseau v. Holmes, 187 Mass. 486, 488 (1905) (consumer rights created by statute may not be waived by contract).
See also Holyoke St. Ry. v. Department of Pub. Utils., 347 Mass. 440, 444-446 (1964) (provision in contract between common carriers unenforceable where not included in issued certificate); Nussenbaum v. Chambers & Chambers Inc., 322 Mass. 419, 422-423 (1948) (agreement to raise salary in contravention of wage stabilization act valid where not intended to be effective until approved by Federal authorities); North Lincoln Park Neighborhood Ass’n v. Alcoholic Beverage Control Bd., 666 A.2d 63, 66-67 (D.C. 1995) (agreement between liquor licensee and neighborhood association and ratified by licensing board became part of license under regulatory scheme).