Skip to main content
2 of 2
Improve formatting
Paul Razvan Berg
  • 18.7k
  • 6
  • 79
  • 148

1. Do I need to call the parent constructor in B's constructor to initialize the value owner in A

Unless you are passing arguments to a constructor, you do not need to explicitly call it. Assigning owner = msg.sender will be evaluated when the contract is deployed

2. Does B need its own address, or will it just use A's as its own?

Using Inheritance in Solidity will bundle your code together and deploy it under a single contract

From the solidity docs:

When a contract inherits from multiple contracts, only a single contract is created on the blockchain, and the code from all the base contracts is copied into the created contract.