Inheritance Reading Assignment

  1. What is the base contract?

It is a contract that can be inherited

  1. Which functions are available for derived contracts?

All the functions of the parent contract

  1. What is hierarchical inheritance?

Derived contracts that inherit the same base contract

1 Like
  • What is the base contract?

The base contract is that which is inherited. The child contract inherits the parent contract which is also known as the ‘base contract’.

  • Which functions are available for derived contracts?

The derived contract makes available all public and internal scoped functions and state variables of the base contract

  • What is hierarchical inheritance?

In the event when a single base contract provides inheritance to multiple derived contracts, this is known as hierarchical inheritance.
[/quote]

1 Like
  1. The base contract is the parent contract or the contract from which a contract is inherited from.

  2. Public and internal scoped functions.

  3. Hierarchical inheritance is when a single contract serves as a base contract for multiple child contracts.

1 Like
  1. What is the base contract?
  • The inherited parent of the inherits child: the parent is ‘copied’ into the derived child contract
  1. Which functions are available for derived contracts?
  • All public & internal scoped functions and state variables
  1. What is hierarchical inheritance?
  • Contract A { … }
    Contract B is A { … }
    Contract C is A { … }
  • Meaning contract A is copied into B and into C
1 Like
  1. The contract that is inherited is called the parent contract or base contract
  2. All functions (public and internal ) 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?
    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 and state variables
  3. What is hierarchical inheritance?
    This is where a single contract acts as a base for multiple contracts
1 Like
1. What is the base contract?

The base contract is the contract that is inherited, also known as the parent contract.

2. Which functions are available for derived contracts?

Derived contracts have access to all public or internal scoped functions and state variables from the base contract.

3. What is hierarchical inheritance?

When a single contract acts as a base contract for multiple derived contracts.

1 Like
  1. What is the base contract?
    A. A Base contract is the parent contract. It is inherited by the Child contract.

  2. Which functions are available for derived contracts?
    A. Public and internal functions are available for derived contracts.

  3. What is hierarchical inheritance?
    A. A parent contract being inherited by more than one child contract.

1 Like

What is the base contract?
a contract that is inherited buy a child contract

Which functions are available for derived contracts?
public, internal functions and state variables are available

What is hierarchical inheritance?
Multiple contracts inherit a base contract

1 Like
  1. Parent contract

  2. Public and internal

  3. Parent with more than one child

1 Like
  1. What is the base contract?
    The base contract is the parent contract - which is the the contract that any other inheriting contracts ultimately inherit from (whether directly or indirectly).

  2. Which functions are available for derived contracts?
    All public and internal scoped functions are available to derived contracts.

  3. What is hierarchical inheritance?
    Hierarchical inheritance is when a base contract has multiple contracts inheriting from it - not where C is derived from B which is derived from A (multi-level), but where B and C are both directly derived from A.

1 Like

Answer:

  1. Base contract is a so-called parent contract. All the functions and state variables are available inside derived contract or child contract.
  2. All public and internal functions inside the base contract are available inside the derived contracts.
  3. Hierarchical inheritance is a type of inheritance when two or more derived contracts have one parent/base contract.
1 Like
  1. A base contract is a parent contract that all of its child contracts inherit from. They can inherit variables, functions, modifiers and events from the base contract.
  2. Functions that are defined by parent contracts using the public or internal scope are available to derived contracts.
  3. Hierarchical inheritance describes the relationship between contracts where a single contract acts as a base for multiple derived contracts.
1 Like

What is the base contract?
The parent contract
Which functions are available for derived contracts?
All public and internal functions and state variables are available.
What is hierarchical inheritance?
A single contract acts as a base contract for multiple derived contracts.

2 Likes
  1. the parent contract

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

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

1 Like
  1. What is the base contract?

Base contract also know as the Parent Contract, contain the base logic and functions for the smart contract usage. This contract will determinate the address to use in order to interact with the SC. Base contracts can be inherit from the child-contracts in order to use the functionalities.

  1. Which functions are available for derived contracts?

Public and internal functions.

  1. What is hierarchical inheritance?

Hierarchical inheritance is when the base contract is inherit by child contracts in single or multiple branches. For example : single when A is B and multiple when C is A,B

2 Likes
  1. What is the base contract?
    The base contract is the top parent contract in a inheritance hierarchy.

  2. Which functions are available for derived contracts?
    Derived contracts have access to all functions from their parent contract as wells as their parent’s parent contacts.

  3. What is hierarchical inheritance?
    It’s a multi layer inheritance in which a contract inherits functions from a parent contract which it itself inherits from another contract. This could go on for multiple layers but the children contract will inherit all properties of the parent-grandparent contracts.

1 Like
  1. What is the base contract?
    The base contract is the root of any contract, and of all inheritance. Also known as the parent contract

  2. Which functions are available for derived contracts?
    All public and internal scoped functions and state variables of the base contract

  3. What is hierarchical inheritance?
    It’s a way of describing forks in the line of inheritance. I.e several child contracts don’t necessarily inherit the same conditions.

1 Like
  1. The base contract is the top level in the taxonomy of derived contracts.
  2. Derived contracts can access all public and internal methods of parent contracts.
  3. Hierarchical inheritance is when multiple contracts are derived from the same base contract.
1 Like
  1. What is the base contract?

It is the parent contract that derive data to the child contract.

  1. Which functions are available for derived contracts?

Public and internal functions, state variables, modifiers and events.

  1. What is hierarchical inheritance?

Its when a single contract is base for more derived contracts.

1 Like