Shemot / Exodus 24:7 · Pshat
וַיִּקַּח סֵפֶר הַבְּרִית וַיִּקְרָא בְּאָזְנֵי הָעָם וַיֹּאמְרוּ כֹּל אֲשֶׁר־דִּבֶּר יְהוָה נַעֲשֶׂה וְנִשְׁמָע׃
And he took the book of the covenant and read it in the hearing of the people, and they said: "All that the Eternal has spoken we will do and we will hear."
Pshat פְּשָׁט
The book of the covenant
At Mount Sinai Moshe (Moses) reads a book to the people, and the people answer with the famous words: "we will do and we will hear". What was in this book, and what does such an answer mean?
Sforno: Moshe read "the book of the covenant" aloud to the people, so that they would know what they were taking upon themselves and the covenant would not be made by deception. "We will do and we will hear": we will do, so as to obey Him, like servants who serve not for a reward. Rashbam: "we will do" what was already said, and "we will hear" what He commands later.
How Sforno and Rashbam explain it
Sforno The book of the covenant
The book in which Moshe wrote the words of the Eternal and the laws on which the covenant would be made, as it says above: "And Moshe wrote" (Shemot / Exodus 24:4).
Sforno And read it in the hearing of the people
So that they would know what they were taking upon themselves, and not be deceived.
Sforno We will do and we will hear
We will do, so as to obey His voice, like servants who serve their master not for a reward, as it says: "doing His word, to obey the voice of His word" (Tehillim / Psalms 103:20).
Rashbam We will do and we will hear
We will do what He has spoken, and we will hear what He commands us from now on, and we will keep it.
Takeaway
The book of the covenant is what Moshe wrote down the day before (Shemot / Exodus 24:4). What exactly was in it, the commentators dispute.
A covenant (בְּרִית) was made with an offering and blood: half the blood Moshe dashed on the altar, half on the people (Shemot / Exodus 24:6–8).
"We will hear" (וְנִשְׁמָע) in Hebrew means both "we will understand" and "we will obey". Sforno reads "we will obey", Rashbam "we will hear new commandments".