Solidity in Hindi: Updraft Study Session, Part 3

Cyfrin Updraft Solidity 101 Study Sessions — Hindi · 1:57:56

Continue the Hindi Solidity study series with a practical recap and live coding in Remix. Ghulam Rasool works through contract setup, variables and functions, visibility, arrays, structs and mappings, then deploys and interacts with example contracts while answering learner questions. Take Parts 1–2 first, or arrive with equivalent Solidity and Remix basics. This is a guided practice session rather than a complete standalone course.

Speakers

Topics

From Cyfrin Updraft Solidity 101 Study Sessions — Hindi, hosted by Cyfrin.

Transcript

[Music] [Music] [Music] Hello. Hello everyone. Welcome to Cipher Updraft. My name is Olam Rasul and I am a ambassador here at Cipher Updraft and it's the part three for the solidity 101

session or session pure and Hindi without any language barriers. beginners first programming language then also it's not a problem. So let me share my screen with you guys.

Yeah. So I think it's visible. Hello. Hello. I am at the doctor. No problem. Do we need to do anything? No, I am at the doctor but I will join in soon. No problem. You can take your time and join as soon as possible. Is my screen visible? Yeah, perfect. So,

like we are going to study it in a bit more from beginner level and blockchain basics language and No worries. So yeah, solidity oneonone in Hindi powered by cipher draft.

Soidity versions variables data location functions visibility then read only functions structure functions mapping and constructors and to I'm waiting. So please let me know when we can start. Okay.

So basically repository using YouTube one minute. It's like resources resources required comment share. Okay, where is the G? Okay, so here is the GitHub and let's

let me share another ones. Okay, so perfect. So check out but yeah so repostory then you can use this GitHub repository the links the tools and everything and second is uh not only this buttad at GPT or

find comfortably and I recommend both of them to you and yeah or exchange answers like what issues you are facing and you can go you can get answers to them like it works as a stack exchange but it's in the Ethereum site so it's ethereumstack exchange.com so let me share this in the comment Okay. Okay. Perfect. Now let's see andidity.

Soidity. So EVM stands for Ethereum virtual machine. Uh it's like computers blockchain ecosystem blockchain ecosystem like nodes machines etc. I think Ethereum I hope you guys know. Okay. Then what is solidity?

Solidity is a highle object-oriented programming language designs for writing smart contract and it's a it's run on Ethereum blockchain. That's the main reason that we use solidity to write smart contracts because we are working on when we work on Ethereum virtual machines we need to use solidity or wiper. So solidity is a good one to start prior experience JavaScript object-oriented programming language. So then solidity will be much more easier to understand comparatively similar JavaScript. So let understand it very clearly

like transaction current that every transaction it is based on a promise like internet service every month then you can use the internet. So similarly as we guys know blockchain is a very trusted kind of technology contract. blockchain securely run and

everything is been recorded without the interference of any third person involvement smart contracts deploy. It is like a contract is decided initially then you need to sign that contract and yeah everything will be ted by the uh smart contract and there is no not any involvement of any third person. So like we use VS code, PyCharm etc. For Ethereum uh sorry for solidity we are going to use remixium. So

remix and comployment. Okay. And Ethereum interface. So here is the compiler or deployment. This option is for deployment. This is the compiler and here are all the files that is that is already provided by remix. So let me delete them one by one. And this is the fresh remix page like I think. So yeah.

So create a new and when you click that you can create a new file name my contract maybe. Okay. and my contracts determine smart contract solidity through basically contract MIT GPL general public license and BSD3 three cloud license unlicensed but it's not recommended license the

mostly suggested license is MIT so let me zoom in a bit so that you guys can see okay perfect spdx license identifier MID so yeah here we go so smart contract which is an open source license and license then you can add license by using this command spdx license identifier and after that you need to

put a colon and provide which what kind of what kind of license this code is using I mean this smart contract is using then about solidity versioning So solidity versioning it's like the version that your code is using for of solidity latest version it's 0.8.29 and yeah it's the latest version of solidity. So solidity version solidity then your solidity version 0.86 or maybe 26. So this is how you define a solidity version

but specify solidity like paragma solidity direct version name 0.8.26 then second thing is paragma solidity 0.8.12 so it's like upper arrow to it represents any version above this like in future updates our compiler will update it automatically. So let's add this thing. Yeah. So this one is the recommended one to use. But there is another one like you can specify like the version should be greater or equal to 0.8.4 but lesser than 0.8.28. But yeah it depends and your code will only learning

