Section 5. (a) A former state employee who knowingly acts as agent or attorney for, or receives compensation directly or indirectly from anyone other than the commonwealth or a state agency, in connection with any particular matter in which the commonwealth or a state agency is a party or has a direct and substantial interest and in which he participated as a state employee while so employed, or
(b) a former state employee who, within one year after his last employment has ceased, appears personally before any court or agency of the commonwealth as agent or attorney for anyone other than the commonwealth in connection with any particular matter in which the commonwealth or a state agency is a party or has a direct and substantial interest and which was under his official responsibility as a state employee at any time within a period of two years prior to the termination of his employment, or
(b1/2) A former state, county or municipal employee who participated as such in general legislation on expanded gaming in the commonwealth or in the implementation, administration or enforcement of chapter 23K, and who becomes an officer or employee of, or who acquires a financial interest in, an applicant for a gaming license or a gaming licensee under said chapter 23K within one year after his last state, county or municipal employment has ceased, or
(c) a partner of a former state employee who knowingly engages, during a period of one year following the termination of the latter's employment by the commonwealth, in any activity in which the former state employee is himself prohibited from engaging in by clause (a), or
(d) a partner of a state employee who knowingly acts as agent or attorney for anyone other than the commonwealth in connection with any particular matter in which the commonwealth or a state agency is a party or has a direct and substantial interest and in which the state employee participates or has participated as a state employee or which is the subject of his official responsibility, or
(e) a former state employee or elected official, including a former member of the general court, who acts as legislative or executive agent, as defined in section thirty-nine of chapter three, for anyone other than the commonwealth or a state agency before the governmental body, as determined by the state ethics commission with which he has been associated, within one year after he leaves that body or
(f) a former state employee whose salary was not less than that in step one of job group M–VII in the management salary schedule in section forty-six C of chapter thirty, and who becomes an officer or employee of a business organization which is or was a party to any privatization contract as defined in section fifty-three of chapter seven in which contract he participated as such state employee, if he becomes such officer or employee while the business organization is such a party or within one year after he terminates his state employment, unless before the termination of his state employment the governor determines, in a writing filed with the state ethics commission, that such participation did not significantly affect the terms or implementation of such contract, shall be punished by a fine of not more than $10,000, or by imprisonment in the state prison for not more than 5 years, or in a jail or house of correction for not more than 2 1/2 years, or both.
If a partner of a member of the general court or of a special state employee or of a former state employee is also a member of another partnership in which the member of the general court or special or former employee has no interest, the activities of the latter partnership in which the member of the general court or special or former employee takes no part shall not thereby be subject to clause (c) or (d).
This section shall not prevent a present or former special state employee from aiding or assisting another person for compensation in the performance of work under a contract with or for the benefit of the commonwealth; provided, that the head of the special state employee's department or agency has certified in writing that the interest of the commonwealth requires such aid or assistance and the certification has been filed with the state ethics commission.