Any laborer employed by a contractor for the construction of any part of a railroad may give notice to the company of any indebtedness due him by the contractor by written notice served on an engineer, agent or superintendent of the company having charge of the section of the road on which the labor was performed, personally or by leaving it at his office or usual place of business with a suitable person.
This notice shall be served within twenty days after the last day of the performance of the labor for which claim is made and shall state the number of days' labor, the time when performed, the amount due and the name of the contractor, and shall be signed by the laborer or his attorney.
The company shall be liable to pay the laborer the amount so due him not exceeding wages for thirty days and an action may be maintained therefor if brought within thirty days after service of its notice. The liability of the company shall not exceed its liability to the contractor and any payment lawfully made to the laborer shall be a discharge to the company from the contractor for the amount so paid.
N.J.S. § 48:12-153