I believe that this law is in direct violation of the commerce clause[1]. The commerce clause was designed to prevent tarrifs from being placed on products from one state being sold in another state. They wanted to prevent inter-state trade wars. Being forced to go thru a dealer network that (theoretically) adds no value while extracting a cut of sales is a form of a tarrif (or at least, I think it is arguably one).…
This wouldn't be a violation of the commerce clause per se. The commerce clause just says that the federal government has the authority to regulate interstate commerce. In other words, the US legislature could pass a law prohibiting these restrictions on Tesla sales, and that law would be constitutional.
This is not completely correct. Let me expand a little bit even though it is not applicable here. There is something called the "dormant" commerce clause (also referred to as the "negative" commerce clause) doctrine. This doctrine basically prohibits states from favoring in state commercial actors at the expense of out of state actors. Think protectionist legislation. Therefore, there is a lot more to the commerce clause than simply allowing the federal government to regulate interstate commerce.