only work in that conditions. But generally I recommend uh method any version above 0.8.26. So then we can simply go and create a contracts. So create first contract. So we can create it like contract. Okay. And let's name it my contract. Then curly braces.

And that will be our code. Your code goes here or contract inside that goes here. Okay. So here is my contract. Then contract that is your contract. So check out variables. So like in boolean string address.

So representat sorry stand for unsigned in integers that means they can only contain a positive value. Okay, positive value like they can contain the numbers but only the positive numbers and second one is int that means integer and they can contain all the values from negative to positive. So yeah negative values to positive values like can contain the numbers.

So yeah, then only positive numbers contain or integers both positive and negative. And boolean is a special type of data type which used to represent true or false for a condition. and string general in form of characters or words or sentences use under uh quotations and So yeah these are the variables then how it works.

So define in 256 how this thing works. So 34 and let's name it as my number. So it's like unit 256 variable or my number and that is 34. So yeah, it works like that and contract compile minute like if I change it to uh 0.2 19 maybe 0.8.19

then red error this is because current compiler that is not accepting this version of solidity. So version like 0.8.19. So then this error should go probably it should go and check. So that means auto compile the code again and again but yeah you can check it on if you wantatically 0.8.19 8.1 and it will update accordingly. So

here is the unit 256 my number and it's 34 and let's add an integer. So okay and it's go my integer save and you can store a negative value maybe 34 or maybe 245. Okay. And then about we can use like boolean. Okay. Boolean my boo. So it can store a value like true and yeah semicolon. So autocomplete because it's autocompleting

my code. beginners suggested automp but yeah so this is how boolean works then string and addresses be so let's add string and let's name it my name and it will store a value and you need to add perfect this how string works then you can store an address be uh my address maybe then about uh let's take a demo address maybe this one. Okay 1 minute. So you can add

anything like 0x 42 letters wallet address but we will look for address when we go ahead when we proceed ahead deployment solidity then when we go to the deployment at that time so yeah and question so you can ask hi guys hello great we're awesome I'm waiting for that. Any questions for me? So you can feel free to ask. Yeah, it's basically hash like

Ethereum address. That's a 42 characters based address which we use and let me add metam mask. Okay. So let's go ahead. These are the variables. Then here are the storage types. So yeah storage work. Okay.

And quick comment [Music] I don't think there are more comments. Okay, so let's get

started. Okay. Sorry. And let's get started. So 256 it's like okay 256 power number that number minus one it's like 2 ^ 8 - 1. So this is how this is the amount of characters that you can use. For example, if I try to store a number like maybe 344 and let's write a function to

call this number. Excuse me. function get number unit 8. Okay, sorry we are calling it public view returns.

error because unit 8 can only store up to 255 characters. Trim this. Sorry guys. And yeah one minute. Excuse me. Al if hello if are you here? I'm here.

Can I get a five minute break, please? Yeah, of course. It is your call. Okay. Sorry. No problem. Hello everyone. Sorry for that delay but

yeah I was getting continuous sneezes. Extremely sorry for that but yeah let's continue and function get number and unit 255 accept if I change it to 255 then see the compiler is working completely fine and deploy you can use any kind of accounts okay and then estimated if I delete the recent contract and deploy a new one.

Then create number. If I click that I can get 255. But if I increase it by one like 256 it is not going the compiler is showing the error like type error 256 is not implicitly convertible to expected type unit 8. So unit 8 255 numbers contain because 2 ^ 8 is 256 and then minus 1 is 255. So large numbers contract. So then we can take it as 256 then it should work perfectly fine or return function 256. Perfect. Perfectly compile. Then

let's deploy it again. And yeah, here is the deployment part. Uh get number and you can get 256 as my numbers value. So this thing work like this. And memory and storage we can get to know it much easier. So yeah, any questions for me?

Okay. Ch. So y - y - one. Yeah. So it's a rule basically 8 digit like you 8. So then it's 2 ^ 8 then minus one. Okay. And this is how 256 works. So if you want you can add integer strings with the same method like integer my number and it's value change minus 56 maybe and yeah so it's it will

work perfectly fine. So basically storage blockchain that is into the three types. First one is memory the temporary data location used during the function execution and the variable store memory that exist only for certain time period and after that it will be get erased. So yeah memory is useful for handling dynamic data structures like arrays when changes don't need to be stored permanently. So or memory gas efficient like it will cost you less gas when compared to storage storage but Memory memory is the best one to use but it doesn't stores your data permanently

