
A utility for the recognition of design pattern on blockchain through static analysis of the code
This Readme is available in the Following Languages:
Italian · English
After the degree, the project has undergone a variety and improvements, therefore what is described in the elaborate of the thesis may not reflect more reliable.
To view the project in the form described in the elaborate of the thesis and the thesis itself, refer to the frozen branch, click here.
Solidity Design Pattern Analyzer is a software application developed for my degree thesis for the three -year CDL in computer science at the University of Catania.
The software application and able to perform the following operations:
(back to top)
(back to top)
Before using the application it is necessary to install addictions.
To install employees you can use the Python Installer package called PIP :
pip install -r requirements.txtpython3 -m venv /path/to/new/virtual/environment
source /path/to/new/virtual/environment/bin/activate
pip install -r requirements.txtTo use Analyzer it is necessary to provide a series of parameters, listed here:
| Parameter | Description |
|---|---|
-h, --help | An optional parameter that, if provided, will make a guide on the use in the terminal |
-a, --action | A mandatory parameter that only accepts analyze and describe values, depending on the operation you want to perform. |
-t, --target | A mandatory parameter that represents the absolute or relative path of the file or folder containing the Solidty source code. If a directory is provided, the modalità batch will be performed that will save all the results obtained in a single file. |
-d, --descriptor | An optional parameter for the analyze operation that represents the Path, absolute or relative, of the file or folder containing the Design Pattern Descriptor .If you omit a predefined path it will be used. |
-v, --verbose | An optional parameter that, if supplied, can print debugs log in the terminal, normally not displayed. |
-ai, --allow-incompatible | An optional parameter that determines the control of compatibility of the version of Soliditch used in the file provided. Accepts as values: ask , skip , always .Default: ask , asks for confirmation. |
-p, --plot | An optional parameter that determines the display of a summary graph. Accepts as values: ask , skip , always .Default: ask , asks for confirmation. |
-pr, --print-result | An optional parameter that, if provided, will make a summary of the results obtained from the analysis print on the terminal. |
-wr, --write-result | An optional parameter that determines the rescue on disk of the results obtained from the analysis of the individual files. Accepts as values: ask , skip , always .Default: ask , asks for confirmation. |
-fr, --format-result | An optional parameter that determines the format with which the data obtained is saved. Accepts as values: json , csv .Default: json . |
--debug-analysis | An optional parameter that, if provided, will make a debug analysis on the Ast. |
For example, wanting to analyze a Smart-Contract in order to identify the use of the ownship pattern and need to execute the command:
python analyzer.py -a analyze -t ./source_code.sol -d ./Ownership_descriptor.json --print-result --write-result always --plot always(back to top)
The software is released under MIT license. View LICENSE for more information.
(back to top)
(back to top)