From 90f2de8555ddf83a233af52108b25327f5a7e7e1 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Thu, 26 Sep 2019 22:48:10 +0100 Subject: [PATCH] Fix typehints for latest mypy release (#1221) --- mythril/analysis/modules/unchecked_retval.py | 8 ++------ mythril/laser/ethereum/state/calldata.py | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/mythril/analysis/modules/unchecked_retval.py b/mythril/analysis/modules/unchecked_retval.py index 678f329c..5aa8f005 100644 --- a/mythril/analysis/modules/unchecked_retval.py +++ b/mythril/analysis/modules/unchecked_retval.py @@ -116,13 +116,9 @@ class UncheckedRetvalModule(DetectionModule): assert state.environment.code.instruction_list[state.mstate.pc - 1][ "opcode" ] in ["CALL", "DELEGATECALL", "STATICCALL", "CALLCODE"] - retval = state.mstate.stack[-1] - # Use Typed Dict after release of mypy 0.670 and remove type ignore + return_value = state.mstate.stack[-1] retvals.append( - { # type: ignore - "address": state.instruction["address"] - 1, - "retval": retval, - } + {"address": state.instruction["address"] - 1, "retval": return_value} ) return [] diff --git a/mythril/laser/ethereum/state/calldata.py b/mythril/laser/ethereum/state/calldata.py index a8ebfa2b..f7fa0036 100644 --- a/mythril/laser/ethereum/state/calldata.py +++ b/mythril/laser/ethereum/state/calldata.py @@ -70,7 +70,7 @@ class BaseCalldata: try: current_index = ( start - if isinstance(start, Expression) + if isinstance(start, BitVec) else symbol_factory.BitVecVal(start, 256) ) parts = []