-
Notifications
You must be signed in to change notification settings - Fork 1.1k
JSON output
Feist Josselin edited this page Apr 25, 2019
·
59 revisions
The json contains a list of vulnerability. A vulnerability is described following this format:
{
check: ...
impact: ...
confidence: ...
description: ...
elements: [
{
type: item0
item0_additional_info: ...
source_mapping : ...
},
{
type: item1
item1_additional_info: ...
source_mapping : ...
}
}
-
check: slither flag (see the list of flags) -
impact: string representation of the impact (High/Medium/Low/Informational) -
confidence: string representation of the confidence (High/Medium/Low) -
description: string output of slither -
elements: structure that changes according to the vulnerability class. Each element has at least itstype(described below) and asource_mappinginformation. As a result, the additional info can be skiped to facilitate the parsing of the json
source_mapping is:
"source_mapping": {
"filename_relative": "contracts/tests/constant.sol",
"filename_absolute": "/tmp/contracts/tests/constant.sol",
"filename_short": "tests/constant.sol",
"filename_used": "contracts/tests/constant.sol",
"length": 58,
"lines": [
5,
6,
7
],
"start": 45
}
Notes:
-
filename_short: it is a shorted version of the path, which hides the platform-specific directories (ex:node_modules). -
filename_used: the path used by the platform. Its format is non-standard
- type
contracthas"name":"contract_name"
-
functionhas"name": "function_name""contract": type contract
-
functionshas- list of function
-
variablehas"name": "variable_name"
-
variableshas- list of variable
-
expressionhas-
expression: a string representation of the expression
-
Some detectors have non standard elements
-
constant-function:contain_assembly: bool -
naming-convention: "convention": "CapWords", "name": "contract_name", "target": "target_name"-
conventioncan be:CapWordsmixedCasel_O_I_should_not_be_usedUPPER_CASE_WITH_UNDERSCORES
-
targetcan be:contractstructureeventfunctionvariablevariable_constantparameterenummodifier
-
-
reentrancy(all variants):- list of "external_calls":
expression/source_mapping - list of "external_calls_sending_eth":
expression/source_mapping - list of "variables_written":
expression/source_mapping/name
- list of "external_calls":