From 455cdd16f52530b14e1ad0f76b4ca2d983615a02 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Sun, 24 Oct 2021 19:29:00 +0100 Subject: [PATCH] Fix issue with calldatasize (#1537) --- mythril/laser/ethereum/instructions.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/mythril/laser/ethereum/instructions.py b/mythril/laser/ethereum/instructions.py index 88b3676f..adc3be60 100644 --- a/mythril/laser/ethereum/instructions.py +++ b/mythril/laser/ethereum/instructions.py @@ -779,15 +779,7 @@ class Instruction: :param global_state: :return: """ - state = global_state.mstate - environment = global_state.environment - - if isinstance(global_state.current_transaction, ContractCreationTransaction): - log.debug("Attempt to use CALLDATASIZE in creation transaction") - state.stack.append(0) - else: - state.stack.append(environment.calldata.calldatasize) - + global_state.mstate.stack.append(global_state.environment.calldata.calldatasize) return [global_state] @staticmethod @@ -2391,7 +2383,7 @@ class Instruction: memory_out_size, memory_out_offset = global_state.mstate.stack[-7:-5] try: - with_value = function_name is not "staticcall" + with_value = function_name != "staticcall" ( callee_address, callee_account,