on the blockchain. Memory data blockchain so then you can use memory and storage is the permanent data location used for state variables and since writing to storage is more expensive in terms of gas cost. Yeah to make sure it should be efficient and and call data is an immutable temporary data location function argument like if you want to provide certain input for a function then we use call data smart

contracts that's why we use data there and and functions. Yeah, the function programming language like it's basically a it's basically a function is basically a thing that allows certain that works when a certain conditions happen like function value. So it works like that. And this time we are going to

create a function that will take input from us and give us an output. Okay. So let's create a function. Okay. And let's name the function add number. Okay. and brackets condition like we want a unit 256 sorry int 256 as an input so number it's a public function then curly braces variable 256 update that

with the input we get from the user which is underscore num. Okay. And it's compiled. Let's go and deploy this thing. So okay. So let's add a number here. Uh minus 45. Add number. Okay. And as you can see here from this contract address to this contract address a number has been sent terminal. Okay.

Actually like how much gas it has been used to call this function and execution cost. Okay. So you can use this terminal window to check what is going on at the time of deployment. Okay. Or actually value minus 45 enter key that is inside our variable integer 256 or not. So another view function. Okay. Number. Okay. Integer 256. Oh, sorry. So it's basically a view function. So we don't require any kind

of input. Okay. public view returns or integer return like integer so integer 256 perfect and then let's add the curly braces and let's return our updated variable my that's it deploy add number minus 34 let's add it

and let's get the number see it's displaying minus 34 I say number add like maybe we can add 89us 89 add then again variable view then it's showing 89 so yeah 256 number then function users input integer 256 then number function number.

So then if we go back to presentation. Soil. So visibility means contract whether owner contributor anyone can call your functions publicly like there is no issue of usage of functions like function. So yeahility and then

privility internal contract. So it can be present there too. Majority of the time public be but as we move on advanced level we can use other type of visibilities too and external is when someone's call a function from outside the contract created function so then we use external type of visibility there and about what is view and pure soility Okay.

And then I was able to add the number into this variable. And so get number it is only a read only 256 call out. So yeah, view and pure read only functions and then view is only used to see data and pure only does the calculation like numbers addition. So then you can use uh pure instead of you. Okay. So it should work

like that. And or question. Okay. So far so good. So strrus. Strus important concept solidity. Strs are the functions u which groups multiple types of data like extract use. You are creating a new kind of data type which stores different types of data types like create student and that student data type is storing a string and a unit date. String is the name of the student

and unit is the role number for example of the student. So multiple values of different data types and different kind of data type. Okay. So let me clear this things. Perfect. So basically strct or let's create a strct by person. Okay.

And there are two things to noted. Okay. Single data. So that's why we use strruct but use x a string okay string and let's call it name okay and then I can use maybe an address or maybe let's use a unit 256 to store some kind of a value maybe your mobile number Okay. So you

can store it like this and strct create this if person or number maybe let's take it role number instead that would be much accountable. So yeah string or unit 256 name and role number we are using both of them. Okay. And then it's like the list like it can store multiple values of a data type. Uh like it can use maybe 10 values or maybe

20 values. It depends on you. And value enter the first value starts from zero then it goes to 1 2 3 till the till how much values you store but the first starting point is zero from there the value gets started so let's add a array so unit 256 okay 256 then like list and yeah this is how array works

and concepts different kind of things throughout this session and next mappings but Yeah, you need to understand it. So mapping basically data type combine store solidity mapping is special data structure that works like a key value store similar to dictionary in Python and hashmap in Java. It allows you to store and retrieve using unique keys. So for example mapping strings 256 map like for example And

then maybe so they both are combined like this person role number is this or this room number belongs to this person that's how mapping works. So mapping example mapping okay and string and is equals to then greater than symbol string to int 256 mapping create then be publicly call and let's name it as person to number maybe something like

that you can use it like that. Perfect. So this is how mapping works 256 and we have named that mapping as person to number. Okay. And then about we can use constructor to constructor basically a special type of function that initializes the contract start at that time only at the time of deployment like when you are initializing the

contract owner name then string memory like name and then owner name at the time of deployment. So it works something like that. So let me show you live how it works. String public uh my name. Okay. And then Okay. And basically it's a type of function. Okay. string

