Crypto Zombies Lesson 2, Chapter 5, Inheritance, Solidity Walkthrough

Lesson Summary

In this Chapter of Crypto Zombies we look at inheritance in Solidity. Solidity allows us to inherit from other contracts. Why would this be helpful you ask? Well, sometimes it is better to split our code logic into more organizable chuncks. Solidity inheritance makes this possible. You can think about this like an animal contract and a dog contract. We can make a contract for animals that has basic stuff like an animal can have 4 legs and 2 eyes. We can then create a dog contract which inherits from animal and will have 4 legs and 2 eyes but can also have its own dog like stuff within the dog contract while having access to the animal contract at the same time. In this specific challenge we are asked to create a ZombieFeeding contract which inherits from the ZombieFactory contract.

Subscribe To Monthly Newsletter. Chance to Win Monthly Prizes

* indicates required