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

Channel:
Subscribers:
8,020
Published on ● Video Link: https://www.youtube.com/watch?v=CM4FK1ZEDP4



Duration: 4:59
977 views
20


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.







Tags:
solidity programming
crypto zombies tutorial
mappings and addresses
solidity contract
msg.sender