and memory which kind of generally gasimiz okay and_ name then we can go ahead and update my name okay with name like this. So compactly open a

magnifier deployment. So let's add a string maybe my name and let's deploy this asployment. So constructor works like that and few projects and one by one things understanding practice. So

let's go one by one 256 variable A. Okay. or let's close it or unit 256 variable B close it okay so 256 then function to add values to A and B okay values and from here.

Perfect. Okay. So, UI 256 A can do it afterwards_B then. Perfect. And update. Okay. as underscore A then we can update to B_B. Perfect.

So add values. Okay. So the contract deploy. Okay. It is asking me for both the values. If I ask him two three add values and perfect the transaction is successful. So return okay function get values and

public view that returns turn this rate 256. Okay. And return A. Okay. And return B. So Oh Okay, sorry problem. I was calling two functions together. Okay, perfect.

So deploy. Okay, so five then I can add another value seven add values and I can get the value of a as five. Okay, and return. Okay. So, 1 minute. Let me deploy the contract again. Three and four. Okay. Add them. Get value four. Perfect. So, this is how it's working.

And 5 minutes break. Then addition, multiplication and mathematical functions. strings or integers and it's 655 uh 54 now actually. Am I live? Yeah, it's 53 actually. Sorry. And we will connect back at sharp 6 and then about deployment. So yeah, let's take a break of 5 to 6 minutes approximately. All

right. Okay guys, welcome back. So,

Let me erase all of this. And I have just realized We have two options. You can understand everything in detail if you guys want. And if not, then we can go ahead. Oh, thanks. Well done. Hold on. Thanks. And hey guys, anyone from Hyderabad city?

Yeah, I am from Hyderabad too. Will there be a recorded session of this? Uh yes, it will be on YouTube live stream. Okay. So I think project sheet. Let's start building it. Okay.

So, create this string store name. Okay. Then I can store a person's marks in physics. Maybe maths. Yeah, you can store physics marks, chemistry. Yeah, perfect. So you write 256 to store a person's physics marks. Okay. And another unit 256 for maths.

And another one for chemistry. Perfect. Okay. And student perfect. So basically like string name and unit 256 for storing the marks. Okay.

or kind of project we can use certain criterias to fulfill like if you want to pass out in every subject you need to cross maybe 35 marks and in total you need to get at least 150 marks. So function and project. So so let's get started. So like as an array, okay, student and that is an

array. Okay, which is public and we can call it I think students students that would be easier. Okay. And let's start creating a function to add all the values to it. Okay.

function add values. Okay. and values like name then about U 256 L byore PHY for physics okay and we are going to use short forms okay and say in 256

underscore math and orient 256 for chemistry. Perfect. So what we have done so far is function values from the user. Okay. And what we can do now is we can push this things into uh into the array which we have created like here. ibility then let's go perfect okay

and student okay dot push okay uh the push basically any kind of value so students and that to with certain values not student. And let's push it inside our strct by name student. Okay. And student is the name of the strct. Then inside that we can

add a name. Then we can add underscorephy. Then we can add underscore mat. Then we can add underscore chm. So yeah. Okay. So okay. string public.

Yeah, storage. Remember to put an option as memory. And it's working perfectly fine till here. Let's compile. Yeah, it's already compiled. So let's try to deploy this thing and check if everything is working fine. Yeah, add values. Okay, let's add some demo values. Then after that 45 67 87 add values and Perfect. It's showing me that on zero we

have a person with string name Hulam and he's he has code 45 in physics 67 in maths and 87 in chemistry something like that and if I add more values let me pick some of the names from the comments mamill yeah yeah let's add muzil okay and let's push your mark so let me change it to 95 35 and 87 and 97 maybe. Yeah, let's add the values and okay. So here if I want to check if I hit zero and check this

option I'm still receiving my values because in the array which we have created by the name students array starts from zero at the point zero uh the values have been stored for hulam who has scored 45 67 and 87. But if I want to check the values for Muzil, I need to update the index and I'm going to write one. And yeah, I can see the values of Muzil now. Muzil and physics 95, 87 and 97. Let's add another person maybe. Uh let me pick another name. N okay, perfect. So is add then if we call

number two you can see n and 95 97 97. So this function is working perfectly fine. Now what we need to do is we need to perform some certain calculations like some certain conditions like if you have scored this much marks then you you are passed and something like that. So, so let's go ahead and let's create another function and this time I'm going to name it get students. Okay.

