chore: fix some typos in comments

Signed-off-by: alwayshang <zhanghonghao@outlook.com>
pull/2444/head
alwayshang 7 months ago
parent fdf54f624d
commit 7fff11b725
  1. 2
      slither/detectors/compiler_bugs/reused_base_constructor.py
  2. 2
      slither/solc_parsing/declarations/contract.py
  3. 2
      tests/unit/core/test_source_mapping.py
  4. 2
      tests/unit/slithir/test_data/ternary_expressions.sol
  5. 4
      tests/unit/slithir/test_ssa_generation.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 {

@ -593,7 +593,7 @@ class ContractSolc(CallerContextExpression):
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:

@ -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

@ -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 :];
// }

@ -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)

Loading…
Cancel
Save