mirror of https://github.com/crytic/slither
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1334 lines
64 KiB
1334 lines
64 KiB
4 years ago
|
[
|
||
|
[
|
||
|
{
|
||
|
"elements": [
|
||
|
{
|
||
|
"type": "variable",
|
||
|
"name": "x",
|
||
|
"source_mapping": {
|
||
|
"start": 130,
|
||
|
"length": 10,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
5
|
||
|
],
|
||
|
"starting_column": 9,
|
||
|
"ending_column": 19
|
||
|
},
|
||
|
"type_specific_fields": {
|
||
|
"parent": {
|
||
|
"type": "function",
|
||
|
"name": "f",
|
||
|
"source_mapping": {
|
||
|
"start": 17,
|
||
|
"length": 442,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17
|
||
|
],
|
||
|
"starting_column": 5,
|
||
|
"ending_column": 6
|
||
|
},
|
||
|
"type_specific_fields": {
|
||
|
"parent": {
|
||
|
"type": "contract",
|
||
|
"name": "C",
|
||
|
"source_mapping": {
|
||
|
"start": 0,
|
||
|
"length": 461,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
1,
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17,
|
||
|
18,
|
||
|
19
|
||
|
],
|
||
|
"starting_column": 1,
|
||
|
"ending_column": 0
|
||
|
}
|
||
|
},
|
||
|
"signature": "f(uint256)"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"type": "function",
|
||
|
"name": "f",
|
||
|
"source_mapping": {
|
||
|
"start": 17,
|
||
|
"length": 442,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17
|
||
|
],
|
||
|
"starting_column": 5,
|
||
|
"ending_column": 6
|
||
|
},
|
||
|
"type_specific_fields": {
|
||
|
"parent": {
|
||
|
"type": "contract",
|
||
|
"name": "C",
|
||
|
"source_mapping": {
|
||
|
"start": 0,
|
||
|
"length": 461,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
1,
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17,
|
||
|
18,
|
||
|
19
|
||
|
],
|
||
|
"starting_column": 1,
|
||
|
"ending_column": 0
|
||
|
}
|
||
|
},
|
||
|
"signature": "f(uint256)"
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"type": "node",
|
||
|
"name": "y = x + 9 + z",
|
||
|
"source_mapping": {
|
||
|
"start": 69,
|
||
|
"length": 13,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
4
|
||
|
],
|
||
|
"starting_column": 9,
|
||
|
"ending_column": 22
|
||
|
},
|
||
|
"type_specific_fields": {
|
||
|
"parent": {
|
||
|
"type": "function",
|
||
|
"name": "f",
|
||
|
"source_mapping": {
|
||
|
"start": 17,
|
||
|
"length": 442,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17
|
||
|
],
|
||
|
"starting_column": 5,
|
||
|
"ending_column": 6
|
||
|
},
|
||
|
"type_specific_fields": {
|
||
|
"parent": {
|
||
|
"type": "contract",
|
||
|
"name": "C",
|
||
|
"source_mapping": {
|
||
|
"start": 0,
|
||
|
"length": 461,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
1,
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17,
|
||
|
18,
|
||
|
19
|
||
|
],
|
||
|
"starting_column": 1,
|
||
|
"ending_column": 0
|
||
|
}
|
||
|
},
|
||
|
"signature": "f(uint256)"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
],
|
||
|
"description": "Variable 'C.f(uint256).x (tests/detectors/variable-scope/predeclaration_usage_local.sol#5)' in C.f(uint256) (tests/detectors/variable-scope/predeclaration_usage_local.sol#2-17) potentially used before declaration: y = x + 9 + z (tests/detectors/variable-scope/predeclaration_usage_local.sol#4)\n",
|
||
|
"markdown": "Variable '[C.f(uint256).x](tests/detectors/variable-scope/predeclaration_usage_local.sol#L5)' in [C.f(uint256)](tests/detectors/variable-scope/predeclaration_usage_local.sol#L2-L17) potentially used before declaration: [y = x + 9 + z](tests/detectors/variable-scope/predeclaration_usage_local.sol#L4)\n",
|
||
|
"id": "ae8657e5e605f868abb11f4568aa1cc99ccd0bd9ba4840bc7d5172e5fd6da165",
|
||
|
"check": "variable-scope",
|
||
|
"impact": "Low",
|
||
|
"confidence": "High"
|
||
|
},
|
||
|
{
|
||
|
"elements": [
|
||
|
{
|
||
|
"type": "variable",
|
||
|
"name": "i",
|
||
|
"source_mapping": {
|
||
|
"start": 199,
|
||
|
"length": 11,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
8
|
||
|
],
|
||
|
"starting_column": 18,
|
||
|
"ending_column": 29
|
||
|
},
|
||
|
"type_specific_fields": {
|
||
|
"parent": {
|
||
|
"type": "function",
|
||
|
"name": "f",
|
||
|
"source_mapping": {
|
||
|
"start": 17,
|
||
|
"length": 442,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17
|
||
|
],
|
||
|
"starting_column": 5,
|
||
|
"ending_column": 6
|
||
|
},
|
||
|
"type_specific_fields": {
|
||
|
"parent": {
|
||
|
"type": "contract",
|
||
|
"name": "C",
|
||
|
"source_mapping": {
|
||
|
"start": 0,
|
||
|
"length": 461,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
1,
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17,
|
||
|
18,
|
||
|
19
|
||
|
],
|
||
|
"starting_column": 1,
|
||
|
"ending_column": 0
|
||
|
}
|
||
|
},
|
||
|
"signature": "f(uint256)"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"type": "function",
|
||
|
"name": "f",
|
||
|
"source_mapping": {
|
||
|
"start": 17,
|
||
|
"length": 442,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17
|
||
|
],
|
||
|
"starting_column": 5,
|
||
|
"ending_column": 6
|
||
|
},
|
||
|
"type_specific_fields": {
|
||
|
"parent": {
|
||
|
"type": "contract",
|
||
|
"name": "C",
|
||
|
"source_mapping": {
|
||
|
"start": 0,
|
||
|
"length": 461,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
1,
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17,
|
||
|
18,
|
||
|
19
|
||
|
],
|
||
|
"starting_column": 1,
|
||
|
"ending_column": 0
|
||
|
}
|
||
|
},
|
||
|
"signature": "f(uint256)"
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"type": "node",
|
||
|
"name": "i = 10",
|
||
|
"source_mapping": {
|
||
|
"start": 402,
|
||
|
"length": 6,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
14
|
||
|
],
|
||
|
"starting_column": 14,
|
||
|
"ending_column": 20
|
||
|
},
|
||
|
"type_specific_fields": {
|
||
|
"parent": {
|
||
|
"type": "function",
|
||
|
"name": "f",
|
||
|
"source_mapping": {
|
||
|
"start": 17,
|
||
|
"length": 442,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17
|
||
|
],
|
||
|
"starting_column": 5,
|
||
|
"ending_column": 6
|
||
|
},
|
||
|
"type_specific_fields": {
|
||
|
"parent": {
|
||
|
"type": "contract",
|
||
|
"name": "C",
|
||
|
"source_mapping": {
|
||
|
"start": 0,
|
||
|
"length": 461,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
1,
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17,
|
||
|
18,
|
||
|
19
|
||
|
],
|
||
|
"starting_column": 1,
|
||
|
"ending_column": 0
|
||
|
}
|
||
|
},
|
||
|
"signature": "f(uint256)"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
],
|
||
|
"description": "Variable 'C.f(uint256).i (tests/detectors/variable-scope/predeclaration_usage_local.sol#8)' in C.f(uint256) (tests/detectors/variable-scope/predeclaration_usage_local.sol#2-17) potentially used before declaration: i = 10 (tests/detectors/variable-scope/predeclaration_usage_local.sol#14)\n",
|
||
|
"markdown": "Variable '[C.f(uint256).i](tests/detectors/variable-scope/predeclaration_usage_local.sol#L8)' in [C.f(uint256)](tests/detectors/variable-scope/predeclaration_usage_local.sol#L2-L17) potentially used before declaration: [i = 10](tests/detectors/variable-scope/predeclaration_usage_local.sol#L14)\n",
|
||
|
"id": "16da9fedd4973449139402e4298178b35fd9fb1eb4d9dc85148790e742729ee4",
|
||
|
"check": "variable-scope",
|
||
|
"impact": "Low",
|
||
|
"confidence": "High"
|
||
|
},
|
||
|
{
|
||
|
"elements": [
|
||
|
{
|
||
|
"type": "variable",
|
||
|
"name": "i",
|
||
|
"source_mapping": {
|
||
|
"start": 199,
|
||
|
"length": 11,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
8
|
||
|
],
|
||
|
"starting_column": 18,
|
||
|
"ending_column": 29
|
||
|
},
|
||
|
"type_specific_fields": {
|
||
|
"parent": {
|
||
|
"type": "function",
|
||
|
"name": "f",
|
||
|
"source_mapping": {
|
||
|
"start": 17,
|
||
|
"length": 442,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17
|
||
|
],
|
||
|
"starting_column": 5,
|
||
|
"ending_column": 6
|
||
|
},
|
||
|
"type_specific_fields": {
|
||
|
"parent": {
|
||
|
"type": "contract",
|
||
|
"name": "C",
|
||
|
"source_mapping": {
|
||
|
"start": 0,
|
||
|
"length": 461,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
1,
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17,
|
||
|
18,
|
||
|
19
|
||
|
],
|
||
|
"starting_column": 1,
|
||
|
"ending_column": 0
|
||
|
}
|
||
|
},
|
||
|
"signature": "f(uint256)"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"type": "function",
|
||
|
"name": "f",
|
||
|
"source_mapping": {
|
||
|
"start": 17,
|
||
|
"length": 442,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17
|
||
|
],
|
||
|
"starting_column": 5,
|
||
|
"ending_column": 6
|
||
|
},
|
||
|
"type_specific_fields": {
|
||
|
"parent": {
|
||
|
"type": "contract",
|
||
|
"name": "C",
|
||
|
"source_mapping": {
|
||
|
"start": 0,
|
||
|
"length": 461,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
1,
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17,
|
||
|
18,
|
||
|
19
|
||
|
],
|
||
|
"starting_column": 1,
|
||
|
"ending_column": 0
|
||
|
}
|
||
|
},
|
||
|
"signature": "f(uint256)"
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"type": "node",
|
||
|
"name": "i > 0",
|
||
|
"source_mapping": {
|
||
|
"start": 410,
|
||
|
"length": 5,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
14
|
||
|
],
|
||
|
"starting_column": 22,
|
||
|
"ending_column": 27
|
||
|
},
|
||
|
"type_specific_fields": {
|
||
|
"parent": {
|
||
|
"type": "function",
|
||
|
"name": "f",
|
||
|
"source_mapping": {
|
||
|
"start": 17,
|
||
|
"length": 442,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17
|
||
|
],
|
||
|
"starting_column": 5,
|
||
|
"ending_column": 6
|
||
|
},
|
||
|
"type_specific_fields": {
|
||
|
"parent": {
|
||
|
"type": "contract",
|
||
|
"name": "C",
|
||
|
"source_mapping": {
|
||
|
"start": 0,
|
||
|
"length": 461,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
1,
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17,
|
||
|
18,
|
||
|
19
|
||
|
],
|
||
|
"starting_column": 1,
|
||
|
"ending_column": 0
|
||
|
}
|
||
|
},
|
||
|
"signature": "f(uint256)"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
],
|
||
|
"description": "Variable 'C.f(uint256).i (tests/detectors/variable-scope/predeclaration_usage_local.sol#8)' in C.f(uint256) (tests/detectors/variable-scope/predeclaration_usage_local.sol#2-17) potentially used before declaration: i > 0 (tests/detectors/variable-scope/predeclaration_usage_local.sol#14)\n",
|
||
|
"markdown": "Variable '[C.f(uint256).i](tests/detectors/variable-scope/predeclaration_usage_local.sol#L8)' in [C.f(uint256)](tests/detectors/variable-scope/predeclaration_usage_local.sol#L2-L17) potentially used before declaration: [i > 0](tests/detectors/variable-scope/predeclaration_usage_local.sol#L14)\n",
|
||
|
"id": "1645f4a9be79ab45d3fcb98b1b147212ee01517980a084481c9b26be36fb0d46",
|
||
|
"check": "variable-scope",
|
||
|
"impact": "Low",
|
||
|
"confidence": "High"
|
||
|
},
|
||
|
{
|
||
|
"elements": [
|
||
|
{
|
||
|
"type": "variable",
|
||
|
"name": "i",
|
||
|
"source_mapping": {
|
||
|
"start": 199,
|
||
|
"length": 11,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
8
|
||
|
],
|
||
|
"starting_column": 18,
|
||
|
"ending_column": 29
|
||
|
},
|
||
|
"type_specific_fields": {
|
||
|
"parent": {
|
||
|
"type": "function",
|
||
|
"name": "f",
|
||
|
"source_mapping": {
|
||
|
"start": 17,
|
||
|
"length": 442,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17
|
||
|
],
|
||
|
"starting_column": 5,
|
||
|
"ending_column": 6
|
||
|
},
|
||
|
"type_specific_fields": {
|
||
|
"parent": {
|
||
|
"type": "contract",
|
||
|
"name": "C",
|
||
|
"source_mapping": {
|
||
|
"start": 0,
|
||
|
"length": 461,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
1,
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17,
|
||
|
18,
|
||
|
19
|
||
|
],
|
||
|
"starting_column": 1,
|
||
|
"ending_column": 0
|
||
|
}
|
||
|
},
|
||
|
"signature": "f(uint256)"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"type": "function",
|
||
|
"name": "f",
|
||
|
"source_mapping": {
|
||
|
"start": 17,
|
||
|
"length": 442,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17
|
||
|
],
|
||
|
"starting_column": 5,
|
||
|
"ending_column": 6
|
||
|
},
|
||
|
"type_specific_fields": {
|
||
|
"parent": {
|
||
|
"type": "contract",
|
||
|
"name": "C",
|
||
|
"source_mapping": {
|
||
|
"start": 0,
|
||
|
"length": 461,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
1,
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17,
|
||
|
18,
|
||
|
19
|
||
|
],
|
||
|
"starting_column": 1,
|
||
|
"ending_column": 0
|
||
|
}
|
||
|
},
|
||
|
"signature": "f(uint256)"
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"type": "node",
|
||
|
"name": "x += i",
|
||
|
"source_mapping": {
|
||
|
"start": 436,
|
||
|
"length": 6,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
15
|
||
|
],
|
||
|
"starting_column": 13,
|
||
|
"ending_column": 19
|
||
|
},
|
||
|
"type_specific_fields": {
|
||
|
"parent": {
|
||
|
"type": "function",
|
||
|
"name": "f",
|
||
|
"source_mapping": {
|
||
|
"start": 17,
|
||
|
"length": 442,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17
|
||
|
],
|
||
|
"starting_column": 5,
|
||
|
"ending_column": 6
|
||
|
},
|
||
|
"type_specific_fields": {
|
||
|
"parent": {
|
||
|
"type": "contract",
|
||
|
"name": "C",
|
||
|
"source_mapping": {
|
||
|
"start": 0,
|
||
|
"length": 461,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
1,
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17,
|
||
|
18,
|
||
|
19
|
||
|
],
|
||
|
"starting_column": 1,
|
||
|
"ending_column": 0
|
||
|
}
|
||
|
},
|
||
|
"signature": "f(uint256)"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
],
|
||
|
"description": "Variable 'C.f(uint256).i (tests/detectors/variable-scope/predeclaration_usage_local.sol#8)' in C.f(uint256) (tests/detectors/variable-scope/predeclaration_usage_local.sol#2-17) potentially used before declaration: x += i (tests/detectors/variable-scope/predeclaration_usage_local.sol#15)\n",
|
||
|
"markdown": "Variable '[C.f(uint256).i](tests/detectors/variable-scope/predeclaration_usage_local.sol#L8)' in [C.f(uint256)](tests/detectors/variable-scope/predeclaration_usage_local.sol#L2-L17) potentially used before declaration: [x += i](tests/detectors/variable-scope/predeclaration_usage_local.sol#L15)\n",
|
||
|
"id": "1f58314c394d14558a0268c5241e448c32d6d74dcadc9a22dcd14b5a09fcbe0d",
|
||
|
"check": "variable-scope",
|
||
|
"impact": "Low",
|
||
|
"confidence": "High"
|
||
|
},
|
||
|
{
|
||
|
"elements": [
|
||
|
{
|
||
|
"type": "variable",
|
||
|
"name": "i",
|
||
|
"source_mapping": {
|
||
|
"start": 199,
|
||
|
"length": 11,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
8
|
||
|
],
|
||
|
"starting_column": 18,
|
||
|
"ending_column": 29
|
||
|
},
|
||
|
"type_specific_fields": {
|
||
|
"parent": {
|
||
|
"type": "function",
|
||
|
"name": "f",
|
||
|
"source_mapping": {
|
||
|
"start": 17,
|
||
|
"length": 442,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17
|
||
|
],
|
||
|
"starting_column": 5,
|
||
|
"ending_column": 6
|
||
|
},
|
||
|
"type_specific_fields": {
|
||
|
"parent": {
|
||
|
"type": "contract",
|
||
|
"name": "C",
|
||
|
"source_mapping": {
|
||
|
"start": 0,
|
||
|
"length": 461,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
1,
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17,
|
||
|
18,
|
||
|
19
|
||
|
],
|
||
|
"starting_column": 1,
|
||
|
"ending_column": 0
|
||
|
}
|
||
|
},
|
||
|
"signature": "f(uint256)"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"type": "function",
|
||
|
"name": "f",
|
||
|
"source_mapping": {
|
||
|
"start": 17,
|
||
|
"length": 442,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17
|
||
|
],
|
||
|
"starting_column": 5,
|
||
|
"ending_column": 6
|
||
|
},
|
||
|
"type_specific_fields": {
|
||
|
"parent": {
|
||
|
"type": "contract",
|
||
|
"name": "C",
|
||
|
"source_mapping": {
|
||
|
"start": 0,
|
||
|
"length": 461,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
1,
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17,
|
||
|
18,
|
||
|
19
|
||
|
],
|
||
|
"starting_column": 1,
|
||
|
"ending_column": 0
|
||
|
}
|
||
|
},
|
||
|
"signature": "f(uint256)"
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"type": "node",
|
||
|
"name": "i --",
|
||
|
"source_mapping": {
|
||
|
"start": 417,
|
||
|
"length": 3,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
14
|
||
|
],
|
||
|
"starting_column": 29,
|
||
|
"ending_column": 32
|
||
|
},
|
||
|
"type_specific_fields": {
|
||
|
"parent": {
|
||
|
"type": "function",
|
||
|
"name": "f",
|
||
|
"source_mapping": {
|
||
|
"start": 17,
|
||
|
"length": 442,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17
|
||
|
],
|
||
|
"starting_column": 5,
|
||
|
"ending_column": 6
|
||
|
},
|
||
|
"type_specific_fields": {
|
||
|
"parent": {
|
||
|
"type": "contract",
|
||
|
"name": "C",
|
||
|
"source_mapping": {
|
||
|
"start": 0,
|
||
|
"length": 461,
|
||
|
"filename_used": "/GENERIC_PATH",
|
||
|
"filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"filename_absolute": "/GENERIC_PATH",
|
||
|
"filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol",
|
||
|
"is_dependency": false,
|
||
|
"lines": [
|
||
|
1,
|
||
|
2,
|
||
|
3,
|
||
|
4,
|
||
|
5,
|
||
|
6,
|
||
|
7,
|
||
|
8,
|
||
|
9,
|
||
|
10,
|
||
|
11,
|
||
|
12,
|
||
|
13,
|
||
|
14,
|
||
|
15,
|
||
|
16,
|
||
|
17,
|
||
|
18,
|
||
|
19
|
||
|
],
|
||
|
"starting_column": 1,
|
||
|
"ending_column": 0
|
||
|
}
|
||
|
},
|
||
|
"signature": "f(uint256)"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
],
|
||
|
"description": "Variable 'C.f(uint256).i (tests/detectors/variable-scope/predeclaration_usage_local.sol#8)' in C.f(uint256) (tests/detectors/variable-scope/predeclaration_usage_local.sol#2-17) potentially used before declaration: i -- (tests/detectors/variable-scope/predeclaration_usage_local.sol#14)\n",
|
||
|
"markdown": "Variable '[C.f(uint256).i](tests/detectors/variable-scope/predeclaration_usage_local.sol#L8)' in [C.f(uint256)](tests/detectors/variable-scope/predeclaration_usage_local.sol#L2-L17) potentially used before declaration: [i --](tests/detectors/variable-scope/predeclaration_usage_local.sol#L14)\n",
|
||
|
"id": "a9a523e5ffe2ef3e4ae3fe06e6b411b269e804e071b5e04cd68cd2f942156cbb",
|
||
|
"check": "variable-scope",
|
||
|
"impact": "Low",
|
||
|
"confidence": "High"
|
||
|
}
|
||
|
]
|
||
|
]
|