Cairo Programming Language II
The picture loads from YouTube. The player loads only when you press Play. Turn on captions in the player if you need them.
An instructor continues a Cairo class by explaining macros, then runs a timed exercise where students work through compile challenges on types, functions, loops, enums and options. Afterward the instructor builds an ERC-20 token contract with an interface, storage, constructor, transfer and approval, and assigns mint, burn and events as homework.
Not by We Them Media Channel: Web3Bridge. Published Friday 24 May 2024.
Titles are the owner’s. It plays from their channel.
Watch it on YouTube (opens in a new tab)
Transcript
This transcript may contain errors. This video belongs to Web3Bridge. Letters mark each change of speaker.
These are the speakers’ own words. We have not checked their claims.
0:00 A: So that's the simple meaning of macro, and there are different ways in which macros are used in either Rust or Cairo. So when you see the println that has the exclamation, whenever you see any piece of code that, you know, that is followed by the exclamation, so it's called a macro. So you have that as- that's the macro. There's another macro when you all those derive. So before the beginning of, let's say, a structure or a function or a module, so you can have an hash into the bracket of, then you have the name of that particular macro in it also. So you can have a derived macro that has copy, and you can derive a macro. So examples of other macros, you have the copy copy, drop, all those ones, they're like standard macro that they can simply look through the structure and they are going to generate those copy code for it. So the thing is, the way it works is that normally when you have a structure, there are some things that you need to like add, there are some traits that you need to add to it. So you know, we have the copy traits, the drop traits, and the likes. So there are some that when they follow a particular pattern, those traits, they can be inferred, so, or they can be derived. Thank you. So in that case, that's where we make- that's where we say- that's where we make use of that derive macro. So when you make use of the derive macro, then you can do that. Then there are some also, there are some macros that StarkNet also provided for us like that the Cairo has also provided for us. Examples of those are where you have the generate traits macro, you have the, you know, the storage, the events and the likes also, all those macros too. So what they do is-
2:10 B: Can you share your screen? I see you're talking, but I can't see your screen. I don't know if you're sharing.
2:17 A: Okay, I've not started sharing my screen.
2:19 B: I feel like I need to have a visual view of what you're trying to say.
2:24 A: Okay, so someone asked a question actually, so I'm trying to, I'm trying to answer that. So let me just do this. Okay, let me come to macros here. This is macro. Yeah, we've not got here, huh? Have we got here? No, we haven't got here yet. So what happened is that those macros, uh, before at compilation time, those codes, they are going to be written out. It's just like They are like shortcuts. So those codes, they are going to be generated out before the program is actually like compiled. So that's how you should look at those macros. So these are examples of macros. So you have the selector, print, println, array, panic, format, WriteLine. So all these ones are types of- they are types of macro. So in the last class I said that- okay, does any other person have a question?
3:45 B: I think there's a question, so we can just go ahead.
4:10 A: All right, so, okay, so, um, 2 things actually. Number one is, I mean, how many people here is aware of the StackBlitz app challenge? So you go to stackblitz.app. So how many people here is aware of this? If you have solved that, let me- I want to end the show of hands. How many people? 1, 2, 3. All right, so we are good. Okay, we have- ah, that's nice. So, um, I want to do something. So Now, I want to do something. So I want you to, in the next some minutes, you are going to start the app. I want to see how much of it that you'll be able to- how much of the questions you are going to be able to solve in the next 15 minutes. So this is it. So, and when you- you're just going to send the screenshot of that to- do you guys have- do you guys have a group?
5:55 B: Not really.
6:03 A: There's no group. So you're going to send the the screenshots to- let me look at- sorry, I'm going to provide you the email now.
6:21 B: Or you can just create a group for this.
6:42 A: Okay, so you are going to send it to that email. So if you look at this now, you have the intro. So what you want to do is very simple. Well, you just have to like compile it. So this one now, there is nothing you are doing. just compile and you move to the next one. So this one, it won't compile. Why? So because the reason is simply because there is nothing here. So for it to compile, you just need a main function. So with this, you can compile it, then you move to the next one like that. So want to see the number that you'll be able to compile in the next 15 minutes. And so the thing is, you should start- I'm going- it's going to run between 5:15 till 5:30. It's going to run between 5:15 till 5:30. So please, if you have solved it before, for this one you have to start again. For this one, you have to start again. If you haven't solved it before, it's- So we just want to see the number of questions that you'll be able to solve within that 15 minutes. Is there anyone that doesn't have clarity about, uh, what I've just said?
8:09 B: Hello, sir. Yes.
8:17 A: You said that for people that have solved this before, how do we undo it? Because, you know, it's checked green once you've solved it. Okay, you can, you can create an incognito mode.
8:31 B: Pardon?
8:35 A: Like you can create, what is it called, so you can like new, maybe new private window. If you create a new private window, that way it doesn't have any session. So just use that. Okay, okay, okay. So want to know how many, how many will be able to solve within the time range.
9:16 B: So how is it?
9:26 A: Yeah, so your time has started. How long does it take to compile? Because this one has been compiling for the past 3 minutes.
9:38 B: Ah.
9:41 A: As you can see, it doesn't take much. It does. It depends on the system. It does, actually. Let me give you an explainer. What's this supposed to be? Let's mute us, right? How many episodes? Where are you now? Can I just see? Wow, it's still compiling. It's still compiling. The first one is still compiling. Wow, first one. Refresh and do it again. For those just joining, we've used 2 minutes already. So just go to the StackLings app, create a new session, create a new session and start solving the problem from the beginning. So by 5:30, you want to see the number of, the number of problems or challenges that you've solved. You should be in function 2 already.
12:52 B: Okay.
13:13 A: Hello, sir. Sir, some of our laptops are not very fast, so the compiling is taking time.
13:18 B: Hello, sir.
13:21 A: Hope this is not an expo for- yeah, um, I have, I have, I've done this sometime before, but I use incognito. But it couldn't, um, you know, refresh my- Remove the sessions. Yeah, it resumed immediately. It resumed immediately. Yeah, even when I- Use another browser. All right, all right. Use another browser. If you've used maybe Brave before, you can use Safari or you use Chrome. I hope this is not an expo. The reason I'm doing this, I expect that I should have gone past that. It's- how is this? How is this so fast? You have 8 minutes left. 8 minutes left.
17:05 B: Notice what?
17:10 A: 4 minutes left. How many people are done? Let me see a show of hands if you are done. Nobody is done yet. Is it, is it hard? Done up to where? Done with everything. My own laptop is taking like 5 minutes.
21:15 B: Wow.
21:15 A: Yeah, compiling is quite slow, and sometimes you compile, you find out that it's an error, you have to solve it and then compile again. When you sum 2 numbers You get- when you sum 2 numbers, there is possibility of getting something bigger. So this should be 116. So Hey, those of you that are coming late to class, you have 1 minute left. Okay. Let's try this. Wait, sum, it's sum big numbers. Okay, sum of big numbers. So it's supposed to Okay. All right, so time up. You should have made your screenshots, huh?
25:26 B: Yes.
25:26 A: So just make the screenshot of where you are. Know that your screenshot is going to include the time that you made the screenshot. That's very sure. So just make the screenshot and send to the email provided. Make the screenshot and send to the email provided. Wherever you are. So, and that marks the end of the- so how was it? How was it? Hello, how was it? Nobody's speaking.
26:12 B: Not good though.
26:14 A: Not good.
26:16 B: You're too fast.
26:18 A: Huh?
26:18 B: You're too fast. I don't know, I don't want to like It's my first time with Cairo, right? And everything is just looking- everything is looking, you know. Yeah.
26:32 A: Okay, Ruth, how many people did it up to enums? How many people did it up to enums? If you did it up to enums, let's say show of hands.
26:51 B: Nobody.
26:53 A: Up to loops? Up to loops?
27:00 B: Nobody.
27:02 A: Up to quizzes 1? Up to quizzes 1? Okay, 1 person, 2 people. Uh, what's happening? Up to quizzes, one, just one person. Okay, functions, how many people up to functions? Okay, um, if, how many people up to if? Nobody. Operations, operations, nobody. Primitive, primitive type. Operations, operations, 1. Okay, primitives. Okay, variables. Variables is just the beginning. I should see every other hand now. How many hands am I seeing? Just 3, 5, 7, 8.
28:15 B: Wow.
28:23 A: Okay, let's, let's look at it from here. This primitive, primitive types 4. I hope everyone has submitted. Sure, that's very important. No. Hello? I didn't submit to. Like I said, you know submit quickly submit quickly submit. I couldn't go up to like three or so, so I just like I was. Please give me some minutes.
30:07 B: Hello?
30:08 A: Okay, so I'm back. Okay, so Let's, let's, let's just continue from here. Let's see, let's try to get this. So if you are going to solve this one, I believe that all these ones, the, all the ones before this, yeah, they are pretty much very simple. So if you look at this one now, sum big numbers, let's look at the test that we have here. So sum big numbers, to modify this test, to modify this test to use the correct integer types. Okay, don't modify the values, just the type. So yeah, now when you sum 2 numbers- so this one is supposed to be uint16. Yeah, so I've changed this one to uint16. So the reason is when you, when you sum 2 big, um, There is a law in, in algorithm, you know, if you have one- if you have, uh, what's it called, n digits, when you sum 2 n digits, the maximum number that you can get should be n+ 1 digits. Do you get? So if you have uint8_t and uint8_t, when you add them together, the maximum that you can get is going to be that 2^8+ 1. +1, so which is already, uh, above the range that we have here. Let's test this again first. Okay, there's another issue. Unexpected return type. Okay. Sum big numbers. Where is it? Sum big numbers. Sum big numbers.
32:09 B: Line 6.
32:14 A: Line 6, yeah. Okay, to do- modify the types of this function to prevent an overflow when summing big numbers. Yes, it should be uint8, um, uint16, right?
32:30 B: You can just give the one inside the parameters.
32:33 A: What?
32:35 B: The one inside the parameters, I think it should also be 16.
32:38 A: Which one?
32:42 B: So this uint8 should also be uint16.
32:45 A: You mean this?
32:49 B: Yeah, I think so.
32:54 A: Ah, let's maybe-
33:00 B: No, like inside the parameter, inside the parameter.
33:05 A: No, those ones should be uint8 now. Like here, x should be uint8, y should be uint8, then it should give you Should give you int16. Yeah, something went wrong with your code, failed to compile file. Let's check some big numbers. You can cast it, you can cast it to, you know, uint16 if you don't want to actually change the parameters to, you know, uint16. You can see we have these as links, so we can have, um, let's see. Now we have dots trying to unexpected return type. Oh, oh, oh, oh, okay, unexpected return type. Expected units 16, found units 8. Okay, let me just test this one first. So we are supposed to, uh, so this should still be 16, then this one will now be into So what's this? Test big numbers failed. Where is test big numbers? Test some big numbers.
35:27 B: Or instead of doing the into together, I can do it separately, like x.into, then y.into. It won't be parentheses, but yes.
35:39 A: So if that doesn't work- okay, that works. Thank you. So operations 1, Return the solution of x raised to power 3 plus y minus 2. So how do we, how do we do that? So you just say that res, let result equal to, so x raised to power 3, how do we do that? That should be .power, right? 3 plus y minus 2. So let's try that. 5 raised to the power 2.
37:48 B: You can just refresh because it happens like that sometimes. Maybe their app is buggy.
37:56 A: Uh-huh. We have to do this again. So let's- let's equal to- that will be x dot x to the power of 3 plus y minus 2.
38:22 B: Okay.
38:35 A: I did bracket x times x times x plus y minus 2. It works. Okay, that would work too. Yeah, I think there is a There is a power method. Sorry, sir, can you please, um, zoom in your screen? So calculate the modulus of x and y. So modulus is simply- so you say let res equal to x. So mod will be percentage, res percentage. x mod y.
39:48 B: Huh?
39:52 A: Okay, what's that? So I cannot see. Just speak out.
39:56 B: Okay, so the one you just did, right, the operations one that you had to do like x times x times x. Uh, yes. The power method that you're trying to do, like, have you used it before in Cairo? Because I feel like the first, the one you did that worked, is not really that efficient. So if there's a power method, because let's say I have like 20, you know, that I want to, you know, get the power up to.
40:26 A: Yes.
40:27 B: Do you think that's efficient?
40:29 A: Yeah, I don't- there is power method in Cairo, actually. There is 4 methods in Cairo. I'm going to check where is it in the common collection, getting started. This has- it should be in the units.
41:31 B: So you can check Appendix 12, number 12.
41:50 A: Okay, Appendix 12. So it's going to be a trait under- okay, operator. Yeah, maybe it's even this. Let's take expression. Yes, this is it. Ah, no, this exclusive, this bit. Now it's looking like it's not there. Wow, so it's only in Rust. So it's actually not there. Actually, it's not there. Let's continue with this first. Multiplication will be let res equal to x times y. So we test next. If- do not use another function called additional variable. So bigger, want to know which is bigger, or what's this? So you can just say that if a is greater than b, it's going to return a, else it should return b.
44:28 B: Okay.
44:37 A: Right, complete this function using if. If fishy is return full, so if fishy is fees, return full, else this. So what's fishy? This is fees. Complete this function using if, else if, and/or else block. If PC is please, return full. If it is whose, return bar. So which means that here we are going to have else if equals false, it's going to return bar, then else The last- Oh, the last one. Sorry, sorry about that.
46:15 B: You can pass.
46:24 A: So functions, call_me. So we have to call- we have to create the function. Function call_me. So it's returning nothing. Compile, compiles. Next one, call_me with this function main. It calls this call_me. So this one now it needs to have- so let's say it's uint8, right? So you have to add the type parameter of whatever functions they are calling. So callMeAgain, this one, it doesn't have any parameter. So, um, like, yeah, it is indicated that it needs, it needs this num. So we have to just put something here. So yeah, main is the original println, this Original price, sale price, sale price, x this, if it's even, price minus this, else this, if it's even, x this. Okay, so this is having issues where if the- don't worry about the function, about this. We are only interested in the signature for now.
48:15 B: So you can just hide that stuff if it's disturbing you.
48:21 A: All right, no, it's going to behave somehow if I should add it. So let this equals to 51. This 51 here, we don't know. So this is unit 32. If it's even, it's taking unit 32. So what's this one returning? So this one is supposed to return something, right? So let's- this is supposed to return uint32. This is returning uint32. So this one is taking in uint32 and returning bool. Okay, so Let's check that. So we have a quiz here. Calculate price of apple. That's the function. Verify test. Do not change the test. Put your function there. So look at this here. Price 1. Calculate price of apple. 35. Calculate price of apple. 40. Calculate price of apple. Maggie is buying apples. Okay, the price of an apple is calculated as follows. An apple costs 3 Cairo bucks. An apple costs 3 Cairo bucks. If Maggie buys more than 40 apples, each apple only costs 2 Cairo bucks. Write the function that calculates the price of an apple. So an apple costs 3 Cairo bucks. If Maggie buys more than 40 apples, each apple only costs 2 Cairo bucks. So What we are doing here is we need to take in, um, you know, we want to calculate this, so we need to take in the number of, uh, number of apple. So let's just use apple here. So, and the number of apple is going to be, let's Let's just use uint8_t is enough here. So, and the price is also going to be- it can be int8_t also. Let's say int32_t. Let's just use int32_t. So we just say that if apple. If the apple, if it is, um, if it is greater than- if made by more than 40, if it is greater than 40, then we are going to return what? Apple times 2. Else we are going to return apple 3. As simple as that. Now you'd see that here I'm not putting the semicolon. The reason I'm not putting the semicolon is so that it can return. That's- I hope we are, we are getting it already. So let's check that. What happened? Unexpected. Okay, expected int32, found int8. So let's just put int8 here. Int8 is enough. So loop, test loop. Let mute_counter equals to 0. Make the test pass without changing any existing line. Make it pass without changing any existing line. So we have loop break counter plus 1. So counter equals to 10. Counter should be 10. So what we just need to do is if we just say that if If counter is equal to 10, then break. So we now bring this break here. This one, mute 10. assert result equals to 5. So you see that in this place now, uh, after this loop here- wait, after this, uh, this condition there is still going to increase it by 1. So which means we are going to say, um, if, if counter equals to 5- Wait, if counter is equal to 5 We are going to break it here. We are going to break the loop here. It's still the same thing. Results should be 5, and we are also going to return counter.
53:59 B: Are we?
54:07 A: Once it breaks, it won't, it won't cut that from that part. Yeah, before the break.
54:14 B: Okay, look.
54:31 A: So, um, so you can just, um, take out the break- for the break statement on line 10, take out the, um, curly brace- I mean, the parenthesis at the back. Then, um, go and bring the counter to the front of the break. Bring the counter to the front of the break. No, no, no, as in on the same line. Okay, yeah, then space, then put the expression at the back like this. No, semicolon, semicolon. Yeah, that should work. Okay, thank you, thank you for that. So what's happening here is when it breaks, it is returning this counter value. So because we have let result here So it's returning this. So we have the enum, define a few types. So define a few types. So here we are going to have quit, echo, move, and change color. Wait, echo moves and change color. So having trouble. Okay, so this one defines different variants. So here we have quit. So it's just like what we had before, but there is now a little change here. Now you see that the echo now has a felt inside it.
56:41 B: Spelled 252.
56:42 A: Then the move, the move has, uh, has a tuple of, you can say, units 8, units 8 inside it. Which one again? Then the color, the change color. It has units, shape 32. This will be 32 into 32. So let's see. Missing token terminal, terminal comma echo.
58:01 B: H.
58:07 A: Oh, you know, it cannot be with Or could the echo be byte array?
58:24 B: The echo?
58:30 A: I'm just, I'm just thinking, could it be byte array? Byte array? This, I think, I think after the echo, there should be a colon. There should be a colon for echo, move, and change color. Like this, just a single column.
59:01 B: Okay.
59:22 A: Missing token comma. Does that mean there's supposed to be a comma here? Okay, so there's supposed to be a comma here.
59:42 B: Oh, you can just leave it at, at 1 instead of 2.
59:50 A: So this one, it was expecting U8. All these ones are expecting U8, not 32.
60:01 B: Maybe it just has to be 1. 1 type, not 3 types.
60:07 A: Wait, sorry, uh, um, unexpected arguments type expected integer, you-
60:26 B: it's found So I think it's expecting just one, but it's finding 2.
60:43 A: The initial bracket, it should not be else. I think same thing applies for the sales because then the sales will also become-
61:09 B: Yeah, oh, no need of brackets. So I don't think we need brackets because it's expecting just one, like one. Okay, same thing for this. Sorry, I'm going to call you. So you can just remove the parenthesis, like make it just one type, uh, this one. Like one, like one. No, like one, not two. Not two types. Ticket. But just try it like this.
62:07 A: Give it to phone.
62:10 B: And but you're giving it a tuple, it's telling you It's expecting one, but I'm giving it 2. Maybe just one type that it needs, then you can just use that type for the 2 objects.
62:22 A: Okay, let me copy this and reload it. Unexpected type expected call integer. You found this. So I think the problem here is that this one. What we have here, we are supposed to take in that tuple. Let's try this. Okay. So we are taking tuple. So this is working now. Sorry, please can you explain that one? Like this last one we just finished, a bit complicated in my mind. So yeah, we are taking in tuple. We are taking in the arguments as tuple of uint8, int8 like this. So let's compile it and it worked.
64:08 B: Why was it not working before?
64:14 A: So I think series of number 1 The syntax, the use of colon, then, uh, then, uh, we have to like put tuple together as a type, and there has to be a comma after, after each of the types. There has to be a comma after each of the types. Let's check the todos here. Implement the message variants. So in this case now, the message variant here is quite different. So you see that here we have message variant of- we have change color, and the change color we have this. Um, the change color is accepting this one. No, no, no, we have state here, state as color. Okay, position quit message. So in the message we have change color, echo, move, and quit. Change color. So let's have it change color. So this change color now is taking in, is taking in, uh, it's taking in this which is Units 8, units 8, units 8. Then echo this field. Yeah, hello, sir, can you zoom in a bit more? Thank you. Then, yeah, the rest of this, I'm not able to see this one. Move. So this move is taking Then quit, just quit. So let's try it. Something went wrong. Test output too failed. Wrong color. Okay, I think that's not the only to-do, most likely. Okay, create a match expression to process different message variants. So In this process here, so when you create a match, so we are going to match the message, right? So before that, we are going to start with let state color We have color. After color, we have position, then width, then- no, color, position, width equal to self. Right, then we now match the message. So if the message is- if the message is, what's it called, change color. So if the message is change color, it's going to have its own, uh, if the message is change color, then it's going to return, um, self equal to The change color that we have here, it has these arguments, so we can just take that. Let's say we have x, y, z. So you can just say, um, So color here will now be- so we can take the arguments here as new color. So the color will now be new color, then the position will still be position, and the width It will still be quit. So if the message is- what's the other message? If the message is echo So let's- we are going to take the argument as, uh, let's take it as s, and we are going to ask it to print line with the statement. If the message is- once again, if the message is move, so we have move to a new point. So we just say self report to- so the color that was there will still be the color The position is now going to be the new, new position, and the quit will still be quit. Then the last one, if you have quit Then we are going to self equal to states. The color will still be color, the position will be position, and width will now be- so let's test. Missing token terminal 53, 53, uh, terminal comma. Okay. Missing token terminal 53 again. New color. Missing token terminal message.
76:13 B: So I think you're supposed to use the functions that are inside the quit function, echo, the move position function. I think these are the functions I'm supposed to-
76:28 A: These ones?
76:29 B: Yeah, the ones inside this change color, create function, echo function.
76:35 A: Is it?
76:36 B: Yeah, so you can just-
76:38 A: They are almost the same actually. So this one will be change color. I'll pass in the new color. Let's check.
76:53 B: So it says this, this change color is also a function inside this one, so you can just do self.change_color.
77:29 A: Missing token terminal format. New column. Let's get the hint here.
77:53 B: Maybe the error coming from the other one.
78:07 A: That's what I think.
78:11 B: You have to do it for the others, just the echo, the move, and the quit. You have to use those functions.
78:17 A: self.move_position new point. So this will be self.quit. Position missing first. New color. Is there supposed to be comma here?
79:50 B: Yeah, instead of comma- instead of semicolon, it's comma in the Cairo book. It's comma instead of semicolon.
79:58 A: Yeah, yeah. Okay, change color. It's still in change color.
80:35 B: New color. Oh yeah, there's comma inside. There's comma. Line 53, the comma that is inside, inside the new color, close to new color. Yeah, yeah, I think the comma should not be there. Yes.
81:13 A: No column. Okay, that's reduced. So unused variable, consider ignoring by replacing with this. Okay, so there's no need for this. Okay, so this should work. Cool, thank you for that. So options, this function, I believe we all know what options are used for. So it's, uh, optional. It returns a value, it returns something or None. So this function returns how much ice cream there is left in the fridge. So if it's before 10 PM, there is 5 pieces left. At 10 PM, someone eats them all, so there is nothing left. So which means that When you look at it, we are going to look at the time of the day and we will say that if, uh, if it is before 10 PM- so we use the 24-hour clock system, so 10 PM is going to be what? We start with AM, then PM. So 10 PM is going to be 22. If time of the day It is lesser than, uh, it is lesser than 22, then we return option of what? No, then we return- is it some- what's it called? 5. Else return None, right? Let's test that. Oh, to fix this test, how do you get the value contained? Let ice cream equals to this.
83:45 B: We have to call option, then colon colon, then let's- I'm checking. Yeah, I think it should be same for the old.
84:08 A: So for this one, it's just- you, you can just unwrap it.
84:12 B: Okay.
84:54 A: Okay, so this should be optional. Check ice cream fill gas usage with 2 field. Which one? Which one field? This one is okay. This one field. Test as true. Take ice cream field. Ice creams equal to 5. Oh, value. This one is okay. So it's check scale duplicates. 9 at 9 it is 5 at 10 it is 5 at 23 5 at 22 5 are we there at wait wait wait wait wait Oh, oh, oh, oh, oh, okay. Else if, um, time of the day is lesser than or equal to 24, right? So option sum, so sum 0 here. Okay. So here they are, they are making us to check for the time of the day. So it has to be lesser than 24. So when it is more than 24, then this one target is this sum. This, um, use the is_sum and is_none. methods to check if optional target contains a value. Place the assertion in the correct blocks. So assert optional target.unwrap Let's see. Optional sum, optional none. Okay, so we say if optional targets.is_sum Those are methods. You need to call them.
90:03 B: Oh.
90:06 A: What again? Modify the following line so that if there is a grade for the course, it is printed. Grade is so-so, course is this. So what you are going to do, modify the following lines so that if there is a grade for the course. So we have a course here, this course is going to be printed. So it's still the same thing that we are going to use. So let's check if there is an option- where is it- students. So you say that if course. This some- but our experience, no good. Display grids. Okay. No. No grade, right? Okay, so we are going to pause there for this one, and we are also going to try to We are going to try to write a smart contract using Cairo. So with all of these syntax. This one doesn't want to share.
93:31 B: Sure. Okay.
93:57 A: All right, so, um, so we are going to write, um, we are going to create another, uh, a new, a new smart contract. So we know that if you want to do that, we use scab new.
94:18 B: I cannot see your screen.
94:19 A: You see it soon. Okay. How about now? So it's got new ERC-20, so you can see into it and Sorry, let's check. Okay, we have it here. So if you want to write a smart contract in Cairo, so the number one thing is that, yes, you make use of this lib.chiro. That's where all your whatever- that's where it's going to be. Your smart contract is going to be in the lib.chiro. So let's delete this. So basically, to start a smart contract in Cairo, you need to firstly- you want to declare your interface. You might want to- you're going to declare your interface. So, and to declare your interface, you are going to write, um, you have traits. So IERC20, and yeah, okay, we already have something like this here. So, and when you do this, you are going to- you can put a macro up here and put startnet surface. So what are those, uh, what are those?
96:50 B: Please, I cannot see your screen.
96:57 A: Can you see it now?
96:58 B: Thank you. Yeah.
97:41 A: So, so now you define your smart contract as your interface, you are going to define it over a generic state. So we most likely will use TContractState. ContractState. So then, you know, in your ERC, this thing, so there are What was it called? Then you can now list out all the functions that you have in your PLC20, this thing. So number 1, we have name. So for this one, you might need to go to- where is it? ARC 20, uh, AIP 20 token standard. So the interface- so all the interface that you need, number 1, we have name. So name, it returns, um, it returns string. So in this place you are going to have, you are going to have what? Name. So you see that your name, it's a public view, returns view. It means there is no changing states. Now for this one, anything that is not changing states When you don't want to change states, you take it as a snapshot. But if you want to change states, you take it as a reference. So you always start your function with self. Then in this place, since it is not taking state, it is not modifying states, then you are going to use this. Uh, you can see that I'm making use of@, this@. So this@, it is representing what? Snapshot. So we don't use string here, we use Feld252, right? Then you can see symbol also, symbol The same thing is going to return 0.252 decimal. It will return unit, it's total supply, it will return, um, 0.256. So balance of- now when you want to take balance of a particular contract, you want to take the balance of someone, so Let's check balance of- you take the balance of the owner and it returns the balance of the owner. So this one is going to be owner. So in this place you don't use address, you use what? Contract address. So everything is a contract address. So this contract address that we now- that we now put here, we have to import it. So we say it's in the- you use StarkNet contract address. Then decimals, total supply, balance of. They will now have transfer. So transfer, you are transferring from, you know, from a particular address to- we are transferring to a particular address. So we are going to declare that. So let me leave a space here. Function transfer. So just like I have said, you are going to use self. Now for this one, we need to pass it as what? As a reference. And in this place, the contract is going to be TContractState. So you can see the con- the person you are transferring, the contract you are transferring to, and the amount that I want to transfer. You have it here. So after the transfer, then you have transferFrom. So transferFrom So the same thing, so from, to, and, and value. So this one too is value, right? So the transfer- both transfer and transfer from, they return bool. Both transfer and transfer from, they return bool. So they return bool. Then we have approve. So for approve, we have spender value and it returns bool of success. So we have approve_spender_value, and it also returns bool. Then we have allowance. So allowance is, uh, is a view function, right? So for, for a view function We are taking the snapshots, we are taking the snapshots, and we have the owner and the spender. Uh, we have the owner and the spender. So this is, uh, how you write more like an interface. This is how you write an interface in your, your smart contracts. You know, when you're writing a smart contract in Solidity also, you are going to start You mostly- you can write it without an interface, but you mostly start using an interface. Then when I want to write the smart contract itself, you have- you are going to have instead of contract the name of the contract. So here you have the name of the contract is here. So then in this place you are going to have a macro that will tell, tell the compiler that this is a contract, right? That is going to tell you that this is a contract. So the First thing that you are going to do is you want to, uh, you are going to declare the- what's it called- the storage. So you have, uh, sorry, you have struct storage. So in this place, all the- so the things that I want to store, just what are your state variables? So the name, the name, the symbol, the decimal, the total supply that I want to track, then the balance of You have the balances, not balanceOf, the balances. Now for this one, it's not HashMap, you use LegacyMap. So it's in Solidity, you have mappings. In this place, you use LegacyMap. Mark. So yeah, you know, you usually have key and the value. So for balances, you know, you are using the contract address to get a particular balance. Then you also have the allowance, the allowances, okay. So you see that for allowances now in Solidity, you make use of 2D, my 2-dimensional mapping, right? You are going to say the mapping of owner to spender, the mapping of spender to the value. So, but in this, in this case, 2D mapping is simply taking the input as a tuple, tuple of the 2 contract addresses, and you map them to Um, what's it called? I map them to the, to the, uh, to the owner. So that's simply how- that's simply how you do it here. Now the next thing is going to be in Solidity, you have what we call the- what? The constructor, right? I hope everyone is still with me. Yes, sir. Yes, we're here. Okay, so in Solidity we have what we call the constructor. The constructor is basically, you know, at deployment when you want to deploy, include the constructor. So in this place also we have a- you are going to have a function And you call it what? Constructor, right? So, and you have to- you need the macro to let the compiler know that- Sir, sorry to interrupt, which intelligence are you making use of?
108:56 B: I need to know too.
109:06 A: This is you. So to make it know that this is the constructor, so in the constructor you have a reference to, uh, to self. So the reference to self is going to be equal Contrast it. Then you are taking the arguments that you are taking. You are taking the name, right? The symbol and the decimal. So we are not the one setting the total supply. We are not this. We are not the one setting the total supply, and we don't need the. You don't need a boolean listing in our, in our constructor. So when you take the name and all those- Sorry. So you are going to say self.name. You can see this is the normal way you assign it, uh, you assign it in Solidity also. So we, we pass this as a reference to self. So self.name equal to name, the name that you've passed in. self.symbol equals to symbol, the symbol that you passed in. And self.decimals equals to decimals also. Then you now know that in Solidity we have, uh, we have 4 types of identifiers, right? We have, we have 4 types of identifiers. We have, um, we have internal, um, private, then what? External.
111:34 B: External.
111:38 A: and public. So these are the 4 types of identifiers that we have been- so, and this we can see like, so we know that internal, it means that internal can be called in the contract and also in the, in a contract that is inheriting it. Private can only be called in the contract. External can only be called from the outside, and public can only be called- it can be called anywhere, right? So, but in this case now, we are just- we are going to divide it majorly into 2: internal and what's external, or external or public. So which means external is both external or public. Anyone that you can call from outside is, uh, Anyone that you can call from outside is external or public. Anyone that you cannot call from outside is private. So anyone that you can call from outside, the way you call them, you, uh, you use a particular macro for them. So you can use either this macro, you can use either this macro external. For this one, you put it in V0. You can use this macro for it, or you can also use, um, you can also use ABI embed version 0. So you can use either of these 2. So which means that when you use this macro on, uh, on a group of functions, then you know that they are what? They are external. And of course, your external functions, they are the ones that you define in your, uh, in your interface, right? So which means that we can now implement this particular interface. We can now implement this particular interface. So since I've already scoped it into using this useSuperERC20 here, then in this place I can just say, I can just say implement ERC20Implementation Uh, implementation of what? Of IERC-20. Now, you know, in this place we used a generic TContractState. So in this place we are not going to use ContractState. We are no longer using generic Implement- rubbish. Okay, so this implement ERC-20, implementation of ERC-20, then we have the contract state here. Then you can now start, uh, you know, all the functions. So the first one here is a reference to self and returns this field. So in this place, it's going to be reference to self. You can see, so before, in this place, we are using T to denote that it is generic, but in this place, this is the concrete implementation of, of it. So here we have self.name. This self.name, you know, we are making reference to this storage here. So we now say .read. Do we get? So then after this, we have, uh, after the name, we have symbol, right? After the symbol, we have decimals. So the same thing, we are just reading them. Then the total supply also. Total supply, we are just reading that.
116:19 B: What again?
116:24 A: Balance of. So balance of. So this one, we take the distance of the owner, so it gives us the balance of. So we are taking- we are looking at the balances to get the balance of, uh, of the, of the owner. So we are reading that. Then we also have allowance. So allowance is also here. So let's just read the allowance also. Allowance. So self-owner spender. So we are reading in the allowances, the allowance of the owner and the and the spender. Okay, so the next- so we now want to do all this transfer, transfer from, approve, and what allowances. Now for us to do all these ones, so there are some things that we usually- there is something that we usually do that, uh, you know, there's something that we usually do instead of calling transfer. We are going to create an internal function that is going to handle, you know, all those transfer, uh, and the likes like that. So how do we create an internal function? This one now is an external function, right? So if you want to create an internal function, there are 2 ways. You can, you can just create- if you just like write the function, it goes- you can also, if you write any function outside of what you have in that place, so he is going to take it as an internal or private function. So, but if you also want to, another way you can also do it is you can make use of this macro, we call it Generate, create. Yeah, so this one you use this for, uh, for implementing internal functions. So for this one now we can have, uh, So for this one now, we can have, let's say, transfer. We can have an internal transfer, an internal function that handles transfer, right? Now what this one is going to do is that we, we have- want to transfer. This is going to change state. So where are we transferring? We need to look at from, from address, from which is a contract address, to which is also a what? A contract address and the value. So, and it's going to- so what this one is going to do is that number one, it's going to make sure- so there are some checks that you want to, uh, that you need to Look at- look after. That's number one, the address that you are sending from is not address 0. The address that you are transferring from is not address 0. You want to make sure that the address that you are transferring from is not address 0. I also want to make sure that the address that you are transferring to is not address 0. So how do you, how do you check that? So you say, so number 1 is you say that let address 0 So which is a contract address? Oh, so we have contract address.
121:11 B: Constants.
121:11 A: So if you go through the- what's it called- you are going to see some of these things. If you go through the, uh, the Cairo book, you're going to see some of the constants that you have there. So this contract, uh, this one now you have to put it into scope. So in this place you say use contract address. So we also need to use that one also. Yes, we also need to use this also. Okay, so if address from- if from is equal to 0, is equal to address 0, then we are going to ask it what we want to assert that The address from is not equal to address 0. Assert that from is not equal to address 0. So you also want to assert that address 2 is not equal to address 0. You also want to assert that the value is greater than 0. I also want to assert that the balance of the person that you want to send from is greater than or equal to the amount that you want to send. Is greater than or equal to the amount that you want to send. Then after you've performed all this check, after you've performed all this check, then you are now going to say what? selfbalances.write. You are going to write for the person that you are taking it from. So for this one now, for this we can create another internal function and simply update To simply update, uh, to update the balance of, you know, different people like that. But let's leave it this way. So the person from the new balance is now going to be the previous address minus value. This one, the new balance, we're now going to do the previous, uh, balance plus this. So with this now, and it's going to return true if this is successful. So which means that if you now want to implement transfer from here, so if you want to implement transfer from here, we are simply going to- so in this place For transfer, we are, uh, we, you know, when you are using transfer, it means that you are sending from your own self. So we are going to say that let msgSender, so that is going, the message sender, msgSender will be equal to, so this one we use what, get caller address, get caller address. So this one now we have to put it into scope, you have to put it into scope. Where is this place again? You have to put it into scope here, get caller address. So you know everyone understands msg.sender, right? Yes, yes, yes. So you can see that we are still making use of the Solidity terms so that it's going to be easier. So since msg.sender- this is how you get your msg.sender. There's no msg.sender in this place. You do what? getCallerAddress. So when you've got the caller address then you can now do the, uh, you can now do the transfer. So in this, you know, in Cairo you don't use capital. So the- hey, I'm writing rubbish. So you have this, then in this place you are going to put your MSG sender. in this place. So you have to- to is the, uh, the person you are sending to, and the value is what- yeah. So when you just- you can see how, how beautiful this is. The real- this is going to, uh, it is this transfer here that is going to perform all the checks, and after performing all the checks, it's going to, you know, Return true. So the true that this one is going to return, we are taking it here, and this one is now going to return it to this one. You can see that this is returning bool. So that is how you perform what's transfer. Now the reason we, we use that one is so that we can use one okotukpa img. So if you don't understand, so instead of- we'll be able to use one One stone to kill 2 birds. So if you want to implement transfer_from now, transfer_from. So we already know, uh, transfer_from msg. Uh, what's it called? For transfer_from, we have- we want to transfer from this person to this person. And you have this, and you have this. So first thing that you are going to check before you call this function, before you call this transfer function, because if you just- yeah, we just have msg.sender. You want to make sure that the, the person has allowance, right? So you, you first said that what, let allowance equal to self.allowance from the, the MSG sender. It has an allowance with the person that you are, uh, that you want to, that I want to transfer from. So when you've done that, you assert that. You see, in Solidity, you usually do assert semicolon semicolon like that. So in this place, you just Uh, in this place, you, you simply, uh, you don't do revert or this thing here. For most of the things that you are doing here, you are asserting. So you assert that the allowance is greater than or equal to what? Or equal to value. So if it is not, if it is not, say about insufficient allowance. So you need to take note, for felt you use a single colon, right? Not double colon, please. So insufficient allowance. Now, self, then you are going to work- you are going to transfer from from that person to the- to- and the value. Then you are going to rewrite the allowance. You are going to deduct that allowance, and that's all. So that's transfer from. Then the next one is what? Is approve. The next one is approve. If you want to approve, what do you do? So if you want to approve a spender of a particular value, right? So you, you are the msg.sender, you get the caller address of the person that is calling. So you just say that what, self.allowance.write for- now you can see that here we have the key, the spender, the owner and the spender, they are the key here. I have the value here and you return, uh, bool. So that's how you, that's how you approve. What's the next one? Allowance. Okay, we've done allowance already. So you can see that we've, we've written, uh, what's it called, a simple Yeah, I'll see 20 contracts. Now your assignment is going to be to make this more robust. You should add mint, burn. You should add mint to it, you should add burn to it. And, and what again? And what again? So, uh, and an additional thing is that you're also going to complete the reading of the Cairo book, and you should figure out how to add an event. You should figure out how to add events to the contracts. I should add events to the contract. And what again? You should add events to the contract where appropriate. You see that if you check the ERC-20 standard Yeah, the events are basically 2, and they are where you are supposed to use them. So that's- ah, sorry, sorry, sorry. So do you have any questions as regards this? I'm going to All right, so, um, I want to ask a simple question actually. Um, if you want to keep track of, um, the msg.center that deployed the contract, how can you actually do that? Sorry, what are you saying? Okay, I say if you want to, you know, keep track or, you know, um, yeah, keep track of the msg.center that deploys the contract, how can you do it?
131:59 B: Oh, okay.
132:03 A: So for, for that one, there is a, uh, there is a universal deployer. So in the, in the constants, then So in the Cairo architecture, there's actually a small difference here. So because there is a, there is a universal deployer. Oh, so let's see. Okay, deploy. Actually, the simple solution that you can that you can make use of at the moment is just like pass that if you need it as an argument, just pass it as part of the variables because in the StarkNet architecture, so there is a universal deployer, so which means that the address this might not like work the same way that you want. But before the next class, I should, I should get back to you on if there is a better way of doing that. So is there any other question? Okay, please just talk. Okay, sorry.
134:39 B: Sorry, sir, how do we get a recording of this class? Because I would personally like to go over it again.
134:44 A: What?
134:46 B: How to get the recording of this class and previous classes?
134:50 A: Okay, just go on your calendar, your calendar. The, the recording will be automatically attached to it. So the calendar that you use to join this one, when you go and check it again after the class, you are going to You're going to find it there.
135:07 B: Okay, thank you. So, so that's the email we use in registering, right?
135:13 A: And yeah, yes, the calendar. Yes, the email you use to register. So just check your calendar. Okay, so this is where we are going to stop for today. So when you do the- you should write your contracts and push it to your GitHub. I should send the link. to that same email address. If you send the link to the same email address, so you have, you have 3 days to do it. You can see-
136:13 B: Can I get this code?
136:14 A: Can you get this code?
136:17 B: Yeah, so you can just put it in the register or something.
136:23 A: Buggy or something. Okay, let me check. Let me check if I can. Cheese.github.com, right? Yeah, longest time. Let's see. Is one of the problems with using the You might not know how to copy and paste. Okay.
137:53 B: Hello, sir. Yeah.
137:58 A: Can you guide us on how to install the IntelliSense you're using? The IntelliSense? Oh. Oh, I'm using-
138:08 B: Copilot.
138:09 A: It's Copilot activated, so I'm using cursor. So this Let me just put it here.
138:33 B: I think it was a sticky gist, or is it a public gist?
138:46 A: Okay, this is secret. How do I change it? Update secret, make public. Okay, it's now public. Sir, please, can you also add the dependency? The dependency? Dependency is just StackNet. Like this, uh, there isn't- we are not using any external. This is just StackNet that we are using.
139:24 B: No, so when we do it, start new, we are going to get all the things that you're going to use to run it.
139:29 A: Yes. Okay, so enjoy, enjoy your weekend.
139:41 B: So wait, you have not said anything about your, your Copilot. You didn't say much about-
139:49 A: Oh yeah, I said I'm using Postman. Um, you can, you can check it out. I might not be able to- console.sh.
140:02 B: So are you the one?
140:03 A: I just get the Copilot, so I'm using the paid version actually.
140:11 B: So are you the one approving the recording, the access? Because mine is restricted.
140:15 A: Am I the one approving the what?
140:19 B: The access to the recording.
140:24 A: I'm not the one, I'm not the one, but you should be able to see it like immediately you leave, right? I'm not the one, you can ask the management, they are going to respond to you when you request for the access. So any other question? I guess we are fine, right?
140:53 B: Sorry, so you say you're using Copilot and Cursor?
140:57 A: No, I'm using Cursor, so it already has all this stuff inside it. So Cursor, it's like VS Code also, it's just that it has AI integrated into it. And you, you can, you can put Copilot in your VS Code. It also works. Can we use VS Code for this? Of course. Of course. So any other question? Oh, if we want to be using AI, I thought they said that AI is taking over the world and it's going to render everybody jobless.
142:04 B: It's the person that is using AI that will take your job. That's the funny part.
142:10 A: When you're using AI, you can work, you can work faster, so they won't have to employ another person and you'll be happy. So, all right, bye guys, see you next time we meet. All right, thank you both. Good night, sir. Enjoy your weekend.
More from this hub
- Web3Bridge Weekly Update Vlog 3
- Web3Bridge Weekly Update Vlog 2 1
- Web3Bridge Weekly Update Vlog 1
- Web3Bridge Experience Uche
- Web3Bridge Experience Vicentia
- Web3Bridge Experience Tosin
- Web3Bridge Student Experience
- Web3Bridge Experience Mitchell
- Web3Bridge Experience Abiodun
- Web3Bridge Live Stream
- Web3 Lagos Conference 2022
- Web3Bridge 3rd anniversary Documentary
- Meet The Students of Web3bridge Cohort 09 - Part I
- Meet The Students of Web3bridge Cohort 09 - Part II
- Cohort 09 Week 01 Students' Report
- Cohort 09 Week 02 Students' Report
- Question & Answer Session With Vitalik Buterin
- Pushing the boundaries of Web3 UX - Richa Joshi
- Implications of the National Policy of Blockchain in Nigeria on the growth of the Web3 ecosystem
- Cohort 09 Week 03 Students' Report
- Cohort 09 Web3bridgers in Class
- Understanding Blockchain For Beginners - Hezekiah Suleman
- Exciting Insights: Students Reflect on Their Week 04 Learnings!
- Taking a Breather: Our Students Stepped Away from Classes for Conference and Workshop Week 05
- The Students Share Their Eviction Test Experience Week 06
- The Students Spent The Whole Week Building Projects Week 07
- An Introduction to Web3 Frontend: Students Sharing Their Experiences Week 08
- The Students Talk About The Dapps They Built Week 09
- Web3bridge Odyssey: Documentary Telling The Story of Web3bridge
- Exploring Foundry: Students Share Their Learning Journey Week 10
- Students Explain Diamond Standard (EIP-2535) | Week 11
- Smart Contract Code Review: The Students Share Their Experience Week 12
- Students Share Their Experience With Smart Contract Security Class Week 13
- Starting & Building a Career in Blockchain - Michael Jerry
- Web3: Community & Protocol - Ayodele Aransiola
- Understanding & Contributing to DAOs - Odebunmi Fiyinfoluwa
- Hacking distribution for web3 startups - Olatinwo Barakat Anuoluwa
- How crypto can regenerate the world - Kevin Owocki
- The Future of Work in a Decentralized World - Emmanuel Tope
- Blockchain for Africa: Why we should care - Amarachi Amaechi
- Web3bridge Cohort X Onsite Arrival Footage
- Meet The Faces of Cohort X: Introducing The Students of Cohort X - Part I
- Meet The Faces of Cohort X: Introducing The Students of Cohort X - Part II
- Meet The Faces of Cohort X: Introducing The Students of Cohort X - Part III
- Centralized vs Decentralized Networks: Insights from The Msg Senders
- Team ZK Shares Their Knowledge Concerning Smart Contract and It's Advantages
- Happy International Women's Day From Web3bridge
- Our Students Share Insight to What Consensus Mechanism is on Blockchain
- Utilizing JSON RPC as a Communication Protocol for Blockchain
- The Life of a Web3bridger in The Cohort: Abigael Irene Nyangasi from kenya
- The Life of a Web3bridger in The Cohort: Mary Gathoni Wangui from kenya
- Team MsgSender Shares Their Insight on Dapps, What They Learned, and Built
- Team Zero Knowledge Shares Their Insight on Dapps, and What They Learned
- Team Alpha.Eth || Solidity
- Exploring Smart Contracts || Cohort X Shares Insight
- Our Students Break Down Multisig Wallet || Cohort X
- Our Students Explain Mainnet Forking: Mirroring The Live Blockchain || Cohort X
- Exploring Smart Contract Interaction || Cohort X
- A Weekly Recap: What Cohort X Learned at Web3Bridge
- Interacting with Web3: Frontend Development in Cohort X
- Project Week: Cohort X Shares Insights and Emotions on Eviction Test
- Watch Our Students Break Down the Diamond Standard in Blockchain || Cohort X
- Starknet Fundamentals
- Cairo Programming Language I
- Writing Cairo Smart Contract on Starknet I
- Writing Cairo Smart Contract on Starknet II
- Testing
- Check out what our ZK masterclass students said about their experiences in the program.
- Starknet Architecture
- Frontend Interaction With Cairo Smart Contract on Starknet
- Quick Review: Understanding Account Abstraction in Blockchain
- Quick Review: EIP-4844 Proto-Danksharding on Ethereum
- Quick Review: Blockchain Layer Two Solutions Explained
- Quick Review: Oracles in Blockchain Technology
- Beyond Web3Bridge: Ayomide Adebara’s Success Story
- Beyond Web3Bridge: Casweeney Ojukwu’s Success Story
- Beyond Web3Bridge: Etim Paul’s Success Story
- Beyond Web3Bridge: Faith Robert’s Success Story
- Beyond Web3Bridge: Emmanuel Glory Praise’s Success Story
- Beyond Web3Bridge: Chinonso Idogwu’s Success Story
- Beyond Web3Bridge: Ginika Chinonso’s Success Story
- Beyond Web3Bridge: Mayowa Obisesan's Success Story
- Beyond Web3Bridge: Mitong Dapal's Success Story
- Beyond Web3Bridge: Musa Abdulkareem's Success Story
- Meet The Faces of Cohort XI: Introducing The Students of Cohort XI - Part I
- Meet The Faces of Cohort XI: Introducing The Students of Cohort XI - Part II
- Meet The Faces of Cohort XI: Introducing The Students of Cohort XI - Part III
- Meet The Faces of Cohort XI: Introducing The Students of Cohort XI - Part IV
- Meet The Faces of Cohort XI: Introducing The Students of Cohort XI - Part V
- Web3 Lagos Conference 2024: Innovation, Networking & Game-Changing Insights - Day 1 & 2 Highlights!
- Web3 Lagos Conference 2024 Recap: Innovation, Hackathons, and Blockchain Breakthroughs!
- Supercharging user onboarding; Building with social logins and smart wallet - Ayomitan Pamilerin
- Web3bridge Journey; A look into the Future - Ayodeji Awosika
- Mental Model for Building Smart Contracts on Bitcoin - Abimbola Adebayo
- Beyond DX; Building World Class Developer Documentation for Web3 - Owanate Amachree
- DAOs and Onchain Governance - Fiyin Odebunmi
- Build In Public; The Web3 Advantage - Kevin Chibuoyim
- Building Scalable Dapps - Israel Rex
- Web3bridge Students (cohort 11) Share What They’ve Learned: What is blockchain?
- Web3bridge Students (cohort 11) Share What They’ve Learned: Understanding Ethereum
- Web3bridge Students (cohort 11) Share What They’ve Learned: Nodes and Clients
- Web3bridge Students (cohort 11) Share What They’ve Learned: Consensus mechanism.
- The Future of Data in Web3 - Ivy Elebesunu
- Empowering Underserved Markets Onchain An Exposition to Real World Assets RWAs - Oluwole Kayode
- Introduction to Blockchain - Hezekiah Suleman
- Real World Assets Fluke or For real - Emmanuel Tope
- Science on the blockchain - Introduction to Decentralized Science - Scott Itepu
- Product Roadmaps and Team Management in a Decentralized World - Adedoyinsolami Adeyeye
- The Role of Social Media in Building Web3 Communities Best Practices and Pitfalls - Amara Achusi
- Working as a writer in Web3; How to build their brand - Toluwalope Ajetunmobi
- A DePIN protocol for unlocking Africa's solar energy potential and solving Energ - Ifeanyi Christwin
- Introduction to Arbitrum - Oluwafemi Samuel
- Web3 UX from a Wallet point of view - John Odey
- How to write content that connects with Target audience - Victor Fawole
- The Role of User Experience in Web3 Adoption - Favour Ohanekwu
- Building a Career in Web3 - Purity Ogheneochuko
- Scroll Technical Workshop - Wisdom Ogwu
- Web3 Documentation Best Practices - Lessons from Rootstock - Wisdom Nwokocha
- Interchain applications Cosmos and the IBC - Peter Anyaogu
- Developers guide to building on Solana - Alex
- Future of Wallet and Custody - Peter Olawuyi
- Field Notes from the Trenches - Ukeme David Eseme
- Web3bridge Students (cohort 11) Share What They’ve Learned: An Account
- Web3bridge Students (cohort 11) Share What They’ve Learned: The EVM
- Web3bridge Students (cohort 11) Share What They’ve Learned: Public and Private Keys
- Web3bridge Students (cohort 11) Share What They’ve Learned: Transaction
- Web3bridge at 5 Full Documentary | Ayodeji Awosika on the Web3 Journey and Growth
- Invariants Testing for Smart Contracts in the World of Medusa - Joshua Adesanya
- Improving web3 User experience through chain abstraction - Collins Enebeli
- The Future of Technical Communication in Web3 - Victoria Adedayo
- CoreDAO workshop
- Build On Bitcoin Leveraging Rootstock - Chekwube Peters
- Building Scalable Web3 Applications - Amani Kanu
- The Future of Social Media for Blockchain Startups - Motolani Omotuyi
- Buidling Decentralized App quickly - KC Pele
- Building the Future Decentralized Computing Infrastructure for Web 3.0 - Uchechukwu Azubuko
- Understanding the Lisk Protocol - Lisk Workshop
- ZK Workshop - PSE team
- From Ancestors to Algorithms Harmonizing Trust Based Cultures - Abidemi Adenle
- DeSci Web3 and the Future of Scientific Collaboration - Daniel Anomfueme
- Exploring Career Paths in Web3 An Introductory Guide for Beginners - Glory Praise
- Building beyond the Hype - Titus Adenugba
- The Future of Digital Trust Leveraging Ceramic for Global Trust System - Kenechukwu Orjiene
- Building a Global Web3 Community - The SuperTeam Case Study
- Meet Push Notification - Push Ambassador
- Introduction to DEXPAY
- Understanding the East African Ecosystem - David Lumala
- Web3bridge Students (cohort 11) Share What They’ve Learned: Building Function Modifiers
- Web3bridge Students (cohort 11) Share What They’ve Learned: EVM Explained
- Web3bridge Students (cohort 11) Share What They’ve Learned: Account
- Web3bridge Students (cohort 11) Share What They’ve Learned: Wallet
- Web3bridge Students (cohort 11) Share What They’ve Learned :Contract structure
- Web3bridge Students (cohort 11) Share What They’ve Learned: Function Visibility
- Web3bridge Students (cohort 11) Share What They’ve Learned: DApps
- Web3bridge Students (cohort 11) Share What They’ve Learned: Deploying a Smart-Contract
- Cohort 11 Student Shares How Our Training Facility Fuels Success: Meet Akinwunmi Akinrimisi.
- OFFICIAL PARTNERSHIP ANNOUNCEMENT
- Cohort XI - Eviction Week
- Web3bridge Students (Cohort XI) Share What They’ve Learned: Interface, Interaction & Mainnet forking
- Web3bridge Students (Cohort XI) Share What They’ve Learned: Multisig Wallet
- Web3bridge Students (Cohort XI) Share What They’ve Learned: NFT Gated Event Contract
- Web3bridge Students (Cohort XI) Share What They’ve Learned: NFT Gated Event Contract
- Web3bridge Students (Cohort XI) Share What They’ve Learned: ABI
- Web3bridge Students (Cohort XI) Share What They’ve Learned: Intro to REACT
- Web3Bridge Journey: A Ugandan Student's Path to Blockchain Excellence
- Web3bridge Students (Cohort XI) Share What They’ve Learned: JSON RPC and Ethereum JSON RPC
- Web3bridge Students (Cohort XI) Share What They’ve Learned: Wallet, Providers and Signers
- Web3bridge Students (Cohort XI) Share What They’ve Learned: Advanced DApps
- Web3bridge Students (Cohort XI) Share What They’ve Learned: IPFS & IPNS
- Web3bridge Students (Cohort XI) Share What They’ve Learned: MetaMask & MetaMask SDK
- Web3bridge Students (Cohort XI) Share What They’ve Learned: Multicall
- Web3bridge Students (Cohort XI) Share What They’ve Learned: Subgraph
- Web3bridge Students (Cohort XI) Share What They’ve Learned: Calls
- Web3bridge Students (Cohort XI) Share What They’ve Learned: Diamond Standard
- Web3bridge Students (Cohort XI) Share What They’ve Learned: EIP 2535 Diamond Standard
- Web3bridge Students (Cohort XI) Share What They’ve Learned: Upgradeable Smart Contract
- Meet The Faces of Cohort XII: Introducing The Students of Cohort XII - Part I
- Meet The Faces of Cohort XII: Introducing The Students of Cohort XII - Part II
- Meet The Faces of Cohort XII: Introducing The Students of Cohort XII - Part III
- Meet The Faces of Cohort XII: Introducing The Students of Cohort XII - Part IV
- Web3bridge Students (Cohort XII) Share What They’ve Learned: Cryptography, Ethereum, and Wallets.
- Web3bridge Students (Cohort XII) Share What They’ve Learned: Solidity, Functions, and Data Locations
- Scroll Meets Web3Bridge: Exclusive Talk with the Founder!
- The Visit!
- Web3bridge Students Share What They’ve Learned: Blockchain, Distributed Ledger & Consensus Mechanism
- Lisk & CVVC Labs Visit Web3Bridge: Power Moves in African Web3
- Alumni Spotlight: Wilfred, Co-Founder of Audioblocks
- Alumni Spotlight: Michael, Co-Founder of Coinsafe
- This Man's Determination Will Leave You Speechless - Alumni Spotlight EP3: Casweeney Ojukwu
- Breaking Into Tech as a Woman - Alumni Spotlight EP4: Glory Praise Emmanuel
- From Machines to Code | Switched Gears into Tech - Alumni Spotlight EP5: Olorunsogo Banwo
- Web3: Get Rich Quick or Game Changer? – Alumni Spotlight EP6: Ayomitan Pamilerin
- Web3 Lagos Conference 4.0 Is Coming! Africa’s Biggest #web3 Event
- Introducing the Web3Bridge Cohort Xiii students
- DeFi Diaries: Building Wealth Community and Resilience in Web3
- The Future of Privacy - Olayinka Oshidipe
- The Future of Payments: From Card Swipes to Stablecoins - Iyanu Faleye
- Blockchain-Enabled AI for Smart Grid Optimization in Africa - Nnamdi Onuigbo
- Introduction to Arbitrum and the Arbitrum Technologies - Olatunji Samuel
- Data-driven Community Building: Metrics that Matter in Web3 - Mfonobong Umondia
- Panel Session VI: How Stablecoins are Powering the New Pan-African Economy.
- From ChatGPT to ChainGPT: Shipping Autonomous Agents on Ethereum - Opeyemi Stephen
- Understanding and building on Polkadot - Bekka
- Panel Session IV: Onchain data or Community-led Models: Which works Better for Today's Market?
- Panel Session II: From Grants to Growth Capital: The Evolving Web3 Playbook For Web3 African Founder
- Designing for Web3: Crafting Useful Products, Beyond DAOs, DeFis, and Wallets - Mercy Kolapo
- Understanding Qubic - Israel Qubic
- Developer Experience Done Right: Proven DX Strategies to Onboard and Retain More Developers - Joshua
- Dexpay Showcase
- Bridging Traditional Fintech with Decentralized Finance - Motunrayo Koyejo
- Composable Yields - Peter Anyaogu
- A Guide to Crypto Data Analytics. Building Your First Dashboard With Dune - Oladayo Oladipupo
- The Vaults Economy: Supercharging Crypto Market Money with ERC-4626 - Olaoluwa Oluwatunmise
- Creating Public Goods: The Missing Link in Your Developer Marketing - John Fawole
- Web3Bridge Turns 6! 🎉
- 6th Anniversary Appreciation
- RWA Tokenization - Ginger Eke-Daniel
- Stop Yapping, Start Building: Real African Contributions to Web3 - Chukwuemeka Uche
- Starknet: Opportunities and how to get started - Faith Roberts
- Stellar and it's Ecosystem - Levai Agbara
- Content Marketing For Onchain Products: A playbook for Builders and Marketers. - Joy Joe
- Beyond Audits: Securing Web3 in the Age of Lazarus - Gracious Igwe
- The State of Onchain UX. Why Crypto Still Feels Broken (How We Fix It) - Nnamdi Ernest
- Inclusive by Design, Compliance by Default. The Blueprint for Web3 Success - Deborah Enyone Oni
- Why Storytelling Matters in Web3 - Gloria Echendu
- Harnessing The Ripple Effects as African Creators - The Content Chef
- Panel Session: Finding the right path to protocol development and growth as a Web3 Developer
- Panel session I: The rise of builder hubs in Nigeria, lessons & opportunity
- The Future of Payments: Spend Crypto like Cash - Amarachi Agwu
- Pathway to Continuous Growth as a Developer || Mayowa Tudonu || Alumni Retreat
- Enterprise Blockchain: What You Should Know and Prepare For || Adebayo Fabamise || Alumni Retreat
- Crypto and Tax in Nigeria: A Practical Guide to the New Rules || Mitong Dapal || Alumni Retreat
- What to Expect from Web3bridge in 2026
- Web3Bridge Cohort XIV Arrival Day Highlight
- Web3Bridge: Not a Shortcut, But a Launchpad
- Meet the new builders of Web3bridge Cohort XIV || PART 1
- Meet the new builders of Web3bridge Cohort XIV || PART 2
- COHORT XIV INTRODUCTION PART 3
- COHORT XIV INTRODUCTION PART 4
- COHORT XIV INTRODUCTION PART 5
- Web3 Lagos Conference 2026 FINALE
- Web3 Lagos Conference 2026
- WAs for African Money Markets and SMEs | Abidemi Ademola @Web3LagosCon
- The Hard Truth: Why Most Nigerian Startups Never Raise Venture Capital | Adeola Adesina
- Why Every Blockchain Needs an Intelligence Layer | Christian Obi @Web3LagosCon
- AI-Powered Infrastructure:Building More with Fewer Servers & Nodes | KC Pele @Web3LagosCon
- Scaling Your Web3 Startup to Mainstream Adoption | Oluwasanmi Timilehin @Web3LagosCon
- Onchain Lending for Productive Assets | Kayode Oluwole @Web3LagosCon
- The Trust Layer for a Trillion Agents: Blockchain, AI & the Next Internet | Ukeme David
- Trust Machines: What Crypto Actually Does for Credit in Africa | Favour Aniogor @Web3LagosCon
- Stablecoins as a Tool for Financial Inclusion | Ajayi Matthew (OnyxFi) @Web3LagosCon
- Tokenization: The Future of Ownership | Solomon Amaechi @Web3LagosCon
- DePIN & Decentralised AI | Panel Session @Web3LagosCon
- The Missing Layer in AI: Incentives, Trust & Accountability | Aishat Suleiman @Web3LagosCon
- Money in Crypto, Life in Fiat | Francis Codex @Web3LagosCon
- Optimizing for AI Agents: Why Founders Must Build for AI, Not Human Eyes | Adugbo Victory
- Decentralization Across Borders | Adetola Ogunsanya @Web3LagosCon
- Stablecoins & the Future of Digital Payments in Africa | Panel Session @Web3LagosCon 5.0
- AI Is Reshaping the Cybersecurity Landscape but How? | Damilola Abiona @Web3LagosCon 5.0
- Scaling Web3 in Africa: Growth Strategies & Adoption | Growth Panel @Web3LagosCon 5.0
- Building Pan-African Payment Rails with Stablecoins | Suleiman Suleiman @Web3LagosCon 5.0
- The Global Builder Pathway: Where Ethereum's Next Applications Come From | Pablo EAG @Web3LagosCon
- Why Every Fintech Is Rebuilding the Same Stablecoin Liquidity Stack | Amadi Chibuotu @Web3LagosCon
- Legal & Compliance in Web3: Navigating Blockchain Regulations | Panel Session @Web3LagosCon
- The Creator Economy with Stablecoins | Ike Orizu @Web3LagosCon 5.0
- Stablecoins Beyond the Hype: Building Africa's Cross-Border Payment Infrastructure | Mercy Emmanuel
- Venture Capital & Startup Funding in Africa | VC/Funding Panel @Web3LagosCon 5.0
Something wrong, or a video you want off this page? Write to wethem.xyz@gmail.com and it is fixed or taken down within 48 hours.
