fix issue-887, FP reentrancy in constructor

pull/1048/head
Jaime 3 years ago
parent feac84d7f7
commit 5ae6a06ed1
  1. 11
      slither/detectors/reentrancy/reentrancy.py
  2. 276
      tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol.0.4.25.ABIEncoderV2Array.json
  3. 276
      tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol.0.5.9.ABIEncoderV2Array.json
  4. 9
      tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol
  5. 1137
      tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol.0.4.25.ReentrancyBenign.json
  6. 9
      tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol
  7. 1145
      tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol.0.5.16.ReentrancyBenign.json
  8. 9
      tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol
  9. 1145
      tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol.0.6.11.ReentrancyBenign.json
  10. 9
      tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol
  11. 1145
      tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol.0.7.6.ReentrancyBenign.json
  12. 10
      tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol
  13. 218
      tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol.0.4.25.ReentrancyEth.json
  14. 11
      tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol
  15. 248
      tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol.0.5.16.ReentrancyEth.json
  16. 11
      tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol
  17. 248
      tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol.0.6.11.ReentrancyEth.json
  18. 11
      tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol
  19. 248
      tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol.0.7.6.ReentrancyEth.json
  20. 10
      tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol
  21. 306
      tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol.0.4.25.ReentrancyReadBeforeWritten.json
  22. 10
      tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol
  23. 316
      tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol.0.5.16.ReentrancyReadBeforeWritten.json
  24. 10
      tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol
  25. 316
      tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol.0.6.11.ReentrancyReadBeforeWritten.json
  26. 14
      tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol
  27. 406
      tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol.0.7.6.ReentrancyReadBeforeWritten.json
  28. 88
      tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol.0.5.10.StorageSignedIntegerArray.json

@ -283,11 +283,12 @@ class Reentrancy(AbstractDetector):
def detect_reentrancy(self, contract):
for function in contract.functions_and_modifiers_declared:
if function.is_implemented:
if self.KEY in function.context:
continue
self._explore(function.entry_point, [])
function.context[self.KEY] = True
if not function.is_constructor:
if function.is_implemented:
if self.KEY in function.context:
continue
self._explore(function.entry_point, [])
function.context[self.KEY] = True
def _detect(self):
""""""

@ -4,19 +4,19 @@
"elements": [
{
"type": "function",
"name": "bad3",
"name": "bad1",
"source_mapping": {
"start": 1076,
"length": 154,
"start": 726,
"length": 63,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
39,
40,
41
29,
30,
31
],
"starting_column": 3,
"ending_column": 4
@ -136,42 +136,42 @@
"ending_column": 2
}
},
"signature": "bad3()"
"signature": "bad1(A.S[3])"
}
},
{
"type": "node",
"name": "b = abi.encode(s)",
"name": "this.bad1_external(s)",
"source_mapping": {
"start": 1195,
"length": 30,
"start": 763,
"length": 21,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
40
30
],
"starting_column": 5,
"ending_column": 35
"ending_column": 26
},
"type_specific_fields": {
"parent": {
"type": "function",
"name": "bad3",
"name": "bad1",
"source_mapping": {
"start": 1076,
"length": 154,
"start": 726,
"length": 63,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
39,
40,
41
29,
30,
31
],
"starting_column": 3,
"ending_column": 4
@ -291,16 +291,16 @@
"ending_column": 2
}
},
"signature": "bad3()"
"signature": "bad1(A.S[3])"
}
}
}
}
],
"description": "Function A.bad3() (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#39-41) trigger an abi encoding bug:\n\t- b = abi.encode(s) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#40)\n",
"markdown": "Function [A.bad3()](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L39-L41) trigger an abi encoding bug:\n\t- [b = abi.encode(s)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L40)\n",
"first_markdown_element": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L39-L41",
"id": "0c50cf7f7b16d965ef04035beb09d25f3fa1fa4afeeb079ea42f2db879e8f1e9",
"description": "Function A.bad1(A.S[3]) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#29-31) trigger an abi encoding bug:\n\t- this.bad1_external(s) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#30)\n",
"markdown": "Function [A.bad1(A.S[3])](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L29-L31) trigger an abi encoding bug:\n\t- [this.bad1_external(s)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L30)\n",
"first_markdown_element": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L29-L31",
"id": "3febdd98f71332c80290c9557c5ef89ea9dbea4f520a084b0307f21b00da5010",
"check": "abiencoderv2-array",
"impact": "High",
"confidence": "High"
@ -309,19 +309,19 @@
"elements": [
{
"type": "function",
"name": "bad0",
"name": "bad2",
"source_mapping": {
"start": 540,
"length": 61,
"start": 852,
"length": 160,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
21,
22,
23
34,
35,
36
],
"starting_column": 3,
"ending_column": 4
@ -441,42 +441,42 @@
"ending_column": 2
}
},
"signature": "bad0()"
"signature": "bad2()"
}
},
{
"type": "node",
"name": "this.bad0_external(bad_arr)",
"name": "b = abi.encode(bad_arr)",
"source_mapping": {
"start": 569,
"length": 27,
"start": 971,
"length": 36,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
22
35
],
"starting_column": 5,
"ending_column": 32
"ending_column": 41
},
"type_specific_fields": {
"parent": {
"type": "function",
"name": "bad0",
"name": "bad2",
"source_mapping": {
"start": 540,
"length": 61,
"start": 852,
"length": 160,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
21,
22,
23
34,
35,
36
],
"starting_column": 3,
"ending_column": 4
@ -596,16 +596,16 @@
"ending_column": 2
}
},
"signature": "bad0()"
"signature": "bad2()"
}
}
}
}
],
"description": "Function A.bad0() (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#21-23) trigger an abi encoding bug:\n\t- this.bad0_external(bad_arr) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#22)\n",
"markdown": "Function [A.bad0()](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L21-L23) trigger an abi encoding bug:\n\t- [this.bad0_external(bad_arr)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L22)\n",
"first_markdown_element": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L21-L23",
"id": "3752da45df0ba78cc9ac01a10b398e4ad74e6ddd572764cf2f361e523a43a998",
"description": "Function A.bad2() (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#34-36) trigger an abi encoding bug:\n\t- b = abi.encode(bad_arr) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#35)\n",
"markdown": "Function [A.bad2()](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L34-L36) trigger an abi encoding bug:\n\t- [b = abi.encode(bad_arr)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L35)\n",
"first_markdown_element": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L34-L36",
"id": "d5860309d331920d1e3f44508fea706df75a4a7c2e93666ca96ca00ef32d7e01",
"check": "abiencoderv2-array",
"impact": "High",
"confidence": "High"
@ -614,19 +614,19 @@
"elements": [
{
"type": "function",
"name": "bad1",
"name": "bad3",
"source_mapping": {
"start": 726,
"length": 63,
"start": 1076,
"length": 154,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
29,
30,
31
39,
40,
41
],
"starting_column": 3,
"ending_column": 4
@ -746,42 +746,42 @@
"ending_column": 2
}
},
"signature": "bad1(A.S[3])"
"signature": "bad3()"
}
},
{
"type": "node",
"name": "this.bad1_external(s)",
"name": "b = abi.encode(s)",
"source_mapping": {
"start": 763,
"length": 21,
"start": 1195,
"length": 30,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
30
40
],
"starting_column": 5,
"ending_column": 26
"ending_column": 35
},
"type_specific_fields": {
"parent": {
"type": "function",
"name": "bad1",
"name": "bad3",
"source_mapping": {
"start": 726,
"length": 63,
"start": 1076,
"length": 154,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
29,
30,
31
39,
40,
41
],
"starting_column": 3,
"ending_column": 4
@ -901,16 +901,16 @@
"ending_column": 2
}
},
"signature": "bad1(A.S[3])"
"signature": "bad3()"
}
}
}
}
],
"description": "Function A.bad1(A.S[3]) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#29-31) trigger an abi encoding bug:\n\t- this.bad1_external(s) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#30)\n",
"markdown": "Function [A.bad1(A.S[3])](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L29-L31) trigger an abi encoding bug:\n\t- [this.bad1_external(s)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L30)\n",
"first_markdown_element": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L29-L31",
"id": "3febdd98f71332c80290c9557c5ef89ea9dbea4f520a084b0307f21b00da5010",
"description": "Function A.bad3() (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#39-41) trigger an abi encoding bug:\n\t- b = abi.encode(s) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#40)\n",
"markdown": "Function [A.bad3()](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L39-L41) trigger an abi encoding bug:\n\t- [b = abi.encode(s)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L40)\n",
"first_markdown_element": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L39-L41",
"id": "0c50cf7f7b16d965ef04035beb09d25f3fa1fa4afeeb079ea42f2db879e8f1e9",
"check": "abiencoderv2-array",
"impact": "High",
"confidence": "High"
@ -919,19 +919,19 @@
"elements": [
{
"type": "function",
"name": "bad5",
"name": "bad0",
"source_mapping": {
"start": 1511,
"length": 142,
"start": 540,
"length": 61,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
49,
50,
51
21,
22,
23
],
"starting_column": 3,
"ending_column": 4
@ -1051,42 +1051,42 @@
"ending_column": 2
}
},
"signature": "bad5()"
"signature": "bad0()"
}
},
{
"type": "node",
"name": "event2_bad(s)",
"name": "this.bad0_external(bad_arr)",
"source_mapping": {
"start": 1630,
"length": 18,
"start": 569,
"length": 27,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
50
22
],
"starting_column": 5,
"ending_column": 23
"ending_column": 32
},
"type_specific_fields": {
"parent": {
"type": "function",
"name": "bad5",
"name": "bad0",
"source_mapping": {
"start": 1511,
"length": 142,
"start": 540,
"length": 61,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
49,
50,
51
21,
22,
23
],
"starting_column": 3,
"ending_column": 4
@ -1206,16 +1206,16 @@
"ending_column": 2
}
},
"signature": "bad5()"
"signature": "bad0()"
}
}
}
}
],
"description": "Function A.bad5() (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#49-51) trigger an abi encoding bug:\n\t- event2_bad(s) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#50)\n",
"markdown": "Function [A.bad5()](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L49-L51) trigger an abi encoding bug:\n\t- [event2_bad(s)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L50)\n",
"first_markdown_element": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L49-L51",
"id": "e77767c95f4548636027a859ca0c63402cfb50af242f116dd3cfc5b038a4128e",
"description": "Function A.bad0() (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#21-23) trigger an abi encoding bug:\n\t- this.bad0_external(bad_arr) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#22)\n",
"markdown": "Function [A.bad0()](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L21-L23) trigger an abi encoding bug:\n\t- [this.bad0_external(bad_arr)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L22)\n",
"first_markdown_element": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L21-L23",
"id": "3752da45df0ba78cc9ac01a10b398e4ad74e6ddd572764cf2f361e523a43a998",
"check": "abiencoderv2-array",
"impact": "High",
"confidence": "High"
@ -1224,19 +1224,19 @@
"elements": [
{
"type": "function",
"name": "bad4",
"name": "bad5",
"source_mapping": {
"start": 1296,
"length": 148,
"start": 1511,
"length": 142,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
44,
45,
46
49,
50,
51
],
"starting_column": 3,
"ending_column": 4
@ -1356,42 +1356,42 @@
"ending_column": 2
}
},
"signature": "bad4()"
"signature": "bad5()"
}
},
{
"type": "node",
"name": "event1_bad(bad_arr)",
"name": "event2_bad(s)",
"source_mapping": {
"start": 1415,
"length": 24,
"start": 1630,
"length": 18,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
45
50
],
"starting_column": 5,
"ending_column": 29
"ending_column": 23
},
"type_specific_fields": {
"parent": {
"type": "function",
"name": "bad4",
"name": "bad5",
"source_mapping": {
"start": 1296,
"length": 148,
"start": 1511,
"length": 142,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
44,
45,
46
49,
50,
51
],
"starting_column": 3,
"ending_column": 4
@ -1511,16 +1511,16 @@
"ending_column": 2
}
},
"signature": "bad4()"
"signature": "bad5()"
}
}
}
}
],
"description": "Function A.bad4() (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#44-46) trigger an abi encoding bug:\n\t- event1_bad(bad_arr) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#45)\n",
"markdown": "Function [A.bad4()](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L44-L46) trigger an abi encoding bug:\n\t- [event1_bad(bad_arr)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L45)\n",
"first_markdown_element": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L44-L46",
"id": "144c77aebb4037fe38c2864892ecb888a4fb7d5e92e321e664b2d2226658a166",
"description": "Function A.bad5() (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#49-51) trigger an abi encoding bug:\n\t- event2_bad(s) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#50)\n",
"markdown": "Function [A.bad5()](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L49-L51) trigger an abi encoding bug:\n\t- [event2_bad(s)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L50)\n",
"first_markdown_element": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L49-L51",
"id": "e77767c95f4548636027a859ca0c63402cfb50af242f116dd3cfc5b038a4128e",
"check": "abiencoderv2-array",
"impact": "High",
"confidence": "High"
@ -1529,19 +1529,19 @@
"elements": [
{
"type": "function",
"name": "bad2",
"name": "bad4",
"source_mapping": {
"start": 852,
"length": 160,
"start": 1296,
"length": 148,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
34,
35,
36
44,
45,
46
],
"starting_column": 3,
"ending_column": 4
@ -1661,42 +1661,42 @@
"ending_column": 2
}
},
"signature": "bad2()"
"signature": "bad4()"
}
},
{
"type": "node",
"name": "b = abi.encode(bad_arr)",
"name": "event1_bad(bad_arr)",
"source_mapping": {
"start": 971,
"length": 36,
"start": 1415,
"length": 24,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
35
45
],
"starting_column": 5,
"ending_column": 41
"ending_column": 29
},
"type_specific_fields": {
"parent": {
"type": "function",
"name": "bad2",
"name": "bad4",
"source_mapping": {
"start": 852,
"length": 160,
"start": 1296,
"length": 148,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
34,
35,
36
44,
45,
46
],
"starting_column": 3,
"ending_column": 4
@ -1816,16 +1816,16 @@
"ending_column": 2
}
},
"signature": "bad2()"
"signature": "bad4()"
}
}
}
}
],
"description": "Function A.bad2() (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#34-36) trigger an abi encoding bug:\n\t- b = abi.encode(bad_arr) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#35)\n",
"markdown": "Function [A.bad2()](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L34-L36) trigger an abi encoding bug:\n\t- [b = abi.encode(bad_arr)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L35)\n",
"first_markdown_element": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L34-L36",
"id": "d5860309d331920d1e3f44508fea706df75a4a7c2e93666ca96ca00ef32d7e01",
"description": "Function A.bad4() (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#44-46) trigger an abi encoding bug:\n\t- event1_bad(bad_arr) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#45)\n",
"markdown": "Function [A.bad4()](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L44-L46) trigger an abi encoding bug:\n\t- [event1_bad(bad_arr)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L45)\n",
"first_markdown_element": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L44-L46",
"id": "144c77aebb4037fe38c2864892ecb888a4fb7d5e92e321e664b2d2226658a166",
"check": "abiencoderv2-array",
"impact": "High",
"confidence": "High"

