Co-authored-by: bart1e <bartolwodzinski@op.pl>
pull/2392/head
alpharush 8 months ago
parent 5f5aacdde7
commit 098851cbd2
  1. 8
      slither/detectors/statements/unused_import.py
  2. 6
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_C_sol__0.txt
  3. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ConstantContractLevelUsedInContractTest_sol__0.txt
  4. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ConstantContractLevelUsedTopLevelTest_sol__0.txt
  5. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ConstantTopLevelUsedInContractTest_sol__0.txt
  6. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ConstantTopLevelUsedTopLevelTest_sol__0.txt
  7. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ContractUsedInContractTest1_sol__0.txt
  8. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ContractUsedInContractTest2_sol__0.txt
  9. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ContractUsedTopLevelTest_sol__0.txt
  10. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomErrorTopLevelUsedInContractTest_sol__0.txt
  11. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomEventContractLevelUsedInContractTest_sol__0.txt
  12. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomEventContractLevelUsedTopLevelTest_sol__0.txt
  13. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeContractLevelUsedInContractTest1_sol__0.txt
  14. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeContractLevelUsedInContractTest2_sol__0.txt
  15. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeContractLevelUsedInContractTest3_sol__0.txt
  16. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeContractLevelUsedInContractTest4_sol__0.txt
  17. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeContractLevelUsedTopLevelTest1_sol__0.txt
  18. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeContractLevelUsedTopLevelTest2_sol__0.txt
  19. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeTopLevelUsedInContractTest1_sol__0.txt
  20. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeTopLevelUsedInContractTest2_sol__0.txt
  21. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeTopLevelUsedInContractTest3_sol__0.txt
  22. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeTopLevelUsedInContractTest4_sol__0.txt
  23. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeTopLevelUsedTopLevelTest1_sol__0.txt
  24. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeTopLevelUsedTopLevelTest2_sol__0.txt
  25. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_EnumContractLevelUsedInContractTest_sol__0.txt
  26. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_EnumContractLevelUsedTopLevelTest_sol__0.txt
  27. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_EnumTopLevelUsedInContractTest_sol__0.txt
  28. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_EnumTopLevelUsedTopLevelTest_sol__0.txt
  29. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_FunctionContractLevelUsedInContractTest_sol__0.txt
  30. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_FunctionContractLevelUsedTopLevelTest_sol__0.txt
  31. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_FunctionTopLevelUsedInContractTest_sol__0.txt
  32. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_FunctionTopLevelUsedTopLevelTest_sol__0.txt
  33. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_LibraryUsedInContractTest_sol__0.txt
  34. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_LibraryUsedTopLevelTest_sol__0.txt
  35. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_StructContractLevelUsedInContractTest_sol__0.txt
  36. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_StructContractLevelUsedTopLevelTest_sol__0.txt
  37. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_StructTopLevelUsedInContractTest_sol__0.txt
  38. 0
      tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_StructTopLevelUsedTopLevelTest_sol__0.txt
  39. 10
      tests/e2e/detectors/test_data/unused-import/0.8.16/A.sol
  40. 9
      tests/e2e/detectors/test_data/unused-import/0.8.16/B.sol
  41. 12
      tests/e2e/detectors/test_data/unused-import/0.8.16/C.sol
  42. BIN
      tests/e2e/detectors/test_data/unused-import/0.8.16/C.sol-0.8.16.zip
  43. 7
      tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantContractLevel.sol
  44. 9
      tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantContractLevelUsedInContractTest.sol
  45. BIN
      tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantContractLevelUsedInContractTest.sol-0.8.16.zip
  46. 12
      tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantContractLevelUsedTopLevelTest.sol
  47. BIN
      tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantContractLevelUsedTopLevelTest.sol-0.8.16.zip
  48. 10
      tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantTopLevel.sol
  49. 9
      tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantTopLevelUsedInContractTest.sol
  50. BIN
      tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantTopLevelUsedInContractTest.sol-0.8.16.zip
  51. 12
      tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantTopLevelUsedTopLevelTest.sol
  52. BIN
      tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantTopLevelUsedTopLevelTest.sol-0.8.16.zip
  53. 7
      tests/e2e/detectors/test_data/unused-import/0.8.16/Contract.sol
  54. 9
      tests/e2e/detectors/test_data/unused-import/0.8.16/ContractUsedInContractTest1.sol
  55. BIN
      tests/e2e/detectors/test_data/unused-import/0.8.16/ContractUsedInContractTest1.sol-0.8.16.zip
  56. 9
      tests/e2e/detectors/test_data/unused-import/0.8.16/ContractUsedInContractTest2.sol
  57. BIN
      tests/e2e/detectors/test_data/unused-import/0.8.16/ContractUsedInContractTest2.sol-0.8.16.zip
  58. 12
      tests/e2e/detectors/test_data/unused-import/0.8.16/ContractUsedTopLevelTest.sol
  59. BIN
      tests/e2e/detectors/test_data/unused-import/0.8.16/ContractUsedTopLevelTest.sol-0.8.16.zip
  60. 10
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomErrorTopLevel.sol
  61. 17
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomErrorTopLevelUsedInContractTest.sol
  62. BIN
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomErrorTopLevelUsedInContractTest.sol-0.8.16.zip
  63. 7
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomEventContractLevel.sol
  64. 12
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomEventContractLevelUsedInContractTest.sol
  65. BIN
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomEventContractLevelUsedInContractTest.sol-0.8.16.zip
  66. 15
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomEventContractLevelUsedTopLevelTest.sol
  67. BIN
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomEventContractLevelUsedTopLevelTest.sol-0.8.16.zip
  68. 7
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevel.sol
  69. 9
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedInContractTest1.sol
  70. BIN
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedInContractTest1.sol-0.8.16.zip
  71. 12
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedInContractTest2.sol
  72. BIN
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedInContractTest2.sol-0.8.16.zip
  73. 13
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedInContractTest3.sol
  74. BIN
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedInContractTest3.sol-0.8.16.zip
  75. 12
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedInContractTest4.sol
  76. BIN
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedInContractTest4.sol-0.8.16.zip
  77. 15
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedTopLevelTest1.sol
  78. BIN
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedTopLevelTest1.sol-0.8.16.zip
  79. 12
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedTopLevelTest2.sol
  80. BIN
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedTopLevelTest2.sol-0.8.16.zip
  81. 10
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevel.sol
  82. 9
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest1.sol
  83. BIN
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest1.sol-0.8.16.zip
  84. 12
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest2.sol
  85. BIN
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest2.sol-0.8.16.zip
  86. 13
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest3.sol
  87. BIN
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest3.sol-0.8.16.zip
  88. 12
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest4.sol
  89. BIN
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest4.sol-0.8.16.zip
  90. 15
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedTopLevelTest1.sol
  91. BIN
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedTopLevelTest1.sol-0.8.16.zip
  92. 12
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedTopLevelTest2.sol
  93. BIN
      tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedTopLevelTest2.sol-0.8.16.zip
  94. 10
      tests/e2e/detectors/test_data/unused-import/0.8.16/EnumContractLevel.sol
  95. 9
      tests/e2e/detectors/test_data/unused-import/0.8.16/EnumContractLevelUsedInContractTest.sol
  96. BIN
      tests/e2e/detectors/test_data/unused-import/0.8.16/EnumContractLevelUsedInContractTest.sol-0.8.16.zip
  97. 12
      tests/e2e/detectors/test_data/unused-import/0.8.16/EnumContractLevelUsedTopLevelTest.sol
  98. BIN
      tests/e2e/detectors/test_data/unused-import/0.8.16/EnumContractLevelUsedTopLevelTest.sol-0.8.16.zip
  99. 13
      tests/e2e/detectors/test_data/unused-import/0.8.16/EnumTopLevel.sol
  100. 9
      tests/e2e/detectors/test_data/unused-import/0.8.16/EnumTopLevelUsedInContractTest.sol
  101. Some files were not shown because too many files have changed in this diff Show More

