mirror of https://github.com/crytic/slither
Merge pull request #858 from crytic/dev-baseline-tests
Add missing tests for detectorspull/1317/head
commit
8e65393f13
@ -0,0 +1,10 @@ |
|||||||
|
contract Test { |
||||||
|
|
||||||
|
function functionWithDeprecatedThrow() public constant { |
||||||
|
// Deprecated: Change msg.gas -> gasleft() |
||||||
|
if(msg.gas == msg.value) { |
||||||
|
// Deprecated: Change throw -> revert() |
||||||
|
throw; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,176 @@ |
|||||||
|
[ |
||||||
|
[ |
||||||
|
{ |
||||||
|
"elements": [ |
||||||
|
{ |
||||||
|
"type": "node", |
||||||
|
"name": "msg.gas == msg.value", |
||||||
|
"source_mapping": { |
||||||
|
"start": 140, |
||||||
|
"length": 20, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/deprecated-standards/0.4.25/deprecated_calls.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/deprecated-standards/0.4.25/deprecated_calls.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
5 |
||||||
|
], |
||||||
|
"starting_column": 12, |
||||||
|
"ending_column": 32 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "function", |
||||||
|
"name": "functionWithDeprecatedThrow", |
||||||
|
"source_mapping": { |
||||||
|
"start": 21, |
||||||
|
"length": 229, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/deprecated-standards/0.4.25/deprecated_calls.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/deprecated-standards/0.4.25/deprecated_calls.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9 |
||||||
|
], |
||||||
|
"starting_column": 5, |
||||||
|
"ending_column": 6 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "Test", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 252, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/deprecated-standards/0.4.25/deprecated_calls.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/deprecated-standards/0.4.25/deprecated_calls.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10, |
||||||
|
11 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "functionWithDeprecatedThrow()" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"description": "Deprecated standard detected msg.gas == msg.value (tests/detectors/deprecated-standards/0.4.25/deprecated_calls.sol#5):\n\t- Usage of \"msg.gas\" should be replaced with \"gasleft()\"\n", |
||||||
|
"markdown": "Deprecated standard detected [msg.gas == msg.value](tests/detectors/deprecated-standards/0.4.25/deprecated_calls.sol#L5):\n\t- Usage of \"msg.gas\" should be replaced with \"gasleft()\"\n", |
||||||
|
"first_markdown_element": "tests/detectors/deprecated-standards/0.4.25/deprecated_calls.sol#L5", |
||||||
|
"id": "e779713eabc28919356310f06b9413a8a3b7e9e713026d6cfae2d9f6839c1e57", |
||||||
|
"check": "deprecated-standards", |
||||||
|
"impact": "Informational", |
||||||
|
"confidence": "High" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"elements": [ |
||||||
|
{ |
||||||
|
"type": "node", |
||||||
|
"name": "", |
||||||
|
"source_mapping": { |
||||||
|
"start": 228, |
||||||
|
"length": 5, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/deprecated-standards/0.4.25/deprecated_calls.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/deprecated-standards/0.4.25/deprecated_calls.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
7 |
||||||
|
], |
||||||
|
"starting_column": 13, |
||||||
|
"ending_column": 18 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "function", |
||||||
|
"name": "functionWithDeprecatedThrow", |
||||||
|
"source_mapping": { |
||||||
|
"start": 21, |
||||||
|
"length": 229, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/deprecated-standards/0.4.25/deprecated_calls.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/deprecated-standards/0.4.25/deprecated_calls.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9 |
||||||
|
], |
||||||
|
"starting_column": 5, |
||||||
|
"ending_column": 6 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "Test", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 252, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/deprecated-standards/0.4.25/deprecated_calls.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/deprecated-standards/0.4.25/deprecated_calls.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10, |
||||||
|
11 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "functionWithDeprecatedThrow()" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"description": "Deprecated standard detected THROW (tests/detectors/deprecated-standards/0.4.25/deprecated_calls.sol#7):\n\t- Usage of \"throw\" should be replaced with \"revert()\"\n", |
||||||
|
"markdown": "Deprecated standard detected [THROW](tests/detectors/deprecated-standards/0.4.25/deprecated_calls.sol#L7):\n\t- Usage of \"throw\" should be replaced with \"revert()\"\n", |
||||||
|
"first_markdown_element": "tests/detectors/deprecated-standards/0.4.25/deprecated_calls.sol#L7", |
||||||
|
"id": "5fbf4a42467953d0fd8d0661cbb4eeb81d4b40f69ae3820196bf10c4be53044e", |
||||||
|
"check": "deprecated-standards", |
||||||
|
"impact": "Informational", |
||||||
|
"confidence": "High" |
||||||
|
} |
||||||
|
] |
||||||
|
] |
@ -0,0 +1,5 @@ |
|||||||
|
contract A { |
||||||
|
function f(uint a, uint b, uint c) public returns (uint) { |
||||||
|
return (a / b) * c; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,127 @@ |
|||||||
|
[ |
||||||
|
[ |
||||||
|
{ |
||||||
|
"elements": [ |
||||||
|
{ |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 14, |
||||||
|
"length": 92, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/divide-before-multiply/0.4.25/divide_before_multiply.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/divide-before-multiply/0.4.25/divide_before_multiply.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
2, |
||||||
|
3, |
||||||
|
4 |
||||||
|
], |
||||||
|
"starting_column": 2, |
||||||
|
"ending_column": 6 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 108, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/divide-before-multiply/0.4.25/divide_before_multiply.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/divide-before-multiply/0.4.25/divide_before_multiply.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f(uint256,uint256,uint256)" |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"type": "node", |
||||||
|
"name": "(a / b) * c", |
||||||
|
"source_mapping": { |
||||||
|
"start": 81, |
||||||
|
"length": 18, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/divide-before-multiply/0.4.25/divide_before_multiply.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/divide-before-multiply/0.4.25/divide_before_multiply.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
3 |
||||||
|
], |
||||||
|
"starting_column": 9, |
||||||
|
"ending_column": 27 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 14, |
||||||
|
"length": 92, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/divide-before-multiply/0.4.25/divide_before_multiply.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/divide-before-multiply/0.4.25/divide_before_multiply.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
2, |
||||||
|
3, |
||||||
|
4 |
||||||
|
], |
||||||
|
"starting_column": 2, |
||||||
|
"ending_column": 6 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 108, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/divide-before-multiply/0.4.25/divide_before_multiply.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/divide-before-multiply/0.4.25/divide_before_multiply.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f(uint256,uint256,uint256)" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"description": "A.f(uint256,uint256,uint256) (tests/detectors/divide-before-multiply/0.4.25/divide_before_multiply.sol#2-4) performs a multiplication on the result of a division:\n\t-(a / b) * c (tests/detectors/divide-before-multiply/0.4.25/divide_before_multiply.sol#3)\n", |
||||||
|
"markdown": "[A.f(uint256,uint256,uint256)](tests/detectors/divide-before-multiply/0.4.25/divide_before_multiply.sol#L2-L4) performs a multiplication on the result of a division:\n\t-[(a / b) * c](tests/detectors/divide-before-multiply/0.4.25/divide_before_multiply.sol#L3)\n", |
||||||
|
"first_markdown_element": "tests/detectors/divide-before-multiply/0.4.25/divide_before_multiply.sol#L2-L4", |
||||||
|
"id": "fe40e2f72824d1270402b09af057ec7364af1ad2f8c48ef4df72fc27012b3186", |
||||||
|
"check": "divide-before-multiply", |
||||||
|
"impact": "Medium", |
||||||
|
"confidence": "Medium" |
||||||
|
} |
||||||
|
] |
||||||
|
] |
@ -0,0 +1,5 @@ |
|||||||
|
contract A { |
||||||
|
function f(uint a, uint b, uint c) public returns (uint) { |
||||||
|
return (a / b) * c; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,127 @@ |
|||||||
|
[ |
||||||
|
[ |
||||||
|
{ |
||||||
|
"elements": [ |
||||||
|
{ |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 14, |
||||||
|
"length": 92, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/divide-before-multiply/0.5.16/divide_before_multiply.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/divide-before-multiply/0.5.16/divide_before_multiply.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
2, |
||||||
|
3, |
||||||
|
4 |
||||||
|
], |
||||||
|
"starting_column": 2, |
||||||
|
"ending_column": 6 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 108, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/divide-before-multiply/0.5.16/divide_before_multiply.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/divide-before-multiply/0.5.16/divide_before_multiply.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f(uint256,uint256,uint256)" |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"type": "node", |
||||||
|
"name": "(a / b) * c", |
||||||
|
"source_mapping": { |
||||||
|
"start": 81, |
||||||
|
"length": 18, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/divide-before-multiply/0.5.16/divide_before_multiply.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/divide-before-multiply/0.5.16/divide_before_multiply.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
3 |
||||||
|
], |
||||||
|
"starting_column": 9, |
||||||
|
"ending_column": 27 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 14, |
||||||
|
"length": 92, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/divide-before-multiply/0.5.16/divide_before_multiply.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/divide-before-multiply/0.5.16/divide_before_multiply.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
2, |
||||||
|
3, |
||||||
|
4 |
||||||
|
], |
||||||
|
"starting_column": 2, |
||||||
|
"ending_column": 6 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 108, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/divide-before-multiply/0.5.16/divide_before_multiply.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/divide-before-multiply/0.5.16/divide_before_multiply.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f(uint256,uint256,uint256)" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"description": "A.f(uint256,uint256,uint256) (tests/detectors/divide-before-multiply/0.5.16/divide_before_multiply.sol#2-4) performs a multiplication on the result of a division:\n\t-(a / b) * c (tests/detectors/divide-before-multiply/0.5.16/divide_before_multiply.sol#3)\n", |
||||||
|
"markdown": "[A.f(uint256,uint256,uint256)](tests/detectors/divide-before-multiply/0.5.16/divide_before_multiply.sol#L2-L4) performs a multiplication on the result of a division:\n\t-[(a / b) * c](tests/detectors/divide-before-multiply/0.5.16/divide_before_multiply.sol#L3)\n", |
||||||
|
"first_markdown_element": "tests/detectors/divide-before-multiply/0.5.16/divide_before_multiply.sol#L2-L4", |
||||||
|
"id": "a484421df5c9ebf3dc3d8bcec6701ab3065e03b21e294c4972142c4503f2fccb", |
||||||
|
"check": "divide-before-multiply", |
||||||
|
"impact": "Medium", |
||||||
|
"confidence": "Medium" |
||||||
|
} |
||||||
|
] |
||||||
|
] |
@ -0,0 +1,5 @@ |
|||||||
|
contract A { |
||||||
|
function f(uint a, uint b, uint c) public returns (uint) { |
||||||
|
return (a / b) * c; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,127 @@ |
|||||||
|
[ |
||||||
|
[ |
||||||
|
{ |
||||||
|
"elements": [ |
||||||
|
{ |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 14, |
||||||
|
"length": 92, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/divide-before-multiply/0.6.11/divide_before_multiply.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/divide-before-multiply/0.6.11/divide_before_multiply.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
2, |
||||||
|
3, |
||||||
|
4 |
||||||
|
], |
||||||
|
"starting_column": 2, |
||||||
|
"ending_column": 6 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 108, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/divide-before-multiply/0.6.11/divide_before_multiply.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/divide-before-multiply/0.6.11/divide_before_multiply.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f(uint256,uint256,uint256)" |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"type": "node", |
||||||
|
"name": "(a / b) * c", |
||||||
|
"source_mapping": { |
||||||
|
"start": 81, |
||||||
|
"length": 18, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/divide-before-multiply/0.6.11/divide_before_multiply.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/divide-before-multiply/0.6.11/divide_before_multiply.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
3 |
||||||
|
], |
||||||
|
"starting_column": 9, |
||||||
|
"ending_column": 27 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 14, |
||||||
|
"length": 92, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/divide-before-multiply/0.6.11/divide_before_multiply.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/divide-before-multiply/0.6.11/divide_before_multiply.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
2, |
||||||
|
3, |
||||||
|
4 |
||||||
|
], |
||||||
|
"starting_column": 2, |
||||||
|
"ending_column": 6 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 108, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/divide-before-multiply/0.6.11/divide_before_multiply.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/divide-before-multiply/0.6.11/divide_before_multiply.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f(uint256,uint256,uint256)" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"description": "A.f(uint256,uint256,uint256) (tests/detectors/divide-before-multiply/0.6.11/divide_before_multiply.sol#2-4) performs a multiplication on the result of a division:\n\t-(a / b) * c (tests/detectors/divide-before-multiply/0.6.11/divide_before_multiply.sol#3)\n", |
||||||
|
"markdown": "[A.f(uint256,uint256,uint256)](tests/detectors/divide-before-multiply/0.6.11/divide_before_multiply.sol#L2-L4) performs a multiplication on the result of a division:\n\t-[(a / b) * c](tests/detectors/divide-before-multiply/0.6.11/divide_before_multiply.sol#L3)\n", |
||||||
|
"first_markdown_element": "tests/detectors/divide-before-multiply/0.6.11/divide_before_multiply.sol#L2-L4", |
||||||
|
"id": "9010aa3fdf8f7689d4c4d4ea0bcd771668212100e5427e48644ed7337de03a6d", |
||||||
|
"check": "divide-before-multiply", |
||||||
|
"impact": "Medium", |
||||||
|
"confidence": "Medium" |
||||||
|
} |
||||||
|
] |
||||||
|
] |
@ -0,0 +1,5 @@ |
|||||||
|
contract A { |
||||||
|
function f(uint a, uint b, uint c) public returns (uint) { |
||||||
|
return (a / b) * c; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,127 @@ |
|||||||
|
[ |
||||||
|
[ |
||||||
|
{ |
||||||
|
"elements": [ |
||||||
|
{ |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 14, |
||||||
|
"length": 92, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/divide-before-multiply/0.7.6/divide_before_multiply.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/divide-before-multiply/0.7.6/divide_before_multiply.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
2, |
||||||
|
3, |
||||||
|
4 |
||||||
|
], |
||||||
|
"starting_column": 2, |
||||||
|
"ending_column": 6 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 108, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/divide-before-multiply/0.7.6/divide_before_multiply.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/divide-before-multiply/0.7.6/divide_before_multiply.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f(uint256,uint256,uint256)" |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"type": "node", |
||||||
|
"name": "(a / b) * c", |
||||||
|
"source_mapping": { |
||||||
|
"start": 81, |
||||||
|
"length": 18, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/divide-before-multiply/0.7.6/divide_before_multiply.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/divide-before-multiply/0.7.6/divide_before_multiply.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
3 |
||||||
|
], |
||||||
|
"starting_column": 9, |
||||||
|
"ending_column": 27 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 14, |
||||||
|
"length": 92, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/divide-before-multiply/0.7.6/divide_before_multiply.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/divide-before-multiply/0.7.6/divide_before_multiply.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
2, |
||||||
|
3, |
||||||
|
4 |
||||||
|
], |
||||||
|
"starting_column": 2, |
||||||
|
"ending_column": 6 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 108, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/divide-before-multiply/0.7.6/divide_before_multiply.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/divide-before-multiply/0.7.6/divide_before_multiply.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f(uint256,uint256,uint256)" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"description": "A.f(uint256,uint256,uint256) (tests/detectors/divide-before-multiply/0.7.6/divide_before_multiply.sol#2-4) performs a multiplication on the result of a division:\n\t-(a / b) * c (tests/detectors/divide-before-multiply/0.7.6/divide_before_multiply.sol#3)\n", |
||||||
|
"markdown": "[A.f(uint256,uint256,uint256)](tests/detectors/divide-before-multiply/0.7.6/divide_before_multiply.sol#L2-L4) performs a multiplication on the result of a division:\n\t-[(a / b) * c](tests/detectors/divide-before-multiply/0.7.6/divide_before_multiply.sol#L3)\n", |
||||||
|
"first_markdown_element": "tests/detectors/divide-before-multiply/0.7.6/divide_before_multiply.sol#L2-L4", |
||||||
|
"id": "9bc6cb85ece6cd57fa946707784180957080ad5f9575abc17af218f0d2801f77", |
||||||
|
"check": "divide-before-multiply", |
||||||
|
"impact": "Medium", |
||||||
|
"confidence": "Medium" |
||||||
|
} |
||||||
|
] |
||||||
|
] |
@ -0,0 +1,9 @@ |
|||||||
|
pragma solidity 0.4.2; |
||||||
|
contract Test{ |
||||||
|
|
||||||
|
enum E{a} |
||||||
|
|
||||||
|
function bug(uint a) public returns(E){ |
||||||
|
return E(a); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,222 @@ |
|||||||
|
[ |
||||||
|
[ |
||||||
|
{ |
||||||
|
"elements": [ |
||||||
|
{ |
||||||
|
"type": "node", |
||||||
|
"name": "Test.E(a)", |
||||||
|
"source_mapping": { |
||||||
|
"start": 118, |
||||||
|
"length": 11, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/enum-conversion/0.4.2/enum_conversion.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/enum-conversion/0.4.2/enum_conversion.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
7 |
||||||
|
], |
||||||
|
"starting_column": 9, |
||||||
|
"ending_column": 20 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "function", |
||||||
|
"name": "bug", |
||||||
|
"source_mapping": { |
||||||
|
"start": 70, |
||||||
|
"length": 69, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/enum-conversion/0.4.2/enum_conversion.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/enum-conversion/0.4.2/enum_conversion.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
6, |
||||||
|
7, |
||||||
|
8 |
||||||
|
], |
||||||
|
"starting_column": 5, |
||||||
|
"ending_column": 6 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "Test", |
||||||
|
"source_mapping": { |
||||||
|
"start": 27, |
||||||
|
"length": 114, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/enum-conversion/0.4.2/enum_conversion.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/enum-conversion/0.4.2/enum_conversion.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10 |
||||||
|
], |
||||||
|
"starting_column": 5, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "bug(uint256)" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"type": "variable", |
||||||
|
"name": "a", |
||||||
|
"source_mapping": { |
||||||
|
"start": 83, |
||||||
|
"length": 6, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/enum-conversion/0.4.2/enum_conversion.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/enum-conversion/0.4.2/enum_conversion.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
6 |
||||||
|
], |
||||||
|
"starting_column": 18, |
||||||
|
"ending_column": 24 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "function", |
||||||
|
"name": "bug", |
||||||
|
"source_mapping": { |
||||||
|
"start": 70, |
||||||
|
"length": 69, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/enum-conversion/0.4.2/enum_conversion.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/enum-conversion/0.4.2/enum_conversion.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
6, |
||||||
|
7, |
||||||
|
8 |
||||||
|
], |
||||||
|
"starting_column": 5, |
||||||
|
"ending_column": 6 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "Test", |
||||||
|
"source_mapping": { |
||||||
|
"start": 27, |
||||||
|
"length": 114, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/enum-conversion/0.4.2/enum_conversion.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/enum-conversion/0.4.2/enum_conversion.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10 |
||||||
|
], |
||||||
|
"starting_column": 5, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "bug(uint256)" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"type": "node", |
||||||
|
"name": "Test.E(a)", |
||||||
|
"source_mapping": { |
||||||
|
"start": 118, |
||||||
|
"length": 11, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/enum-conversion/0.4.2/enum_conversion.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/enum-conversion/0.4.2/enum_conversion.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
7 |
||||||
|
], |
||||||
|
"starting_column": 9, |
||||||
|
"ending_column": 20 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "function", |
||||||
|
"name": "bug", |
||||||
|
"source_mapping": { |
||||||
|
"start": 70, |
||||||
|
"length": 69, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/enum-conversion/0.4.2/enum_conversion.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/enum-conversion/0.4.2/enum_conversion.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
6, |
||||||
|
7, |
||||||
|
8 |
||||||
|
], |
||||||
|
"starting_column": 5, |
||||||
|
"ending_column": 6 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "Test", |
||||||
|
"source_mapping": { |
||||||
|
"start": 27, |
||||||
|
"length": 114, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/enum-conversion/0.4.2/enum_conversion.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/enum-conversion/0.4.2/enum_conversion.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10 |
||||||
|
], |
||||||
|
"starting_column": 5, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "bug(uint256)" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"description": "Test.E(a) (tests/detectors/enum-conversion/0.4.2/enum_conversion.sol#7) has a dangerous enum conversion\n\t- Variable: Test.bug(uint256).a (tests/detectors/enum-conversion/0.4.2/enum_conversion.sol#6) of type: uint256\n\t- Enum conversion: Test.E(a) (tests/detectors/enum-conversion/0.4.2/enum_conversion.sol#7)\n", |
||||||
|
"markdown": "[Test.E(a)](tests/detectors/enum-conversion/0.4.2/enum_conversion.sol#L7) has a dangerous enum conversion\n\t- Variable: [Test.bug(uint256).a](tests/detectors/enum-conversion/0.4.2/enum_conversion.sol#L6) of type: uint256\n\t- Enum conversion: [Test.E(a)](tests/detectors/enum-conversion/0.4.2/enum_conversion.sol#L7)\n", |
||||||
|
"first_markdown_element": "tests/detectors/enum-conversion/0.4.2/enum_conversion.sol#L7", |
||||||
|
"id": "f16bcdd6943fe3ff7ed6cc9b729ed5f95f61375509c7cce6646efa44c69860b7", |
||||||
|
"check": "enum-conversion", |
||||||
|
"impact": "Medium", |
||||||
|
"confidence": "High" |
||||||
|
} |
||||||
|
] |
||||||
|
] |
@ -0,0 +1,8 @@ |
|||||||
|
contract C { |
||||||
|
|
||||||
|
function f() internal returns (uint a) { |
||||||
|
assembly { |
||||||
|
a := shr(a, 8) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,3 @@ |
|||||||
|
[ |
||||||
|
[] |
||||||
|
] |
@ -0,0 +1,8 @@ |
|||||||
|
contract C { |
||||||
|
|
||||||
|
function f() internal returns (uint a) { |
||||||
|
assembly { |
||||||
|
a := shr(a, 8) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,3 @@ |
|||||||
|
[ |
||||||
|
[] |
||||||
|
] |
@ -0,0 +1,8 @@ |
|||||||
|
contract C { |
||||||
|
|
||||||
|
function f() internal returns (uint a) { |
||||||
|
assembly { |
||||||
|
a := shr(a, 8) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,135 @@ |
|||||||
|
[ |
||||||
|
[ |
||||||
|
{ |
||||||
|
"elements": [ |
||||||
|
{ |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 19, |
||||||
|
"length": 106, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/incorrect-shift/0.6.11/shift_parameter_mixup.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/incorrect-shift/0.6.11/shift_parameter_mixup.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7 |
||||||
|
], |
||||||
|
"starting_column": 5, |
||||||
|
"ending_column": 6 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "C", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 128, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/incorrect-shift/0.6.11/shift_parameter_mixup.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/incorrect-shift/0.6.11/shift_parameter_mixup.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 2 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f()" |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"type": "node", |
||||||
|
"name": "a = 8 >> a", |
||||||
|
"source_mapping": { |
||||||
|
"start": 93, |
||||||
|
"length": 14, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/incorrect-shift/0.6.11/shift_parameter_mixup.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/incorrect-shift/0.6.11/shift_parameter_mixup.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
5 |
||||||
|
], |
||||||
|
"starting_column": 13, |
||||||
|
"ending_column": 27 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 19, |
||||||
|
"length": 106, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/incorrect-shift/0.6.11/shift_parameter_mixup.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/incorrect-shift/0.6.11/shift_parameter_mixup.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7 |
||||||
|
], |
||||||
|
"starting_column": 5, |
||||||
|
"ending_column": 6 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "C", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 128, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/incorrect-shift/0.6.11/shift_parameter_mixup.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/incorrect-shift/0.6.11/shift_parameter_mixup.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 2 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f()" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"description": "C.f() (tests/detectors/incorrect-shift/0.6.11/shift_parameter_mixup.sol#3-7) contains an incorrect shift operation: a = 8 >> a (tests/detectors/incorrect-shift/0.6.11/shift_parameter_mixup.sol#5)\n", |
||||||
|
"markdown": "[C.f()](tests/detectors/incorrect-shift/0.6.11/shift_parameter_mixup.sol#L3-L7) contains an incorrect shift operation: [a = 8 >> a](tests/detectors/incorrect-shift/0.6.11/shift_parameter_mixup.sol#L5)\n", |
||||||
|
"first_markdown_element": "tests/detectors/incorrect-shift/0.6.11/shift_parameter_mixup.sol#L3-L7", |
||||||
|
"id": "eefda017d078fd6c0cdb19b471ac8d0a96b2b3dba9bac04ac194270820a77301", |
||||||
|
"check": "incorrect-shift", |
||||||
|
"impact": "High", |
||||||
|
"confidence": "High" |
||||||
|
} |
||||||
|
] |
||||||
|
] |
@ -0,0 +1,8 @@ |
|||||||
|
contract C { |
||||||
|
|
||||||
|
function f() internal returns (uint a) { |
||||||
|
assembly { |
||||||
|
a := shr(a, 8) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,135 @@ |
|||||||
|
[ |
||||||
|
[ |
||||||
|
{ |
||||||
|
"elements": [ |
||||||
|
{ |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 19, |
||||||
|
"length": 106, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/incorrect-shift/0.7.6/shift_parameter_mixup.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/incorrect-shift/0.7.6/shift_parameter_mixup.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7 |
||||||
|
], |
||||||
|
"starting_column": 5, |
||||||
|
"ending_column": 6 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "C", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 128, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/incorrect-shift/0.7.6/shift_parameter_mixup.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/incorrect-shift/0.7.6/shift_parameter_mixup.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 2 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f()" |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"type": "node", |
||||||
|
"name": "a = 8 >> a", |
||||||
|
"source_mapping": { |
||||||
|
"start": 93, |
||||||
|
"length": 14, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/incorrect-shift/0.7.6/shift_parameter_mixup.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/incorrect-shift/0.7.6/shift_parameter_mixup.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
5 |
||||||
|
], |
||||||
|
"starting_column": 13, |
||||||
|
"ending_column": 27 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 19, |
||||||
|
"length": 106, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/incorrect-shift/0.7.6/shift_parameter_mixup.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/incorrect-shift/0.7.6/shift_parameter_mixup.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7 |
||||||
|
], |
||||||
|
"starting_column": 5, |
||||||
|
"ending_column": 6 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "C", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 128, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/incorrect-shift/0.7.6/shift_parameter_mixup.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/incorrect-shift/0.7.6/shift_parameter_mixup.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 2 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f()" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"description": "C.f() (tests/detectors/incorrect-shift/0.7.6/shift_parameter_mixup.sol#3-7) contains an incorrect shift operation: a = 8 >> a (tests/detectors/incorrect-shift/0.7.6/shift_parameter_mixup.sol#5)\n", |
||||||
|
"markdown": "[C.f()](tests/detectors/incorrect-shift/0.7.6/shift_parameter_mixup.sol#L3-L7) contains an incorrect shift operation: [a = 8 >> a](tests/detectors/incorrect-shift/0.7.6/shift_parameter_mixup.sol#L5)\n", |
||||||
|
"first_markdown_element": "tests/detectors/incorrect-shift/0.7.6/shift_parameter_mixup.sol#L3-L7", |
||||||
|
"id": "8aa2292fd8d53a23f05aed92384dde452ea1f879d2422c4726b75a79a5aa6f81", |
||||||
|
"check": "incorrect-shift", |
||||||
|
"impact": "High", |
||||||
|
"confidence": "High" |
||||||
|
} |
||||||
|
] |
||||||
|
] |
@ -0,0 +1,9 @@ |
|||||||
|
interface ISomething { |
||||||
|
function f1() external returns(uint); |
||||||
|
} |
||||||
|
|
||||||
|
contract Something { |
||||||
|
function f1() external returns(uint){ |
||||||
|
return 42; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,58 @@ |
|||||||
|
[ |
||||||
|
[ |
||||||
|
{ |
||||||
|
"elements": [ |
||||||
|
{ |
||||||
|
"type": "contract", |
||||||
|
"name": "Something", |
||||||
|
"source_mapping": { |
||||||
|
"start": 68, |
||||||
|
"length": 89, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/missing-inheritance/0.4.25/unimplemented_interface.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/missing-inheritance/0.4.25/unimplemented_interface.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"type": "contract", |
||||||
|
"name": "ISomething", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 66, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/missing-inheritance/0.4.25/unimplemented_interface.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/missing-inheritance/0.4.25/unimplemented_interface.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 2 |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"description": "Something (tests/detectors/missing-inheritance/0.4.25/unimplemented_interface.sol#5-10) should inherit from ISomething (tests/detectors/missing-inheritance/0.4.25/unimplemented_interface.sol#1-3)\n", |
||||||
|
"markdown": "[Something](tests/detectors/missing-inheritance/0.4.25/unimplemented_interface.sol#L5-L10) should inherit from [ISomething](tests/detectors/missing-inheritance/0.4.25/unimplemented_interface.sol#L1-L3)\n", |
||||||
|
"first_markdown_element": "tests/detectors/missing-inheritance/0.4.25/unimplemented_interface.sol#L5-L10", |
||||||
|
"id": "58962dc72a6c49524a027e8e1615ab92be30f1a0f5ef0eb4a029204687159649", |
||||||
|
"check": "missing-inheritance", |
||||||
|
"impact": "Informational", |
||||||
|
"confidence": "High" |
||||||
|
} |
||||||
|
] |
||||||
|
] |
@ -0,0 +1,9 @@ |
|||||||
|
interface ISomething { |
||||||
|
function f1() external returns(uint); |
||||||
|
} |
||||||
|
|
||||||
|
contract Something { |
||||||
|
function f1() external returns(uint){ |
||||||
|
return 42; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,58 @@ |
|||||||
|
[ |
||||||
|
[ |
||||||
|
{ |
||||||
|
"elements": [ |
||||||
|
{ |
||||||
|
"type": "contract", |
||||||
|
"name": "Something", |
||||||
|
"source_mapping": { |
||||||
|
"start": 68, |
||||||
|
"length": 89, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/missing-inheritance/0.5.16/unimplemented_interface.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/missing-inheritance/0.5.16/unimplemented_interface.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"type": "contract", |
||||||
|
"name": "ISomething", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 66, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/missing-inheritance/0.5.16/unimplemented_interface.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/missing-inheritance/0.5.16/unimplemented_interface.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 2 |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"description": "Something (tests/detectors/missing-inheritance/0.5.16/unimplemented_interface.sol#5-10) should inherit from ISomething (tests/detectors/missing-inheritance/0.5.16/unimplemented_interface.sol#1-3)\n", |
||||||
|
"markdown": "[Something](tests/detectors/missing-inheritance/0.5.16/unimplemented_interface.sol#L5-L10) should inherit from [ISomething](tests/detectors/missing-inheritance/0.5.16/unimplemented_interface.sol#L1-L3)\n", |
||||||
|
"first_markdown_element": "tests/detectors/missing-inheritance/0.5.16/unimplemented_interface.sol#L5-L10", |
||||||
|
"id": "58962dc72a6c49524a027e8e1615ab92be30f1a0f5ef0eb4a029204687159649", |
||||||
|
"check": "missing-inheritance", |
||||||
|
"impact": "Informational", |
||||||
|
"confidence": "High" |
||||||
|
} |
||||||
|
] |
||||||
|
] |
@ -0,0 +1,9 @@ |
|||||||
|
interface ISomething { |
||||||
|
function f1() external returns(uint); |
||||||
|
} |
||||||
|
|
||||||
|
contract Something { |
||||||
|
function f1() external returns(uint){ |
||||||
|
return 42; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,58 @@ |
|||||||
|
[ |
||||||
|
[ |
||||||
|
{ |
||||||
|
"elements": [ |
||||||
|
{ |
||||||
|
"type": "contract", |
||||||
|
"name": "Something", |
||||||
|
"source_mapping": { |
||||||
|
"start": 68, |
||||||
|
"length": 89, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/missing-inheritance/0.6.11/unimplemented_interface.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/missing-inheritance/0.6.11/unimplemented_interface.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"type": "contract", |
||||||
|
"name": "ISomething", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 66, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/missing-inheritance/0.6.11/unimplemented_interface.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/missing-inheritance/0.6.11/unimplemented_interface.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 2 |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"description": "Something (tests/detectors/missing-inheritance/0.6.11/unimplemented_interface.sol#5-10) should inherit from ISomething (tests/detectors/missing-inheritance/0.6.11/unimplemented_interface.sol#1-3)\n", |
||||||
|
"markdown": "[Something](tests/detectors/missing-inheritance/0.6.11/unimplemented_interface.sol#L5-L10) should inherit from [ISomething](tests/detectors/missing-inheritance/0.6.11/unimplemented_interface.sol#L1-L3)\n", |
||||||
|
"first_markdown_element": "tests/detectors/missing-inheritance/0.6.11/unimplemented_interface.sol#L5-L10", |
||||||
|
"id": "58962dc72a6c49524a027e8e1615ab92be30f1a0f5ef0eb4a029204687159649", |
||||||
|
"check": "missing-inheritance", |
||||||
|
"impact": "Informational", |
||||||
|
"confidence": "High" |
||||||
|
} |
||||||
|
] |
||||||
|
] |
@ -0,0 +1,9 @@ |
|||||||
|
interface ISomething { |
||||||
|
function f1() external returns(uint); |
||||||
|
} |
||||||
|
|
||||||
|
contract Something { |
||||||
|
function f1() external returns(uint){ |
||||||
|
return 42; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,58 @@ |
|||||||
|
[ |
||||||
|
[ |
||||||
|
{ |
||||||
|
"elements": [ |
||||||
|
{ |
||||||
|
"type": "contract", |
||||||
|
"name": "Something", |
||||||
|
"source_mapping": { |
||||||
|
"start": 68, |
||||||
|
"length": 89, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/missing-inheritance/0.7.6/unimplemented_interface.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/missing-inheritance/0.7.6/unimplemented_interface.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"type": "contract", |
||||||
|
"name": "ISomething", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 66, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/missing-inheritance/0.7.6/unimplemented_interface.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/missing-inheritance/0.7.6/unimplemented_interface.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 2 |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"description": "Something (tests/detectors/missing-inheritance/0.7.6/unimplemented_interface.sol#5-10) should inherit from ISomething (tests/detectors/missing-inheritance/0.7.6/unimplemented_interface.sol#1-3)\n", |
||||||
|
"markdown": "[Something](tests/detectors/missing-inheritance/0.7.6/unimplemented_interface.sol#L5-L10) should inherit from [ISomething](tests/detectors/missing-inheritance/0.7.6/unimplemented_interface.sol#L1-L3)\n", |
||||||
|
"first_markdown_element": "tests/detectors/missing-inheritance/0.7.6/unimplemented_interface.sol#L5-L10", |
||||||
|
"id": "58962dc72a6c49524a027e8e1615ab92be30f1a0f5ef0eb4a029204687159649", |
||||||
|
"check": "missing-inheritance", |
||||||
|
"impact": "Informational", |
||||||
|
"confidence": "High" |
||||||
|
} |
||||||
|
] |
||||||
|
] |
@ -0,0 +1,13 @@ |
|||||||
|
contract A { |
||||||
|
uint x; |
||||||
|
constructor() public { |
||||||
|
x = 0; |
||||||
|
} |
||||||
|
function A() public { |
||||||
|
x = 1; |
||||||
|
} |
||||||
|
|
||||||
|
function test() public returns(uint) { |
||||||
|
return x; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,154 @@ |
|||||||
|
[ |
||||||
|
[ |
||||||
|
{ |
||||||
|
"elements": [ |
||||||
|
{ |
||||||
|
"type": "contract", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 193, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/multiple-constructors/0.4.22/multiple_constructor_schemes.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/multiple-constructors/0.4.22/multiple_constructor_schemes.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10, |
||||||
|
11, |
||||||
|
12, |
||||||
|
13, |
||||||
|
14 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"type": "function", |
||||||
|
"name": "constructor", |
||||||
|
"source_mapping": { |
||||||
|
"start": 29, |
||||||
|
"length": 43, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/multiple-constructors/0.4.22/multiple_constructor_schemes.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/multiple-constructors/0.4.22/multiple_constructor_schemes.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
3, |
||||||
|
4, |
||||||
|
5 |
||||||
|
], |
||||||
|
"starting_column": 5, |
||||||
|
"ending_column": 6 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 193, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/multiple-constructors/0.4.22/multiple_constructor_schemes.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/multiple-constructors/0.4.22/multiple_constructor_schemes.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10, |
||||||
|
11, |
||||||
|
12, |
||||||
|
13, |
||||||
|
14 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "constructor()" |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"type": "function", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 77, |
||||||
|
"length": 42, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/multiple-constructors/0.4.22/multiple_constructor_schemes.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/multiple-constructors/0.4.22/multiple_constructor_schemes.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
6, |
||||||
|
7, |
||||||
|
8 |
||||||
|
], |
||||||
|
"starting_column": 5, |
||||||
|
"ending_column": 6 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 193, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/multiple-constructors/0.4.22/multiple_constructor_schemes.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/multiple-constructors/0.4.22/multiple_constructor_schemes.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10, |
||||||
|
11, |
||||||
|
12, |
||||||
|
13, |
||||||
|
14 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "A()" |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"description": "A (tests/detectors/multiple-constructors/0.4.22/multiple_constructor_schemes.sol#1-14) contains multiple constructors in the same contract:\n\t- A.constructor() (tests/detectors/multiple-constructors/0.4.22/multiple_constructor_schemes.sol#3-5)\n\t- A.A() (tests/detectors/multiple-constructors/0.4.22/multiple_constructor_schemes.sol#6-8)\n", |
||||||
|
"markdown": "[A](tests/detectors/multiple-constructors/0.4.22/multiple_constructor_schemes.sol#L1-L14) contains multiple constructors in the same contract:\n\t- [A.constructor()](tests/detectors/multiple-constructors/0.4.22/multiple_constructor_schemes.sol#L3-L5)\n\t- [A.A()](tests/detectors/multiple-constructors/0.4.22/multiple_constructor_schemes.sol#L6-L8)\n", |
||||||
|
"first_markdown_element": "tests/detectors/multiple-constructors/0.4.22/multiple_constructor_schemes.sol#L1-L14", |
||||||
|
"id": "704cdb1c05e919913c22befaf077b9585bc75e31b5033fa46c930ad82dc6852e", |
||||||
|
"check": "multiple-constructors", |
||||||
|
"impact": "High", |
||||||
|
"confidence": "High" |
||||||
|
} |
||||||
|
] |
||||||
|
] |
@ -0,0 +1,7 @@ |
|||||||
|
contract Similar { |
||||||
|
function f() public returns (uint) { |
||||||
|
uint testVariable = 1; |
||||||
|
uint textVariable = 2; |
||||||
|
return testVariable + textVariable; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,155 @@ |
|||||||
|
[ |
||||||
|
[ |
||||||
|
{ |
||||||
|
"elements": [ |
||||||
|
{ |
||||||
|
"type": "variable", |
||||||
|
"name": "testVariable", |
||||||
|
"source_mapping": { |
||||||
|
"start": 69, |
||||||
|
"length": 21, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/similar-names/0.4.25/similar_variables.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/similar-names/0.4.25/similar_variables.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
3 |
||||||
|
], |
||||||
|
"starting_column": 9, |
||||||
|
"ending_column": 30 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 23, |
||||||
|
"length": 149, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/similar-names/0.4.25/similar_variables.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/similar-names/0.4.25/similar_variables.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6 |
||||||
|
], |
||||||
|
"starting_column": 5, |
||||||
|
"ending_column": 6 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "Similar", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 174, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/similar-names/0.4.25/similar_variables.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/similar-names/0.4.25/similar_variables.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f()" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"type": "variable", |
||||||
|
"name": "textVariable", |
||||||
|
"source_mapping": { |
||||||
|
"start": 100, |
||||||
|
"length": 21, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/similar-names/0.4.25/similar_variables.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/similar-names/0.4.25/similar_variables.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
4 |
||||||
|
], |
||||||
|
"starting_column": 9, |
||||||
|
"ending_column": 30 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 23, |
||||||
|
"length": 149, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/similar-names/0.4.25/similar_variables.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/similar-names/0.4.25/similar_variables.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6 |
||||||
|
], |
||||||
|
"starting_column": 5, |
||||||
|
"ending_column": 6 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "Similar", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 174, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/similar-names/0.4.25/similar_variables.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/similar-names/0.4.25/similar_variables.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f()" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"description": "Variable Similar.f().testVariable (tests/detectors/similar-names/0.4.25/similar_variables.sol#3) is too similar to Similar.f().textVariable (tests/detectors/similar-names/0.4.25/similar_variables.sol#4)\n", |
||||||
|
"markdown": "Variable [Similar.f().testVariable](tests/detectors/similar-names/0.4.25/similar_variables.sol#L3) is too similar to [Similar.f().textVariable](tests/detectors/similar-names/0.4.25/similar_variables.sol#L4)\n", |
||||||
|
"first_markdown_element": "tests/detectors/similar-names/0.4.25/similar_variables.sol#L3", |
||||||
|
"id": "2f767a2bb6f48a8435ce456e2d3ad859bdeccf66507735a14e20515e914038d5", |
||||||
|
"check": "similar-names", |
||||||
|
"impact": "Informational", |
||||||
|
"confidence": "Medium" |
||||||
|
} |
||||||
|
] |
||||||
|
] |
@ -0,0 +1,7 @@ |
|||||||
|
contract Similar { |
||||||
|
function f() public returns (uint) { |
||||||
|
uint testVariable = 1; |
||||||
|
uint textVariable = 2; |
||||||
|
return testVariable + textVariable; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,155 @@ |
|||||||
|
[ |
||||||
|
[ |
||||||
|
{ |
||||||
|
"elements": [ |
||||||
|
{ |
||||||
|
"type": "variable", |
||||||
|
"name": "testVariable", |
||||||
|
"source_mapping": { |
||||||
|
"start": 69, |
||||||
|
"length": 21, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/similar-names/0.5.16/similar_variables.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/similar-names/0.5.16/similar_variables.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
3 |
||||||
|
], |
||||||
|
"starting_column": 9, |
||||||
|
"ending_column": 30 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 23, |
||||||
|
"length": 149, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/similar-names/0.5.16/similar_variables.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/similar-names/0.5.16/similar_variables.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6 |
||||||
|
], |
||||||
|
"starting_column": 5, |
||||||
|
"ending_column": 6 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "Similar", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 174, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/similar-names/0.5.16/similar_variables.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/similar-names/0.5.16/similar_variables.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f()" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"type": "variable", |
||||||
|
"name": "textVariable", |
||||||
|
"source_mapping": { |
||||||
|
"start": 100, |
||||||
|
"length": 21, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/similar-names/0.5.16/similar_variables.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/similar-names/0.5.16/similar_variables.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
4 |
||||||
|
], |
||||||
|
"starting_column": 9, |
||||||
|
"ending_column": 30 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 23, |
||||||
|
"length": 149, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/similar-names/0.5.16/similar_variables.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/similar-names/0.5.16/similar_variables.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6 |
||||||
|
], |
||||||
|
"starting_column": 5, |
||||||
|
"ending_column": 6 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "Similar", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 174, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/similar-names/0.5.16/similar_variables.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/similar-names/0.5.16/similar_variables.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f()" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"description": "Variable Similar.f().testVariable (tests/detectors/similar-names/0.5.16/similar_variables.sol#3) is too similar to Similar.f().textVariable (tests/detectors/similar-names/0.5.16/similar_variables.sol#4)\n", |
||||||
|
"markdown": "Variable [Similar.f().testVariable](tests/detectors/similar-names/0.5.16/similar_variables.sol#L3) is too similar to [Similar.f().textVariable](tests/detectors/similar-names/0.5.16/similar_variables.sol#L4)\n", |
||||||
|
"first_markdown_element": "tests/detectors/similar-names/0.5.16/similar_variables.sol#L3", |
||||||
|
"id": "2f767a2bb6f48a8435ce456e2d3ad859bdeccf66507735a14e20515e914038d5", |
||||||
|
"check": "similar-names", |
||||||
|
"impact": "Informational", |
||||||
|
"confidence": "Medium" |
||||||
|
} |
||||||
|
] |
||||||
|
] |
@ -0,0 +1,7 @@ |
|||||||
|
contract Similar { |
||||||
|
function f() public returns (uint) { |
||||||
|
uint testVariable = 1; |
||||||
|
uint textVariable = 2; |
||||||
|
return testVariable + textVariable; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,155 @@ |
|||||||
|
[ |
||||||
|
[ |
||||||
|
{ |
||||||
|
"elements": [ |
||||||
|
{ |
||||||
|
"type": "variable", |
||||||
|
"name": "testVariable", |
||||||
|
"source_mapping": { |
||||||
|
"start": 69, |
||||||
|
"length": 21, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/similar-names/0.6.11/similar_variables.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/similar-names/0.6.11/similar_variables.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
3 |
||||||
|
], |
||||||
|
"starting_column": 9, |
||||||
|
"ending_column": 30 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 23, |
||||||
|
"length": 149, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/similar-names/0.6.11/similar_variables.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/similar-names/0.6.11/similar_variables.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6 |
||||||
|
], |
||||||
|
"starting_column": 5, |
||||||
|
"ending_column": 6 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "Similar", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 174, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/similar-names/0.6.11/similar_variables.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/similar-names/0.6.11/similar_variables.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f()" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"type": "variable", |
||||||
|
"name": "textVariable", |
||||||
|
"source_mapping": { |
||||||
|
"start": 100, |
||||||
|
"length": 21, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/similar-names/0.6.11/similar_variables.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/similar-names/0.6.11/similar_variables.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
4 |
||||||
|
], |
||||||
|
"starting_column": 9, |
||||||
|
"ending_column": 30 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 23, |
||||||
|
"length": 149, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/similar-names/0.6.11/similar_variables.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/similar-names/0.6.11/similar_variables.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6 |
||||||
|
], |
||||||
|
"starting_column": 5, |
||||||
|
"ending_column": 6 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "Similar", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 174, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/similar-names/0.6.11/similar_variables.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/similar-names/0.6.11/similar_variables.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f()" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"description": "Variable Similar.f().testVariable (tests/detectors/similar-names/0.6.11/similar_variables.sol#3) is too similar to Similar.f().textVariable (tests/detectors/similar-names/0.6.11/similar_variables.sol#4)\n", |
||||||
|
"markdown": "Variable [Similar.f().testVariable](tests/detectors/similar-names/0.6.11/similar_variables.sol#L3) is too similar to [Similar.f().textVariable](tests/detectors/similar-names/0.6.11/similar_variables.sol#L4)\n", |
||||||
|
"first_markdown_element": "tests/detectors/similar-names/0.6.11/similar_variables.sol#L3", |
||||||
|
"id": "2f767a2bb6f48a8435ce456e2d3ad859bdeccf66507735a14e20515e914038d5", |
||||||
|
"check": "similar-names", |
||||||
|
"impact": "Informational", |
||||||
|
"confidence": "Medium" |
||||||
|
} |
||||||
|
] |
||||||
|
] |
@ -0,0 +1,7 @@ |
|||||||
|
contract Similar { |
||||||
|
function f() public returns (uint) { |
||||||
|
uint testVariable = 1; |
||||||
|
uint textVariable = 2; |
||||||
|
return testVariable + textVariable; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,155 @@ |
|||||||
|
[ |
||||||
|
[ |
||||||
|
{ |
||||||
|
"elements": [ |
||||||
|
{ |
||||||
|
"type": "variable", |
||||||
|
"name": "testVariable", |
||||||
|
"source_mapping": { |
||||||
|
"start": 69, |
||||||
|
"length": 21, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/similar-names/0.7.6/similar_variables.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/similar-names/0.7.6/similar_variables.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
3 |
||||||
|
], |
||||||
|
"starting_column": 9, |
||||||
|
"ending_column": 30 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 23, |
||||||
|
"length": 149, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/similar-names/0.7.6/similar_variables.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/similar-names/0.7.6/similar_variables.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6 |
||||||
|
], |
||||||
|
"starting_column": 5, |
||||||
|
"ending_column": 6 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "Similar", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 174, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/similar-names/0.7.6/similar_variables.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/similar-names/0.7.6/similar_variables.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f()" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"type": "variable", |
||||||
|
"name": "textVariable", |
||||||
|
"source_mapping": { |
||||||
|
"start": 100, |
||||||
|
"length": 21, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/similar-names/0.7.6/similar_variables.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/similar-names/0.7.6/similar_variables.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
4 |
||||||
|
], |
||||||
|
"starting_column": 9, |
||||||
|
"ending_column": 30 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 23, |
||||||
|
"length": 149, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/similar-names/0.7.6/similar_variables.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/similar-names/0.7.6/similar_variables.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6 |
||||||
|
], |
||||||
|
"starting_column": 5, |
||||||
|
"ending_column": 6 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "Similar", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 174, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/similar-names/0.7.6/similar_variables.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/similar-names/0.7.6/similar_variables.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f()" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"description": "Variable Similar.f().testVariable (tests/detectors/similar-names/0.7.6/similar_variables.sol#3) is too similar to Similar.f().textVariable (tests/detectors/similar-names/0.7.6/similar_variables.sol#4)\n", |
||||||
|
"markdown": "Variable [Similar.f().testVariable](tests/detectors/similar-names/0.7.6/similar_variables.sol#L3) is too similar to [Similar.f().textVariable](tests/detectors/similar-names/0.7.6/similar_variables.sol#L4)\n", |
||||||
|
"first_markdown_element": "tests/detectors/similar-names/0.7.6/similar_variables.sol#L3", |
||||||
|
"id": "2f767a2bb6f48a8435ce456e2d3ad859bdeccf66507735a14e20515e914038d5", |
||||||
|
"check": "similar-names", |
||||||
|
"impact": "Informational", |
||||||
|
"confidence": "Medium" |
||||||
|
} |
||||||
|
] |
||||||
|
] |
@ -0,0 +1,12 @@ |
|||||||
|
contract A { |
||||||
|
function f(uint x) public returns (uint) { |
||||||
|
if (x >= 0) { // bad -- always true |
||||||
|
return 1; |
||||||
|
} |
||||||
|
return 7; |
||||||
|
} |
||||||
|
|
||||||
|
function g(uint8 y) public returns (bool) { |
||||||
|
return (y < 512); // bad! |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,284 @@ |
|||||||
|
[ |
||||||
|
[ |
||||||
|
{ |
||||||
|
"elements": [ |
||||||
|
{ |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 14, |
||||||
|
"length": 133, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.4.25/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.4.25/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7 |
||||||
|
], |
||||||
|
"starting_column": 2, |
||||||
|
"ending_column": 3 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 232, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.4.25/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.4.25/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10, |
||||||
|
11, |
||||||
|
12, |
||||||
|
13 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f(uint256)" |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"type": "node", |
||||||
|
"name": "x >= 0", |
||||||
|
"source_mapping": { |
||||||
|
"start": 69, |
||||||
|
"length": 6, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.4.25/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.4.25/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
3 |
||||||
|
], |
||||||
|
"starting_column": 13, |
||||||
|
"ending_column": 19 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 14, |
||||||
|
"length": 133, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.4.25/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.4.25/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7 |
||||||
|
], |
||||||
|
"starting_column": 2, |
||||||
|
"ending_column": 3 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 232, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.4.25/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.4.25/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10, |
||||||
|
11, |
||||||
|
12, |
||||||
|
13 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f(uint256)" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"description": "A.f(uint256) (tests/detectors/tautology/0.4.25/type_based_tautology.sol#2-7) contains a tautology or contradiction:\n\t- x >= 0 (tests/detectors/tautology/0.4.25/type_based_tautology.sol#3)\n", |
||||||
|
"markdown": "[A.f(uint256)](tests/detectors/tautology/0.4.25/type_based_tautology.sol#L2-L7) contains a tautology or contradiction:\n\t- [x >= 0](tests/detectors/tautology/0.4.25/type_based_tautology.sol#L3)\n", |
||||||
|
"first_markdown_element": "tests/detectors/tautology/0.4.25/type_based_tautology.sol#L2-L7", |
||||||
|
"id": "c9b8085dbb7e6d0dfc2ee5711ac45a70e4c0f494ac4efcae42a6b947e3170ddb", |
||||||
|
"check": "tautology", |
||||||
|
"impact": "Medium", |
||||||
|
"confidence": "High" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"elements": [ |
||||||
|
{ |
||||||
|
"type": "function", |
||||||
|
"name": "g", |
||||||
|
"source_mapping": { |
||||||
|
"start": 150, |
||||||
|
"length": 80, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.4.25/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.4.25/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
9, |
||||||
|
10, |
||||||
|
11 |
||||||
|
], |
||||||
|
"starting_column": 2, |
||||||
|
"ending_column": 3 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 232, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.4.25/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.4.25/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10, |
||||||
|
11, |
||||||
|
12, |
||||||
|
13 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "g(uint8)" |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"type": "node", |
||||||
|
"name": "(y < 512)", |
||||||
|
"source_mapping": { |
||||||
|
"start": 202, |
||||||
|
"length": 16, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.4.25/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.4.25/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
10 |
||||||
|
], |
||||||
|
"starting_column": 9, |
||||||
|
"ending_column": 25 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "function", |
||||||
|
"name": "g", |
||||||
|
"source_mapping": { |
||||||
|
"start": 150, |
||||||
|
"length": 80, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.4.25/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.4.25/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
9, |
||||||
|
10, |
||||||
|
11 |
||||||
|
], |
||||||
|
"starting_column": 2, |
||||||
|
"ending_column": 3 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 232, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.4.25/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.4.25/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10, |
||||||
|
11, |
||||||
|
12, |
||||||
|
13 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "g(uint8)" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"description": "A.g(uint8) (tests/detectors/tautology/0.4.25/type_based_tautology.sol#9-11) contains a tautology or contradiction:\n\t- (y < 512) (tests/detectors/tautology/0.4.25/type_based_tautology.sol#10)\n", |
||||||
|
"markdown": "[A.g(uint8)](tests/detectors/tautology/0.4.25/type_based_tautology.sol#L9-L11) contains a tautology or contradiction:\n\t- [(y < 512)](tests/detectors/tautology/0.4.25/type_based_tautology.sol#L10)\n", |
||||||
|
"first_markdown_element": "tests/detectors/tautology/0.4.25/type_based_tautology.sol#L9-L11", |
||||||
|
"id": "75dfe0b8776a8cf490a4e3f30366dec173fd0dc7418335f77c68ba5bca536382", |
||||||
|
"check": "tautology", |
||||||
|
"impact": "Medium", |
||||||
|
"confidence": "High" |
||||||
|
} |
||||||
|
] |
||||||
|
] |
@ -0,0 +1,12 @@ |
|||||||
|
contract A { |
||||||
|
function f(uint x) public returns (uint) { |
||||||
|
if (x >= 0) { // bad -- always true |
||||||
|
return 1; |
||||||
|
} |
||||||
|
return 7; |
||||||
|
} |
||||||
|
|
||||||
|
function g(uint8 y) public returns (bool) { |
||||||
|
return (y < 512); // bad! |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,284 @@ |
|||||||
|
[ |
||||||
|
[ |
||||||
|
{ |
||||||
|
"elements": [ |
||||||
|
{ |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 14, |
||||||
|
"length": 133, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.5.16/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.5.16/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7 |
||||||
|
], |
||||||
|
"starting_column": 2, |
||||||
|
"ending_column": 3 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 232, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.5.16/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.5.16/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10, |
||||||
|
11, |
||||||
|
12, |
||||||
|
13 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f(uint256)" |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"type": "node", |
||||||
|
"name": "x >= 0", |
||||||
|
"source_mapping": { |
||||||
|
"start": 69, |
||||||
|
"length": 6, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.5.16/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.5.16/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
3 |
||||||
|
], |
||||||
|
"starting_column": 13, |
||||||
|
"ending_column": 19 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 14, |
||||||
|
"length": 133, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.5.16/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.5.16/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7 |
||||||
|
], |
||||||
|
"starting_column": 2, |
||||||
|
"ending_column": 3 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 232, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.5.16/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.5.16/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10, |
||||||
|
11, |
||||||
|
12, |
||||||
|
13 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f(uint256)" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"description": "A.f(uint256) (tests/detectors/tautology/0.5.16/type_based_tautology.sol#2-7) contains a tautology or contradiction:\n\t- x >= 0 (tests/detectors/tautology/0.5.16/type_based_tautology.sol#3)\n", |
||||||
|
"markdown": "[A.f(uint256)](tests/detectors/tautology/0.5.16/type_based_tautology.sol#L2-L7) contains a tautology or contradiction:\n\t- [x >= 0](tests/detectors/tautology/0.5.16/type_based_tautology.sol#L3)\n", |
||||||
|
"first_markdown_element": "tests/detectors/tautology/0.5.16/type_based_tautology.sol#L2-L7", |
||||||
|
"id": "764eb2c7aa5cd1a30d16deb620e0dc3b8a9e9170978908bcc1f6fc1ac5a8daa1", |
||||||
|
"check": "tautology", |
||||||
|
"impact": "Medium", |
||||||
|
"confidence": "High" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"elements": [ |
||||||
|
{ |
||||||
|
"type": "function", |
||||||
|
"name": "g", |
||||||
|
"source_mapping": { |
||||||
|
"start": 150, |
||||||
|
"length": 80, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.5.16/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.5.16/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
9, |
||||||
|
10, |
||||||
|
11 |
||||||
|
], |
||||||
|
"starting_column": 2, |
||||||
|
"ending_column": 3 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 232, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.5.16/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.5.16/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10, |
||||||
|
11, |
||||||
|
12, |
||||||
|
13 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "g(uint8)" |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"type": "node", |
||||||
|
"name": "(y < 512)", |
||||||
|
"source_mapping": { |
||||||
|
"start": 202, |
||||||
|
"length": 16, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.5.16/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.5.16/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
10 |
||||||
|
], |
||||||
|
"starting_column": 9, |
||||||
|
"ending_column": 25 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "function", |
||||||
|
"name": "g", |
||||||
|
"source_mapping": { |
||||||
|
"start": 150, |
||||||
|
"length": 80, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.5.16/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.5.16/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
9, |
||||||
|
10, |
||||||
|
11 |
||||||
|
], |
||||||
|
"starting_column": 2, |
||||||
|
"ending_column": 3 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 232, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.5.16/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.5.16/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10, |
||||||
|
11, |
||||||
|
12, |
||||||
|
13 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "g(uint8)" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"description": "A.g(uint8) (tests/detectors/tautology/0.5.16/type_based_tautology.sol#9-11) contains a tautology or contradiction:\n\t- (y < 512) (tests/detectors/tautology/0.5.16/type_based_tautology.sol#10)\n", |
||||||
|
"markdown": "[A.g(uint8)](tests/detectors/tautology/0.5.16/type_based_tautology.sol#L9-L11) contains a tautology or contradiction:\n\t- [(y < 512)](tests/detectors/tautology/0.5.16/type_based_tautology.sol#L10)\n", |
||||||
|
"first_markdown_element": "tests/detectors/tautology/0.5.16/type_based_tautology.sol#L9-L11", |
||||||
|
"id": "0c29aa92764cb30104a4c4ba02e307d5949143b4cbfa2d8a52d9473140907872", |
||||||
|
"check": "tautology", |
||||||
|
"impact": "Medium", |
||||||
|
"confidence": "High" |
||||||
|
} |
||||||
|
] |
||||||
|
] |
@ -0,0 +1,12 @@ |
|||||||
|
contract A { |
||||||
|
function f(uint x) public returns (uint) { |
||||||
|
if (x >= 0) { // bad -- always true |
||||||
|
return 1; |
||||||
|
} |
||||||
|
return 7; |
||||||
|
} |
||||||
|
|
||||||
|
function g(uint8 y) public returns (bool) { |
||||||
|
return (y < 512); // bad! |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,284 @@ |
|||||||
|
[ |
||||||
|
[ |
||||||
|
{ |
||||||
|
"elements": [ |
||||||
|
{ |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 14, |
||||||
|
"length": 133, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.6.11/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.6.11/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7 |
||||||
|
], |
||||||
|
"starting_column": 2, |
||||||
|
"ending_column": 3 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 232, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.6.11/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.6.11/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10, |
||||||
|
11, |
||||||
|
12, |
||||||
|
13 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f(uint256)" |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"type": "node", |
||||||
|
"name": "x >= 0", |
||||||
|
"source_mapping": { |
||||||
|
"start": 69, |
||||||
|
"length": 6, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.6.11/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.6.11/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
3 |
||||||
|
], |
||||||
|
"starting_column": 13, |
||||||
|
"ending_column": 19 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 14, |
||||||
|
"length": 133, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.6.11/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.6.11/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7 |
||||||
|
], |
||||||
|
"starting_column": 2, |
||||||
|
"ending_column": 3 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 232, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.6.11/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.6.11/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10, |
||||||
|
11, |
||||||
|
12, |
||||||
|
13 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f(uint256)" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"description": "A.f(uint256) (tests/detectors/tautology/0.6.11/type_based_tautology.sol#2-7) contains a tautology or contradiction:\n\t- x >= 0 (tests/detectors/tautology/0.6.11/type_based_tautology.sol#3)\n", |
||||||
|
"markdown": "[A.f(uint256)](tests/detectors/tautology/0.6.11/type_based_tautology.sol#L2-L7) contains a tautology or contradiction:\n\t- [x >= 0](tests/detectors/tautology/0.6.11/type_based_tautology.sol#L3)\n", |
||||||
|
"first_markdown_element": "tests/detectors/tautology/0.6.11/type_based_tautology.sol#L2-L7", |
||||||
|
"id": "fec3df769045cbe4984e50b2f651f60ffc36b116bc7273a64f761e8fbfc674b9", |
||||||
|
"check": "tautology", |
||||||
|
"impact": "Medium", |
||||||
|
"confidence": "High" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"elements": [ |
||||||
|
{ |
||||||
|
"type": "function", |
||||||
|
"name": "g", |
||||||
|
"source_mapping": { |
||||||
|
"start": 150, |
||||||
|
"length": 80, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.6.11/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.6.11/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
9, |
||||||
|
10, |
||||||
|
11 |
||||||
|
], |
||||||
|
"starting_column": 2, |
||||||
|
"ending_column": 3 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 232, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.6.11/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.6.11/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10, |
||||||
|
11, |
||||||
|
12, |
||||||
|
13 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "g(uint8)" |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"type": "node", |
||||||
|
"name": "(y < 512)", |
||||||
|
"source_mapping": { |
||||||
|
"start": 202, |
||||||
|
"length": 16, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.6.11/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.6.11/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
10 |
||||||
|
], |
||||||
|
"starting_column": 9, |
||||||
|
"ending_column": 25 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "function", |
||||||
|
"name": "g", |
||||||
|
"source_mapping": { |
||||||
|
"start": 150, |
||||||
|
"length": 80, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.6.11/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.6.11/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
9, |
||||||
|
10, |
||||||
|
11 |
||||||
|
], |
||||||
|
"starting_column": 2, |
||||||
|
"ending_column": 3 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 232, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.6.11/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.6.11/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10, |
||||||
|
11, |
||||||
|
12, |
||||||
|
13 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "g(uint8)" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"description": "A.g(uint8) (tests/detectors/tautology/0.6.11/type_based_tautology.sol#9-11) contains a tautology or contradiction:\n\t- (y < 512) (tests/detectors/tautology/0.6.11/type_based_tautology.sol#10)\n", |
||||||
|
"markdown": "[A.g(uint8)](tests/detectors/tautology/0.6.11/type_based_tautology.sol#L9-L11) contains a tautology or contradiction:\n\t- [(y < 512)](tests/detectors/tautology/0.6.11/type_based_tautology.sol#L10)\n", |
||||||
|
"first_markdown_element": "tests/detectors/tautology/0.6.11/type_based_tautology.sol#L9-L11", |
||||||
|
"id": "51bc777574da16aab9aefb9d0294fdad9ef3a44136e9e7b1f7e05cfd9c1d4e54", |
||||||
|
"check": "tautology", |
||||||
|
"impact": "Medium", |
||||||
|
"confidence": "High" |
||||||
|
} |
||||||
|
] |
||||||
|
] |
@ -0,0 +1,12 @@ |
|||||||
|
contract A { |
||||||
|
function f(uint x) public returns (uint) { |
||||||
|
if (x >= 0) { // bad -- always true |
||||||
|
return 1; |
||||||
|
} |
||||||
|
return 7; |
||||||
|
} |
||||||
|
|
||||||
|
function g(uint8 y) public returns (bool) { |
||||||
|
return (y < 512); // bad! |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,284 @@ |
|||||||
|
[ |
||||||
|
[ |
||||||
|
{ |
||||||
|
"elements": [ |
||||||
|
{ |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 14, |
||||||
|
"length": 133, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.7.6/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.7.6/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7 |
||||||
|
], |
||||||
|
"starting_column": 2, |
||||||
|
"ending_column": 3 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 232, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.7.6/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.7.6/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10, |
||||||
|
11, |
||||||
|
12, |
||||||
|
13 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f(uint256)" |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"type": "node", |
||||||
|
"name": "x >= 0", |
||||||
|
"source_mapping": { |
||||||
|
"start": 69, |
||||||
|
"length": 6, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.7.6/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.7.6/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
3 |
||||||
|
], |
||||||
|
"starting_column": 13, |
||||||
|
"ending_column": 19 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "function", |
||||||
|
"name": "f", |
||||||
|
"source_mapping": { |
||||||
|
"start": 14, |
||||||
|
"length": 133, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.7.6/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.7.6/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7 |
||||||
|
], |
||||||
|
"starting_column": 2, |
||||||
|
"ending_column": 3 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 232, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.7.6/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.7.6/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10, |
||||||
|
11, |
||||||
|
12, |
||||||
|
13 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "f(uint256)" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"description": "A.f(uint256) (tests/detectors/tautology/0.7.6/type_based_tautology.sol#2-7) contains a tautology or contradiction:\n\t- x >= 0 (tests/detectors/tautology/0.7.6/type_based_tautology.sol#3)\n", |
||||||
|
"markdown": "[A.f(uint256)](tests/detectors/tautology/0.7.6/type_based_tautology.sol#L2-L7) contains a tautology or contradiction:\n\t- [x >= 0](tests/detectors/tautology/0.7.6/type_based_tautology.sol#L3)\n", |
||||||
|
"first_markdown_element": "tests/detectors/tautology/0.7.6/type_based_tautology.sol#L2-L7", |
||||||
|
"id": "e444c1c7287bff97cae3505472d10d8ef5e01aa1f2e7660c81a3beb11eeaea0e", |
||||||
|
"check": "tautology", |
||||||
|
"impact": "Medium", |
||||||
|
"confidence": "High" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"elements": [ |
||||||
|
{ |
||||||
|
"type": "function", |
||||||
|
"name": "g", |
||||||
|
"source_mapping": { |
||||||
|
"start": 150, |
||||||
|
"length": 80, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.7.6/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.7.6/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
9, |
||||||
|
10, |
||||||
|
11 |
||||||
|
], |
||||||
|
"starting_column": 2, |
||||||
|
"ending_column": 3 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 232, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.7.6/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.7.6/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10, |
||||||
|
11, |
||||||
|
12, |
||||||
|
13 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "g(uint8)" |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"type": "node", |
||||||
|
"name": "(y < 512)", |
||||||
|
"source_mapping": { |
||||||
|
"start": 202, |
||||||
|
"length": 16, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.7.6/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.7.6/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
10 |
||||||
|
], |
||||||
|
"starting_column": 9, |
||||||
|
"ending_column": 25 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "function", |
||||||
|
"name": "g", |
||||||
|
"source_mapping": { |
||||||
|
"start": 150, |
||||||
|
"length": 80, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.7.6/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.7.6/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
9, |
||||||
|
10, |
||||||
|
11 |
||||||
|
], |
||||||
|
"starting_column": 2, |
||||||
|
"ending_column": 3 |
||||||
|
}, |
||||||
|
"type_specific_fields": { |
||||||
|
"parent": { |
||||||
|
"type": "contract", |
||||||
|
"name": "A", |
||||||
|
"source_mapping": { |
||||||
|
"start": 0, |
||||||
|
"length": 232, |
||||||
|
"filename_used": "/GENERIC_PATH", |
||||||
|
"filename_relative": "tests/detectors/tautology/0.7.6/type_based_tautology.sol", |
||||||
|
"filename_absolute": "/GENERIC_PATH", |
||||||
|
"filename_short": "tests/detectors/tautology/0.7.6/type_based_tautology.sol", |
||||||
|
"is_dependency": false, |
||||||
|
"lines": [ |
||||||
|
1, |
||||||
|
2, |
||||||
|
3, |
||||||
|
4, |
||||||
|
5, |
||||||
|
6, |
||||||
|
7, |
||||||
|
8, |
||||||
|
9, |
||||||
|
10, |
||||||
|
11, |
||||||
|
12, |
||||||
|
13 |
||||||
|
], |
||||||
|
"starting_column": 1, |
||||||
|
"ending_column": 0 |
||||||
|
} |
||||||
|
}, |
||||||
|
"signature": "g(uint8)" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"description": "A.g(uint8) (tests/detectors/tautology/0.7.6/type_based_tautology.sol#9-11) contains a tautology or contradiction:\n\t- (y < 512) (tests/detectors/tautology/0.7.6/type_based_tautology.sol#10)\n", |
||||||
|
"markdown": "[A.g(uint8)](tests/detectors/tautology/0.7.6/type_based_tautology.sol#L9-L11) contains a tautology or contradiction:\n\t- [(y < 512)](tests/detectors/tautology/0.7.6/type_based_tautology.sol#L10)\n", |
||||||
|
"first_markdown_element": "tests/detectors/tautology/0.7.6/type_based_tautology.sol#L9-L11", |
||||||
|
"id": "036b1ecab6ee0dcb07806dbd8ffb05abf29941bbbcbb161da0013b31be51b3de", |
||||||
|
"check": "tautology", |
||||||
|
"impact": "Medium", |
||||||
|
"confidence": "High" |
||||||
|
} |
||||||
|
] |
||||||
|
] |
Loading…
Reference in new issue