File tree Expand file tree Collapse file tree 2 files changed +22
-4
lines changed
Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -263,14 +263,16 @@ public static void analyzeContract(SmartContract contract) {
263263 System .exit (1 );
264264 }
265265
266- LiSAConfiguration conf = LiSAConfigurationManager .createConfiguration (contract );
266+ LiSAConfiguration conf = LiSAConfigurationManager .createConfiguration (contract , true );
267+ if (TEST_MODE )
268+ conf = LiSAConfigurationManager .createConfiguration (contract );
267269 JumpSolver checker = new JumpSolver ();
268270 conf .semanticChecks .add (checker );
269271
270272 LiSA lisa = new LiSA (conf );
271273 lisa .run (program );
272274
273- log .info ("Analysis ended ({}) " , contract .getAddress ());
275+ log .info ("Analysis ended {} " , contract .getAddress ());
274276
275277 contract .setStatistics (
276278 computeStatistics (checker , lisa , program ));
Original file line number Diff line number Diff line change @@ -20,6 +20,18 @@ public class LiSAConfigurationManager {
2020 * @return A configured instance of {@link LiSAConfiguration}.
2121 */
2222 public static LiSAConfiguration createConfiguration (SmartContract contract ) {
23+ return createConfiguration (contract , false );
24+ }
25+
26+ /**
27+ * Creates a LiSA configuration for analyzing the given smart contract.
28+ *
29+ * @param contract The smart contract to be analyzed.
30+ * @param dumpResults Dump the jsonOutput and html version of the CFG.
31+ *
32+ * @return A configured instance of {@link LiSAConfiguration}.
33+ */
34+ public static LiSAConfiguration createConfiguration (SmartContract contract , boolean dumpResults ) {
2335 String address = EthereumUtils .isValidEVMAddress (contract .getAddress ()) ? contract .getAddress () : null ;
2436
2537 LiSAConfiguration conf = new LiSAConfiguration ();
@@ -32,8 +44,12 @@ public static LiSAConfiguration createConfiguration(SmartContract contract) {
3244 conf .serializeResults = false ;
3345 conf .optimize = false ;
3446 conf .useWideningPoints = false ;
35- // conf.analysisGraphs = LiSAConfiguration.GraphType.HTML;
36- conf .jsonOutput = true ;
47+ conf .jsonOutput = false ;
48+
49+ if (dumpResults ) {
50+ conf .analysisGraphs = LiSAConfiguration .GraphType .HTML ;
51+ conf .jsonOutput = true ;
52+ }
3753
3854 return conf ;
3955 }
You can’t perform that action at this time.
0 commit comments