Or you basically uh we can use an indexing system like index indexing means if you want we can use indexing system yeah into 56 okay and is use as num I think I haven't used num anywhere yeah so yeah then visibility public and we are viewing and returning a lot of values. So returns public view returns

and okay then we need unit 256 marks for different subjects. Let me calculate how much unit 256 are required. Three for three math, physics, chemistry. Three. And then another one for our index. Okay. And so let's then add another three unit to 56.

Okay. and another unit 256. So this is done for maths, physics and chemistry. Now we need to add another unit 256 to return the value of index. Okay, three a minute. Let's go. So unit 256 for index and at last boolean uh because we need to display whether the thing is true or false. Let's go.

Perfect. Inside the function, let's add our logic. So basically logic simply total marks to physics, maths or chemistry that should be 150 and every subject should carry not less than 35 marks. So then you are failed in that case. So then boolean will return a false and if you are pass then boolean will return a true.

So indexing student memory. Okay. Then we can use names as an index. So square brackets represent and yeah and we can add indexes because function call that is on index. Okay.

And this is okay. So we are not calling the index actually we are calling the num. Perfect. And there is an error. Let's see. Warning unnamed return. Okay. Unsigned. Okay. Okay. Okay. No problem. Uh let's keep adding the code so that it would get perfectly okay. So event 256 total marks display and that should be equal to all sum of the three subjects. Okay.

So student memory maths physics or chemistry values. So s domath okay then we can get s dot physics I hope yeah the values are same but the first initial letter is capital I think so yeah okay and we need to add all three of them so that's the main I think maths,

physics, and maybe dot chemistry. Perfect. Seven compilation errors. But don't worry, we will solve them one by one. total sum should be greater than or equal to 150. So boolean okay PSD passed okay and that should be equal to when the total total unit

256 total should be greater than or equal to 150 marks. Okay. Or perfect as to then it's true. Okay. And now every subject limitation should we add limitation to every subject like 35 marks should be at least in each subject. What do you guys say for that? 35 marks limitation. So and and 35 marks should be there for each

subject. So what we can do is we can basically math s math key s dot math that should be greater than or equal to 35 a condition. Okay. And same goes for physics and chemistry. Okay. Same goes for physics. So, and and s dot physics it should be greater than or equal to 35 and ant s dot chemistry should be greater than or

equal to 35. Perfect. Let's return the values now. I think perfectly. Let me revise once. Huh, perfect to be return values. That's it. Okay. So, let's return the values now. S name. Okay.

strct name. Okay. Then a s dot maths a s dot physics. Okay. Then a s dot chemistry. Okay. Then total complete marks including maths, physics and chemistry and with a boolean to

boolean by the name. Perfect. And yeah see there are no errors now and we have written this first good quality of exceptional code and we have done a great job here. So contract smart contract data type by the name then three values 256 regarding each subject. Then we have created an array by the name student uh

sorry by the name students and this array contains our strct student values in it. So function values add one by one. So you string memory name it is taking name and input from the user. Okay. Then 256 for physics 256 for max 256 for chemistry. It is taking four inputs from the user. One is string and three are unit 256. It's a public function. Then what it does is it's p it push the value of the inputs into our array and strct.

Okay. So here is our array. Then we are using push command to push the values inside strruct by name student. And inside that we are going to push them one by one. String then physics then maths then chemistry. Then we are using a function we we are creating a function by name get students. Here we are taking unit 256 num as an input. Okay. And public view returns. And we are going to return string which will be name 256 maths 256 physics 256 chemistry and another unit 256 for the total. And we are returning a boolean which should display true true or false if the code uh sorry if the

particular student have passed or not we are using boolean for that. Then in student uh we are using a memory s. Okay. Uh which will put the uh which is going to put the input which the user have provided in the array name students. Then we are going to display the total marks like including maths, physics and chemistry. Total marks 150 and marks of maths 35 physics. So then this boolean will be true. Okay. And return all the

values with name with math. Okay. and with physics with chemistry and total marks and with the boolean okay so let's deploy this contract here this is on a virtual machine ID and we have one of our we have a lot of accounts and we are using one account99999 536 something ether okay and contract Let's deploy it. Okay, let's deploy it now. Perfect.

So, you have the values one by one values add. First will be my name. Okay. Then second value will be my physics mark. So, let me add 45. Let me add 34. in mathematics and let me add 78 in chemistry. Okay. So if I calculate them 45 + 34 + 78 we are getting 157.