@ -1,7 +1,7 @@
from typing import List
from slither.detectors.abstract_detector import AbstractDetector, DetectorClassification, Output
# pylint: disable=protected-access,too-many-nested-blocks
class UnusedImport(AbstractDetector):
"""
Detector unused imports.
@ -59,12 +59,10 @@ class UnusedImport(AbstractDetector):
break
if not use_found:
unused.append(f"{i.source_mapping.content} ({i.source_mapping}")
unused.append(f"{i.source_mapping.content} ({i.source_mapping})")
if len(unused) > 0:
unused_list = ""
for i in unused:
unused_list += f"\n\t-{i}"
unused_list = "\n\t-" + "\n\t-".join(unused)
results.append(
self.generate_result(

@ -0,0 +1,6 @@
The following unused import(s) in tests/e2e/detectors/test_data/unused-imports/0.8.16/B.sol should be removed:
-import "./A.sol"; (tests/e2e/detectors/test_data/unused-imports/0.8.16/B.sol#4)
The following unused import(s) in tests/e2e/detectors/test_data/unused-imports/0.8.16/C.sol should be removed:
-import "./B.sol"; (tests/e2e/detectors/test_data/unused-imports/0.8.16/C.sol#4)

@ -0,0 +1,10 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
library A
{
function a() public
{
}
}

@ -0,0 +1,9 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
import "./A.sol";
contract B
{
}

@ -0,0 +1,12 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
import "./B.sol";
contract C
{
constructor()
{
A.a();
}
}

@ -0,0 +1,7 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
library ConstantContractLevel
{
uint constant public CONSTANT = 0;
}

@ -0,0 +1,9 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
import "./ConstantContractLevel.sol";
contract ConstantContractLevelUsedInContractTest
{
uint private v = ConstantContractLevel.CONSTANT;
}

@ -0,0 +1,12 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
import "./ConstantContractLevel.sol";
uint constant __ = ConstantContractLevel.CONSTANT;
// dummy contract, so that "No contract were found ..." message is not being thrown by Slither
contract Dummy
{
}

@ -0,0 +1,10 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
uint constant ConstantTopLevel = 0;
// dummy contract, so that "No contract were found ..." message is not being thrown by Slither
contract Dummy
{
}

@ -0,0 +1,9 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
import "./ConstantTopLevel.sol";
contract ConstantTopLevelUsedInContractTest
{
uint private v = ConstantTopLevel;
}

@ -0,0 +1,12 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
import "./ConstantTopLevel.sol";
uint constant __ = ConstantTopLevel;
// dummy contract, so that "No contract were found ..." message is not being thrown by Slither
contract Dummy_
{
}

@ -0,0 +1,7 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
contract Contract
{
}

@ -0,0 +1,9 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
import "./Contract.sol";
contract ContractUsedInContractTest1
{
Contract c;
}

@ -0,0 +1,9 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
import "./Contract.sol";
contract ContractUsedInContractTest2 is Contract
{
}

@ -0,0 +1,12 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
import "./Contract.sol";
Contract constant c = Contract(address(0x0));
// dummy contract, so that "No contract were found ..." message is not being thrown by Slither
contract Dummy
{
}

@ -0,0 +1,10 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
error err();
// dummy contract, so that "No contract were found ..." message is not being thrown by Slither
contract Dummy
{
}

@ -0,0 +1,17 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
import "./CustomErrorTopLevel.sol";
contract CustomErrorTopLevelUsedInContractTest
{
constructor()
{
f();
}
function f() private pure
{
revert err();
}
}

@ -0,0 +1,7 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
library CustomEventContractLevel
{
event CustomEvent();
}

@ -0,0 +1,12 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
import "./CustomEventContractLevel.sol";
contract CustomEventContractLevelUsedInContractTest
{
function f() public
{
emit CustomEventContractLevel.CustomEvent();
}
}

@ -0,0 +1,15 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
import "./CustomEventContractLevel.sol";
function f()
{
emit CustomEventContractLevel.CustomEvent();
}
// dummy contract, so that "No contract were found ..." message is not being thrown by Slither
contract Dummy
{
}

@ -0,0 +1,7 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
contract CustomTypeContractLevel
{
type CustomType is uint;
}

@ -0,0 +1,9 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
import "./CustomTypeContractLevel.sol";
contract CustomTypeContractLevelUsedInContractTest1
{
CustomTypeContractLevel.CustomType private v;
}

@ -0,0 +1,12 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
import "./CustomTypeContractLevel.sol";
contract CustomTypeContractLevelUsedInContractTest2
{
function f(CustomTypeContractLevel.CustomType) public
{
}
}

@ -0,0 +1,13 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
import "./CustomTypeContractLevel.sol";
contract CustomTypeContractLevelUsedInContractTest3
{
modifier m()
{
CustomTypeContractLevel.CustomType ___;
_;
}
}

@ -0,0 +1,12 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
import "./CustomTypeContractLevel.sol";
contract CustomTypeContractLevelUsedInContractTest4
{
struct CustomStruct
{
CustomTypeContractLevel.CustomType ___;
}
}

@ -0,0 +1,15 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
import "./CustomTypeContractLevel.sol";
struct CustomTypeContractLevelUsedTopLevelTest1
{
CustomTypeContractLevel.CustomType __;
}
// dummy contract, so that "No contract were found ..." message is not being thrown by Slither
contract Dummy
{
}

@ -0,0 +1,12 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
import "./CustomTypeContractLevel.sol";
CustomTypeContractLevel.CustomType constant __ = CustomTypeContractLevel.CustomType.wrap(0);
// dummy contract, so that "No contract were found ..." message is not being thrown by Slither
contract Dummy
{
}

@ -0,0 +1,10 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
type CustomType is uint;
// dummy contract, so that "No contract were found ..." message is not being thrown by Slither
contract Dummy
{
}

@ -0,0 +1,9 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
import "./CustomTypeTopLevel.sol";
contract CustomTypeTopLevelUsedInContractTest1
{
CustomType private v;
}

@ -0,0 +1,12 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
import "./CustomTypeTopLevel.sol";
contract CustomTypeTopLevelUsedInContractTest2
{
function f(CustomType) public
{
}
}

@ -0,0 +1,13 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
import "./CustomTypeTopLevel.sol";
contract CustomTypeTopLevelUsedInContractTest3
{
modifier m()
{
CustomType v;
_;
}
}

@ -0,0 +1,12 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
import "./CustomTypeTopLevel.sol";
contract CustomTypeTopLevelUsedInContractTest4
{
struct CustomStruct
{
CustomType ___;
}
}

@ -0,0 +1,15 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
import "./CustomTypeTopLevel.sol";
struct CustomTypeTopLevelUsedTopLevelTest1
{
CustomType __;
}
// dummy contract, so that "No contract were found ..." message is not being thrown by Slither
contract Dummy_
{
}

@ -0,0 +1,12 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
import "./CustomTypeTopLevel.sol";
CustomType constant __ = CustomType.wrap(0);
// dummy contract, so that "No contract were found ..." message is not being thrown by Slither
contract Dummy_
{
}

@ -0,0 +1,10 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
contract EnumContractLevel
{
enum CustomEnum
{
__
}
}

@ -0,0 +1,9 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
import "./EnumContractLevel.sol";
contract EnumContractLevelUsedInContractTest
{
uint private v = uint(EnumContractLevel.CustomEnum.__);
}

@ -0,0 +1,12 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
import "./EnumContractLevel.sol";
uint constant __ = uint(EnumContractLevel.CustomEnum.__);
// dummy contract, so that "No contract were found ..." message is not being thrown by Slither
contract Dummy
{
}

@ -0,0 +1,13 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
enum EnumTopLevel
{
__
}
// dummy contract, so that "No contract were found ..." message is not being thrown by Slither
contract Dummy
{
}

@ -0,0 +1,9 @@
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.16;
import "./EnumTopLevel.sol";
contract EnumTopLevelUsedInContractTest
{
uint private v = uint(EnumTopLevel.__);
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save