From 6834d4c78767d21efea51e557125066629bc3d23 Mon Sep 17 00:00:00 2001 From: Josselin Date: Mon, 13 May 2019 11:28:03 +0100 Subject: [PATCH] Improve type propagation for variable acceded through base contract name --- slither/slithir/convert.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/slither/slithir/convert.py b/slither/slithir/convert.py index 31b141a57..a1b15d5b5 100644 --- a/slither/slithir/convert.py +++ b/slither/slithir/convert.py @@ -426,6 +426,12 @@ def propagate_types(ir, node): f = next((f for f in type_t.functions if f.name == ir.variable_right), None) if f: ir.lvalue.set_type(f) + else: + # Allow propgation for variable access through contract's nale + # like Base_contract.my_variable + v = next((v for v in type_t.state_variables if v.name == ir.variable_right), None) + if v: + ir.lvalue.set_type(v.type) elif isinstance(ir, NewArray): ir.lvalue.set_type(ir.array_type) elif isinstance(ir, NewContract):