The Smarty Pants Stone is a yellow-colored gem used as a necklace with the ability to make the user highly intelligent. In "Grim the Genius", Grim wants to win back Hildy by using this stone after causing her many failures.
In the show
Grim knows Doc is the smartest person in Jollywood, so he went to the cottage disguised as a baker named Toasty -- complete with an giant, edible piece of toast around his head -- and asks Doc for something that will make him smart. Doc gives him the Smarty Pants Stone, and from the moment he puts it around Grim, he becomes intelligent. Hildy is impressed with Grim making things right by organizing their potion ingredients and showing off complex math problems, even surprising her with a great dinner of beef wellington. Finally, they successfully drove Queen Delightful, Lord Starchbottom, and Sir Yipsalot out of the castle, and Hildy crowns herself queen.
However, the effects of the Smarty Pants Stone made Grim rejecting Hildy's romantic affections towards him, eventually leading her to heartbreak. To make things worse, Grim then crowns himself king, believing that he'll be a better monarch than Hildy. After many attempts, the 7D outsmarted Grim by entering the castle through a series of alternate underground tubes. The stone is then snatched away from him, and Hildy is happy to see the old Grim again, saying that he doesn't need the stone. They finally show their love for each other -- while being sent to the moon by Grumpy.