The myth is told chiefly in Fargard 2 of the Vendidad, the legal and mythological portion of the Avesta. Ahura Mazda first offers Yima the task of bearing and carrying forward his religion; Yima declines that specific charge, and is offered instead the rule of a golden age, under which he makes the earth grow wider three times over as its population increases beyond what it could otherwise hold, herds and people alike free from death, old age, sickness and excess or want. It is a reign remembered in later Zoroastrian and Persian tradition, under Yima's later name Jamshid, as an age of order so complete it became the byword for lost prosperity.
Ahura Mazda then warns Yima of catastrophic winters to come, a scale of cosmic destruction that will kill livestock and cover the world in snow. He instructs Yima to build a vara, a large enclosed shelter, laid out on a square plan with gates and internal divisions, and to bring into it a breeding pair or seed stock of every kind of animal, plant and fire, along with a select population of people, sealing it until the danger has passed. The Bundahishn, a later Zoroastrian cosmological text compiled from Avestan material, elaborates the vara's construction and its role sustaining life through to the world's eventual renewal.