New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

Workshop: Learn to Build Zero to Hero - ETHGlobal Sydney 2024

ETHGlobalWed, Oct 9, 2024, 12:00 AM

Join Solange Gueiros of Chainlink for a workshop titled, "Learn to Build Zero to Hero." Solange's workshop is for beginners who are new to web3 and blockchain. Learn to deploy your first smart contract and other concepts! This workshop took place at ETHGlobal Sydney 2024, the first major Ethereum hackathon in Oceania, hosted by ETHGlobal, May 3-5 at The Venue Alexandria. ----------------- Follow us: https://x.com/ethglobal Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com

Transcript

[Music] so prepare your computer get your computer ready because I'm pretty sure that we have one hour and we are doing this in a way step by step to be sure that everyone can do together okay so is this this is the introduction to blockchain and the goal now on this session is deploy your first smart content and we are doing everything that we need to do that this is me my name is Solen Gus I am a developer Advocate at chaining clubs it means that I am a blockchain educator a really educator I love to teach people and I love to bring new people to blockchain so this session for me the session when you are creating our first smart content for me is the most important session here and these are my contents and yes I came from Brazil yes and you can call me Sal it's easy to you as well and this is the presentation so if you need to take care of one slide is this take a picture or everything that you need is over there I can go fast in the others but this is the most important for you yes this is really amazing so good and on training clubs I teach how to use the training services but exactly because I like to start with the beginners I like to start with this kind of sessions when we are really uh creating from zero my first question for you who here didn't have a wallet in your computer do you have a wallet no perfect I love you is this is the best because you are really doing this from zero this is really amazing so let's do I'd like to you to go to this place now so like I said before this is really really hands on so get your computer and go to this site this is a collaborative pad it means that we can write together over there everyone can write in the same time in the same line sometimes it's a mess I know but we can figure out and make this be good and be careful to not delete everything okay because in the same way that we can write we can delete so be careful and this is the way that I can share with you everything that I'm doing so if I may open a link a URL I share in the pad with you I copy over there and you can open your computer if I'm creating the content I doing exactly the same so we are doing step by step and I'm sure that you can do everything with me okay oh good if you didn't type it yet take a picture and I me moving forward in fact I me going over there and yes it was here and I'm inviting to I'd like to know you a bit more so I'm sa from s Pao Brazil and you where are you from Wow we have a Gerald from Singapore wow and Jack from Australia and the har here as well New Zealand I think it's all that Harry yes we have more than one Harry here amazing and do you have more people doing with me I love to have a lot of people doing that so I creating a divider here so if you'd like to add your name at on this part and you that arrived now take picture of this this is the link that you must go now and then you can follow follow us and go with us so let's move forward and uh first uh really uh small introduction related to blockchain there are many ways uh that you can explay what's blockchain but I'm telling that blockchain is a chain of blocks and each of these blocks have uh used to have the hash the cryptographic part from the previous block also some transactions and uh the proof of work is to create a hash of this block in a valid way then when I have the block two I have the hash of the previous block and all the transactions as well and this this I I'm having more blocks and more uh transaction inside but imagine that I am on the block number 100 and I'd like to change something in the block number one what's happened I must change the block uh I change a transaction in the block number one it means that the hash of the block number one uh was changed so the hash of the block number two must change and three and four until the blocking number 100 this is difficult and this you be more difficult if you have different computers that have the same database the same copy of the blockchain because they must agree they must have a consensus on that it means that this is impossible almost impossible and because of this we used to say that the blockchain is immutable because when we have a lot of blocks after the block where are your transaction and there are out the consensus and the cryptograph proof of that uh you cannot change nothing the past anymore and this is the security part of blockchain that uh really it's fascinating for me and like I said we have transactions in the blockchain we have a lot of transactions and these transactions mean something it's like a state machine and I used to say that a state machine is like photos so each state is a photo so if I'm here this is a photo if here I must come back to the mic if I'm over there it's another photo so what must happen from that photo to this photo to this be changed to this be updated I must have a transaction that made that this transaction for me this change of state for me so it's this when we are changing states I I can change some balance here I can change some information but all the states are photos and we have the blocks in the middle that are updating the word State this is a view of blockchain for you and remember that we have these in a decentralized way because we have different nodes operators that has a having they have a cop of this and they are checking out the transactions as well and this is what web3 when we talk about web3 we are talking about the evolution of web so the web one is uh we are most reading things and then we came to we through to when we are producing content like in the social networks and now we have the web3 without this content in a decentralized way and you are ready to create your first wallet so what is a wallet first of all well uh the best definition it's a key manager because when I talk about all wallets I me uh talking about public and private Keys the public key or the address is derived from the public key is the part that you can share with everyone like share your bank account to receive some money is this but your password is like the private key is the part that you never ever can share with anyone and the wallet is managing just to us because the private Keys used to be a long words and symbols and hard to say uh so if you have a key manager or a wallet it will be better for you and our first exercise is exactly install a wallet we are installing metam mask and yes welcome H Andre and C welcome welcome so this is the link of metamask so if you are doing this with me you can go in the pad now and click on the link of the line n and this is open metamask for you okay I used to install this from zero I'm not doing this now because I have another wallet that is ready or let's see maybe I can do that yes I have enough here so what I'm you doing now to do from zero with you I'm really uninstalling mine you don't need to do that okay so I don't have metamask anymore and I like you I am a really beginner starting from zero so go to the metamask website download and then install metamask for Chrome here we are it's downloading it now then I can addit to Chrome and add the extension wait a minute yes in a few minutes I have um it's downloading now and this is a great moment to test how is the network here in the hackaton because I put a lot of people to download things in the same time and here we are I am a metamask so I I'm a green and create and new wallet so I agree with this as well I can create a password uh and this this is important like in the bank if you lost your password you can ask anyone here no if you lost it bye you don't have your phones anymore so be careful in fact it's not exactly the wallet related to this what is important this part and really two points for you first uh now maybe your friend or the people near you can see your s phrase your recovery phrase um and because of this and because we are learning we are using this wallet now only to test net don't add the real funds here because someone could see your s phrasing now and could um like steal your money later okay so this is for test okay and this is a good practice never adding the same wallet real money and real cryptocurrency and test net uh cryptocurrencies okay this is so and another point is never ever do what I'm doing with you now okay because I doing this because I teaching you and I really hope you that you not steal my tokens later okay let's see but I may reveal my seed phrase to you and this is the most important part of the wallet and you never can do that uh okay if you take a picture I will I am not using this again but this is the point you never can share this with anyone okay I'm copying like here and this this okay next I must be sure that I have this done so I I must get this probably you are doing the same this and what is the number eight this is the four five six seven eight yes and how good now I have a wallet and next next I will not go to the details and I got it I got everything now because there are a lot of things to yes this is my wallet okay to be sure that you are good with me I'd like to ask two points uh for you now and I I have a document that I can copy some comments to help you so now first we must go to the test net and let's set this for you how are we going to test to the test net here in the left side up left side up corner I have this show test networks so I enable the test networks now and I'm clicking and selecting seia seia is the test net from eum okay e is this now ium I'm good now and to be sure that you are doing this with me can you share your address with me like I can get my address here I can see the account one over there and click copy and then I can paste this for you remember that this is the public part so this is if you'd like to send some cryptocurrency to me you must send here and if I'd like to send some to you if you'd like to receive something you can share your all with me now as well and I i' like to know if I have more people doing yes I have you one nice thank you Geral are doing as well amazing congrats guys you create your first wallet now yes first step we are ready so let's go forward now that I have my wallet I come back here to the presentation a bit more what is the difference between the mainnet and the testet so the main net where the blockchain uh in this blockchain the funds are real it means that if you try to uh change Swap this money or this token this crypto currency to the fat money that you use uh and you get in the banks you can but on test net test net is for free test net is to learn and to develop your projects without paying nothing okay so test Nets is exactly it's used to have the same behavior of the main net but it's free this is the the most important part and okay I have in my wallet what I need now I need tokens because I paying I me paying fees to have my transactions be confirmed in the blockchain and I paying this using the nativ cryptocurrency the cryptocurrency that is used to be minted when we have new blocks okay and we are on a now a seia and the cryptocurrency is calleded ether okay so we have the fet to get this and the fet is the place to get this kind of things I added two options for you this is one from chain link generic but because we are all in the same network so probably the first person can get it and no one else can get because the same IP so I have this another only to us to use it during the hon okay don't share outside and let's share with you the password we had using the second one okay hey we have our so James Jack and Andre congrats guys and this is this is the falsa that we are going now this is the password okay and you can get for now you only need AUM but if you can you can get link as well this is the fet okay and you can see here that I am yeah I'm adding my address here and like you I'm doing this from zero so let's copy the address add here and then I be getting 10 link and 0.5 eum link is the token from chain link it's because I work on chain link you can get this as well but we are not using link now now it's only it send the request and this falet is prepared to all of us do this in the same time so we can do that and in a few minutes here we are for each of these I have a transaction hash so what is a transaction hash remember that we have the blockchain we have the transactions and the this is the blockchain Explorer the blockchain Explorer it's a place where I can see the transactions remember that the blockchains are public spaces so anyone can get this and the is disc this is not the blockchain itself this is a private company or a it's a good company I can say but this is a company that has a copy of the blockchain and they get this copy of the blockchain and uh copy to another database index database a normal database and in a way that is easy to us to search wherever like search so this is the block Explorer I can see that this was the block was transaction was minet this was the address of the fal this is my address and I receive 0.58 and this this this is the Block in this block we have uh 150 transactions 110 contract transactions you can see everything over there and this this now that you have uh I already have tokens let's see if I have it yes if came here I have 0.5 SE it I'm so happy with this and let's come back here a bit more oh I talk about this block Explorer for you and let's talk about smart content and be ready to create our first smart content so what are smart Contents I used to say that the smart contents are computer programs normal computer programs but they are published and and executed in a blockchain environment and remember we talk about blockchain and blockchain it's immutable so this is much content after is deployed is immutable you cannot change the search code anymore and we used to say that this is this happening in an autonomous way when you call some function in the smart contact it will be always executed when this so exactly this when it's triggered col you'll be executed and know intermediaries no one else can stop your function anymore this is the point is in the blockchain you cannot change you cannot stop it anymore if you didn't prepare something to that okay and to create our first smart content now we are using remix so remix is an environment where it's uh where you can create as smart content and you don't need to install nothing in your computer what I love about remix is that it's in the browser so it's so easy to use and let's go over there I think I have it here yes here is remix and it's important to you to oh let's uh prepare this for you first here you are you can click on remix and we are uh preparing the environment to us first so on remix I may this is so small for you better now I think better on remix first of all I we going to the icon number four I used to count this being the first okay 1 2 3 4 and you can see that I have the auto compile enable Okay do the same this will be easy to you when you are creating the smart content to have your content ready and compiled ready to be play published it okay then I going now to the next icon deploy and run transactions icon number five deploy and run transactions and over there I must connect this site this is a decentralized application I can say I me connecting this site with my wallet exactly on this moment REM has a blockchain simulator in the memory of the browser this is the remix VM it's a blockchain simulator but I'd like to use that connected with my wallet but I know that I have a problem now probably you don't have okay because I I uninstalled my metamask and installing the game you not recognize so let's refresh mine you don't need to do that okay so 1 2 3 4 five here I am environment choose injected provider here we are and I must approve that it means that every website that would like to connect with my wallet I must approve that okay and yes I'm doing that What's happen with this remix on remix I creating the smart content remix you create a transaction the bite code of my smart wanted and then you'll be sent to metamask and metamask on metamask I me authorizing that like signing that I am the owner and signing that I'm authorizing to pay the fees and mamas get this transaction and broadcast to the blockchain to we used to say that to the main pool of the blockchain is a part where the transactions is waiting to be in a block and some validator in the blockchain you get that transaction and then uh including a block and be confirm it so next and connect in the moment that I'm connected let's share this with you so in the moment that I connected you can see here down that now I have seoa Network and a bit down this is my account and my balance okay here we are I'm ready to deploy my first smart contact with you are you ready how good do you have any D or any question until now okay let's move forward so here we are our smart contact you be col register is this okay so I'm going now to the icon number two icon number two and down we have some work spaces you don't need to worry about this now scroll a bit down and go to create a new file and the name I pasting the name is register do so here you are on the right side I have a part I space to create my content I'm copying that to you now I have it done here and in the same way I may coping to you and also sharing if you I have it in a git Hub as well but let's copy to you here and now I'm asking to copy everything that between the beginning and the end and you can see that I put two slashes in the beginning and the end these are comments and uh the comments if you copy is not bad it happen but it's better if you start to copy here okay and let's go to them to this that I have it what I have here it's a good practice to start your much content with a comment and the kind of license that you are using so I'm using the open SE license MIT then I have this command pragma to define the version of solidity that I'm using so I'm using solidity 0.8.

