and we are live welcome everybody for this live stream today we are going to do a full course for solidity this is going to be for complete beginners so there is zero prerequisite so let me know if you uh where you are from in the chat I see some people already um I see Patrick uh I see rul s Miguel uh Michael well seems like we have many people today um ABA Manu Roland Delta 5 amazing uh so uh briefly uh if uh if you are complete newb so uh I'm going to do a little advertisement here but this is going to be fast so uh we do a full Sol boot camp on E block to turn you into a complete solity Pro in one month so the next boot camp is going to start May 20 20th so this is roughly in one week and uh and yeah so this one is for complete beginner and the goal is that at the end you will be able to get your first freelance gig that will basically more than payback for the boot camp so uh enrollment is open until Friday so you have one day and a half left um and yeah so we have 30 people per um per cohort so I just posted the link in the chat all right um so if you are new here uh and you don't know who I am so I'm Julian the founder of it the blocks and I've been a blockchain developer since 2017 and so I've worked with this technology on a day-to-day basis I've worked for a couple of big project in the space as a full-time employee as a freelancer and I've taught more than 15,000 students uh blockchain development especially solidity so uh that's that's it for myself inro and uh so next uh let's start with this course on solidity all right so what is what is the sync solidity um so here this is the homepage of the St uh website so we on the blockchain on the ethereum blockchain uh we have spart contract smart contract there are this small program that run on the blockchain okay and U and they are written in a programming language called solidity they don't have to be in solidity they are other programming language but most of them are in this programming language and so this programming language look like JavaScript but it's not exactly the same so it's actually quite tricky it looks easy on the surface but uh you you have you have to uh you have to go a little bit deeper if you really want to be a good s developer so what I want to um what I want to show you is a real life smart contract and by the way I see some question in the chat already some people are asking if we need to learn another programming language before that like JavaScript no that's not necessary so let's go on ether scan okay and uh so ether scan is what we call a blockchain Explorer so uh you can see you can search smart contract by their address uh or also you can search them by keywords for example usdc that's a stable coin that's basically uh like another version of the dollar but on the blockchain so one usdc always equal $1 and usdc uh so this is a smart contract and so we can see uh the address so if you click here uh we can see the address of usdc actually I'm going to zoom in a little bit uh let me see yeah I think it's a little bit better like this so here we can see the address of USBC so you can see this as a this is an ID basically to identify the smart contract um so a smart contract can have a balance of ether so it's like um like a bank account basically it tells you how much money it has and um and here if you go here you click on contract and you can see the source code of the smart contract so don't worry at this stage you're not uh expected to understand how it works uh but but basically here we can read the code of the smart contract So Sol uh looks like this and uh on ether scanion you can basically read the code of each smart contract like this um so I mentioned that solidity is for ethereum smart contract but actually there are many other blockchain that where you can use solidity so you go on this website change .org and you can see all the blockchain where uh you can use um uh the solidity as well as all the the development tool for ethereum so you have ethereum of course but you have other one like B&B smart chain base polygon Etc and that's because under the hood even though those are other blockchain they actually use the tech of ethereum uh including solidity so very very important to know um one little detail about solidity is that even though this is a programming language for ethereum actually technically it's not part of the ethereum blockchain this is a high level language and we need to compile this language meaning we need to translate this language into a low-level dialect and this is this dialect that the ethereum blockchain understand and so you can actually see this uh uh EV M codes let me see uh so here on this website ev. codes you can see the list of this lowlevel dialect I mentioned uh this is what we call evm bite code so this is a series of Elementary instruction like this stop add multiply Etc and so it's not really readable for us um so it's readable for computer but not not for programmers so this is why we program in this high level language solidity and then and is going to be translated to this lowlevel language that will actually run on the blockchain um okay um so um we are going to start our first smart contract okay so for that you guys going to uh go on a uh website called uh remix doeum dor so I'm going to paste this in the chat uh let me see just one second I see someone in the chat that just bought uh a course of uh e the blocks awesome man welcome uh so remix ethereum.org you go on this website and that's basically an online IDE so you can use it to code in solidity and that's amazing because really you have nothing to install this is just a website so it's really easy um and so we are going to do our first smart contract so that you can understand that you too you can you can do uh you can do a smart contract it's not something to complicated it so you go you have different uh uh different places in remix so here you click here this is the file explorer and you click here and here you click the name you type the name of your smart contract hell world.com uh do what saying this is not a website do Sol o so that's the file extension of solidity and uh and we are going to type after um what we call the pragma statement so in this area this is the coding uh editor and the pragma statement is going to give us uh it's going to specify which version of solidity we are going to use so we're going to use 0.8.2 25 so that's the latest version uh if you see some existing smart contract on the blockchain you will see that they may have different version for example here usdc you can see that its version is much older 0.424 so that means if you check this contract maybe the syntax will be slightly different because the rules were not exactly the same but when you start a new smart contract you always want to use the latest version um all right so here uh I'm going to go very fast here because I just want to show you quickly uh how you can do your first M contract so we're going to do a simple function that return uh return the fix string okay so pure uh pure it's going to return just a string and I will explain after but now now uh I just want to show you an example hello world okay so here seems like everything is fine so now we go on the deploy tab this is this menu here uh we click on deploy so you may wonder where this is going to deploy our contract because uh is it going to the real blockchain uh what we call menet Well turns out it's possible to have different network so we have the real Network work where we spend real money but the problem is that it's not really great if you uh if you just want to if you just want to learn okay because every time you spend you you you send a transaction you need to pay real money so you don't want to have to pay for every time you're learning something so that's why in remix there is a really great feature where you can just deploy to what we call a local blockchain and it's completely isolated from menet so you can make any mistake that you want it's like a playground that you can use use and um so here we can select this playground if we go to environment we see remix VM um that's that's basically this this local blockchain I'm talking about and so we click on deploy um and we see our contract appear appearing the lower left corner here uh T and um and we can see our function hello so this is this button here so if you click on hello uh we see here this string appearing hello word so it's probably not very clear on my screen but if you do it on your laptop you will see Hello World appearing and so with this basically you've deployed your first smart contract so you see that wasn't so difficult um so now uh I'm going to go back to the the code editor and uh and I'm going to expand a little bit more in detail so our smart contract they are defined by uh this keyword here contract everything that you see in blue this is um a special syntax keyword okay so you cannot use this this word uh yourself this is for example if I want to call a contract contract solidity will not be happy with this okay and you can see this we have this underline here uh the syntax highlighter in red that tell us you can see here is not happy so when you see this exclamation mark in red it means you have a problem and you can also see it here in the solidity compiler uh compilation failed so we don't have the right to use those uh those blue keyword so contract and then the name of the contract you can use any name that you want except the Forbidden keyword um cycle is just my contract and then you open the curly braces and everything that you put inside is going to be belong to this contract so it's a little bit like when you have an object you can put things inside this object and for example if we were to Define another contract here my contract two so those are two completely different contract okay everything that is inside here is independent from everything that is inside here all right so so you know the basic uh layout and what we're going to have in a contract is basically two kind two kind of things really uh so we're going to declare variables here exactly what we call State variable uh so those are basically saved in the blockchain and after we going to have our functions so State variable this is basically your data right um and the function this is how you can read or modify the the data okay so that's that's the logic um so here when we Define a function we have the function keyword and then we have the name of the function then we have parenthesis like this um and so we can have arguments in the parenthesis we will see this after and then we have a bunch of keyword here so I'm going to explain this uh step by step so external means that you can call this function from outside the blockchain um pure means that um pure means that you can you are going to return this is going to be a readonly function so it doesn't modify anything so here we can see it just returned this that's it and after the returns keyword is going to give you the nature of the variable that we return so that's because in solidity this is what we call a type language so we always need to SP specify the type of the variables that we manipulate um contrary to to python or JavaScript in Python for JavaScript for example you can do something like like JavaScript you can do cost uh I don't know my variable equal 10 something like this but in uh in solidity you cannot do this because we don't know here what is if we don't instantiate this with 10 basically this variable could be anything but in Sol it you cannot do this you have to specify the type of the variable before and this type is is not flexible once you've decided the variable is of a certain type you cannot change it anymore so big big difference with uh Dynamic languages here and so the type of the return in the function is a string so that uh string and then we have this uh memory keyword so I'm just going to not going to get too much into the the detail for the memory keyword but basically for string we is always string and memory most of the time um okay so and then after we have the return keyword hello word and so here if we if we change something in hello word so for example put several H here so let's let's deploy again uh and if we click on hello now we can see the the string is different okay so I told you about some uh keyword here like external uh what if it's not external let's try hello uh I don't know hell another one and this one's going to be internal okay and it's not going to do anything so what's going to happen let's click on deploy um and now we can only see Hello even though we actually have hell also we have two function but we just see one of them the other one is not visible from outside of the blockchain so we can call hel from inside the contract for example here uh we could do Hela like this but uh cannot call it from outside uh right so this is really really basic function um and now we're going to start to talk of State variable because you know this is just a pure um readon function just return the strings not really interesting so what we want to do is interact with data right so there are different kind of variables but the one you're going to manipulate the most is uint so that's unsign integer uh that's basically zero one uh two 3 Etc so we don't have decimal number in solidity so you don't have 1.5 for example it's not possible it has to be integer um and it goes up to a very big number which is 2^ 256 minus one um so we have our u in here and then we Define if we can read this u in from outside of blockchain so if you put public that's yes if you put private that's no so let's try public uh VAR one right in okay let's remove the function here um you in V one and then you in v two all right and so the second one we want to make it private so I want to show you the difference um so we deploy and here VAR one um we it's available but VAR two we don't see it because that's private and actually we can read the value of V one and so we see the default value value of integer which is zero but if we instantiate it to something like 10 that's going to have a default a different initial value so now it's going to be 10 okay so we have um we have those State variable and now let's do something a little bit more difficult let's try to read the value of one of these variable with a function for example V 2 we we don't have we don't we do not see it outside of the blockchain but we can create a function for that so we can uh create a function called get VA 2 right and this time we're not going to use the pure keyword uh but uh we're going to use view so pure is when you return a a static piece of data like a piece a string for example a static string but view is when you read from a variable um and here returns so V uint this time and here we're just going to do return VAR two all right so should yes fine so let's deploy again uh and here we see two functions so V one that's because this is a public variable so automatically it create a getter function with the same name so here it's 10 and get V 2 so it's going to return zero and uh yes so now it's a bit more interesting we can declare variable and we can also create a function to read them um so so far we've just read variable but on the blockchain we want to read and also modify variable so that's why we are going to do a counter um so let's uh let's do a counter and going to call this uh data for example in uh we're going to call this uh increment um so now we're going to is data equal data + 1 all right and we're going to return uh remove view because this time this is not going to be a readonly function but we're actually going to modify the blockchain um and you're going to remove return because we're not returning anything all right so data equal data + one and we can also have a function that decremented so decrement data equal data minus one right so let's deploy again and now we see three functions so data uh give us the initial value zero increment so now we see that something is happening uh here at the bottom of the screen huh so this is this is like um this tells you that we just sent a transaction and it gives you the detail of this transaction so let me uh pull this up and let's open this okay so here this is a little bit small I don't know if you can see it clearly um I'm going to try to so we see different information so it tells you that it's is transaction mine execution succeed we have the transaction hash so that's an ID that um that we can use to identify the transaction so um we can use the blockchain Explorer like ether scan to actually search for this transaction hash in this case it's not going to work because we have the we're using the virtual the local blockchain of remix but if we were doing a transaction in on public blockchain we would be able to use this blockchain Explorer um then we can see the blockchain hash so basically where in the blockchain this transaction was mined um block number few few detail and um here so from the sending address uh 0x 5B something and if you scroll up you can see that this matches what we have in the account field here 0x 5B Etc so if you select another address here you will see the from field that is going to change uh two so it tells you which contract he called with the function and then uh we have some fied about transaction cost so the thing is on the blockchain when you uh when you modify data you send this transaction that I mentioned and this cost money this cost money because the miners so also called validators so these are entity uh a computer basically that will charge you money uh to run your transaction because it cost them money to actually do it so uh we need to pay them and we pay them um with ether but it's where it gets a little bit complex we actually use another unit to measure this transaction cost that is called gas so I don't want to spend too much time on gas um but basically from high at this point just remember that it means how much money you paid for these transaction and here the field that tells you how much money you actually paid was 43,000 so this one transaction cost basically uh you have another one called for execution cost so that was the cost of running the solidity code um but on top of it there is also a fixed cost per transaction which is 21,000 gas so no matter what you do if you send ether if you execute a contract Etc you always pay 20,000 and then on top of it uh you also pay um per um uh for each extra uh extra action that you do so like running a smart contract function and the more complex it is the more it's going to cost you all right so uh here we yeah that was our transaction and if you look at other things let me see uh so for example this one this one here was different this one was a call okay so when you see VM here it means that was a transaction but when you see call it means um that was just a call so when you call a only function this is just a call this is not a transaction and it cost you zero it's free to read data from the blockchain it only cost you money if you're modified okay um so so so so uh that's it for okay let's let's lower this let's lower this okay so let's go back to um yeah to hear our different mosquito almost got it uh so here in G in uh dark green you have the readon function data and in Orange you have the function that actually modify the blockchain like increment or uh or decrement okay so that was a a very very simple contract um so now I want to show you some other uh some data structure um some some other type of variable so uint this is the one you're going to use the most and after you in another one that is very useful is address uh like for example here so an address basically identify smart contract on a blockchain but also wallets so you have two kind of addresses one is called okay so let me remve that um one is called an eoa address and one is called uh basically a contract address so an example of a contract address would be for example here we can see our deploy smart contract so we can copy it here this is a contract address the contract address of this contract um and the EA address will be the deployment address so here in account you click here and the big difference is that the eii address is going to be Associated to a private key so basically like a secret password if you want and you can use this private key to uh send transaction on behalf of this EA address okay so if you own some ether for example you have wallet like metamask this is an EA address so most of the EA address are controll by human but you can also be controlled by code for example if you have a back end somewhere and it has a private key then this is going to be an EA address and then you have this smart contract address that identify smart contract so they don't have a private key okay so um you cannot control a smart contract with a private key a smart contract all you can do with it is you can deploy it and then it's basically waiting for incoming transaction so it has this function and you need to execute its function but it's just paive there is no way for the smart contract to you cannot uh uh use the the private key of the smart contract to control it it's this does not exist so big big difference uh and so in this variable type uh address we can store the two type of address uh right so um yeah so this is this is uh this is address another type of uh of variable is a Boolean value so for example uh I don't know like a like a Boolean flag like to to to say something stud has started so Boolean um yeah so you in addresses Boolean uh and apart from that so you have strings we talked about it before but it's a slightly more comp Le Lex type uh so strings in solidity they are not very used because they are not really gas efficient and and to manipulate them we don't really have all the function we have in JavaScript or python so in general we just avoid avoid the the string uh okay it's mostly un and addresses really okay so this is for the um for basically the simple the simple variable the I I talk of the simple variable type and now after we will talk of the more advanced variable type um but um but first maybe uh maybe that we can do a spot contract a little bit slightly more complex okay so let's do a calculator so that you can see the the different um the different operation we can do so public dat data okay so let's do an addition uh actually let's we don't even need this one so let's do an addition you in right and then here what we're going to do is return a plus b okay so you can do additions uh here it's going to be pure returns you in okay so we can do addition we can do subtraction uh here we can do division uh we can do multiplication um and we can okay let's change the names add uh sub divide uh multiply and we can do power as well so for power uh yeah this one all right so seems correct so let's remove the previous destroy the previous contract click on deploy all right so let's check it uh 1 2 equal three all right division uh 10 five uh equal two but if the division um doesn't have uh uh if the division basically if the result is a decimal number you see that there're going to be some rounding so 10 ided by 4 for example um yeah it's it's two it's uh so that's why um we have they we have some issue with uh division in solidity so we avoid to do any division that doesn't give you an integer uh as as a result if it gives you a decimal number that that's not good so the way we do this is that we make we make sure that at the numerator we are dealing with really big num so that the division is always uh always whole um okay so multiplication 2 * 2 = 4 um then power so two power two so four as well uh and sub 10 - 2 equal 8 all right so everything is working uh all right let me look at the chat a little bit um so so what do we have here uh so someone say hey Julian in 2020 I took the dab 30 course from you now I'm in a I'm a middle developer amazing thank you for bringing knowledge to the people awesome uh T ahed I'm a software engineer working at a company which stock price went down 70% on the verge of getting led up is it a good time to learn blockchain yeah so we are in the middle so make uh yeah sucks for your company but the good news is that right now we're at the middle of the bull market so if you see all the blockchain recruiters they are really bullish they have really a lot of jobs so yeah good time okay so now we have our simple smart contract but we uh we know how to do arithmetic um so so so what are we going to do next um I want to show you some more advanced data structure um so uh let me see no first of all I want to show you how to move money okay because money is super important so okay let's say let's say that we have a function here that we call this deposit okay we make it external uh and we make it payable and payable means that now it's possible to send money to uh to this function and uh I'm going to show you how just after and we can also um we can also withdraw money so withdraw you put what is the amount so for example you want to send it to who okay uh you want to send it to this guy and um and I want this amount okay and so what you're going to do is uh so here address this so basically this is how you target this smart contract and we also here the notation to send ether is a bit ugly but it is what it is so call Curly bracket value here amount and then uh between parentheses and uh here empty quote okay um oh what am I doing uh no no no no no Julian that is not right that is not right you it's not how to work two okay two here the recipient of The Ether call and then here it tells me it's not happy um and uh let me see so we forgot something here so we forgot to make it payable yeah so because you have two variable type in solidity address and address payable and to receive money it actually has to be to be payable so don't be confused here this is the uh address payable keyword at address variable type sorry and here is a payable keyword for the function so mean this means two different thing the first one means you can send money to this function and second one means you can send money to this address okay so let's try to use this uh let's deploy this contract and here we can see this is a red function deposit red means you can send money so deposit and it turns out with the address generated by remix we have about 100 ether of course this is not real ether um but we can send some of this ether and here you can see the value field so let's send one ether okay uh so if we click on deploy now we can see that the balance show you one ether and we can see the balance of our account that uh decrease by one ether but we can get it back if we click on withdraw so let's click on here uh rraw and here we are going to uh specify how much ether we want to send so um here there is a a confusion with uh the way ether is transferred on the blockchain so when we talk of amount here what do you think if amount equal one does it mean we send one ether no no no no it means we send one way so way is a very very small unit of an ether this is like a tiny fraction one ether is equal to 10 power uh 10 power 18 way okay so that's one with many zero so what we need to do if we want to get uh uh if we want to get our ether back we just we need much more than one way okay so let's do uh 1 2 three 4 five 6 7 8 9 10 11 12 13 14 15 16 17 18 okay should be fine uh so let's click on risk draw and now the balance is zero and we can see that our ether um our ether came back okay so we don't have exactly the same amount as in the beginning because we needed to to pay for the transaction fee but this is almost the same thing okay so now you know how to manipulate ether so to send ether to a Smart contract and um send it to another address okay uh so after we are going to study the data type that a little bit more complex because you know in any programming language we need to uh deal with collection of data so we need container we can put data inside so the first kind of container that we have is a an array so you in in uh here uh with a square bracket specif ify this is an array and uh for example I don't know balances and so that is an array so how you manipulate uh this array so we're going to see this for example uh add uh add yeah uh so the way you're going to add something to this array is balances. push in let's say here we element and we're going to push an element in the the array like this right um it's not possible to push two different data types so in JavaScript for example if you have an array you do whatever you want you can put an integer the next element can be a string whatever it doesn't matter here in solidity all the elements will have the same type now um it's possible to read value so read value um and you have to specify the index okay and view [Music] return u in okay and uh return read and between square bracket you specify the sorry but it is specify the index and so the index start at zero okay so here when you do push it's going to be push this element uh index zero then if you call it a second time it's going to be one programming language okay um then we can do another function to update right so to update um we going to have value here um so balances I and here we're going to replace what we had before okay like this um and it's also possible to delete an element so let me see uh Delete so actually doesn't like this delete is uh a forbidden keyword so we need find something else let's say we want to delete the this element and it's going to um let me see uh delete it's basically going to reset it to its default value um and yeah so this is most of the operation you can do with an array uh so let's test this deploy okay so here let's add uh I don't know uh okay 10 uh now let's add 20 okay so now let's read the first one the first one is 10 second one is 20 okay it's working um then let's update so the first one is not going to be 10 but it's going to be 100 Okay so now let's read the first one now this is 100 all right now let's try to delete the first one uh so delete and now if we try to read the first one then it's reset to its default value which is zero okay awesome so now you know how to deal with arrays congrats um so next I'm going to show you another container that is very used and this is a mapping right but first of all pose water okay so second type is mapping so mapping um and in the mapping this is basically like a key value store so you know in JavaScript you have key value store is something like this right like uh myy key my value my uh my key2 my my value two uh Etc right so the equivalent here will be a mapping and first you specify the type of the key and then the type of the value um so one thing we can like a type of mapping we see a lot is balances so the key will will be an address and then the value will be a uint in we make it public um and yeah call this balances and yeah uh so now how are you going to manipulate this mapping so we're going to see this uh function and first of all let's let's add something so add and address uh balance okay now you do balances of address equal balance all right and so what if if you want to update uh a a existing entry well this actually exactly the same function um so you will just call this and basically it will overwrite whatever was initially in uh in in this at this slot that's it um then we can read a mapping so read um I read uh this uh this address and this time it's going to be view returns a u in and we return the balances of this address okay so okay so and what else we can do we can also remove an entry so delete element and uh we can use the delete keyword all right so now we have everything let's delete the contract let's deploy and let's play around so first of all let's add some things so okay let's select like another address here um for of for the second this address I'm going to add 10 for example right um then if I try to read so I can read the entry for this address I click on balances and I have 10 now I can update this value so if instead of 10 I put 100 it's basically going to overwrite what we had before so now we click on balance and now we have 100 and what if we delete this delete it so now if we read it it's going to be reset at its default value which is uh zero but there's something really strange let's say we want to read this another address that we we never set this address and we so let's try to read this no sorry balances and we can read it it's zero even though we never initialize it it doesn't give us any um any error and that's a big difference between this and an array if you try to read a non-existing value of an array it will give you a mistake um but uh for mapping you can read any entry of any mapping uh it always going to uh return you something uh which is the default value of the type basically all right uh so now you you know mapping um and what else what else we are going to do uh tonight so let me see um all right so so now I want to show you a modifier and access control so basically often time in smart contract you need to verify the access so maybe someone want to do some action but maybe they are not allowed to do it so we need to uh to make sure that they're not going to steal money or something like this so let's declare here a uh a variable we call this owner and we're going to use a special function I never mentioned before this is called a Constructor so that's basically a function that is executed only once when you um deploy the smart contract so that's where you put the initialization code basically and here in this owner uh you are going to initialize it so there are a couple of builting keyword in solidity and one of them is MSG do sender okay so every time you uh you have some sol code you can read this this uh this variable this is populated automatically by solidity so here that means that whoever deployed this smart contract this address going to be assigned to uh to the owner um okay and so now what we do is this owners well let's say we have a sensitive function like I don't know RISD draw money okay risk draw and we can specify I don't know how much we want for example um so external let's say we rest draw to so mhg sender call uh value amount this is how you send money I show you this before so this is how you would send money to yourself uh and here let's make it payable so this is how you transform a nonp payable address to a payable address okay but um if if you do this anybody can call this function and this is a huge security reability and you know for smart contract security is really big deal we need to make sure that our contract are secure so to prevent this uh what we can do is we can use what's called a require statement um so yeah there are there are different way to do access control but that's the most simple way uh require and then you're going to put a test inside so MSG sender and we want this sender to be the owner okay and if this is true if this test is true so here you can see that there are two equal okay this is not one very different one means assignment two equal test and if this is true the execution is just going to continue but otherwise if it's not true it's going to trigger uh an error and uh we're going to see it so only owner right uh what's what's the problem here okay fine this is so here when you see something in Orange but it's not in red it's just mean this is a warning so warning um you can still deploy your smart contract but not if it's an error which is red okay so now let's try this deploy um so who is the owner the owner 0 x5b which is our address here okay so if we try to rraw for example uh zero ether uh so let's see if it works yeah it works but now if we try to withdraw zero ether but from another address let's see if this work and no no doesn't work you have the uh the error here you can see the the red icon it tells you revert the transaction has been reverted to the initial state so that means that any change that that was made during this transaction everything is cancell okay so let's say let's say that here you try to steal money uh modify uh variable uh Etc everything that you do before and everything you do after everything is cancelled okay it's back to square one back before to the state before the transaction remove all of this and it tells you the reason why uh why we reverted so it's because this is only owner okay so in here it matches our string okay so you can see that this is uh this is working all right so let me check the chat a little bit do we have any question um Naza hey I'm a Java developer with five years of experience will it be easy for me to switch to solidity and master it in a short time yeah yeah I mean it's uh you don't need any prior experience uh in programming but if you do that's even better so um yeah absolutely uh Billy thanks for this class thanks man uh Miguel why don't you use two. transfer so that's because two do the transfer function was the the old way of transferring money but it has been depreciated uh because there was a security vulnerability and the new way is to use uh the the call function so technically call this is a what we call a a low-level call um this is actually quite old school uh this this call function was present since the beginning of solidity and then they tried to do a more recent version with transfer but they figure out there was a bug in transfer so we uh we went back to the old version that's the story um okay um so uh what else uh what else we going to do I'm going to show you um how we can create struct uh so custom um custom data structure basically so let's say that we want to have an object and in this object we want to have custom field so for that we're going to use a struct and uh we can call it like like we want like user for example and then we're going to give it a couple of fields so user can have balance for example uh can have uh name uh I don't know like join at uh everything you you want and the way you're going to uh create this user so create user you're going to specify all these fields so balance uh name and U in uh actually no need for that I'll show you another builting variable so um here what we're going to do and usually what we do is that this struct we usually put them in mapping or in in container at least so uh let's say the key will be the address usually the way you track user on the blockchain is is wi address okay and uh and here what are you going to do so create user actually we need its address uh so users here it's address and we're going to credit the user like this so balance name and for join at we can use a special variable called block. timestamp um that will give you the date at which the smart contract the transaction was sent so if you don't know what is a time stamp that's basically an integer uh look something like this so like a big number and that's the number of second since uh 1st of January 1970 probably UTC uh some the green wi Meridian uh and you can see the current Uh current time stamp so if you go to this website you'll tell you hey time stamps this one 56 and you can see that every second it's uh it's incremented so this is this number that you're going to have access to all right create user and then um if you want to uh to read the user then it's also possible uh so for example get user and here address address and um external view returns and we can we can specify the different uh the basically we can specify we want a user memory but that wasn't necessary because we already here if the users uh if this is public we can already read from this but I just want to show you another way uh all right so we're fine let's redeploy boom redeploy from here and users um so we're going to create a user uh let's try to create a user yeah for for ourself for example so create user this address the balance I don't know maybe zero uh and name uh I don't know Bub all right so create user now get user so let's put our address get user and here it give us the results it's not super readable uh but is zero the balance and BB the name and then the the time stamp so one 71 something and that's basically that's that's close to to what we that's close to the current time stamp okay so uh now you know how to define a custom data structure um okay guys so it was pretty much everything that I wanted to show you today so U that was a crash course so you know I don't want to give you we're not we're not going to cover everything in s you still have a lot of different things that um that that you can do but with what I showed you you can already do uh do a couple of things and yeah so this is a good beginning so as I mentioned at the beginning um we have our solidity boot camp that is starting next week um so in one months we're going to turn you into a solidity Pro so of course we're going to go much further compared to what we did today um we're going to cover Advance solidity uh uh testing um uh Y which is a lowlevel um dialect of solidity we're going to cover security we're going to cover gas optimization and the last week we're going to teach you everything that you need to know if you want to create uh a token as a freelancer so not the basic tutorial that you find on YouTube but the complete sequence absolutely everything you to do like customization of the token uh uh deployment management of the private key all the little detail that that you need and so thanks to this module you can then go on website like upwork and find very easily your first freelance gig and this is how you get your foot in the door and once once you have this first ped uh ped Mission the PED gig then everything else becomes so much more simple but you need to have this foot in the door and so this is what we do in this boot camp so if you want to check out the the program and register I put the link in the chat so the uh registration are going to close on Friday so you have but uh one day and a half left if you want to register okay guys so let me see if we have any uh last question in the chat um so I don't see anything okay so I hope that that was interesting I hope you learned something today and um I will see you next week on the Channel all right thanks everybody have a good day bye