The function is the extended/inter-procedural variant of callee_functions(), meaning it works recursively. It returns the Functions object representing all the functions through which the function could be called.
The difference between extended_callee_functions() and callee_functions() the later one will only return direct callee functions, while the extended version will find all the functions recursively that eventually call the target function.
Example
from glider import*defquery():# find some internal function, at it will most probably have more callees functions =Functions().with_one_property([MethodProp.INTERNAL]).exec(1,1100)#lets take the first function from the result and return its extended_callee_functions output = functions[0].extended_callee_functions().exec()#print the code of the function, to be aware of whose callees we getprint(functions[0].source_code())return output
function_callOptionalReturn(IERC20 token,bytesmemory data) private {// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that// the target address contains contract code and also asserts for success in the low-level call.bytesmemory returndata =address(token).functionCall(data,"SafeERC20: low-level call failed");if (returndata.length >0) { // Return data is optional// solhint-disable-next-line max-line-lengthrequire(abi.decode(returndata, (bool)),"SafeERC20: ERC20 operation did not succeed"); } }
functionfunctionCallWithValue(address target,bytesmemory data,uint256 value,stringmemory errorMessage) internalreturns (bytesmemory) {require(address(this).balance >= value,"Address: insufficient balance for call");require(isContract(target),"Address: call to non-contract");// solhint-disable-next-line avoid-low-level-calls (bool success,bytesmemory returndata) = target.call{ value: value }(data);return_verifyCallResult(success, returndata, errorMessage); }
functionisContract(address account) internalviewreturns (bool) {// This method relies on extcodesize, which returns 0 for contracts in// construction, since the code is only stored at the end of the// constructor execution.uint256 size;// solhint-disable-next-line no-inline-assemblyassembly { size :=extcodesize(account) }return size >0; }
function_verifyCallResult(bool success,bytesmemory returndata,stringmemory errorMessage) privatepurereturns(bytesmemory) {if (success) {return returndata; } else {// Look for revert reason and bubble it up if presentif (returndata.length >0) {// The easiest way to bubble the revert reason is using memory via assembly// solhint-disable-next-line no-inline-assemblyassembly {let returndata_size :=mload(returndata)revert(add(32, returndata), returndata_size) } } else {revert(errorMessage); } } }