How to deploy and verify (Remix+Metamask)

Ethereum Blockchain Ethereum totorials
19 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
This is a free item
$0.00
د.إ0.00
Kz0.00
ARS$0.00
A$0.00
৳0.00
Лв0.00
Bs0.00
B$0.00
P0.00
CA$0.00
CHF 0.00
CLP$0.00
CN¥0.00
COP$0.00
₡0.00
Kč0.00
DKK kr0.00
RD$0.00
DA0.00
E£0.00
ብር0.00
€0.00
FJ$0.00
£0.00
Q0.00
GY$0.00
HK$0.00
L0.00
Ft0.00
₪0.00
₹0.00
ISK kr0.00
¥0.00
KSh0.00
₩0.00
DH0.00
L0.00
ден0.00
MOP$0.00
MX$0.00
RM0.00
N$0.00
₦0.00
C$0.00
NOK kr0.00
रु0.00
NZ$0.00
S/0.00
K0.00
₱0.00
₨0.00
zł0.00
₲0.00
L0.00
QR0.00
SAR0.00
SEK kr0.00
S$0.00
฿0.00
₺0.00
$U0.00
R0.00
ZK0.00
Already have an account? Log In

Transcript

Hello. Today I'm going to show you how to deploy the smart contract using meta mask and remix. Okay so meta mask is basically everfree provider and remix is is a ID online Ida for solidity it also deploys contracts. So I'm going to deploy the contract which I have already written which is a simple ERC 20 token which, you know, with the a simple transfer, you know, all that ERC 20 standard functions, which one would expect from the token. Okay, so, I'm going to use the open 15 and I already have it compiled. Now, the only thing which I need to do is, you know, get it injected correctly, and sometimes, you need to refresh the browser.

Get it running. Okay, so it should compile. And now I should check. Yes got this is this is my account on roxton desktop network cache. Yeah it is. So what I'm going to do is my smart contract does not request any, any, any arguments.

So first of all I'm going to show you how to deploy it and check it how to verify it. And then I'm going to show you how to add arguments into constructor and verify them on the ether scan. Okay, so now we need to select my contract which I won't spoil which is a simple ERC 20 token it would go Let's create it I'm gonna submit it he we go now I'm gonna pause and you know I'm gonna skip the waiting so I'm gonna be there with you when when it's done okay, so got deployed. So now I can check out which was deployed I can check Republic variable and read it. Now as you may see a name is us token and so on so on. Now I want to check, same contract on either scan that's go to ether scan.

Oh, I'm sorry, it's Broxton scan. Anyway, here it is. Obviously, I need to verify before I read it, so I'm going to go ahead copy the code Just the name of the contract. Now, this is the compiler, which is oh four T and here it is that I enabled optimizations. Now I did not. So I click Save.

Now I verified. Let's check it out. Here we go, we have a we have confirm the contract. Go ahead. The same code I, it's the same code from here. Same API.

And I can check which is over here, except for I do not I cannot run functions. So let's check the balance. query, I do get zero Why do I get do check me? Oh, okay. This one requires me to close parenthesis. Okay.

Ah, I see I see it's not exact code which I used Okay, so I will need to open the CO I'm just gonna add them. So basically balances owner equals to initial supply. Okay here to this is I'm going to call violet again I would need to redeploy it because I made a mistake and I did not add balance to myself or myself or whatever okay Select our contract let's close this one simple issue yeah this one okay it's gonna take a while so I'm gonna I'm gonna wait it out I'm gonna skip will be the short notice Oh hit it is I didn't need to wait wow that was that that's great okay I'm not expecting it so fast get a check. Balance of okay great on either scan obviously I'm going to I will need to do the same thing on fortunately a different address and it is what it is okay so and I cannot find address Why?

Why? Coffee ciders Okay, it's great if I go this contract name this And see it is done. Um, let's get back to contract. Let's try to check balance of this address it is it is. Okay. So now I would like to show you how to add parameter to constructor and how you verify it because you need then you verifying it, you need to provide an ABI encoded argument.

So what I'm going to do is what I'm gonna do is I'm going to show you how vital looks This is the end. And most of the time so far after this number x number two another sector actually eight encoded arguments appear. So I'm going to show you I'm gonna add, let's say, each provide random you and I'm just gonna provide that I'm not gonna do anything with it. Okay, let's, let's come. Yeah, let's compile it. Okay.

