The warrants involved in this case were all issued to the defendant Reiff while he was a member of the board of supervisors of the plaintiff county. Some of them covered work done by his team, and others were issued to him for labor performed by others; the claim or demand therefor having been purchased by him at a discount. The warrants were declared to be illegal, and, so far as they concerned the work of the defendant’s team, the judgment is not assailed, except on the ground of an alleged estoppel which we shall hereinafter discuss. Aside from the question of estoppel, the judgment on this branch of the case is clearly right under section 468a of the Supplement to the Code of 1902, and the holding in Nelson v. Harrison County, 126 Iowa, 436. Section 596 of the Code provides as follows: “No officer of any county . . .• shall, directly • or indirectly, be permitted to take, purchase, or receive in payment, exchange, or in any way whatever, any warrant, scrip or other evidence of its indebtedness or any demand against it for less amount than that expressed on the face of the warrant, scrip, or other evidence of indebtedness or demand with accrued interest thereon.” The trial court evidently construed .this *679section as prohibiting the purchase at a discount of any claim or demand against the county whether evidenced by writing or not. The facts are that the defendant Reiff sometimes paid certain laborers for their alleged time, less the discount, and as we understand the record, made out the bills therefor himself and had them allowed on his recommendation and without verification by the person doing the work.
, „ 1. Counties: cUimsaby°f The appellant contends that the statute refers only to the purchase of legal written evidences of the indebtedness of the county manifested in some form of obligation on its part. The contention is manifestly unsound, * f°r the statute itself specifies warrants, scrip, or 0tber evidence of its indebtedness, and then further says, “ or any demand against it.” A demand against the county may be in very informal shape and still be legal and represent an honest claim, and the very clear meaning of the statute is to prohibit speculation in any form of indebtedness issued by the county, and in any form or character of demand made against it. Any other construction would destroy the very purpose of the law, and provide a complete cover and shield for the acts which are prohibited. It is further said that, even if the transaction falls within the prohibition of the statute, the county has received, the benefit of the work, and that it is inequitable and unjust to hold the warrants void. ■ It is a fundamental rule, however, that rights based on the violation of the law will never be enforced by the courts, and this without reference to the wish of either party to the transaction. If the court is advised that the transaction is illegal because in contravention of a statute making it a criminal offense, it is sufficient to justify a refusal to uphold the transaction in any way. Nelson v. Harrison County, supra; Berka v. Woodward, 125 Cal. 119 (57 Pac. 777, 45 L. R. A. 420, 73 Am. St. Rep. 31) ; Bank v. Owens, 2 Pet. (U. S.) 527 (7 L. Ed. 508); Hall v. Coppell, 7 Wall. (U. S.) 542 (19 L. Ed. 244).
*6802.Same: estoppel: compromise and settlement: fraud. The plea of estoppel is based on the following facts: An examination of the auditor’s office of the county in 1902 showed a condition of affairs that incited action, and upon examination it was found that a large amount °f road fun(ls and some of the general fund ^ad ]jeeil drawn by Reiff and unaccounted for. Following this, he was indicted for embezzlement, and an action brought to remove all of the members of the board. During the pendency of the cases against Reiff, one of the other members was tried and removed from the office. When the removal case against Reiff was called for trial he proposed a settlement, and produced receipts showing the expenditures for road purposes of all of the sum drawn by him except about $1,154. It was then agreed that he should pay this sum to the county, resign his office, and pay all costs of the removal action, whereupon the civil suit and the criminal case were to be dismissed, and the arrangement was in fact fully carried out. At that time the county did not know of the transactions involved in this action, but the receipt that was then given to Reiff by the county attorney, acting for the county, contained the recital that it was for the purpose of releasing Reiff from “ all liability on account of any and all county funds heretofore coming into his hands.” In our judgment neither the transaction nor the receipt constituted such a settlement as will estop the county in this action, even if it be conceded that the county would be estopped by a settlement that covered the precise matters in issue here. Notwithstanding the recital in the receipt delivered to Reiff, there was a settlement only of the specific account then under consideration. There was a direct examination and an exact statement as to the fund which it was claimed by the county had been misappropriated by the defendant, and no attempt was made to cover anything else. The defendant Reiff then knew that he had violated the statute in the respects herein stated, and his concealment of the facts relating thereto may well be held *681to constitute such fraud as would permit an impeachment of the settlement, even if it were intended to cover all items between them. 1 Cyc. 460, 312, 338; Boston & L. R. Corp. v. Nashua & L. R. Corp., 157 Mass. 258 (31 N. E. 1067); Jones v. Fennimore, 1 G. Greene, 134; Watson C. & M. Co. v. James, 72 Iowa, 184.
The illegality in the transaction now before us was clearly not settled when the other cases were dismissed. The judgment of the district court is therefor right, and it is affirmed.