Repository navigation
JSON output
Feist Josselin edited this page Nov 29, 2018
·
59 revisions
"check": "slither_flag"
Each element has a check field, which is the slither flag to run the detector
"source_mapping": {
"filename": "tests/constant.sol",
"length": 58,
"lines": [
5,
6,
7
],
"start": 45
}
"expressions": [
{
"source_mapping": {...},
"expression": "the expression..."
},
...
],
-
expressionsis a list
"function": {
{ "name": "function_name",
"source_mapping": { .. }
}
},
"functions": {
[
{ "name": "function_name",
"source_mapping": { .. }}
]
},
-
functionsis a list
"variable":
{
"name": "userBalance",
"source_mapping": {...}
}
"variables": [
{
"name": "userBalance",
"source_mapping": {...}
}
]
-
variablesis a list
| Num | Detector | check |
function |
functions |
variable |
variables |
expressions |
Extra |
|---|---|---|---|---|---|---|---|---|
| 1 | suicidal |
X | X | |||||
| 2 | uninitialized-state |
X | X | X | ||||
| 3 | uninitialized-storage |
X | X | X | ||||
| 4 | arbitrary-send |
X | X | X | ||||
| 5 | controlled-delegatecall |
X | X | X | ||||
| 6 | reentrancy |
X | Yes | |||||
| 7 | locked-ether |
X | X | |||||
| 8 | constant-function |
X | X | X | X | Yes | ||
| 9 | tx-origin |
X | X | X | ||||
| 10 | uninitialized-local |
X | X | X | ||||
| 11 | unused-return |
X | X | X | ||||
| 12 | assembly |
X | X | Yes | ||||
| 13 | constable-states |
X | X | X | ||||
| 14 | external-function |
X | X | |||||
| 15 | low-level-calls |
X | X | X | ||||
| 16 | naming-convention |
X | Yes | |||||
| 17 | pragma |
X | X | |||||
| 18 | solc-version |
X | X | |||||
| 19 | unused-state |
X | X |
The additional field is the boolean contain_assembly
Ex:
[
{
"check": "constant-function",
"contains_assembly": false,
"functions": [ {
"name": "test_view_bug",
"source_mapping": { .. }
}],
"variables": [
"name": "test_view_bug",
"source_mapping": { .. }
]
}
]
- if
contains_assemblyis true,variablesis empty.
[
{
"check": "naming-convention",
"convention": "CapWords",
"name": {
"name": "contract_name",
"source_mapping": {...},
"type": "contract"
}
]
-
conventioncan be:CapWordsmixedCasel_O_I_should_not_be_usedUPPER_CASE_WITH_UNDERSCORES
-
typecan be:contractstructureeventfunctionvariablevariable_constantparameterenummodifier
[
{
"check": "reentrancy",
"external_calls": [
{
"expression": "! (msg.sender.call.value(userBalance[msg.sender])())",
"source_mapping": {...}
}
],
"external_calls_sending_eth": [
{
"expression": "! (msg.sender.call.value(userBalance[msg.sender])())",
"source_mapping": {...}
}
],
"function": {
"name": "withdrawBalance",
"source_mapping": {...}
},
"variables_written": [
{
"expression": "userBalance[msg.sender] = 0",
"name": "userBalance",
"source_mapping": {...}
}
]
}
]
-
external_callscontains a list -
external_calls_sending_ethcontains a list -
variablescontains a list -
external_calls_sending_ethcan be empty
[
{
"assembly": [
{
"source_mapping": {...}
}
],
"check": "assembly",
"function": {
"name": "at",
"source_mapping": {...}
}
}
]
-
assemblycontains a list