Improve report formatting

pull/1029/head
Bernhard Mueller 6 years ago
parent 3d35f905e4
commit dc1963c316
  1. 6
      mythril/analysis/modules/dependence_on_predictable_vars.py

@ -78,7 +78,7 @@ def _analyze_states(state: GlobalState) -> list:
for annotation in state.mstate.stack[-2].annotations: for annotation in state.mstate.stack[-2].annotations:
if isinstance(annotation, PredictableValueAnnotation): if isinstance(annotation, PredictableValueAnnotation):
description = ( description = (
"The " + annotation.opcode + " is used in an if-statement. " "The " + annotation.opcode + " is used in a conditional statement. "
) )
description += ( description += (
"Note that the values of variables like coinbase, gaslimit, block number and timestamp " "Note that the values of variables like coinbase, gaslimit, block number and timestamp "
@ -95,7 +95,7 @@ def _analyze_states(state: GlobalState) -> list:
bytecode=state.environment.code.bytecode, bytecode=state.environment.code.bytecode,
title="Dependence on predictable environment variable", title="Dependence on predictable environment variable",
severity="Low", severity="Low",
description_head="Control flow decision is made based on a predictable variable.", description_head="A control flow decision is made based on a predictable variable.",
description_tail=description, description_tail=description,
gas_used=(state.mstate.min_gas_used, state.mstate.max_gas_used), gas_used=(state.mstate.min_gas_used, state.mstate.max_gas_used),
) )
@ -154,7 +154,7 @@ def _analyze_states(state: GlobalState) -> list:
opcode = instructions[state.mstate.pc - 1]["opcode"] opcode = instructions[state.mstate.pc - 1]["opcode"]
annotation = PredictableValueAnnotation( annotation = PredictableValueAnnotation(
"block." + opcode.lower() + "environment variable" "block." + opcode.lower() + " environment variable"
) )
state.mstate.stack[-1].annotate(annotation) state.mstate.stack[-1].annotate(annotation)

Loading…
Cancel
Save