The code of chivalry (or "heroic code") is based on a number of factors.
A hero must display prowess, seek justice, and be courageous. Beowulf absolutely meets these requirements as he battles the monster Grendel (see lines 744-789).
A hero must not be shy about his prowess and courage either, and Beowulf certainly is not. For example, after defeating the monster Grendel who has terrorized Heorot, he hangs the beast's arm and claw from the rafters of Heorot for all to see: ...Clear proof of this/could be seen in the hand the hero displayed/high up near the roof: the whole of Grendal's/shoulder and arm, his awesome grasp.
Beowulf is also loyal until his bitter end, even though those he has so admirably defended throughout his life desert him (with the exception of Wiglaf). Wiglaf interprets the code by recalling Beowulf's heroism. He rightly points out that "(i)n days gong by/when our warriors fell and we were undefended/he kept our coffers and our kingdom safe./He worked for the people, but as well as that/he behaved like a hero."
Others prove to the audience that not all men can meet the tough standards. A tale told by Unferth tells the tale. Though Breca is strong and brave, he does not measure up to Beowulf and thus falls short of the idealization of the code. (See lines 499-558).