diff --git a/slither/tools/read_storage/__main__.py b/slither/tools/read_storage/__main__.py index 660af2c17..25314f000 100644 --- a/slither/tools/read_storage/__main__.py +++ b/slither/tools/read_storage/__main__.py @@ -147,7 +147,7 @@ def main() -> None: srs.get_storage_layout() srs.print_table() return - + if args.table_storage_value: environ["TABLE"] = "1" srs.get_all_storage_variables() diff --git a/slither/tools/read_storage/read_storage.py b/slither/tools/read_storage/read_storage.py index 5bd2cdbd9..8101ebb38 100644 --- a/slither/tools/read_storage/read_storage.py +++ b/slither/tools/read_storage/read_storage.py @@ -329,7 +329,6 @@ class SlitherReadStorage: type_string = info.get("type_string") struct_var = info.get("struct_var") - hex_bytes = get_storage_data(self.web3, self.checksum_address, slot) tabulate_data.append( [ slot, @@ -337,7 +336,12 @@ class SlitherReadStorage: size, type_string, var, - self.convert_value_to_type(hex_bytes, size, offset, type_string), + self.convert_value_to_type( + get_storage_data(self.web3, self.checksum_address, slot), + size, + offset, + type_string, + ), ] ) @@ -353,7 +357,6 @@ class SlitherReadStorage: # doesn't handle deep keys currently var_name_struct_or_array_var = f"{var} -> {struct_var}" - hex_bytes = get_storage_data(self.web3, self.checksum_address, slot) tabulate_data.append( [ slot, @@ -361,7 +364,12 @@ class SlitherReadStorage: size, type_string, var_name_struct_or_array_var, - self.convert_value_to_type(hex_bytes, size, offset, type_string), + self.convert_value_to_type( + get_storage_data(self.web3, self.checksum_address, slot), + size, + offset, + type_string, + ), ] )