@ -4,19 +4,19 @@
"elements": [
{
"type": "function",
"name": "bad1",
"name": "bad5",
"source_mapping": {
"start": 744,
"length": 70,
"start": 1536,
"length": 142,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
29,
30,
31
49,
50,
51
],
"starting_column": 3,
"ending_column": 4
@ -136,42 +136,42 @@
"ending_column": 2
}
},
"signature": "bad1(A.S[3])"
"signature": "bad5()"
}
},
{
"type": "node",
"name": "this.bad1_external(s)",
"name": "event2_bad(s)",
"source_mapping": {
"start": 788,
"length": 21,
"start": 1655,
"length": 18,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
30
50
],
"starting_column": 5,
"ending_column": 26
"ending_column": 23
},
"type_specific_fields": {
"parent": {
"type": "function",
"name": "bad1",
"name": "bad5",
"source_mapping": {
"start": 744,
"length": 70,
"start": 1536,
"length": 142,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
29,
30,
31
49,
50,
51
],
"starting_column": 3,
"ending_column": 4
@ -291,16 +291,16 @@
"ending_column": 2
}
},
"signature": "bad1(A.S[3])"
"signature": "bad5()"
}
}
}
}
],
"description": "Function A.bad1(A.S[3]) (tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#29-31) trigger an abi encoding bug:\n\t- this.bad1_external(s) (tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#30)\n",
"markdown": "Function [A.bad1(A.S[3])](tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L29-L31) trigger an abi encoding bug:\n\t- [this.bad1_external(s)](tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L30)\n",
"first_markdown_element": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L29-L31",
"id": "04f20a6b780d160f34e95fca8f1dc426e8d05eaf7a452340a809bdeafcb84efb",
"description": "Function A.bad5() (tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#49-51) trigger an abi encoding bug:\n\t- event2_bad(s) (tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#50)\n",
"markdown": "Function [A.bad5()](tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L49-L51) trigger an abi encoding bug:\n\t- [event2_bad(s)](tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L50)\n",
"first_markdown_element": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L49-L51",
"id": "9c6da636be98419174c8e81e73efc09e7b942f9cf477cf0de793fb92c88fc976",
"check": "abiencoderv2-array",
"impact": "High",
"confidence": "High"
@ -309,19 +309,19 @@
"elements": [
{
"type": "function",
"name": "bad2",
"name": "bad4",
"source_mapping": {
"start": 877,
"length": 160,
"start": 1321,
"length": 148,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
34,
35,
36
44,
45,
46
],
"starting_column": 3,
"ending_column": 4
@ -441,42 +441,42 @@
"ending_column": 2
}
},
"signature": "bad2()"
"signature": "bad4()"
}
},
{
"type": "node",
"name": "b = abi.encode(bad_arr)",
"name": "event1_bad(bad_arr)",
"source_mapping": {
"start": 996,
"length": 36,
"start": 1440,
"length": 24,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
35
45
],
"starting_column": 5,
"ending_column": 41
"ending_column": 29
},
"type_specific_fields": {
"parent": {
"type": "function",
"name": "bad2",
"name": "bad4",
"source_mapping": {
"start": 877,
"length": 160,
"start": 1321,
"length": 148,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
34,
35,
36
44,
45,
46
],
"starting_column": 3,
"ending_column": 4
@ -596,16 +596,16 @@
"ending_column": 2
}
},
"signature": "bad2()"
"signature": "bad4()"
}
}
}
}
],
"description": "Function A.bad2() (tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#34-36) trigger an abi encoding bug:\n\t- b = abi.encode(bad_arr) (tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#35)\n",
"markdown": "Function [A.bad2()](tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L34-L36) trigger an abi encoding bug:\n\t- [b = abi.encode(bad_arr)](tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L35)\n",
"first_markdown_element": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L34-L36",
"id": "e976cd11118a9f5aaacfe5715cef990140fd67c7a35682446aedc878b63b3b24",
"description": "Function A.bad4() (tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#44-46) trigger an abi encoding bug:\n\t- event1_bad(bad_arr) (tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#45)\n",
"markdown": "Function [A.bad4()](tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L44-L46) trigger an abi encoding bug:\n\t- [event1_bad(bad_arr)](tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L45)\n",
"first_markdown_element": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L44-L46",
"id": "6e9dfeb7f6ea7c989276fa8c5e27d71ab0f6b63ee878fb3f761dab9d07942246",
"check": "abiencoderv2-array",
"impact": "High",
"confidence": "High"
@ -614,19 +614,19 @@
"elements": [
{
"type": "function",
"name": "bad0",
"name": "bad1",
"source_mapping": {
"start": 549,
"length": 61,
"start": 744,
"length": 70,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
21,
22,
23
29,
30,
31
],
"starting_column": 3,
"ending_column": 4
@ -746,42 +746,42 @@
"ending_column": 2
}
},
"signature": "bad0()"
"signature": "bad1(A.S[3])"
}
},
{
"type": "node",
"name": "this.bad0_external(bad_arr)",
"name": "this.bad1_external(s)",
"source_mapping": {
"start": 578,
"length": 27,
"start": 788,
"length": 21,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
22
30
],
"starting_column": 5,
"ending_column": 32
"ending_column": 26
},
"type_specific_fields": {
"parent": {
"type": "function",
"name": "bad0",
"name": "bad1",
"source_mapping": {
"start": 549,
"length": 61,
"start": 744,
"length": 70,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
21,
22,
23
29,
30,
31
],
"starting_column": 3,
"ending_column": 4
@ -901,16 +901,16 @@
"ending_column": 2
}
},
"signature": "bad0()"
"signature": "bad1(A.S[3])"
}
}
}
}
],
"description": "Function A.bad0() (tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#21-23) trigger an abi encoding bug:\n\t- this.bad0_external(bad_arr) (tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#22)\n",
"markdown": "Function [A.bad0()](tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L21-L23) trigger an abi encoding bug:\n\t- [this.bad0_external(bad_arr)](tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L22)\n",
"first_markdown_element": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L21-L23",
"id": "4755c0ac779753117c13ea710352c179c82da332c5be5f08ea5da28efa4c63b6",
"description": "Function A.bad1(A.S[3]) (tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#29-31) trigger an abi encoding bug:\n\t- this.bad1_external(s) (tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#30)\n",
"markdown": "Function [A.bad1(A.S[3])](tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L29-L31) trigger an abi encoding bug:\n\t- [this.bad1_external(s)](tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L30)\n",
"first_markdown_element": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L29-L31",
"id": "04f20a6b780d160f34e95fca8f1dc426e8d05eaf7a452340a809bdeafcb84efb",
"check": "abiencoderv2-array",
"impact": "High",
"confidence": "High"
@ -919,19 +919,19 @@
"elements": [
{
"type": "function",
"name": "bad3",
"name": "bad0",
"source_mapping": {
"start": 1101,
"length": 154,
"start": 549,
"length": 61,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
39,
40,
41
21,
22,
23
],
"starting_column": 3,
"ending_column": 4
@ -1051,42 +1051,42 @@
"ending_column": 2
}
},
"signature": "bad3()"
"signature": "bad0()"
}
},
{
"type": "node",
"name": "b = abi.encode(s)",
"name": "this.bad0_external(bad_arr)",
"source_mapping": {
"start": 1220,
"length": 30,
"start": 578,
"length": 27,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
40
22
],
"starting_column": 5,
"ending_column": 35
"ending_column": 32
},
"type_specific_fields": {
"parent": {
"type": "function",
"name": "bad3",
"name": "bad0",
"source_mapping": {
"start": 1101,
"length": 154,
"start": 549,
"length": 61,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
39,
40,
41
21,
22,
23
],
"starting_column": 3,
"ending_column": 4
@ -1206,16 +1206,16 @@
"ending_column": 2
}
},
"signature": "bad3()"
"signature": "bad0()"
}
}
}
}
],
"description": "Function A.bad3() (tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#39-41) trigger an abi encoding bug:\n\t- b = abi.encode(s) (tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#40)\n",
"markdown": "Function [A.bad3()](tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L39-L41) trigger an abi encoding bug:\n\t- [b = abi.encode(s)](tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L40)\n",
"first_markdown_element": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L39-L41",
"id": "37e980d8d34fcffe10d2533052de986dd57c1d45700f02234332b275b532c71d",
"description": "Function A.bad0() (tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#21-23) trigger an abi encoding bug:\n\t- this.bad0_external(bad_arr) (tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#22)\n",
"markdown": "Function [A.bad0()](tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L21-L23) trigger an abi encoding bug:\n\t- [this.bad0_external(bad_arr)](tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L22)\n",
"first_markdown_element": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L21-L23",
"id": "4755c0ac779753117c13ea710352c179c82da332c5be5f08ea5da28efa4c63b6",
"check": "abiencoderv2-array",
"impact": "High",
"confidence": "High"
@ -1224,19 +1224,19 @@
"elements": [
{
"type": "function",
"name": "bad5",
"name": "bad2",
"source_mapping": {
"start": 1536,
"length": 142,
"start": 877,
"length": 160,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
49,
50,
51
34,
35,
36
],
"starting_column": 3,
"ending_column": 4
@ -1356,42 +1356,42 @@
"ending_column": 2
}
},
"signature": "bad5()"
"signature": "bad2()"
}
},
{
"type": "node",
"name": "event2_bad(s)",
"name": "b = abi.encode(bad_arr)",
"source_mapping": {
"start": 1655,
"length": 18,
"start": 996,
"length": 36,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
50
35
],
"starting_column": 5,
"ending_column": 23
"ending_column": 41
},
"type_specific_fields": {
"parent": {
"type": "function",
"name": "bad5",
"name": "bad2",
"source_mapping": {
"start": 1536,
"length": 142,
"start": 877,
"length": 160,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
49,
50,
51
34,
35,
36
],
"starting_column": 3,
"ending_column": 4
@ -1511,16 +1511,16 @@
"ending_column": 2
}
},
"signature": "bad5()"
"signature": "bad2()"
}
}
}
}
],
"description": "Function A.bad5() (tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#49-51) trigger an abi encoding bug:\n\t- event2_bad(s) (tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#50)\n",
"markdown": "Function [A.bad5()](tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L49-L51) trigger an abi encoding bug:\n\t- [event2_bad(s)](tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L50)\n",
"first_markdown_element": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L49-L51",
"id": "9c6da636be98419174c8e81e73efc09e7b942f9cf477cf0de793fb92c88fc976",
"description": "Function A.bad2() (tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#34-36) trigger an abi encoding bug:\n\t- b = abi.encode(bad_arr) (tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#35)\n",
"markdown": "Function [A.bad2()](tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L34-L36) trigger an abi encoding bug:\n\t- [b = abi.encode(bad_arr)](tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L35)\n",
"first_markdown_element": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L34-L36",
"id": "e976cd11118a9f5aaacfe5715cef990140fd67c7a35682446aedc878b63b3b24",
"check": "abiencoderv2-array",
"impact": "High",
"confidence": "High"
@ -1529,19 +1529,19 @@
"elements": [
{
"type": "function",
"name": "bad4",
"name": "bad3",
"source_mapping": {
"start": 1321,
"length": 148,
"start": 1101,
"length": 154,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
44,
45,
46
39,
40,
41
],
"starting_column": 3,
"ending_column": 4
@ -1661,42 +1661,42 @@
"ending_column": 2
}
},
"signature": "bad4()"
"signature": "bad3()"
}
},
{
"type": "node",
"name": "event1_bad(bad_arr)",
"name": "b = abi.encode(s)",
"source_mapping": {
"start": 1440,
"length": 24,
"start": 1220,
"length": 30,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
45
40
],
"starting_column": 5,
"ending_column": 29
"ending_column": 35
},
"type_specific_fields": {
"parent": {
"type": "function",
"name": "bad4",
"name": "bad3",
"source_mapping": {
"start": 1321,
"length": 148,
"start": 1101,
"length": 154,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol",
"is_dependency": false,
"lines": [
44,
45,
46
39,
40,
41
],
"starting_column": 3,
"ending_column": 4
@ -1816,16 +1816,16 @@
"ending_column": 2
}
},
"signature": "bad4()"
"signature": "bad3()"
}
}
}
}
],
"description": "Function A.bad4() (tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#44-46) trigger an abi encoding bug:\n\t- event1_bad(bad_arr) (tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#45)\n",
"markdown": "Function [A.bad4()](tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L44-L46) trigger an abi encoding bug:\n\t- [event1_bad(bad_arr)](tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L45)\n",
"first_markdown_element": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L44-L46",
"id": "6e9dfeb7f6ea7c989276fa8c5e27d71ab0f6b63ee878fb3f761dab9d07942246",
"description": "Function A.bad3() (tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#39-41) trigger an abi encoding bug:\n\t- b = abi.encode(s) (tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#40)\n",
"markdown": "Function [A.bad3()](tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L39-L41) trigger an abi encoding bug:\n\t- [b = abi.encode(s)](tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L40)\n",
"first_markdown_element": "tests/detectors/abiencoderv2-array/0.5.9/storage_ABIEncoderV2_array.sol#L39-L41",
"id": "37e980d8d34fcffe10d2533052de986dd57c1d45700f02234332b275b532c71d",
"check": "abiencoderv2-array",
"impact": "High",
"confidence": "High"

