0

enter image description here

in picture 1, the last contract S6 when i call super.test() it returns only 5 (it calls only the most right parent contract), but on another code for example: contract H is F, G { function bar() public override(F, G) { super.bar(); when i call super.bar() it calls both parent contracts. Why is that can someone explain, im stuck on this for days

1 Answer 1

1

To make this work, you have to explicitly call S4.test() in S5:

function test() public pure virtual override returns (uint) {
    S4.test();
}

In general, I recommend using explicit contract names over the super keyword.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.