These actions are to enforce liens ■claimed by the respective plaintiffs against real estate of the ■corporation defendant.
■ In the first the complaint alleges said defendant’s ownership of the land; that in May, 1877, it made a contract with *330the defendant Anderson, by which he agreed to construct,, during the years 1877 and 1878, a building on the land; that afterwards plaintiff contracted with Anderson to do a part of' the work on the building, and furnish part of the materials, therefor; that he accordingly did such work and furnished such materials, between May 30, 1877, and September 2é, 1878; that there is a balance due him from Anderson therefor, and that he has made and filed the account thereof, as. required by the act of 1878. There is also a similar claim alleged for work done and materials furnished by him, under-a contract with Anderson, made in April, 1878.
The complaint in the second action is for materials furnished Anderson for constructing a building on the land of' the corporation, between April 1, 1878, and November 10, 1878. This complaint does not aver the existence of any contract between the corporation defendant and Anderson for constructing the building, but avers that Anderson “was building and constructing a school-building for said St. Olaf’s. School, situate on,” etc. A demurrer to the first complaint was sustained, and a demurrer to the second overruled.
Prior to the passage of Laws 1878, c. 3, amending Gen. St. c. 90, (Gen. St. 1878, c. 90, §§ 2-6,) no one was .entitled, to a lien on building and land for work done or materials furnished for constructing, altering or repairing a building, unless, he had a contract with the owner, or his agent, for doing orfu’rnishing the same. The remedy of one doing work on, or furnishing material for the building, for the builder or contractor, was against the amount that might be due the latter, under-, his contract with the owner, at the time notice should be. served on the owner by the person doing such -work, or furnishing such material. Under chapter 90, before the amendment, the remedy, both to the original contractor and those, doing work or furnishing material for him, depended upon, there being a contract with the owner. The change effected, bv the amendment of 1878 is in extending the right of lien.. *331to those who, before that time, had right of recourse only against the amount due from the owner to the builder or contractor.
The second section* of the chapter, as amended, construed literally and by itself, might seem to indicate an intention to give a right of lien to anjr one doing work on, or furnishing material for a building, whether the owner of the land consented to its erection or not, or even if erected against his will; but as it would not be within the power of the legislature to do this, we must look beyond the mere language of that section to ascertain the intention. The giving of a lien in favor of any others than the builder is^in effect, making the owner, to the extent of his interest in the building and land, surety that the builder will pay the debts contracted by bim in erecting the building. '*
To enable the owner to avoid the inconvenience and risk that would accrue to bim from this, section 3 provides: “Upon entering into a contract to do any work or furnish any materials for which a lien might accrue under section 1 of this chapter, if the contractor will enter into a bond with the owner, for the use of all persons.who may do work or furnish materials pursuant to such contract, conditioned for the payment of all just claims for such work or materials as they become due,” then, the bond being in such amount, not less than the agreed price in' the contract, and with such sureties as the judge of the district court or justices of the peace shall *332approve, and being filed in the office of the register of deeds, and notice thereof being kept conspicuously posted on the. premises, “no lien shall attach in favor of the persons mentioned in section 2 of this chapter.” Section 4 provides that the mak'ng and filing of such bond, at any time after the making of such contract, shall discharge all such liens that have accrued, and prevent any others accruing. Section 5 provides: “Any person entitled to a lien under the provisions of section 2 of this chapter shall be considered a party in interest in said bond, and may bring an action thereon, in his own name, for the value or contract price of labor done or materials furnished under the provisions of the contract with the owner.” These sections cover all cases where there is a contract with the owner, and refer to no other.
As we cannot assbme that the legislature intended what it had no power to do — to impose liens on the owner’s property, without any reference to his consent — the liens provided for in sections 3, 4 and 5 are those intended to be created by section 2; and liens are intended only in favor of those who contribute, by labor or materials, to the erection, alteration or repairs of any house, etc., which the owner has contracted to have erected, altered or repaired. The basis of the right to enforce a claim as a lien against the property is the consent of the owner. ITis consent is evidenced by his contract, where the statute gives the lien as a consequence of his contract, and of the doing work or furnishing materials in the performance of it. Parties are presumed to contract with reference to the existing law affecting or annexing incidents to their contracts. This statute gives, as an incident to a contract, for erecting, altering or repairing a house, etc., power to the builder or contractor to charge the house, etc., and the land, with debts for labor and material incurred by him in performing the contract. The owner consents to this power conclusively and irrevocably, so far as others than the builder or contractor are concerned, by mailing a contract while such is the law.
*333A contract made prior to the amendment of 1878 was not, as the law stood, subject to this incident; the owner did not thereby give nor consent to any such power. A subsequent act of the legislature could not make the contract have any such effect. Donahy v. Clapp, 12 Cush. 440.
In the first of these cases, the contract between the owner and builder, having been made in 1877, must be governed by the law then existing, which gave no lien except to the builder. The demurrer in that ease was properly sustained. In the other case, the complaint was bad, because it did not allege the existence of any contract on the part of the owner, and the demurrer ought to have been sustained.
Order in the first case affirmed, and the order in the second case reversed.
This section, so far as liere material, reads as follows: “Every mechanicor other person doing or performing any work toward the erection, alteration or repair of any house, mill, manufactory, *' * or other building, or appurtenances, * * or furnishing any material for the construction, alteration or repair of such building, * * whether such work is performed as journeyman, laborer, .carman, subcontractor or otherwise, shall have a lien, for the value or contract price of such labor or material, upon such house, mill, manufactory, or other building, and appurtenances, * * together with the right, title or interest of the person owning such house, mill, manufactory, or other building and appurtenances, on and to the land upon which the same is situated, not exceeding forty acres,” etc. Gen. St. 1878, c. 90, § 2. fliEroKTEit.