CallGraph.name_prefix()

name_prefix(suffix: str, sensitivity: bool = True) β†’ List[CallNode]

Returns a list of CallNode objects whose corresponding function name has the specified prefix.

Return type

β†’ List[CallNode]

from glider import *

def query():
  # Fetch the first contract
  contracts = Contracts().exec(1)
  
  # Get call nodes of functions starting with "_msgSend" 
  call_nodes = contracts[0].call_graph().name_prefix("_msgSend")
  for node in call_nodes:
    print(node.callable_name())
  return []

Output:

{
  "print_output": [
    "_msgSender"
  ]
}

Last updated