You are on page 1of 1

making the zombie factory

Blockchain: Smart Contracts


Laboratory Assignment 1
by Rémy Siminel

In this introductory tutorial on the Solidity programming language


and its application to smart contracts, I learned how to make a contract
that creates instances of a structure I defined and keeps track of them in
Solidity’s version pragma. To do so, I learned how to create private and
public functions, events, structures and - of course - contracts. I used
typecasting, function modifiers and hash functions.

I am accustomed to languages where the data type of a variable deter-


mines whether it is passed to a function by value or by reference: lists
are by reference, integers are by value, and so on. I therefore found
the idea of being able to chose whether to pass a given variable by
value or by reference very useful although doing so by putting the word
“memory” in between the type and it’s name was quite confusing to me.
Personally, I understand “uint memory dna” as “an integer stored in
memory named dna”.

This was the first time I was formally introduced to starting names
of local variables or private functions with an underscore. It is a very
useful convention despite taking longer to type.

This was also my first time working with hash functions and I must
say, I find them super cool in so many ways. Seeing that zombie change
appearance as I changed the input text really made my day. I’ve tried to
do some research into how they work but so far the sources I find either
oversimplify so much that they carry no useful information or are too
complex for me to understand.
With my (albeit limited) research into hash functions, I have a new
appreciation for the inclusion of the time at which a block was mined
in it’s contents. This, I realise is useful to prevent blocks from being
duplicated in the blockchain. Neat.

You might also like