|
|
|
@ -311,10 +311,10 @@ def parse_expression(expression: Dict, caller_context) -> "Expression": |
|
|
|
|
|
|
|
|
|
if isinstance(expression, Call): |
|
|
|
|
called = parse_expression(expression.func, caller_context) |
|
|
|
|
|
|
|
|
|
if isinstance(called, Identifier) and isinstance(called.value, SolidityFunction): |
|
|
|
|
if called.value.name == "empty()": |
|
|
|
|
type_to = parse_type(expression.args[0], caller_context) |
|
|
|
|
# TODO figure out how to represent this type argument |
|
|
|
|
parsed_expr = CallExpression(called, [], str(type_to)) |
|
|
|
|
parsed_expr.set_offset(expression.src, caller_context.compilation_unit) |
|
|
|
|
return parsed_expr |
|
|
|
@ -355,7 +355,19 @@ def parse_expression(expression: Dict, caller_context) -> "Expression": |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
return parsed_expr |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
elif called.value.name == "raw_call()": |
|
|
|
|
args = [parse_expression(a, caller_context) for a in expression.args] |
|
|
|
|
# This is treated specially in order to force `extract_tmp_call` to treat this as a `HighLevelCall` which will be converted |
|
|
|
|
# to a `LowLevelCall` by `convert_to_low_level`. This is an artifact of the late conversion of Solidity... |
|
|
|
|
call = CallExpression(MemberAccess("raw_call", "tuple(bool,bytes32)", args[0]), args[1:], "tuple(bool,bytes32)") |
|
|
|
|
call.set_offset(expression.src, caller_context.compilation_unit) |
|
|
|
|
call.call_value = next(iter(parse_expression(x.value, caller_context) for x in expression.keywords if x.arg == "value"), None) |
|
|
|
|
call.call_gas = next(iter(parse_expression(x.value, caller_context) for x in expression.keywords if x.arg == "gas"), None) |
|
|
|
|
# TODO handle `max_outsize` keyword |
|
|
|
|
|
|
|
|
|
return call |
|
|
|
|
|
|
|
|
|
if expression.args and isinstance(expression.args[0], VyDict): |
|
|
|
|
arguments = [] |
|
|
|
|
for val in expression.args[0].values: |
|
|
|
|