Deuteronomy 31:24

And it came to pass, when Moses had made an end of writing the words of this law in a book, until they were finished,

At his last opportunity to address Israel, shortly before he died in Moab, Moses himself at God's command finished writing the words of the law in a book until they were finished. The book contained all the laws, judgments, and statutes God had given him, including the regulations respecting sacrificial offerings and the ceremonial laws. He also faithfully recorded in it all the instructions given to Israel along the way, all the miracles performed for them, all the murmurings of the children of Israel, and even how he himself was overcome in consequence of their murmurings. These book laws are distinct from the giving of the law on Mount Sinai and from the Ten Commandments; they were not a new revelation but a repetition, given in Moab before his death, of the ceremonial laws given at Sinai, which Israel was directed to preserve carefully.

In repeating and enlarging on them he added some methods for enforcing them, explained some precepts, and made clear the reasons for the laws, and he repeated commands that transgressors had broken and for which God's judgments had fallen, so the people would know that disobedience brings God's punishment. The finished book was entrusted to men in sacred office, the appointed officers, to be kept in the side of the ark, where God's care continually rested upon that sacred chest, so that it would be preserved in a most sacred place for safekeeping. It was preserved there to remain available for future reference, for Israel's judges to consult when any case arose, because an erring people twist God's requirements to suit their own case and desires.