Skip to Content
Ethereum Smart Contract Development
book

Ethereum Smart Contract Development

by Mayukh Mukhopadhyay
February 2018
Intermediate to advanced
288 pages
6h 58m
English
Packt Publishing
Content preview from Ethereum Smart Contract Development

Inheritance

Solidity imitates the Python language, in the context of inheritance. It supports general inheritance, multiple inheritance, and polymorphism. In simple words, inheritance is the property where a contract copies properties from a parent contract. In the case of multiple inheritance, a contract copies properties from more than one contract. Polymorphism denotes a general contract that can be reused by many other contracts.

For example, a contract, eat(), can be used by both human() contract and birds(), as well as animal() contracts. In solidity, IS is the keyword used for inheritance of contracts.

Multiple inheritances sometimes lead to deadlock problems. Figure 6.6 illustrates this problem in terms of solidity, which gives the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Building Games with Ethereum Smart Contracts: Intermediate Projects for Solidity Developers

Building Games with Ethereum Smart Contracts: Intermediate Projects for Solidity Developers

Kedar Iyer, Chris Dannen

Publisher Resources

ISBN: 9781788473040Supplemental Content