0

This question already has an answer here:

interface I { }

contract A is I { }

contract B is A { }

contract C is A { }

contract D is B, C { }

What would happen in this situation? How is this kind of diamond inheritance resolved in solidity? Should I be aware of any "gotchas"?

marked as duplicate by shane, Richard Horrocks, Achala Dissanayake, Briomkez, Aquila Oct 25 '18 at 20:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

From the docs: The order in which the base classes are listed matters. C will override B to the extent they share content in common.

For 'gotchas:' If there are multiple different kinds of functions with the same name, an error might be produced; details are here (reposted in part under GPL):

When the inheritance results in a contract with a function and a modifier of the same name, it is considered as an error. This error is produced also by an event and a modifier of the same name, and a function and an event of the same name. As an exception, a state variable getter can override a public function.

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