> Also it would make little sense to have a law saying that you can't be a user of illegal drugs at the moment of purchase of a firearm, but you can start using such substances afterwards.
The law in question derives from the federal government's Constitutional authority to regulate interstate and international commerce, which is (I would guess) why the language fixates on that aspect. The federal government doesn't otherwise have the power to infringe on the Second, Fourth, and (possibly) Tenth Amendments - as would likely be necessary to federally require gun owners to submit to random drug tests over something that one's state has made legal.
Meanwhile, my state (last I checked) has laws on the books separately prohibiting intoxication (be it via cannabis, alcohol, or whatever) while in possession of a firearm; to my knowledge, most (all?) states do.