All right. It's not used anyway, who cares? Let's go ahead and close this one. Select. Oh, yeah, and I need to provide now random number. Okay, let's go.

Okay, I need to submit at Hopefully, hopefully is going to fast this time. So in the meantime, there's obviously a manual process process in which you can go arguments by hand, but this this, the way I'm doing is, is it's much more simpler and obviously much more faster. But it's a good idea to understand how they are coded and it is. There is a link on either scan where you can check how they are coded. Try to find it or scan Yes, yeah. This is Yep, there it is that it is.

Yeah. It's still not. Boy. So I'm deployed. You can smell it ID whether it's your four four number. Yeah, it is.

So basically this will How should my codec argument will look like. Key screen details. It is. Let's find deny Okay I'm gonna post it to notepad so I can see better Okay It is that simple which is F and what did I provide it I provided it which is case so let's go ahead and call it this out first of all I need to open the contracting Raj then go add this and verify ah same stuff you provide actress disable and now the OG edit is simple Let's wait it out they No, I did not make any mistakes. I think it is. It was compiled correctly.

Verified correct. Okay. So just for I'm sorry, get back to contract contract which required one our demand and creation code would deconstruct the arguments. You made the code on yourself. Can I read it? Yes I do.

That's tricky balance. It is okay. So, same process will will go if you add more arguments, they will be attached after this point. Whatever practice you will know If you will notice it now, for what purpose you may want to understand how actually it works, when for example, when you want to send the rod sessions you cannot send you know something like this like by contract that you know at address and function you need to send raw transaction which show obviously needs to be done in encoded way and it is encoded obviously, into, you know 32 bit bad and also in unit to convert data into tech So, if you would like to you know, sign some send the function, you will need to do this first you get the SH a function and then you need to provide the the arguments for the function. So, in total we had this what you would send to the blockchain that smart contract, if you would like to if you do not have an ability or you are worried about security, you would want to you would need to do that.

Otherwise, you would need to use some kind of gateway to the to blockchain Okay, so, I think that's it. I think that's it. Okay, so I'm going to show you how to how it works. look like if I add some something else, like an address. Let's go ahead and let's compile it. Okay.

Question number number and I'm gonna call this one I need to ride the burdens is because JavaScript does not stand address theorem addresses. Okay, I submit it's gonna take a while obviously and I'm gonna skip it so I'm gonna meet when done okay, hit is it is okay. I need to get to scan Where did you not update yet? I hope I'm past the correct actress. Yes, say yeah. So it's not Babe Let's wait till it stops okay this is this verify it so what will happen is it will create an address let's try to find the address for it.

Um I'll just an address look like coded address go to address I see address looks like an example I think there's none Okay, nevermind you're gonna see it right away so it has created over here I'm going to copy so it gets it better. That's fine the old 20 or 29 Okay, here it is. This is my 15 and this is why address coded to 332 by bad h E and so so obviously I will need to provide that or arguments. And now what I'm going to do is copy the code that is named this disabled and let's verify nothing complex it is it is called. Now I want to say I would like to probably like show you how you can deploy using truffle and using nest. Now, what's what's the main difference with the mist, I would say the mist is most straightforward because Sonic scent obviously to some extent.

Now for this to work you either need to connect to attach to the node or You like myself, I run the node on my local computer. So I yeah, initially I started with the node with the local note and best. And after a while you need to, you need to speak, stay in sync in order to work with it. And after the soft work after update after the basically aetherium developers trying to push Metropolis fork and they're obviously in need that need testing and they are testing it on our roster. So right now, it is not stable, takes a long time to sync. And it sometimes it takes a long time for transactions to appear on a blockchain to be confirmed.

To the mind. Okay, so a truffle. Now truffle is good. If you write large, large and calm, complex contracts. That case, truffle is the way to go. Obviously, truffle is a great test environment.

So it's it's a, it's most complex, but it's most powerful. So personally, I use solidity online remix, to debug or to test like some particular functionality of solidity. And I you Yeah, to debug also, it's a great tool to debug because it has a debugger. Now truffle does not have and sometimes when euro or appears like opcode isn't invalid. You have no idea what happened. You know, with the experience, obviously, you can understand more but with the remedy You can trace down the what is going to suppress debug, and it's going to show you, they're going to show you how, how it was great hard.

It's gonna basically it's gonna work like a debugger, which would basically it's gonna work like a classical debugger. Okay, so I think that is that's it. Thank you. See you. Bye bye

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.