forked from crytic/slither
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
1,688 additions
and
1,767 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
slither/detectors/oracles/supported_oracles/help_functions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from slither.core.cfg.node import Node, NodeType | ||
from slither.slithir.operations.return_operation import Return | ||
from slither.slithir.operations import InternalCall | ||
from slither.slithir.operations.solidity_call import SolidityCall | ||
|
||
# Helpfull functions | ||
def check_revert(node: Node) -> bool: | ||
for n in node.sons: | ||
if n.type == NodeType.EXPRESSION: | ||
for ir in n.irs: | ||
if isinstance(ir, SolidityCall): | ||
if "revert" in ir.function.name: | ||
return True | ||
return False | ||
|
||
|
||
def return_boolean(node: Node) -> bool: | ||
for n in node.sons: | ||
if n.type == NodeType.RETURN: | ||
for ir in n.irs: | ||
if isinstance(ir, Return): | ||
return True | ||
return False | ||
|
||
|
||
def is_internal_call(node): | ||
for ir in node.irs: | ||
if isinstance(ir, InternalCall): | ||
return True | ||
return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.