Call.get_name()
Returns the name of the function being called.
get_name() → str
Query Example
from glider import *
def query():
instructions = Instructions().calls().exec(2)
for entry_ins in instructions:
for call in entry_ins.get_callee_values():
print(call.get_name(), call.expression)
return instructions
Output
"root":{4 items
"contract":string"0xd705c24267ed3c55458160104994c55c6492dfcf"
"contract_name":string"SafeMath"
"sol_function":solidity
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
"sol_instruction":solidity
require(c >= a, "SafeMath: addition overflow")
}
"root":{4 items
"contract":string"0xd705c24267ed3c55458160104994c55c6492dfcf"
"contract_name":string"SafeMath"
"sol_function":solidity
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
"sol_instruction":solidity
return sub(a, b, "SafeMath: subtraction overflow")
}
"root":{1 item
"print_output":[4 items
0:string"require"
1:string"require(bool,string)(c >= a,"SafeMath: addition overflow")"
2:string"sub"
3:string"sub(a,b,"SafeMath: subtraction overflow")"
]
}
Last updated