Contract.parent_contracts()

Returns Contracts object for the contracts from which the contract was inherited directly.

parent_contracts() β†’ Contracts

Example query

from glider import *

def query():
  contracts = Contracts().exec(1, 1)
  
  names = []
  for contract in contracts:
    print(contract.name)

    parent_contracts = contract.parent_contracts().exec()

    for contract in parent_contracts:
      names.append(contract.name)

  return [{"names": names}]

Example output

{
  "names": [
    "Context"
  ]
}
{
  "print_output": [
    "Ownable"
  ]
}

Last updated