It was normal practice at the conclusion of a secular treaty for the suzerain to hand a copy of the treaty to the vassal to be lodged in the sanctuary of the vassal under the care of the priests and under the eye of the gods. Again, on the death of the vassal, his successor was approved by the suzerain but was required to ratify the treaty himself. There need be no problem in the statement that Moses handed over a document of some kind to Joshua, even if this was not Deuteronomy as we now have it