Calling Parent Functions | Solidity 0.8

  Рет қаралды 9,146

Smart Contract Programmer

Smart Contract Programmer

Күн бұрын

Пікірлер: 20
@ariisichoix5795
@ariisichoix5795 2 жыл бұрын
You are such an important ressource for all the blockchain industry ! no kidding, the way you explain solidity is so CLEAR ! Thank you El. Professor
@zes7215
@zes7215 2 жыл бұрын
no such thing as imx or callx or parentx or inherix or genx or etc, ts just macx, nonerx, ceuxyuax, do, be, say, can do, be, say any nmw and any s perfx
@lkd982
@lkd982 2 жыл бұрын
These tutorials are a marvel of methodical consistency
@orleee
@orleee 2 жыл бұрын
thank you for explaining this in a simple and to the point way ,
@gosuto-inzasheru
@gosuto-inzasheru 2 жыл бұрын
aaaand another perfect explanation!
@FCXPERT10
@FCXPERT10 2 жыл бұрын
👍..keep making tutorials on solidity ..it helps the community to grow
@romanrogers1647
@romanrogers1647 2 жыл бұрын
Thanks for this! When calling super.bar() inside contract H, why is it calling contract G instead of contract F? Is this because G's functionality is the highest function on the stack and is therefore called first, and then we skip H's call because it's noted as a duplicate?
@Bruhne
@Bruhne Жыл бұрын
Got it!
@abithshaji7862
@abithshaji7862 Жыл бұрын
You have used event here. Does it not work if we have a return statement? I mean for a function that returns something.
@Ts2pc
@Ts2pc 2 жыл бұрын
May I ask why ? after calling the function bar, I thought there will be two e.bar , but only e.bar is logged? Thanks in advance!
@thanhvuong3385
@thanhvuong3385 9 ай бұрын
I also think like this, have you find out the reason?
@thanhvuong3385
@thanhvuong3385 9 ай бұрын
@@Ts2pc man it's 1 year ago, do you working in this blockchain field?
@ViktorNaychev
@ViktorNaychev Ай бұрын
The super keyword in Solidity refers to the next parent in the inheritance chain, not necessarily the immediate parent. In this context, Solidity uses a C3 Linearization algorithm to determine the order in which parent contracts are called. C3 linearization ensures that each parent contract in the inheritance tree is called exactly once, even if there are multiple paths to that parent. - explanation generated from GPT-4o
@MrCoreyTexas
@MrCoreyTexas 5 ай бұрын
I don't think you should create such complicated multiple inheritance graphs. For one thing, I was surprised to learn that calling bar() on H called G.bar() and then F.bar(); from the way things have worked until now, it would seem it would do F.bar() then G.bar(), in other words, left to right. I consider this a design error in solidity! I would also have expected E.bar() to be called twice, not once - because both F.bar() and G.bar() call the function with super. More proof that multiple inheritance can get really complex and hard to reason about. Imagine an even more complex inheritance graph and trying to figure out the order of things.
@smartcontractprogrammer
@smartcontractprogrammer 5 ай бұрын
Yes, you shouldn't create a complicated inheritance in your code. This was an example to illustrate how inheritance behaves in Solidity
@ViktorNaychev
@ViktorNaychev Ай бұрын
The super keyword in Solidity refers to the next parent in the inheritance chain, not necessarily the immediate parent. In this context, Solidity uses a C3 Linearization algorithm to determine the order in which parent contracts are called. C3 linearization ensures that each parent contract in the inheritance tree is called exactly once, even if there are multiple paths to that parent. - explanation generated from GPT-4o
@jhaymes8220
@jhaymes8220 2 жыл бұрын
Is there a way I I can inherit a contract and only to only use one of its functions?
@smartcontractprogrammer
@smartcontractprogrammer 2 жыл бұрын
Parent.func() ?
@thanhvuong3385
@thanhvuong3385 9 ай бұрын
@@smartcontractprogrammer I think he mean that the child contract only be able to call 1 func from parent contract. So in parent contract we can set others function as private right?
Calling Parent Constructors | Solidity 0.8
5:02
Smart Contract Programmer
Рет қаралды 10 М.
Visibility | Solidity 0.8
6:06
Smart Contract Programmer
Рет қаралды 9 М.
The Singing Challenge #joker #Harriet Quinn
00:35
佐助与鸣人
Рет қаралды 37 МЛН
Multiple Inheritances | Solidity 0.8
4:34
Smart Contract Programmer
Рет қаралды 10 М.
doing leetcode everyday until I get a job (day 40)
3:57
John Wilkins
Рет қаралды 94
Inheritance | Solidity 0.8
4:00
Smart Contract Programmer
Рет қаралды 14 М.
Fallback | Solidity 0.8
5:21
Smart Contract Programmer
Рет қаралды 20 М.
5 Signs of an Inexperienced Self-Taught Developer (and how to fix)
8:40
IPC: To Share Memory Or To Send Messages
14:15
Core Dumped
Рет қаралды 39 М.
Call | Solidity 0.8
7:45
Smart Contract Programmer
Рет қаралды 21 М.
Delegatecall | Solidity 0.8
9:26
Smart Contract Programmer
Рет қаралды 25 М.
Library | Solidity 0.8
6:18
Smart Contract Programmer
Рет қаралды 13 М.
90 FPS ЗА 30.000 РУБЛЕЙ
9:06
Игорь Линк
Рет қаралды 75 М.
Low Battery 🪫🥹🥹🥹
0:10
dednahype
Рет қаралды 7 МЛН
IPHONE OR XIAOMI OR NOKIA?!!😂📱
0:33
Kan Andrey
Рет қаралды 3,4 МЛН
Nokia....
0:16
NEXIDO EDITS
Рет қаралды 9 МЛН
Apple Intelligence vs Galaxy Ai✨ #Shorts
0:19
lifegoodd
Рет қаралды 3,6 МЛН
Is this the latest iPhone model#shorts
0:13
Si pamerR
Рет қаралды 1,5 МЛН