Functions.with_one_of_the_modifier_names()

with_one_of_the_modifier_names(names: List[str], sensitivity: bool = True) β†’ Functions

Adds a filter to get functions that have a modifier with one of the given names.

Example

from glider import *

def query():
  
  # Fetch a list of functions with modifiers from the given list
  functions = Functions().with_one_of_the_modifier_names(['onlyAdmin','onlyOwner']).exec(10)

  return functions

Output

[
  {
    "contract": "0x2d8bE62BF76F5c6962E0E44e93374786F329260c",
    "contract_name": "ComposableHolding",
    "sol_function": "function addInvestmentStrategy(address strategyAddress)\n    external\n    onlyAdmin\n    validAddress(strategyAddress)\n    {\n        investmentStrategies[strategyAddress] = true;\n    }"
  },
  {
    "contract": "0x2d8bE62BF76F5c6962E0E44e93374786F329260c",
    "contract_name": "ComposableHolding",
    "sol_function": "function addInvestmentStrategy(address strategyAddress)\n    external\n    onlyAdmin\n    validAddress(strategyAddress)\n    {\n        investmentStrategies[strategyAddress] = true;\n    }"
  }
]

Last updated