Skip to content

Commit cc754af

Browse files
committed
move VariableLocation to variable.py
1 parent bfa789f commit cc754af

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

slither/core/variables/local_variable.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,15 @@
1-
import enum
21
from typing import TYPE_CHECKING, Optional
32

43
from slither.core.declarations.structure import Structure
54
from slither.core.solidity_types.elementary_type import ElementaryType
65
from slither.core.solidity_types.mapping_type import MappingType
76
from slither.core.solidity_types.user_defined_type import UserDefinedType
8-
from slither.core.variables.variable import Variable
7+
from slither.core.variables.variable import Variable, VariableLocation
98

109
if TYPE_CHECKING: # type: ignore
1110
from slither.core.declarations import Function
1211

1312

14-
class VariableLocation(enum.Enum):
15-
MEMORY = "memory"
16-
CALLDATA = "calldata"
17-
STORAGE = "storage"
18-
REFERENCE_TO_STORAGE = "reference_to_storage"
19-
TRANSIENT = "transient"
20-
21-
2213
class LocalVariable(Variable):
2314
def __init__(self) -> None:
2415
super().__init__()

slither/core/variables/variable.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Variable module
33
"""
44
from typing import Optional, TYPE_CHECKING, List, Union, Tuple
5+
from enum import Enum
56

67
from slither.core.source_mapping.source_mapping import SourceMapping
78
from slither.core.solidity_types.type import Type
@@ -11,6 +12,16 @@
1112
from slither.core.expressions.expression import Expression
1213
from slither.core.declarations import Function
1314

15+
16+
class VariableLocation(Enum):
17+
DEFAULT = "default"
18+
MEMORY = "memory"
19+
CALLDATA = "calldata"
20+
STORAGE = "storage"
21+
REFERENCE_TO_STORAGE = "reference_to_storage"
22+
TRANSIENT = "transient"
23+
24+
1425
# pylint: disable=too-many-instance-attributes
1526
class Variable(SourceMapping):
1627
def __init__(self) -> None:

0 commit comments

Comments
 (0)