—Order reversed on the law with costs and motion granted. Memorandum: Plaintiff, a supplier of materials to subcontractor G.A. Dyce, Inc. (Dyce), instituted a class action pursuant to article 3-A of the Lien Law on behalf of itself and all others entitled to share funds owed to Dyce by the contractor. Dyce had filed a petition in Bankruptcy Court. Defendants LeCesse Brothers Contracting, Inc. (LeCesse) and LeCesse Corporation asserted as a second affirmative defense that LeCesse, the contractor, had a right, pursuant to its contract with Dyce, to offset against the funds owing to Dyce the costs, including legal fees, that it incurred in responding to a notice of mechanics’ liens and trust fund claims and in defending this action.
Plaintiff moved to dismiss so much of the second affirmative defense as sought to offset against the funds owing to Dyce the expenses incurred and to be incurred by way of legal fees and out-of-pocket expenses in connection with the defense of this action. Supreme Court denied that motion on the ground that plaintiff is bound by the contract between the contractor and the subcontractor. That was error.
"The purpose of the enactment of said article 3-A was to make more certain that laborers and materialmen on an improvement are paid from the project funds” (Frontier Excavating v Sovereign Constr. Co., 30 AD2d 487, 489, appeal dismissed 24 NY2d 991). The trust assets of which a contractor or a subcontractor is a trustee may be applied to specified expenditures in the performance of the contract or subcon*1054tract (Lien Law § 71 [2]). Payment of legal fees to oppose the claims of materialmen would not only be unauthorized by the statute, but such payment, if permitted, would permit the use of trust assets to defeat the rights of the very persons article 3-A was intended to protect (see, Chase Lincoln First Bank v New York State Elec. & Gas Corp., 182 AD2d 906, 907).
All concur except Boomer, J., who concurs in result in the following Memorandum.