Magic Lamp

The Magic Lamp is an object that appears in Sonic and the Secret Rings. It is an oil lamp from the world of the Arabian Nights that was used to imprison Erazor Djinn in ancient times until he had granted the wishes of a thousand people as punishment for his evil. It can also be used to force Erazor Djinn to grant three wishes to the person who wields it.

History
Long before the events of Sonic and the Secret Rings, the Magic Lamp was used to seal Erazor Djinn inside of it when the genie was punished for his misdeeds. As a part of his punishment, Erazor was bound to remain trapped within the Magic Lamp until he had granted three wishes to each of a thousand people.

After Erazor had served his sentence and escape from his Magic Lamp, he was ready to continue his evil ways, though he was still bound to grant the wishes of those who possessed the Magic Lamp. Under unknown circumstances, the Magic Lamp was later crushed into a twisted orb and came into the possession of Shahra.

After Sonic the Hedgehog was brought into the world of the Arabian Nights to stop Erazor by Shahra, and found the Blue World Ring, Shahra gave the crushed Magic Lamp to Sonic. Despite Sonic having no idea what it was, Shahra only told him that it would be their last resort of stopping Erazor and that she was unable to use it herself.

During the final confrontation with Erazor, Shahra was killed when Erazor tried to sacrifice Sonic as part of a ritual for control over the World Rings. As Shahra died in Sonic's arms and Sonic wished to Shahra that she would "go back to the way she was", the Magic Lamp was restored to its original form. Later, after being defeated by Darkspine Sonic as Alf Layla wa-Layla, Erazor boasted to Sonic of being immortal and unstoppable, but Sonic responded in kind by pulling out the Magic Lamp.

Understanding the meaning behind it, Sonic told Erazor that since he possessed his Magic Lamp, Erazor was supposed to grant him three wishes, but the genie refused. In response to Erazor's refusal, Sonic used the Magic Lamp's power of Erazor to make him grant his three wishes: bringing Shahra back to life, restoring the world of the Arabian Nights and its storybook back to normal, and that Erazor would remain trapped within the Magic Lamp until the end of time. For each wish stated, Sonic shot Erazor with a magical fireball from the Magic Lamp that forced Erazor to fulfill Sonic's wish. After granting Sonic's final wish, Erazor was then sucked into the Magic Lamp, sealing him within it once more.

After trapping Erazor within it, Sonic took the Magic Lamp to the Evil Foundry where he threw it into the lava pools within the complex, either destroying it or making sure no one would ever find it again.