I thinking about this owner modifier. The constructor is saving the address of the owner which is taken from the wallet (we can use our own or customer/employer), and then after deploy nobody will be able to change the value of the owner variable in the constructor, won’t they? That would mean if I as a owner will lose the account with the ownership address or I would die, without leaving my keys somewhere, nobody will be able to do modify the contract?
Yes, correct. The owner won’t be able to be changed. You could configure the contract to have multiple owners if you want that.
And just to confirm, code below means: // ownerToAnimals[msg.sender] is pointing which array of animals to use what is defined by msg.sender, then which animal to return by id, and the last returning string which the name of the animal; is my reasoning right?
Yes, that’s correct.
I have tried to return whole array, but it doesn’t work, it seems that I need to use some expansions to run it
Yeah, solidity doesn’t support returning entire arrays as of now. I haven’t played around with the experimental version of the encoder. But it looks like you got all the data from the array. But the AnimalType has been cast to an integer, since solidity doesn’t know how to return our ENUM. 0 means the first option in our enum and 1 the second, and so on.