@ -4,6 +4,15 @@ contract ReentrancyBenign {
uint8 anotherVariableToChange;
uint8 counter = 0;
// Should not detect reentrancy in constructor
constructor(address addr) {
(bool success) = addr.call();
if (!success) {
revert();
}
counter += 1;
}
function bad0() public {
if (!(msg.sender.call())) {
revert();

@ -4,6 +4,15 @@ contract ReentrancyBenign {
uint8 anotherVariableToChange;
uint8 counter = 0;
// Should not detect reentrancy in constructor
constructor(address addr) public {
(bool success,) = addr.call("");
if (!success) {
revert();
}
counter += 1;
}
function bad0() public {
(bool success,) = msg.sender.call("");
if (!success) {

@ -4,6 +4,15 @@ contract ReentrancyBenign {
uint8 anotherVariableToChange;
uint8 counter = 0;
// Should not detect reentrancy in constructor
constructor(address addr) public {
(bool success,) = addr.call("");
if (!success) {
revert();
}
counter += 1;
}
function bad0() public {
(bool success,) = msg.sender.call("");
if (!success) {

@ -4,6 +4,15 @@ contract ReentrancyBenign {
uint8 anotherVariableToChange;
uint8 counter = 0;
// Should not detect reentrancy in constructor
constructor(address addr) {
(bool success,) = addr.call("");
if (!success) {
revert();
}
counter += 1;
}
function bad0() public {
(bool success,) = msg.sender.call("");
if (!success) {

@ -11,6 +11,16 @@ contract Reentrancy {
userBalance[msg.sender] += msg.value;
}
// Should not detect reentrancy in constructor
constructor() public {
// send userBalance[msg.sender] ethers to msg.sender
// if mgs.sender is a contract, it will call its fallback function
if (!(msg.sender.call.value(userBalance[msg.sender])())) {
revert();
}
userBalance[msg.sender] = 0;
}
function withdrawBalance() public{
// send userBalance[msg.sender] ethers to msg.sender
// if mgs.sender is a contract, it will call its fallback function

@ -6,7 +6,7 @@
"type": "function",
"name": "withdrawBalance",
"source_mapping": {
"start": 299,
"start": 656,
"length": 314,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol",
@ -14,14 +14,14 @@
"filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol",
"is_dependency": false,
"lines": [
14,
15,
16,
17,
18,
19,
20,
21
24,
25,
26,
27,
28,
29,
30,
31
],
"starting_column": 5,
"ending_column": 6
@ -32,7 +32,7 @@
"name": "Reentrancy",
"source_mapping": {
"start": 26,
"length": 2334,
"length": 2691,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol",
"filename_absolute": "/GENERIC_PATH",
@ -108,7 +108,17 @@
69,
70,
71,
72
72,
73,
74,
75,
76,
77,
78,
79,
80,
81,
82
],
"starting_column": 1,
"ending_column": 2
@ -121,7 +131,7 @@
"type": "node",
"name": "! (msg.sender.call.value(userBalance[msg.sender])())",
"source_mapping": {
"start": 482,
"start": 839,
"length": 53,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol",
@ -129,7 +139,7 @@
"filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol",
"is_dependency": false,
"lines": [
17
27
],
"starting_column": 13,
"ending_column": 66
@ -139,7 +149,7 @@
"type": "function",
"name": "withdrawBalance",
"source_mapping": {
"start": 299,
"start": 656,
"length": 314,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol",
@ -147,14 +157,14 @@
"filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol",
"is_dependency": false,
"lines": [
14,
15,
16,
17,
18,
19,
20,
21
24,
25,
26,
27,
28,
29,
30,
31
],
"starting_column": 5,
"ending_column": 6
@ -165,7 +175,7 @@
"name": "Reentrancy",
"source_mapping": {
"start": 26,
"length": 2334,
"length": 2691,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol",
"filename_absolute": "/GENERIC_PATH",
@ -241,7 +251,17 @@
69,
70,
71,
72
72,
73,
74,
75,
76,
77,
78,
79,
80,
81,
82
],
"starting_column": 1,
"ending_column": 2
@ -259,7 +279,7 @@
"type": "node",
"name": "userBalance[msg.sender] = 0",
"source_mapping": {
"start": 579,
"start": 936,
"length": 27,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol",
@ -267,7 +287,7 @@
"filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol",
"is_dependency": false,
"lines": [
20
30
],
"starting_column": 9,
"ending_column": 36
@ -277,7 +297,7 @@
"type": "function",
"name": "withdrawBalance",
"source_mapping": {
"start": 299,
"start": 656,
"length": 314,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol",
@ -285,14 +305,14 @@
"filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol",
"is_dependency": false,
"lines": [
14,
15,
16,
17,
18,
19,
20,
21
24,
25,
26,
27,
28,
29,
30,
31
],
"starting_column": 5,
"ending_column": 6
@ -303,7 +323,7 @@
"name": "Reentrancy",
"source_mapping": {
"start": 26,
"length": 2334,
"length": 2691,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol",
"filename_absolute": "/GENERIC_PATH",
@ -379,7 +399,17 @@
69,
70,
71,
72
72,
73,
74,
75,
76,
77,
78,
79,
80,
81,
82
],
"starting_column": 1,
"ending_column": 2
@ -395,10 +425,10 @@
}
}
],
"description": "Reentrancy in Reentrancy.withdrawBalance() (tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#14-21):\n\tExternal calls:\n\t- ! (msg.sender.call.value(userBalance[msg.sender])()) (tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#17)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = 0 (tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#20)\n",
"markdown": "Reentrancy in [Reentrancy.withdrawBalance()](tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#L14-L21):\n\tExternal calls:\n\t- [! (msg.sender.call.value(userBalance[msg.sender])())](tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#L17)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = 0](tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#L20)\n",
"first_markdown_element": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#L14-L21",
"id": "957f3b0e921130284eee0bc87196da62a404d42f5be7eb797f1c3ffb0d4de355",
"description": "Reentrancy in Reentrancy.withdrawBalance() (tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#24-31):\n\tExternal calls:\n\t- ! (msg.sender.call.value(userBalance[msg.sender])()) (tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#27)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = 0 (tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#30)\n",
"markdown": "Reentrancy in [Reentrancy.withdrawBalance()](tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#L24-L31):\n\tExternal calls:\n\t- [! (msg.sender.call.value(userBalance[msg.sender])())](tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#L27)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = 0](tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#L30)\n",
"first_markdown_element": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#L24-L31",
"id": "759a5ea5deb597f6ca748c9b27656dee01b1e4b634365a68b918bf10518662e8",
"check": "reentrancy-eth",
"impact": "High",
"confidence": "Medium"
@ -409,7 +439,7 @@
"type": "function",
"name": "withdrawBalance_nested",
"source_mapping": {
"start": 2108,
"start": 2465,
"length": 246,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol",
@ -417,13 +447,13 @@
"filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol",
"is_dependency": false,
"lines": [
64,
65,
66,
67,
68,
69,
70
74,
75,
76,
77,
78,
79,
80
],
"starting_column": 5,
"ending_column": 6
@ -434,7 +464,7 @@
"name": "Reentrancy",
"source_mapping": {
"start": 26,
"length": 2334,
"length": 2691,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol",
"filename_absolute": "/GENERIC_PATH",
@ -510,7 +540,17 @@
69,
70,
71,
72
72,
73,
74,
75,
76,
77,
78,
79,
80,
81,
82
],
"starting_column": 1,
"ending_column": 2
@ -523,7 +563,7 @@
"type": "node",
"name": "msg.sender.call.value(amount / 2)()",
"source_mapping": {
"start": 2263,
"start": 2620,
"length": 33,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol",
@ -531,7 +571,7 @@
"filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol",
"is_dependency": false,
"lines": [
67
77
],
"starting_column": 13,
"ending_column": 46
@ -541,7 +581,7 @@
"type": "function",
"name": "withdrawBalance_nested",
"source_mapping": {
"start": 2108,
"start": 2465,
"length": 246,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol",
@ -549,13 +589,13 @@
"filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol",
"is_dependency": false,
"lines": [
64,
65,
66,
67,
68,
69,
70
74,
75,
76,
77,
78,
79,
80
],
"starting_column": 5,
"ending_column": 6
@ -566,7 +606,7 @@
"name": "Reentrancy",
"source_mapping": {
"start": 26,
"length": 2334,
"length": 2691,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol",
"filename_absolute": "/GENERIC_PATH",
@ -642,7 +682,17 @@
69,
70,
71,
72
72,
73,
74,
75,
76,
77,
78,
79,
80,
81,
82
],
"starting_column": 1,
"ending_column": 2
@ -660,7 +710,7 @@
"type": "node",
"name": "userBalance[msg.sender] = 0",
"source_mapping": {
"start": 2310,
"start": 2667,
"length": 27,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol",
@ -668,7 +718,7 @@
"filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol",
"is_dependency": false,
"lines": [
68
78
],
"starting_column": 13,
"ending_column": 40
@ -678,7 +728,7 @@
"type": "function",
"name": "withdrawBalance_nested",
"source_mapping": {
"start": 2108,
"start": 2465,
"length": 246,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol",
@ -686,13 +736,13 @@
"filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol",
"is_dependency": false,
"lines": [
64,
65,
66,
67,
68,
69,
70
74,
75,
76,
77,
78,
79,
80
],
"starting_column": 5,
"ending_column": 6
@ -703,7 +753,7 @@
"name": "Reentrancy",
"source_mapping": {
"start": 26,
"length": 2334,
"length": 2691,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol",
"filename_absolute": "/GENERIC_PATH",
@ -779,7 +829,17 @@
69,
70,
71,
72
72,
73,
74,
75,
76,
77,
78,
79,
80,
81,
82
],
"starting_column": 1,
"ending_column": 2
@ -795,10 +855,10 @@
}
}
],
"description": "Reentrancy in Reentrancy.withdrawBalance_nested() (tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#64-70):\n\tExternal calls:\n\t- msg.sender.call.value(amount / 2)() (tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#67)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = 0 (tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#68)\n",
"markdown": "Reentrancy in [Reentrancy.withdrawBalance_nested()](tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#L64-L70):\n\tExternal calls:\n\t- [msg.sender.call.value(amount / 2)()](tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#L67)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = 0](tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#L68)\n",
"first_markdown_element": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#L64-L70",
"id": "bc5fd7842eb653b31fae72521123190b37b3dfe9d70a201bfcd70c8a7b5f43ba",
"description": "Reentrancy in Reentrancy.withdrawBalance_nested() (tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#74-80):\n\tExternal calls:\n\t- msg.sender.call.value(amount / 2)() (tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#77)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = 0 (tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#78)\n",
"markdown": "Reentrancy in [Reentrancy.withdrawBalance_nested()](tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#L74-L80):\n\tExternal calls:\n\t- [msg.sender.call.value(amount / 2)()](tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#L77)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = 0](tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#L78)\n",
"first_markdown_element": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#L74-L80",
"id": "cc27a0e36ba51b1a24ae1df9b9f2ec9e67afedd649839a3302b6f9e08987c7d8",
"check": "reentrancy-eth",
"impact": "High",
"confidence": "Medium"

@ -11,6 +11,17 @@ contract Reentrancy {
userBalance[msg.sender] += msg.value;
}
// Should not detect reentrancy in constructor
constructor() public {
// send userBalance[msg.sender] ethers to msg.sender
// if mgs.sender is a contract, it will call its fallback function
(bool ret, bytes memory mem) = msg.sender.call.value(userBalance[msg.sender])("");
if( ! ret ){
revert();
}
userBalance[msg.sender] = 0;
}
function withdrawBalance() public{
// send userBalance[msg.sender] ethers to msg.sender
// if mgs.sender is a contract, it will call its fallback function

@ -6,7 +6,7 @@
"type": "function",
"name": "withdrawBalance",
"source_mapping": {
"start": 301,
"start": 703,
"length": 357,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol",
@ -14,15 +14,15 @@
"filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol",
"is_dependency": false,
"lines": [
14,
15,
16,
17,
18,
19,
20,
21,
22
25,
26,
27,
28,
29,
30,
31,
32,
33
],
"starting_column": 5,
"ending_column": 6
@ -33,7 +33,7 @@
"name": "Reentrancy",
"source_mapping": {
"start": 28,
"length": 1807,
"length": 2209,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol",
"filename_absolute": "/GENERIC_PATH",
@ -91,7 +91,18 @@
51,
52,
53,
54
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65
],
"starting_column": 1,
"ending_column": 2
@ -104,7 +115,7 @@
"type": "node",
"name": "(ret,mem) = msg.sender.call.value(userBalance[msg.sender])()",
"source_mapping": {
"start": 480,
"start": 882,
"length": 81,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol",
@ -112,7 +123,7 @@
"filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol",
"is_dependency": false,
"lines": [
17
28
],
"starting_column": 9,
"ending_column": 90
@ -122,7 +133,7 @@
"type": "function",
"name": "withdrawBalance",
"source_mapping": {
"start": 301,
"start": 703,
"length": 357,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol",
@ -130,15 +141,15 @@
"filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol",
"is_dependency": false,
"lines": [
14,
15,
16,
17,
18,
19,
20,
21,
22
25,
26,
27,
28,
29,
30,
31,
32,
33
],
"starting_column": 5,
"ending_column": 6
@ -149,7 +160,7 @@
"name": "Reentrancy",
"source_mapping": {
"start": 28,
"length": 1807,
"length": 2209,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol",
"filename_absolute": "/GENERIC_PATH",
@ -207,7 +218,18 @@
51,
52,
53,
54
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65
],
"starting_column": 1,
"ending_column": 2
@ -225,7 +247,7 @@
"type": "node",
"name": "userBalance[msg.sender] = 0",
"source_mapping": {
"start": 624,
"start": 1026,
"length": 27,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol",
@ -233,7 +255,7 @@
"filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol",
"is_dependency": false,
"lines": [
21
32
],
"starting_column": 9,
"ending_column": 36
@ -243,7 +265,7 @@
"type": "function",
"name": "withdrawBalance",
"source_mapping": {
"start": 301,
"start": 703,
"length": 357,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol",
@ -251,15 +273,15 @@
"filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol",
"is_dependency": false,
"lines": [
14,
15,
16,
17,
18,
19,
20,
21,
22
25,
26,
27,
28,
29,
30,
31,
32,
33
],
"starting_column": 5,
"ending_column": 6
@ -270,7 +292,7 @@
"name": "Reentrancy",
"source_mapping": {
"start": 28,
"length": 1807,
"length": 2209,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol",
"filename_absolute": "/GENERIC_PATH",
@ -328,7 +350,18 @@
51,
52,
53,
54
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65
],
"starting_column": 1,
"ending_column": 2
@ -344,10 +377,10 @@
}
}
],
"description": "Reentrancy in Reentrancy.withdrawBalance() (tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#14-22):\n\tExternal calls:\n\t- (ret,mem) = msg.sender.call.value(userBalance[msg.sender])() (tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#17)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = 0 (tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#21)\n",
"markdown": "Reentrancy in [Reentrancy.withdrawBalance()](tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#L14-L22):\n\tExternal calls:\n\t- [(ret,mem) = msg.sender.call.value(userBalance[msg.sender])()](tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#L17)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = 0](tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#L21)\n",
"first_markdown_element": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#L14-L22",
"id": "63e2edc090dbced31786ef360979f0516f51ed13f9cdc1df4722a486e6aee0b1",
"description": "Reentrancy in Reentrancy.withdrawBalance() (tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#25-33):\n\tExternal calls:\n\t- (ret,mem) = msg.sender.call.value(userBalance[msg.sender])() (tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#28)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = 0 (tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#32)\n",
"markdown": "Reentrancy in [Reentrancy.withdrawBalance()](tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#L25-L33):\n\tExternal calls:\n\t- [(ret,mem) = msg.sender.call.value(userBalance[msg.sender])()](tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#L28)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = 0](tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#L32)\n",
"first_markdown_element": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#L25-L33",
"id": "e2dcb62d8ffcc2636bab0fee518b4a79c760f2974c39950214749fc78bebc9de",
"check": "reentrancy-eth",
"impact": "High",
"confidence": "Medium"
@ -358,7 +391,7 @@
"type": "function",
"name": "withdrawBalance_fixed_3",
"source_mapping": {
"start": 1437,
"start": 1839,
"length": 393,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol",
@ -366,16 +399,16 @@
"filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol",
"is_dependency": false,
"lines": [
44,
45,
46,
47,
48,
49,
50,
51,
52,
53
55,
56,
57,
58,
59,
60,
61,
62,
63,
64
],
"starting_column": 5,
"ending_column": 6
@ -386,7 +419,7 @@
"name": "Reentrancy",
"source_mapping": {
"start": 28,
"length": 1807,
"length": 2209,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol",
"filename_absolute": "/GENERIC_PATH",
@ -444,7 +477,18 @@
51,
52,
53,
54
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65
],
"starting_column": 1,
"ending_column": 2
@ -457,7 +501,7 @@
"type": "node",
"name": "(ret,mem) = msg.sender.call.value(amount)()",
"source_mapping": {
"start": 1682,
"start": 2084,
"length": 64,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol",
@ -465,7 +509,7 @@
"filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol",
"is_dependency": false,
"lines": [
49
60
],
"starting_column": 9,
"ending_column": 73
@ -475,7 +519,7 @@
"type": "function",
"name": "withdrawBalance_fixed_3",
"source_mapping": {
"start": 1437,
"start": 1839,
"length": 393,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol",
@ -483,16 +527,16 @@
"filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol",
"is_dependency": false,
"lines": [
44,
45,
46,
47,
48,
49,
50,
51,
52,
53
55,
56,
57,
58,
59,
60,
61,
62,
63,
64
],
"starting_column": 5,
"ending_column": 6
@ -503,7 +547,7 @@
"name": "Reentrancy",
"source_mapping": {
"start": 28,
"length": 1807,
"length": 2209,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol",
"filename_absolute": "/GENERIC_PATH",
@ -561,7 +605,18 @@
51,
52,
53,
54
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65
],
"starting_column": 1,
"ending_column": 2
@ -579,7 +634,7 @@
"type": "node",
"name": "userBalance[msg.sender] = amount",
"source_mapping": {
"start": 1781,
"start": 2183,
"length": 32,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol",
@ -587,7 +642,7 @@
"filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol",
"is_dependency": false,
"lines": [
51
62
],
"starting_column": 13,
"ending_column": 45
@ -597,7 +652,7 @@
"type": "function",
"name": "withdrawBalance_fixed_3",
"source_mapping": {
"start": 1437,
"start": 1839,
"length": 393,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol",
@ -605,16 +660,16 @@
"filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol",
"is_dependency": false,
"lines": [
44,
45,
46,
47,
48,
49,
50,
51,
52,
53
55,
56,
57,
58,
59,
60,
61,
62,
63,
64
],
"starting_column": 5,
"ending_column": 6
@ -625,7 +680,7 @@
"name": "Reentrancy",
"source_mapping": {
"start": 28,
"length": 1807,
"length": 2209,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol",
"filename_absolute": "/GENERIC_PATH",
@ -683,7 +738,18 @@
51,
52,
53,
54
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65
],
"starting_column": 1,
"ending_column": 2
@ -699,10 +765,10 @@
}
}
],
"description": "Reentrancy in Reentrancy.withdrawBalance_fixed_3() (tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#44-53):\n\tExternal calls:\n\t- (ret,mem) = msg.sender.call.value(amount)() (tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#49)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = amount (tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#51)\n",
"markdown": "Reentrancy in [Reentrancy.withdrawBalance_fixed_3()](tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#L44-L53):\n\tExternal calls:\n\t- [(ret,mem) = msg.sender.call.value(amount)()](tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#L49)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = amount](tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#L51)\n",
"first_markdown_element": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#L44-L53",
"id": "edbf6fc902d003daf83854bd9eb110406d5bd8c3b8facfcf0601b3e5f739b37d",
"description": "Reentrancy in Reentrancy.withdrawBalance_fixed_3() (tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#55-64):\n\tExternal calls:\n\t- (ret,mem) = msg.sender.call.value(amount)() (tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#60)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = amount (tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#62)\n",
"markdown": "Reentrancy in [Reentrancy.withdrawBalance_fixed_3()](tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#L55-L64):\n\tExternal calls:\n\t- [(ret,mem) = msg.sender.call.value(amount)()](tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#L60)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = amount](tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#L62)\n",
"first_markdown_element": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#L55-L64",
"id": "b1d5762a3d9738215079d50da4bf0ecdc8eddd575b7f8686bdbfa3d101adf809",
"check": "reentrancy-eth",
"impact": "High",
"confidence": "Medium"

@ -11,6 +11,17 @@ contract Reentrancy {
userBalance[msg.sender] += msg.value;
}
// Should not detect reentrancy in constructor
constructor() public {
// send userBalance[msg.sender] ethers to msg.sender
// if mgs.sender is a contract, it will call its fallback function
(bool ret, bytes memory mem) = msg.sender.call{value:userBalance[msg.sender]}("");
if( ! ret ){
revert();
}
userBalance[msg.sender] = 0;
}
function withdrawBalance() public{
// send userBalance[msg.sender] ethers to msg.sender
// if mgs.sender is a contract, it will call its fallback function

@ -6,7 +6,7 @@
"type": "function",
"name": "withdrawBalance",
"source_mapping": {
"start": 301,
"start": 707,
"length": 357,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol",
@ -14,15 +14,15 @@
"filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol",
"is_dependency": false,
"lines": [
14,
15,
16,
17,
18,
19,
20,
21,
22
25,
26,
27,
28,
29,
30,
31,
32,
33
],
"starting_column": 5,
"ending_column": 6
@ -33,7 +33,7 @@
"name": "Reentrancy",
"source_mapping": {
"start": 28,
"length": 1807,
"length": 2213,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol",
"filename_absolute": "/GENERIC_PATH",
@ -91,7 +91,18 @@
51,
52,
53,
54
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65
],
"starting_column": 1,
"ending_column": 2
@ -104,7 +115,7 @@
"type": "node",
"name": "(ret,mem) = msg.sender.call.value(userBalance[msg.sender])()",
"source_mapping": {
"start": 480,
"start": 886,
"length": 81,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol",
@ -112,7 +123,7 @@
"filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol",
"is_dependency": false,
"lines": [
17
28
],
"starting_column": 9,
"ending_column": 90
@ -122,7 +133,7 @@
"type": "function",
"name": "withdrawBalance",
"source_mapping": {
"start": 301,
"start": 707,
"length": 357,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol",
@ -130,15 +141,15 @@
"filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol",
"is_dependency": false,
"lines": [
14,
15,
16,
17,
18,
19,
20,
21,
22
25,
26,
27,
28,
29,
30,
31,
32,
33
],
"starting_column": 5,
"ending_column": 6
@ -149,7 +160,7 @@
"name": "Reentrancy",
"source_mapping": {
"start": 28,
"length": 1807,
"length": 2213,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol",
"filename_absolute": "/GENERIC_PATH",
@ -207,7 +218,18 @@
51,
52,
53,
54
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65
],
"starting_column": 1,
"ending_column": 2
@ -225,7 +247,7 @@
"type": "node",
"name": "userBalance[msg.sender] = 0",
"source_mapping": {
"start": 624,
"start": 1030,
"length": 27,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol",
@ -233,7 +255,7 @@
"filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol",
"is_dependency": false,
"lines": [
21
32
],
"starting_column": 9,
"ending_column": 36
@ -243,7 +265,7 @@
"type": "function",
"name": "withdrawBalance",
"source_mapping": {
"start": 301,
"start": 707,
"length": 357,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol",
@ -251,15 +273,15 @@
"filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol",
"is_dependency": false,
"lines": [
14,
15,
16,
17,
18,
19,
20,
21,
22
25,
26,
27,
28,
29,
30,
31,
32,
33
],
"starting_column": 5,
"ending_column": 6
@ -270,7 +292,7 @@
"name": "Reentrancy",
"source_mapping": {
"start": 28,
"length": 1807,
"length": 2213,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol",
"filename_absolute": "/GENERIC_PATH",
@ -328,7 +350,18 @@
51,
52,
53,
54
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65
],
"starting_column": 1,
"ending_column": 2
@ -344,10 +377,10 @@
}
}
],
"description": "Reentrancy in Reentrancy.withdrawBalance() (tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#14-22):\n\tExternal calls:\n\t- (ret,mem) = msg.sender.call.value(userBalance[msg.sender])() (tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#17)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = 0 (tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#21)\n",
"markdown": "Reentrancy in [Reentrancy.withdrawBalance()](tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#L14-L22):\n\tExternal calls:\n\t- [(ret,mem) = msg.sender.call.value(userBalance[msg.sender])()](tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#L17)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = 0](tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#L21)\n",
"first_markdown_element": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#L14-L22",
"id": "703bb72dceaefd2a51f7f2f7c83443d37cebcc0b8ce4b5f6bd54e803d4c58d0d",
"description": "Reentrancy in Reentrancy.withdrawBalance() (tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#25-33):\n\tExternal calls:\n\t- (ret,mem) = msg.sender.call.value(userBalance[msg.sender])() (tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#28)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = 0 (tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#32)\n",
"markdown": "Reentrancy in [Reentrancy.withdrawBalance()](tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#L25-L33):\n\tExternal calls:\n\t- [(ret,mem) = msg.sender.call.value(userBalance[msg.sender])()](tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#L28)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = 0](tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#L32)\n",
"first_markdown_element": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#L25-L33",
"id": "2ae23f335df95d0f5c56d214774a6afc507773d057c4ca44f2eb4eff0e2ebe98",
"check": "reentrancy-eth",
"impact": "High",
"confidence": "Medium"
@ -358,7 +391,7 @@
"type": "function",
"name": "withdrawBalance_fixed_3",
"source_mapping": {
"start": 1437,
"start": 1843,
"length": 393,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol",
@ -366,16 +399,16 @@
"filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol",
"is_dependency": false,
"lines": [
44,
45,
46,
47,
48,
49,
50,
51,
52,
53
55,
56,
57,
58,
59,
60,
61,
62,
63,
64
],
"starting_column": 5,
"ending_column": 6
@ -386,7 +419,7 @@
"name": "Reentrancy",
"source_mapping": {
"start": 28,
"length": 1807,
"length": 2213,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol",
"filename_absolute": "/GENERIC_PATH",
@ -444,7 +477,18 @@
51,
52,
53,
54
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65
],
"starting_column": 1,
"ending_column": 2
@ -457,7 +501,7 @@
"type": "node",
"name": "(ret,mem) = msg.sender.call.value(amount)()",
"source_mapping": {
"start": 1682,
"start": 2088,
"length": 64,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol",
@ -465,7 +509,7 @@
"filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol",
"is_dependency": false,
"lines": [
49
60
],
"starting_column": 9,
"ending_column": 73
@ -475,7 +519,7 @@
"type": "function",
"name": "withdrawBalance_fixed_3",
"source_mapping": {
"start": 1437,
"start": 1843,
"length": 393,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol",
@ -483,16 +527,16 @@
"filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol",
"is_dependency": false,
"lines": [
44,
45,
46,
47,
48,
49,
50,
51,
52,
53
55,
56,
57,
58,
59,
60,
61,
62,
63,
64
],
"starting_column": 5,
"ending_column": 6
@ -503,7 +547,7 @@
"name": "Reentrancy",
"source_mapping": {
"start": 28,
"length": 1807,
"length": 2213,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol",
"filename_absolute": "/GENERIC_PATH",
@ -561,7 +605,18 @@
51,
52,
53,
54
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65
],
"starting_column": 1,
"ending_column": 2
@ -579,7 +634,7 @@
"type": "node",
"name": "userBalance[msg.sender] = amount",
"source_mapping": {
"start": 1781,
"start": 2187,
"length": 32,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol",
@ -587,7 +642,7 @@
"filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol",
"is_dependency": false,
"lines": [
51
62
],
"starting_column": 13,
"ending_column": 45
@ -597,7 +652,7 @@
"type": "function",
"name": "withdrawBalance_fixed_3",
"source_mapping": {
"start": 1437,
"start": 1843,
"length": 393,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol",
@ -605,16 +660,16 @@
"filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol",
"is_dependency": false,
"lines": [
44,
45,
46,
47,
48,
49,
50,
51,
52,
53
55,
56,
57,
58,
59,
60,
61,
62,
63,
64
],
"starting_column": 5,
"ending_column": 6
@ -625,7 +680,7 @@
"name": "Reentrancy",
"source_mapping": {
"start": 28,
"length": 1807,
"length": 2213,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol",
"filename_absolute": "/GENERIC_PATH",
@ -683,7 +738,18 @@
51,
52,
53,
54
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65
],
"starting_column": 1,
"ending_column": 2
@ -699,10 +765,10 @@
}
}
],
"description": "Reentrancy in Reentrancy.withdrawBalance_fixed_3() (tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#44-53):\n\tExternal calls:\n\t- (ret,mem) = msg.sender.call.value(amount)() (tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#49)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = amount (tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#51)\n",
"markdown": "Reentrancy in [Reentrancy.withdrawBalance_fixed_3()](tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#L44-L53):\n\tExternal calls:\n\t- [(ret,mem) = msg.sender.call.value(amount)()](tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#L49)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = amount](tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#L51)\n",
"first_markdown_element": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#L44-L53",
"id": "9d69f38d42306f0c57969c0e57d606c4bbd636e4deae55b630b247299f7afa49",
"description": "Reentrancy in Reentrancy.withdrawBalance_fixed_3() (tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#55-64):\n\tExternal calls:\n\t- (ret,mem) = msg.sender.call.value(amount)() (tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#60)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = amount (tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#62)\n",
"markdown": "Reentrancy in [Reentrancy.withdrawBalance_fixed_3()](tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#L55-L64):\n\tExternal calls:\n\t- [(ret,mem) = msg.sender.call.value(amount)()](tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#L60)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = amount](tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#L62)\n",
"first_markdown_element": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#L55-L64",
"id": "c4d2dd489fd8bc396119bdd7e5a73c3782cf5fa27171112104e34b2f3ccf37c4",
"check": "reentrancy-eth",
"impact": "High",
"confidence": "Medium"

@ -11,6 +11,17 @@ contract Reentrancy {
userBalance[msg.sender] += msg.value;
}
// Should not detect reentrancy in constructor
constructor() public {
// send userBalance[msg.sender] ethers to msg.sender
// if mgs.sender is a contract, it will call its fallback function
(bool ret, bytes memory mem) = msg.sender.call{value:userBalance[msg.sender]}("");
if( ! ret ){
revert();
}
userBalance[msg.sender] = 0;
}
function withdrawBalance() public{
// send userBalance[msg.sender] ethers to msg.sender
// if mgs.sender is a contract, it will call its fallback function

@ -6,7 +6,7 @@
"type": "function",
"name": "withdrawBalance",
"source_mapping": {
"start": 301,
"start": 703,
"length": 357,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol",
@ -14,15 +14,15 @@
"filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol",
"is_dependency": false,
"lines": [
14,
15,
16,
17,
18,
19,
20,
21,
22
25,
26,
27,
28,
29,
30,
31,
32,
33
],
"starting_column": 5,
"ending_column": 6
@ -33,7 +33,7 @@
"name": "Reentrancy",
"source_mapping": {
"start": 28,
"length": 1807,
"length": 2209,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol",
"filename_absolute": "/GENERIC_PATH",
@ -91,7 +91,18 @@
51,
52,
53,
54
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65
],
"starting_column": 1,
"ending_column": 2
@ -104,7 +115,7 @@
"type": "node",
"name": "(ret,mem) = msg.sender.call{value: userBalance[msg.sender]}()",
"source_mapping": {
"start": 480,
"start": 882,
"length": 81,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol",
@ -112,7 +123,7 @@
"filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol",
"is_dependency": false,
"lines": [
17
28
],
"starting_column": 9,
"ending_column": 90
@ -122,7 +133,7 @@
"type": "function",
"name": "withdrawBalance",
"source_mapping": {
"start": 301,
"start": 703,
"length": 357,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol",
@ -130,15 +141,15 @@
"filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol",
"is_dependency": false,
"lines": [
14,
15,
16,
17,
18,
19,
20,
21,
22
25,
26,
27,
28,
29,
30,
31,
32,
33
],
"starting_column": 5,
"ending_column": 6
@ -149,7 +160,7 @@
"name": "Reentrancy",
"source_mapping": {
"start": 28,
"length": 1807,
"length": 2209,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol",
"filename_absolute": "/GENERIC_PATH",
@ -207,7 +218,18 @@
51,
52,
53,
54
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65
],
"starting_column": 1,
"ending_column": 2
@ -225,7 +247,7 @@
"type": "node",
"name": "userBalance[msg.sender] = 0",
"source_mapping": {
"start": 624,
"start": 1026,
"length": 27,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol",
@ -233,7 +255,7 @@
"filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol",
"is_dependency": false,
"lines": [
21
32
],
"starting_column": 9,
"ending_column": 36
@ -243,7 +265,7 @@
"type": "function",
"name": "withdrawBalance",
"source_mapping": {
"start": 301,
"start": 703,
"length": 357,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol",
@ -251,15 +273,15 @@
"filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol",
"is_dependency": false,
"lines": [
14,
15,
16,
17,
18,
19,
20,
21,
22
25,
26,
27,
28,
29,
30,
31,
32,
33
],
"starting_column": 5,
"ending_column": 6
@ -270,7 +292,7 @@
"name": "Reentrancy",
"source_mapping": {
"start": 28,
"length": 1807,
"length": 2209,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol",
"filename_absolute": "/GENERIC_PATH",
@ -328,7 +350,18 @@
51,
52,
53,
54
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65
],
"starting_column": 1,
"ending_column": 2
@ -344,10 +377,10 @@
}
}
],
"description": "Reentrancy in Reentrancy.withdrawBalance() (tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#14-22):\n\tExternal calls:\n\t- (ret,mem) = msg.sender.call{value: userBalance[msg.sender]}() (tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#17)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = 0 (tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#21)\n",
"markdown": "Reentrancy in [Reentrancy.withdrawBalance()](tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#L14-L22):\n\tExternal calls:\n\t- [(ret,mem) = msg.sender.call{value: userBalance[msg.sender]}()](tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#L17)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = 0](tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#L21)\n",
"first_markdown_element": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#L14-L22",
"id": "4080e36d35513345b756c6f8d09f2b1238c4553d4b38793d44fe99895e546709",
"description": "Reentrancy in Reentrancy.withdrawBalance() (tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#25-33):\n\tExternal calls:\n\t- (ret,mem) = msg.sender.call{value: userBalance[msg.sender]}() (tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#28)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = 0 (tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#32)\n",
"markdown": "Reentrancy in [Reentrancy.withdrawBalance()](tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#L25-L33):\n\tExternal calls:\n\t- [(ret,mem) = msg.sender.call{value: userBalance[msg.sender]}()](tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#L28)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = 0](tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#L32)\n",
"first_markdown_element": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#L25-L33",
"id": "df77aefe86b51d596b1dba22bde98d85390038724420e61fb18579fd90af852c",
"check": "reentrancy-eth",
"impact": "High",
"confidence": "Medium"
@ -358,7 +391,7 @@
"type": "function",
"name": "withdrawBalance_fixed_3",
"source_mapping": {
"start": 1437,
"start": 1839,
"length": 393,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol",
@ -366,16 +399,16 @@
"filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol",
"is_dependency": false,
"lines": [
44,
45,
46,
47,
48,
49,
50,
51,
52,
53
55,
56,
57,
58,
59,
60,
61,
62,
63,
64
],
"starting_column": 5,
"ending_column": 6
@ -386,7 +419,7 @@
"name": "Reentrancy",
"source_mapping": {
"start": 28,
"length": 1807,
"length": 2209,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol",
"filename_absolute": "/GENERIC_PATH",
@ -444,7 +477,18 @@
51,
52,
53,
54
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65
],
"starting_column": 1,
"ending_column": 2
@ -457,7 +501,7 @@
"type": "node",
"name": "(ret,mem) = msg.sender.call{value: amount}()",
"source_mapping": {
"start": 1682,
"start": 2084,
"length": 64,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol",
@ -465,7 +509,7 @@
"filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol",
"is_dependency": false,
"lines": [
49
60
],
"starting_column": 9,
"ending_column": 73
@ -475,7 +519,7 @@
"type": "function",
"name": "withdrawBalance_fixed_3",
"source_mapping": {
"start": 1437,
"start": 1839,
"length": 393,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol",
@ -483,16 +527,16 @@
"filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol",
"is_dependency": false,
"lines": [
44,
45,
46,
47,
48,
49,
50,
51,
52,
53
55,
56,
57,
58,
59,
60,
61,
62,
63,
64
],
"starting_column": 5,
"ending_column": 6
@ -503,7 +547,7 @@
"name": "Reentrancy",
"source_mapping": {
"start": 28,
"length": 1807,
"length": 2209,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol",
"filename_absolute": "/GENERIC_PATH",
@ -561,7 +605,18 @@
51,
52,
53,
54
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65
],
"starting_column": 1,
"ending_column": 2
@ -579,7 +634,7 @@
"type": "node",
"name": "userBalance[msg.sender] = amount",
"source_mapping": {
"start": 1781,
"start": 2183,
"length": 32,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol",
@ -587,7 +642,7 @@
"filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol",
"is_dependency": false,
"lines": [
51
62
],
"starting_column": 13,
"ending_column": 45
@ -597,7 +652,7 @@
"type": "function",
"name": "withdrawBalance_fixed_3",
"source_mapping": {
"start": 1437,
"start": 1839,
"length": 393,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol",
@ -605,16 +660,16 @@
"filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol",
"is_dependency": false,
"lines": [
44,
45,
46,
47,
48,
49,
50,
51,
52,
53
55,
56,
57,
58,
59,
60,
61,
62,
63,
64
],
"starting_column": 5,
"ending_column": 6
@ -625,7 +680,7 @@
"name": "Reentrancy",
"source_mapping": {
"start": 28,
"length": 1807,
"length": 2209,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol",
"filename_absolute": "/GENERIC_PATH",
@ -683,7 +738,18 @@
51,
52,
53,
54
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65
],
"starting_column": 1,
"ending_column": 2
@ -699,10 +765,10 @@
}
}
],
"description": "Reentrancy in Reentrancy.withdrawBalance_fixed_3() (tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#44-53):\n\tExternal calls:\n\t- (ret,mem) = msg.sender.call{value: amount}() (tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#49)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = amount (tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#51)\n",
"markdown": "Reentrancy in [Reentrancy.withdrawBalance_fixed_3()](tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#L44-L53):\n\tExternal calls:\n\t- [(ret,mem) = msg.sender.call{value: amount}()](tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#L49)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = amount](tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#L51)\n",
"first_markdown_element": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#L44-L53",
"id": "748ed9bcfb9b4a29525eb6514dfff59da6436c7d70a9706d335f71a15ab31620",
"description": "Reentrancy in Reentrancy.withdrawBalance_fixed_3() (tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#55-64):\n\tExternal calls:\n\t- (ret,mem) = msg.sender.call{value: amount}() (tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#60)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = amount (tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#62)\n",
"markdown": "Reentrancy in [Reentrancy.withdrawBalance_fixed_3()](tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#L55-L64):\n\tExternal calls:\n\t- [(ret,mem) = msg.sender.call{value: amount}()](tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#L60)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = amount](tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#L62)\n",
"first_markdown_element": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#L55-L64",
"id": "d68cc7cd493eca1fda517423f6f6ad0a5671d0bbea1d80ec0cb403ca66d5d4b8",
"check": "reentrancy-eth",
"impact": "High",
"confidence": "Medium"

@ -3,6 +3,16 @@
contract ReentrancyWrite {
bool notCalled = true;
// Should not detect reentrancy in constructor
constructor(address addr) {
require(notCalled);
(bool success) = addr.call();
if (!success) {
revert();
}
notCalled = false;
}
function bad0() public {
require(notCalled);
if (!(msg.sender.call())) {

@ -6,7 +6,7 @@
"type": "function",
"name": "bad0",
"source_mapping": {
"start": 87,
"start": 326,
"length": 153,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
@ -14,13 +14,13 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
"is_dependency": false,
"lines": [
6,
7,
8,
9,
10,
11,
12
16,
17,
18,
19,
20,
21,
22
],
"starting_column": 5,
"ending_column": 6
@ -31,7 +31,7 @@
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 537,
"length": 776,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
@ -64,7 +64,17 @@
26,
27,
28,
29
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39
],
"starting_column": 1,
"ending_column": 2
@ -77,7 +87,7 @@
"type": "node",
"name": "! (msg.sender.call())",
"source_mapping": {
"start": 152,
"start": 391,
"length": 20,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
@ -85,7 +95,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
"is_dependency": false,
"lines": [
8
18
],
"starting_column": 13,
"ending_column": 33
@ -95,7 +105,7 @@
"type": "function",
"name": "bad0",
"source_mapping": {
"start": 87,
"start": 326,
"length": 153,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
@ -103,13 +113,13 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
"is_dependency": false,
"lines": [
6,
7,
8,
9,
10,
11,
12
16,
17,
18,
19,
20,
21,
22
],
"starting_column": 5,
"ending_column": 6
@ -120,7 +130,7 @@
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 537,
"length": 776,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
@ -153,7 +163,17 @@
26,
27,
28,
29
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39
],
"starting_column": 1,
"ending_column": 2
@ -171,7 +191,7 @@
"type": "node",
"name": "notCalled = false",
"source_mapping": {
"start": 216,
"start": 455,
"length": 17,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
@ -179,7 +199,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
"is_dependency": false,
"lines": [
11
21
],
"starting_column": 9,
"ending_column": 26
@ -189,7 +209,7 @@
"type": "function",
"name": "bad0",
"source_mapping": {
"start": 87,
"start": 326,
"length": 153,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
@ -197,13 +217,13 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
"is_dependency": false,
"lines": [
6,
7,
8,
9,
10,
11,
12
16,
17,
18,
19,
20,
21,
22
],
"starting_column": 5,
"ending_column": 6
@ -214,7 +234,7 @@
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 537,
"length": 776,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
@ -247,7 +267,17 @@
26,
27,
28,
29
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39
],
"starting_column": 1,
"ending_column": 2
@ -263,10 +293,10 @@
}
}
],
"description": "Reentrancy in ReentrancyWrite.bad0() (tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#6-12):\n\tExternal calls:\n\t- ! (msg.sender.call()) (tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- notCalled = false (tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#11)\n",
"markdown": "Reentrancy in [ReentrancyWrite.bad0()](tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L6-L12):\n\tExternal calls:\n\t- [! (msg.sender.call())](tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [notCalled = false](tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L11)\n",
"first_markdown_element": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L6-L12",
"id": "f933b0dd64ecd6dfb70018248bff9e11c03a35657032529ff992308456d475dd",
"description": "Reentrancy in ReentrancyWrite.bad0() (tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#16-22):\n\tExternal calls:\n\t- ! (msg.sender.call()) (tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#18)\n\tState variables written after the call(s):\n\t- notCalled = false (tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#21)\n",
"markdown": "Reentrancy in [ReentrancyWrite.bad0()](tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L16-L22):\n\tExternal calls:\n\t- [! (msg.sender.call())](tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L18)\n\tState variables written after the call(s):\n\t- [notCalled = false](tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L21)\n",
"first_markdown_element": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L16-L22",
"id": "296bbfc5c41b40046e8fc0563e89099df3ff17caf0bd3ff8dde0271aacd8d981",
"check": "reentrancy-no-eth",
"impact": "Medium",
"confidence": "Medium"
@ -277,7 +307,7 @@
"type": "function",
"name": "bad1",
"source_mapping": {
"start": 246,
"start": 485,
"length": 158,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
@ -285,12 +315,12 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
"is_dependency": false,
"lines": [
14,
15,
16,
17,
18,
19
24,
25,
26,
27,
28,
29
],
"starting_column": 5,
"ending_column": 6
@ -301,7 +331,7 @@
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 537,
"length": 776,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
@ -334,7 +364,17 @@
26,
27,
28,
29
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39
],
"starting_column": 1,
"ending_column": 2
@ -347,7 +387,7 @@
"type": "node",
"name": "success = msg.sender.call()",
"source_mapping": {
"start": 321,
"start": 560,
"length": 34,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
@ -355,7 +395,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
"is_dependency": false,
"lines": [
16
26
],
"starting_column": 9,
"ending_column": 43
@ -365,7 +405,7 @@
"type": "function",
"name": "bad1",
"source_mapping": {
"start": 246,
"start": 485,
"length": 158,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
@ -373,12 +413,12 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
"is_dependency": false,
"lines": [
14,
15,
16,
17,
18,
19
24,
25,
26,
27,
28,
29
],
"starting_column": 5,
"ending_column": 6
@ -389,7 +429,7 @@
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 537,
"length": 776,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
@ -422,7 +462,17 @@
26,
27,
28,
29
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39
],
"starting_column": 1,
"ending_column": 2
@ -440,7 +490,7 @@
"type": "node",
"name": "bad0()",
"source_mapping": {
"start": 391,
"start": 630,
"length": 6,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
@ -448,7 +498,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
"is_dependency": false,
"lines": [
18
28
],
"starting_column": 9,
"ending_column": 15
@ -458,7 +508,7 @@
"type": "function",
"name": "bad1",
"source_mapping": {
"start": 246,
"start": 485,
"length": 158,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
@ -466,12 +516,12 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
"is_dependency": false,
"lines": [
14,
15,
16,
17,
18,
19
24,
25,
26,
27,
28,
29
],
"starting_column": 5,
"ending_column": 6
@ -482,7 +532,7 @@
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 537,
"length": 776,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
@ -515,7 +565,17 @@
26,
27,
28,
29
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39
],
"starting_column": 1,
"ending_column": 2
@ -533,7 +593,7 @@
"type": "node",
"name": "! (msg.sender.call())",
"source_mapping": {
"start": 152,
"start": 391,
"length": 20,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
@ -541,7 +601,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
"is_dependency": false,
"lines": [
8
18
],
"starting_column": 13,
"ending_column": 33
@ -551,7 +611,7 @@
"type": "function",
"name": "bad0",
"source_mapping": {
"start": 87,
"start": 326,
"length": 153,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
@ -559,13 +619,13 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
"is_dependency": false,
"lines": [
6,
7,
8,
9,
10,
11,
12
16,
17,
18,
19,
20,
21,
22
],
"starting_column": 5,
"ending_column": 6
@ -576,7 +636,7 @@
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 537,
"length": 776,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
@ -609,7 +669,17 @@
26,
27,
28,
29
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39
],
"starting_column": 1,
"ending_column": 2
@ -627,7 +697,7 @@
"type": "node",
"name": "bad0()",
"source_mapping": {
"start": 391,
"start": 630,
"length": 6,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
@ -635,7 +705,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
"is_dependency": false,
"lines": [
18
28
],
"starting_column": 9,
"ending_column": 15
@ -645,7 +715,7 @@
"type": "function",
"name": "bad1",
"source_mapping": {
"start": 246,
"start": 485,
"length": 158,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
@ -653,12 +723,12 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
"is_dependency": false,
"lines": [
14,
15,
16,
17,
18,
19
24,
25,
26,
27,
28,
29
],
"starting_column": 5,
"ending_column": 6
@ -669,7 +739,7 @@
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 537,
"length": 776,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
@ -702,7 +772,17 @@
26,
27,
28,
29
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39
],
"starting_column": 1,
"ending_column": 2
@ -721,7 +801,7 @@
"type": "node",
"name": "notCalled = false",
"source_mapping": {
"start": 216,
"start": 455,
"length": 17,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
@ -729,7 +809,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
"is_dependency": false,
"lines": [
11
21
],
"starting_column": 9,
"ending_column": 26
@ -739,7 +819,7 @@
"type": "function",
"name": "bad0",
"source_mapping": {
"start": 87,
"start": 326,
"length": 153,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
@ -747,13 +827,13 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
"is_dependency": false,
"lines": [
6,
7,
8,
9,
10,
11,
12
16,
17,
18,
19,
20,
21,
22
],
"starting_column": 5,
"ending_column": 6
@ -764,7 +844,7 @@
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 537,
"length": 776,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
@ -797,7 +877,17 @@
26,
27,
28,
29
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39
],
"starting_column": 1,
"ending_column": 2
@ -813,10 +903,10 @@
}
}
],
"description": "Reentrancy in ReentrancyWrite.bad1(address) (tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#14-19):\n\tExternal calls:\n\t- success = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#16)\n\t- bad0() (tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#18)\n\t\t- ! (msg.sender.call()) (tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- bad0() (tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#18)\n\t\t- notCalled = false (tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#11)\n",
"markdown": "Reentrancy in [ReentrancyWrite.bad1(address)](tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L14-L19):\n\tExternal calls:\n\t- [success = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L16)\n\t- [bad0()](tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L18)\n\t\t- [! (msg.sender.call())](tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [bad0()](tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L18)\n\t\t- [notCalled = false](tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L11)\n",
"first_markdown_element": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L14-L19",
"id": "7bb6139d33983b626159983e8a4d7fc049710a8f08908c1d212bd13b68640a6a",
"description": "Reentrancy in ReentrancyWrite.bad1(address) (tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#24-29):\n\tExternal calls:\n\t- success = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#26)\n\t- bad0() (tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#28)\n\t\t- ! (msg.sender.call()) (tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#18)\n\tState variables written after the call(s):\n\t- bad0() (tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#28)\n\t\t- notCalled = false (tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#21)\n",
"markdown": "Reentrancy in [ReentrancyWrite.bad1(address)](tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L24-L29):\n\tExternal calls:\n\t- [success = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L26)\n\t- [bad0()](tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L28)\n\t\t- [! (msg.sender.call())](tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L18)\n\tState variables written after the call(s):\n\t- [bad0()](tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L28)\n\t\t- [notCalled = false](tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L21)\n",
"first_markdown_element": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L24-L29",
"id": "93b771e9737b42c786392b01e24457616ec7e54b5dd7714c96a1e67b9dd535f3",
"check": "reentrancy-no-eth",
"impact": "Medium",
"confidence": "Medium"

@ -3,6 +3,16 @@
contract ReentrancyWrite {
bool notCalled = true;
// Should not detect reentrancy in constructor
constructor(address addr) public {
require(notCalled);
(bool success,) = addr.call("");
if (!success) {
revert();
}
notCalled = false;
}
function bad0() public {
require(notCalled);
(bool success,) = msg.sender.call("");

@ -6,7 +6,7 @@
"type": "function",
"name": "bad0",
"source_mapping": {
"start": 87,
"start": 336,
"length": 188,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
@ -14,14 +14,14 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
"is_dependency": false,
"lines": [
6,
7,
8,
9,
10,
11,
12,
13
16,
17,
18,
19,
20,
21,
22,
23
],
"starting_column": 5,
"ending_column": 6
@ -32,7 +32,7 @@
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 610,
"length": 859,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
@ -67,7 +67,17 @@
28,
29,
30,
31
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41
],
"starting_column": 1,
"ending_column": 2
@ -80,7 +90,7 @@
"type": "node",
"name": "(success) = msg.sender.call()",
"source_mapping": {
"start": 148,
"start": 397,
"length": 37,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
@ -88,7 +98,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
"is_dependency": false,
"lines": [
8
18
],
"starting_column": 9,
"ending_column": 46
@ -98,7 +108,7 @@
"type": "function",
"name": "bad0",
"source_mapping": {
"start": 87,
"start": 336,
"length": 188,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
@ -106,14 +116,14 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
"is_dependency": false,
"lines": [
6,
7,
8,
9,
10,
11,
12,
13
16,
17,
18,
19,
20,
21,
22,
23
],
"starting_column": 5,
"ending_column": 6
@ -124,7 +134,7 @@
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 610,
"length": 859,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
@ -159,7 +169,17 @@
28,
29,
30,
31
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41
],
"starting_column": 1,
"ending_column": 2
@ -177,7 +197,7 @@
"type": "node",
"name": "notCalled = false",
"source_mapping": {
"start": 251,
"start": 500,
"length": 17,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
@ -185,7 +205,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
"is_dependency": false,
"lines": [
12
22
],
"starting_column": 9,
"ending_column": 26
@ -195,7 +215,7 @@
"type": "function",
"name": "bad0",
"source_mapping": {
"start": 87,
"start": 336,
"length": 188,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
@ -203,14 +223,14 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
"is_dependency": false,
"lines": [
6,
7,
8,
9,
10,
11,
12,
13
16,
17,
18,
19,
20,
21,
22,
23
],
"starting_column": 5,
"ending_column": 6
@ -221,7 +241,7 @@
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 610,
"length": 859,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
@ -256,7 +276,17 @@
28,
29,
30,
31
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41
],
"starting_column": 1,
"ending_column": 2
@ -272,10 +302,10 @@
}
}
],
"description": "Reentrancy in ReentrancyWrite.bad0() (tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#6-13):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- notCalled = false (tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#12)\n",
"markdown": "Reentrancy in [ReentrancyWrite.bad0()](tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L6-L13):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [notCalled = false](tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L12)\n",
"first_markdown_element": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L6-L13",
"id": "0aac5bbaf3a6f1b7de2ac725771ade12f8b1453c0639d09517b8bddb098a13d2",
"description": "Reentrancy in ReentrancyWrite.bad0() (tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#16-23):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#18)\n\tState variables written after the call(s):\n\t- notCalled = false (tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#22)\n",
"markdown": "Reentrancy in [ReentrancyWrite.bad0()](tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L16-L23):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L18)\n\tState variables written after the call(s):\n\t- [notCalled = false](tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L22)\n",
"first_markdown_element": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L16-L23",
"id": "c9ba81d76d46579f9e78ac96b1aae43b71f2d4a96d4c47b2fab9831bf0f15a8f",
"check": "reentrancy-no-eth",
"impact": "Medium",
"confidence": "Medium"
@ -286,7 +316,7 @@
"type": "function",
"name": "bad1",
"source_mapping": {
"start": 281,
"start": 530,
"length": 161,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
@ -294,12 +324,12 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
"is_dependency": false,
"lines": [
15,
16,
17,
18,
19,
20
25,
26,
27,
28,
29,
30
],
"starting_column": 5,
"ending_column": 6
@ -310,7 +340,7 @@
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 610,
"length": 859,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
@ -345,7 +375,17 @@
28,
29,
30,
31
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41
],
"starting_column": 1,
"ending_column": 2
@ -358,7 +398,7 @@
"type": "node",
"name": "(success) = msg.sender.call()",
"source_mapping": {
"start": 356,
"start": 605,
"length": 37,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
@ -366,7 +406,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
"is_dependency": false,
"lines": [
17
27
],
"starting_column": 9,
"ending_column": 46
@ -376,7 +416,7 @@
"type": "function",
"name": "bad1",
"source_mapping": {
"start": 281,
"start": 530,
"length": 161,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
@ -384,12 +424,12 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
"is_dependency": false,
"lines": [
15,
16,
17,
18,
19,
20
25,
26,
27,
28,
29,
30
],
"starting_column": 5,
"ending_column": 6
@ -400,7 +440,7 @@
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 610,
"length": 859,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
@ -435,7 +475,17 @@
28,
29,
30,
31
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41
],
"starting_column": 1,
"ending_column": 2
@ -453,7 +503,7 @@
"type": "node",
"name": "bad0()",
"source_mapping": {
"start": 429,
"start": 678,
"length": 6,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
@ -461,7 +511,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
"is_dependency": false,
"lines": [
19
29
],
"starting_column": 9,
"ending_column": 15
@ -471,7 +521,7 @@
"type": "function",
"name": "bad1",
"source_mapping": {
"start": 281,
"start": 530,
"length": 161,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
@ -479,12 +529,12 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
"is_dependency": false,
"lines": [
15,
16,
17,
18,
19,
20
25,
26,
27,
28,
29,
30
],
"starting_column": 5,
"ending_column": 6
@ -495,7 +545,7 @@
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 610,
"length": 859,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
@ -530,7 +580,17 @@
28,
29,
30,
31
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41
],
"starting_column": 1,
"ending_column": 2
@ -548,7 +608,7 @@
"type": "node",
"name": "(success) = msg.sender.call()",
"source_mapping": {
"start": 148,
"start": 397,
"length": 37,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
@ -556,7 +616,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
"is_dependency": false,
"lines": [
8
18
],
"starting_column": 9,
"ending_column": 46
@ -566,7 +626,7 @@
"type": "function",
"name": "bad0",
"source_mapping": {
"start": 87,
"start": 336,
"length": 188,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
@ -574,14 +634,14 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
"is_dependency": false,
"lines": [
6,
7,
8,
9,
10,
11,
12,
13
16,
17,
18,
19,
20,
21,
22,
23
],
"starting_column": 5,
"ending_column": 6
@ -592,7 +652,7 @@
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 610,
"length": 859,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
@ -627,7 +687,17 @@
28,
29,
30,
31
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41
],
"starting_column": 1,
"ending_column": 2
@ -645,7 +715,7 @@
"type": "node",
"name": "bad0()",
"source_mapping": {
"start": 429,
"start": 678,
"length": 6,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
@ -653,7 +723,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
"is_dependency": false,
"lines": [
19
29
],
"starting_column": 9,
"ending_column": 15
@ -663,7 +733,7 @@
"type": "function",
"name": "bad1",
"source_mapping": {
"start": 281,
"start": 530,
"length": 161,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
@ -671,12 +741,12 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
"is_dependency": false,
"lines": [
15,
16,
17,
18,
19,
20
25,
26,
27,
28,
29,
30
],
"starting_column": 5,
"ending_column": 6
@ -687,7 +757,7 @@
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 610,
"length": 859,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
@ -722,7 +792,17 @@
28,
29,
30,
31
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41
],
"starting_column": 1,
"ending_column": 2
@ -741,7 +821,7 @@
"type": "node",
"name": "notCalled = false",
"source_mapping": {
"start": 251,
"start": 500,
"length": 17,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
@ -749,7 +829,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
"is_dependency": false,
"lines": [
12
22
],
"starting_column": 9,
"ending_column": 26
@ -759,7 +839,7 @@
"type": "function",
"name": "bad0",
"source_mapping": {
"start": 87,
"start": 336,
"length": 188,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
@ -767,14 +847,14 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
"is_dependency": false,
"lines": [
6,
7,
8,
9,
10,
11,
12,
13
16,
17,
18,
19,
20,
21,
22,
23
],
"starting_column": 5,
"ending_column": 6
@ -785,7 +865,7 @@
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 610,
"length": 859,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
@ -820,7 +900,17 @@
28,
29,
30,
31
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41
],
"starting_column": 1,
"ending_column": 2
@ -836,10 +926,10 @@
}
}
],
"description": "Reentrancy in ReentrancyWrite.bad1(address) (tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#15-20):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#17)\n\t- bad0() (tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#19)\n\t\t- (success) = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- bad0() (tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#19)\n\t\t- notCalled = false (tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#12)\n",
"markdown": "Reentrancy in [ReentrancyWrite.bad1(address)](tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L15-L20):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L17)\n\t- [bad0()](tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L19)\n\t\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [bad0()](tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L19)\n\t\t- [notCalled = false](tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L12)\n",
"first_markdown_element": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L15-L20",
"id": "05033b6ee9ae71d9cc7b1ec3f6b09d4c0a43a6c92393f54fa45ce27c89a1e771",
"description": "Reentrancy in ReentrancyWrite.bad1(address) (tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#25-30):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#27)\n\t- bad0() (tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#29)\n\t\t- (success) = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#18)\n\tState variables written after the call(s):\n\t- bad0() (tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#29)\n\t\t- notCalled = false (tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#22)\n",
"markdown": "Reentrancy in [ReentrancyWrite.bad1(address)](tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L25-L30):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L27)\n\t- [bad0()](tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L29)\n\t\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L18)\n\tState variables written after the call(s):\n\t- [bad0()](tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L29)\n\t\t- [notCalled = false](tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L22)\n",
"first_markdown_element": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L25-L30",
"id": "9fbfafd0d47ce4f4ead524570f382093c186c4e9e5e96ce0067fce3ffb6dc74a",
"check": "reentrancy-no-eth",
"impact": "Medium",
"confidence": "Medium"

@ -3,6 +3,16 @@
contract ReentrancyWrite {
bool notCalled = true;
// Should not detect reentrancy in constructor
constructor(address addr) public {
require(notCalled);
(bool success,) = addr.call("");
if (!success) {
revert();
}
notCalled = false;
}
function bad0() public {
require(notCalled);
(bool success,) = msg.sender.call("");

@ -6,7 +6,7 @@
"type": "function",
"name": "bad0",
"source_mapping": {
"start": 87,
"start": 336,
"length": 188,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
@ -14,14 +14,14 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
"is_dependency": false,
"lines": [
6,
7,
8,
9,
10,
11,
12,
13
16,
17,
18,
19,
20,
21,
22,
23
],
"starting_column": 5,
"ending_column": 6
@ -32,7 +32,7 @@
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 610,
"length": 859,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
@ -67,7 +67,17 @@
28,
29,
30,
31
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41
],
"starting_column": 1,
"ending_column": 2
@ -80,7 +90,7 @@
"type": "node",
"name": "(success) = msg.sender.call()",
"source_mapping": {
"start": 148,
"start": 397,
"length": 37,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
@ -88,7 +98,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
"is_dependency": false,
"lines": [
8
18
],
"starting_column": 9,
"ending_column": 46
@ -98,7 +108,7 @@
"type": "function",
"name": "bad0",
"source_mapping": {
"start": 87,
"start": 336,
"length": 188,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
@ -106,14 +116,14 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
"is_dependency": false,
"lines": [
6,
7,
8,
9,
10,
11,
12,
13
16,
17,
18,
19,
20,
21,
22,
23
],
"starting_column": 5,
"ending_column": 6
@ -124,7 +134,7 @@
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 610,
"length": 859,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
@ -159,7 +169,17 @@
28,
29,
30,
31
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41
],
"starting_column": 1,
"ending_column": 2
@ -177,7 +197,7 @@
"type": "node",
"name": "notCalled = false",
"source_mapping": {
"start": 251,
"start": 500,
"length": 17,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
@ -185,7 +205,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
"is_dependency": false,
"lines": [
12
22
],
"starting_column": 9,
"ending_column": 26
@ -195,7 +215,7 @@
"type": "function",
"name": "bad0",
"source_mapping": {
"start": 87,
"start": 336,
"length": 188,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
@ -203,14 +223,14 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
"is_dependency": false,
"lines": [
6,
7,
8,
9,
10,
11,
12,
13
16,
17,
18,
19,
20,
21,
22,
23
],
"starting_column": 5,
"ending_column": 6
@ -221,7 +241,7 @@
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 610,
"length": 859,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
@ -256,7 +276,17 @@
28,
29,
30,
31
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41
],
"starting_column": 1,
"ending_column": 2
@ -272,10 +302,10 @@
}
}
],
"description": "Reentrancy in ReentrancyWrite.bad0() (tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#6-13):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- notCalled = false (tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#12)\n",
"markdown": "Reentrancy in [ReentrancyWrite.bad0()](tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L6-L13):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [notCalled = false](tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L12)\n",
"first_markdown_element": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L6-L13",
"id": "a786c050fdd723d3185d93105e0903cb696bf4ce71996fc791e79d8f97c5e72d",
"description": "Reentrancy in ReentrancyWrite.bad0() (tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#16-23):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#18)\n\tState variables written after the call(s):\n\t- notCalled = false (tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#22)\n",
"markdown": "Reentrancy in [ReentrancyWrite.bad0()](tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L16-L23):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L18)\n\tState variables written after the call(s):\n\t- [notCalled = false](tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L22)\n",
"first_markdown_element": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L16-L23",
"id": "6d19938cb98129ec5abb0fcde1a08ea92c6ab0125e210a1d4c10f27e9a9419cb",
"check": "reentrancy-no-eth",
"impact": "Medium",
"confidence": "Medium"
@ -286,7 +316,7 @@
"type": "function",
"name": "bad1",
"source_mapping": {
"start": 281,
"start": 530,
"length": 161,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
@ -294,12 +324,12 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
"is_dependency": false,
"lines": [
15,
16,
17,
18,
19,
20
25,
26,
27,
28,
29,
30
],
"starting_column": 5,
"ending_column": 6
@ -310,7 +340,7 @@
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 610,
"length": 859,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
@ -345,7 +375,17 @@
28,
29,
30,
31
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41
],
"starting_column": 1,
"ending_column": 2
@ -358,7 +398,7 @@
"type": "node",
"name": "(success) = msg.sender.call()",
"source_mapping": {
"start": 356,
"start": 605,
"length": 37,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
@ -366,7 +406,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
"is_dependency": false,
"lines": [
17
27
],
"starting_column": 9,
"ending_column": 46
@ -376,7 +416,7 @@
"type": "function",
"name": "bad1",
"source_mapping": {
"start": 281,
"start": 530,
"length": 161,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
@ -384,12 +424,12 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
"is_dependency": false,
"lines": [
15,
16,
17,
18,
19,
20
25,
26,
27,
28,
29,
30
],
"starting_column": 5,
"ending_column": 6
@ -400,7 +440,7 @@
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 610,
"length": 859,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
@ -435,7 +475,17 @@
28,
29,
30,
31
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41
],
"starting_column": 1,
"ending_column": 2
@ -453,7 +503,7 @@
"type": "node",
"name": "bad0()",
"source_mapping": {
"start": 429,
"start": 678,
"length": 6,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
@ -461,7 +511,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
"is_dependency": false,
"lines": [
19
29
],
"starting_column": 9,
"ending_column": 15
@ -471,7 +521,7 @@
"type": "function",
"name": "bad1",
"source_mapping": {
"start": 281,
"start": 530,
"length": 161,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
@ -479,12 +529,12 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
"is_dependency": false,
"lines": [
15,
16,
17,
18,
19,
20
25,
26,
27,
28,
29,
30
],
"starting_column": 5,
"ending_column": 6
@ -495,7 +545,7 @@
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 610,
"length": 859,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
@ -530,7 +580,17 @@
28,
29,
30,
31
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41
],
"starting_column": 1,
"ending_column": 2
@ -548,7 +608,7 @@
"type": "node",
"name": "(success) = msg.sender.call()",
"source_mapping": {
"start": 148,
"start": 397,
"length": 37,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
@ -556,7 +616,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
"is_dependency": false,
"lines": [
8
18
],
"starting_column": 9,
"ending_column": 46
@ -566,7 +626,7 @@
"type": "function",
"name": "bad0",
"source_mapping": {
"start": 87,
"start": 336,
"length": 188,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
@ -574,14 +634,14 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
"is_dependency": false,
"lines": [
6,
7,
8,
9,
10,
11,
12,
13
16,
17,
18,
19,
20,
21,
22,
23
],
"starting_column": 5,
"ending_column": 6
@ -592,7 +652,7 @@
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 610,
"length": 859,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
@ -627,7 +687,17 @@
28,
29,
30,
31
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41
],
"starting_column": 1,
"ending_column": 2
@ -645,7 +715,7 @@
"type": "node",
"name": "bad0()",
"source_mapping": {
"start": 429,
"start": 678,
"length": 6,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
@ -653,7 +723,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
"is_dependency": false,
"lines": [
19
29
],
"starting_column": 9,
"ending_column": 15
@ -663,7 +733,7 @@
"type": "function",
"name": "bad1",
"source_mapping": {
"start": 281,
"start": 530,
"length": 161,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
@ -671,12 +741,12 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
"is_dependency": false,
"lines": [
15,
16,
17,
18,
19,
20
25,
26,
27,
28,
29,
30
],
"starting_column": 5,
"ending_column": 6
@ -687,7 +757,7 @@
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 610,
"length": 859,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
@ -722,7 +792,17 @@
28,
29,
30,
31
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41
],
"starting_column": 1,
"ending_column": 2
@ -741,7 +821,7 @@
"type": "node",
"name": "notCalled = false",
"source_mapping": {
"start": 251,
"start": 500,
"length": 17,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
@ -749,7 +829,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
"is_dependency": false,
"lines": [
12
22
],
"starting_column": 9,
"ending_column": 26
@ -759,7 +839,7 @@
"type": "function",
"name": "bad0",
"source_mapping": {
"start": 87,
"start": 336,
"length": 188,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
@ -767,14 +847,14 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
"is_dependency": false,
"lines": [
6,
7,
8,
9,
10,
11,
12,
13
16,
17,
18,
19,
20,
21,
22,
23
],
"starting_column": 5,
"ending_column": 6
@ -785,7 +865,7 @@
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 610,
"length": 859,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
@ -820,7 +900,17 @@
28,
29,
30,
31
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41
],
"starting_column": 1,
"ending_column": 2
@ -836,10 +926,10 @@
}
}
],
"description": "Reentrancy in ReentrancyWrite.bad1(address) (tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#15-20):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#17)\n\t- bad0() (tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#19)\n\t\t- (success) = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- bad0() (tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#19)\n\t\t- notCalled = false (tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#12)\n",
"markdown": "Reentrancy in [ReentrancyWrite.bad1(address)](tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L15-L20):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L17)\n\t- [bad0()](tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L19)\n\t\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [bad0()](tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L19)\n\t\t- [notCalled = false](tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L12)\n",
"first_markdown_element": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L15-L20",
"id": "02d9e7190770aed44ccdabc149dfc114e91d2f90346cfbfff570c7ccbc1d64e8",
"description": "Reentrancy in ReentrancyWrite.bad1(address) (tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#25-30):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#27)\n\t- bad0() (tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#29)\n\t\t- (success) = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#18)\n\tState variables written after the call(s):\n\t- bad0() (tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#29)\n\t\t- notCalled = false (tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#22)\n",
"markdown": "Reentrancy in [ReentrancyWrite.bad1(address)](tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L25-L30):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L27)\n\t- [bad0()](tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L29)\n\t\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L18)\n\tState variables written after the call(s):\n\t- [bad0()](tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L29)\n\t\t- [notCalled = false](tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L22)\n",
"first_markdown_element": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L25-L30",
"id": "dfc70c3670d28f163af1fd624da8ace78193a8309e4c442462e7bc96e88eeae1",
"check": "reentrancy-no-eth",
"impact": "Medium",
"confidence": "Medium"

@ -1,8 +1,22 @@
// pragma solidity 0.4.26;
interface IContract {
function foo() external;
}
contract ReentrancyWrite {
bool notCalled = true;
// Should not detect reentrancy in constructor
constructor(address addr) {
require(notCalled);
(bool success,) = addr.call("");
if (!success) {
revert();
}
notCalled = false;
}
function bad0() public {
require(notCalled);
(bool success,) = msg.sender.call("");

@ -6,7 +6,7 @@
"type": "function",
"name": "bad0",
"source_mapping": {
"start": 87,
"start": 383,
"length": 188,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
@ -14,14 +14,14 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"is_dependency": false,
"lines": [
6,
7,
8,
9,
10,
11,
12,
13
20,
21,
22,
23,
24,
25,
26,
27
],
"starting_column": 5,
"ending_column": 6
@ -31,18 +31,14 @@
"type": "contract",
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 610,
"start": 82,
"length": 852,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"is_dependency": false,
"lines": [
3,
4,
5,
6,
7,
8,
9,
@ -67,7 +63,21 @@
28,
29,
30,
31
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45
],
"starting_column": 1,
"ending_column": 2
@ -80,7 +90,7 @@
"type": "node",
"name": "(success) = msg.sender.call()",
"source_mapping": {
"start": 148,
"start": 444,
"length": 37,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
@ -88,7 +98,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"is_dependency": false,
"lines": [
8
22
],
"starting_column": 9,
"ending_column": 46
@ -98,7 +108,7 @@
"type": "function",
"name": "bad0",
"source_mapping": {
"start": 87,
"start": 383,
"length": 188,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
@ -106,14 +116,14 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"is_dependency": false,
"lines": [
6,
7,
8,
9,
10,
11,
12,
13
20,
21,
22,
23,
24,
25,
26,
27
],
"starting_column": 5,
"ending_column": 6
@ -123,18 +133,14 @@
"type": "contract",
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 610,
"start": 82,
"length": 852,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"is_dependency": false,
"lines": [
3,
4,
5,
6,
7,
8,
9,
@ -159,7 +165,21 @@
28,
29,
30,
31
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45
],
"starting_column": 1,
"ending_column": 2
@ -177,7 +197,7 @@
"type": "node",
"name": "notCalled = false",
"source_mapping": {
"start": 251,
"start": 547,
"length": 17,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
@ -185,7 +205,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"is_dependency": false,
"lines": [
12
26
],
"starting_column": 9,
"ending_column": 26
@ -195,7 +215,7 @@
"type": "function",
"name": "bad0",
"source_mapping": {
"start": 87,
"start": 383,
"length": 188,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
@ -203,14 +223,14 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"is_dependency": false,
"lines": [
6,
7,
8,
9,
10,
11,
12,
13
20,
21,
22,
23,
24,
25,
26,
27
],
"starting_column": 5,
"ending_column": 6
@ -220,18 +240,14 @@
"type": "contract",
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 610,
"start": 82,
"length": 852,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"is_dependency": false,
"lines": [
3,
4,
5,
6,
7,
8,
9,
@ -256,7 +272,21 @@
28,
29,
30,
31
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45
],
"starting_column": 1,
"ending_column": 2
@ -272,10 +302,10 @@
}
}
],
"description": "Reentrancy in ReentrancyWrite.bad0() (tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#6-13):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- notCalled = false (tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#12)\n",
"markdown": "Reentrancy in [ReentrancyWrite.bad0()](tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L6-L13):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [notCalled = false](tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L12)\n",
"first_markdown_element": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L6-L13",
"id": "10fd7c0322e6af411a40589a36dd17ec3e91b73cb56a6757dd9b192bcc2b6955",
"description": "Reentrancy in ReentrancyWrite.bad0() (tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#20-27):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#22)\n\tState variables written after the call(s):\n\t- notCalled = false (tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#26)\n",
"markdown": "Reentrancy in [ReentrancyWrite.bad0()](tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L20-L27):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L22)\n\tState variables written after the call(s):\n\t- [notCalled = false](tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L26)\n",
"first_markdown_element": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L20-L27",
"id": "ef995e89d54c7b577af2ca26540e01da65ac0e2466d6d7a58e4d11e9211b12a4",
"check": "reentrancy-no-eth",
"impact": "Medium",
"confidence": "Medium"
@ -286,7 +316,7 @@
"type": "function",
"name": "bad1",
"source_mapping": {
"start": 281,
"start": 577,
"length": 161,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
@ -294,12 +324,12 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"is_dependency": false,
"lines": [
15,
16,
17,
18,
19,
20
29,
30,
31,
32,
33,
34
],
"starting_column": 5,
"ending_column": 6
@ -309,18 +339,14 @@
"type": "contract",
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 610,
"start": 82,
"length": 852,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"is_dependency": false,
"lines": [
3,
4,
5,
6,
7,
8,
9,
@ -345,7 +371,21 @@
28,
29,
30,
31
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45
],
"starting_column": 1,
"ending_column": 2
@ -358,7 +398,7 @@
"type": "node",
"name": "(success) = msg.sender.call()",
"source_mapping": {
"start": 356,
"start": 652,
"length": 37,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
@ -366,7 +406,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"is_dependency": false,
"lines": [
17
31
],
"starting_column": 9,
"ending_column": 46
@ -376,7 +416,7 @@
"type": "function",
"name": "bad1",
"source_mapping": {
"start": 281,
"start": 577,
"length": 161,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
@ -384,12 +424,12 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"is_dependency": false,
"lines": [
15,
16,
17,
18,
19,
20
29,
30,
31,
32,
33,
34
],
"starting_column": 5,
"ending_column": 6
@ -399,18 +439,14 @@
"type": "contract",
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 610,
"start": 82,
"length": 852,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"is_dependency": false,
"lines": [
3,
4,
5,
6,
7,
8,
9,
@ -435,7 +471,21 @@
28,
29,
30,
31
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45
],
"starting_column": 1,
"ending_column": 2
@ -453,7 +503,7 @@
"type": "node",
"name": "bad0()",
"source_mapping": {
"start": 429,
"start": 725,
"length": 6,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
@ -461,7 +511,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"is_dependency": false,
"lines": [
19
33
],
"starting_column": 9,
"ending_column": 15
@ -471,7 +521,7 @@
"type": "function",
"name": "bad1",
"source_mapping": {
"start": 281,
"start": 577,
"length": 161,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
@ -479,12 +529,12 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"is_dependency": false,
"lines": [
15,
16,
17,
18,
19,
20
29,
30,
31,
32,
33,
34
],
"starting_column": 5,
"ending_column": 6
@ -494,18 +544,14 @@
"type": "contract",
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 610,
"start": 82,
"length": 852,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"is_dependency": false,
"lines": [
3,
4,
5,
6,
7,
8,
9,
@ -530,7 +576,21 @@
28,
29,
30,
31
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45
],
"starting_column": 1,
"ending_column": 2
@ -548,7 +608,7 @@
"type": "node",
"name": "(success) = msg.sender.call()",
"source_mapping": {
"start": 148,
"start": 444,
"length": 37,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
@ -556,7 +616,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"is_dependency": false,
"lines": [
8
22
],
"starting_column": 9,
"ending_column": 46
@ -566,7 +626,7 @@
"type": "function",
"name": "bad0",
"source_mapping": {
"start": 87,
"start": 383,
"length": 188,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
@ -574,14 +634,14 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"is_dependency": false,
"lines": [
6,
7,
8,
9,
10,
11,
12,
13
20,
21,
22,
23,
24,
25,
26,
27
],
"starting_column": 5,
"ending_column": 6
@ -591,18 +651,14 @@
"type": "contract",
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 610,
"start": 82,
"length": 852,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"is_dependency": false,
"lines": [
3,
4,
5,
6,
7,
8,
9,
@ -627,7 +683,21 @@
28,
29,
30,
31
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45
],
"starting_column": 1,
"ending_column": 2
@ -645,7 +715,7 @@
"type": "node",
"name": "bad0()",
"source_mapping": {
"start": 429,
"start": 725,
"length": 6,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
@ -653,7 +723,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"is_dependency": false,
"lines": [
19
33
],
"starting_column": 9,
"ending_column": 15
@ -663,7 +733,7 @@
"type": "function",
"name": "bad1",
"source_mapping": {
"start": 281,
"start": 577,
"length": 161,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
@ -671,12 +741,12 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"is_dependency": false,
"lines": [
15,
16,
17,
18,
19,
20
29,
30,
31,
32,
33,
34
],
"starting_column": 5,
"ending_column": 6
@ -686,18 +756,14 @@
"type": "contract",
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 610,
"start": 82,
"length": 852,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"is_dependency": false,
"lines": [
3,
4,
5,
6,
7,
8,
9,
@ -722,7 +788,21 @@
28,
29,
30,
31
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45
],
"starting_column": 1,
"ending_column": 2
@ -741,7 +821,7 @@
"type": "node",
"name": "notCalled = false",
"source_mapping": {
"start": 251,
"start": 547,
"length": 17,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
@ -749,7 +829,7 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"is_dependency": false,
"lines": [
12
26
],
"starting_column": 9,
"ending_column": 26
@ -759,7 +839,7 @@
"type": "function",
"name": "bad0",
"source_mapping": {
"start": 87,
"start": 383,
"length": 188,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
@ -767,14 +847,14 @@
"filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"is_dependency": false,
"lines": [
6,
7,
8,
9,
10,
11,
12,
13
20,
21,
22,
23,
24,
25,
26,
27
],
"starting_column": 5,
"ending_column": 6
@ -784,18 +864,14 @@
"type": "contract",
"name": "ReentrancyWrite",
"source_mapping": {
"start": 28,
"length": 610,
"start": 82,
"length": 852,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol",
"is_dependency": false,
"lines": [
3,
4,
5,
6,
7,
8,
9,
@ -820,7 +896,21 @@
28,
29,
30,
31
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45
],
"starting_column": 1,
"ending_column": 2
@ -836,10 +926,10 @@
}
}
],
"description": "Reentrancy in ReentrancyWrite.bad1(address) (tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#15-20):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#17)\n\t- bad0() (tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#19)\n\t\t- (success) = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- bad0() (tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#19)\n\t\t- notCalled = false (tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#12)\n",
"markdown": "Reentrancy in [ReentrancyWrite.bad1(address)](tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L15-L20):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L17)\n\t- [bad0()](tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L19)\n\t\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [bad0()](tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L19)\n\t\t- [notCalled = false](tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L12)\n",
"first_markdown_element": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L15-L20",
"id": "a9d96103d5786a77ba0de28c96dc94a27ea5acda47af8fef59a80327925a286b",
"description": "Reentrancy in ReentrancyWrite.bad1(address) (tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#29-34):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#31)\n\t- bad0() (tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#33)\n\t\t- (success) = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#22)\n\tState variables written after the call(s):\n\t- bad0() (tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#33)\n\t\t- notCalled = false (tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#26)\n",
"markdown": "Reentrancy in [ReentrancyWrite.bad1(address)](tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L29-L34):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L31)\n\t- [bad0()](tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L33)\n\t\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L22)\n\tState variables written after the call(s):\n\t- [bad0()](tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L33)\n\t\t- [notCalled = false](tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L26)\n",
"first_markdown_element": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L29-L34",
"id": "11273f8e5ccbb848ea0de9b7c15e3fb66deb7c061265f88b8aa7646eed935c0e",
"check": "reentrancy-no-eth",
"impact": "Medium",
"confidence": "Medium"

@ -64,19 +64,19 @@
},
{
"type": "function",
"name": "bad1",
"name": "bad0",
"source_mapping": {
"start": 601,
"length": 170,
"start": 355,
"length": 132,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol",
"is_dependency": false,
"lines": [
15,
16,
17
10,
11,
12
],
"starting_column": 3,
"ending_column": 4
@ -142,42 +142,42 @@
"ending_column": 2
}
},
"signature": "bad1(int128[3])"
"signature": "bad0()"
}
},
{
"type": "node",
"name": "intArray = userArray",
"name": "intArray = (- 1,- 2,- 3)",
"source_mapping": {
"start": 746,
"length": 20,
"start": 384,
"length": 23,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol",
"is_dependency": false,
"lines": [
16
11
],
"starting_column": 5,
"ending_column": 25
"ending_column": 28
},
"type_specific_fields": {
"parent": {
"type": "function",
"name": "bad1",
"name": "bad0",
"source_mapping": {
"start": 601,
"length": 170,
"start": 355,
"length": 132,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol",
"is_dependency": false,
"lines": [
15,
16,
17
10,
11,
12
],
"starting_column": 3,
"ending_column": 4
@ -243,16 +243,16 @@
"ending_column": 2
}
},
"signature": "bad1(int128[3])"
"signature": "bad0()"
}
}
}
}
],
"description": "Contract A (tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#3-45) \n\t- Function A.bad1(int128[3]) (tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#15-17)\n\t\t- intArray = userArray (tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#16) has a storage signed integer array assignment\n",
"markdown": "Contract [A](tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#L3-L45) \n\t- Function [A.bad1(int128[3])](tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#L15-L17)\n\t\t- [intArray = userArray](tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#L16) has a storage signed integer array assignment\n",
"description": "Contract A (tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#3-45) \n\t- Function A.bad0() (tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#10-12)\n\t\t- intArray = (- 1,- 2,- 3) (tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#11) has a storage signed integer array assignment\n",
"markdown": "Contract [A](tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#L3-L45) \n\t- Function [A.bad0()](tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#L10-L12)\n\t\t- [intArray = (- 1,- 2,- 3)](tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#L11) has a storage signed integer array assignment\n",
"first_markdown_element": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#L3-L45",
"id": "7ba5efbfb61ba63a7ac01d376a0cede2fda18c2a2d8604c4a82cccec92ae2bdb",
"id": "da870be9a396bc52d2f6f8caeb00e6b8809ad1b6fb4c24a019568257b3404a2f",
"check": "storage-array",
"impact": "High",
"confidence": "Medium"
@ -321,19 +321,19 @@
},
{
"type": "function",
"name": "bad0",
"name": "bad1",
"source_mapping": {
"start": 355,
"length": 132,
"start": 601,
"length": 170,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol",
"is_dependency": false,
"lines": [
10,
11,
12
15,
16,
17
],
"starting_column": 3,
"ending_column": 4
@ -399,42 +399,42 @@
"ending_column": 2
}
},
"signature": "bad0()"
"signature": "bad1(int128[3])"
}
},
{
"type": "node",
"name": "intArray = (- 1,- 2,- 3)",
"name": "intArray = userArray",
"source_mapping": {
"start": 384,
"length": 23,
"start": 746,
"length": 20,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol",
"is_dependency": false,
"lines": [
11
16
],
"starting_column": 5,
"ending_column": 28
"ending_column": 25
},
"type_specific_fields": {
"parent": {
"type": "function",
"name": "bad0",
"name": "bad1",
"source_mapping": {
"start": 355,
"length": 132,
"start": 601,
"length": 170,
"filename_used": "/GENERIC_PATH",
"filename_relative": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol",
"is_dependency": false,
"lines": [
10,
11,
12
15,
16,
17
],
"starting_column": 3,
"ending_column": 4
@ -500,16 +500,16 @@
"ending_column": 2
}
},
"signature": "bad0()"
"signature": "bad1(int128[3])"
}
}
}
}
],
"description": "Contract A (tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#3-45) \n\t- Function A.bad0() (tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#10-12)\n\t\t- intArray = (- 1,- 2,- 3) (tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#11) has a storage signed integer array assignment\n",
"markdown": "Contract [A](tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#L3-L45) \n\t- Function [A.bad0()](tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#L10-L12)\n\t\t- [intArray = (- 1,- 2,- 3)](tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#L11) has a storage signed integer array assignment\n",
"description": "Contract A (tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#3-45) \n\t- Function A.bad1(int128[3]) (tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#15-17)\n\t\t- intArray = userArray (tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#16) has a storage signed integer array assignment\n",
"markdown": "Contract [A](tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#L3-L45) \n\t- Function [A.bad1(int128[3])](tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#L15-L17)\n\t\t- [intArray = userArray](tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#L16) has a storage signed integer array assignment\n",
"first_markdown_element": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#L3-L45",
"id": "da870be9a396bc52d2f6f8caeb00e6b8809ad1b6fb4c24a019568257b3404a2f",
"id": "7ba5efbfb61ba63a7ac01d376a0cede2fda18c2a2d8604c4a82cccec92ae2bdb",
"check": "storage-array",
"impact": "High",
"confidence": "Medium"

Loading…
Cancel
Save