EXHIBIT 2

                    AMENDMENT TO SHAREHOLDER RIGHTS AGREEMENT

1.    General Background. In accordance with Section 27 of the Shareholder
      Rights Agreement between State Street Bank and Trust Company (the "Rights
      Agent") and Medford Bancorp dated September 22, 1993 (the "Agreement"),
      the Rights Agent and Medford Bancorp desire to amend the Agreement to
      appoint EquiServe Trust Company, N.A.

2.    Effectiveness. This Amendment shall be effective as of November 6, 2001
      (the "Amendment") and all defined terms and definitions in the Agreement
      shall be the same in the Amendment except as specifically revised by the
      Amendment.

3.    Revision. The section in the Agreement entitled "Change of Rights Agent"
      is hereby deleted in its entirety and replaced with the following:

      Change of Rights Agent. The Rights Agent or any successor Rights Agent may
      resign and be discharged from its duties under this Agreement upon 30
      days' notice in writing mailed to the Company and to each transfer agent
      of the Common Shares or Preferred Shares by registered or certified mail
      and to the holders of the Right Certificates by first-class mail. The
      Company may remove the Rights Agent or any successor Rights Agent, with or
      without cause, effective immediately or on a specified date by written
      notice given to the Rights Agent or successor Rights Agent, as the case
      may be, and to each transfer agent of the Common Shares or Preferred
      Shares by registered or certified mail, and to the holders of the Right
      Certificates by any means reasonably determined by the Company to inform
      such holder of such removal (including without limitation, by including
      such information in one or more of the Company's reports to shareholders
      or reports or filings with the Securities and Exchange Commission). If the
      Rights Agent shall resign or be removed or shall otherwise become
      incapable of acting, the Company shall appoint a successor to the Rights
      Agent. If the Company shall fail to make such appointment within a period
      of 30 days after giving notice of such removal or after it has been
      notified in writing of such resignation or incapacity by the resigning or
      incapacitated rights Agent or by the holder of a Right Certificate (who
      shall, with such notice, submit such holder's Right Certificate for
      inspection by the company), then the registered holder of any Right
      Certificate may apply to any court of competent jurisdiction for the
      appointment of a new Rights Agent. Any successor Rights Agent, whether
      appointed by the Company or by such a court, shall be a corporation or
      trust company organized and doing business under the laws of the United
      States, or any state of the United States, in good standing, which is
      authorized under such laws to exercise corporate trust or stock


      transfer powers and is subject to supervision or examination by federal or
      state authority and which has individually or combined with an affiliate
      at the time of its appointment as Rights Agent a combined capital and
      surplus of at least $50 million dollars. After appointment, the successor
      Rights Agent shall be vested with the same powers, rights, duties and
      responsibilities as if it had been originally named as Rights Agent
      without further act or deed; but the predecessor Rights Agent shall
      deliver and transfer to the successor Rights Agent any property at the
      time held by it hereunder, and execute and deliver any further assurance,
      conveyance, act or deed necessary for the purpose. Not later than the
      effective date of any such appointment the Company shall file notice
      thereof in writing with the predecessor Rights Agent and each transfer
      agent of the Common Shares or Preferred Shares, and give notice to the
      registered holders of the Right Certificates by any means reasonably
      determined by the Company to inform such holder of such removal (including
      without limitation, by including such information in one or more of the
      Company's reports to shareholders or reports or filings with the
      Securities and Exchange Commission). Failure to give any notice provided
      for in this Section 21, however, or any defect therein, shall not affect
      the legality or validity of the resignation or removal of the Rights Agent
      or the appointment of the successor Rights Agent, as the case may be.

4.    Except as amended hereby, the Agreement and all schedules or exhibits
      thereto shall remain in full force and effect.

IN WITNESS WHEREOF, the parties hereto have caused this Amendment to be executed
in their names and on their behalf by and through their duly authorized
officers, as of this 6th day of November, 2001.

Medford Bancorp                     State Street Bank and Trust Co.


/s/ Philip W. Wong                  /s/ Carol Mulvey-Eori
- --------------------------          ----------------------
By: Philip W. Wong                  By: Carol Mulvey-Eori
Title: E.V.P. and C.F.O.            Title: Managing Director, Client
                                           Administraton


                                    EquiServe Trust Company, N.A.


                                    /s/ Carol Mulvey-Eori
                                    ----------------------
                                    By: Carol Mulvey-Eori
                                    Title: Managing Director, Client
                                           Administraton