Inheritance Reading Assignment

  1. The base contract is the parent contract that child contracts inherit from.

  2. Public and internal functions are available for derived contracts.

  3. Multiple child contracts inherit from one parent contract.

1 Like
  1. The parent contract

  2. All public and internal scoped functions and state variables

  3. A single contract acts as a base contract for multiple derived contracts

1 Like
  1. The base contract is a single contract that acts as a base for derived contracts

  2. All public and internal scoped functions

  3. Where a single contract acts as a base for multiple derived contracts

1 Like
  1. What is the base contract? - It is the parent contract

  2. Which functions are available for derived contracts? - Polymorphism (Function / Contract)

  3. What is hierarchical inheritance? In this case a certain contract acts as the sole basis for multiple other contracts

1 Like
  1. What is the base contract?
  • The base contract is a contract from which a child contract inherits the variables, functions, modifiers, and events
  1. Which functions are available for derived contracts?
  • All public and internal scoped functions and state variables are available to derived contracts.
  1. What is hierarchical inheritance?
  • It is a contract inheritance where a single contract acts as a base contract for multiple derived contracts.
1 Like

Answers

  1. The base contract is the parent contract. It’s the contract that is inherited by derived (or child) contract, thanks to an “is-a” relationship (eg. iPhone is a Smartphone).

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

  3. A hierarchical inheritance is when a single parent contract is the base of multiple derived contracts.

1 Like
  1. The base contract is the parent contract of a derived one. For a given contract, if it inherits from another one, that which is inherited is the base contract. (quite a tong twister ^^ ).
  2. Derived contracts has access to all public and internal scoped functions
  3. Hierarchical inheritance happens when a contract is both parent and a child contract, so it derives from a contract and is the base for another contract. The relationships between all the contracts in the structure define the diagram of inheritance.
1 Like
  1. The base contract is the parent from which child (derived) contracts inherit functions and state variables.

  2. Derived contracts have access to Internal and public functions from the base contract. They also have access to external functions but i don’t think they inherit it.
    Private are only executable within the contract they are in.

  3. Hierarchical inheritance is like multi-level inheritance except there is only 1 parent. One base contract with x kids. (contract A, contract B is A, contract C is A…)

1 Like
  • What is the base contract?

A base contract, also known as a parent contract, is the first contract in a composition. Other contracts may inherit its code.

  • Which functions are available for derived contracts?

All public and scoped functions along with state variables are available to derived contracts. Derived contracts may use these functions by calling them with the ‘is’ keyword.

  • What is hierarchical inheritance?

Hierarchical inheritance is similar to ‘Single’ as there is a parent-child relationship between contracts however there can be multiple contracts that my be derived from the base contract.

1 Like

What is the base contract?
It is the parent contract which is inherited from

Which functions are available for derived contracts?
All public and internal scoped functions and state variables are available to derived contracts

What is hierarchical inheritance?
It is when a contract acts a base contract for multiple different contracts. Similar to a Mother with multiple children.

2 Likes
  1. The parent contract.
  2. All public and internal scoped functions and state variables are available to derived contracts.
  3. When a single contract acts as a base contract for multiple derived contracts.
2 Likes
  1. The contract that is inherited is the parent contrat=base contract
  2. Available are all public and internal functions, also all state variables
    3.Hierarchical inheritance is a single contract acts as a base contract for multiple derived contracts.
2 Likes
  1. Base contract referse to mixing or combining multiple contracts or data types together.

  2. Puplic or internal are avalible.

  3. Hierarchical inheritance is when a single contract is inheited by mutiple contracts.

1 Like

Glenn_CostaRica

1. What is the base contract?
The base contract – or parent contract – is the contract whose properties and functions are inherited by another contract, the derived contract – or child --.

2. Which functions are available for derived contracts?
The derived contract has – or can have – its own functions like any other contract. It also inherits the functions of its parents and also the functions of the parents of its parents.

3. What is hierarchical inheritance?
Inheritance – or simple inheritance – is a process through which a contract known as a “child contract” or “derived contract” acquires all the properties and functions of another contract of relatively higher level, a “parent contract” or “base contract”. Through inheritance, Solidity copies the base contract into the derived contract and a single contract is created. So, let’s say A contract is a parent contract and B contract is a child (A=Parent and B=child). In Solidity, A is contained inside B. In code we represent this like: contract A {…} and contract B is A {…} where it can be seen how A is absorbed by B. Hierarchical inheritance is the process where there are more levels on inherited contracts: three or more levels. This means that we can have a contract C that inherits from a contract B that inherits from a contract A: contract A {…} and contract B is A {…} and contract C is B {…}! Of course, there can be another contract D that inherits from C, and so on.

1 Like
  1. The parent contract - the one from which the child contracts are derived.
  2. All public and internal scoped functions and state variables from the parent contract are available in child contracts.
  3. When a single contract acts as a base contract for multiple derived contracts.
1 Like
  1. Base contract is contract from which other contacts inherit
  2. All public and internal functions from base contract
  3. Hierarchial inheritance is a type of inhheritence where we have a single base contract with multiple branches of child contracts
1 Like
  1. The base contract is the ‘father’ contract from where other ‘children’ contracts are inherited from.

  2. The functions available for derived contracts are public or internal.

  3. Hierarchical inheritance is assumed when circumstances like : big ‘father’ contract has ‘children’ contracts derived .

1 Like
  1. Base contract is the parent contract in a parent-child relationship between smart contracts.

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

  3. In hierarchical inheritance, a single contract acts as a base contract for multiple derived contracts.

1 Like
  1. What is the base contract?
    A) A contract that other contracts inherit functions and state variables from.

  2. Which functions are available for derived contracts?
    A) The public and internal functions of the base contract from which they are derived

  3. What is hierarchical inheritance?
    A) Two or more contracts directly derived from the base contract

1 Like
  1. The base contract is the top parent contract (root)
  2. public and internal
  3. it’s when each child has exactly one parent (no multiple parents)
1 Like