Smart contract applet architecture

zombie factory.

The new zombie event requires three parameters.
gene
gene
zombie structure, the structure has 2 variables, one is the name, the other is dna.
zombie structure, string name, uint dna.
array: zombie structure array zombie;
mapping : Zombie corresponds to owner: integer corresponds to address.
Number of mapped zombies: address corresponds to integer
Function: create zombie (string name, unsigned integer) private { set a variable as id, assign id to send this event. } function : _generateRandomDna passes in a string variable, encrypts the variable with keccak256(), and converts the type to an unsigned integer. Then create a variable and assign the encrypted value of the string to the variable. Then the function returns.







Guess you like

Origin blog.csdn.net/SDSsdsSDsSSSDDDS/article/details/128519688