Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,440 --> 00:00:05,190
None of you have your first smart contracts in remix and you have interacted with them.
2
00:00:05,210 --> 00:00:09,940
Let me quickly summarize the section before moving on to something more advanced.
3
00:00:09,950 --> 00:00:17,600
So in this video, I just want to quickly summarize what we did before and we started off with actually
4
00:00:17,600 --> 00:00:26,090
creating files in remix and instead of just creating files, you saw that there is also workspaces where
5
00:00:26,090 --> 00:00:31,940
you can add workspaces and you start with a so called default workspace.
6
00:00:31,940 --> 00:00:38,120
And throughout the course I will probably stay in this default workspace unless we are doing some sort
7
00:00:38,120 --> 00:00:43,190
of specific advanced project where we might want to add in an open Zeppelin workspace.
8
00:00:43,280 --> 00:00:46,280
But for now you can safely stay in the default workspace.
9
00:00:46,280 --> 00:00:49,220
If you don't have a default workspace, just create a default one.
10
00:00:49,400 --> 00:00:54,140
And most likely it will come with a very similar structure like this one.
11
00:00:54,140 --> 00:00:59,690
It will have a contract folder where you can still probably correctly there is the contract inside,
12
00:00:59,720 --> 00:01:05,300
then a script folder, which is I think a fairly new feature of remix that you can execute actual JavaScript
13
00:01:05,300 --> 00:01:07,910
scripts inside a JavaScript environment.
14
00:01:08,300 --> 00:01:13,580
I mean, that's a pretty convenient thing if you have a set of smart contracts that you want to deploy
15
00:01:13,580 --> 00:01:17,330
and pre populate with some data, then that's the way to go I guess.
16
00:01:17,570 --> 00:01:18,860
And then you have tests.
17
00:01:18,860 --> 00:01:22,010
I have not really used the unit test there yet.
18
00:01:22,460 --> 00:01:24,380
I think they are working just fine.
19
00:01:24,380 --> 00:01:27,320
I just I'm just not a huge fan of remix unit test.
20
00:01:27,320 --> 00:01:30,380
I rather do them in Truffle Ha Head or now foundry.
21
00:01:30,980 --> 00:01:33,830
Now to add a new file, you don't click the little.
22
00:01:33,830 --> 00:01:38,000
Plus I can hear you click the little new file I can over here.
23
00:01:38,000 --> 00:01:41,870
And then it will create a new file in the folder that you selected.
24
00:01:41,870 --> 00:01:47,810
So it is a good idea to first select a contract folder and then click the new file again, and that
25
00:01:47,810 --> 00:01:53,870
one will create a new file in this folder and you can name it my contract.
26
00:01:53,870 --> 00:02:01,670
So now with that one, when you click it, you will end up in an editor on the right side.
27
00:02:01,730 --> 00:02:07,790
And there you can write your smart contract code or comments or anything else that you want to write
28
00:02:07,790 --> 00:02:08,240
there.
29
00:02:08,720 --> 00:02:13,100
If you have text files and it's also a text editor, it's not just for solidity.
30
00:02:13,700 --> 00:02:19,160
If you want to make it bigger or smaller because the font is too smaller to big, you can add click
31
00:02:19,160 --> 00:02:21,410
the little plus or minus loop.
32
00:02:21,410 --> 00:02:27,230
I can magnifier, I can see there it is not working with your keyboard where you press control plus
33
00:02:27,230 --> 00:02:27,770
and minus.
34
00:02:27,770 --> 00:02:31,640
This will just make the UI elements bigger, but not the actual editor.
35
00:02:31,640 --> 00:02:32,930
So be aware of that.
36
00:02:33,830 --> 00:02:34,310
Yeah.
37
00:02:34,310 --> 00:02:38,240
With that we have the remix files pane.
38
00:02:38,240 --> 00:02:42,500
Now let's get over to the actual compiler.
39
00:02:44,540 --> 00:02:46,430
In the compiler.
40
00:02:46,430 --> 00:02:49,380
There are a couple of things that you should be aware of.
41
00:02:49,400 --> 00:02:57,340
Number one is the compiler version that should be automatically selected based on the pragmatic line.
42
00:02:57,350 --> 00:03:02,000
So if the primer is zero 814, then it will select the compiler zero at 14.
43
00:03:02,180 --> 00:03:13,070
If you have assembler compiler that specifies any compiler between 080 and 090, then you probably have
44
00:03:13,070 --> 00:03:15,010
to select the compiler version yourself.
45
00:03:15,020 --> 00:03:19,610
So make sure that you're maybe not exactly the latest one, but one of the latest ones and understand
46
00:03:19,610 --> 00:03:21,510
what are those language features.
47
00:03:21,530 --> 00:03:26,480
One thing I can recommend you is to turn on the auto compile functionality.
48
00:03:26,480 --> 00:03:31,730
So every time you change something it will run the compiler over here automatically.
49
00:03:31,730 --> 00:03:37,160
Compiler then already tell you over here with the little check mark or if it's not the check mark,
50
00:03:37,160 --> 00:03:37,940
then there is a problem.
51
00:03:37,940 --> 00:03:40,250
So you should be aware of that too.
52
00:03:42,320 --> 00:03:49,040
Now the next thing I want to talk about is to deploy and run transactions, plug in that you can find
53
00:03:49,430 --> 00:03:51,590
as the third option in remarks.
54
00:03:51,590 --> 00:03:59,210
And over here you have an environment dropdown and for now we are going to stay in the JavaScript virtual
55
00:03:59,210 --> 00:04:04,520
machine environment from remix because it gives us already a couple of accounts over here.
56
00:04:04,520 --> 00:04:08,140
So we don't have to do any account management or wallets that's already integrated.
57
00:04:08,150 --> 00:04:10,970
You don't have to worry about the gas amount at the moment.
58
00:04:10,970 --> 00:04:20,570
It is the amount of gas that is available for each transaction for computational well operations during
59
00:04:20,570 --> 00:04:25,550
execution of a transaction that is the default value from remix mix.
60
00:04:25,550 --> 00:04:29,090
It is not the default value that has anything to do with Etherium or whatever.
61
00:04:29,090 --> 00:04:34,070
Just somebody at the remix testing probably went ahead and said like, Well, 3 million.
62
00:04:34,070 --> 00:04:35,570
That sounds like a good number.
63
00:04:35,570 --> 00:04:37,670
So we're going to do 3 million as a default.
64
00:04:37,670 --> 00:04:43,940
I think the current max amount is around 8 million gas on the Ethereum main chain.
65
00:04:43,940 --> 00:04:45,980
You sell them, actually send the max amount.
66
00:04:45,980 --> 00:04:51,620
You are calculating, estimating how much gas that transaction will need and then it's automatically
67
00:04:51,620 --> 00:04:53,090
sending the right gas amount.
68
00:04:53,090 --> 00:05:00,290
So you'll never well anyway, not overpaying because you get the remainder of gas back to your account,
69
00:05:00,290 --> 00:05:02,810
but it is just a better way to do it.
70
00:05:02,810 --> 00:05:03,620
The value field.
71
00:05:03,620 --> 00:05:09,620
You also have to not worry about it at the moment it is if you want to send actual ether together with
72
00:05:09,620 --> 00:05:13,850
a transaction with the smart contract interaction to a smart contract, we are doing this later with
73
00:05:13,850 --> 00:05:15,620
so called payable functions.
74
00:05:16,040 --> 00:05:19,430
What is important here is the contract dropdown.
75
00:05:19,430 --> 00:05:24,740
Has the contract selected that you want to deploy and then you can hit deploy.
76
00:05:27,190 --> 00:05:30,490
K next is the remix interaction.
77
00:05:30,490 --> 00:05:36,340
So as soon as you have your smart contract deployed with the deployed tab and underneath directly at
78
00:05:36,340 --> 00:05:40,780
no space there underneath directly will be the smart contract instances.
79
00:05:40,780 --> 00:05:45,730
Every time you click deploy, it will deploy a new instance that is important to understand because
80
00:05:45,730 --> 00:05:47,620
you cannot update code on the blockchain.
81
00:05:47,620 --> 00:05:53,080
It's immutable unless you're writing something like proxy contracts, which is something where I have
82
00:05:53,080 --> 00:05:55,060
a specific lecture about it.
83
00:05:55,150 --> 00:06:03,100
On Ethereum, the blockchain, this developer come as an extra material, but it's not content of this
84
00:06:03,100 --> 00:06:04,300
lecture or section.
85
00:06:04,300 --> 00:06:09,100
Maybe we do something else with proxy contracts later in the course, but I have not planned it right
86
00:06:09,100 --> 00:06:12,490
now, so that is very advanced.
87
00:06:12,490 --> 00:06:17,140
If you want to update your already deployed byte code, we are not doing this.
88
00:06:17,140 --> 00:06:24,250
We are normally going by having immutable contracts, running on the address and then you deploy a new
89
00:06:24,250 --> 00:06:24,460
one.
90
00:06:24,460 --> 00:06:31,540
So it gets a new address which you can conveniently copy here if you want to, and you can collapse
91
00:06:31,540 --> 00:06:37,300
your contract with the little collapse I can here, and then you can start to interact with it with
92
00:06:37,300 --> 00:06:38,260
these buttons.
93
00:06:38,830 --> 00:06:41,050
The blue ones are the greenish.
94
00:06:41,050 --> 00:06:42,070
I don't know what is this color?
95
00:06:42,070 --> 00:06:51,970
Navy color is for red operations and red or orange colors is for right operations where you most likely
96
00:06:51,970 --> 00:06:54,970
also have an input field and then you can also collapse.
97
00:06:54,970 --> 00:07:00,730
That and this one over here, the the part on the lower end is for low level interactions.
98
00:07:00,730 --> 00:07:05,650
So if you are doing something maybe in a fallback function, which we are also covering later, then
99
00:07:05,650 --> 00:07:09,910
you can use that one that was named previously differently.
100
00:07:09,910 --> 00:07:10,960
And it's very confusing.
101
00:07:10,960 --> 00:07:17,650
If you look at old YouTube videos, then this one is actually over here at the top of the smart contract.
102
00:07:17,650 --> 00:07:22,540
In this I only called send and not transact so they change the UI around.
103
00:07:23,830 --> 00:07:25,360
It is a low level interaction.
104
00:07:25,360 --> 00:07:28,690
This is what it is about and I think the UI now better reflects it.
105
00:07:28,690 --> 00:07:29,740
But it is confusing.
106
00:07:29,740 --> 00:07:34,570
If you are coming from older YouTube videos, great.
107
00:07:37,110 --> 00:07:45,360
Next we have the logging functionality of remix on the bottom right and you can make it bigger or smaller.
108
00:07:45,360 --> 00:07:49,380
There is a little you have to hover with the mouse over here and then you can drag it up or down.
109
00:07:49,590 --> 00:07:53,730
So if the lock window is not big enough, then you can make it bigger.
110
00:07:54,000 --> 00:07:57,510
There you have a couple of things and I just want to highlight them.
111
00:07:57,510 --> 00:08:01,650
I don't want to go too much into detail of them because we are doing this later on.
112
00:08:01,650 --> 00:08:05,340
Again, there is two things which are outstanding.
113
00:08:05,340 --> 00:08:09,330
The one is a little checkmark icon which is writing transaction.
114
00:08:09,330 --> 00:08:14,940
And then over here there is another one which is called a call which is reading transaction.
115
00:08:15,450 --> 00:08:22,350
You see from which account, from which address you send it to, which address you send.
116
00:08:22,350 --> 00:08:28,230
It is something that you should not only see, but remix is hiding it, so you actually have to open
117
00:08:28,230 --> 00:08:39,360
it and then you can potentially copy the contract address that it is sending it to with the little copy
118
00:08:39,390 --> 00:08:40,230
copy icon.
119
00:08:40,230 --> 00:08:46,740
I think otherwise you have to you have to see what kind of smart contract you are interacting with in
120
00:08:46,740 --> 00:08:47,130
another way.
121
00:08:47,130 --> 00:08:51,240
And I don't I don't know what what other way would there be other than the address?
122
00:08:51,240 --> 00:08:54,720
Because the contract, if you deploy several of them, they all have the same name.
123
00:08:55,230 --> 00:08:59,820
Then you see gas and transaction costs, something you are going to talk about later.
124
00:08:59,820 --> 00:09:01,680
You see there is a transaction hash.
125
00:09:01,680 --> 00:09:09,690
Each and every transaction has its own hash, which is a unique hash like a like an A in code for books,
126
00:09:09,690 --> 00:09:12,240
you have a transaction hash for transaction.
127
00:09:12,240 --> 00:09:14,940
I think about this way, there is a status.
128
00:09:14,940 --> 00:09:21,030
If the transaction is successful and everything is fine, there were no errors, then this returns true.
129
00:09:21,030 --> 00:09:22,590
Otherwise it returns false.
130
00:09:22,890 --> 00:09:28,950
And there is a theta field which in remix is called Input.
131
00:09:29,760 --> 00:09:35,880
I don't know why they call it input, but a native transaction in Ethereum that would actually be the
132
00:09:36,300 --> 00:09:37,200
data field.
133
00:09:37,410 --> 00:09:43,410
And that's the thing that smart contract developers are interested in, because this is when you when
134
00:09:43,410 --> 00:09:48,690
you compare it to the data field over here that's actually called theta, then this is the data field.
135
00:09:48,690 --> 00:09:54,090
This is the, the code that you send to interact deployer smart contract or interact with the smart
136
00:09:54,090 --> 00:09:55,470
contract on the low level.
137
00:09:55,470 --> 00:10:02,190
And this is something that we are going to deep dive into now with that pretty much everything is said.
138
00:10:02,190 --> 00:10:04,560
There is also a debug button for the remix debugger.
139
00:10:04,560 --> 00:10:09,000
We have a separate lecture on that and yeah, that's it.
140
00:10:09,000 --> 00:10:14,550
I think you can go safely to the next lecture if you understood everything of that and we see you in
141
00:10:14,550 --> 00:10:18,540
the next section where we actually do our first small project.
14952
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.