Section 123. Any company accepting said sections shall be bound thereby to sell its entire property and franchises as a going concern to the commonwealth or to any city or town at any time for an amount in cash equal to the stock investment, and the amount of cash paid in for preferred stock, and the purchaser shall in addition assume all outstanding bonds, contracts, leases and other liabilities of the company. Said sections shall not affect the right of the commonwealth or of any city or town to acquire at any time, by eminent domain under chapter seventy-nine, the property and franchises of any company accepting said sections.