Okay. Let's add this value. Okay. And let's add where uh the position of the student in the string get student. So yeah it has declared about all the values my name my marks okay physics chemistry uh and sorry physics maths and chemistry then the total 157 but the boolean states false. Why false? Because uh we have uh it is showing false because 157 is greater than 150. It should say true right? But no there is a problem. We have added a condition here that every subject in every subject the student must score above 35 marks and here in mathematics I think so no in

physics I have scored 34 which is not a good thing. So it is showing false and I have failed this examination. Okay, let me add another person. Okay, let's add his marks. Okay, 87. Add values. And this person is at the location of 1. Okay. Male 78 999 87. And the total is 264 marks. And the boolean is displaying true. So that means this person has been passed in the examination. So we have created this complete mark sheet contract. Okay.

And I hope each and every concept we have covered here like structure arrays. Yeah, we can do another example if you want in mappings and or else we can proceed towards the deployment. You are using Patrick Colon's courses and spamming cipher updraft. Sorry, I didn't get that.

Okay. Yeah. Because cipher updraft is created by Patrick Collins. So I think sharing his resources is a good option. Okay. So let's do the deployment for that thing. So for deployment we require a wallet to transact with our smart contract. Okay. So we are going to use MetaMask and I have added the extension of MetaMask. If you want you can go and type MetaMask on any of the browser that you are

using and make sure that you use this link metamask.io because there are a lot of another spammy and scammers emails. So okay, click on get metamask and yeah it will redirect you here and I already have metam mask installed. Okay, let's add MetaMask here. Perfect. So, let get let's get started. I agree to MetaMask and let's create a new wallet. Make sure you read each and everything. See uh private clicks and views on the apps are stored but on other details like public addresses are not general we are temporarily use your IP address to detect and general location like your country or region. An optional if you decide you want to share

or delete your usage settings anytime. Okay, we'll use this data to learn how to interact. Sure. So, make sure that this should be personal because I'm creating a demo MetaMask wallet for purpose of teaching. But you need to make sure that you never share your password private keys with anyone. So, yeah, make sure you store them very secretly. Okay. I'm creating a demo thing. Perfect. I understand Metamas

cannot recover password for me. Make sure that you store your password at a very secure location. Okay, let's create a new wallet. Secure your wallet. Make sure to see this video. Make sure you never share your secret recovery phase because this is the main thing of your wallet. on this. All of

your accounts are based Make sure that you never share your

secret recovery phase with anyone. funds. Not even recovery. So yeah, secret recovery phase. So it's likely a scam. Okay. So okay, let's reveal my secret recovery phase. Perfect.

Uh let me recover it first. Okay. So let's take a screenshot. Again I'm saying this because I am using this thing this wallet only for learning purposes. So I might share my details but you must keep your secret recovery phase very much secure because your complete wallet and funds depends on it. Let's verify it. Okay. And it's here.

Perfect. Let's confirm. Done. Perfect. Now Metam Mask has been added to our Firefox as an extension and it is connecting me to the Ethereum mainet. Any questions for me? Let's close some of these

tabs. Boom. Here is my MetaMask wallet. Okay. So, we are currently on Ethereum mainet. This is your chain on which you're using and here make sure you enable this option. So first go to your chain selection your network selection then make sure that you select show test network. Okay then make sure you select CIA. So for the deployment process we are going to use cipolia test net. Okay and it's loading. If you want to add multiple accounts, you can add two in MetaMask. Like for example, I can add another account. Okay, create a new account by some other name maybe

learning. See, here is the new account and this is our wallet address. Okay, it's like a unique address for each and every wallet. And there are two main things in every wallet. First is the wallet address and second is the network. This if someone knows about these two things then they can transfer or interact with your wallet but they can't uh like use your funds or etc. Make sure you never share your private key or secret recovery phase or even password with anyone. Okay. And here is the Sapoleia ETH to deploy. We need some

kind of Ethereum in our account because if you can see in the remix panel okay you can see that here this account uh it were supposed to have okay let's do one thing this account was supposed to have 100 ethers somewhere around so then contracts deployction cost or gas fees. Okay, let's choose another account and try to deploy the contract 100 and contract deploy. See it has been deployed or 100 Ethereum that

