CryptoZombies Lesson 1/ Soon to be a TEC lab!

1Hive Discord server invite.

CryptoZombies is still the most functional, self-contained solid Solidity course, for free, on the internet.
I’ve paid for courses that taught me less and did not work as advertised, requiring extra downloads and changes to install software, for example.

Anyway…

Before I go any further, as I’m writing this the back and next buttons at the CryptoZombies site seem to not be working. I’ve been changing pages in the address bar.

Lesson one deals with just one contract, ZombieFactory.
I think inheritance is introduced in Lesson 2.

The lessons are the names of the bigger chunks of course; this one is “Building the zombie factory”.
Each lesson is a group of chapters, which vary in difficulty, which is nice.

Chapter 1 introduces the zombies and shows the math behind the sliders used to select the zombies’ features. I could actually look at that again.

Chapter 2 introduces pragma and basic contract form.
As far as I know pragma is just the magic word we type before we type the version and solidity.
Now I’m going to have to look it up.
I found this very old article, which basically says the same thing, I think?

Chapter 3 is about declaring variables and uint’s.

Chapter 4 is about coding the DNA.
For this we use modulo, designated by %.
Modulo gives the remainder of a division problem, so 9 % 3 = 0 and 12 % 10 = 2.

We can use this to skin extra digits off when we only want a certain number of digits.

n % 10^x gives x digits.
For example, 3421675 % 10^3 = 3421675 %1000 = 675. I don’t know how to explain it better.
My best advice is to try it on numbers until the light goes on.

Chapter 5 creating the zombie struct.
Not gonna lie.
I love structs.

Chapter 6 Arrays. So, I’m very vague on what this means, but I remember it’s important and that it didn’t always happen (I don’t think). Solidity automatically creates a getter function for public arrays.
I haven’t really internalized this syntax, but I’ll add to this bit soon.

Chapter 7 difference storage v memory.
Hopefully I have this straight, that storage is written to the blockchain and therefore costs to interact with, whereas memory is a local value and only lasts as long as the transaction.
Arrays, structs, mappings, and strings need to distinguish which to use.
Function parameter variables should start with an _.

Chapter 8 Pushing structs to the array.
My notes say to be careful and keep track of what’s what.
Each struct is a zombie.
As zombies are created that zombie is pushed to and stored in an array.

Chapter 9 This can’t have been everything.
When making a function private denote with an _ at the beginning of the function name.

Chapter 10 Return declarations, function modifiers.
Intro of pure, which doesn’t read any data outside of function parameters, and view, which is looking at but not modifying data. The compiler should catch errors using these two modifiers.

Chapter 11 Typecasting.
How to simulate generating a random integer using Solidity.

Chapter 12 This one is picky and wants uint randDna = … and not the other way around.

Chapter 13 Events. Events are how a smart contract communicates with the front end that something has happened on the blockchain.
Events are capitalized.

Chapter 14 talks about web3 and JS.

Chapter 15 is congratulations.

As I said, I’ll come back and edit this, do my best to keep it up-to-date as people have questions and issues.

9 Likes

I’m thinking we’ll get through the course on three or four lab sessions then mess with the contracts in Remix and then with Hardhat.
I haven’t tried the zombie contracts on Remix yet.

Ok.
I tried a contract and it’s a mess.
Also, the ownable.sol CryptoZombies uses needs to import something else to use irl, which I discovered whilst trying to upgrade my FatAssPonees.sol this morning.

I can do this more than once a week.
Also, I’ll be going into Remix browser IDE, talking about libraries, etc.
I’ll put up the video messy though it be, probably tonight or tomorrow.

1 Like

How do I begin with crypto zombies…my interest is at large…,

1 Like

It’s all in there… All of the blue words are relevant links.
I’ll be in the cafe on Thursdays, 15:00 UTC, until further notice.
It’s on the 1hive calendar.
Also, you can always ask me for help, especially with the first three lessons.

1 Like

Cool I definitely would be there what tool’s are needed to be present

1 Like

CryptoZombies is browser based and doesn’t require any installation.

1 Like

I’d study about this more. So i can understand it better

1 Like

This is a nicely put together platform.

I had to look at this on my own since I was busy last time you were hosting a lab. This is definitely the most engaging coding course I’ve tried. I actually learn a little using this. I’m moving quite slowly through because of limited time. But I hope to join live next time you host a lab. Thank you meta for introducing this to us, it’s really cool.

@metaverde I have a question and if we used the cryptozombies classes, as learning and at the same time for participating we would give an nft let’s say of collectible study they are just ideas that I can think of for this type of thing!

When I return to Colombia or Spain, I will be more attentive to this because I really like the idea of learning solidity!

2 Likes

I thought I’d answered.
If someone has the time that would be great!

We could plan and somehow attract interested bees, I could create some poap for such events or classes dictated by you with the help of cryptozombies on the Cafe channel! :honeybee: :books:
@metaverde

1 Like

Here’s the invite link to TEC Discord.
Next week we’ll be deploying a token using Remix at 1Hive and working on a Scaffold-Eth challenge at TEC.

1 Like