Instruction.get_parent()

Returns parent function/modifier of the instruction.

get_parent() β†’ Callable | NoneObject

The function returns a Callable object, specifically either a Function or Modifier object, where the current instruction is placed.

Query Example

from glider import *
def query():
  #return the parent function/modifier of an instruction
  return [Instructions().exec(1)[0].get_parent()]

Output

{
    "contract": "0x798AcB51D8FBc97328835eE2027047a8B54533AD", 
    "contract_name": "Context", 
    "sol_function": "function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }"
}

Last updated