@@ -150,29 +150,31 @@ public static void enableTxOriginChecker() {
150150 public static void setTestMode () {
151151 TEST_MODE = true ;
152152 }
153-
153+
154154 public static boolean isInTestMode () {
155155 return TEST_MODE ;
156156 }
157-
157+
158158 public static boolean isInPaperMode () {
159159 return PAPER_MODE ;
160160 }
161161
162162 /**
163- * Enables the paper mode (i.e., statistics contains jump classifications as in the reference paper).
163+ * Enables the paper mode (i.e., statistics contains jump classifications as
164+ * in the reference paper).
164165 */
165166 public static void setPaperMode () {
166167 PAPER_MODE = true ;
167168 }
168169
169170 /**
170- * Disables the paper mode (i.e., statistics contains jump classifications as in the reference paper).
171+ * Disables the paper mode (i.e., statistics contains jump classifications
172+ * as in the reference paper).
171173 */
172174 public static void disablePaperMode () {
173175 PAPER_MODE = false ;
174176 }
175-
177+
176178 /**
177179 * Executes the analysis workflow.
178180 *
@@ -250,7 +252,7 @@ public static void analyzeSetOfContracts(Path filePath) {
250252 * Analyzes a set of smart contracts from a given file.
251253 *
252254 * @param filePath the path to the file containing contract addresses
253- * @param shutdown whether to shut down the executor after the analysis
255+ * @param shutdown whether to shut down the executor after the analysis
254256 */
255257 public static void analyzeSetOfContracts (Path filePath , boolean shutdown ) {
256258 log .info ("Building contracts." );
@@ -611,7 +613,8 @@ private static StatisticsObject<?> computeJumps(JumpSolver checker, Set<Statemen
611613 }
612614
613615 /**
614- * Computes jump-related statistics based on the analysis results, with the same classification of the reference paper.
616+ * Computes jump-related statistics based on the analysis results, with the
617+ * same classification of the reference paper.
615618 *
616619 * @param checker the jump solver used for analysis
617620 * @param soundlySolved the set of jumps that have been soundly solved
@@ -624,11 +627,10 @@ private static StatisticsObject<?> computePaperJumps(JumpSolver checker, Set<Sta
624627
625628 int resolved = 0 ;
626629 int unreachable = 0 ;
627- int erroneous = 0 ;
628- int unknown = 0 ;
630+ int erroneous = 0 ;
631+ int unknown = 0 ;
629632 int topState = 0 ;
630633
631-
632634 if (cfg .getEntrypoints ().stream ().findAny ().isEmpty ()) {
633635 log .warn ("There are no entrypoints." );
634636 return null ;
@@ -637,36 +639,41 @@ private static StatisticsObject<?> computePaperJumps(JumpSolver checker, Set<Sta
637639 Statement entryPoint = cfg .getEntrypoints ().stream ().findAny ().get ();
638640
639641 // we are safe supposing that we have a single entry point
640- for (Statement jumpNode : cfg .getAllJumps ())
641- if ((jumpNode instanceof Jump ) || (jumpNode instanceof Jumpi ))
642+ for (Statement jumpNode : cfg .getAllJumps ())
643+ if ((jumpNode instanceof Jump ) || (jumpNode instanceof Jumpi ))
642644 if (cfg .getAllPushedJumps ().contains (jumpNode ))
643645 // stacks of pushed jumps are not stored for optimization
644646 resolved ++;
645647 else if (soundlySolved .contains (jumpNode ))
646- // soundlySolved contains getMaybeUnsoundJumps() (whole value state went to top)
647- // and getUnsoundJumps() (at least one stack has top on front)
648+ // soundlySolved contains getMaybeUnsoundJumps() (whole
649+ // value state went to top)
650+ // and getUnsoundJumps() (at least one stack has top on
651+ // front)
648652 unknown ++;
649653 else if (checker .getUnsoundJumps ().contains (jumpNode ))
650- // getUnsoundJumps() contains jumps where at least one top stack is top
654+ // getUnsoundJumps() contains jumps where at least one top
655+ // stack is top
651656 unknown ++;
652657 else if (checker .getMaybeUnsoundJumps ().contains (jumpNode )) {
653- // getMaybeUnsoundJumps() contains jumps where the whole value state went to top
658+ // getMaybeUnsoundJumps() contains jumps where the whole
659+ // value state went to top
654660 unknown ++;
655661 topState ++;
656- } else if (!cfg .reachableFrom (entryPoint , jumpNode ) || checker .getUnreachableJumps ().contains (jumpNode ))
657- // getUnreachableJumps() contains jumps where the whole value state went to bottom
662+ } else if (!cfg .reachableFrom (entryPoint , jumpNode ) || checker .getUnreachableJumps ().contains (jumpNode ))
663+ // getUnreachableJumps() contains jumps where the whole
664+ // value state went to bottom
658665 unreachable ++;
659666 else {
660667 Set <StackElement > topStacks = checker .getTopStackValuesPerJump (jumpNode );
661- if (topStacks .isEmpty ())
668+ if (topStacks .isEmpty ())
662669 unreachable ++;
663- else if (topStacks .stream ().allMatch (StackElement ::isBottom ))
670+ else if (topStacks .stream ().allMatch (StackElement ::isBottom ))
664671 erroneous ++;
665672 else if (topStacks .stream ().anyMatch (StackElement ::isTop ))
666673 unknown ++;
667- else
674+ else
668675 resolved ++;
669- }
676+ }
670677
671678 PaperStatisticsObject stats = PaperStatisticsObject .newStatisticsObject ()
672679 .totalOpcodes (cfg .getOpcodeCount ())
0 commit comments