Crypto Zombies Lesson 2, Chapter 4, Require, Solidity Require Statements

Lesson Summary

In this Chapter of Crypto Zombies we look at the require statement in Solidity. Solidity require statements allow us to run a function if a condition is true. If the condition is false it will stop execution of the function and throw and error. In this specific Solidity challenge we are asked to place a requirei statement in the beginning of our createRandomZombie function. Our statement should check to make sure the current address which called ownerZombieCount, hasn't created any zombies yet. If it is there first zombie then it will allow them since they don't have any(0) yet.

Subscribe To Monthly Newsletter. Chance to Win Monthly Prizes

* indicates required