The appellant’s first point is, that the referee erred in excluding the evidence offered by the defendants of the value of the plaintiff’s services, and in rendering a judgment upon an issue not made by the pleadings.
By the Code, all forms of pleadings were abolished, except as prescribed by that act. A plain and concise statement of the facts upon which the party relies, is all that is now required. This complaint, after stating the character of the parties, the employment, its nature, and the condition of the subject matter, avers the value of the services to be five thousand dollars, and that the defendant promised and agreed to pay that sum therefor.
The complaint is not, therefore, strictly upon the quantum meruit; it is equally a count for a specific sum agreed to be paid. Therefore, proof of such agreement was not inconsistent .with the complaint; neither was it a variance. And when the *179plaintiff withdrew all claim upon the quantum meruit, and claimed to recover upon a special agreement for the service, the actual value of the services rendered became wholly immaterial ; that question was no longer in the case, and it was not error then to reject the defendants’ offer to prove value.
There was no claim on the trial that the defendants had been misled by the plaintiff’s being permitted to prove a special agreement for the services claimed in the action, or by the rejection of their offer to prove the value of such services. Therefore, if there was any variance between the allegations in the •pleadings and the proofs, it was not material (Code of Pro. § 169); and even now, if necessary, this court might, by order, confirm the pleading to the fact proved, because the claim is not substantially changed. Id. § 173.
I most fully concur with the defendant’s counsel, that this contract should be construed with reference to the subject and the situation. What the defendants wanted was their pay. In seeking it they had been defeated and mulcted in over one thousand two hundred dollars, costs. They then sought the services of the plaintiff, and agreed, if he would take their case, and succeeded, he should be paid five thousand dollars. Such is the fact as found by the referee; and his findings being conclusive, they constitute the facts upon which the rights of the parties must here be determined.
. It was said in Thompson v. Kessel, 30 N. Y. 383, that when the testimony before a referee is conflicting upon all the material points involved in the action, and the court at general term has affirmed the judgment, the court of appeals cannot look into the testimony to determine whether the facts found are found according to the weight of evidence. See, also, Bergin v Wemple,* Id. 319. This branch of the case, therefore, stands upon the basis that the plaintiff rendered the services sued for upon a special offer of compensation made at the time of the employment. Entering upon the service was an acceptance of that order; and the offer and its acceptance constituted a valid agreement, supported by a sufficient consideration.
Since the adoption of the Code, there is nothing to prevent *180an attorney from agreeing with his client as to the amount and terms of his compensation. In this case, the plaintiff’s compensation was dependent upon success; that success was only contemplated through the prosecution of the action between the defendants and their opponent; and it is morally certain that no settlement would have been proposed, but for the plaintiff’s efforts and partial success in prosecuting said action.
The defendants by their agreement with the plaintiff, were not debarred from settling and discontinuing said action; but in doing so, they only terminated that litigation; they did not put an end to their contract with the plaintiff. The plaintiff? having performed on his part until stopped by the defendants, is entitled to full indemnity — is entitled to recover precisely what he would have made by performance. Masterton v. Mayor of Brooklyn, 7 Hill, 61, 75, and cases cited. I think the rule is, that where performance is arrested and prevented by the act or omission of one party, the other has the election either to treat the contract as rescinded, and recover on the quantum meruit the value of the services rendered, or work performed, or to sue upon the contract and recover for what has been done, at the stipulated price, and for the loss, in profits or otherwise, sustained by the operation. This was the rule upon which Jones v. Judd, 4 N. Y. (4 Comst.) 412, was decided, although upon that question this court was equally divided.
It is a general rule that a party injured by a breach of contract is entitled to recover, not only all his damages, but also all gains prevented, if the gains were such as would have accrued to him from the contract itself, had it been performed. Clark v. Mayor,* &c., 3 Barb. 288; Davis v. Talcott, 14 Id. 611.
The principle of allowing profits is now well established-See Shephard v. Milwaukee, 15 Wis. 318; Hinckley v. Beck-*181with, 13 Id. 31; Philadelphia, W. & B. R. R. v. Howard, 13 How. U. S. 307, 344 ; Sedg. on Dam. 3rd ed., p. 75; Fox v. Harding, 7 Cush. 576.
In cases where there is to be an outlay to earn the sum stipulated, if completion is prevented, such outlay, if not made, should be deducted, in order to determine the profits; but in this case there is'no such consideration; here no outlay or expense was to be incurred; the sum agreed upon was the measure of profits, had the contract been performed; and its performance is pronounced when performance has been prevented by the-interference of the other party; and hence the sum agreed is equally the measure of damages. Costigan v. Mohawk & H. R. R. Co., 3 Den. 609.
The referee, in adjusting the plaintiff's recovery, apportioned, it as the amount received bore to the amount claimed. This within the principles above stated, was as favorable as the defendants could ask. They claimed sixty-six thousand dollars; they agreed to give the plaintiff five thousand dollars if he should succeed in recovering it; the plaintiff had partially succeeded, and was diligently prosecuting the work, when the defendants arrested his proceedings and accepted fifty-six thousand dollars. Clearly the rule of damages applied was manifestly equitable and just.
Woodruff, J.,was of opinion that the defendants had no right to deprive the plaintiff of the opportunity of succeeding in the suit, and evade liability for compensation, on the ground that success was not certain. The plaintiff had a right to insist that, according to the mutual agreement of the parties, and by its just implication, success was possible; and that this was enough, under the circumstances, to entitle the plaintiff to recover at the contract rate of compensation, at least pro rata; and that obviously no more equitable apportionment could be made than that which the referee adopted, viz: to require payment in proportion to the sum recovered. Whether the plaintiff was not entitled to recover the whole contract price, it was unnecessary to consider, as he had not appealed from the judgment.
In this opinion Masost, J., was understood to concur.
Followed in Baldwin v. Van Deusen, 37 N. Y. 487.
Clark v. Mayor, &c. was reversed in the court of appeals (4 N. Y. [4 Comst.] 338), on the ground that, although the doctrine above stated is the true rule in the case of an action upon the contract, for its breach, it is not applicable where the contractor treats the contract as rescinded, and sues merely on a quantum meruit, for work, &c. done. In that case, the actual value is the measure of damages; in the case in the. text, it will be observed, the recovery was on the contract.