Update detectors helper to be consistent with README.md

Update locked-ether description in README
Update README generation in slither.py
pull/55/head
Josselin 6 years ago
parent 8edda50c62
commit 836f3bab33
  1. 2
      README.md
  2. 11
      slither/__main__.py
  3. 2
      slither/detectors/attributes/constant_pragma.py
  4. 2
      slither/detectors/attributes/locked_ether.py
  5. 2
      slither/detectors/attributes/old_solc.py
  6. 2
      slither/detectors/examples/backdoor.py
  7. 2
      slither/detectors/functions/arbitrary_send.py
  8. 2
      slither/detectors/functions/suicidal.py
  9. 2
      slither/detectors/naming_convention/naming_convention.py
  10. 2
      slither/detectors/operations/low_level_calls.py
  11. 2
      slither/detectors/reentrancy/reentrancy.py
  12. 2
      slither/detectors/statements/assembly.py
  13. 2
      slither/detectors/statements/tx_origin.py
  14. 2
      slither/detectors/variables/possible_const_state_variables.py
  15. 2
      slither/detectors/variables/uninitialized_state_variables.py
  16. 2
      slither/detectors/variables/uninitialized_storage_variables.py
  17. 2
      slither/detectors/variables/unused_state_variables.py

@ -53,7 +53,7 @@ Num | Check | What it Detects | Impact | Confidence
3 | `uninitialized-storage` | Uninitialized storage variables | High | High
4 | `arbitrary-send` | Functions that send ether to an arbitrary destination | High | Medium
5 | `reentrancy` | Reentrancy vulnerabilities | High | Medium
6 | `locked-ether`| Payable functions that do not send ether | Medium | High
6 | `locked-ether` | Contracts that lock ether | Medium | High
7 | `tx-origin` | Dangerous usage of `tx.origin` | Medium | Medium
8 | `assembly` | Assembly usage | Informational | High
9 | `const-candidates-state` | State variables that could be declared constant | Informational | High