is changed to 99.9999 something 6511 91 gas has been cost for this deployment task. Okay. or basically complete complete smart contract in the file type and has stored in our into the blockchain. Okay.

So another thing I am an ambassador at cipher abdcraftraft and I have the authority to use this GitHub repo for learning and teaching purpose. Okay. So already then fake amount of fake kind of Ethereum work but it is only used for testing purposes. Okay.

So the best link would be the Google one or you can use chain link one also. It is also the best platform to get the faucets. But yeah, I'm going to use the Google one because it works for me. Okay, this taking some time. Perfect. So minute I think 1

minute. Okay. Yeah, I think I have shared that GitHub repo but because it's there are links it is not showing up here. Okay, no problem. URL github.com/sipher/foundry fullcourse see you. Okay. And it's a public repository. Okay.

test Google and I recommend using Google Cloud because other ones because to stop scammers spammers from accessing the test net funds. Okay, so wallet address but I think Google here is our metam mask. Let us copy this address and address when I hit the receive. Okay, you are signed out. Okay, no problem. So

my Google account wallet Okay, your test net tokens are on the way. Then receive 0.02 E. You should receive the Seapoleia ETH. Okay, perfect. The drip has been complete and I have received the transaction has on my Google and I think yeah see here we got 0.05 into our learning account

and first account of $1.4 which is 0.8 eight sepia ETH from because learning account it's pending and it's confirmed Etheum but to just make sure Ethereum when we try to interact with

our contract. Okay. 0.004. Okay. Perfect deployment injected provider metamask. Okay.

And you should see an option of injected provider metam mask refresh as extension download. Okay. And where is my contract? Here it is. Let me close this. And let's copy this thing. Perfect. Let's refresh.

Okay, here is our contract and it's compiled. Let's check. Yeah, see injected provider MetaMask and connect with MetaMask. Okay. So let's connect. Perfect. See it is connected or accounts. Let's go ahead deploy and it is saying request from remixium org to deploy a contract. Okay.

And it is costing us $48 as network fees. No worries. Let's confirm the transaction. Creating of mark sheet is pending. It's taking some time. You can use perfect. See, I have get a confirmation that uh the transaction has been successful and you can check about this transaction or sepoleia.can.io website each and every detail of the transaction you can use the link. It's sepoleia.etherscan.io. Let me share this

in the chat. Perfect. So you can see the transaction hash. Okay. And the status is successful and two blocks confirmation. Okay. Okay. And here is the time stamp. 23 seconds ago, May 6, 2025 at 11:24 UTC. From this wallet address to this contract address. Okay. 0 Ethereum and transaction fee is 0.02 Ethereum.

Gas price is 43 G. So, GWEI how this thing works. Gas limit and usage by transaction. Okay. Limits. key. Okay, it is saying about that. Then here is the input data which what we have sent to the blockchain. Okay, amount of data. Perfect. And it's values. For example, some general values like

interact contract. So again metam mask is getting popped up and it is saying to transact to uh update these values into the smart contract. So let's confirm this change and it's loading transact to mark sheet. Okay add values. So value add perfect confirm transaction and I and go refresh call method by 23 seconds ago or here is the same thing which we have

seen here on Ether scan. Okay, 2 minutes ago time of deployment but transaction hash. So let's copy the transaction hash and let's go to etherscan.io. Okay. Transaction hash paste search see contract by this wallet address.

Okay. And this is the transaction hash three blocks confirmation 1 minute ago. Then values view. So then we can view it. Okay. Zero. Then I can see my values here. And the call function has been created. But it has not cost us anything. and update like maybe I can change the name maybe 76 78 okay 98 or uh

86 or as transaction sent value add smart contract. So then again it's costing us some amount of Ethereum. Let's confirm this transaction and it is saying transact to mark sheet add value to spending. It will take us some time and perfect it has been done and direct. Okay. Uh it's successful success.

So like values 86 98 and 95 that has been added to the smart contract. So let's see get student call. So yeah you can see the updated thing. So yeah this is how the deployment process work at sepoleia testn net and we can do the same thing for zk sync deploy so then chain list.orgization chain.org or and we put it in the chat box. I think it's not supporting the links. Yeah, it's not supporting the

links. I don't know why. Okay. So chainless.org go on to this website and zksync mainet and make sure to click this check box because we are working on test nets because we are learning currently. Okay. And zk sync simpia test net.

