Inheritance Reading Assignment

Read through the blog post linked in the lecture, then answer the following questions. Post your answers in this forum thread.

  1. What is the base contract?
  2. Which functions are available for derived contracts?
  3. What is hierarchical inheritance?
20 Likes
  1. What is the base contract?: the parent contract.
  2. Which functions are available for derived contracts?: Polymorphism
  3. What is hierarchical inheritance?: It is similar to simple inheritance
2 Likes
  1. The contract that is inherited is the parent contrat=base contract
    2.All public and internal scoped functions (as well as state variables) are available for derived contracts.
    3.In hierarchical inheritance, single contract acts as a base contract for multiple derived contracts.
3 Likes
  1. What is the base contract?

The contract that is inherited is the parent contract

  1. Which functions are available for derived contracts?

.All public and internal functions and state variables are available for derived contracts.

  1. What is hierarchical inheritance?

Hierarchical inheritance is again similar to simple inheritance. Here, however, a single contract acts as a base contract for multiple derived contracts.

2 Likes
  1. What is the base contract?
    parent contract or base contract
  2. Which functions are available for derived contracts?
    available are all public and internal functions, also all state variables
  3. What is hierarchical inheritance?
    single contract act as a base contract for multiple derived (child) contracts
2 Likes
  1. The base contract is the parent contract. Also known as the contract from which the child contracts, or derived contracts, derive public and internal functions, state variables, modifiers, and events.

  2. Functions defined using the public or internal scope.

  3. It’s a type of inheritance where instead of one parent contract and one child contract, there is one parent contract and multiple child contracts deriving from it.

2 Likes

Inheritance - Reading Assignment

1. What is the base contract?

  • The base contract is the parent contract. It is the contract that is inherited.

2. Which functions are available for derived contracts?

  • All public and internal scoped functions are available in a derived contract.

3.What is hierarchical inheritance?

  • It is when a parent contract acts as base contract for multiple child contracts (derived contracts).
8 Likes

1. What is the base contract?

The base contract is the parent from which the child contract(s) derive from.

2. Which functions are available for derived contracts?

The child contract inherits all functions and state variables with visibility public or internal.

3. What is hierarchical inheritance?

Hierarchical inheritance occurs when the graph of parent child relationships between contracts has multiple branches. I.e “B is A”, “C is A”, and “D is B”. This can also lead to multiple inheritance where branches converge- i.e. “E is A, B, C, D”.

2 Likes
  1. What is the base contract? the parent contract
  2. Which functions are available for derived contracts? all public and internal scoped
    functions and state variables are available to derived contracts.
  3. What is hierarchical inheritance? Hierarchical inheritance is a single contract acts as a base contract for multiple derived contracts.
1 Like

1 Like
  1. The parent contract is known as a base contract .Inheritance is mostly about code-reusability.
  2. There is a is-a relationship between base and derived contracts and all public and internal scoped
    functions and state variables are available to derived contracts.
  3. A single contract acts as a base contract for multiple derived contracts.
1 Like

1.What is the base contract?
It is a Parent Contract.
2.Which functions are available for derived contracts?
All public and internal scoped functions and state variables are available to derived contracts.
3.What is hierarchical inheritance?
A single contract acts as a base contract for multiple derived contracts.

1 Like
  1. What is the base contract? The parent contract is known as the base contract which is inherited.
  2. Which functions are available for derived contracts? All public and internal scoped functions are available for derived contracts.
  3. What is hierarchical inheritance? In a hierarchical inheritance a single contract acts as a base contract for multiple derived contracts.
1 Like
  1. The base contract, also called “father” contract is the contract which will have other contract/s that inherit/s variables / functions / modifiers and events to his son/child.

  2. public and internal functions;

  3. Contract A{}
    Contract B is A{}
    Contract C is A {}

1 Like

image

2 Likes
  1. It is the parent contract that future contracts derive from.
  2. All the functions in the parent contract are available for the child contracts.
  3. Hierarchical inheritance is like having multiple children. They come from the same parent but are different from one another.
2 Likes
  1. What is the base contract?
    The parent contract that all further (child) contracts will derive from.
  2. Which functions are available for derived contracts?
    All public and internal scoped functions and state variables are available to derived contracts.
  3. What is hierarchical inheritance?
    A single contract acts as a base contract for multiple derived contracts.
1 Like
  1. What is the base contract?

It has to do with inheritance. It is the contract from where other contracts inherit the features.

  1. Which functions are available for derived contracts?

All public and internal scoped functions.

  1. What is hierarchical inheritance?

It is similar to simple inheritance. However, in hierarchical inheritance a single contract “A” acts as a base contract for multiple derived contracts such as “B”, “C” and “D” for instance.

2 Likes
  1. What is the base contract?

It’s the parent contract, where a child contract inherits from.

  1. Which functions are available for derived contracts?

All public and internal scoped functions of the base contract (same goes for internal and public state of the base contract)

  1. What is hierarchical inheritance?

When multiple contracts use the same base contract.

3 Likes
  1. a base contract is a contract that is the parent to other contracts that derive from it.
  2. all functions that are not private in the parent contracts.
  3. When a contract is the parent to multiple other contracts.
2 Likes