Skip to content

Latest commit

 

History

History
5 lines (3 loc) · 747 Bytes

Wrong_inheritance.md

File metadata and controls

5 lines (3 loc) · 747 Bytes

Solidity supports multiple inheritance, meaning that one contract can inherit several contracts. Multiple inheritance introduces ambiguity called Diamond Problem: if two or more base contracts define the same function, which one should be called in the child contract? Solidity deals with this ambiguity by using reverse C3 Linearization, which sets a priority between base contracts.

That way, base contracts have different priorities, so the order of inheritance matters. Neglecting inheritance order can lead to unexpected behavior.