Skip to content

Commit

Permalink
fix linters
Browse files Browse the repository at this point in the history
  • Loading branch information
montyly committed Feb 20, 2025
1 parent 33b4bba commit 116a31a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 4 additions & 2 deletions slither/visitors/slithir/expression_to_slithir.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,10 @@ def _post_call_expression(self, expression: CallExpression) -> None:
self._result.append(var)
set_val(expression, val)

elif (called.name == "sload(uint256)" or called.name == "sstore(uint256,uint256)") and (
len(args) > 0 and isinstance(args[0], StateVariable)
elif (
called.name in ["sload(uint256)", "sstore(uint256,uint256)"]
and len(args) > 0
and isinstance(args[0], StateVariable)
):
# parse_yul._parse_yul_magic_suffixes does a best effort tentative to retrieve
# the right state variable on .slot access
Expand Down
5 changes: 1 addition & 4 deletions tests/unit/slithir/test_yul_parser_assembly_slot.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ def test_yul_parser_assembly_slot(solc_binary_path) -> None:
assert isinstance(value.value, LocalVariable)


def test_yul_parser_assembly_slot(solc_binary_path) -> None:
# mstore(0x0, bucketId)
# mstore(0x20, _counters.slot)
data = {"0x0": "bucketId", "0x20": "_counters"}
def test_yul_parser_sstore_sload(solc_binary_path) -> None:

solc_path = solc_binary_path("0.8.18")
slither = Slither(Path(TEST_DATA_DIR, "assembly_sstore_sload.sol").as_posix(), solc=solc_path)
Expand Down

0 comments on commit 116a31a

Please sign in to comment.