Crypto Zombies Lesson 2, Chapter 3 Msg.sender, Solidity Language

Lesson Summary

In this Crypto Zombie Solidity chapter we begin to look at Msg.sender. In Solidity we have access to specific global variables within all our functions. Msg.sender always represents the address of the smart contract (external caller) who called the function. The msg.sender Solidity concept should be understood to continue advancing in this tutorial but the key concepte is the idea that a smart contract will sit on the blockchain waiting to be called by one of its own functions. So there must always be a msg.sender. In this specific challenge we update our mapping "zombieToOwner" to contain msg.sender under the id. Next we increase ownerZombieCount for that specific msg.sender called. So everytime the createZombie function is run, those 2 updates will happen according to the address(msg.sender) that called the function.

Subscribe To Monthly Newsletter. Chance to Win Monthly Prizes

* indicates required