Section 185. The state treasurer in his official capacity shall take and hold in trust deposits made by any domestic company for the purpose of complying with the laws of this commonwealth or of any other state or country to enable such company to do business in such state or country, and also in like manner take and hold any deposit made by a foreign company or foreign fraternal benefit society under any law of this commonwealth; provided, that bonds need not be accepted by the treasurer unless in registered form and of denominations satisfactory to him. The company or society making such deposit shall be entitled to the income thereof, and may from time to time, with the consent of the treasurer, when not forbidden by the law under which the deposit is made, change in whole or in part the securities composing the deposit for other approved securities of equal par value.
The state treasurer may, upon written request of any domestic company, return to it the whole or any portion of any deposit held by him on behalf of such company, if he is satisfied that the deposit or the portion thereof requested to be returned is subject to no liability and is no longer required to be held by any provision of law of this commonwealth or of any such other state or country or for the purpose of the original deposit. He shall return to any foreign company or foreign fraternal benefit society the whole or any portion of any deposit held by him on behalf of such company or such society, upon the written order of the commissioner.
A company or society which has made such deposit, or its trustees or resident manager in the United States, or the commissioner, or any creditor of such company or society may at any time bring, in the supreme judicial court for the county of Suffolk, a suit in equity against the commonwealth and other parties properly joined therein to enforce, administer or terminate the trust created by such deposit. The process in such suit shall be served on the state treasurer, who shall appear and answer on behalf of the commonwealth and perform such orders and decrees as the court may make thereon.