|
|
|
@ -454,17 +454,21 @@ def _convert_type_contract(ir: Member) -> Assignment: |
|
|
|
|
assert isinstance(ir.variable_left.type, TypeInformation) |
|
|
|
|
contract = ir.variable_left.type.type |
|
|
|
|
|
|
|
|
|
scope = ir.node.scope |
|
|
|
|
scope = ir.node.file_scope |
|
|
|
|
|
|
|
|
|
if ir.variable_right == "creationCode": |
|
|
|
|
bytecode = scope.bytecode_init(contract.name) |
|
|
|
|
bytecode = scope.bytecode_init( |
|
|
|
|
ir.node.compilation_unit.crytic_compile_compilation_unit, contract.name |
|
|
|
|
) |
|
|
|
|
assignment = Assignment(ir.lvalue, Constant(str(bytecode)), ElementaryType("bytes")) |
|
|
|
|
assignment.set_expression(ir.expression) |
|
|
|
|
assignment.set_node(ir.node) |
|
|
|
|
assignment.lvalue.set_type(ElementaryType("bytes")) |
|
|
|
|
return assignment |
|
|
|
|
if ir.variable_right == "runtimeCode": |
|
|
|
|
bytecode = scope.bytecode_runtime(contract.name) |
|
|
|
|
bytecode = scope.bytecode_runtime( |
|
|
|
|
ir.node.compilation_unit.crytic_compile_compilation_unit, contract.name |
|
|
|
|
) |
|
|
|
|
assignment = Assignment(ir.lvalue, Constant(str(bytecode)), ElementaryType("bytes")) |
|
|
|
|
assignment.set_expression(ir.expression) |
|
|
|
|
assignment.set_node(ir.node) |
|
|
|
|