Exhibit 5.1

October 12, 2022
DICE Therapeutics, Inc.
400 East Jamie Court, Suite 300
South San Francisco, CA 94080
Ladies and Gentlemen:
We deliver this opinion with respect to certain matters in connection with the offering by DICE Therapeutics, Inc., a Delaware corporation (the “Company”), of up to 9,452,054 shares (the “Shares”) of the Company’s common stock, par value $0.0001 per share (the “Common Stock”), including 1,232,876 shares of Common Stock subject to an underwriters’ option to purchase additional shares, to be issued pursuant to that certain Underwriting Agreement (the “Underwriting Agreement”), dated as of October 12, 2022, between the Company and BofA Securities, Inc., SVB Securities LLC, Evercore Group L.L.C. and Guggenheim Securities, LLC, as representatives of the several underwriters named therein. The Shares were registered pursuant to the Registration Statement on Form S-3 (File No. 333-267702) filed by the Company with the Securities and Exchange Commission (the “Commission”) on October 3, 2022 and declared effective on October 7, 2022 (the “Registration Statement”) under the Securities Act of 1933, as amended (the “Securities Act”), including the prospectus dated October 7, 2022 included therein (the “Base Prospectus”) as supplemented by the preliminary prospectus supplement dated October 11, 2022 and the final prospectus supplement dated October 12, 2022, filed with the Commission pursuant to Rule 424(b) under the Securities Act (collectively, the “Prospectus Supplements” and, together with the Base Prospectus, the “Prospectus”). The offering of the Shares by the Company pursuant to the Registration Statement, the Prospectus and the Underwriting Agreement is referred to herein as the “Offering.”
In connection with our opinion expressed below we have examined originals or copies of the Underwriting Agreement, the Company’s Restated Certificate of Incorporation, filed with, and certified by, the Delaware Secretary of State (the “Restated Certificate”) and the Company’s Restated Bylaws (the “Bylaws” and, together with the Restated Certificate, the “Charter Documents”), the Registration Statement, together with the exhibits filed as a part thereof and all other documents incorporated therein by reference, the Prospectus, certain corporate proceedings of the Company’s board of directors (the “Board”) or a committee or committees of the Board and the Company’s stockholders relating to the Registration Statement, the Company’s Restated Certificate and Bylaws, and such other agreements, documents, certificates and statements of the Company, its transfer agent and public or government officials, as we have deemed advisable, and have examined such questions of law as we have considered necessary.
We have assumed, and express no opinion as to, the genuineness of all signatures on documents submitted to us, the authenticity and completeness of all documents submitted to us as originals, the conformity to originals and completeness of all documents submitted to us as copies, the legal capacity of all persons or entities executing the same, the absence of any undisclosed termination, modification, waiver or amendment to any document reviewed by us, the absence of any other extrinsic agreements or documents that might change or affect the interpretation or terms of documents we have reviewed, and the due authorization, execution and delivery of all such documents where due authorization, execution and delivery are prerequisites to the effectiveness thereof. In giving our opinion, we have also relied upon a good standing certificate regarding the Company issued by the Delaware Secretary of State dated October 12, 2022 and a management certificate addressed to us and dated of even date herewith executed by the Company containing certain factual representations by the Company (the “Management Certificate”).
We render this opinion only with respect to, and express no opinion herein concerning the application or effect of any laws other than the existing Delaware General Corporation Law. In connection with our opinions expressed below, we have assumed that, (i) at or prior to the time of the issuance and delivery of any of the Shares, there will not have occurred any change in the law or the facts affecting the validity of the Shares, any change in actions of the Board or the Company’s