I am currently learning solidity through CryptoZombies and I came across a point where they say ,"setKittyContractAddress is external", so anyone can call it! That means anyone who called the function could change the address of the CryptoKitties contract, and break our app for all its users.
We do want the ability to update this address in our contract, but we don't want everyone to be able to update it.
To handle cases like this, one common practice that has emerged is to make contracts Ownable — meaning they have an owner (you) who has special privileges. Here is that function:
function setKittyContractAddress(address _address) external {
kittyContract = KittyInterface(_address);
}
Now my question is that can we not just use msg.sender for this purpose.
I don't quite know how to do that though.