The difference between the extended_next_instructions() function and next_instructions() is that this function works in an inter-procedural manner and returns all instructions following the current instruction in the CFG (control-flow-graph).
The function is intra-procedural, and follows function calls; for the intra-procedural variant of this function, use next_instructions().
require(currentAllowance >= amount,"ERC20: transfer amount exceeds allowance")
the function will return instructions from transferFrom(), as well as from _approve() and _msgSender().
Query Example
from glider import*defquery(): instructions =Functions().with_all_properties([MethodProp.INTERNAL]).instructions().with_callee_function_name('require').exec(1,2)return instructions +list(instructions[0].extended_previous_instructions())
Output Example
"root":{4 items"contract":string"0x5e6b2027f794a069bfa5e80195e22544d40ae600""contract_name":string"NATEHALLINAN""sol_function":solidityfunctiontransferFrom(address sender,address recipient,uint256 amount ) publicvirtualoverridereturns (bool) {_transfer(sender, recipient, amount);uint256 currentAllowance = _allowances[sender][_msgSender()];require(currentAllowance >= amount,"ERC20: transfer amount exceeds allowance");unchecked {_approve(sender,_msgSender(), currentAllowance - amount); }returntrue; }"sol_instruction":solidityrequire(currentAllowance >= amount,"ERC20: transfer amount exceeds allowance")},..."root":{4 items"contract":string"0x5e6b2027f794a069bfa5e80195e22544d40ae600""contract_name":string"NATEHALLINAN""sol_function":solidityfunction_approve(address owner,address spender,uint256 amount ) internalvirtual {require(owner !=address(0),"ERC20: approve from the zero address");require(spender !=address(0),"ERC20: approve to the zero address"); _allowances[owner][spender] = amount;emitApproval(owner, spender, amount); }"sol_instruction":solidityrequire(spender !=address(0),"ERC20: approve to the zero address")},..."root":{4 items"contract":string"0x5e6b2027f794a069bfa5e80195e22544d40ae600""contract_name":string"NATEHALLINAN""sol_function":solidityfunction_msgSender() internalviewvirtualreturns (address) {return msg.sender; }"sol_instruction":solidity{return msg.sender; }}...
The function returns APISet, instead of APIList, in case the result of the function is used as the return value of the query it must be casted to list()