A global function is defined outside of any contract scope.
An example of a global function is:
pragmasolidity ^0.7.0;// solhint-disable/** * @dev Reverts if `condition` is false, with a revert reason containing `errorCode`. Only codes up to 999 are * supported. */function_require(bool condition,uint256 errorCode) pure {if (!condition) _revert(errorCode);}
An example query to filter these functions:
from glider import*defquery(): props_included = [MethodProp.IS_GLOBAL] functions =Functions()\.with_all_properties(props_included)\.exec(1)print(functions[0].source_code())print(functions[0].address())return []
Output:
"root":{1 item"print_output":[2 items0:string"function_require(bool condition,uint256 errorCode) pure {if (!condition) _revert(errorCode);}"1:string"0x0d968094e386f9fbfb3797655ab8e4672c2cb737"]}