Callables.with_signature()

with_signature(signature: str) → Callables

Adds a filter to get callables that have the given signature. 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 signatures, refer to Callables.with_signatures().

Functions Example

from glider import *

def query():
  # Retrieve all functions with the signature `transferFrom(address,address,uint256)`
  functions = Functions().with_signature("transferFrom(address,address,uint256)").exec(100)

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

Output:

Modifiers Example

from glider import *

def query():
  # Retrieve all the modifiers with the signature `nonReentrant()`
  modifiers = Modifiers().with_signature("nonReentrant()").exec(100)

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

Output:

Last updated