In Camp Green Lake, the juveniles are required to dig holes five feet deep and five feet wide to "build character." After Stanley runs away from Camp Green Lake to save Zero, the two boys end up surviving on God's Thumb, where they eat Sam's magical healing onions.
After their brief respite, Stanley learns that Zero was the person who stole Clyde Livingston's shoes and that they were required to dig holes in order to find Kissin' Kate Barlow's buried treasure. The boys decide to travel back to the camp to dig up the treasure without the Warden or any of the counselors spotting them.
When they return to the camp at night, they dig up a suitcase, which surprisingly has Stanley Yelnats's name written on the side. Although the Warden catches them, the Attorney General arrives along with Stanley's attorney and both boys get to leave Camp Green Lake with the suitcase. When Stanley finally opens the suitcase, he is surprised to find stock certificates, deeds of trust, and promissory notes which make him and Zero rich.