4th Street Bar Hive-Bar

Hive-Bar Powered by Hive beta-fdb5b5b

Community post

Step 3: Solidity Heredity Simply Explained

10.png
Now we have created a simple Smart Contract with a few get and set functions. Now we can extend our simple contract by inheritance. This will give us a general extension of functionality from one contract to the other. With Solidity Smart Contract Heredity, we don’t have to define any additional functions in our own contract, we can simply access functions from other Smart Contracts.

Solidity Smart Contract Heredity Simply Explained

We now want to inherit “MyFirstContract” from our first contract. This will make it the so-called upper class. All classes or contracts inherited from it will automatically become its subclass. The subclasses inherit all methods, properties and fields from the superclass without having to create them again.

This means that we do not have to define any additional functions in our own contract, but can simply access functions of the superclasses.

How does it all work now?

This article will answer all your questions: Solidity heredity simply explained

1 upvotes $0.00

Replies (0)

Conversation

No replies yet

Replies will appear here as people join the conversation.

Review before signing

Posting as . Signing with . Keychain permission: Posting. Hive Keychain will ask you to approve this action next.


  
Technical details

Operation fingerprint: