-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInheritance (part 2).srt
1265 lines (1012 loc) · 32.9 KB
/
Inheritance (part 2).srt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1
00:00:00,140 --> 00:00:03,449
in this video you'll go to some examples
在此视频中,您将转到有关多个继承针固定性的一些示例
2
00:00:03,449 --> 00:00:06,990
of multiple inheritance pin solidity for
在此视频中,您将转到有关多个继承针固定性的一些示例
3
00:00:06,990 --> 00:00:09,030
the first example we will consider the
在第一个示例中,我们将考虑合同c继承自的情况
4
00:00:09,030 --> 00:00:11,370
case where a contract c inherits from
在第一个示例中,我们将考虑合同c继承自的情况
5
00:00:11,370 --> 00:00:16,260
contract a and contract B here we have
合同a和合同B在这里,我们有三个合同合同a合同B
6
00:00:16,260 --> 00:00:19,199
three contracts contract a contract B
合同a和合同B在这里,我们有三个合同合同a合同B
7
00:00:19,199 --> 00:00:22,619
and contract C for a contract C to
以及合同C,以使合同C继承合同a和合同B
8
00:00:22,619 --> 00:00:25,800
inherit both contract a and contract B
以及合同C,以使合同C继承合同a和合同B
9
00:00:25,800 --> 00:00:27,990
we first start with the keyword a's
我们首先以关键字a开头,后跟合约名称,因此
10
00:00:27,990 --> 00:00:30,960
followed by the name of the contract so
我们首先以关键字a开头,后跟合约名称,因此
11
00:00:30,960 --> 00:00:34,890
contract a comma and then V and if
收缩一个逗号,然后收缩V,如果contact包含一个称为foo的函数,
12
00:00:34,890 --> 00:00:37,649
contact a has a function called foo and
收缩一个逗号,然后收缩V,如果contact包含一个称为foo的函数,
13
00:00:37,649 --> 00:00:40,160
contract B as a function called Bar
合约B作为称为Bar合约的函数具有合约foo和foo
14
00:00:40,160 --> 00:00:43,410
contract C has both functions foo and
合约B作为称为Bar合约的函数具有合约foo和foo
15
00:00:43,410 --> 00:00:46,950
bar you can verify this for yourself by
栏,您可以通过编译合同和部署来自己验证
16
00:00:46,950 --> 00:00:49,289
compiling the contracts and deploying
栏,您可以通过编译合同和部署来自己验证
17
00:00:49,289 --> 00:00:51,680
contract C
合同C,如果父母双方相同
18
00:00:51,680 --> 00:00:54,780
and if both the parents had the same
合同C,如果父母双方相同
19
00:00:54,780 --> 00:00:58,110
function function food then contract see
功能功能食物然后收缩在这里只看到功能之一
20
00:00:58,110 --> 00:01:01,320
in here only one of the functions so
功能功能食物然后收缩在这里只看到功能之一
21
00:01:01,320 --> 00:01:03,600
which function food that contract see
哪些功能可以让您看清合约和发丝,让我们找出来
22
00:01:03,600 --> 00:01:05,970
and hair let's find out
哪些功能可以让您看清合约和发丝,让我们找出来
23
00:01:05,970 --> 00:01:08,250
go ahead and compile and redeploy the
继续编译并重新部署合同
24
00:01:08,250 --> 00:01:10,730
contract
继续编译并重新部署合同
25
00:01:13,049 --> 00:01:16,140
when you execute the function foo you'll
当您执行函数foo时,当我们调用
26
00:01:16,140 --> 00:01:18,810
get the string be back when we call the
当您执行函数foo时,当我们调用
27
00:01:18,810 --> 00:01:21,930
function food inside contract see the
合同中的函数food参见合同B中的函数foo是
28
00:01:21,930 --> 00:01:24,330
function foo inside contract B was
合同中的函数food参见合同B中的函数foo是
29
00:01:24,330 --> 00:01:27,360
called and it returned the string B if
调用,并且如果您反转继承并重新部署,它将返回字符串B
30
00:01:27,360 --> 00:01:30,390
you reverse the inheritance and redeploy
调用,并且如果您反转继承并重新部署,它将返回字符串B
31
00:01:30,390 --> 00:01:33,090
the contract and execute the function
合同并执行功能foo yo,将字符串取回,所以现在
32
00:01:33,090 --> 00:01:37,590
foo yo get the string a back so now
合同并执行功能foo yo,将字符串取回,所以现在
33
00:01:37,590 --> 00:01:39,000
we've seen that when the order of
我们已经看到,当继承顺序是内部的B函数食物时
34
00:01:39,000 --> 00:01:42,330
inheritance was a B function food inside
我们已经看到,当继承顺序是内部的B函数食物时
35
00:01:42,330 --> 00:01:44,850
contract B was called an in return the
另一方面,合约B被称为“返回”字符串B
36
00:01:44,850 --> 00:01:46,709
string B on the other hand when the
另一方面,合约B被称为“返回”字符串B
37
00:01:46,709 --> 00:01:49,860
order of inheritance was be a function
继承的顺序是合同a中的功能食品
38
00:01:49,860 --> 00:01:52,560
food inside contract a was called in a
继承的顺序是合同a中的功能食品
39
00:01:52,560 --> 00:01:55,020
return the string gay you can see from
从这两个示例返回的字符串gay可以看到
40
00:01:55,020 --> 00:01:57,030
these two examples that the order of
从这两个示例返回的字符串gay可以看到
41
00:01:57,030 --> 00:01:59,970
inheritance determines which function
继承决定了我们合同继承的功能,那么您应该如何
42
00:01:59,970 --> 00:02:03,810
our contract inherits so how should you
继承决定了我们合同继承的功能,那么您应该如何
43
00:02:03,810 --> 00:02:05,819
order the contracts that you want to
根据以下命令订购要签订合同的合同
44
00:02:05,819 --> 00:02:08,880
enter into your contract according to
根据以下命令订购要签订合同的合同
45
00:02:08,880 --> 00:02:11,430
the solidity documentation you have to
实体文档,您必须在订单中列出明显的合同
46
00:02:11,430 --> 00:02:13,530
list apparent contracts in the order
实体文档,您必须在订单中列出明显的合同
47
00:02:13,530 --> 00:02:17,100
from most baseline to most derived what
从大多数基准到大多数派生,我们所说的“最基础的”和“大多数”是什么意思
48
00:02:17,100 --> 00:02:19,470
do we mean by most based like and most
从大多数基准到大多数派生,我们所说的“最基础的”和“大多数”是什么意思
49
00:02:19,470 --> 00:02:23,519
derived so for example contract a is
派生的,例如合同a比合同更像
50
00:02:23,519 --> 00:02:25,980
more based like than contract see
派生的,例如合同a比合同更像
51
00:02:25,980 --> 00:02:29,100
because contract a does not inherit any
因为合同a不会继承任何其他合同
52
00:02:29,100 --> 00:02:30,239
other contracts
因为合同a不会继承任何其他合同
53
00:02:30,239 --> 00:02:33,299
likewise contract B is more based I
同样,合同B的依据更多,我认为出租车和合同的依据更多
54
00:02:33,299 --> 00:02:37,049
think on taxi and contract see is more
同样,合同B的依据更多,我认为出租车和合同的依据更多
55
00:02:37,049 --> 00:02:39,660
derived than both contract B and
比合同B和合同日都衍生,因为合同C继承了
56
00:02:39,660 --> 00:02:43,230
contract day because contract C inherits
比合同B和合同日都衍生,因为合同C继承了
57
00:02:43,230 --> 00:02:46,650
from a and B and if you had a contract D
来自a和B的合同,并且如果您拥有从a和C继承的合同D
58
00:02:46,650 --> 00:02:50,519
that inherits from a and C the contract
来自a和B的合同,并且如果您拥有从a和C继承的合同D
59
00:02:50,519 --> 00:02:53,730
D is more derived than C and also more
D比C更衍生,也更衍生和签订合同通知书
60
00:02:53,730 --> 00:02:56,519
derived and contract a notice the order
D比C更衍生,也更衍生和签订合同通知书
61
00:02:56,519 --> 00:02:59,670
of inheritance for contract D is from
合同D的继承权是从更多的空间到大多数衍生的空间,因为
62
00:02:59,670 --> 00:03:02,250
more space like to most derived since
合同D的继承权是从更多的空间到大多数衍生的空间,因为
63
00:03:02,250 --> 00:03:06,030
contract C inherits from contract a it
合同C从合同a继承,如果您继承合同c
64
00:03:06,030 --> 00:03:08,970
is more derived than contract a if you
合同C从合同a继承,如果您继承合同c
65
00:03:08,970 --> 00:03:10,889
were to switch the order of inheritance
将继承的顺序从大多数派生切换到大多数基础派,例如
66
00:03:10,889 --> 00:03:14,220
from most derived to most based like the
将继承的顺序从大多数派生切换到大多数基础派,例如
67
00:03:14,220 --> 00:03:16,650
solidity compiler might earn air like
坚固的编译器可能会像这样赚钱
68
00:03:16,650 --> 00:03:18,280
this
坚固的编译器可能会像这样赚钱
69
00:03:18,280 --> 00:03:21,610
once we order our inheritance from most
一旦我们从大多数基本类型到大多数派生命令继承
70
00:03:21,610 --> 00:03:24,670
base type to most derived how does
一旦我们从大多数基本类型到大多数派生命令继承
71
00:03:24,670 --> 00:03:26,800
solidity determine which function to
坚固性根据坚固性确定要调用的功能
72
00:03:26,800 --> 00:03:29,610
call according to the solidity
坚固性根据坚固性确定要调用的功能
73
00:03:29,610 --> 00:03:32,050
documentation when a function is called
多次定义的函数调用时的文档
74
00:03:32,050 --> 00:03:34,420
that is defined multiple times in
多次定义的函数调用时的文档
75
00:03:34,420 --> 00:03:37,030
different contracts solidity searches
不同的合同稳定性从右到左搜索功能,然后
76
00:03:37,030 --> 00:03:39,370
for the function from right to left and
不同的合同稳定性从右到左搜索功能,然后
77
00:03:39,370 --> 00:03:43,390
in a depth first manner right to left is
以深度优先的方式从右到左很容易理解,但让我们来看一下
78
00:03:43,390 --> 00:03:45,490
easy to understand but let's go over a
以深度优先的方式从右到左很容易理解,但让我们来看一下
79
00:03:45,490 --> 00:03:49,360
quick example using contracts see when
使用合同的简单示例,请参见何时在内部调用函数foo
80
00:03:49,360 --> 00:03:51,070
we call the function foo inside
使用合同的简单示例,请参见何时在内部调用函数foo
81
00:03:51,070 --> 00:03:53,680
contracts see you'll get the string B
合约看到您将获得字符串B,这是因为搜索了牢固性
82
00:03:53,680 --> 00:03:56,650
back this is because solidity searched
合约看到您将获得字符串B,这是因为搜索了牢固性
83
00:03:56,650 --> 00:03:59,110
for the function foo starting from the
对于从最右边的裤装协定开始的功能foo
84
00:03:59,110 --> 00:04:01,810
rightmost pant contract which is
对于从最右边的裤装协定开始的功能foo
85
00:04:01,810 --> 00:04:05,020
contract e and inside contract be a
合同e和合同内部都是发现函数foo
86
00:04:05,020 --> 00:04:06,690
found the function foo
合同e和合同内部都是发现函数foo
87
00:04:06,690 --> 00:04:09,760
if contract B didn't have the function
如果合同B不具有函数foo,我们在内部调用函数food
88
00:04:09,760 --> 00:04:12,670
foo and we call the function food inside
如果合同B不具有函数foo,我们在内部调用函数food
89
00:04:12,670 --> 00:04:16,000
contract C then solidity will start from
合同C,那么稳固性将从最右边的裤子合同开始,发现
90
00:04:16,000 --> 00:04:18,760
the rightmost pant contract finding that
合同C,那么稳固性将从最右边的裤子合同开始,发现
91
00:04:18,760 --> 00:04:20,980
contract B does not have the function
合约B没有功能foo next solid将搜索
92
00:04:20,980 --> 00:04:24,160
foo next solidity will search for the
合约B没有功能foo next solid将搜索
93
00:04:24,160 --> 00:04:27,190
function food inside contract a since
合约内的功能食品,因为合约内定义了功能foo
94
00:04:27,190 --> 00:04:30,010
function foo is defined inside contract
合约内的功能食品,因为合约内定义了功能foo
95
00:04:30,010 --> 00:04:33,550
a the function foo inside contract C
合同C内的函数foo将导致合同内的函数foo
96
00:04:33,550 --> 00:04:36,430
will result to the function foo inside
合同C内的函数foo将导致合同内的函数foo
97
00:04:36,430 --> 00:04:39,430
contract a and when we execute the
收缩a,当我们执行功能时,如果我们返回字符串,
98
00:04:39,430 --> 00:04:43,090
function we get our string a back if we
收缩a,当我们执行功能时,如果我们返回字符串,
99
00:04:43,090 --> 00:04:45,070
were to switch the order of inheritance
切换继承顺序,使合同a是最右边的坦克
100
00:04:45,070 --> 00:04:47,919
so that contract a is the rightmost tank
切换继承顺序,使合同a是最右边的坦克
101
00:04:47,919 --> 00:04:51,010
object then solidity will first search
对象,然后坚固性将首先在合同内搜索功能食品
102
00:04:51,010 --> 00:04:53,380
for the function food inside contract
对象,然后坚固性将首先在合同内搜索功能食品
103
00:04:53,380 --> 00:04:55,750
day before searching for that function
在合同E中搜索该功能的前一天,您可以在此处进行验证
104
00:04:55,750 --> 00:04:58,960
in contract E and you can verify here
在合同E中搜索该功能的前一天,您可以在此处进行验证
105
00:04:58,960 --> 00:05:01,180
that the function food inside contract
接下来称为合同日内的功能食品
106
00:05:01,180 --> 00:05:04,120
day was called next let's go over what
接下来称为合同日内的功能食品
107
00:05:04,120 --> 00:05:07,330
it means to search depth first here we
这意味着首先要搜索深度,我们有从D和D继承的合同D
108
00:05:07,330 --> 00:05:10,270
have contract D that inherits from a and
这意味着首先要搜索深度,我们有从D和D继承的合同D
109
00:05:10,270 --> 00:05:13,450
C when we call the function foo on
C当我们在联系人D上调用函数foo时,它首先返回字符串B
110
00:05:13,450 --> 00:05:16,840
contact D it returns the string B first
C当我们在联系人D上调用函数foo时,它首先返回字符串B
111
00:05:16,840 --> 00:05:19,030
solidity search for the function foo
自该功能以来,在契约密钥内部进行功能性foo搜索
112
00:05:19,030 --> 00:05:21,729
inside contract key since the function
自该功能以来,在契约密钥内部进行功能性foo搜索
113
00:05:21,729 --> 00:05:24,720
foo is not defined inside contract D
在合同D实体内部未定义foo的情况下搜索了功能foo
114
00:05:24,720 --> 00:05:27,460
solidity searched for the function foo
在合同D实体内部未定义foo的情况下搜索了功能foo
115
00:05:27,460 --> 00:05:30,550
in the rightmost parent contract in this
在这种情况下最右边的父合同中
116
00:05:30,550 --> 00:05:31,810
case contract
在这种情况下最右边的父合同中
117
00:05:31,810 --> 00:05:34,420
again the function food is not defined
再次,功能性食品未在接触中定义,请参见“坚固性搜索”
118
00:05:34,420 --> 00:05:37,960
inside contact see so solidity searches
再次,功能性食品未在接触中定义,请参见“坚固性搜索”
119
00:05:37,960 --> 00:05:40,660
for the function food in the rightmost
在这种情况下,最右边的父合同中的功能食品为
120
00:05:40,660 --> 00:05:43,980
parent contract in this case contract be
在这种情况下,最右边的父合同中的功能食品为
121
00:05:43,980 --> 00:05:47,139
function food is defined inside contract
合同中定义了功能食品,因此坚固性称为此功能,并且
122
00:05:47,139 --> 00:05:50,200
be so solidity calls this function and
合同中定义了功能食品,因此坚固性称为此功能,并且
123
00:05:50,200 --> 00:05:52,690
it turns the string B and we get our
它将字符串B变成字符串,如果函数foo,我们将字符串V返回到此处
124
00:05:52,690 --> 00:05:55,660
string V back here if the function foo
它将字符串B变成字符串,如果函数foo,我们将字符串V返回到此处
125
00:05:55,660 --> 00:05:59,020
was not defined in contract B and the
未在合同B中定义,并且函数foo被称为合同D
126
00:05:59,020 --> 00:06:01,840
function foo was called a contract D
未在合同B中定义,并且函数foo被称为合同D
127
00:06:01,840 --> 00:06:04,870
then solidity will first search for the
然后坚固性将首先在合约D内搜索功能食物
128
00:06:04,870 --> 00:06:08,050
function food inside contract D next it
然后坚固性将首先在合约D内搜索功能食物
129
00:06:08,050 --> 00:06:09,820
will search for the function in the
在这种情况下,将在最右边的平移合约中搜索功能
130
00:06:09,820 --> 00:06:12,040
rightmost pan contract in this case
在这种情况下,将在最右边的平移合约中搜索功能
131
00:06:12,040 --> 00:06:14,980
contract C again the function foo is not
再次与合同C一起在合同C中未定义函数foo,因此具有坚固性
132
00:06:14,980 --> 00:06:18,190
defined inside contract C so solidity
再次与合同C一起在合同C中未定义函数foo,因此具有坚固性
133
00:06:18,190 --> 00:06:20,620
will search for that function in the
将在最右边的平移合约中搜索该功能
134
00:06:20,620 --> 00:06:22,120
rightmost pan contract
将在最右边的平移合约中搜索该功能
135
00:06:22,120 --> 00:06:25,180
in this case contract B function foo is
在这种情况下,合约B函数foo没有在合约内定义
136
00:06:25,180 --> 00:06:27,970
not defined inside contract be so
在这种情况下,合约B函数foo没有在合约内定义
137
00:06:27,970 --> 00:06:31,000
solidity comes back to contract C and
坚固性回到合同C,例如平底锅中的功能
138
00:06:31,000 --> 00:06:33,790
such as for the function in the pan
坚固性回到合同C,例如平底锅中的功能
139
00:06:33,790 --> 00:06:37,570
contract left of contract B in this case
在这种情况下,合同B的合同左,因为合同a定义了
140
00:06:37,570 --> 00:06:41,140
contract a since contract a defines the
在这种情况下,合同B的合同左,因为合同a定义了
141
00:06:41,140 --> 00:06:43,630
function foo this is the function that
函数foo这是被调用的函数,这是值
142
00:06:43,630 --> 00:06:45,910
is being called and this is the value
函数foo这是被调用的函数,这是值
143
00:06:45,910 --> 00:06:48,430
that's being returned
那是返回的,所以我们已经看到房屋Liddy覆盖
144
00:06:48,430 --> 00:06:51,250
so we've seen house Liddy overrides
那是返回的,所以我们已经看到房屋Liddy覆盖
145
00:06:51,250 --> 00:06:53,680
functions that are defined multiple
接下来在不同合约中多次定义的函数
146
00:06:53,680 --> 00:06:57,520
times in different contracts next let's
接下来在不同合约中多次定义的函数
147
00:06:57,520 --> 00:06:59,710
go over how to call functions of parent
仔细研究一下如何调用父合约的功能,但是在执行此操作之前,我要
148
00:06:59,710 --> 00:07:03,190
contracts but before we do that I want
仔细研究一下如何调用父合约的功能,但是在执行此操作之前,我要
149
00:07:03,190 --> 00:07:05,740
to first introduce you to feature
首先向您介绍功能不稳定(可以触发的事件)
150
00:07:05,740 --> 00:07:09,160
instability called events you can fire
首先向您介绍功能不稳定(可以触发的事件)
151
00:07:09,160 --> 00:07:11,800
events inside the function and these
函数内部的事件,这些事件将被记录到
152
00:07:11,800 --> 00:07:14,050
events will be recorded into the
函数内部的事件,这些事件将被记录到
153
00:07:14,050 --> 00:07:16,960
transaction logs so how is it useful to
交易日志,所以对我们现在有什么用,对我们的跟踪很有用
154
00:07:16,960 --> 00:07:20,380
us now it will be useful for us to trace
交易日志,所以对我们现在有什么用,对我们的跟踪很有用
155
00:07:20,380 --> 00:07:23,199
function calls I'll make another video
函数调用我将制作另一个有关事件主题的视频
156
00:07:23,199 --> 00:07:26,110
for the topic of events where we will
函数调用我将制作另一个有关事件主题的视频
157
00:07:26,110 --> 00:07:29,440
explore in more details for now I'll
现在详细探讨,我将向您展示如何声明事件
158
00:07:29,440 --> 00:07:31,570
just show you how to declare an event
现在详细探讨,我将向您展示如何声明事件
159
00:07:31,570 --> 00:07:34,300
file your event inside the function and
在函数中归档事件以及如何在事务中查看事件
160
00:07:34,300 --> 00:07:37,180
how to see event inside the transaction
在函数中归档事件以及如何在事务中查看事件
161
00:07:37,180 --> 00:07:40,270
log you can define an event by starting
日志中,您可以通过以下方式定义事件:以关键字event开头,然后以
162
00:07:40,270 --> 00:07:42,520
with the keyword event followed by the
日志中,您可以通过以下方式定义事件:以关键字event开头,然后以
163
00:07:42,520 --> 00:07:45,699
name of event that you want to define in
在这种情况下,您想要定义的事件的名称我将其命名为nog
164
00:07:45,699 --> 00:07:49,060
this case I'll just name it nog inside
在这种情况下,您想要定义的事件的名称我将其命名为nog
165
00:07:49,060 --> 00:07:51,130
the event you can pass parameters that
如果您可以传递您现在要登录的参数,那么真实的狗
166
00:07:51,130 --> 00:07:54,099
you want to log in nowadays real dog the
如果您可以传递您现在要登录的参数,那么真实的狗
167
00:07:54,099 --> 00:07:56,560
name of the function by passing it as a
通过将其作为字符串传递给您可以触发的函数内部的函数名称
168
00:07:56,560 --> 00:08:00,880
string inside the function you can fire
通过将其作为字符串传递给您可以触发的函数内部的函数名称
169
00:08:00,880 --> 00:08:03,160
the event by starting with the keyword
该事件以关键字email开头,后跟事件名称
170
00:08:03,160 --> 00:08:06,130
email followed by the name of the event
该事件以关键字email开头,后跟事件名称
171
00:08:06,130 --> 00:08:09,010
that you want to fire and passing in the
您想要触发并传递您想要的参数
172
00:08:09,010 --> 00:08:12,250
parameters that you want along
您想要触发并传递您想要的参数
173
00:08:12,250 --> 00:08:15,590
compile and deploy contract day and then
编译并部署合同日,然后执行功能foo,然后单击
174
00:08:15,590 --> 00:08:19,550
execute the function foo click on the
编译并部署合同日,然后执行功能foo,然后单击
175
00:08:19,550 --> 00:08:24,020
transaction dog and scroll down on the
交易狗并向下滚动狗,您可以看到该事件名为
176
00:08:24,020 --> 00:08:26,300
dogs you can see that the event named
交易狗并向下滚动狗,您可以看到该事件名为
177
00:08:26,300 --> 00:08:30,740
dog was fired with the message a dot foo
狗被解雇了一个消息,点号为foo
178
00:08:30,740 --> 00:08:33,250
was called
狗被解雇了一个消息,点号为foo
179
00:08:33,970 --> 00:08:36,250
and that's all you need to know about
这就是您现在需要了解的所有事件,所以现在让我们回到
180
00:08:36,250 --> 00:08:39,159
events for now so now let's go back to
这就是您现在需要了解的所有事件,所以现在让我们回到
181
00:08:39,159 --> 00:08:41,200
the topic of how to call parent
可以调用父合约的主题可以称为父合约
182
00:08:41,200 --> 00:08:44,200
contracts parent contracts can be called
可以调用父合约的主题可以称为父合约
183
00:08:44,200 --> 00:08:46,750
directly or by using the keyword super
直接或通过使用关键字super通过使用关键字super
184
00:08:46,750 --> 00:08:49,720
by using the keyword super all of the
直接或通过使用关键字super通过使用关键字super
185
00:08:49,720 --> 00:08:52,270
parent contracts will be called let's go
父合同将被称为让我们来看一个使用实际代码的示例
186
00:08:52,270 --> 00:08:54,220
through an example using actual code
父合同将被称为让我们来看一个使用实际代码的示例
187
00:08:54,220 --> 00:08:57,160
here we have contract II that inherits
在这里,我们有从合同a和合同继承的合同II
188
00:08:57,160 --> 00:09:01,090
from contract a and contract see also n
在这里,我们有从合同a和合同继承的合同II
189
00:09:01,090 --> 00:09:04,270
heads from contract a and contact e
合同a的负责人和联系人e从B和C继承而来
190
00:09:04,270 --> 00:09:08,020
inherits from both B and C next both
合同a的负责人和联系人e从B和C继承而来
191
00:09:08,020 --> 00:09:10,990
contract B and C overrides the function
当我们调用合约B和C时,合约B和C会覆盖合约a中的函数foo
192
00:09:10,990 --> 00:09:14,350
foo from contract a when we call the
当我们调用合约B和C时,合约B和C会覆盖合约a中的函数foo
193
00:09:14,350 --> 00:09:16,870
function foo on contact E we want to be
联系E上的函数foo,我们希望能够看到哪些父函数是
194
00:09:16,870 --> 00:09:19,180
able to see which parent functions were
联系E上的函数foo,我们希望能够看到哪些父函数是
195
00:09:19,180 --> 00:09:22,720
called so we'll fire any bank before
打电话给我们,所以我们会在调用母合同之前解雇任何银行
196
00:09:22,720 --> 00:09:26,190
calling the parent contract
打电话给我们,所以我们会在调用母合同之前解雇任何银行
197
00:09:28,170 --> 00:09:31,720
compile and deploy contract D and
编译和部署合同D并在内部执行功能食物
198
00:09:31,720 --> 00:09:33,760
execute the function food inside
编译和部署合同D并在内部执行功能食物
199
00:09:33,760 --> 00:09:36,540
contract D
合同D
200
00:09:40,630 --> 00:09:43,000
click on the transaction and scroll down
点击交易并向下滚动到您在交易模式下的日志