Callables.with_arg_type()

with_arg_type(arg_type: str, sensitivity: bool = True) → Callables

Adds a filter to get callables having specified argument type like "address" or even non-elementary types like structs. Returns a filtered Callables child object. This method can be called on all Callables child classes: Functions and Modifiers.

To filter given a list of argument types, refer to Callables.with_arg_types().

Note that the function will handle alias types, e.g. if uint256 is passed to the function, the results will also include the alias "uint" variables

Functions Example

from glider import *

def query():
  # Retrieve the functions that have `Order` as one of their argument types
  functions = Functions().with_arg_type("Order").exec(100)

  # Return the first five functions
  return functions[:5]

Output:

Modifiers Example

from glider import *

def query():
  # Retrieve the modifiers that have `Set` as one of their argument types
  modifiers = Modifiers().with_arg_type("State").exec(100)

  # Return the first five modifiers
  return modifiers[:5]

Output:

Last updated