|
|
@ -68,6 +68,14 @@ class Contract(ChildSlither, SourceMapping): |
|
|
|
def setInheritance(self, inheritance): |
|
|
|
def setInheritance(self, inheritance): |
|
|
|
self._inheritance = inheritance |
|
|
|
self._inheritance = inheritance |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@property |
|
|
|
|
|
|
|
def derived_contracts(self): |
|
|
|
|
|
|
|
''' |
|
|
|
|
|
|
|
list(Contract): Return the list of contracts derived from self |
|
|
|
|
|
|
|
''' |
|
|
|
|
|
|
|
candidates = self.slither.contracts |
|
|
|
|
|
|
|
return [c for c in candidates if self in c.inheritance] |
|
|
|
|
|
|
|
|
|
|
|
@property |
|
|
|
@property |
|
|
|
def structures(self): |
|
|
|
def structures(self): |
|
|
|
''' |
|
|
|
''' |
|
|
@ -163,6 +171,18 @@ class Contract(ChildSlither, SourceMapping): |
|
|
|
''' |
|
|
|
''' |
|
|
|
return self.functions_not_inherited + self.modifiers_not_inherited |
|
|
|
return self.functions_not_inherited + self.modifiers_not_inherited |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_functions_overridden_by(self, function): |
|
|
|
|
|
|
|
''' |
|
|
|
|
|
|
|
Return the list of functions overriden by the function |
|
|
|
|
|
|
|
Args: |
|
|
|
|
|
|
|
(core.Function) |
|
|
|
|
|
|
|
Returns: |
|
|
|
|
|
|
|
list(core.Function) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
''' |
|
|
|
|
|
|
|
candidates = [c.functions_not_inherited for c in self.inheritance] |
|
|
|
|
|
|
|
candidates = [candidate for sublist in candidates for candidate in sublist] |
|
|
|
|
|
|
|
return [f for f in candidates if f.full_name == function.full_name] |
|
|
|
|
|
|
|
|
|
|
|
@property |
|
|
|
@property |
|
|
|
def all_functions_called(self): |
|
|
|
def all_functions_called(self): |
|
|
|