Mishneh Torah — Transmission of the Oral Law מסירת תורה שבעל פה, Chapter 2
The full Hebrew text of Mishneh Torah, Transmission of the Oral Law, Chapter 2, with English translation by Maimonides (Rambam).
כָּל הַתּוֹרָה – כְּתָבָהּ מֹשֶׁה רַבֵּנוּ קֹדֶם שֶׁיָּמוּת, בִּכְתָב יָדוֹ. וְנָתַן סֵפֶר לְכָל שֵׁבֶט וְשֵׁבֶט; וְסֵפֶר אֶחָד – נְתָנָהוּ בָּאָרוֹן לְעֵד, שֶׁנֶּאֱמָר "לָקֹחַ, אֵת סֵפֶר הַתּוֹרָה הַזֶּה, וְשַׂמְתֶּם אֹתוֹ, מִצַּד אֲרוֹן בְּרִית־ה' אֱלֹהֵיכֶם; וְהָיָה־שָׁם בְּךָ, לְעֵד" (דברים לא, כו).
Moses, our teacher, personally transcribed the entire Torah before he died. He gave a Torah scroll to each tribe and placed another scroll in the ark as a testimonial, as [Deuteronomy 31:26] states: "Take this Torah scroll and place it [beside the ark…] and it will be there as a testimonial."