Adds a filter to get callables having specified name. Returns a filtered Callables child object. This method can be called on all Callables child classes: Functions and Modifiers.
from glider import*defquery():# Retrieve the functions named `distributeFunds` functions =Functions().with_name("distributeFunds").exec(100)# Return the first five functionsreturn functions[0:5]
from glider import*defquery():# Retrieve the modifiers named `onlyCaller` modifiers =Modifiers().with_name("onlyCaller").exec(100)# Return the first five modifiersreturn modifiers[0:5]
Output:
[ {"contract":"0x7386A87c0ccF7C6d03172B110E58965c26Db221B","contract_name":"BridgeStorage","sol_modifier":"modifier onlyCaller() {\n require(msg.sender == caller,\"only use main contract to call\");\n _;\n }" }, {"contract":"0x7386A87c0ccF7C6d03172B110E58965c26Db221B","contract_name":"BridgeLogic","sol_modifier":"modifier onlyCaller(){\n require(msg.sender == caller,\"only main contract can call\");\n _;\n }" }, {"contract":"0xba0c2df7c1b5abbc3c058f40b18f5c3940b24122","contract_name":"Presale01","sol_modifier":"modifier onlyCaller() {\n require(CALLER == msg.sender,\"NOT PRESALE CALLER\");\n _;\n }" }]