Mass. Gen. Laws ch. 143, § 94
The board shall have the following powers and duties:
(iv) the establishment of reasonable fees for inspections, which fees shall be collected and retained by the city or town conducting such inspections.
Such rules and regulations, together with any penalties for the violation thereof, as hereinafter provided, shall comprise and be collectively known as the state building code.
Whoever violates any provision of the state building code, except any specialized code as described in section ninety-six, shall be punished by a fine of not more than one thousand dollars or by imprisonment for not more than one year, or both, for each such violation. Each day during which a violation exists shall constitute a separate offense.