The function returns all the local variables used (read/written) inside the Value.
Query Example
from glider import*defquery(): functions =Functions()\.with_name('stake')\.exec(2)for function in functions:for instruction in function.instructions().exec():for operand in instruction.get_operands(): local_vars = operand.get_local_vars()iflen(local_vars)>0:print([x.expression for x in local_vars])return functions
Example Output
"root":{3 items"contract":string"0x11faf8f647602f923672e2455322107a27acf9c1""contract_name":string"StakingContract""sol_function":solidityfunctionstake(address_collection,uint256[] calldata tokenIds) publicnonReentrant {require(allowedToStake[_collection],"Not allowed to stake for this collection");require(tokenIds.length >0,"tokenIds parameter has zero length.");uint256 _pendingRewards =pendingReward(_collection, msg.sender);if(_pendingRewards >0) {require(rtoken.transfer(msg.sender, _pendingRewards),"Reward Token Transfer is failed."); } userInfo[_collection][msg.sender].startBlock = block.number;for(uint256 i =0; i < tokenIds.length; i++) {require(IERC721(_collection).ownerOf(tokenIds[i]) == msg.sender,"Not Your NFT.");IERC721(_collection).transferFrom(msg.sender,address(this), tokenIds[i]); EnumerableSet.add(userInfo[_collection][msg.sender].tokenIds, tokenIds[i]); }emitStake(msg.sender, tokenIds.length); }}"root":{1 item"print_output":[7 items0:string"['_pendingRewards']"1:string"['_pendingRewards']"2:string"['i']"3:string"['i']"4:string"['i']"5:string"['i']"6:string"['i']"]}