@ -34,13 +34,16 @@ def output_to_markdown(detector_classes):
confidence = classification_txt[detector.CONFIDENCE]
detectors_list.append((argument, help_info, impact, confidence))
# Sort by impact and name
detectors_list = sorted(detectors_list, key=lambda element: (element[2], element[0]))
# Sort by impact, confidence, and name
detectors_list = sorted(detectors_list, key=lambda element: (element[2], element[3], element[0]))
idx = 1
for (argument, help_info, impact, confidence) in detectors_list:
print('`--detect-{}`| Detect {} | {} | {}'.format(argument,
print('{} | `{}` | {} | {} | {}'.format(idx,
argument,
help_info,
classification_txt[impact],
confidence))
idx = idx +1
def process(filename, args, detector_classes, printer_classes):
"""
@ -275,7 +278,7 @@ def parse_args(detector_classes, printer_classes):
for detector_cls in detector_classes:
detector_arg = '--detect-{}'.format(detector_cls.ARGUMENT)
detector_help = 'Detection of {}'.format(detector_cls.HELP)
detector_help = '{}'.format(detector_cls.HELP)
parser.add_argument(detector_arg,
help=detector_help,
action="append_const",

@ -11,7 +11,7 @@ class ConstantPragma(AbstractDetector):
"""
ARGUMENT = 'pragma'
HELP = 'if different pragma directives are used'
HELP = 'If different pragma directives are used'
IMPACT = DetectorClassification.INFORMATIONAL
CONFIDENCE = DetectorClassification.HIGH

@ -13,7 +13,7 @@ class LockedEther(AbstractDetector):
"""
ARGUMENT = 'locked-ether'
HELP = "contracts with a payable function that do not send ether"
HELP = "Contracts that lock ether"
IMPACT = DetectorClassification.MEDIUM
CONFIDENCE = DetectorClassification.HIGH

@ -12,7 +12,7 @@ class OldSolc(AbstractDetector):
"""
ARGUMENT = 'solc-version'
HELP = 'if an old version of Solidity used (<0.4.23)'
HELP = 'If an old version of Solidity used (<0.4.23)'
IMPACT = DetectorClassification.INFORMATIONAL
CONFIDENCE = DetectorClassification.HIGH

@ -7,7 +7,7 @@ class Backdoor(AbstractDetector):
"""
ARGUMENT = 'backdoor' # slither will launch the detector with slither.py --mydetector
HELP = 'function named backdoor (detector example)'
HELP = 'Function named backdoor (detector example)'
IMPACT = DetectorClassification.HIGH
CONFIDENCE = DetectorClassification.HIGH

@ -27,7 +27,7 @@ class ArbitrarySend(AbstractDetector):
"""
ARGUMENT = 'arbitrary-send'
HELP = 'functions sending ethers to an arbitrary destination'
HELP = 'Functions that send ether to an arbitrary destination'
IMPACT = DetectorClassification.HIGH
CONFIDENCE = DetectorClassification.MEDIUM

@ -12,7 +12,7 @@ class Suicidal(AbstractDetector):
"""
ARGUMENT = 'suicidal'
HELP = 'suicidal functions'
HELP = 'Suicidal functions'
IMPACT = DetectorClassification.HIGH
CONFIDENCE = DetectorClassification.HIGH

@ -9,7 +9,7 @@ class NamingConvention(AbstractDetector):
"""
ARGUMENT = 'naming-convention'
HELP = 'conformance to Solidity naming conventions'
HELP = 'Conformance to Solidity naming conventions'
IMPACT = DetectorClassification.INFORMATIONAL
CONFIDENCE = DetectorClassification.HIGH

@ -12,7 +12,7 @@ class LowLevelCalls(AbstractDetector):
"""
ARGUMENT = 'low-level-calls'
HELP = 'low level calls'
HELP = 'Low level calls'
IMPACT = DetectorClassification.INFORMATIONAL
CONFIDENCE = DetectorClassification.HIGH

@ -17,7 +17,7 @@ from slither.slithir.operations import (HighLevelCall, LowLevelCall,
class Reentrancy(AbstractDetector):
ARGUMENT = 'reentrancy'
HELP = 'reentrancy vulnerabilities'
HELP = 'Reentrancy vulnerabilities'
IMPACT = DetectorClassification.HIGH
CONFIDENCE = DetectorClassification.MEDIUM

@ -12,7 +12,7 @@ class Assembly(AbstractDetector):
"""
ARGUMENT = 'assembly'
HELP = 'assembly usage'
HELP = 'Assembly usage'
IMPACT = DetectorClassification.INFORMATIONAL
CONFIDENCE = DetectorClassification.HIGH

@ -10,7 +10,7 @@ class TxOrigin(AbstractDetector):
"""
ARGUMENT = 'tx-origin'
HELP = 'dangerous usage of `tx.origin`'
HELP = 'Dangerous usage of `tx.origin`'
IMPACT = DetectorClassification.MEDIUM
CONFIDENCE = DetectorClassification.MEDIUM

@ -19,7 +19,7 @@ class ConstCandidateStateVars(AbstractDetector):
"""
ARGUMENT = 'const-candidates-state'
HELP = 'detect state variables that could be const'
HELP = 'State variables that could be declared constant'
IMPACT = DetectorClassification.INFORMATIONAL
CONFIDENCE = DetectorClassification.HIGH

@ -20,7 +20,7 @@ class UninitializedStateVarsDetection(AbstractDetector):
"""
ARGUMENT = 'uninitialized-state'
HELP = 'uninitialized state variables'
HELP = 'Uninitialized state variables'
IMPACT = DetectorClassification.HIGH
CONFIDENCE = DetectorClassification.HIGH

@ -15,7 +15,7 @@ class UninitializedStorageVars(AbstractDetector):
"""
ARGUMENT = 'uninitialized-storage'
HELP = 'uninitialized storage variables'
HELP = 'Uninitialized storage variables'
IMPACT = DetectorClassification.HIGH
CONFIDENCE = DetectorClassification.HIGH

@ -10,7 +10,7 @@ class UnusedStateVars(AbstractDetector):
"""
ARGUMENT = 'unused-state'
HELP = 'unused state variables'
HELP = 'Unused state variables'
IMPACT = DetectorClassification.INFORMATIONAL
CONFIDENCE = DetectorClassification.HIGH

Loading…
Cancel
Save