Okay. Connect wallet and it's asking us to connect with metam mask. Okay. Perfect. See your accounts and suggest transaction. Use your enable network connect. Okay. And network URL then currency symbol is let's approve this thing and let's go to our metam mask. Perfect. See now it has been shifted to zinc test net but test zero amount of [Music] okay just give me one

minute test so then we can transfer it to our ZK sync chain transaction hash is pending perfect I think I should receive some amount of sepia into my mask account one let's change it to test network sepoleia Yeah, perfect. So now we need to transfer this to our ZKs sync sepoleia

test net. For that you can go to z portal.z.io. Okay. And this is the ether scan. Okay. So go to portal.zksync.io. Okay. Let me show you from scratch. It's loading. Then you can go to bridge if you can see here and make sure you connect your wallet. Connect Metam

Mask and make sure to read the details. connect. Perfect. Now we can see and make sure you select the ZK sync capia test net. Okay. And I have connected my wallet. It's taking some time to load. 9C. Okay. Okay, my conf is using the 9C1. Let me go to Solia. Perfect. So, I can maximum

transfer 0.038. No problem. Let's transfer the exact amount of Ethereum 954. Okay. To zinc test net. Perfect. Okay. Change wallet to Ethereum test net. Yeah. Continue. So it will take approximately 15 minutes of time to bridge and it will ask for our

confirmation. Sure. Till that time we can talk about the difference between ether V and Q. So okay I think it's done now. No, no, it's taking some time. Ethereum unit converter. Perfect. So here you can see one Ethereum is equal to 1 and 9 Z. Okay, which is somewhere around 1 billion. Okay, which is

somewhere around 1 billion K. Okay, and one with the power of 18 zeros. One with trailing 18 zeros is the quantity of VO and that is 1 Ethereum. So currently 1 Ethereum is priced at 1818. Then 1818 if we perform a calculation, this is the life price of Ethereum. 188.12

Okay. 28 28.12 divided by it's 1 billion. So yeah, 188. It's taking 550 something.

Okay. So, let's check if the bridge is successfully done. As you can see, the amount has been deducted from our main account with Cipolia network. If you see Solia Zync Safia test net uh yeah it has been added here. I think the bridge is complete. Yeah, perfect. So now let's add option I mean a plugin of ZK sync to our Remix IDE.

Let's close the unwanted windows. Perfect. So as you can see there is an option to there's option of zika sync plugin. Okay. And we need to select wallet connect wallet metam mask and it will pop up. Let's connect it. And we are connected. Okay. Make sure our contract

should be inside contracts folder. Created a folder and maybe copy this thing inside this folder. Okay, perfect. So, it's now inside the contract folder. Yeah. Compile project.

[Music] Okay. Yeah, perfect. So, the comp has compiled our contract. Here is the file and let's deploy it on ZK sync test net. Okay. You can takeick on verify contract if you want, but I'm going to deploy it. And Ethereum is going to ask us to signature this request. Let's go. Perfect. Let's add some demo values to transact. Okay. Get

students add values and again transaction confirm. Perfect. Values has been added. Now let's see in the terminal this returning the values 67 87 35 and true random and let's try to add this values again is asking us for transactional access and add then one per click get students. So yeah you can see it has

written the values. And we can copy this hash. We can come to capoleia.explorer.ksyncing.io. You can just add the transactional hash.

Okay. And this taking a bit of time. Okay let's see process sending this is the transaction hash and it's the block ID batch number from the wallet address to here and data here input data and value serial Ethereum fees is 0.17019 Ethereum and Yeah, as per pop data and received 2 minutes ago. So we have successfully deployed our smart contract on ZK sync and on Solia both of

the test networks and we have built a basic kind of contract which displays the status of failure and passing examinations of a student or Perfect. I think or make sure blockchain basics then solidity oneonone about foundry oneonone then

advanced foundry okay guys that's it for today I think about the getting real world data using chain link or maybe solidity oneonone course but that would require a good level of understanding and that would require a much more time so already it's 2 hours I think so we have started at

6:00 and it's 8:00 p.m. now. Yeah, sure. I'm next session. So then we can focus on that thing. Then after that we can start building on Foundry. Okay. And that's it for the session guys. I hope you all enjoyed Thank you. Thanks a lot. Make sure you

attend all the upcoming sessions and I think you guys have a luma form to register for the upcoming events of cipher webdraft. Stay connected with the best learning platform for web 3 and I think that's it for this session. We will continue in the next session. All right, take care. Bye-bye.