The Basis for Fulfillment of the Noahide Code
Rambam explains in Laws of Kings (8:11): “The Holy One, blessed be He, commanded the Seven Noahide Commandments in the Torah, and informed Moses our teacher that Noah’s descendants had been previously commanded to fulfill them.” This means that even though Noah’s descendants were previously commanded to fulfill them – and this Divine command was not nullified in legal terms, and Gentiles are still obligated by the power of the original commands – nevertheless, there were more details added by G-d through Moses at the giving of the Torah at Mount Sinai.
Clearly, the Noahide Commandments were commanded to Moses, because even though they were commanded previously to Adam and Noah, they were never written down as Torah before Mount Sinai. Their recording in the Written Torah was through Moses, and their explanations and details as transmitted in the Oral Torah were given to Moses, as will be explained. According to his above-cited ruling, Rambam explains that:
(a) the descendants of Noah are obligated to observe their Seven Commandments because these were commanded to them by G-d through Moses, and
(b) when the Torah was given by G-d through Moses, there was a spiritual dimension that He added for the Gentiles as well as for the Jews. The explanation of this spiritual dimension of the Noahide Code, which was added by G-d through Moses at Mount Sinai, is given by Rambam in Laws of the Foundations of the Torah, ch. 8.
Rambam explains that we do not believe in Moses our teacher as a prophet because of the miracles he performed, since a prediction and a sign could be accomplished through sorcery, and thus it could be doubted. Rather, we believe in Moses and G-d’s true Torah of Moses – against which there will never be a real challenge – based on the true testimony of what the eyes of the entire Israelite nation saw and their ears heard at G-d’s giving of the Ten Commandments at Mount Sinai.
By Rabbi Moshe Weiner, in "The Divine Code," Author's Introduction.