Every laborer, mechanic, ranchman, farmer, merchant, or other person performing any work or labor or furnishing any material, ranch or farm products, provisions, goods, or supplies to any contractor or subcontractor, in the construction of any railroad, or any part thereof, used by such contractor or subcontractor in carrying on said work of construction whose demand for work, labor, material, ranch or farm products, provisions, goods, or supplies so furnished has not been paid, may deliver to the company owning such railroad or to its agent, a verified account of the amount and value of the work, and labor so performed or the material, ranch or farm products, provisions, goods or supplies so furnished, and thereupon such company, or its agent, shall retain out of the subsequent payments to the contractor or contractors the amount of such unpaid account for the benefit of the person to whom the same is due.
W.S. 37-9-602