It’s just a point that needs more refining. I tend away from a contract because contract separates the the parties and actually creates a Federation on superior footing to the States.
As a treaty, the states and the federal government are inextricable, and the Senate was the tie point.
Either way, whether treaty or contract is not dispositive to the invalidity of unconstitutional federal law. The clincher is the fact the Constitution was ratified by the states making it, according to the Supremacy Clause, the law of the land.
Having said that, it is an interesting concept. I have thought “treaty” makes more sense in that there is an agreement that, if the feds break the agreement, the states may do likewise. Sort of like a contract in that sense though I guess.