This is a bill in equity brought by the plaintiff surety company seeking reimbursement for the amount paid by it to a lien claimant upon a bond given by the plaintiff, as surety, and the defendant Thomas D. Murphy, as principal, as security under G. L. (Ter. Ed.) c. 149, § 29. The case was heard on agreed facts, a final decree was entered for the plaintiff, and the case is before this court on the appeal of the Standard Oil Company of New York, an intervening petitioner. The agreed facts are as follows: “On May 5, 1930, the defendant Thomas D. Murphy entered into a contract with the defendant town of Winthrop to build and surface certain streets in the town of Winthrop. The plaintiff Commercial Casualty Insurance Company was the surety on the bond in the penal sum of $10,000 given by the defendant Murphy in connection with this contract. The bond was conditioned upon the obligation to pay all claims for all labor performed or furnished and to indemnify and save harmless the town of Winthrop from all such claims. This bond was the security *103obtained by the town of Winthrop under the provisions of G. L. c. 149, § 29, and having obtained security by bond it was under no obligation to furnish other additional security for payment by the defendant Murphy for labor performed and materials furnished by subcontractors. The contract between the town of Winthrop and the defendant Murphy provided that the town might withhold fifteen per cent of the contract price for a period of sixty-one days after the final completion of the work, not only to protect the town against all claims of subcontractors remaining unpaid, but also to protect the town against any loss sustained by reason of any default on the part of the defendant Murphy. In connection with the execution of the bond the defendant Murphy gave the plaintiff an indemnity agreement dated May 2, 1930, which included, among other provisions, an assignment to the plaintiff of all deferred payments and retained percentages due at the time of any breach or default to be credited by the plaintiff upon any loss, charge or expense suffered by it by reason of its execution of the bond. On October 27, 1930, the Lynn Sand & Stone Company, a subcontractor which had furnished labor or materials to the defendant Murphy, filed a notice with the town clerk in accordance with the provisions of the statute that it had a claim in the sum of $3,311.02. The plaintiff then notified the defendant town that it held an assignment of all retained percentages and other moneys due the defendant Murphy, and subsequently the plaintiff paid this claim of the Lynn Sand & Stone Company and accepted an assignment of its claim on April 28, 1931. The claim of the Lynn Sand & Stone Company was the only claim filed within the time and in the manner provided by the statute. The defendant Standard Oil Company of New York furnished material to the deféndant Murphy in the performance of his contract with the town of Winthrop, but it failed and neglected to file notice of its claim within the time provided by statute and it has no claim upon the bond which was the security furnished by the town in compliance with the statute. Having failed to file a notice which would enable it to obtain the benefit of *104the security of the bond, the defendant Standard Oil Company of New York brought an action at law against the defendant Murphy by a writ dated March 18, 1931, and sought by trustee process served upon the town of Winthrop on March 19, 1931, and March 21, 1931, to attach the funds constituting the retained percentage in the hands or possession of the town of Winthrop. The work under the contract was completed on September 2, 1930, and at that date the defendant town of Winthrop had in its hands or possession as a retained percentage a fund in the sum of $2,330.10. It still holds this retained percentage and it has accepted the work and has no claim against the defendant Murphy.”
The single issue presented by the record in this case is whether the plaintiff as surety upon the bond representing the statutory security, having paid the claim of the only subcontractor which filed a notice, is entitled to a priority in the retained percentage held by the town as against the Standard Oil Company of New York, an attaching creditor.
The plaintiff claims priority upon two distinct grounds: (1) “The plaintiff acquired by assignment, prior in point of time to the Standard Oil Company attachment, all interest of the defendant Murphy in the retained percentage”; and (2) “The provision in the contract for a retained percentage was an indemnity upon which the plaintiff, as surety, justly relied, and by payment of the sole hen claimant it acquired an equitable priority in this fund superior to the rights of assignors of the contractor and attaching creditors.” In this Commonwealth a prior assignee for value prevails over a subsequent attaching creditor who attempts by trustee process to attach the funds in the hands of the debtor, even though no notice of the assignment has been given to the trustee debtor prior to the attachment. Thayer v. Daniels, 113 Mass. 129. Dix v. Cobb, 4 Mass. 508. Cosmopolitan Trust Co. v. Leonard Watch Co. 249 Mass. 14, 19. It appears, however, by the agreed facts that notice of the assignment of Murphy to the plaintiff was given to the town on or about October 27, 1930, which was coincident in time *105with the notice filed by the Lynn Sand & Stone Company in accordance with the provisions of the statute. The assign-» ment of the defendant Murphy to the plaintiff was supported by ample consideration.
The Standard Oil Company of New York contends that the defendant Murphy could not assign his interest to the plaintiff for the reason that art. I of the contract provided that the contractor “shall not, except as the Board [board of selectmen] shall authorize in writing, assign or let any part of the contract or of anything to be done thereunder”; and contends that the payment by the defendant town to the defendant Murphy was clearly something to be done under the terms of said contract and that no assignment of it (i.e. “all the deferred payments and retained percentages . . .”) could be made without the authorization in writing of the board of selectmen of the town; that no such authorization in writing was ever obtained, and no question of waiver as a matter of fact is raised, citing New-bury v. Lincoln, 276 Mass. 445, 450. The short answer is that the payment of the deferred payments and the retained percentages was a thing to be done by the town and not by Murphy. More specifically, the provisions of arts. VII and IX of the Murphy contract with the town show clearly that the amounts retained were to cover damages or claims for which the town might be hable. Art. VII reads: “The Contractor agrees to indemnify and save harmless the Town from all claims against said Town by mechanics, laborers and others, for work performed or materials furnished for carrying on the contract, and until said claims shall have been satisfactorily discharged the Town may retain from any money due, or that may become due the Contractor under this contract, such sum or sums as may be sufficient to cover such claims”; and art. IX: “The Town, within sixty-one days after the work shall have been entirely completed in accordance with the contract and upon certification thereto by the Engineer, provided the Contractor shall have in all respects faithfully performed the contract, shall allow and pay to the Contractor the balance of the contract sum, first deducting such sums paid for *106carrying on the contract as above provided together with such sums as may have been required to settle the claims for labor and materials specified in the above article, or to secure those remaining unpaid, together with any other sums retained or paid under the provisions of this contract.” It is obvious that there is nothing in arts. VII and IX which, inhibited the giving of an assignment of “deferred payments and retained percentages” subject to the right of the town to make payments therefrom as provided in art. IX. If the contract be interpreted, as it should be, as giving the town the right to pay claims for labor and materials arising out of the constructions whether or not the claims were filed according to the statute, the town has not elected to pay, and has elected, as shown by its answer to the trustee writ, to hold the funds as a stakeholder. The town raises no objection to the recognition of the assignment on this ground and the defendant Standard Oil Company of New York is not entitled to raise the objection. See Newbury v. Lincoln, 276 Mass. 445.
The Standard Oil Company of New York further contends that the assignment of Murphy was void in that it purported to assign money to be earned in futuro under the terms of a contract that at the time the assignment was executed and delivered was not in existence, citing Williston on Contracts, § 414, at page 770, Eagan v. Luby, 133 Mass. 543, Raulins v. Levi, 232 Mass. 42. The principle relied on is well established in the law and is not questioned by the plaintiff, the position of the plaintiff being that the application for the contract, the execution of the bond, and the contract with the town all related to the same subject matter and should be treated as essential parts of one transaction. So considered the application, which was dated May 2; 1930, was a contract to execute an assignment, which would not be effective until the bond was executed and delivered to the town concurrently with the execution of the construction contract between Murphy and the town. The application bears date as of May 2, 1930, the construction contract bears date of May 5, 1930, and the bond is dated May 6, 1930. It is plain that these *107undertakings were so interrelated as to constitute one transaction, and it is obvious that the assignment did not become effective as a binding obligation upon Murphy until the bond was accepted by the town and the contract with the town executed.
It is agreed that the figures $2,230.10 as they appear in the second paragraph of the final decree shall be amended to read $2,330.10. The final decree as amended is
Affirmed with costs.