If this the law being passed that is a pact between different states, then it isn’t unconstitutional. If it is just a law stating that Massachusetts’ electors will be selected based on the winner of the national popular vote, then it is constiutional. Pretty strange they would want their electors to possibly vote against the wishes of their own citizens, though.
That's the position of the proponents. How does an explicit and exclusive right of the states violate Congressional supremacy concerns? However, they will seek Congressional approval anyway to avoid potential litigation.