
146 N.J. Super. 6 (1976)
368 A.2d 943
NEW JERSEY BANK (NATIONAL ASSOCIATION), A CORPORATION OF THE UNITED STATES OF AMERICA, PLAINTIFF-RESPONDENT,
v.
JOSEPH P. PALLADINO, DEFENDANT, AND FIRST STATE BANK OF HUDSON COUNTY, DEFENDANT-APPELLANT.
Superior Court of New Jersey, Appellate Division.
Submitted November 22, 1976.
Decided December 13, 1976.
*9 Before Judges BISCHOFF, MICHELS and E. GAULKIN.
Messrs. Waters, McPherson & Hudzin, attorneys for appellant, (Mr. John M. Strichek on the brief).
Mr. Allan A. Maki, attorney for respondent.
Messrs. Schumann, Hession, Kennelly & Dorment, attorneys for intervenor Federal Deposit Insurance Corporation (Ms. Dorothea O'C. Wefing on the brief).
The opinion of the court was delivered by BISCHOFF, J.A.D.
Defendant First State Bank of Hudson County and intervenor Federal Deposit Insurance Corporation, as liquidator of First State Bank of Hudson County, appeal from a judgment entered in favor of plaintiff New Jersey Bank and against the defendants in the sum of $65,595.60.
The basic facts giving rise to this lawsuit are undisputed.
In July 1972 defendant Joseph P. Palladino sought a 90-day loan of $100,000 from plaintiff. Everett Muh, an officer in plaintiff bank, asked for a financial statement and requested "some sort of collateral or support" for the loan. In compliance with this request plaintiff received a letter dated July 5, 1972 from Edward B. Dooley, president of defendant bank, reading:
This letter will serve as a commitment to you that the First State Bank of Hudson County will assume the obligation arising from a note signed by Mr. Joseph P. Palladino on July 16, 1972, in the amount of $100,000.00.
We will honor this commitment, ninety (90) days after the date of the note, upon notice to us that the loan has not been paid by Mr. Joseph P. Palladino.
That same day, July 5, Palladino executed a note for $100,000, received a check in that amount from plaintiff and deposited it to his account in defendant bank as part of a deposit of $125,000.
*10 Records of defendant bank indicate that as of June 5, 1972 Palladino owed defendant bank $60,000 and that on July 12 this amount was reduced to $28,000, a reduction of $32,000.
The $100,000 note came due on October 3 and plaintiff demanded payment. Dooley called Muh of plaintiff bank and requested that plaintiff accept a $50,000 reduction from Palladino and accept a new note in the amount of $50,000 for six months, upon the understanding that a new letter would be forwarded from defendant-bank to plaintiff. Muh agreed.
Plaintiff received the $50,000 in reduction of the loan. Palladino executed a new note for $50,000 dated October 12, 1972, and Dooley, as president of the First State Bank of Hudson County, sent the following letter to plaintiff, dated October 11, 1972:
This letter will serve as a commitment to you that the First State Bank of Hudson County will assume the obligation arising from a note signed by Mr. Joseph P. Palladino on October 12, 1972 in the amount of $50,000.00.
We will honor this commitment six (6) months after the date of the note upon notice to us that the loan has not been paid by Mr. Joseph P. Palladino.
No payments were ever made on account of the principal of the note, though quarterly payments of interest were made. Plaintiff carried the note past it due date and at the time of trial the interest due was $7,762.20. The note provided for 15% attorneys fees on the principal, or $7,500, thus the total amount alleged due was $65,262.27, which sum plaintiff sought to recover from defendant.
The trial judge found that the letter from Dooley on behalf of defendant bank was a guaranty, valid and binding on the bank; that said bank benefited from the loan by reduction of the Palladino outstanding notes and that defendant could not void its contractual obligations on the note by alleging that the letter of Dooley constituted a violation of the statutory limits on its lending authority (N.J.S.A. 17:9A-62A).
*11 Judgment was entered for plaintiff against both defendants for $50,000 and interest and attorney's fees for a total of $65,595.65[1].
Defendant bank appeals from the judgment.
Since the entry of judgment and the filing of appellant's brief on this appeal, defendant bank has been declared insolvent. The Federal Deposit Insurance Corporation succeeded to the entire interest of the bank in this matter and has been granted leave to intervene.
Defendant bank, in its brief, argues that the attempt of Dooley to obligate the bank for $50,000 was illegal and unauthorized, as being in violation of N.J.S.A. 17:9A-60 (6). N.J.S.A. 17:9A-62A provides:
Except as provided in this article, the total liabilities of any person shall not exceed 10% of the aggregate of the unimpaired capital stock and the surplus of the bank.
This argument is based on the contention that the credit extended to the Palladino line exceeded the limitation proscribed by the statutes and hence, the action of Dooley in attempting to guarantee the Palladino loan was ultra vires, illegal and not binding on defendant bank.
The intervenor contends that the letter of guaranty issued by defendant bank is illegal, void and unenforceable as being in direct violation of N.J.S.A. 17:9A-213.1, which provides:
Except as in this act or otherwise by law provided, no bank or savings bank shall have power to guarantee the obligations of others; or to insure or indemnify against the acts, omissions, undertakings, liabilities or losses of others.
*12 Plaintiff, on the other hand, contends that Dooley's letters were actually "letters of credit" and that as such defendant bank was authorized to issue them pursuant to N.J.S.A. 17:9A-25:
In addition to the powers specified in section 24, every bank shall, subject to the provisions of this act, have the following powers, whether or not such powers are specifically set forth in its certificate of incorporation:

* * * * * * * *
(3) to issue letters of credit authorizing holders thereof to draw drafts upon it or upon its correspondents at sight or on time not exceeding one year; to guarantee, for a period not exceeding one year from the date of such guarantee, the payment by its customers of amounts due or to become due upon the purchase by such customers of real or personal property.
We hold that Dooley's letters were not "letters of credit" as that term is used in the Uniform Commercial Code, N.J.S.A. 12A:5-101 et seq., nor as that term is used in N.J.S.A. 17:9A-25(3).
Moreover, assuming arguendo that the letter of October 11, 1972 was a "letter of credit," plaintiff's attempt to impose liability on the defendant bank based on the letter fails, as being beyond the express statutory limitation of one year on such undertakings. The default on the Palladino note occurred February 15, 1974, the date plaintiff first demanded payment, i.e., 16 months after the date of Dooley's letter.
Plaintiff argues that since the note was for six months and dated October 12, 1972, the one-year period mentioned in the statute did not commence to run until April 12, 1973. We disagree. The plain intent and meaning of the statute is to limit the obligation of a bank on "letters of credit" to a one-year period from the issuance of the letter. Cf. National Surety Corp. v. Midland Bank & Trust Co., 408 F. Supp. 684, 687-691 (D.N.J. 1976).
We turn to a consideration of N.J.S.A. 17:9A-213.1. There is a strong public policy in maintaining the stability of banks. National Surety Corp. v. Midland Bank & Trust *13 Co., supra at 690. This statute was passed to advance that policy, as is indicated by N.J.S.A. 17:9A-214, which provides that violations of N.J.S.A. 17:9A-213.1, among others, are punishable as misdemeanors and may be enjoined.
A violation of this statute by one bank issuing a guaranty to another bank is not simply an ultra vires act. It is an illegal act and void. Any purported guaranty given by one bank to another in violation of N.J.S.A. 17:9A-213.1 is unenforceable by the bank receiving it. Cf. Strickland v. Nat'l Salt Co., 79 N.J. Eq. 182, 192 (E. & A. 1911)[2].
Nor can a bank be estopped from asserting the defense of illegality based on a violation of N.J.S.A. 17:9A-213.1 under the circumstances here present. Estoppel is only appropriate where one having a right to do so justifiably relies on another's conduct to his detriment. Brower v. Glen Wild Lake Co., 86 N.J. Super. 341 (App. Div.), certif. den. 44 N.J. 399 (1965); First Nat'l State Bank v. Carlyle House, Inc., 102 N.J. Super. 300, 310 (Ch. Div. 1968), aff'd o.b. 107 N.J. Super. 389 (App. Div. 1969). See also, Summer Cottagers' Ass'n of Cape May v. City of Cape May, 19 N.J. 493, 504 (1955). Plaintiff bank had no right to rely upon the conduct of defendant bank in giving a guaranty. Plaintiff knew, or should have known, that the offer of defendant bank to guarantee the Palladino account was illegal and void. Cf. National Surety Corp. v. Midland Bank & Trust Co., supra at 692; 7 Fletcher, Cyclopedia of Corporations (perm. ed. 1964), § 3611 at 753-754; see also, Vogel v. Atlantic Tar & Chem. Wks., 101 N.J.L. 99, 101 (E. & A. 1925); Cassatt v. First Nat'l Bank, 111 N.J.L. 536, 544 (E. & A. 1933).
*14 As a general proposition, courts will not lend their assistance to either party to an illegal transaction which is void as contrary to public policy. Strickland v. Nat'l Salt Co., supra. However, the application of equitable principles may prevent one party to such a transaction from retaining a benefit or unfair advantage over another received as a result thereof. Therefore, if defendant-bank received a benefit from the illegal transaction, it should be required to repay the sums so received. 7 Fletcher, op. cit., § 3627 At 770-771; cf. Eastern Speedways, Inc. v. Hamilton Trust Co., 123 N.J.L. 257 (E. & A. 1939). The burden of proving the nature and extent of such benefit rests upon the plaintiff.
The record discloses that at the time the $125,000 deposit was made Palladino was indebted to defendant bank for $60,000 and, in addition, was liable for an overdraft of $5,790.80. As a result of this $125,000 deposit, $28,000 was paid on account of the Palladino indebtedness and the overdraft was satisfied. Thus, defendant bank benefited from the $125,000 deposit to the extent of $33,780.80. Plaintiff's contention that defendant benefited in other respects is not supported by the record.
The Uniform Commercial Code, Art. 4, (N.J.S.A. 12A:4-101 et seq.) vests broad discretion in a bank to allocate funds received to a customer's account in any order convenient to the bank. N.J.S.A. 12A:4-303. It is reasonable to assume that defendant bank allocated the funds received from Palladino in a manner most beneficial to it. Plaintiff has failed to prove otherwise. On the record before us there is no basis for our concluding that defendant bank obtained any benefit from its own illegal act in excess of $8,790.80. This determination results from the allocation of the $25,000 not traceable to funds received from plaintiff bank to the $33,790.80 benefit received by defendant first, leaving only the remainder, or $8,790.80, to be credited against the $100,000 Palladino received from plaintiff.
*15 The theory on which we have decided this case leads us to conclude that there is no basis for the allowance to plaintiff of either attorneys' fees or interest.
The judgment entered in favor of plaintiff must be modified. Accordingly, the judgment in favor of plaintiff New Jersey Bank against the defendant First State Bank of Hudson County is reduced to the sum of $8,790.80.
NOTES
[1]  Palladino did not answer either the original suit or a crossclaim filed by defendant bank and a default judgment was entered against him on both the complaint and crossclaim. These default judgments are not involved in this appeal.
[2]  N.J.S.A. 14A:3-2, which limits the application of the ultra vires defense, at least as applied to nonbanking corporations, was not intended to affect the defense of illegality as discussed in Strickland, supra. See Commissioners' comment  (1968) to N.J.S.A. 14A:3-2.
