The Magic Contract is a document that allows Shiroe to create magical spells that did not previously exist in Elder Tale. The materials used to create the contract depends on their quality and the type of magical effect. In the case of Rundelhous Code, Shiroe used Phantasmal-level items such as paper from the Fairy King and ink from the Time Dragon's Eye. Due to his level 90 skills as a Scribe, he was able to re-write a fundamental law of Elder Tale, thereby creating a form of Global-Scale Magic. As a result, he keeps this ability a complete secret due to the chaos it would cause among the People of the Land, should it be known that he could transform anyone into an Adventurer.
Return of the Goblin King arc
Rundelhous Code was mortally wounded during the defense of Choushi Town. Though his body was saved by the healers of his party, his spirit had already left. To save him, Shiroe used Revival Incense to temporarily force his spirit back into his body, then have him sign a Magic Contract that Shiroe had created, using the top-quality materials he had gathered previously when Elder Tale was a game. As a result, Rundelhous was given the subclass of Adventurer and was revived at the Cathedral.
Gold of the Kunie arc
After failing to negotiate with Kinjo the first time, Shiroe writes up another magical contract for when he reached Kinjo at the end of the Abyssal Shaft raid. This contract allowed him to use the Kunie's infinite pool of gold to buy up all the unowned zones in Yamato, and then return both that land plus Akiba's important structures to the Kunie clan, rendering them unpurchaseable by any of the Round Table's enemies and releasing them from the duty of maintaining those structures.