9 I know that there are newer versions but this is a version safe to use with AUM but also to use with other blockchains that are compatible with eum we say that it's evm compatible so this version is good to use with Bas and others okay here I have the command contct so my contract is defined here the name of my contract and everything that I have inside this keiss you be my contract over there I have I start having a string it's a variable it's a kind of box that you can put anything inside if it's a a integer for example I can only have numbers but because if a string I really can uh store everything inside this box it's a private it means that I can access this variable only inside my contract and the name of my variable is sted info then I have functions functions used to be a definition of your name so if I call this name everything that's inside here you happen like here have one comment but I can share this with you for example uh this not so complicated let's get this this is a bit complicated uh this I have a function you can see how much things I have inside the function and everything will be executed on when when I call only this and this is our goal uh on register when I get info it will happen this you receive I mean sharing I me returning the variable the content of the sted info I used to say that this is external because I cannot call this function inside my contact on outside this is a view because it's not changing the state I may only Consulting like a query this information and I returning the same kind of variable I have another function over there the set info and I must pass a parameter the parameter will be my info and in this moment I may save some information in the variable so my info you'll be uh added in the box you'll be inside my box you'll be saved in my stored info and this is our firstart content do you have any D good okay let's go forth you are ready to deploy that now so come back to Icon number five deploy and run transactions Let's uh add this for you and beside uh before that I'd like to ask you as well to be sure that if you go to the icon number four you can see that I have a green sign over there this means that the compilation is successful and this is happened only because I create I enable out compile if not I must compile this okay but I enable out compile and if I did something wrong let's do something wrong this is wrong now and now I have a red here and I can see oh it's wrong here oh okay let's fix that and it's good again okay so let's go now to the icon number five deploy and run transactions scroll probably you don't need to scroll down I know that my my my screen is big so we scroll down until you find the deploy button and click on deploy so what's happen Now remix create the transaction with the bite code the how the code related to my smart contract then send this to metamask on metamask I'm authorizing that and after this you'll be confirmed in the blockchain some moment if I scroll down I can go to this part the loyed unpinned conts and my conts are already over there so you can go to this part copy the content and I be so happy if you share this with me and let's see how I get the address of mining I can get the address of M in this way so if I scroll down here in this part deploy independent contracts this is the name of my contract this is the address each contract that you deploy in the blockchain has your own uh address and be read my photographer because I will do something to you now I need your help now to take a picture for me yes because I'm asking uh please all of you could you raise your hand if you create your first smart content now with me yes yooo yes higher higher yes thank you thank you you create your first much content congrats to you now yes amazing is this so I copy the address now and I came here and paste to you so you can do the same with me i' like to interact with some of smart contacts in a few minutes I you get yours in a few minutes yes congrats Ryan Gerald woo on basis great yes I like that and let's come back over there so if I expain my content now I can go here in the uh left side and now I can see the functions do you know why one function has a blue button and the other has a orange button do you know tell me yes exactly the blue bottles is the view is only to read and the Orange is to change the state to write on the blockchain okay and this this here I can say the information that I'd like to add here it Global Cy this is my information now I'm clicking on set info and do a new transaction on the blockchain same in a new transaction to save this information in the stored info variable and if I expand this a bit more I can also see the transaction here when it's confirmed is it still painting you can see this part and I'm waiting yes it's confirmed now the green button and let's get get the get INF for now yes I have the it Global Sydney ready now and it's here I have a question to you can I update this information now what you think yes yes and uh why I cannot change the search code if I'd like to add some new code here I can't if I do that it'll be a new smart contact but if I'd like to change what I'm staring over there I can because I can call the set INF for how many times i' like to do that so let's add it Global sign by saw or whatever you can write other thing over there and set info confirm and wait the confirmation here or I can see the confirmation Happening Here in the Activity part is pain as well or another tip if you go to the puzzle you can pin the metam mask and see here as well and okay I must got it a lot of things first okay now it's confirm it confirm it confirm it and let's go to the get info yes it Global syy by Soul so I can change this information how many times I'd like to do that it's so easy but the next point that I'd like to tell you to teach you is uh you we have a lot of smart content already deployed in the blockchain how can I interact with any of these conts there are two ways if I know the ABI of the smart content the ABI is only the it's the application binary interface is the definition of the function only the definition but not the search code that I have inside the function okay this is the Abbi or if I have the search code all the search code like we have now we can use that and because we have the same search code I can interact with any of your is not content so uh Ryan I'm where are you I yeah yes I'm using your contact now okay I copy the address of ran contract uh and come back to remix now I'm not deploying I'm using this address um button so paste and then I can click on it address I I'm creating another instance of the register but this second one is not mine it's from Ryan let's see what he did here oo yes it Global SE by Ryan amazing yes but I you change your information now so so was here and I'm clicking on set info so you can see now that I'm sending a transaction to his smart content is not mine anymore can I do that can I change another smart content on the blockchain o yes I can and here could you tell me if it change for you as well yes change for him yeah and this is a important point to you to uh be aware of be careful related to the permissions in the smart content in this content your first smart content we have no permissions everyone can come here can change everything it's like everyone can interact with your content and change the information but uh when we have another kind of business you must take take care of this like imagine that you have a Alo list and only only that list of addresses can interact with some function this is important to you okay be care uh careful about the permissions and rollers inside your asart content and um I have more time so let's go forward I have more things to to you so we did that this is the register so we have as as well this is in my GitHub if you lost it and this is some tools that can help you and let me go to that tools now and in fact I'm collecting a token now I have time so let's do that so this is the wizard from open zapping open zapping is a secured company and they AIT SM content and they create uh some uh like trustable smart contest that we can use and this can be help to us so the are C token is the fible token that we used to have and this is I standard I standard is not a obligation a standard is a agreement a suggestion that you can use if you like to use and why the people use this kind of Standards to talk the same language if you know that a token is erc2 token you know that to transfer token you must use the a function called transfer cannot be transferring if youd like to see the balance of your account the function is called balance off not balance from and this kind of things are defined in the standard and are the points that H if you are telling the word that you token is compatible with this standard I me try to get that fun on your contract and I should have it done okay this is an agreement between people in the same way here C20 is for fible tokens it means that it's like two tokens have the same value it's like to have two $100 bills and if I change one to another it's the same value but if I try to do an ERC 20 uh ERC 71 token this is a non fun toen we used to say that they are the nfts and on the nft when you create the content the cont is a collection and each item inside the collection has a unique index like 0 one two and they are unique and they can have different attributes different images different informations because of that we used to say that they are unique and they can have different values okay and this is a good way to you to start if you need to create a token in the hackaton or an nft in the hackaton this is the best way to to start in fact using that I create one that I'm sharing with you now let's go to the Token part so we did this I interact with your contract and now I like this is are the references related to uh to tokens okay at least to the erc2 Token this is on this is not on my presentation anymore so get here late let's create a token how can I create the token my token is a bit differ different from that from open zapping my token has it's minable so after I deployed my token I can mint more tokens I'd like to have a rols so i' like to control who can Min tokens and what more not the permission only the rules and I could change something else over there in fact my token has only uh do you know that eum ether has 18 decimal places yes my token you have only two I'd like to have a token like a fth Monday like usdc yd only two uh decimal places so I'm changing here this I have it the token here so let's open the token including that I must copy this for you if You' like to create your own token you can do that as well and uh update the token info if you are doing that you can update the line 10 so imagine that I doing this now this is the token that I create two days ago now I have the it glob uh Cate token so it will be the ETS token and this is and I'm using that standard that wizard the only thing that I did different is the decimal places all the other part is the same and you can see here that I have a whole colored minted roll and only the address that that adding this minted roll can mint tokens this is our goal and I can deploy that now let's go here go and if I click on the play now you have it this toen now confir and probably in a few minutes I have the token here if you are creating our token you can share that with me so let's see what's mine yes here is my token and now okay I have a token I you like to add my token on metamask how can I do that if I copy again my token address came me to metamask and go to the tokens stab over there here I have the import tokens part paste the address of my token you can see that this symbol was detected two decimal places should appear here and import now I have my token oh but I don't have tokens yet let's mean tokens get my address go to the contract expand it go to the mint expand the mint to my address i' like to have 100 tokens so 100 how much decimal places I have two so I must add two zeros because of the decimal places click on transact and now I can confirm and in a few minutes I have more tokens here yes it's confirmed if I come back yes you can talk yes let's do it so here on metamask you go to the tokens Tab and then you have the import tokens over there and here you can see that now I have 100 tokens yooo my tokens here so this is uh I was expecting to stop in the first smart content but I have time so let's go forward and another point that is on my presentation this is so useful to you chain list.org and why this is useful because we have other blockchains here and maybe we are not only using ethereum seia but I'd like to use basy so H I am here I'm including the test net because I'd like to have the test net from Bas and if I add Bas here I can find the Bas SEO test net and added this to my wallet but in fact it's not working the B okay they are trying to send a wrong RPC I did this man today but I can also go to polygon like we have one guy from B over there and we have Jed from polygon over there as well so let's go to polygon and I can add polygon but I'm not on Main net I am I like to use Amo the new test net and this this I can connect the wallet and do the same process here we have all the networks and this be useful to you the third tool that is so useful to you in the haon you must speed up everything here we know that and sorry you are not sleeping too much this is normal uh you can sleep on Monday okay so go to SCA scaffold it and here we are on scaffold it you can clone this rapple and this rapple it's a a huge template with a lot of things that you can do okay so like that if you go here you can see that you have Foundry we have uh Vim you have packages you have more things around and you can see more branches and uh some examples like they scaffold it version one this we have uh something like uh create a ticket nft or us AI or ABI or something like uh Crea what is a banana bricket I don't know but you can have uh buff Corners this is so cute bonding curves and you have a lot of things here that can help you okay so this is so useful to you I can add this on the slides directly this is the the old version but the examples in the old versions okay and um is this congratulations you create your first smart content here I'm so glad and so happy to do this with you and uh what you learned today you create your wallet you learned about about the blockchain fundamentals you create your first smart content and also a token and I can say thank you to you and I be around you know that I from chain link we have a boo over there so if you need any help you can go over there not only related to chain link I can help you in your smart contact as well if you have some D I can try to help too okay so is this and good luck in the hackaton guys see you [Applause] around uh do you have any question yes ah yes let's do the mint again I can do with you so why I came to do the mint I came to my token expain the token and here I have the mint function it will be easy to you if you also expand the mint function and this used to used to be empty here is the address who is receiving uh the token so I'd like to use the address of my account so copy from metamask the address of your account and the amount if I like to mean 100 is this but also remember that you must add the zeros the decimal places so I must add two more zeros because my token has two decimals and now click on transact say do you got uh tokens in our fet go to the faet I have a faet to help you and it here uh what's can I see your uh is your address can I see your address what is your address here do you have your address what's your name Jackie okay let's see you let's see what's happen if you I love to do this life because the people can learn if this so I'm going to the block explor anyway I came into a transaction I have six minutes I can't be here so this is uh Jack address and you can see over there that he create two content so this is your token I can tell that this is supposed to be your token are you check your token now are you add your token on my m ask the g g WT is this is your token yeah so you have a token the token is right and oh I forgot to see if your address has uh funds uh yes you have a 0.47 probably be sure that you are on seia now maybe you change the network in a wrong way and you must back to seia and here on seia so if I did a second token over there with the address this is your token this should not be a problem yeah and uh let's see the decimal are good the the name is the it Global C Day token good I like it and you can came here is exactly the same I cannot mint tokens because I'm not it's your token like I don't have a permission to do that only you can me tokens if I try I can't but I can see with you late so are you finish and then you have this the access control so you have you are trying to use a different wallet to me the tokens okay they the only wallet that can mint the tokens now is the wallet who create the token this is the point yeah and I can share with you like I have another uh another example call token shop that this is a a token shop to Mint tokens you can try to use that but know I cannot do this in four minutes so I finish this now I think we are good now and I can see your uh one one okay so thank you so much [Music]

Automatic transcript — names and jargon may be misspelled.