mirror of https://github.com/crytic/slither
parent
20a79519f3
commit
10109fc553
@ -1,17 +0,0 @@ |
||||
from typing import TYPE_CHECKING |
||||
|
||||
if TYPE_CHECKING: |
||||
from slither.core.declarations import Event |
||||
|
||||
|
||||
class ChildEvent: |
||||
def __init__(self) -> None: |
||||
super().__init__() |
||||
self._event = None |
||||
|
||||
def set_event(self, event: "Event"): |
||||
self._event = event |
||||
|
||||
@property |
||||
def event(self) -> "Event": |
||||
return self._event |
@ -1,18 +0,0 @@ |
||||
from typing import TYPE_CHECKING, Union |
||||
|
||||
if TYPE_CHECKING: |
||||
from slither.core.expressions.expression import Expression |
||||
from slither.slithir.operations import Operation |
||||
|
||||
|
||||
class ChildExpression: |
||||
def __init__(self) -> None: |
||||
super().__init__() |
||||
self._expression = None |
||||
|
||||
def set_expression(self, expression: Union["Expression", "Operation"]) -> None: |
||||
self._expression = expression |
||||
|
||||
@property |
||||
def expression(self) -> Union["Expression", "Operation"]: |
||||
return self._expression |
@ -1,17 +0,0 @@ |
||||
from typing import TYPE_CHECKING |
||||
|
||||
if TYPE_CHECKING: |
||||
from slither.core.declarations import Function |
||||
|
||||
|
||||
class ChildFunction: |
||||
def __init__(self) -> None: |
||||
super().__init__() |
||||
self._function = None |
||||
|
||||
def set_function(self, function: "Function") -> None: |
||||
self._function = function |
||||
|
||||
@property |
||||
def function(self) -> "Function": |
||||
return self._function |
@ -1,17 +0,0 @@ |
||||
from typing import TYPE_CHECKING |
||||
|
||||
if TYPE_CHECKING: |
||||
from slither.core.declarations import Contract |
||||
|
||||
|
||||
class ChildInheritance: |
||||
def __init__(self) -> None: |
||||
super().__init__() |
||||
self._contract_declarer = None |
||||
|
||||
def set_contract_declarer(self, contract: "Contract") -> None: |
||||
self._contract_declarer = contract |
||||
|
||||
@property |
||||
def contract_declarer(self) -> "Contract": |
||||
return self._contract_declarer |
@ -1,31 +0,0 @@ |
||||
from typing import TYPE_CHECKING |
||||
|
||||
if TYPE_CHECKING: |
||||
from slither.core.compilation_unit import SlitherCompilationUnit |
||||
from slither.core.cfg.node import Node |
||||
from slither.core.declarations import Function, Contract |
||||
|
||||
|
||||
class ChildNode: |
||||
def __init__(self) -> None: |
||||
super().__init__() |
||||
self._node = None |
||||
|
||||
def set_node(self, node: "Node") -> None: |
||||
self._node = node |
||||
|
||||
@property |
||||
def node(self) -> "Node": |
||||
return self._node |
||||
|
||||
@property |
||||
def function(self) -> "Function": |
||||
return self.node.function |
||||
|
||||
@property |
||||
def contract(self) -> "Contract": |
||||
return self.node.function.contract |
||||
|
||||
@property |
||||
def compilation_unit(self) -> "SlitherCompilationUnit": |
||||
return self.node.compilation_unit |
@ -1,17 +0,0 @@ |
||||
from typing import TYPE_CHECKING |
||||
|
||||
if TYPE_CHECKING: |
||||
from slither.core.declarations import Structure |
||||
|
||||
|
||||
class ChildStructure: |
||||
def __init__(self) -> None: |
||||
super().__init__() |
||||
self._structure = None |
||||
|
||||
def set_structure(self, structure: "Structure") -> None: |
||||
self._structure = structure |
||||
|
||||
@property |
||||
def structure(self) -> "Structure": |
||||
return self._structure |
@ -1,6 +1,19 @@ |
||||
from typing import TYPE_CHECKING, Optional |
||||
from slither.core.variables.variable import Variable |
||||
from slither.core.children.child_structure import ChildStructure |
||||
|
||||
|
||||
class StructureVariable(ChildStructure, Variable): |
||||
pass |
||||
if TYPE_CHECKING: |
||||
from slither.core.declarations import Structure |
||||
|
||||
|
||||
class StructureVariable(Variable): |
||||
def __init__(self) -> None: |
||||
super().__init__() |
||||
self._structure: Optional["Structure"] = None |
||||
|
||||
def set_structure(self, structure: "Structure") -> None: |
||||
self._structure = structure |
||||
|
||||
@property |
||||
def structure(self) -> "Structure": |
||||
return self._structure |
||||
|
Loading…
Reference in new issue