From 7fff11b7251f20159465a73f81f477c01e55d576 Mon Sep 17 00:00:00 2001 From: alwayshang Date: Wed, 24 Apr 2024 17:20:24 +0800 Subject: [PATCH] chore: fix some typos in comments Signed-off-by: alwayshang --- slither/detectors/compiler_bugs/reused_base_constructor.py | 2 +- slither/solc_parsing/declarations/contract.py | 2 +- tests/unit/core/test_source_mapping.py | 2 +- tests/unit/slithir/test_data/ternary_expressions.sol | 2 +- tests/unit/slithir/test_ssa_generation.py | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/slither/detectors/compiler_bugs/reused_base_constructor.py b/slither/detectors/compiler_bugs/reused_base_constructor.py index 73bd410c79..4764dc6419 100644 --- a/slither/detectors/compiler_bugs/reused_base_constructor.py +++ b/slither/detectors/compiler_bugs/reused_base_constructor.py @@ -35,7 +35,7 @@ class ReusedBaseConstructor(AbstractDetector): ARGUMENT = "reused-constructor" HELP = "Reused base constructor" IMPACT = DetectorClassification.MEDIUM - # The confidence is medium, because prior Solidity 0.4.22, we cant differentiate + # The confidence is medium, because prior Solidity 0.4.22, we can't differentiate # contract C is A() { # to # contract C is A { diff --git a/slither/solc_parsing/declarations/contract.py b/slither/solc_parsing/declarations/contract.py index ebab0e6df4..1ccdc57602 100644 --- a/slither/solc_parsing/declarations/contract.py +++ b/slither/solc_parsing/declarations/contract.py @@ -593,7 +593,7 @@ def _analyze_params_elements( # pylint: disable=too-many-arguments,too-many-loc def analyze_constant_state_variables(self) -> None: for var_parser in self._variables_parser: if var_parser.underlying_variable.is_constant: - # cant parse constant expression based on function calls + # can't parse constant expression based on function calls try: var_parser.analyze(self) except (VariableNotFound, KeyError) as e: diff --git a/tests/unit/core/test_source_mapping.py b/tests/unit/core/test_source_mapping.py index 298a192d5f..2a1bbc5510 100644 --- a/tests/unit/core/test_source_mapping.py +++ b/tests/unit/core/test_source_mapping.py @@ -58,7 +58,7 @@ def test_source_mapping_inheritance(solc_binary_path, solc_version): assert {(x.start, x.end) for x in slither.offset_to_implementations(file, 203)} == {(193, 230)} # Offset 93 is the call to f() in A.test() - # This can lead to three differents functions, depending on the current contract's context + # This can lead to three different functions, depending on the current contract's context functions = slither.offset_to_objects(file, 93) print(functions) assert len(functions) == 3 diff --git a/tests/unit/slithir/test_data/ternary_expressions.sol b/tests/unit/slithir/test_data/ternary_expressions.sol index 1ccd51d34d..43ba9b9cb2 100644 --- a/tests/unit/slithir/test_data/ternary_expressions.sol +++ b/tests/unit/slithir/test_data/ternary_expressions.sol @@ -6,7 +6,7 @@ contract C { // TODO // 1) support variable declarations //uint min = 1 > 0 ? 1 : 2; - // 2) suppory ternary index range access + // 2) support ternary index range access // function e(bool cond, bytes calldata x) external { // bytes memory a = x[cond ? 1 : 2 :]; // } diff --git a/tests/unit/slithir/test_ssa_generation.py b/tests/unit/slithir/test_ssa_generation.py index 1a709c2f78..1358fa957c 100644 --- a/tests/unit/slithir/test_ssa_generation.py +++ b/tests/unit/slithir/test_ssa_generation.py @@ -502,7 +502,7 @@ def test_storage_refers_to(slither_from_solidity_source): When a phi-node is created, ensure refers_to is propagated to the phi-node. Assignments also propagate refers_to. Whenever a ReferenceVariable is the destination of an assignment (e.g. s.v = 10) - below, create additional versions of the variables it refers to record that a a + below, create additional versions of the variables it refers to record that a write was made. In the current implementation, this is referenced by phis. """ source = """ @@ -550,7 +550,7 @@ def test_storage_refers_to(slither_from_solidity_source): entryphi = [x for x in phinodes if x.lvalue in sphi.lvalue.refers_to] assert len(entryphi) == 2 - # The remaining two phis are the ones recording that write through ReferenceVariable occured + # The remaining two phis are the ones recording that write through ReferenceVariable occurred for ephi in entryphi: phinodes.remove(ephi) phinodes.remove(sphi)