From 4a241c586818adddc6d93f998c1499e76838fb9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?LUKE=E2=84=A2?= Date: Tue, 1 Aug 2023 12:39:29 +1000 Subject: [PATCH 01/45] Write file on each save --- .gitignore | 5 ++++- slither/core/slither_core.py | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4441c03d18..a895c22ee1 100644 --- a/.gitignore +++ b/.gitignore @@ -114,4 +114,7 @@ test_artifacts/ crytic-export/ # Auto-generated Github pages docs -docs/ \ No newline at end of file +docs/ + +# slither.db.json +slither.db.json diff --git a/slither/core/slither_core.py b/slither/core/slither_core.py index 798008707f..3304d52bd5 100644 --- a/slither/core/slither_core.py +++ b/slither/core/slither_core.py @@ -466,6 +466,7 @@ def write_results_to_hide(self) -> None: def save_results_to_hide(self, results: List[Dict]) -> None: self._results_to_hide += results + self.write_results_to_hide() def add_path_to_filter(self, path: str): """ From e38966c5f75ec8dbc8ba6a56585483275101c329 Mon Sep 17 00:00:00 2001 From: "Khang Vo (doublevkay)" Date: Wed, 25 Oct 2023 16:54:24 +0700 Subject: [PATCH 02/45] detect reinitializer in unprotected_upgrade detector --- .../statements/unprotected_upgradeable.py | 12 ++++- tests/e2e/compilation/test_resolution.py | 6 +-- ...gradeable_0_4_25_AnyInitializer_sol__0.txt | 1 + ...pgradeable_0_4_25_Reinitializer_sol__0.txt | 1 + ...gradeable_0_5_16_AnyInitializer_sol__0.txt | 1 + ...pgradeable_0_5_16_Reinitializer_sol__0.txt | 1 + ...gradeable_0_6_11_AnyInitializer_sol__0.txt | 1 + ...pgradeable_0_6_11_Reinitializer_sol__0.txt | 1 + ...pgradeable_0_7_6_AnyInitializer_sol__0.txt | 1 + ...Upgradeable_0_7_6_Reinitializer_sol__0.txt | 1 + ...gradeable_0_8_15_AnyInitializer_sol__0.txt | 1 + ...pgradeable_0_8_15_Reinitializer_sol__0.txt | 1 + .../0.4.25/AnyInitializer.sol | 15 ++++++ .../0.4.25/AnyInitializer.sol-0.4.25.zip | Bin 0 -> 2867 bytes .../0.4.25/Initializable.sol | 14 +++-- .../0.4.25/Reinitializer.sol | 15 ++++++ .../0.4.25/Reinitializer.sol-0.4.25.zip | Bin 0 -> 2874 bytes .../0.5.16/AnyInitializer.sol | 15 ++++++ .../0.5.16/AnyInitializer.sol-0.5.16.zip | Bin 0 -> 2968 bytes .../0.5.16/Initializable.sol | 14 +++-- .../0.5.16/Reinitializer.sol | 15 ++++++ .../0.5.16/Reinitializer.sol-0.5.16.zip | Bin 0 -> 2977 bytes .../0.6.11/AnyInitializer.sol | 15 ++++++ .../0.6.11/AnyInitializer.sol-0.6.11.zip | Bin 0 -> 3699 bytes .../0.6.11/Initializable.sol | 14 +++-- .../0.6.11/Reinitializer.sol | 15 ++++++ .../0.6.11/Reinitializer.sol-0.6.11.zip | Bin 0 -> 3721 bytes .../0.7.6/AnyInitializer.sol | 15 ++++++ .../0.7.6/AnyInitializer.sol-0.7.6.zip | Bin 0 -> 3594 bytes .../0.7.6/Initializable.sol | 8 ++- .../0.7.6/Reinitializer.sol | 15 ++++++ .../0.7.6/Reinitializer.sol-0.7.6.zip | Bin 0 -> 3622 bytes .../0.8.15/AnyInitializer.sol | 15 ++++++ .../0.8.15/AnyInitializer.sol-0.8.15.zip | Bin 0 -> 3666 bytes .../0.8.15/Initializable.sol | 6 ++- .../0.8.15/Reinitializer.sol | 15 ++++++ .../0.8.15/Reinitializer.sol-0.8.15.zip | Bin 0 -> 3691 bytes tests/e2e/detectors/test_detectors.py | 50 ++++++++++++++++++ 38 files changed, 262 insertions(+), 22 deletions(-) create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_4_25_AnyInitializer_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_4_25_Reinitializer_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_5_16_AnyInitializer_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_5_16_Reinitializer_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_6_11_AnyInitializer_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_6_11_Reinitializer_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_7_6_AnyInitializer_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_7_6_Reinitializer_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_8_15_AnyInitializer_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_8_15_Reinitializer_sol__0.txt create mode 100644 tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/AnyInitializer.sol create mode 100644 tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/AnyInitializer.sol-0.4.25.zip create mode 100644 tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/Reinitializer.sol create mode 100644 tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/Reinitializer.sol-0.4.25.zip create mode 100644 tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/AnyInitializer.sol create mode 100644 tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/AnyInitializer.sol-0.5.16.zip create mode 100644 tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/Reinitializer.sol create mode 100644 tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/Reinitializer.sol-0.5.16.zip create mode 100644 tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/AnyInitializer.sol create mode 100644 tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/AnyInitializer.sol-0.6.11.zip create mode 100644 tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/Reinitializer.sol create mode 100644 tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/Reinitializer.sol-0.6.11.zip create mode 100644 tests/e2e/detectors/test_data/unprotected-upgrade/0.7.6/AnyInitializer.sol create mode 100644 tests/e2e/detectors/test_data/unprotected-upgrade/0.7.6/AnyInitializer.sol-0.7.6.zip create mode 100644 tests/e2e/detectors/test_data/unprotected-upgrade/0.7.6/Reinitializer.sol create mode 100644 tests/e2e/detectors/test_data/unprotected-upgrade/0.7.6/Reinitializer.sol-0.7.6.zip create mode 100644 tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/AnyInitializer.sol create mode 100644 tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/AnyInitializer.sol-0.8.15.zip create mode 100644 tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/Reinitializer.sol create mode 100644 tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/Reinitializer.sol-0.8.15.zip diff --git a/slither/detectors/statements/unprotected_upgradeable.py b/slither/detectors/statements/unprotected_upgradeable.py index 30e6300f17..b032114232 100644 --- a/slither/detectors/statements/unprotected_upgradeable.py +++ b/slither/detectors/statements/unprotected_upgradeable.py @@ -50,9 +50,19 @@ def _whitelisted_modifiers(f: Function) -> bool: return "onlyProxy" not in [modifier.name for modifier in f.modifiers] +import re + + def _initialize_functions(contract: Contract) -> List[Function]: return list( - filter(_whitelisted_modifiers, [f for f in contract.functions if f.name == "initialize"]) + filter( + _whitelisted_modifiers, + [ + f + for f in contract.functions + if any((m.name in ["initializer", "reinitializer"]) for m in f.modifiers) + ], + ) ) diff --git a/tests/e2e/compilation/test_resolution.py b/tests/e2e/compilation/test_resolution.py index af7cbe2c77..c3290624be 100644 --- a/tests/e2e/compilation/test_resolution.py +++ b/tests/e2e/compilation/test_resolution.py @@ -57,6 +57,6 @@ def test_contract_function_parameter(solc_binary_path) -> None: function = contract.functions[0] parameters = function.parameters - assert (parameters[0].name == 'param1') - assert (parameters[1].name == '') - assert (parameters[2].name == 'param3') + assert parameters[0].name == "param1" + assert parameters[1].name == "" + assert parameters[2].name == "param3" diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_4_25_AnyInitializer_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_4_25_AnyInitializer_sol__0.txt new file mode 100644 index 0000000000..1ca788ced8 --- /dev/null +++ b/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_4_25_AnyInitializer_sol__0.txt @@ -0,0 +1 @@ +AnyInitializer (tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/AnyInitializer.sol#3-15) is an upgradeable contract that does not protect its initialize functions: AnyInitializer.anyName() (tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/AnyInitializer.sol#6-9). Anyone can delete the contract with: AnyInitializer.kill() (tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/AnyInitializer.sol#11-14) diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_4_25_Reinitializer_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_4_25_Reinitializer_sol__0.txt new file mode 100644 index 0000000000..79cc306fea --- /dev/null +++ b/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_4_25_Reinitializer_sol__0.txt @@ -0,0 +1 @@ +Reinitializer (tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/Reinitializer.sol#3-15) is an upgradeable contract that does not protect its initialize functions: Reinitializer.initialize() (tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/Reinitializer.sol#6-9). Anyone can delete the contract with: Reinitializer.kill() (tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/Reinitializer.sol#11-14) diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_5_16_AnyInitializer_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_5_16_AnyInitializer_sol__0.txt new file mode 100644 index 0000000000..36309ced37 --- /dev/null +++ b/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_5_16_AnyInitializer_sol__0.txt @@ -0,0 +1 @@ +AnyInitializer (tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/AnyInitializer.sol#3-15) is an upgradeable contract that does not protect its initialize functions: AnyInitializer.anyName() (tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/AnyInitializer.sol#6-9). Anyone can delete the contract with: AnyInitializer.kill() (tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/AnyInitializer.sol#11-14) diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_5_16_Reinitializer_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_5_16_Reinitializer_sol__0.txt new file mode 100644 index 0000000000..99eac307d9 --- /dev/null +++ b/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_5_16_Reinitializer_sol__0.txt @@ -0,0 +1 @@ +Reinitializer (tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/Reinitializer.sol#3-15) is an upgradeable contract that does not protect its initialize functions: Reinitializer.initialize() (tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/Reinitializer.sol#6-9). Anyone can delete the contract with: Reinitializer.kill() (tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/Reinitializer.sol#11-14) diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_6_11_AnyInitializer_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_6_11_AnyInitializer_sol__0.txt new file mode 100644 index 0000000000..dc9612b837 --- /dev/null +++ b/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_6_11_AnyInitializer_sol__0.txt @@ -0,0 +1 @@ +AnyInitializer (tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/AnyInitializer.sol#3-15) is an upgradeable contract that does not protect its initialize functions: AnyInitializer.anyName() (tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/AnyInitializer.sol#6-9). Anyone can delete the contract with: AnyInitializer.kill() (tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/AnyInitializer.sol#11-14) diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_6_11_Reinitializer_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_6_11_Reinitializer_sol__0.txt new file mode 100644 index 0000000000..2708424239 --- /dev/null +++ b/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_6_11_Reinitializer_sol__0.txt @@ -0,0 +1 @@ +Reinitializer (tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/Reinitializer.sol#3-15) is an upgradeable contract that does not protect its initialize functions: Reinitializer.initialize() (tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/Reinitializer.sol#6-9). Anyone can delete the contract with: Reinitializer.kill() (tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/Reinitializer.sol#11-14) diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_7_6_AnyInitializer_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_7_6_AnyInitializer_sol__0.txt new file mode 100644 index 0000000000..5a4ccf71af --- /dev/null +++ b/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_7_6_AnyInitializer_sol__0.txt @@ -0,0 +1 @@ +AnyInitializer (tests/e2e/detectors/test_data/unprotected-upgrade/0.7.6/AnyInitializer.sol#3-15) is an upgradeable contract that does not protect its initialize functions: AnyInitializer.anyName() (tests/e2e/detectors/test_data/unprotected-upgrade/0.7.6/AnyInitializer.sol#6-9). Anyone can delete the contract with: AnyInitializer.kill() (tests/e2e/detectors/test_data/unprotected-upgrade/0.7.6/AnyInitializer.sol#11-14) diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_7_6_Reinitializer_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_7_6_Reinitializer_sol__0.txt new file mode 100644 index 0000000000..f79c9c662d --- /dev/null +++ b/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_7_6_Reinitializer_sol__0.txt @@ -0,0 +1 @@ +Reinitializer (tests/e2e/detectors/test_data/unprotected-upgrade/0.7.6/Reinitializer.sol#3-15) is an upgradeable contract that does not protect its initialize functions: Reinitializer.initialize() (tests/e2e/detectors/test_data/unprotected-upgrade/0.7.6/Reinitializer.sol#6-9). Anyone can delete the contract with: Reinitializer.kill() (tests/e2e/detectors/test_data/unprotected-upgrade/0.7.6/Reinitializer.sol#11-14) diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_8_15_AnyInitializer_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_8_15_AnyInitializer_sol__0.txt new file mode 100644 index 0000000000..fb08aab174 --- /dev/null +++ b/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_8_15_AnyInitializer_sol__0.txt @@ -0,0 +1 @@ +AnyInitializer (tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/AnyInitializer.sol#3-15) is an upgradeable contract that does not protect its initialize functions: AnyInitializer.anyName() (tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/AnyInitializer.sol#6-9). Anyone can delete the contract with: AnyInitializer.kill() (tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/AnyInitializer.sol#11-14) diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_8_15_Reinitializer_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_8_15_Reinitializer_sol__0.txt new file mode 100644 index 0000000000..2eb7d5feea --- /dev/null +++ b/tests/e2e/detectors/snapshots/detectors__detector_UnprotectedUpgradeable_0_8_15_Reinitializer_sol__0.txt @@ -0,0 +1 @@ +Reinitializer (tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/Reinitializer.sol#3-15) is an upgradeable contract that does not protect its initialize functions: Reinitializer.initialize() (tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/Reinitializer.sol#6-9). Anyone can delete the contract with: Reinitializer.kill() (tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/Reinitializer.sol#11-14) diff --git a/tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/AnyInitializer.sol b/tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/AnyInitializer.sol new file mode 100644 index 0000000000..9ad63bcdf1 --- /dev/null +++ b/tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/AnyInitializer.sol @@ -0,0 +1,15 @@ +import "./Initializable.sol"; + +contract AnyInitializer is Initializable { + address owner; + + function anyName() external initializer { + require(owner == address(0)); + owner = msg.sender; + } + + function kill() external { + require(msg.sender == owner); + selfdestruct(owner); + } +} diff --git a/tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/AnyInitializer.sol-0.4.25.zip b/tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/AnyInitializer.sol-0.4.25.zip new file mode 100644 index 0000000000000000000000000000000000000000..143c2bc5247ad601d63a91458a6eab99667dacba GIT binary patch literal 2867 zcma);_dgU41IN$aDP=30uXWBIAt%JSaA#$cdC1{x5@&=mvz;xQ>=AJ`ncd+i4C)mu~+!9sAIc93QzuGw^ z|28|FDxr=hHKS*oFSJ~x8K=J&UGZ9t;o;F&1}WVE&1ZV0K}5H(tKm+6(V&HJ?kv<% z#b*Zh0JIuE>`C;k=gYGW=kkit#Tdx0E-2#uw;DqQDTNkS%12DZwe!An5!=UGo%%6- zLV;|(g(tU96GVD$T+SkOK>1GM{HJ84rS)p8sT-95-;ZxQuC}_jd|{2Eh(Auz_Py25 z#tp5PTVnf-C#eZgC+^)9D`;tJdWyiyFDaSo(9C46x*gs&rQcwGwuS=+$L$Ncu;Jp5 zUk+S<5vb{lz8j>!_t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zaOq!i1X ztp79sRB9_*{8U9>KHQ&O++kH710`FI=r`-So*|Mz$jB#cB4_I&&!KL%#b#7}dlrgCTxDaOts_T&M+W4UaM5A_KzLzaU^<899@mWS2B*Mo<+3VPFDBWL4MUn18 zS0!bb3f@MI8pJNR+=}tQvS%5MK7pW;Ank$_N&h-qC>A!5*C`E6p-PDEUt4uid=3L< z;hg@0NZ%C%MkN9-3@NkpOZ%f5y%5?@3N3Lm`+k16YfkxEJmXB1=~3o%L(+VJYX3L zUKu&knWA*!c%fXrIU420qtcH5QI!!N#QDOoiKi~v&jdnH@+C_0f?x0X={H#SIxb^6 zFV@Ni*UJXAiK=}mt5vm=szq#t*voV5ck(`dZGkmRyUWQQeY()~<8TC#wSW0}6ZGT# z7iI_WEFpW+=}F+mGSVDKrwjVuzWk3e|2HwffARm>Gt!&^{O=q1Pp$u<9LvA!KamNS AU;qFB literal 0 HcmV?d00001 diff --git a/tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/Initializable.sol b/tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/Initializable.sol index 779a0e87c9..c19577db34 100644 --- a/tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/Initializable.sol +++ b/tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/Initializable.sol @@ -1,5 +1,9 @@ -contract Initializable{ - modifier initializer() { - _; - } -} \ No newline at end of file +contract Initializable { + modifier initializer() { + _; + } + + modifier reinitializer(uint64 version) { + _; + } +} diff --git a/tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/Reinitializer.sol b/tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/Reinitializer.sol new file mode 100644 index 0000000000..cdf587c494 --- /dev/null +++ b/tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/Reinitializer.sol @@ -0,0 +1,15 @@ +import "./Initializable.sol"; + +contract Reinitializer is Initializable { + address payable owner; + + function initialize() external reinitializer(2) { + require(owner == address(0)); + owner = msg.sender; + } + + function kill() external { + require(msg.sender == owner); + selfdestruct(owner); + } +} diff --git a/tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/Reinitializer.sol-0.5.16.zip b/tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/Reinitializer.sol-0.5.16.zip new file mode 100644 index 0000000000000000000000000000000000000000..0f8b1e98475645e063a808c52ce50582aaf1252b GIT binary patch literal 2977 zcma);=QkUS0>)#LzV@D>FuA|(UZ001EXfJ#h^v-GvJSMJ0} zy%Kd+k2^x3jVChRm_rqWN42m>{qhG2ftry42Uu~?7C$Xm0`D@Y*)6`c%6}1>WR5D) zh)nfk<5xuS@-4>#udzt<`4auyu@P~afK43~v#IN5*m$m?%q`O>|sUNtm zYQw%kzL*{}6(>S4W3m@;)v1SA#7J4)Td=C_I&CLyo`IYp&Tsw8&#^u-PYN-+Mtz)z=YeseVPbjFfBVXR<}w*wBa(yAlh6qX3$0 zqvXq2c{UJ98ooXF;-<+U)%5M%M%TtCn!O%}ad9fAUSIUVw>DPFTCvAG6zD`gBc&X+A^ zDq4Fr%U3?3UKYcpa0ly9KRWA)A3A1Izp6JDPCiQFURdtsd_oy{jVhJX3bUG4|0K^l z($%Is^-<8vvG1Gpq3n{YI;cz;L0R(Yc4-@2|2j7~9;FDco>!PAncNmiHs8H1=or+= zu=nH5j8c?&sDmvcuA0^=XCj~yaFaVCAmrYC{+uaXYR^O(SV!t{UahOGR4qIn-_=P7 zbD*{tuv~l87bH(B1wR-!Y-@hqD4ym^1{J??)e^4!&@5)K9_gdLviSmrZj?pL-;Tbx z@Sxn$nK#5hckq%5o{v2V$c12$g+LW@+R-cd87vzpeQ~kk82e;1_V;m|l~g)BI8E41 zodw3Vti4(z8F6<$X8am~J{_9I%5v_pS{0ef7MPW9`qe$cLFhO&|^*;Jo2lsX^>=c?_KJJQnJM zq?O#8XsOc3Dllh|)8DPVYFd%J(sdV!D9FdnP%qB~Jmwl#JD^RDyX&+&#sryj-M%+@ z28}rw?2=2uvTFwmLfA_qoR;fbE~B`$gY(~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 HcmV?d00001 diff --git a/tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/AnyInitializer.sol b/tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/AnyInitializer.sol new file mode 100644 index 0000000000..bccbbc3ea2 --- /dev/null +++ b/tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/AnyInitializer.sol @@ -0,0 +1,15 @@ +import "./Initializable.sol"; + +contract AnyInitializer is Initializable { + address payable owner; + + function anyName() external initializer { + require(owner == address(0)); + owner = payable(msg.sender); + } + + function kill() external { + require(msg.sender == owner); + selfdestruct(owner); + } +} diff --git a/tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/AnyInitializer.sol-0.6.11.zip b/tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/AnyInitializer.sol-0.6.11.zip new file mode 100644 index 0000000000000000000000000000000000000000..b2608ec1993449eb8e96275638a14b255a68b36b GIT binary patch literal 3699 zcma)_Wp3IJjN4Im)W%!F&A0NHmJ006oG00IC2K*=Kz z;oFEI^B?DLj0O0_D917(Ky@q;~ zOpZ1`xm(cZ;mqI38Iz>XD$g~CY-f@@38EC_YI6%d$c1oifob`~=Uj$VzCpHD!50x} zCdlfiF$meoL*{AC&Cp7q zK6_ATZDw**=AqUz0W!o#e13xEkT&LfSyJG$(13cUl?r{EYY1DLJ#jl9**)9PD@3|cD(s;@F=opIe+7I0La#A;X zX{=m7_S}H%O5n$hZTpTL`^6LjZgHD_L*g6wg3L(jU6@d}8P1*~wYO6?!2A5xhB8GF zEXRHV`!=#?$#@c0Y;OZe(PaAxdZ%I<`PNbROIG8s?-#U)zLeC7B0tK%=~glkh* zr7Avw9#rPR@X+^#%r4mYRN{A-cH#r};XU6M6BHd+B0M&1TQ12ue7j%+h{}~zF0Yni zN4mActBBC~dRk~IH0GKttGy0nX=6ZUGub0f&*`5|KCS5XZQ}`UNBrE?Y+$~Vs6^tj znc6we?o~oOudl}XjOkaoT}qief`K1@9VW7iAF|w3!E;~RYtv2X@lJV@9$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.11/Initializable.sol b/tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/Initializable.sol index 779a0e87c9..c19577db34 100644 --- a/tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/Initializable.sol +++ b/tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/Initializable.sol @@ -1,5 +1,9 @@ -contract Initializable{ - modifier initializer() { - _; - } -} \ No newline at end of file +contract Initializable { + modifier initializer() { + _; + } + + modifier reinitializer(uint64 version) { + _; + } +} diff --git a/tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/Reinitializer.sol b/tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/Reinitializer.sol new file mode 100644 index 0000000000..d8a81a4cea --- /dev/null +++ b/tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/Reinitializer.sol @@ -0,0 +1,15 @@ +import "./Initializable.sol"; + +contract Reinitializer is Initializable { + address payable owner; + + function initialize() external reinitializer(2) { + require(owner == address(0)); + owner = payable(msg.sender); + } + + function kill() external { + require(msg.sender == owner); + selfdestruct(owner); + } +} diff --git a/tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/Reinitializer.sol-0.6.11.zip b/tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/Reinitializer.sol-0.6.11.zip new file mode 100644 index 0000000000000000000000000000000000000000..a74cdfdf4d8b6b88d23c6ea9f1deca66155804f1 GIT binary patch literal 3721 zcma)<=QkS+pvDua5wj?@YLr+pswiqptWv9~z14`3Aa?EX3Z-a_8ZB+r9;LNft5%KL zVpoh(E0kIlMw;sdpo#>_@ey-9Gv`JJdi=IQl1zz3Ve+cUm6`HV4goPp~!*QebNs4rSD_hass=(E@j7O$VhC(m$4kv%vcC0U*AaiduOFyAmp6BY9G+9#JNih&06}&Q>N)Eb63QHU241w z*NOg6?JDF1>$Iuk{H6Yg_>%IB#7QH(^^B^oMN}n=Q(om(m=j`4V{H+J9r|%NYeLje z#0A&6OUiz3HWKI^0EiZY^vZ@V+S9>LM{(rbk*zt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-5 zL~3EtCUSY_tHk`YhRe$`zkKpd;u1uH4H)IO@X4nZvFj03w5r<5>@SHwOegoU#%eUAbI*cSgqikZU`zF-(!1jw(OIPm{`qkHNtZy1;wUte#>#2VFe#m7A>B9n5 zWD+3NLutD^zVA_{L3mw5uZzA&fRNLJtX}D}X#PSGADg+U5w*0U++%3#|yo|y^N(grbou2 z81?HK8!$l9E~?;MwvS^WCESwtOvdDc0;@n0Kh;u1b?8*h)lv<1$fAS}ixHy)V$h6) z=7i4D_vc5&DD805hLlKaK1G_; z{>ii6PYf|b1p&HgqDV+epc$>khB)q1zH2VwB)D`3n2fx%ab60#b8sKiTuxg9B^(B$ z_*KGmgpy1#-5Cc(tCJ^}GR-FYEBeVbnvzyKS9E{U&}3b6k5c2x0Sn}EHKuQn%tcjw z=IKPw#uTdtyUB4DPe7M1973&?`jg}{ay%p#29YkFt#6B3j8Bbm9X*rRCi_+n`OP2JKQhdhZ5Jh| zJ|$1rBY|^GT>3aoz7d4*)%z?En(=cpJ#M~unf`&akS?>A=hdYgpzxbpux5=w%*15F zFo|w9YSt9<_p&}p$)MIE^*5-Ik1L{axX^1a!HA&YUTHBIq{3qEJOJWInEoJ}kA7pa z?h)y*z5Tu zHz&8Ry(tI=TTldaj%iuilB?Vncx$j5&txqs_hryA+zhTcalE(Aw`_0g6p7QNV6zW0 zyOlY_pys7qFrw*3dGa;6XqI<-yvZYykQgsuL=;lWZ!ERyGHZV8ySGgVcptj=_!b|tlD=MDZ5#X%e-n=~F#}#)P*DCd zo+}OTRrIv9@b$u~4aMjz9#X=)MO$ds`Xd(+MI0cjf)L;LE_Q1{OC1kimf*kZ+dqT* e{{-Uw2mh1IX{i$t|7VQ%ue$&E^`8v_0RIOl0rs*0 literal 0 HcmV?d00001 diff --git a/tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/AnyInitializer.sol b/tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/AnyInitializer.sol new file mode 100644 index 0000000000..bccbbc3ea2 --- /dev/null +++ b/tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/AnyInitializer.sol @@ -0,0 +1,15 @@ +import "./Initializable.sol"; + +contract AnyInitializer is Initializable { + address payable owner; + + function anyName() external initializer { + require(owner == address(0)); + owner = payable(msg.sender); + } + + function kill() external { + require(msg.sender == owner); + selfdestruct(owner); + } +} diff --git a/tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/AnyInitializer.sol-0.8.15.zip b/tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/AnyInitializer.sol-0.8.15.zip new file mode 100644 index 0000000000000000000000000000000000000000..9da08b61b090ac06cfad5660e4b6d09d5ce3ebfa GIT binary patch literal 3666 zcma*q=Q|q=!v*jdMMccoiWW(1YE)}f)VOU`d(xPz~)kfWEI>wV&T0CNB!8~~6-BJIWSVjhJP zBlXgtydGBvo;G$wqArUZ$E;T?gXl>RIfSFxIruPJh+~_Zic5Ib5v$lOwEc_wA|l1m zt4slr8OX%_+>7(kS}Zv}+u8eUm1Y5_Lzu;5j#l#BQgzX8I#a|sHdj7Qr|7%TO@|U$ zypx3_5;sy>d;tb0$Z~0oJ=vMVlb`(+uneoGX0v2X>{t;S*}06`q;OLj@kiANtmU2<}j*5ul#6Bus)M*H+`XNVjfPc zVsO9qA1)4oQ*6|9>MIiO$?&2c;*D9*8Qv;PmGBVX{+J)cLEtA&RAG^z3HdLG>cNUmesrHk$-Sy?)1 zYMS}0D4k>1x4SDePj~2fXh*F;+z|LHV+#m@kLRQoUE8?3rm*$Z-A2xtKev2(37RQ5 z>Psif7JBYtnXhwuzg;yqI2gd0?=0b1;9;}ytTiSgv~46ggD46qLQNp-x93^4>ySaV& z#q^mj(ZB;TXcQHX9qI7%>etPisX2UAZNJ{W$dZpqZr?^t=PT-)%Cy;*H@?wF1hCOw z`DpwNEIa2FIGqy_=+x7wqJj5HZayIvP2yODRHV`=TWn)it1{G*hKZzH&a~e- z*lAV%0ndbwPS_>8;}vMkYo@wG4f*I>(%HT1@AURUjC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IMCk&;s`ux)HeerXa{hfxzaS8u?yj`2BY~# z02Xq9HRysQ?yZuUiGAdk9OpZ_S$p2RO8fiHWSyP{RtE^YVogTG0hx7P<@?S#hnV9= zRlw4PbkMkA^y8`!G@7OgMEBd&dhVaM;uF*mo9QCt_HsSU;Q_$qt`#0%{zjxoHu zIL3H>k*1l!ub@@!`X)HDi96pDu)9GVtq~t8hBxY$iUI z><y&Xxv**&be9Bdxbn_GCg@Xx#zr?WNZlmeNkm$OOJ1ql|Mfsz}km}B1 z>$Bg+()-dn28@wQ+z6>kx*D5J6@`ldyHYxtG_wuJG2PeFze1%`w^l+9PTOmC%CqWy7?G(hC0;yeWb}3K~FVPiDe_Flx zc=xYwPR{kA3o*4qEdo!3h(h~9hNs{n$^lJ^ss=1BN>EP+YXt#}p}Q-0!=i9xap2BB ze|qXGrC*nOD)EVX42V=_(v}C6TMJioOgDE&hzw;fuvdmWM$KKPd{x?)dUpnXebO!? zr2uh)sA_cwk3T=QRE}a?>siVgq#U*r<_v!oBN58nX0{hMYSc~8apwa1$XO-NzlV{p zH4;o3RuE&3=`?gp4FM-0eSPOdd+){IxZ0Y3A3$EY`>wf-y8pHwopx$1WM3SIky85jIHzO>Kl?w z@`!%In`I~>&meM@d5gQG&aX(tkC33ED#I_1UAG}>!O^hGnCm-5m{JrIaWkc=gL~u4 zE`22?oL~bujlHB7vOhvFM1SA7GMvDhN!jVPO+Z&ioq+HK(SMiTzu5c#gcJN{{x|pO VsNW;`&zs=i>ixUh|H=^n_&--P_3Quu literal 0 HcmV?d00001 diff --git a/tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/Initializable.sol b/tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/Initializable.sol index 4fd7561c84..a095b72274 100644 --- a/tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/Initializable.sol +++ b/tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/Initializable.sol @@ -6,10 +6,14 @@ contract Initializable { _; } + modifier reinitializer(uint64 version) { + _; + } + function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; } } -} \ No newline at end of file +} diff --git a/tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/Reinitializer.sol b/tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/Reinitializer.sol new file mode 100644 index 0000000000..d8a81a4cea --- /dev/null +++ b/tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/Reinitializer.sol @@ -0,0 +1,15 @@ +import "./Initializable.sol"; + +contract Reinitializer is Initializable { + address payable owner; + + function initialize() external reinitializer(2) { + require(owner == address(0)); + owner = payable(msg.sender); + } + + function kill() external { + require(msg.sender == owner); + selfdestruct(owner); + } +} diff --git a/tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/Reinitializer.sol-0.8.15.zip b/tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/Reinitializer.sol-0.8.15.zip new file mode 100644 index 0000000000000000000000000000000000000000..e58f71c44bf6463efc884abc9f72584f15f2e395 GIT binary patch literal 3691 zcma)<=QkUU0)}JnRchAWl&Vpx)QC~kR>a=Kh`mW|8nri3qi7I{+M}^oYwubyYt~*R z+~4nhzvtZd{qUUkocAAibTn{q3G$Y__?<_1Lu02JE+0NeloK+hfw0sDZh zUBN;2Uc%n)u9o%z9`0T~meyXjPGCQKVP|i52oWwGz#ISw0{~>>;vB{9#5{{8M;l*} z!TTU!ZWK#&f*#{*);aGE+UIA%#JsF+t|5PNgjsjEC^(u2TIv(ZSB*Hm_Iq`>p1t-EygP;@nm(IrM#Wd8aI6n+o{- z>7k=F6j#NKGJtC%```h;Ct?NvskJ!-l_an>U=k2pI#V7)7d^P1U|O$}(kjwZPN{x* zrDe8`BXKjF(aZepWb~Y5_w`C=RMOIqXkff-;}kc?(4%2vLmpfcKi$%Crbmg0?sZnA zhV!oK`=nMlm$mg>?pRW~^--Z_dXD7!aWm1(q&e_Pnv`2~W8> zW!PS10IlUHnztZucSt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;#9v7aj))TA zd-jf3YU|1q=F!vb&LbD2x+8e|)G(VW40VT-c)Z6vF7PK|gNSb{C8$CpJsB!BTsL1Q zm`Ss??zWq~-}?AQ2TqtZnD3*0fEe$J8x5Faa(*F3?LU)ZeQFNaMr{g{Kq8YGEc+hL s3Ez(BXkcN>;rwq0{6_=-n=q_@@qZbijs_n7zh|s}s{aqM$^Tvd0lrZlAOHXW literal 0 HcmV?d00001 diff --git a/tests/e2e/detectors/test_detectors.py b/tests/e2e/detectors/test_detectors.py index 28dcc5e755..a3dc933a34 100644 --- a/tests/e2e/detectors/test_detectors.py +++ b/tests/e2e/detectors/test_detectors.py @@ -938,6 +938,16 @@ def id_test(test_item: Test): "whitelisted.sol", "0.4.25", ), + Test( + all_detectors.UnprotectedUpgradeable, + "Reinitializer.sol", + "0.4.25", + ), + Test( + all_detectors.UnprotectedUpgradeable, + "AnyInitializer.sol", + "0.4.25", + ), Test( all_detectors.UnprotectedUpgradeable, "Buggy.sol", @@ -953,6 +963,16 @@ def id_test(test_item: Test): "whitelisted.sol", "0.5.16", ), + Test( + all_detectors.UnprotectedUpgradeable, + "Reinitializer.sol", + "0.5.16", + ), + Test( + all_detectors.UnprotectedUpgradeable, + "AnyInitializer.sol", + "0.5.16", + ), Test( all_detectors.UnprotectedUpgradeable, "Buggy.sol", @@ -968,6 +988,16 @@ def id_test(test_item: Test): "whitelisted.sol", "0.6.11", ), + Test( + all_detectors.UnprotectedUpgradeable, + "Reinitializer.sol", + "0.6.11", + ), + Test( + all_detectors.UnprotectedUpgradeable, + "AnyInitializer.sol", + "0.6.11", + ), Test( all_detectors.UnprotectedUpgradeable, "Buggy.sol", @@ -978,6 +1008,16 @@ def id_test(test_item: Test): "Fixed.sol", "0.7.6", ), + Test( + all_detectors.UnprotectedUpgradeable, + "Reinitializer.sol", + "0.7.6", + ), + Test( + all_detectors.UnprotectedUpgradeable, + "AnyInitializer.sol", + "0.7.6", + ), Test( all_detectors.UnprotectedUpgradeable, "whitelisted.sol", @@ -998,6 +1038,16 @@ def id_test(test_item: Test): "whitelisted.sol", "0.8.15", ), + Test( + all_detectors.UnprotectedUpgradeable, + "Reinitializer.sol", + "0.8.15", + ), + Test( + all_detectors.UnprotectedUpgradeable, + "AnyInitializer.sol", + "0.8.15", + ), Test( all_detectors.ABIEncoderV2Array, "storage_ABIEncoderV2_array.sol", From 314ceeb3c28b84a955e1dc010342c328ed5162e7 Mon Sep 17 00:00:00 2001 From: "Khang Vo (doublevkay)" Date: Thu, 26 Oct 2023 16:47:13 +0700 Subject: [PATCH 03/45] remove ambiguous relation between _is_upgradeable and _is_upgradeable_proxy --- slither/core/declarations/contract.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/slither/core/declarations/contract.py b/slither/core/declarations/contract.py index 458f951f56..359658cbd6 100644 --- a/slither/core/declarations/contract.py +++ b/slither/core/declarations/contract.py @@ -1337,8 +1337,6 @@ def update_read_write_using_ssa(self) -> None: def is_upgradeable(self) -> bool: if self._is_upgradeable is None: self._is_upgradeable = False - if self.is_upgradeable_proxy: - return False initializable = self.file_scope.get_contract_from_name("Initializable") if initializable: if initializable in self.inheritance: From 2b81c02c612929c26bded0b32f87fde7d05ea040 Mon Sep 17 00:00:00 2001 From: "Khang Vo (doublevkay)" Date: Mon, 30 Oct 2023 12:08:20 +0700 Subject: [PATCH 04/45] make lint --- slither/detectors/statements/unprotected_upgradeable.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/slither/detectors/statements/unprotected_upgradeable.py b/slither/detectors/statements/unprotected_upgradeable.py index b032114232..59f27fc580 100644 --- a/slither/detectors/statements/unprotected_upgradeable.py +++ b/slither/detectors/statements/unprotected_upgradeable.py @@ -49,10 +49,6 @@ def _whitelisted_modifiers(f: Function) -> bool: # https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/3dec82093ea4a490d63aab3e925fed4f692909e8/contracts/proxy/utils/UUPSUpgradeable.sol#L38-L42 return "onlyProxy" not in [modifier.name for modifier in f.modifiers] - -import re - - def _initialize_functions(contract: Contract) -> List[Function]: return list( filter( From ca851e2d079fb601826e3ad09458cb00af9b64e3 Mon Sep 17 00:00:00 2001 From: "Khang Vo (doublevkay)" Date: Mon, 30 Oct 2023 12:08:50 +0700 Subject: [PATCH 05/45] make lint --- slither/detectors/statements/unprotected_upgradeable.py | 1 + 1 file changed, 1 insertion(+) diff --git a/slither/detectors/statements/unprotected_upgradeable.py b/slither/detectors/statements/unprotected_upgradeable.py index 59f27fc580..d25aff187d 100644 --- a/slither/detectors/statements/unprotected_upgradeable.py +++ b/slither/detectors/statements/unprotected_upgradeable.py @@ -49,6 +49,7 @@ def _whitelisted_modifiers(f: Function) -> bool: # https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/3dec82093ea4a490d63aab3e925fed4f692909e8/contracts/proxy/utils/UUPSUpgradeable.sol#L38-L42 return "onlyProxy" not in [modifier.name for modifier in f.modifiers] + def _initialize_functions(contract: Contract) -> List[Function]: return list( filter( From eba14c9fae7f1ef801c873c99976b69d94c89080 Mon Sep 17 00:00:00 2001 From: Feist Josselin Date: Tue, 2 Jan 2024 18:14:29 +0100 Subject: [PATCH 06/45] Add more academic references --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 0f548d6b88..51eed6ff48 100644 --- a/README.md +++ b/README.md @@ -300,5 +300,12 @@ Title | Usage | Authors | Venue | Code [Do Not Rug on Me: Leveraging Machine Learning Techniques for Automated Scam Detection](https://www.mdpi.com/2227-7390/10/6/949) | Use Slither to extract tokens' features (mintable, pausable, ..) | Mazorra, Bruno, Victor Adan, and Vanesa Daza | Mathematics 10.6 (2022) [MANDO: Multi-Level Heterogeneous Graph Embeddings for Fine-Grained Detection of Smart Contract Vulnerabilities](https://arxiv.org/abs/2208.13252) | Use Slither to extract the CFG and call graph | Hoang Nguyen, Nhat-Minh Nguyen, Chunyao Xie, Zahra Ahmadi, Daniel Kudendo, Thanh-Nam Doan and Lingxiao Jiang| IEEE 9th International Conference on Data Science and Advanced Analytics (DSAA, 2022) | [ge-sc](https://github.com/MANDO-Project/ge-sc) [Automated Auditing of Price Gouging TOD Vulnerabilities in Smart Contracts](https://www.cs.toronto.edu/~fanl/papers/price-icbc22.pdf) | Use Slither to extract the CFG and data dependencies| Sidi Mohamed Beillahi, Eric Keilty, Keerthi Nelaturu, Andreas Veneris, and Fan Long | 2022 IEEE International Conference on Blockchain and Cryptocurrency (ICBC) | [Smart-Contract-Repair](https://github.com/Veneris-Group/TOD-Location-Rectification) +[Modeling and Enforcing Access Control Policies for Smart Contracts](https://publikationen.bibliothek.kit.edu/1000152805/151859658) | Extend Slither's data dependencies | Jan-Philipp Toberg, Jonas Schiffl, Frederik Reiche, Bernhard Beckert, Robert Heinrich, Ralf Reussner | IEEE International Conference on Decentralized Applications and Infrastructures (DAPPS), 2022 | [SolidityAccessControlEnforcement](https://github.com/KASTEL-CSSDA/SolidityAccessControlEnforcement) +[Smart Contract Vulnerability Detection Based on Deep Learning and Multimodal Decision Fusion](https://www.mdpi.com/1424-8220/23/16/7246) | Use Slither to extract the CFG | Weichu Deng, Huanchun Wei, Teng Huang, Cong Cao, Yun Peng, and Xuan Hu | Sensors 2023, 23, 7246 | +[Semantic-enriched Code Knowledge Graph to Reveal Unknowns in Smart Contract Code Reuse](https://www.researchgate.net/profile/Qing-Huang-26/publication/370638129_Semantic-enriched_Code_Knowledge_Graph_to_Reveal_Unknowns_in_Smart_Contract_Code_Reuse/links/645b7b8639c408339b3a54da/Semantic-Enriched-Code-Knowledge-Graph-to-Reveal-Unknowns-in-Smart-Contract-Code-Reuse.pdf) | Use Slither to extract the code features (CFG, function, parameters types, ..) | Qing Huang, Dianshu Liao, Zhenchang Xing, Zhengkang Zuo, Changjing Wang, Xin Xia | ACM Transactions on Software Engineering and Methodology, 2023 | +[Smart Contract Parallel Execution with Fine-Grained State Accesses](https://personal.ntu.edu.sg/yi_li/files/Qi2023SCP.pdf) | Use Slither to build state access graphs | Xiaodong Qi, Jiao Jiao, Yi Li | International Conference on Distributed Computing Systems (ICDCS), 2023 | +[Bad Apples: Understanding the Centralized Security Risks in Decentralized Ecosystems](https://diaowenrui.github.io/paper/www23-yan.pdf) | Implement an internal analysis on top of Slither | Kailun Yan , Jilian Zhang , Xiangyu Liu , Wenrui Diao , Shanqing Guo | ACM Web Conference April 2023 | +[Identifying Vulnerabilities in Smart Contracts using Interval Analysis](https://arxiv.org/pdf/2309.13805.pdf) | Create 4 detectors on top of Slither | Ştefan-Claudiu Susan, Andrei Arusoaie | FROM 2023 | +Storage State Analysis and Extraction of Ethereum Blockchain Smart Contracts (no pdf in open access) | Rely on Slither's CFG and AST | Maha Ayub , Tania Saleem , Muhammad Janjua , Talha Ahmad | TOSEM 2023 | [SmartMuv](https://github.com/WaizKhan7/SmartMuv) If you are using Slither on an academic work, consider applying to the [Crytic $10k Research Prize](https://blog.trailofbits.com/2019/11/13/announcing-the-crytic-10k-research-prize/). From d54728c62258fae3c861b2ebee9dce7bb9d0c9fa Mon Sep 17 00:00:00 2001 From: Feist Josselin Date: Wed, 13 Mar 2024 12:03:54 +0100 Subject: [PATCH 07/45] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 51eed6ff48..85d794e192 100644 --- a/README.md +++ b/README.md @@ -301,11 +301,11 @@ Title | Usage | Authors | Venue | Code [MANDO: Multi-Level Heterogeneous Graph Embeddings for Fine-Grained Detection of Smart Contract Vulnerabilities](https://arxiv.org/abs/2208.13252) | Use Slither to extract the CFG and call graph | Hoang Nguyen, Nhat-Minh Nguyen, Chunyao Xie, Zahra Ahmadi, Daniel Kudendo, Thanh-Nam Doan and Lingxiao Jiang| IEEE 9th International Conference on Data Science and Advanced Analytics (DSAA, 2022) | [ge-sc](https://github.com/MANDO-Project/ge-sc) [Automated Auditing of Price Gouging TOD Vulnerabilities in Smart Contracts](https://www.cs.toronto.edu/~fanl/papers/price-icbc22.pdf) | Use Slither to extract the CFG and data dependencies| Sidi Mohamed Beillahi, Eric Keilty, Keerthi Nelaturu, Andreas Veneris, and Fan Long | 2022 IEEE International Conference on Blockchain and Cryptocurrency (ICBC) | [Smart-Contract-Repair](https://github.com/Veneris-Group/TOD-Location-Rectification) [Modeling and Enforcing Access Control Policies for Smart Contracts](https://publikationen.bibliothek.kit.edu/1000152805/151859658) | Extend Slither's data dependencies | Jan-Philipp Toberg, Jonas Schiffl, Frederik Reiche, Bernhard Beckert, Robert Heinrich, Ralf Reussner | IEEE International Conference on Decentralized Applications and Infrastructures (DAPPS), 2022 | [SolidityAccessControlEnforcement](https://github.com/KASTEL-CSSDA/SolidityAccessControlEnforcement) -[Smart Contract Vulnerability Detection Based on Deep Learning and Multimodal Decision Fusion](https://www.mdpi.com/1424-8220/23/16/7246) | Use Slither to extract the CFG | Weichu Deng, Huanchun Wei, Teng Huang, Cong Cao, Yun Peng, and Xuan Hu | Sensors 2023, 23, 7246 | -[Semantic-enriched Code Knowledge Graph to Reveal Unknowns in Smart Contract Code Reuse](https://www.researchgate.net/profile/Qing-Huang-26/publication/370638129_Semantic-enriched_Code_Knowledge_Graph_to_Reveal_Unknowns_in_Smart_Contract_Code_Reuse/links/645b7b8639c408339b3a54da/Semantic-Enriched-Code-Knowledge-Graph-to-Reveal-Unknowns-in-Smart-Contract-Code-Reuse.pdf) | Use Slither to extract the code features (CFG, function, parameters types, ..) | Qing Huang, Dianshu Liao, Zhenchang Xing, Zhengkang Zuo, Changjing Wang, Xin Xia | ACM Transactions on Software Engineering and Methodology, 2023 | -[Smart Contract Parallel Execution with Fine-Grained State Accesses](https://personal.ntu.edu.sg/yi_li/files/Qi2023SCP.pdf) | Use Slither to build state access graphs | Xiaodong Qi, Jiao Jiao, Yi Li | International Conference on Distributed Computing Systems (ICDCS), 2023 | -[Bad Apples: Understanding the Centralized Security Risks in Decentralized Ecosystems](https://diaowenrui.github.io/paper/www23-yan.pdf) | Implement an internal analysis on top of Slither | Kailun Yan , Jilian Zhang , Xiangyu Liu , Wenrui Diao , Shanqing Guo | ACM Web Conference April 2023 | -[Identifying Vulnerabilities in Smart Contracts using Interval Analysis](https://arxiv.org/pdf/2309.13805.pdf) | Create 4 detectors on top of Slither | Ştefan-Claudiu Susan, Andrei Arusoaie | FROM 2023 | +[Smart Contract Vulnerability Detection Based on Deep Learning and Multimodal Decision Fusion](https://www.mdpi.com/1424-8220/23/16/7246) | Use Slither to extract the CFG | Weichu Deng, Huanchun Wei, Teng Huang, Cong Cao, Yun Peng, and Xuan Hu | Sensors 2023, 23, 7246 | +[Semantic-enriched Code Knowledge Graph to Reveal Unknowns in Smart Contract Code Reuse](https://www.researchgate.net/profile/Qing-Huang-26/publication/370638129_Semantic-enriched_Code_Knowledge_Graph_to_Reveal_Unknowns_in_Smart_Contract_Code_Reuse/links/645b7b8639c408339b3a54da/Semantic-Enriched-Code-Knowledge-Graph-to-Reveal-Unknowns-in-Smart-Contract-Code-Reuse.pdf) | Use Slither to extract the code features (CFG, function, parameters types, ..) | Qing Huang, Dianshu Liao, Zhenchang Xing, Zhengkang Zuo, Changjing Wang, Xin Xia | ACM Transactions on Software Engineering and Methodology, 2023 | +[Smart Contract Parallel Execution with Fine-Grained State Accesses](https://personal.ntu.edu.sg/yi_li/files/Qi2023SCP.pdf) | Use Slither to build state access graphs | Xiaodong Qi, Jiao Jiao, Yi Li | International Conference on Distributed Computing Systems (ICDCS), 2023 | +[Bad Apples: Understanding the Centralized Security Risks in Decentralized Ecosystems](https://diaowenrui.github.io/paper/www23-yan.pdf) | Implement an internal analysis on top of Slither | Kailun Yan , Jilian Zhang , Xiangyu Liu , Wenrui Diao , Shanqing Guo | ACM Web Conference April 2023 | +[Identifying Vulnerabilities in Smart Contracts using Interval Analysis](https://arxiv.org/pdf/2309.13805.pdf) | Create 4 detectors on top of Slither | Ştefan-Claudiu Susan, Andrei Arusoaie | FROM 2023 | Storage State Analysis and Extraction of Ethereum Blockchain Smart Contracts (no pdf in open access) | Rely on Slither's CFG and AST | Maha Ayub , Tania Saleem , Muhammad Janjua , Talha Ahmad | TOSEM 2023 | [SmartMuv](https://github.com/WaizKhan7/SmartMuv) If you are using Slither on an academic work, consider applying to the [Crytic $10k Research Prize](https://blog.trailofbits.com/2019/11/13/announcing-the-crytic-10k-research-prize/). From f10759c045c4d301783d29bac09c45ce4be6478e Mon Sep 17 00:00:00 2001 From: Feist Josselin Date: Wed, 13 Mar 2024 12:08:58 +0100 Subject: [PATCH 08/45] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 85d794e192..d0336e7f24 100644 --- a/README.md +++ b/README.md @@ -306,6 +306,6 @@ Title | Usage | Authors | Venue | Code [Smart Contract Parallel Execution with Fine-Grained State Accesses](https://personal.ntu.edu.sg/yi_li/files/Qi2023SCP.pdf) | Use Slither to build state access graphs | Xiaodong Qi, Jiao Jiao, Yi Li | International Conference on Distributed Computing Systems (ICDCS), 2023 | [Bad Apples: Understanding the Centralized Security Risks in Decentralized Ecosystems](https://diaowenrui.github.io/paper/www23-yan.pdf) | Implement an internal analysis on top of Slither | Kailun Yan , Jilian Zhang , Xiangyu Liu , Wenrui Diao , Shanqing Guo | ACM Web Conference April 2023 | [Identifying Vulnerabilities in Smart Contracts using Interval Analysis](https://arxiv.org/pdf/2309.13805.pdf) | Create 4 detectors on top of Slither | Ştefan-Claudiu Susan, Andrei Arusoaie | FROM 2023 | -Storage State Analysis and Extraction of Ethereum Blockchain Smart Contracts (no pdf in open access) | Rely on Slither's CFG and AST | Maha Ayub , Tania Saleem , Muhammad Janjua , Talha Ahmad | TOSEM 2023 | [SmartMuv](https://github.com/WaizKhan7/SmartMuv) +Storage State Analysis and Extraction of Ethereum Blockchain Smart Contracts (no PDF in open access) | Rely on Slither's CFG and AST | Maha Ayub , Tania Saleem , Muhammad Janjua , Talha Ahmad | TOSEM 2023 | [SmartMuv](https://github.com/WaizKhan7/SmartMuv) If you are using Slither on an academic work, consider applying to the [Crytic $10k Research Prize](https://blog.trailofbits.com/2019/11/13/announcing-the-crytic-10k-research-prize/). From 3905158cb5ce71eec200e7589dcdb051e6e86c46 Mon Sep 17 00:00:00 2001 From: Feist Josselin Date: Wed, 13 Mar 2024 12:25:16 +0100 Subject: [PATCH 09/45] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d0336e7f24..4d9e1d10e1 100644 --- a/README.md +++ b/README.md @@ -301,11 +301,11 @@ Title | Usage | Authors | Venue | Code [MANDO: Multi-Level Heterogeneous Graph Embeddings for Fine-Grained Detection of Smart Contract Vulnerabilities](https://arxiv.org/abs/2208.13252) | Use Slither to extract the CFG and call graph | Hoang Nguyen, Nhat-Minh Nguyen, Chunyao Xie, Zahra Ahmadi, Daniel Kudendo, Thanh-Nam Doan and Lingxiao Jiang| IEEE 9th International Conference on Data Science and Advanced Analytics (DSAA, 2022) | [ge-sc](https://github.com/MANDO-Project/ge-sc) [Automated Auditing of Price Gouging TOD Vulnerabilities in Smart Contracts](https://www.cs.toronto.edu/~fanl/papers/price-icbc22.pdf) | Use Slither to extract the CFG and data dependencies| Sidi Mohamed Beillahi, Eric Keilty, Keerthi Nelaturu, Andreas Veneris, and Fan Long | 2022 IEEE International Conference on Blockchain and Cryptocurrency (ICBC) | [Smart-Contract-Repair](https://github.com/Veneris-Group/TOD-Location-Rectification) [Modeling and Enforcing Access Control Policies for Smart Contracts](https://publikationen.bibliothek.kit.edu/1000152805/151859658) | Extend Slither's data dependencies | Jan-Philipp Toberg, Jonas Schiffl, Frederik Reiche, Bernhard Beckert, Robert Heinrich, Ralf Reussner | IEEE International Conference on Decentralized Applications and Infrastructures (DAPPS), 2022 | [SolidityAccessControlEnforcement](https://github.com/KASTEL-CSSDA/SolidityAccessControlEnforcement) -[Smart Contract Vulnerability Detection Based on Deep Learning and Multimodal Decision Fusion](https://www.mdpi.com/1424-8220/23/16/7246) | Use Slither to extract the CFG | Weichu Deng, Huanchun Wei, Teng Huang, Cong Cao, Yun Peng, and Xuan Hu | Sensors 2023, 23, 7246 | -[Semantic-enriched Code Knowledge Graph to Reveal Unknowns in Smart Contract Code Reuse](https://www.researchgate.net/profile/Qing-Huang-26/publication/370638129_Semantic-enriched_Code_Knowledge_Graph_to_Reveal_Unknowns_in_Smart_Contract_Code_Reuse/links/645b7b8639c408339b3a54da/Semantic-Enriched-Code-Knowledge-Graph-to-Reveal-Unknowns-in-Smart-Contract-Code-Reuse.pdf) | Use Slither to extract the code features (CFG, function, parameters types, ..) | Qing Huang, Dianshu Liao, Zhenchang Xing, Zhengkang Zuo, Changjing Wang, Xin Xia | ACM Transactions on Software Engineering and Methodology, 2023 | -[Smart Contract Parallel Execution with Fine-Grained State Accesses](https://personal.ntu.edu.sg/yi_li/files/Qi2023SCP.pdf) | Use Slither to build state access graphs | Xiaodong Qi, Jiao Jiao, Yi Li | International Conference on Distributed Computing Systems (ICDCS), 2023 | -[Bad Apples: Understanding the Centralized Security Risks in Decentralized Ecosystems](https://diaowenrui.github.io/paper/www23-yan.pdf) | Implement an internal analysis on top of Slither | Kailun Yan , Jilian Zhang , Xiangyu Liu , Wenrui Diao , Shanqing Guo | ACM Web Conference April 2023 | -[Identifying Vulnerabilities in Smart Contracts using Interval Analysis](https://arxiv.org/pdf/2309.13805.pdf) | Create 4 detectors on top of Slither | Ştefan-Claudiu Susan, Andrei Arusoaie | FROM 2023 | +[Smart Contract Vulnerability Detection Based on Deep Learning and Multimodal Decision Fusion](https://www.mdpi.com/1424-8220/23/16/7246) | Use Slither to extract the CFG | Weichu Deng, Huanchun Wei, Teng Huang, Cong Cao, Yun Peng, and Xuan Hu | Sensors 2023, 23, 7246 +[Semantic-enriched Code Knowledge Graph to Reveal Unknowns in Smart Contract Code Reuse](https://www.researchgate.net/profile/Qing-Huang-26/publication/370638129_Semantic-enriched_Code_Knowledge_Graph_to_Reveal_Unknowns_in_Smart_Contract_Code_Reuse/links/645b7b8639c408339b3a54da/Semantic-Enriched-Code-Knowledge-Graph-to-Reveal-Unknowns-in-Smart-Contract-Code-Reuse.pdf) | Use Slither to extract the code features (CFG, function, parameters types, ..) | Qing Huang, Dianshu Liao, Zhenchang Xing, Zhengkang Zuo, Changjing Wang, Xin Xia | ACM Transactions on Software Engineering and Methodology, 2023 +[Smart Contract Parallel Execution with Fine-Grained State Accesses](https://personal.ntu.edu.sg/yi_li/files/Qi2023SCP.pdf) | Use Slither to build state access graphs | Xiaodong Qi, Jiao Jiao, Yi Li | International Conference on Distributed Computing Systems (ICDCS), 2023 +[Bad Apples: Understanding the Centralized Security Risks in Decentralized Ecosystems](https://diaowenrui.github.io/paper/www23-yan.pdf) | Implement an internal analysis on top of Slither | Kailun Yan , Jilian Zhang , Xiangyu Liu , Wenrui Diao , Shanqing Guo | ACM Web Conference April 2023 +[Identifying Vulnerabilities in Smart Contracts using Interval Analysis](https://arxiv.org/pdf/2309.13805.pdf) | Create 4 detectors on top of Slither | Ştefan-Claudiu Susan, Andrei Arusoaie | FROM 2023 Storage State Analysis and Extraction of Ethereum Blockchain Smart Contracts (no PDF in open access) | Rely on Slither's CFG and AST | Maha Ayub , Tania Saleem , Muhammad Janjua , Talha Ahmad | TOSEM 2023 | [SmartMuv](https://github.com/WaizKhan7/SmartMuv) If you are using Slither on an academic work, consider applying to the [Crytic $10k Research Prize](https://blog.trailofbits.com/2019/11/13/announcing-the-crytic-10k-research-prize/). From 2bd6cbeddde8dd89a10ecbd3ba3a0f96f994b602 Mon Sep 17 00:00:00 2001 From: Alexis Date: Mon, 8 Apr 2024 10:50:15 +0200 Subject: [PATCH 10/45] Remove deprecated flags and their migration. --- slither/utils/command_line.py | 35 ------------------- .../test_path_filtering/slither.config.json | 2 +- 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/slither/utils/command_line.py b/slither/utils/command_line.py index f03ced8345..a37e859133 100644 --- a/slither/utils/command_line.py +++ b/slither/utils/command_line.py @@ -75,13 +75,6 @@ class FailOnLevel(enum.Enum): **DEFAULTS_FLAG_IN_CONFIG_CRYTIC_COMPILE, } -deprecated_flags = { - "fail_pedantic": True, - "fail_low": False, - "fail_medium": False, - "fail_high": False, -} - def read_config_file(args: argparse.Namespace) -> None: # No config file was provided as an argument @@ -98,12 +91,6 @@ def read_config_file(args: argparse.Namespace) -> None: with open(args.config_file, encoding="utf8") as f: config = json.load(f) for key, elem in config.items(): - if key in deprecated_flags: - logger.info( - yellow(f"{args.config_file} has a deprecated key: {key} : {elem}") - ) - migrate_config_options(args, key, elem) - continue if key not in defaults_flag_in_config: logger.info( yellow(f"{args.config_file} has an unknown key: {key} : {elem}") @@ -118,28 +105,6 @@ def read_config_file(args: argparse.Namespace) -> None: logger.error(yellow("Falling back to the default settings...")) -def migrate_config_options(args: argparse.Namespace, key: str, elem): - if key.startswith("fail_") and getattr(args, "fail_on") == defaults_flag_in_config["fail_on"]: - if key == "fail_pedantic": - pedantic_setting = elem - fail_on = FailOnLevel.PEDANTIC if pedantic_setting else FailOnLevel.NONE - setattr(args, "fail_on", fail_on) - logger.info(f"Migrating fail_pedantic: {pedantic_setting} as fail_on: {fail_on.value}") - elif key == "fail_low" and elem is True: - logger.info("Migrating fail_low: true -> fail_on: low") - setattr(args, "fail_on", FailOnLevel.LOW) - - elif key == "fail_medium" and elem is True: - logger.info("Migrating fail_medium: true -> fail_on: medium") - setattr(args, "fail_on", FailOnLevel.MEDIUM) - - elif key == "fail_high" and elem is True: - logger.info("Migrating fail_high: true -> fail_on: high") - setattr(args, "fail_on", FailOnLevel.HIGH) - else: - logger.warning(yellow(f"Key {key} was deprecated but no migration was provided")) - - def output_to_markdown( detector_classes: List[Type[AbstractDetector]], printer_classes: List[Type[AbstractPrinter]], diff --git a/tests/e2e/config/test_path_filtering/slither.config.json b/tests/e2e/config/test_path_filtering/slither.config.json index 95aac92b06..0c365eac75 100644 --- a/tests/e2e/config/test_path_filtering/slither.config.json +++ b/tests/e2e/config/test_path_filtering/slither.config.json @@ -2,6 +2,6 @@ "detectors_to_run": "all", "exclude_informational": true, "exclude_low": true, - "fail_pedantic": false, + "fail_on": "none", "filter_paths": "libs|src/ReentrancyMock.sol" } From 41f599b5463c2518cf71d41556e0597cda298f4b Mon Sep 17 00:00:00 2001 From: Simone Date: Mon, 22 Aug 2022 17:50:35 +0200 Subject: [PATCH 11/45] Remove libraries, mock contract, option interfaces --- slither/__main__.py | 8 ++++++++ slither/printers/inheritance/inheritance_graph.py | 8 ++++++-- slither/slither.py | 4 +++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/slither/__main__.py b/slither/__main__.py index caaef5730b..d303aebe68 100644 --- a/slither/__main__.py +++ b/slither/__main__.py @@ -335,6 +335,14 @@ def parse_args( default=defaults_flag_in_config["printers_to_run"], ) + group_printer.add_argument( + "--exclude-interfaces", + help= "Exclude interfaces from inheritance-graph printer", + action="store_true", + dest="exclude_interfaces", + default=False, + ) + group_detector.add_argument( "--list-detectors", help="List available detectors", diff --git a/slither/printers/inheritance/inheritance_graph.py b/slither/printers/inheritance/inheritance_graph.py index a16ce273af..3a91f1523f 100644 --- a/slither/printers/inheritance/inheritance_graph.py +++ b/slither/printers/inheritance/inheritance_graph.py @@ -98,12 +98,14 @@ def _summary(self, contract): """ ret = "" + inheritance = [i for i in contract.immediate_inheritance if "mock" not in i.name.lower()] + # Add arrows (number them if there is more than one path so we know order of declaration for inheritance). - if len(contract.immediate_inheritance) == 1: + if len(inheritance) == 1: immediate_inheritance = contract.immediate_inheritance[0] ret += f"c{contract.id}_{contract.name} -> c{immediate_inheritance.id}_{immediate_inheritance};\n" else: - for i, immediate_inheritance in enumerate(contract.immediate_inheritance): + for i, immediate_inheritance in enumerate(inheritance): ret += f'c{contract.id}_{contract.name} -> c{immediate_inheritance.id}_{immediate_inheritance} [ label="{i + 1}" ];\n' # Functions @@ -195,6 +197,8 @@ def output(self, filename): content = 'digraph "" {\n' for c in self.contracts: + if c.is_top_level or "mock" in c.name.lower() or c.is_library or (self.slither.exclude_interfaces and c.is_interface): + continue content += self._summary(c) + "\n" content += "}" diff --git a/slither/slither.py b/slither/slither.py index 0f22185353..72cf365362 100644 --- a/slither/slither.py +++ b/slither/slither.py @@ -196,10 +196,12 @@ def __init__(self, target: Union[str, CryticCompile], **kwargs) -> None: if printers_to_run == "echidna": self.skip_data_dependency = True + # Used in inheritance-graph printer + self.exclude_interfaces = kwargs.get("exclude_interfaces", False) + self._init_parsing_and_analyses(kwargs.get("skip_analyze", False)) def _init_parsing_and_analyses(self, skip_analyze: bool) -> None: - for parser in self._parsers: try: parser.parse_contracts() From ea01702294bf8b2e4c512063402020a795e68cf1 Mon Sep 17 00:00:00 2001 From: Simone Date: Mon, 22 Aug 2022 18:04:23 +0200 Subject: [PATCH 12/45] Fix remove interfaces inherited --- slither/printers/inheritance/inheritance_graph.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slither/printers/inheritance/inheritance_graph.py b/slither/printers/inheritance/inheritance_graph.py index 3a91f1523f..36fb6c4328 100644 --- a/slither/printers/inheritance/inheritance_graph.py +++ b/slither/printers/inheritance/inheritance_graph.py @@ -98,7 +98,7 @@ def _summary(self, contract): """ ret = "" - inheritance = [i for i in contract.immediate_inheritance if "mock" not in i.name.lower()] + inheritance = [i for i in contract.immediate_inheritance if "mock" not in i.name.lower() and (self.slither.exclude_interfaces and not i.is_interface)] # Add arrows (number them if there is more than one path so we know order of declaration for inheritance). if len(inheritance) == 1: From 4164039011de66c076981d5f652c076a2ab53a96 Mon Sep 17 00:00:00 2001 From: Simone Date: Mon, 22 Aug 2022 18:14:14 +0200 Subject: [PATCH 13/45] Fix --- slither/printers/inheritance/inheritance_graph.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/slither/printers/inheritance/inheritance_graph.py b/slither/printers/inheritance/inheritance_graph.py index 36fb6c4328..a593d20eed 100644 --- a/slither/printers/inheritance/inheritance_graph.py +++ b/slither/printers/inheritance/inheritance_graph.py @@ -98,7 +98,8 @@ def _summary(self, contract): """ ret = "" - inheritance = [i for i in contract.immediate_inheritance if "mock" not in i.name.lower() and (self.slither.exclude_interfaces and not i.is_interface)] + # Remove contracts that have "mock" in the name and if --exclude-interface removes inherited interfaces + inheritance = [i for i in contract.immediate_inheritance if "mock" not in i.name.lower() and (not self.slither.exclude_interfaces or self.slither.exclude_interfaces and not i.is_interface)] # Add arrows (number them if there is more than one path so we know order of declaration for inheritance). if len(inheritance) == 1: From 20fa97cbacb33330da75f2678313f2727fc6d0a5 Mon Sep 17 00:00:00 2001 From: Alexis Date: Tue, 9 Apr 2024 17:18:02 +0200 Subject: [PATCH 14/45] Remove interface from inheritance graph. --- slither/__main__.py | 6 +++--- .../printers/inheritance/inheritance_graph.py | 17 ++++++++++++++--- slither/slither.py | 2 +- .../test_data/test_contract_names/C.sol | 16 +++++++++++++++- tests/e2e/printers/test_printers.py | 12 ++++++++++++ 5 files changed, 45 insertions(+), 8 deletions(-) diff --git a/slither/__main__.py b/slither/__main__.py index d303aebe68..de818c2882 100644 --- a/slither/__main__.py +++ b/slither/__main__.py @@ -336,10 +336,10 @@ def parse_args( ) group_printer.add_argument( - "--exclude-interfaces", - help= "Exclude interfaces from inheritance-graph printer", + "--include-interfaces", + help="Include interfaces from inheritance-graph printer", action="store_true", - dest="exclude_interfaces", + dest="include_interfaces", default=False, ) diff --git a/slither/printers/inheritance/inheritance_graph.py b/slither/printers/inheritance/inheritance_graph.py index a593d20eed..54b525c774 100644 --- a/slither/printers/inheritance/inheritance_graph.py +++ b/slither/printers/inheritance/inheritance_graph.py @@ -98,8 +98,14 @@ def _summary(self, contract): """ ret = "" - # Remove contracts that have "mock" in the name and if --exclude-interface removes inherited interfaces - inheritance = [i for i in contract.immediate_inheritance if "mock" not in i.name.lower() and (not self.slither.exclude_interfaces or self.slither.exclude_interfaces and not i.is_interface)] + # Remove contracts that have "mock" in the name and if --include-interfaces in False (default) + # removes inherited interfaces + inheritance = [ + i + for i in contract.immediate_inheritance + if "mock" not in i.name.lower() + and (not i.is_interface or self.slither.include_interfaces) + ] # Add arrows (number them if there is more than one path so we know order of declaration for inheritance). if len(inheritance) == 1: @@ -116,6 +122,7 @@ def _summary(self, contract): for f in contract.functions if not f.is_constructor and not f.is_constructor_variables + and not f.is_virtual and f.contract_declarer == contract and f.visibility in visibilities ] @@ -198,7 +205,11 @@ def output(self, filename): content = 'digraph "" {\n' for c in self.contracts: - if c.is_top_level or "mock" in c.name.lower() or c.is_library or (self.slither.exclude_interfaces and c.is_interface): + if ( + "mock" in c.name.lower() + or c.is_library + or (c.is_interface and not self.slither.include_interfaces) + ): continue content += self._summary(c) + "\n" content += "}" diff --git a/slither/slither.py b/slither/slither.py index 72cf365362..7adc0694ca 100644 --- a/slither/slither.py +++ b/slither/slither.py @@ -197,7 +197,7 @@ def __init__(self, target: Union[str, CryticCompile], **kwargs) -> None: self.skip_data_dependency = True # Used in inheritance-graph printer - self.exclude_interfaces = kwargs.get("exclude_interfaces", False) + self.include_interfaces = kwargs.get("include_interfaces", False) self._init_parsing_and_analyses(kwargs.get("skip_analyze", False)) diff --git a/tests/e2e/printers/test_data/test_contract_names/C.sol b/tests/e2e/printers/test_data/test_contract_names/C.sol index 90bc35df39..d6ba9b5c15 100644 --- a/tests/e2e/printers/test_data/test_contract_names/C.sol +++ b/tests/e2e/printers/test_data/test_contract_names/C.sol @@ -1,7 +1,21 @@ import "./A.sol"; -contract C is A { +interface MyInterfaceX { + function count() external view returns (uint256); + + function increment() external; +} + +contract C is A, MyInterfaceX { function c_main() public pure { a_main(); } + + function count() external view override returns (uint256){ + return 1; + } + + function increment() external override { + + } } diff --git a/tests/e2e/printers/test_printers.py b/tests/e2e/printers/test_printers.py index 26429d3381..3dea8b74a4 100644 --- a/tests/e2e/printers/test_printers.py +++ b/tests/e2e/printers/test_printers.py @@ -34,3 +34,15 @@ def test_inheritance_printer(solc_binary_path) -> None: assert counter["B -> A"] == 2 assert counter["C -> A"] == 1 + + # Lets also test the include/exclude interface behavior + # Check that the interface is not included + assert "MyInterfaceX" not in content + + slither.include_interfaces = True + output = printer.output("test_printer.dot") + content = output.elements[0]["name"]["content"] + assert "MyInterfaceX" in content + + # Remove test generated files + Path("test_printer.dot").unlink(missing_ok=True) From dcec99b1b80bb033ccfef2ee17652518d9a5e349 Mon Sep 17 00:00:00 2001 From: Alexis Date: Wed, 10 Apr 2024 11:07:00 +0200 Subject: [PATCH 15/45] Reduce verbosity for InvalidCompilation errors --- slither/__main__.py | 10 ++++++++-- tests/e2e/test_cli.py | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 tests/e2e/test_cli.py diff --git a/slither/__main__.py b/slither/__main__.py index caaef5730b..4fc83a11e5 100644 --- a/slither/__main__.py +++ b/slither/__main__.py @@ -14,7 +14,7 @@ from typing import Tuple, Optional, List, Dict, Type, Union, Any, Sequence -from crytic_compile import cryticparser, CryticCompile +from crytic_compile import cryticparser, CryticCompile, InvalidCompilation from crytic_compile.platform.standard import generate_standard_export from crytic_compile.platform.etherscan import SUPPORTED_NETWORK from crytic_compile import compile_all, is_supported @@ -93,7 +93,13 @@ def process_all( detector_classes: List[Type[AbstractDetector]], printer_classes: List[Type[AbstractPrinter]], ) -> Tuple[List[Slither], List[Dict], List[Output], int]: - compilations = compile_all(target, **vars(args)) + + try: + compilations = compile_all(target, **vars(args)) + except InvalidCompilation: + logger.error("Unable to compile all targets.") + sys.exit(2) + slither_instances = [] results_detectors = [] results_printers = [] diff --git a/tests/e2e/test_cli.py b/tests/e2e/test_cli.py new file mode 100644 index 0000000000..72e0441d6a --- /dev/null +++ b/tests/e2e/test_cli.py @@ -0,0 +1,20 @@ +import sys +import tempfile +import pytest + +from slither.__main__ import main_impl + + +def test_cli_exit_on_invalid_compilation_file(caplog): + + with tempfile.NamedTemporaryFile("w") as f: + f.write("pragma solidity ^0.10000.0;") + + sys.argv = ["slither", f.name] + with pytest.raises(SystemExit) as pytest_wrapped_e: + main_impl([], []) + + assert pytest_wrapped_e.type == SystemExit + assert pytest_wrapped_e.value.code == 2 + + assert caplog.record_tuples[0] == ("Slither", 40, "Unable to compile all targets.") From 0ecf6b4a1691909b19f46f384d80ea63e8904d91 Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Wed, 10 Apr 2024 23:12:32 -0500 Subject: [PATCH 16/45] fix: unused state var detector for abstract/library --- .../variables/unused_state_variables.py | 14 +++++++-- ...sedStateVars_0_7_6_unused_state_sol__0.txt | 4 +++ .../unused-state/0.7.6/unused_state.sol | 29 ++++++++++++++++++ .../0.7.6/unused_state.sol-0.7.6.zip | Bin 1874 -> 3063 bytes 4 files changed, 45 insertions(+), 2 deletions(-) diff --git a/slither/detectors/variables/unused_state_variables.py b/slither/detectors/variables/unused_state_variables.py index 830ca34caa..0fb068fda4 100644 --- a/slither/detectors/variables/unused_state_variables.py +++ b/slither/detectors/variables/unused_state_variables.py @@ -46,8 +46,18 @@ def detect_unused(contract: Contract) -> Optional[List[StateVariable]]: variables_used = [item for sublist in variables_used for item in sublist] variables_used = list(set(variables_used + array_candidates)) + # If the contract is abstract, only consider private variables as other visibilities may be used in dependencies + if contract.is_abstract: + return [ + x + for x in contract.state_variables + if x not in variables_used and x.visibility == "private" + ] + # Return the variables unused that are not public - return [x for x in contract.variables if x not in variables_used and x.visibility != "public"] + return [ + x for x in contract.state_variables if x not in variables_used and x.visibility != "public" + ] class UnusedStateVars(AbstractDetector): @@ -71,7 +81,7 @@ def _detect(self) -> List[Output]: """Detect unused state variables""" results = [] for c in self.compilation_unit.contracts_derived: - if c.is_signature_only(): + if c.is_signature_only() or c.is_library: continue unusedVars = detect_unused(c) if unusedVars: diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedStateVars_0_7_6_unused_state_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedStateVars_0_7_6_unused_state_sol__0.txt index 39c7ed13e8..6e89528837 100644 --- a/tests/e2e/detectors/snapshots/detectors__detector_UnusedStateVars_0_7_6_unused_state_sol__0.txt +++ b/tests/e2e/detectors/snapshots/detectors__detector_UnusedStateVars_0_7_6_unused_state_sol__0.txt @@ -4,5 +4,9 @@ A.unused4 (tests/e2e/detectors/test_data/unused-state/0.7.6/unused_state.sol#7) A.unused2 (tests/e2e/detectors/test_data/unused-state/0.7.6/unused_state.sol#5) is never used in B (tests/e2e/detectors/test_data/unused-state/0.7.6/unused_state.sol#11-16) +H.bad1 (tests/e2e/detectors/test_data/unused-state/0.7.6/unused_state.sol#38) is never used in I (tests/e2e/detectors/test_data/unused-state/0.7.6/unused_state.sol#41-46) + +F.bad1 (tests/e2e/detectors/test_data/unused-state/0.7.6/unused_state.sol#27) is never used in F (tests/e2e/detectors/test_data/unused-state/0.7.6/unused_state.sol#26-33) + A.unused3 (tests/e2e/detectors/test_data/unused-state/0.7.6/unused_state.sol#6) is never used in B (tests/e2e/detectors/test_data/unused-state/0.7.6/unused_state.sol#11-16) diff --git a/tests/e2e/detectors/test_data/unused-state/0.7.6/unused_state.sol b/tests/e2e/detectors/test_data/unused-state/0.7.6/unused_state.sol index b603f88755..9e4f7ec6f5 100644 --- a/tests/e2e/detectors/test_data/unused-state/0.7.6/unused_state.sol +++ b/tests/e2e/detectors/test_data/unused-state/0.7.6/unused_state.sol @@ -14,3 +14,32 @@ contract B is A{ used = address(0); } } + +library C { + uint internal constant good = 0x00; // other contract can access this constant + function c() public pure returns (uint){ + return 0; + } + +} + +abstract contract F { + uint private bad1 = 0x00; + uint private good1 = 0x00; + uint internal good2 = 0x00; + function use() external returns (uint){ + return good1; + } +} + +abstract contract H { + uint private good1 = 0x00; + uint internal good2 = 0x00; + uint internal bad1 = 0x00; +} + +contract I is H { + function use2() external returns (uint){ + return good2; + } +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-state/0.7.6/unused_state.sol-0.7.6.zip b/tests/e2e/detectors/test_data/unused-state/0.7.6/unused_state.sol-0.7.6.zip index 2feb3c2f6db0f5494f7686efed23719e46d198ea..13cab662f312bfab7dd45bfd450f397e08ec114f 100644 GIT binary patch delta 2809 zcmV@KL7#%4ghAkidfCpSb$9n005a`kr>&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*8IoRVaB@+s1tuPopw_ z)gISoDuNa7%NoUUcZZEkaacSN@2z6RhMpNN{1%Ni;-lZDPiP;`Oy7>}8W`vc$q1vj za(u?hqx@s~X_5x#Ot1qV1e1uT_8=K5z}Lh(HmU#}`z)pLR|}^!AWo|E)u2mz&{Q2Z8xb?;azht&c>1ko||SL-Tvz+=hgWB#97F*slkazpL?eify;c zYe{}Wlc;m?E**EMifEc!jg3R3c#`q1ql>MyhR6HA_Vip1S>16u;N<~gCu&ku)! z8=wU{fc4?QtzCe;{PSZ9(?tJ0ET@~H5}_52G-XotejUB==a^ib$1Rj8a|&yJruUO> zTLITW`7^-KZK|x#uqX~fx9X1~3Tl0>LbB|m(3U8>h^`f&^~9%zpydk z6;aq(>{0IIT(wW13;r9uTTCAvEojs#bOtMI71-uS0e%gqBAa<0xPynEW-EK}dWG0w zyTp0)(rB{-wfN^sz!JQzuoUorK@mJjfP1n=y0x$tQ0f zzSgWQv|JGtOkH%%L54_^dAENRV#V>+TU#OdHqAWw;i&2MUQ|WsGVeft{X0VKz1C*0 zG~BD)3_CiGBiS=>5-8rqpL`-ltj?21<29HHyAioV~*&8k|H_|7%I|e(5rm) zng$+Y@F{vbzt?y)=4${S|M$7eyHHC30zU&k00ICG05*+xR+t6G!l(uS0P`f1sS8L3 J>IMJ+008e$9Ekt` From 9413e1ea9461e68127510e182a32ac0e8dafbf3d Mon Sep 17 00:00:00 2001 From: Alexis Date: Thu, 18 Apr 2024 10:28:30 +0200 Subject: [PATCH 17/45] Fix #2430 EVM printer now correctly detects missing bytecode in contract and don't try to analyze them. --- slither/printers/summary/evm.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/slither/printers/summary/evm.py b/slither/printers/summary/evm.py index 0e5ce58d78..aad71bdff8 100644 --- a/slither/printers/summary/evm.py +++ b/slither/printers/summary/evm.py @@ -1,6 +1,8 @@ """ Module printing evm mapping of the contract """ +import logging + from slither.printers.abstract_printer import AbstractPrinter from slither.analyses.evm import ( generate_source_to_evm_ins_mapping, @@ -9,6 +11,9 @@ from slither.utils.colors import blue, green, magenta, red +logger: logging.Logger = logging.getLogger("EVMPrinter") + + def _extract_evm_info(slither): """ Extract evm information for all derived contracts using evm_cfg_builder @@ -24,6 +29,16 @@ def _extract_evm_info(slither): contract_bytecode_runtime = contract.file_scope.bytecode_runtime( contract.compilation_unit.crytic_compile_compilation_unit, contract.name ) + + if not contract_bytecode_runtime: + logger.info( + "Contract %s (abstract: %r) has no bytecode runtime, skipping. ", + contract.name, + contract.is_abstract, + ) + evm_info["empty", contract.name] = True + continue + contract_srcmap_runtime = contract.file_scope.srcmap_runtime( contract.compilation_unit.crytic_compile_compilation_unit, contract.name ) @@ -80,6 +95,10 @@ def output(self, _filename): for contract in self.slither.contracts_derived: txt += blue(f"Contract {contract.name}\n") + if evm_info.get(("empty", contract.name), False): + txt += "\tempty contract\n" + continue + contract_file = self.slither.source_code[ contract.source_mapping.filename.absolute ].encode("utf-8") From bb8ad1800123f79005e8166b81d6637ffc1d89ae Mon Sep 17 00:00:00 2001 From: careworry Date: Thu, 18 Apr 2024 19:19:13 +0800 Subject: [PATCH 18/45] chore: fix some typos in comments Signed-off-by: careworry --- slither/core/declarations/function.py | 8 ++++---- slither/detectors/naming_convention/naming_convention.py | 2 +- slither/detectors/statements/divide_before_multiply.py | 4 ++-- slither/slithir/convert.py | 2 +- slither/tools/kspec_coverage/analysis.py | 2 +- tests/unit/slithir/test_ssa_generation.py | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/slither/core/declarations/function.py b/slither/core/declarations/function.py index 958a7d2199..be215bd1f2 100644 --- a/slither/core/declarations/function.py +++ b/slither/core/declarations/function.py @@ -1593,7 +1593,7 @@ def _analyze_read_write(self) -> None: write_var = [x for x in write_var if x] write_var = [item for sublist in write_var for item in sublist] write_var = list(set(write_var)) - # Remove dupplicate if they share the same string representation + # Remove duplicate if they share the same string representation write_var = [ next(obj) for i, obj in groupby(sorted(write_var, key=lambda x: str(x)), lambda x: str(x)) @@ -1604,7 +1604,7 @@ def _analyze_read_write(self) -> None: write_var = [x for x in write_var if x] write_var = [item for sublist in write_var for item in sublist] write_var = list(set(write_var)) - # Remove dupplicate if they share the same string representation + # Remove duplicate if they share the same string representation write_var = [ next(obj) for i, obj in groupby(sorted(write_var, key=lambda x: str(x)), lambda x: str(x)) @@ -1614,7 +1614,7 @@ def _analyze_read_write(self) -> None: read_var = [x.variables_read_as_expression for x in self.nodes] read_var = [x for x in read_var if x] read_var = [item for sublist in read_var for item in sublist] - # Remove dupplicate if they share the same string representation + # Remove duplicate if they share the same string representation read_var = [ next(obj) for i, obj in groupby(sorted(read_var, key=lambda x: str(x)), lambda x: str(x)) @@ -1624,7 +1624,7 @@ def _analyze_read_write(self) -> None: read_var = [x.variables_read for x in self.nodes] read_var = [x for x in read_var if x] read_var = [item for sublist in read_var for item in sublist] - # Remove dupplicate if they share the same string representation + # Remove duplicate if they share the same string representation read_var = [ next(obj) for i, obj in groupby(sorted(read_var, key=lambda x: str(x)), lambda x: str(x)) diff --git a/slither/detectors/naming_convention/naming_convention.py b/slither/detectors/naming_convention/naming_convention.py index 827cfe2468..ab43318f11 100644 --- a/slither/detectors/naming_convention/naming_convention.py +++ b/slither/detectors/naming_convention/naming_convention.py @@ -16,7 +16,7 @@ class NamingConvention(AbstractDetector): Exceptions: - Allow constant variables name/symbol/decimals to be lowercase (ERC20) - - Allow '_' at the beggining of the mixed_case match for private variables and unused parameters + - Allow '_' at the beginning of the mixed_case match for private variables and unused parameters - Ignore echidna properties (functions with names starting 'echidna_' or 'crytic_' """ diff --git a/slither/detectors/statements/divide_before_multiply.py b/slither/detectors/statements/divide_before_multiply.py index 1f6ccd87e1..e33477135d 100644 --- a/slither/detectors/statements/divide_before_multiply.py +++ b/slither/detectors/statements/divide_before_multiply.py @@ -80,7 +80,7 @@ def _explore( for ir in node.irs: if isinstance(ir, Assignment): if ir.rvalue in divisions: - # Avoid dupplicate. We dont use set so we keep the order of the nodes + # Avoid duplicate. We dont use set so we keep the order of the nodes if node not in divisions[ir.rvalue]: # type: ignore divisions[ir.lvalue] = divisions[ir.rvalue] + [node] # type: ignore else: @@ -94,7 +94,7 @@ def _explore( nodes = [] for r in mul_arguments: if not isinstance(r, Constant) and (r in divisions): - # Dont add node already present to avoid dupplicate + # Dont add node already present to avoid duplicate # We dont use set to keep the order of the nodes if node in divisions[r]: nodes += [n for n in divisions[r] if n not in nodes] diff --git a/slither/slithir/convert.py b/slither/slithir/convert.py index b8ce460bff..7d8aa543bf 100644 --- a/slither/slithir/convert.py +++ b/slither/slithir/convert.py @@ -482,7 +482,7 @@ def propagate_type_and_convert_call(result: List[Operation], node: "Node") -> Li call_data.remove(ins.variable) if isinstance(ins, Argument): - # In case of dupplicate arguments we overwrite the value + # In case of duplicate arguments we overwrite the value # This can happen because of addr.call.value(1).value(2) if ins.get_type() in [ArgumentType.GAS]: calls_gas[ins.call_id] = ins.argument diff --git a/slither/tools/kspec_coverage/analysis.py b/slither/tools/kspec_coverage/analysis.py index 763939e251..a2ae236606 100755 --- a/slither/tools/kspec_coverage/analysis.py +++ b/slither/tools/kspec_coverage/analysis.py @@ -59,7 +59,7 @@ def _get_all_covered_kspec_functions(target: str) -> Set[Tuple[str, str]]: def _get_slither_functions( slither: SlitherCompilationUnit, ) -> Dict[Tuple[str, str], Union[FunctionContract, StateVariable]]: - # Use contract == contract_declarer to avoid dupplicate + # Use contract == contract_declarer to avoid duplicate all_functions_declared: List[Union[FunctionContract, StateVariable]] = [ f for f in slither.functions diff --git a/tests/unit/slithir/test_ssa_generation.py b/tests/unit/slithir/test_ssa_generation.py index 1a709c2f78..2d6c9c8c1a 100644 --- a/tests/unit/slithir/test_ssa_generation.py +++ b/tests/unit/slithir/test_ssa_generation.py @@ -502,7 +502,7 @@ def test_storage_refers_to(slither_from_solidity_source): When a phi-node is created, ensure refers_to is propagated to the phi-node. Assignments also propagate refers_to. Whenever a ReferenceVariable is the destination of an assignment (e.g. s.v = 10) - below, create additional versions of the variables it refers to record that a a + below, create additional versions of the variables it refers to record that a write was made. In the current implementation, this is referenced by phis. """ source = """ From 6074ab1c3821e7d040512582756be789844b06c4 Mon Sep 17 00:00:00 2001 From: Alexis Date: Fri, 19 Apr 2024 10:54:37 +0200 Subject: [PATCH 19/45] Remove calls to isinstance to improve performances. --- slither/visitors/expression/expression.py | 79 +++++++++-------------- 1 file changed, 29 insertions(+), 50 deletions(-) diff --git a/slither/visitors/expression/expression.py b/slither/visitors/expression/expression.py index 41886a1023..860ca28503 100644 --- a/slither/visitors/expression/expression.py +++ b/slither/visitors/expression/expression.py @@ -1,4 +1,5 @@ import logging +from functools import cache from slither.core.expressions.assignment_operation import AssignmentOperation from slither.core.expressions.binary_operation import BinaryOperation @@ -21,6 +22,28 @@ logger = logging.getLogger("ExpressionVisitor") +@cache +def get_visitor_mapping(): + """Returns a visitor mapping from expression type to visiting functions.""" + return { + AssignmentOperation: '_visit_assignement_operation', + BinaryOperation: '_visit_binary_operation', + CallExpression: '_visit_call_expression', + ConditionalExpression: '_visit_conditional_expression', + ElementaryTypeNameExpression: '_visit_elementary_type_name_expression', + Identifier: '_visit_identifier', + IndexAccess: '_visit_index_access', + Literal: '_visit_literal', + MemberAccess: '_visit_member_access', + NewArray: '_visit_new_array', + NewContract: '_visit_new_contract', + NewElementaryType: '_visit_new_elementary_type', + TupleExpression: '_visit_tuple_expression', + TypeConversion: '_visit_type_conversion', + UnaryOperation: '_visit_unary_operation' + } + + # pylint: disable=too-few-public-methods class ExpressionVisitor: def __init__(self, expression: Expression) -> None: @@ -35,60 +58,16 @@ def expression(self) -> Expression: # visit an expression # call pre_visit, visit_expression_name, post_visit - # pylint: disable=too-many-branches def _visit_expression(self, expression: Expression) -> None: self._pre_visit(expression) - if isinstance(expression, AssignmentOperation): - self._visit_assignement_operation(expression) - - elif isinstance(expression, BinaryOperation): - self._visit_binary_operation(expression) - - elif isinstance(expression, CallExpression): - self._visit_call_expression(expression) - - elif isinstance(expression, ConditionalExpression): - self._visit_conditional_expression(expression) - - elif isinstance(expression, ElementaryTypeNameExpression): - self._visit_elementary_type_name_expression(expression) - - elif isinstance(expression, Identifier): - self._visit_identifier(expression) - - elif isinstance(expression, IndexAccess): - self._visit_index_access(expression) - - elif isinstance(expression, Literal): - self._visit_literal(expression) - - elif isinstance(expression, MemberAccess): - self._visit_member_access(expression) - - elif isinstance(expression, NewArray): - self._visit_new_array(expression) - - elif isinstance(expression, NewContract): - self._visit_new_contract(expression) - - elif isinstance(expression, NewElementaryType): - self._visit_new_elementary_type(expression) - - elif isinstance(expression, TupleExpression): - self._visit_tuple_expression(expression) + if expression is not None: + visitor_method = get_visitor_mapping().get(expression.__class__) + if not visitor_method: + raise SlitherError(f"Expression not handled: {expression}") - elif isinstance(expression, TypeConversion): - self._visit_type_conversion(expression) - - elif isinstance(expression, UnaryOperation): - self._visit_unary_operation(expression) - - elif expression is None: - pass - - else: - raise SlitherError(f"Expression not handled: {expression}") + visitor = getattr(self, visitor_method) + visitor(expression) self._post_visit(expression) From 6afe440924369910cd33890256ad6afb7677ce1a Mon Sep 17 00:00:00 2001 From: Alexis Date: Fri, 19 Apr 2024 10:54:52 +0200 Subject: [PATCH 20/45] Memoize calls to __str__ --- slither/core/slither_core.py | 10 +- slither/core/solidity_types/array_type.py | 4 +- .../core/solidity_types/elementary_type.py | 4 +- slither/core/solidity_types/mapping_type.py | 4 +- .../slither_compilation_unit_solc.py | 127 ++++++++++-------- 5 files changed, 92 insertions(+), 57 deletions(-) diff --git a/slither/core/slither_core.py b/slither/core/slither_core.py index 8eca260fac..727c2e44c6 100644 --- a/slither/core/slither_core.py +++ b/slither/core/slither_core.py @@ -35,6 +35,14 @@ def _relative_path_format(path: str) -> str: return path.split("..")[-1].strip(".").strip("/") +def empty_tuple_list(): + return [(-1, -1)] + + +def tuple_dict(): + return defaultdict(empty_tuple_list) + + # pylint: disable=too-many-instance-attributes,too-many-public-methods class SlitherCore(Context): """ @@ -80,7 +88,7 @@ def __init__(self) -> None: # Maps from file to detector name to the start/end ranges for that detector. # Infinity is used to signal a detector has no end range. self._ignore_ranges: Dict[str, Dict[str, List[Tuple[int, ...]]]] = defaultdict( - lambda: defaultdict(lambda: [(-1, -1)]) + tuple_dict ) self._compilation_units: List[SlitherCompilationUnit] = [] diff --git a/slither/core/solidity_types/array_type.py b/slither/core/solidity_types/array_type.py index 04a458d685..2541258913 100644 --- a/slither/core/solidity_types/array_type.py +++ b/slither/core/solidity_types/array_type.py @@ -1,3 +1,4 @@ +from functools import cache from typing import Union, Optional, Tuple, Any, TYPE_CHECKING from slither.core.expressions.expression import Expression @@ -66,6 +67,7 @@ def storage_size(self) -> Tuple[int, bool]: return elem_size * int(str(self._length_value)), True return 32, True + @cache def __str__(self) -> str: if self._length: return str(self._type) + f"[{str(self._length_value)}]" @@ -77,4 +79,4 @@ def __eq__(self, other: Any) -> bool: return self._type == other.type and self._length_value == other.length_value def __hash__(self) -> int: - return hash(str(self)) + return hash(self._type) diff --git a/slither/core/solidity_types/elementary_type.py b/slither/core/solidity_types/elementary_type.py index a9f45c8d81..63c3071ede 100644 --- a/slither/core/solidity_types/elementary_type.py +++ b/slither/core/solidity_types/elementary_type.py @@ -1,4 +1,5 @@ import itertools +from functools import cache from typing import Tuple, Optional, Any from slither.core.solidity_types.type import Type @@ -216,6 +217,7 @@ def max(self) -> int: return MaxValues[self.name] raise SlitherException(f"{self.name} does not have a max value") + @cache def __str__(self) -> str: return self._type @@ -225,4 +227,4 @@ def __eq__(self, other: Any) -> bool: return self.type == other.type def __hash__(self) -> int: - return hash(str(self)) + return hash(self._type) diff --git a/slither/core/solidity_types/mapping_type.py b/slither/core/solidity_types/mapping_type.py index 9741569edf..e7adb461cb 100644 --- a/slither/core/solidity_types/mapping_type.py +++ b/slither/core/solidity_types/mapping_type.py @@ -1,3 +1,4 @@ +from functools import cache from typing import Union, Tuple, TYPE_CHECKING, Any from slither.core.solidity_types.type import Type @@ -35,6 +36,7 @@ def storage_size(self) -> Tuple[int, bool]: def is_dynamic(self) -> bool: return True + @cache def __str__(self) -> str: return f"mapping({str(self._from)} => {str(self._to)})" @@ -44,4 +46,4 @@ def __eq__(self, other: Any) -> bool: return self.type_from == other.type_from and self.type_to == other.type_to def __hash__(self) -> int: - return hash(str(self)) + return hash(f"{self._from}.{self._to}") diff --git a/slither/solc_parsing/slither_compilation_unit_solc.py b/slither/solc_parsing/slither_compilation_unit_solc.py index 36efeef33a..b3bb0d46a9 100644 --- a/slither/solc_parsing/slither_compilation_unit_solc.py +++ b/slither/solc_parsing/slither_compilation_unit_solc.py @@ -1,3 +1,4 @@ +import concurrent.futures from collections import defaultdict import json import logging @@ -73,6 +74,64 @@ def _handle_import_aliases( ) +def generate_slithir_contract(contract): + contract.add_constructor_variables() + + for func in contract.functions + contract.modifiers: + try: + func.generate_slithir_and_analyze() + + except AttributeError as e: + # This can happen for example if there is a call to an interface + # And the interface is redefined due to contract's name reuse + # But the available version misses some functions + # self._underlying_contract_to_parser[contract].log_incorrect_parsing( + # f"Impossible to generate IR for {contract.name}.{func.name} ({func.source_mapping}):\n {e}" + # ) + # TODO(dm) + pass + except Exception as e: + func_expressions = "\n".join([f"\t{ex}" for ex in func.expressions]) + logger.error( + f"\nFailed to generate IR for {contract.name}.{func.name}. Please open an issue https://github.com/crytic/slither/issues.\n{contract.name}.{func.name} ({func.source_mapping}):\n " + f"{func_expressions}" + ) + raise e + try: + contract.convert_expression_to_slithir_ssa() + except Exception as exc: + logger.error( + f"\nFailed to convert IR to SSA for {contract.name} contract. Please open an issue https://github.com/crytic/slither/issues.\n " + ) + raise exc + + +def generate_slithir_function(func): + try: + func.generate_slithir_and_analyze() + except AttributeError as e: + logger.error( + f"Impossible to generate IR for top level function {func.name} ({func.source_mapping}):\n {e}" + ) + except Exception as e: + func_expressions = "\n".join([f"\t{ex}" for ex in func.expressions]) + logger.error( + f"\nFailed to generate IR for top level function {func.name}. Please open an issue https://github.com/crytic/slither/issues.\n{func.name} ({func.source_mapping}):\n " + f"{func_expressions}" + ) + raise e + + try: + func.generate_slithir_ssa({}) + except Exception as e: + func_expressions = "\n".join([f"\t{ex}" for ex in func.expressions]) + logger.error( + f"\nFailed to convert IR to SSA for top level function {func.name}. Please open an issue https://github.com/crytic/slither/issues.\n{func.name} ({func.source_mapping}):\n " + f"{func_expressions}" + ) + raise e + + class SlitherCompilationUnitSolc(CallerContextExpression): # pylint: disable=too-many-instance-attributes def __init__(self, compilation_unit: SlitherCompilationUnit) -> None: @@ -803,60 +862,22 @@ def _analyze_variables_modifiers_functions(self, contract: ContractSolc) -> None contract.set_is_analyzed(True) def _convert_to_slithir(self) -> None: - for contract in self._compilation_unit.contracts: - contract.add_constructor_variables() - - for func in contract.functions + contract.modifiers: - try: - func.generate_slithir_and_analyze() - - except AttributeError as e: - # This can happens for example if there is a call to an interface - # And the interface is redefined due to contract's name reuse - # But the available version misses some functions - self._underlying_contract_to_parser[contract].log_incorrect_parsing( - f"Impossible to generate IR for {contract.name}.{func.name} ({func.source_mapping}):\n {e}" - ) - except Exception as e: - func_expressions = "\n".join([f"\t{ex}" for ex in func.expressions]) - logger.error( - f"\nFailed to generate IR for {contract.name}.{func.name}. Please open an issue https://github.com/crytic/slither/issues.\n{contract.name}.{func.name} ({func.source_mapping}):\n " - f"{func_expressions}" - ) - raise e - try: - contract.convert_expression_to_slithir_ssa() - except Exception as e: - logger.error( - f"\nFailed to convert IR to SSA for {contract.name} contract. Please open an issue https://github.com/crytic/slither/issues.\n " - ) - raise e - - for func in self._compilation_unit.functions_top_level: - try: - func.generate_slithir_and_analyze() - except AttributeError as e: - logger.error( - f"Impossible to generate IR for top level function {func.name} ({func.source_mapping}):\n {e}" - ) - except Exception as e: - func_expressions = "\n".join([f"\t{ex}" for ex in func.expressions]) - logger.error( - f"\nFailed to generate IR for top level function {func.name}. Please open an issue https://github.com/crytic/slither/issues.\n{func.name} ({func.source_mapping}):\n " - f"{func_expressions}" - ) - raise e - - try: - func.generate_slithir_ssa({}) - except Exception as e: - func_expressions = "\n".join([f"\t{ex}" for ex in func.expressions]) - logger.error( - f"\nFailed to convert IR to SSA for top level function {func.name}. Please open an issue https://github.com/crytic/slither/issues.\n{func.name} ({func.source_mapping}):\n " - f"{func_expressions}" - ) - raise e + generate_slithir_contract(contract) + + for function in self._compilation_unit.functions_top_level: + generate_slithir_function(function) + # + # with concurrent.futures.ProcessPoolExecutor() as executor: + # + # futures = [ + # executor.submit(generate_slithir_contract, contract) for contract in self._compilation_unit.contracts + # ] + [ + # executor.submit(generate_slithir_function, function) for function in self._compilation_unit.functions_top_level + # ] + # + # for future in concurrent.futures.as_completed(futures): + # future.result() self._compilation_unit.propagate_function_calls() for contract in self._compilation_unit.contracts: From ae6fc40b62c8c4bac7bbc71f4e485e7316bc13d7 Mon Sep 17 00:00:00 2001 From: Alexis Date: Fri, 19 Apr 2024 11:26:43 +0200 Subject: [PATCH 21/45] Remove unneeded metaclass --- slither/core/source_mapping/source_mapping.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/slither/core/source_mapping/source_mapping.py b/slither/core/source_mapping/source_mapping.py index fceab78559..078d5afab1 100644 --- a/slither/core/source_mapping/source_mapping.py +++ b/slither/core/source_mapping/source_mapping.py @@ -1,5 +1,4 @@ import re -from abc import ABCMeta from typing import Dict, Union, List, Tuple, TYPE_CHECKING, Optional, Any from Crypto.Hash import SHA1 @@ -183,7 +182,7 @@ def _convert_source_mapping( return new_source -class SourceMapping(Context, metaclass=ABCMeta): +class SourceMapping(Context): def __init__(self) -> None: super().__init__() self.source_mapping: Optional[Source] = None From bb842783674034666df8031a80b5fb716c1b53c8 Mon Sep 17 00:00:00 2001 From: Alexis Date: Fri, 19 Apr 2024 11:52:53 +0200 Subject: [PATCH 22/45] Prevent a call to isinstance in _filter_state_variables_written --- slither/core/declarations/function.py | 9 +++------ slither/core/expressions/identifier.py | 3 +++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/slither/core/declarations/function.py b/slither/core/declarations/function.py index 958a7d2199..4829f21023 100644 --- a/slither/core/declarations/function.py +++ b/slither/core/declarations/function.py @@ -94,14 +94,11 @@ class FunctionType(Enum): def _filter_state_variables_written(expressions: List["Expression"]): ret = [] + for expression in expressions: - if isinstance(expression, Identifier): - ret.append(expression) - if isinstance(expression, UnaryOperation): - ret.append(expression.expression) - if isinstance(expression, MemberAccess): + if isinstance(expression, (Identifier, UnaryOperation, MemberAccess)): ret.append(expression.expression) - if isinstance(expression, IndexAccess): + elif isinstance(expression, IndexAccess): ret.append(expression.expression_left) return ret diff --git a/slither/core/expressions/identifier.py b/slither/core/expressions/identifier.py index 5cd29a9f5d..493620ab18 100644 --- a/slither/core/expressions/identifier.py +++ b/slither/core/expressions/identifier.py @@ -78,3 +78,6 @@ def value( def __str__(self) -> str: return str(self._value) + + def expression(self): + return self From 59caf4bb3fc10b2e04173836eb6ae0f9f3a1d4c4 Mon Sep 17 00:00:00 2001 From: Alexis Date: Fri, 19 Apr 2024 14:08:05 +0200 Subject: [PATCH 23/45] Revert "Memoize calls to __str__" This reverts commit 6afe440924369910cd33890256ad6afb7677ce1a. --- slither/core/slither_core.py | 10 +- slither/core/solidity_types/array_type.py | 4 +- .../core/solidity_types/elementary_type.py | 4 +- slither/core/solidity_types/mapping_type.py | 4 +- .../slither_compilation_unit_solc.py | 127 ++++++++---------- 5 files changed, 57 insertions(+), 92 deletions(-) diff --git a/slither/core/slither_core.py b/slither/core/slither_core.py index 727c2e44c6..8eca260fac 100644 --- a/slither/core/slither_core.py +++ b/slither/core/slither_core.py @@ -35,14 +35,6 @@ def _relative_path_format(path: str) -> str: return path.split("..")[-1].strip(".").strip("/") -def empty_tuple_list(): - return [(-1, -1)] - - -def tuple_dict(): - return defaultdict(empty_tuple_list) - - # pylint: disable=too-many-instance-attributes,too-many-public-methods class SlitherCore(Context): """ @@ -88,7 +80,7 @@ def __init__(self) -> None: # Maps from file to detector name to the start/end ranges for that detector. # Infinity is used to signal a detector has no end range. self._ignore_ranges: Dict[str, Dict[str, List[Tuple[int, ...]]]] = defaultdict( - tuple_dict + lambda: defaultdict(lambda: [(-1, -1)]) ) self._compilation_units: List[SlitherCompilationUnit] = [] diff --git a/slither/core/solidity_types/array_type.py b/slither/core/solidity_types/array_type.py index 2541258913..04a458d685 100644 --- a/slither/core/solidity_types/array_type.py +++ b/slither/core/solidity_types/array_type.py @@ -1,4 +1,3 @@ -from functools import cache from typing import Union, Optional, Tuple, Any, TYPE_CHECKING from slither.core.expressions.expression import Expression @@ -67,7 +66,6 @@ def storage_size(self) -> Tuple[int, bool]: return elem_size * int(str(self._length_value)), True return 32, True - @cache def __str__(self) -> str: if self._length: return str(self._type) + f"[{str(self._length_value)}]" @@ -79,4 +77,4 @@ def __eq__(self, other: Any) -> bool: return self._type == other.type and self._length_value == other.length_value def __hash__(self) -> int: - return hash(self._type) + return hash(str(self)) diff --git a/slither/core/solidity_types/elementary_type.py b/slither/core/solidity_types/elementary_type.py index 63c3071ede..a9f45c8d81 100644 --- a/slither/core/solidity_types/elementary_type.py +++ b/slither/core/solidity_types/elementary_type.py @@ -1,5 +1,4 @@ import itertools -from functools import cache from typing import Tuple, Optional, Any from slither.core.solidity_types.type import Type @@ -217,7 +216,6 @@ def max(self) -> int: return MaxValues[self.name] raise SlitherException(f"{self.name} does not have a max value") - @cache def __str__(self) -> str: return self._type @@ -227,4 +225,4 @@ def __eq__(self, other: Any) -> bool: return self.type == other.type def __hash__(self) -> int: - return hash(self._type) + return hash(str(self)) diff --git a/slither/core/solidity_types/mapping_type.py b/slither/core/solidity_types/mapping_type.py index e7adb461cb..9741569edf 100644 --- a/slither/core/solidity_types/mapping_type.py +++ b/slither/core/solidity_types/mapping_type.py @@ -1,4 +1,3 @@ -from functools import cache from typing import Union, Tuple, TYPE_CHECKING, Any from slither.core.solidity_types.type import Type @@ -36,7 +35,6 @@ def storage_size(self) -> Tuple[int, bool]: def is_dynamic(self) -> bool: return True - @cache def __str__(self) -> str: return f"mapping({str(self._from)} => {str(self._to)})" @@ -46,4 +44,4 @@ def __eq__(self, other: Any) -> bool: return self.type_from == other.type_from and self.type_to == other.type_to def __hash__(self) -> int: - return hash(f"{self._from}.{self._to}") + return hash(str(self)) diff --git a/slither/solc_parsing/slither_compilation_unit_solc.py b/slither/solc_parsing/slither_compilation_unit_solc.py index b3bb0d46a9..36efeef33a 100644 --- a/slither/solc_parsing/slither_compilation_unit_solc.py +++ b/slither/solc_parsing/slither_compilation_unit_solc.py @@ -1,4 +1,3 @@ -import concurrent.futures from collections import defaultdict import json import logging @@ -74,64 +73,6 @@ def _handle_import_aliases( ) -def generate_slithir_contract(contract): - contract.add_constructor_variables() - - for func in contract.functions + contract.modifiers: - try: - func.generate_slithir_and_analyze() - - except AttributeError as e: - # This can happen for example if there is a call to an interface - # And the interface is redefined due to contract's name reuse - # But the available version misses some functions - # self._underlying_contract_to_parser[contract].log_incorrect_parsing( - # f"Impossible to generate IR for {contract.name}.{func.name} ({func.source_mapping}):\n {e}" - # ) - # TODO(dm) - pass - except Exception as e: - func_expressions = "\n".join([f"\t{ex}" for ex in func.expressions]) - logger.error( - f"\nFailed to generate IR for {contract.name}.{func.name}. Please open an issue https://github.com/crytic/slither/issues.\n{contract.name}.{func.name} ({func.source_mapping}):\n " - f"{func_expressions}" - ) - raise e - try: - contract.convert_expression_to_slithir_ssa() - except Exception as exc: - logger.error( - f"\nFailed to convert IR to SSA for {contract.name} contract. Please open an issue https://github.com/crytic/slither/issues.\n " - ) - raise exc - - -def generate_slithir_function(func): - try: - func.generate_slithir_and_analyze() - except AttributeError as e: - logger.error( - f"Impossible to generate IR for top level function {func.name} ({func.source_mapping}):\n {e}" - ) - except Exception as e: - func_expressions = "\n".join([f"\t{ex}" for ex in func.expressions]) - logger.error( - f"\nFailed to generate IR for top level function {func.name}. Please open an issue https://github.com/crytic/slither/issues.\n{func.name} ({func.source_mapping}):\n " - f"{func_expressions}" - ) - raise e - - try: - func.generate_slithir_ssa({}) - except Exception as e: - func_expressions = "\n".join([f"\t{ex}" for ex in func.expressions]) - logger.error( - f"\nFailed to convert IR to SSA for top level function {func.name}. Please open an issue https://github.com/crytic/slither/issues.\n{func.name} ({func.source_mapping}):\n " - f"{func_expressions}" - ) - raise e - - class SlitherCompilationUnitSolc(CallerContextExpression): # pylint: disable=too-many-instance-attributes def __init__(self, compilation_unit: SlitherCompilationUnit) -> None: @@ -862,22 +803,60 @@ def _analyze_variables_modifiers_functions(self, contract: ContractSolc) -> None contract.set_is_analyzed(True) def _convert_to_slithir(self) -> None: + for contract in self._compilation_unit.contracts: - generate_slithir_contract(contract) - - for function in self._compilation_unit.functions_top_level: - generate_slithir_function(function) - # - # with concurrent.futures.ProcessPoolExecutor() as executor: - # - # futures = [ - # executor.submit(generate_slithir_contract, contract) for contract in self._compilation_unit.contracts - # ] + [ - # executor.submit(generate_slithir_function, function) for function in self._compilation_unit.functions_top_level - # ] - # - # for future in concurrent.futures.as_completed(futures): - # future.result() + contract.add_constructor_variables() + + for func in contract.functions + contract.modifiers: + try: + func.generate_slithir_and_analyze() + + except AttributeError as e: + # This can happens for example if there is a call to an interface + # And the interface is redefined due to contract's name reuse + # But the available version misses some functions + self._underlying_contract_to_parser[contract].log_incorrect_parsing( + f"Impossible to generate IR for {contract.name}.{func.name} ({func.source_mapping}):\n {e}" + ) + except Exception as e: + func_expressions = "\n".join([f"\t{ex}" for ex in func.expressions]) + logger.error( + f"\nFailed to generate IR for {contract.name}.{func.name}. Please open an issue https://github.com/crytic/slither/issues.\n{contract.name}.{func.name} ({func.source_mapping}):\n " + f"{func_expressions}" + ) + raise e + try: + contract.convert_expression_to_slithir_ssa() + except Exception as e: + logger.error( + f"\nFailed to convert IR to SSA for {contract.name} contract. Please open an issue https://github.com/crytic/slither/issues.\n " + ) + raise e + + for func in self._compilation_unit.functions_top_level: + try: + func.generate_slithir_and_analyze() + except AttributeError as e: + logger.error( + f"Impossible to generate IR for top level function {func.name} ({func.source_mapping}):\n {e}" + ) + except Exception as e: + func_expressions = "\n".join([f"\t{ex}" for ex in func.expressions]) + logger.error( + f"\nFailed to generate IR for top level function {func.name}. Please open an issue https://github.com/crytic/slither/issues.\n{func.name} ({func.source_mapping}):\n " + f"{func_expressions}" + ) + raise e + + try: + func.generate_slithir_ssa({}) + except Exception as e: + func_expressions = "\n".join([f"\t{ex}" for ex in func.expressions]) + logger.error( + f"\nFailed to convert IR to SSA for top level function {func.name}. Please open an issue https://github.com/crytic/slither/issues.\n{func.name} ({func.source_mapping}):\n " + f"{func_expressions}" + ) + raise e self._compilation_unit.propagate_function_calls() for contract in self._compilation_unit.contracts: From 85b39ea915a64e7e5949f857c798a8e22858d2cc Mon Sep 17 00:00:00 2001 From: Alexis Date: Fri, 19 Apr 2024 14:28:33 +0200 Subject: [PATCH 24/45] Add missing expression types --- slither/visitors/expression/expression.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/slither/visitors/expression/expression.py b/slither/visitors/expression/expression.py index 860ca28503..f60fb2b5a0 100644 --- a/slither/visitors/expression/expression.py +++ b/slither/visitors/expression/expression.py @@ -17,6 +17,9 @@ from slither.core.expressions.tuple_expression import TupleExpression from slither.core.expressions.type_conversion import TypeConversion from slither.core.expressions.unary_operation import UnaryOperation +from slither.core.expressions.super_call_expression import SuperCallExpression +from slither.core.expressions.super_identifier import SuperIdentifier +from slither.core.expressions.self_identifier import SelfIdentifier from slither.exceptions import SlitherError logger = logging.getLogger("ExpressionVisitor") @@ -40,7 +43,10 @@ def get_visitor_mapping(): NewElementaryType: '_visit_new_elementary_type', TupleExpression: '_visit_tuple_expression', TypeConversion: '_visit_type_conversion', - UnaryOperation: '_visit_unary_operation' + UnaryOperation: '_visit_unary_operation', + SelfIdentifier: '_visit_identifier', + SuperIdentifier: '_visit_identifier', + SuperCallExpression: '_visit_call_expression', } From 74d88371b4758580f2d550e744fb17f95341ea9f Mon Sep 17 00:00:00 2001 From: Alexis Date: Fri, 19 Apr 2024 16:48:47 +0200 Subject: [PATCH 25/45] Fix bugs in the EVM printer --- slither/analyses/evm/convert.py | 8 ++- slither/printers/summary/evm.py | 86 +++++++++++++++++---------------- 2 files changed, 48 insertions(+), 46 deletions(-) diff --git a/slither/analyses/evm/convert.py b/slither/analyses/evm/convert.py index 5e8c4a1280..fe294798e5 100644 --- a/slither/analyses/evm/convert.py +++ b/slither/analyses/evm/convert.py @@ -178,15 +178,14 @@ def generate_source_to_evm_ins_mapping(evm_instructions, srcmap_runtime, slither # In order to compress these source mappings especially for bytecode, the following rules are used: # If a field is empty, the value of the preceding element is used. # If a : is missing, all following fields are considered empty. - mapping_item = mapping.split(":") mapping_item += prev_mapping[len(mapping_item) :] for i, _ in enumerate(mapping_item): if mapping_item[i] == "": - mapping_item[i] = int(prev_mapping[i]) + mapping_item[i] = prev_mapping[i] - offset, _length, file_id, *_ = mapping_item + offset, _, file_id, *_ = mapping_item prev_mapping = mapping_item if file_id == "-1": @@ -194,8 +193,7 @@ def generate_source_to_evm_ins_mapping(evm_instructions, srcmap_runtime, slither # See https://github.com/ethereum/solidity/issues/6119#issuecomment-467797635 continue - offset = int(offset) - line_number = file_source[0:offset].count("\n".encode("utf-8")) + 1 + line_number = file_source[0 : int(offset)].count("\n".encode("utf-8")) + 1 # Append evm instructions to the corresponding source line number # Note: Some evm instructions in mapping are not necessarily in program execution order diff --git a/slither/printers/summary/evm.py b/slither/printers/summary/evm.py index aad71bdff8..b834eb6eb8 100644 --- a/slither/printers/summary/evm.py +++ b/slither/printers/summary/evm.py @@ -2,8 +2,11 @@ Module printing evm mapping of the contract """ import logging +from typing import Union, List, Dict from slither.printers.abstract_printer import AbstractPrinter +from slither.core.declarations.function import Function +from slither.core.declarations.modifier import Modifier from slither.analyses.evm import ( generate_source_to_evm_ins_mapping, load_evm_cfg_builder, @@ -77,6 +80,33 @@ class PrinterEVM(AbstractPrinter): WIKI = "https://github.com/trailofbits/slither/wiki/Printer-documentation#evm" + def build_element_node_str( + self, + element: Union["Modifier", "Function"], + contract_pcs: Dict[int, List[int]], + contract_cfg, + ) -> str: + element_file = self.slither.source_code[ + element.contract_declarer.source_mapping.filename.absolute + ].splitlines() + + return_string = "" + for node in element.nodes: + return_string += green(f"\t\tNode: {node}\n") + node_source_line = node.source_mapping.lines[0] + return_string += green( + f"\t\tSource line {node_source_line}: {element_file[node_source_line - 1].rstrip()}\n" + ) + + return_string += magenta("\t\tEVM Instructions:\n") + node_pcs = contract_pcs.get(node_source_line, []) + for pc in node_pcs: + return_string += magenta( + f"\t\t\t{hex(pc)}: {contract_cfg.get_instruction_at(pc)}\n" + ) + + return return_string + def output(self, _filename): """ _filename is not used @@ -99,53 +129,27 @@ def output(self, _filename): txt += "\tempty contract\n" continue - contract_file = self.slither.source_code[ - contract.source_mapping.filename.absolute - ].encode("utf-8") - with open(contract.source_mapping.filename.absolute, "r", encoding="utf8") as f: - contract_file_lines = f.readlines() - - contract_pcs = {} - contract_cfg = {} - for function in contract.functions: txt += blue(f"\tFunction {function.canonical_name}\n") - # CFG and source mapping depend on function being constructor or not - if function.is_constructor: - contract_cfg = evm_info["cfg_init", contract.name] - contract_pcs = evm_info["mapping_init", contract.name] - else: - contract_cfg = evm_info["cfg", contract.name] - contract_pcs = evm_info["mapping", contract.name] - - for node in function.nodes: - txt += green("\t\tNode: " + str(node) + "\n") - node_source_line = ( - contract_file[0 : node.source_mapping.start].count("\n".encode("utf-8")) + 1 - ) - txt += green( - f"\t\tSource line {node_source_line}: {contract_file_lines[node_source_line - 1].rstrip()}\n" - ) - txt += magenta("\t\tEVM Instructions:\n") - node_pcs = contract_pcs.get(node_source_line, []) - for pc in node_pcs: - txt += magenta(f"\t\t\t{hex(pc)}: {contract_cfg.get_instruction_at(pc)}\n") + txt += self.build_element_node_str( + function, + evm_info["mapping", contract.name] + if not function.is_constructor + else evm_info["mapping_init", contract.name], + evm_info["cfg", contract.name] + if not function.is_constructor + else evm_info["cfg_init", contract.name], + ) for modifier in contract.modifiers: txt += blue(f"\tModifier {modifier.canonical_name}\n") - for node in modifier.nodes: - txt += green("\t\tNode: " + str(node) + "\n") - node_source_line = ( - contract_file[0 : node.source_mapping.start].count("\n".encode("utf-8")) + 1 - ) - txt += green( - f"\t\tSource line {node_source_line}: {contract_file_lines[node_source_line - 1].rstrip()}\n" - ) - txt += magenta("\t\tEVM Instructions:\n") - node_pcs = contract_pcs.get(node_source_line, []) - for pc in node_pcs: - txt += magenta(f"\t\t\t{hex(pc)}: {contract_cfg.get_instruction_at(pc)}\n") + + txt += self.build_element_node_str( + modifier, + evm_info["mapping", contract.name], + evm_info["cfg", contract.name], + ) self.info(txt) res = self.generate_output(txt) From 2979cb85ac06f1b059bbec8e90e7dbb4a6755d35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= Date: Fri, 19 Apr 2024 16:34:19 -0300 Subject: [PATCH 26/45] Restore plugin example to working state The current example depended on a very old Slither version, and triggered an error due to its empty description, URL, etc. Add example values so the detector can be run. --- plugin_example/setup.py | 4 ++-- plugin_example/slither_my_plugin/detectors/__init__.py | 0 plugin_example/slither_my_plugin/detectors/example.py | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 plugin_example/slither_my_plugin/detectors/__init__.py diff --git a/plugin_example/setup.py b/plugin_example/setup.py index 1bc065394a..908ad51da2 100644 --- a/plugin_example/setup.py +++ b/plugin_example/setup.py @@ -1,14 +1,14 @@ from setuptools import setup, find_packages setup( - name="slither-my-plugins", + name="slither_my_plugin", description="This is an example of detectors and printers to Slither.", url="https://github.com/trailofbits/slither-plugins", author="Trail of Bits", version="0.0", packages=find_packages(), python_requires=">=3.8", - install_requires=["slither-analyzer==0.1"], + install_requires=["slither-analyzer>=0.6.0"], entry_points={ "slither_analyzer.plugin": "slither my-plugin=slither_my_plugin:make_plugin", }, diff --git a/plugin_example/slither_my_plugin/detectors/__init__.py b/plugin_example/slither_my_plugin/detectors/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/plugin_example/slither_my_plugin/detectors/example.py b/plugin_example/slither_my_plugin/detectors/example.py index 2f10cb518a..edf2d382ad 100644 --- a/plugin_example/slither_my_plugin/detectors/example.py +++ b/plugin_example/slither_my_plugin/detectors/example.py @@ -11,12 +11,12 @@ class Example(AbstractDetector): # pylint: disable=too-few-public-methods IMPACT = DetectorClassification.HIGH CONFIDENCE = DetectorClassification.HIGH - WIKI = "" + WIKI = "https://www.example.com/#example-detector" - WIKI_TITLE = "" - WIKI_DESCRIPTION = "" - WIKI_EXPLOIT_SCENARIO = "" - WIKI_RECOMMENDATION = "" + WIKI_TITLE = "example detector" + WIKI_DESCRIPTION = "This is an example detector that always generates a finding" + WIKI_EXPLOIT_SCENARIO = "Scenario goes here" + WIKI_RECOMMENDATION = "Customize the detector" def _detect(self): From 68adb6e05465dfc2ecf546d57e92abfddde81294 Mon Sep 17 00:00:00 2001 From: Alexis Date: Mon, 22 Apr 2024 11:09:47 +0200 Subject: [PATCH 27/45] Continue performance improvments --- slither/core/declarations/custom_error.py | 1 + slither/core/declarations/import_directive.py | 2 + slither/core/declarations/pragma_directive.py | 1 + .../core/solidity_types/elementary_type.py | 2 +- slither/core/solidity_types/type_alias.py | 1 + slither/core/source_mapping/source_mapping.py | 42 +++++++++++++------ slither/utils/source_mapping.py | 28 ++----------- slither/visitors/expression/expression.py | 36 ++++++++-------- 8 files changed, 58 insertions(+), 55 deletions(-) diff --git a/slither/core/declarations/custom_error.py b/slither/core/declarations/custom_error.py index 234873eaca..6e2cf142ff 100644 --- a/slither/core/declarations/custom_error.py +++ b/slither/core/declarations/custom_error.py @@ -17,6 +17,7 @@ def __init__(self, compilation_unit: "SlitherCompilationUnit") -> None: self._solidity_signature: Optional[str] = None self._full_name: Optional[str] = None + self._pattern = "error" @property def name(self) -> str: diff --git a/slither/core/declarations/import_directive.py b/slither/core/declarations/import_directive.py index 19ea2cff96..440b09e9cd 100644 --- a/slither/core/declarations/import_directive.py +++ b/slither/core/declarations/import_directive.py @@ -16,6 +16,8 @@ def __init__(self, filename: Path, scope: "FileScope") -> None: # Map local name -> original name self.renaming: Dict[str, str] = {} + self._pattern = "import" + @property def filename(self) -> str: """ diff --git a/slither/core/declarations/pragma_directive.py b/slither/core/declarations/pragma_directive.py index cd790d5a47..90c1da2ddf 100644 --- a/slither/core/declarations/pragma_directive.py +++ b/slither/core/declarations/pragma_directive.py @@ -11,6 +11,7 @@ def __init__(self, directive: List[str], scope: "FileScope") -> None: super().__init__() self._directive = directive self.scope: "FileScope" = scope + self._pattern = "pragma" @property def directive(self) -> List[str]: diff --git a/slither/core/solidity_types/elementary_type.py b/slither/core/solidity_types/elementary_type.py index a9f45c8d81..61729b06a2 100644 --- a/slither/core/solidity_types/elementary_type.py +++ b/slither/core/solidity_types/elementary_type.py @@ -225,4 +225,4 @@ def __eq__(self, other: Any) -> bool: return self.type == other.type def __hash__(self) -> int: - return hash(str(self)) + return hash(self._type) diff --git a/slither/core/solidity_types/type_alias.py b/slither/core/solidity_types/type_alias.py index ead9b5394f..c22cd257ef 100644 --- a/slither/core/solidity_types/type_alias.py +++ b/slither/core/solidity_types/type_alias.py @@ -15,6 +15,7 @@ def __init__(self, underlying_type: ElementaryType, name: str) -> None: super().__init__() self.name = name self.underlying_type = underlying_type + self._pattern = "type" @property def type(self) -> ElementaryType: diff --git a/slither/core/source_mapping/source_mapping.py b/slither/core/source_mapping/source_mapping.py index 078d5afab1..8dda25a241 100644 --- a/slither/core/source_mapping/source_mapping.py +++ b/slither/core/source_mapping/source_mapping.py @@ -98,21 +98,29 @@ def __str__(self) -> str: return f"{filename_short}{lines}" def __hash__(self) -> int: - return hash(str(self)) + return hash( + ( + self.start, + self.length, + self.filename.relative, + self.end, + ) + ) def __eq__(self, other: Any) -> bool: - if not isinstance(other, type(self)): + try: + return ( + self.start == other.start + and self.length == other.length + and self.filename == other.filename + and self.is_dependency == other.is_dependency + and self.lines == other.lines + and self.starting_column == other.starting_column + and self.ending_column == other.ending_column + and self.end == other.end + ) + except AttributeError: return NotImplemented - return ( - self.start == other.start - and self.length == other.length - and self.filename == other.filename - and self.is_dependency == other.is_dependency - and self.lines == other.lines - and self.starting_column == other.starting_column - and self.ending_column == other.ending_column - and self.end == other.end - ) def _compute_line( @@ -188,6 +196,8 @@ def __init__(self) -> None: self.source_mapping: Optional[Source] = None self.references: List[Source] = [] + self._pattern: Union[str, None] = None + def set_offset( self, offset: Union["Source", str], compilation_unit: "SlitherCompilationUnit" ) -> None: @@ -203,3 +213,11 @@ def add_reference_from_raw_source( ) -> None: s = _convert_source_mapping(offset, compilation_unit) self.references.append(s) + + @property + def pattern(self) -> str: + if self._pattern is None: + # Add " " to look after the first solidity keyword + return f" {self.name}" # pylint: disable=no-member + + return self._pattern diff --git a/slither/utils/source_mapping.py b/slither/utils/source_mapping.py index 9bf772894e..180c842f72 100644 --- a/slither/utils/source_mapping.py +++ b/slither/utils/source_mapping.py @@ -2,37 +2,17 @@ from crytic_compile import CryticCompile from slither.core.declarations import ( Contract, - Function, - Enum, - Event, - Import, - Pragma, - Structure, - CustomError, FunctionContract, ) -from slither.core.solidity_types import Type, TypeAlias from slither.core.source_mapping.source_mapping import Source, SourceMapping -from slither.core.variables.variable import Variable from slither.exceptions import SlitherError def get_definition(target: SourceMapping, crytic_compile: CryticCompile) -> Source: - if isinstance(target, (Contract, Function, Enum, Event, Structure, Variable)): - # Add " " to look after the first solidity keyword - pattern = " " + target.name - elif isinstance(target, Import): - pattern = "import" - elif isinstance(target, Pragma): - pattern = "pragma" # todo maybe return with the while pragma statement - elif isinstance(target, CustomError): - pattern = "error" - elif isinstance(target, TypeAlias): - pattern = "type" - elif isinstance(target, Type): - raise SlitherError("get_definition_generic not implemented for types") - else: - raise SlitherError(f"get_definition_generic not implemented for {type(target)}") + try: + pattern = target.pattern + except AttributeError as exc: + raise SlitherError(f"get_definition_generic not implemented for {type(target)}") from exc file_content = crytic_compile.src_content_for_file(target.source_mapping.filename.absolute) txt = file_content[ diff --git a/slither/visitors/expression/expression.py b/slither/visitors/expression/expression.py index f60fb2b5a0..f727273864 100644 --- a/slither/visitors/expression/expression.py +++ b/slither/visitors/expression/expression.py @@ -29,24 +29,24 @@ def get_visitor_mapping(): """Returns a visitor mapping from expression type to visiting functions.""" return { - AssignmentOperation: '_visit_assignement_operation', - BinaryOperation: '_visit_binary_operation', - CallExpression: '_visit_call_expression', - ConditionalExpression: '_visit_conditional_expression', - ElementaryTypeNameExpression: '_visit_elementary_type_name_expression', - Identifier: '_visit_identifier', - IndexAccess: '_visit_index_access', - Literal: '_visit_literal', - MemberAccess: '_visit_member_access', - NewArray: '_visit_new_array', - NewContract: '_visit_new_contract', - NewElementaryType: '_visit_new_elementary_type', - TupleExpression: '_visit_tuple_expression', - TypeConversion: '_visit_type_conversion', - UnaryOperation: '_visit_unary_operation', - SelfIdentifier: '_visit_identifier', - SuperIdentifier: '_visit_identifier', - SuperCallExpression: '_visit_call_expression', + AssignmentOperation: "_visit_assignement_operation", + BinaryOperation: "_visit_binary_operation", + CallExpression: "_visit_call_expression", + ConditionalExpression: "_visit_conditional_expression", + ElementaryTypeNameExpression: "_visit_elementary_type_name_expression", + Identifier: "_visit_identifier", + IndexAccess: "_visit_index_access", + Literal: "_visit_literal", + MemberAccess: "_visit_member_access", + NewArray: "_visit_new_array", + NewContract: "_visit_new_contract", + NewElementaryType: "_visit_new_elementary_type", + TupleExpression: "_visit_tuple_expression", + TypeConversion: "_visit_type_conversion", + UnaryOperation: "_visit_unary_operation", + SelfIdentifier: "_visit_identifier", + SuperIdentifier: "_visit_identifier", + SuperCallExpression: "_visit_call_expression", } From 82f295f2d072f214ebf3f25f9a91fc019fbb2229 Mon Sep 17 00:00:00 2001 From: Alexis Date: Mon, 22 Apr 2024 11:33:03 +0200 Subject: [PATCH 28/45] Replace cache with lru_cache to keep Py3.8 compatibility --- slither/visitors/expression/expression.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slither/visitors/expression/expression.py b/slither/visitors/expression/expression.py index f727273864..83dd1be51a 100644 --- a/slither/visitors/expression/expression.py +++ b/slither/visitors/expression/expression.py @@ -1,5 +1,5 @@ import logging -from functools import cache +from functools import lru_cache from slither.core.expressions.assignment_operation import AssignmentOperation from slither.core.expressions.binary_operation import BinaryOperation @@ -25,7 +25,7 @@ logger = logging.getLogger("ExpressionVisitor") -@cache +@lru_cache() def get_visitor_mapping(): """Returns a visitor mapping from expression type to visiting functions.""" return { From 8c46b9ea7c9683e369e9f30f67d30d5347087935 Mon Sep 17 00:00:00 2001 From: Alexis Date: Tue, 23 Apr 2024 09:59:00 +0200 Subject: [PATCH 29/45] Configure coderabbit review to also consider PR on dev branch. --- .coderabbit.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .coderabbit.yaml diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 0000000000..c1e63d0c0e --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,25 @@ +# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json +language: "en" +early_access: false +knowledge_base: + learnings: + scope: auto + issues: + scope: global +reviews: + profile: "chill" + request_changes_workflow: false + high_level_summary: true + poem: false + review_status: true + collapse_walkthrough: true + auto_review: + enabled: true + ignore_title_keywords: + - "WIP" + - "DO NOT MERGE" + drafts: false + base_branches: + - dev +chat: + auto_reply: true \ No newline at end of file From 7fff11b7251f20159465a73f81f477c01e55d576 Mon Sep 17 00:00:00 2001 From: alwayshang Date: Wed, 24 Apr 2024 17:20:24 +0800 Subject: [PATCH 30/45] chore: fix some typos in comments Signed-off-by: alwayshang --- slither/detectors/compiler_bugs/reused_base_constructor.py | 2 +- slither/solc_parsing/declarations/contract.py | 2 +- tests/unit/core/test_source_mapping.py | 2 +- tests/unit/slithir/test_data/ternary_expressions.sol | 2 +- tests/unit/slithir/test_ssa_generation.py | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/slither/detectors/compiler_bugs/reused_base_constructor.py b/slither/detectors/compiler_bugs/reused_base_constructor.py index 73bd410c79..4764dc6419 100644 --- a/slither/detectors/compiler_bugs/reused_base_constructor.py +++ b/slither/detectors/compiler_bugs/reused_base_constructor.py @@ -35,7 +35,7 @@ class ReusedBaseConstructor(AbstractDetector): ARGUMENT = "reused-constructor" HELP = "Reused base constructor" IMPACT = DetectorClassification.MEDIUM - # The confidence is medium, because prior Solidity 0.4.22, we cant differentiate + # The confidence is medium, because prior Solidity 0.4.22, we can't differentiate # contract C is A() { # to # contract C is A { diff --git a/slither/solc_parsing/declarations/contract.py b/slither/solc_parsing/declarations/contract.py index ebab0e6df4..1ccdc57602 100644 --- a/slither/solc_parsing/declarations/contract.py +++ b/slither/solc_parsing/declarations/contract.py @@ -593,7 +593,7 @@ def _analyze_params_elements( # pylint: disable=too-many-arguments,too-many-loc def analyze_constant_state_variables(self) -> None: for var_parser in self._variables_parser: if var_parser.underlying_variable.is_constant: - # cant parse constant expression based on function calls + # can't parse constant expression based on function calls try: var_parser.analyze(self) except (VariableNotFound, KeyError) as e: diff --git a/tests/unit/core/test_source_mapping.py b/tests/unit/core/test_source_mapping.py index 298a192d5f..2a1bbc5510 100644 --- a/tests/unit/core/test_source_mapping.py +++ b/tests/unit/core/test_source_mapping.py @@ -58,7 +58,7 @@ def test_source_mapping_inheritance(solc_binary_path, solc_version): assert {(x.start, x.end) for x in slither.offset_to_implementations(file, 203)} == {(193, 230)} # Offset 93 is the call to f() in A.test() - # This can lead to three differents functions, depending on the current contract's context + # This can lead to three different functions, depending on the current contract's context functions = slither.offset_to_objects(file, 93) print(functions) assert len(functions) == 3 diff --git a/tests/unit/slithir/test_data/ternary_expressions.sol b/tests/unit/slithir/test_data/ternary_expressions.sol index 1ccd51d34d..43ba9b9cb2 100644 --- a/tests/unit/slithir/test_data/ternary_expressions.sol +++ b/tests/unit/slithir/test_data/ternary_expressions.sol @@ -6,7 +6,7 @@ contract C { // TODO // 1) support variable declarations //uint min = 1 > 0 ? 1 : 2; - // 2) suppory ternary index range access + // 2) support ternary index range access // function e(bool cond, bytes calldata x) external { // bytes memory a = x[cond ? 1 : 2 :]; // } diff --git a/tests/unit/slithir/test_ssa_generation.py b/tests/unit/slithir/test_ssa_generation.py index 1a709c2f78..1358fa957c 100644 --- a/tests/unit/slithir/test_ssa_generation.py +++ b/tests/unit/slithir/test_ssa_generation.py @@ -502,7 +502,7 @@ def test_storage_refers_to(slither_from_solidity_source): When a phi-node is created, ensure refers_to is propagated to the phi-node. Assignments also propagate refers_to. Whenever a ReferenceVariable is the destination of an assignment (e.g. s.v = 10) - below, create additional versions of the variables it refers to record that a a + below, create additional versions of the variables it refers to record that a write was made. In the current implementation, this is referenced by phis. """ source = """ @@ -550,7 +550,7 @@ def test_storage_refers_to(slither_from_solidity_source): entryphi = [x for x in phinodes if x.lvalue in sphi.lvalue.refers_to] assert len(entryphi) == 2 - # The remaining two phis are the ones recording that write through ReferenceVariable occured + # The remaining two phis are the ones recording that write through ReferenceVariable occurred for ephi in entryphi: phinodes.remove(ephi) phinodes.remove(sphi) From e2daa8ac6e6d583d4b0c9f31bb17b0ad490d52cc Mon Sep 17 00:00:00 2001 From: Ngalim Siregar Date: Tue, 23 Apr 2024 07:24:59 +0700 Subject: [PATCH 31/45] Add detectors_to_include to override exclude args --- slither/__main__.py | 73 +++++++++++++++++++++-------------- slither/utils/command_line.py | 1 + 2 files changed, 45 insertions(+), 29 deletions(-) diff --git a/slither/__main__.py b/slither/__main__.py index 4fc83a11e5..a4ff784db1 100644 --- a/slither/__main__.py +++ b/slither/__main__.py @@ -11,7 +11,7 @@ import sys import traceback from importlib import metadata -from typing import Tuple, Optional, List, Dict, Type, Union, Any, Sequence +from typing import Any, Dict, List, Optional, Sequence, Set, Tuple, Type, Union from crytic_compile import cryticparser, CryticCompile, InvalidCompilation @@ -211,47 +211,54 @@ def choose_detectors( if args.detectors_to_run == "all": detectors_to_run = all_detector_classes - if args.detectors_to_exclude: - detectors_excluded = args.detectors_to_exclude.split(",") - for detector in detectors: - if detector in detectors_excluded: - detectors_to_run.remove(detectors[detector]) else: - for detector in args.detectors_to_run.split(","): - if detector in detectors: - detectors_to_run.append(detectors[detector]) - else: - raise ValueError(f"Error: {detector} is not a detector") - detectors_to_run = sorted(detectors_to_run, key=lambda x: x.IMPACT) + detectors_to_run = __include_detectors( + set(detectors_to_run), args.detectors_to_run, detectors + ) return detectors_to_run - if args.exclude_optimization: - detectors_to_run = [ - d for d in detectors_to_run if d.IMPACT != DetectorClassification.OPTIMIZATION - ] + classification_map = { + DetectorClassification.HIGH: args.exclude_high, + DetectorClassification.MEDIUM: args.exclude_medium, + DetectorClassification.LOW: args.exclude_low, + DetectorClassification.INFORMATIONAL: args.exclude_informational, + DetectorClassification.OPTIMIZATION: args.exclude_optimization, + } + excluded_classification = [ + classification for classification, included in classification_map.items() if included + ] + detectors_to_run = [d for d in detectors_to_run if d.IMPACT not in excluded_classification] - if args.exclude_informational: - detectors_to_run = [ - d for d in detectors_to_run if d.IMPACT != DetectorClassification.INFORMATIONAL - ] - if args.exclude_low: - detectors_to_run = [d for d in detectors_to_run if d.IMPACT != DetectorClassification.LOW] - if args.exclude_medium: - detectors_to_run = [ - d for d in detectors_to_run if d.IMPACT != DetectorClassification.MEDIUM - ] - if args.exclude_high: - detectors_to_run = [d for d in detectors_to_run if d.IMPACT != DetectorClassification.HIGH] if args.detectors_to_exclude: detectors_to_run = [ d for d in detectors_to_run if d.ARGUMENT not in args.detectors_to_exclude ] - detectors_to_run = sorted(detectors_to_run, key=lambda x: x.IMPACT) + if args.detectors_to_include: + detectors_to_run = __include_detectors( + set(detectors_to_run), args.detectors_to_include, detectors + ) return detectors_to_run +def __include_detectors( + detectors_to_run: Set[Type[AbstractDetector]], + detectors_to_include: str, + detectors: Dict[str, Type[AbstractDetector]], +) -> List[Type[AbstractDetector]]: + include_detectors = detectors_to_include.split(",") + + for detector in include_detectors: + if detector in detectors: + detectors_to_run.add(detectors[detector]) + else: + raise ValueError(f"Error: {detector} is not a detector") + + detectors_to_run = sorted(detectors_to_run, key=lambda x: x.IMPACT) + return detectors_to_run + + def choose_printers( args: argparse.Namespace, all_printer_classes: List[Type[AbstractPrinter]] ) -> List[Type[AbstractPrinter]]: @@ -407,6 +414,14 @@ def parse_args( default=defaults_flag_in_config["exclude_high"], ) + group_detector.add_argument( + "--include-detectors", + help="Comma-separated list of detectors that should be included", + action="store", + dest="detectors_to_include", + default=defaults_flag_in_config["detectors_to_include"], + ) + fail_on_group = group_detector.add_mutually_exclusive_group() fail_on_group.add_argument( "--fail-pedantic", diff --git a/slither/utils/command_line.py b/slither/utils/command_line.py index a37e859133..f5b9ab4527 100644 --- a/slither/utils/command_line.py +++ b/slither/utils/command_line.py @@ -48,6 +48,7 @@ class FailOnLevel(enum.Enum): "detectors_to_run": "all", "printers_to_run": None, "detectors_to_exclude": None, + "detectors_to_include": None, "exclude_dependencies": False, "exclude_informational": False, "exclude_optimization": False, From 0dca6a6760f07f65c37dc19bac6c3e48989e528d Mon Sep 17 00:00:00 2001 From: snoppy Date: Sat, 4 May 2024 17:05:10 +0800 Subject: [PATCH 32/45] chore: fix typos and link update Signed-off-by: snoppy --- slither/tools/documentation/README.md | 2 +- slither/visitors/expression/read_var.py | 4 ++-- slither/visitors/slithir/expression_to_slithir.py | 2 +- slither/vyper_parsing/declarations/contract.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/slither/tools/documentation/README.md b/slither/tools/documentation/README.md index b4b3e6a76b..218f2e91d2 100644 --- a/slither/tools/documentation/README.md +++ b/slither/tools/documentation/README.md @@ -1,5 +1,5 @@ # slither-documentation -`slither-documentation` uses [codex](https://beta.openai.com) to generate natspec documenation. +`slither-documentation` uses [codex](https://platform.openai.com) to generate natspec documenation. This tool is experimental. See [solmate documentation](https://github.com/montyly/solmate/pull/1) for an example of usage. diff --git a/slither/visitors/expression/read_var.py b/slither/visitors/expression/read_var.py index a0efdde618..9619cfff9b 100644 --- a/slither/visitors/expression/read_var.py +++ b/slither/visitors/expression/read_var.py @@ -50,8 +50,8 @@ def result(self) -> List[Expression]: self._result = list(set(get(self.expression))) return self._result - # overide assignement - # dont explore if its direct assignement (we explore if its +=, -=, ...) + # override assignment + # dont explore if its direct assignment (we explore if its +=, -=, ...) def _visit_assignement_operation(self, expression: AssignmentOperation) -> None: if expression.type != AssignmentOperationType.ASSIGN: self._visit_expression(expression.expression_left) diff --git a/slither/visitors/slithir/expression_to_slithir.py b/slither/visitors/slithir/expression_to_slithir.py index 0f91f9bd16..7d0ac4abf1 100644 --- a/slither/visitors/slithir/expression_to_slithir.py +++ b/slither/visitors/slithir/expression_to_slithir.py @@ -188,7 +188,7 @@ def _post_assignement_operation(self, expression: AssignmentOperation) -> None: right = get(expression.expression_right) operation: Operation if isinstance(left, list): # tuple expression: - if isinstance(right, list): # unbox assigment + if isinstance(right, list): # unbox assignment assert len(left) == len(right) for idx, _ in enumerate(left): if ( diff --git a/slither/vyper_parsing/declarations/contract.py b/slither/vyper_parsing/declarations/contract.py index 2acd43e0fa..64fab1c549 100644 --- a/slither/vyper_parsing/declarations/contract.py +++ b/slither/vyper_parsing/declarations/contract.py @@ -84,7 +84,7 @@ def _parse_contract_items(self) -> None: self._structuresNotParsed.append(node) elif isinstance(node, ImportFrom): # TOOD aliases - # We create an `InterfaceDef` sense the compilatuion unit does not contain the actual interface + # We create an `InterfaceDef` sense the compilation unit does not contain the actual interface # https://github.com/vyperlang/vyper/tree/master/vyper/builtins/interfaces if node.module == "vyper.interfaces": interfaces = { From 08d631f6c91a9d4fa64fd0a1ab9a5a110b7614b2 Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Wed, 15 May 2024 08:40:40 -0500 Subject: [PATCH 33/45] fix: support array of structs in abi.decode --- slither/visitors/slithir/expression_to_slithir.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slither/visitors/slithir/expression_to_slithir.py b/slither/visitors/slithir/expression_to_slithir.py index 7d0ac4abf1..1d68336bd6 100644 --- a/slither/visitors/slithir/expression_to_slithir.py +++ b/slither/visitors/slithir/expression_to_slithir.py @@ -448,12 +448,12 @@ def _post_index_access(self, expression: IndexAccess) -> None: right = get(expression.expression_right) operation: Operation # Left can be a type for abi.decode(var, uint[2]) - if isinstance(left, (Type, Contract, Enum)): + if isinstance(left, (Type, Contract, Enum, Structure)): # Nested type are not yet supported by abi.decode, so the assumption # Is that the right variable must be a constant assert isinstance(right, Constant) # Case for abi.decode(var, I[2]) where I is an interface/contract or an enum - if isinstance(left, (Contract, Enum)): + if isinstance(left, (Contract, Enum, Structure)): left = UserDefinedType(left) t = ArrayType(left, int(right.value)) set_val(expression, t) From 22b9cfc39cf96d9188eeca1c72bf122630056d80 Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Fri, 17 May 2024 15:33:39 -0500 Subject: [PATCH 34/45] fix: use contract declarer's scope for name resolution --- .../solc_parsing/expressions/find_variable.py | 2 +- .../scope_with_renaming/core/MainContract.sol | 41 +++++++++++++++++++ .../core/ParentContract.sol | 30 ++++++++++++++ .../scope_with_renaming/errors/MainErrors.sol | 9 ++++ .../errors/ParentContractErrors.sol | 7 ++++ tests/unit/core/test_scope_with_renaming.py | 17 ++++++++ tests/unit/core/test_using_for.py | 2 +- 7 files changed, 106 insertions(+), 2 deletions(-) create mode 100644 tests/unit/core/test_data/scope_with_renaming/core/MainContract.sol create mode 100644 tests/unit/core/test_data/scope_with_renaming/core/ParentContract.sol create mode 100644 tests/unit/core/test_data/scope_with_renaming/errors/MainErrors.sol create mode 100644 tests/unit/core/test_data/scope_with_renaming/errors/ParentContractErrors.sol create mode 100644 tests/unit/core/test_scope_with_renaming.py diff --git a/slither/solc_parsing/expressions/find_variable.py b/slither/solc_parsing/expressions/find_variable.py index 2d8fa58f60..4ea1239e52 100644 --- a/slither/solc_parsing/expressions/find_variable.py +++ b/slither/solc_parsing/expressions/find_variable.py @@ -304,7 +304,7 @@ def _find_variable_init( scope = underlying_function.file_scope else: assert isinstance(underlying_function, FunctionContract) - scope = underlying_function.contract.file_scope + scope = underlying_function.contract_declarer.file_scope elif isinstance(caller_context, StructureTopLevelSolc): direct_contracts = [] diff --git a/tests/unit/core/test_data/scope_with_renaming/core/MainContract.sol b/tests/unit/core/test_data/scope_with_renaming/core/MainContract.sol new file mode 100644 index 0000000000..5eb92aa2fd --- /dev/null +++ b/tests/unit/core/test_data/scope_with_renaming/core/MainContract.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.13; + +import { + ParentContract +} from "./ParentContract.sol"; + +import { + MainErrors as Errors +} from "./../errors/MainErrors.sol"; + + +contract MainContract is ParentContract { + + + function functionWithMainError1(uint256 a, uint256 b) external pure returns (uint256) { + if (a == b) { + revert Errors.MainError1(); + } + // Add some arithmetic operations here + return a + b; + } + + function functionWithMainError2(uint256 a, uint256 b) external pure returns (uint256) { + if (a < b) { + revert Errors.MainError2(); + } + // Add some arithmetic operations here + return a - b; + } + + function functionWithMainError3(uint256 a, uint256 b) external pure returns (uint256) { + if (b == 0) { + revert Errors.MainError3(); + } + // Add some arithmetic operations here + return a * b; + } + + +} diff --git a/tests/unit/core/test_data/scope_with_renaming/core/ParentContract.sol b/tests/unit/core/test_data/scope_with_renaming/core/ParentContract.sol new file mode 100644 index 0000000000..9ca32a1a6f --- /dev/null +++ b/tests/unit/core/test_data/scope_with_renaming/core/ParentContract.sol @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.13; + + +import { + AccessControlErrors as Errors +} from "../errors/ParentContractErrors.sol"; + + +contract ParentContract { + + + function functionWithAccessControlErrors1(uint256 a, uint256 b) external pure returns (uint256) { + if (a == b) { + revert Errors.AccessControlErrors1(); + } + // Add some arithmetic operations here + return a + b; + } + + function functionWithAccessControlErrors2(uint256 a, uint256 b) external pure returns (uint256) { + if (a < b) { + revert Errors.AccessControlErrors2(); + } + // Add some arithmetic operations here + return a - b; + } + + +} diff --git a/tests/unit/core/test_data/scope_with_renaming/errors/MainErrors.sol b/tests/unit/core/test_data/scope_with_renaming/errors/MainErrors.sol new file mode 100644 index 0000000000..e7db5c5c38 --- /dev/null +++ b/tests/unit/core/test_data/scope_with_renaming/errors/MainErrors.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.13; + +// TODO: remove unused errors +library MainErrors { + error MainError1(); + error MainError2(); + error MainError3(); +} diff --git a/tests/unit/core/test_data/scope_with_renaming/errors/ParentContractErrors.sol b/tests/unit/core/test_data/scope_with_renaming/errors/ParentContractErrors.sol new file mode 100644 index 0000000000..38ce16bdd2 --- /dev/null +++ b/tests/unit/core/test_data/scope_with_renaming/errors/ParentContractErrors.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.13; + +library AccessControlErrors { + error AccessControlErrors1(); + error AccessControlErrors2(); +} diff --git a/tests/unit/core/test_scope_with_renaming.py b/tests/unit/core/test_scope_with_renaming.py new file mode 100644 index 0000000000..6984cfaa42 --- /dev/null +++ b/tests/unit/core/test_scope_with_renaming.py @@ -0,0 +1,17 @@ +from pathlib import Path +from crytic_compile import CryticCompile +from crytic_compile.platform.solc_standard_json import SolcStandardJson + +from slither import Slither + +TEST_DATA_DIR = Path(__file__).resolve().parent / "test_data" +SCOPE_RENAMING_TEST_DATA_DIR = Path(TEST_DATA_DIR, "scope_with_renaming") + +# https://github.com/crytic/slither/issues/2454 +def test_find_variable_scope_with_renaming(solc_binary_path) -> None: + solc_path = solc_binary_path("0.8.24") + standard_json = SolcStandardJson() + for source_file in SCOPE_RENAMING_TEST_DATA_DIR.rglob("**/*.sol"): + standard_json.add_source_file(Path(source_file).as_posix()) + compilation = CryticCompile(standard_json, solc=solc_path) + Slither(compilation, disallow_partial=True) diff --git a/tests/unit/core/test_using_for.py b/tests/unit/core/test_using_for.py index 4d7634c5c9..656fc3a357 100644 --- a/tests/unit/core/test_using_for.py +++ b/tests/unit/core/test_using_for.py @@ -17,7 +17,7 @@ def test_using_for_global_collision(solc_binary_path) -> None: for source_file in Path(USING_FOR_TEST_DATA_DIR, "using_for_global_collision").rglob("*.sol"): standard_json.add_source_file(Path(source_file).as_posix()) compilation = CryticCompile(standard_json, solc=solc_path) - sl = Slither(compilation) + sl = Slither(compilation, disallow_partial=True) _run_all_detectors(sl) From 4f661e48077337bca95a8f460aebc96bf19cfb12 Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Fri, 17 May 2024 15:48:57 -0500 Subject: [PATCH 35/45] add test for 08d631f --- ...-decode-fixed-array.sol-0.8.10-compact.zip | Bin 4857 -> 5926 bytes ...-decode-fixed-array.sol-0.8.11-compact.zip | Bin 4875 -> 5850 bytes ...-decode-fixed-array.sol-0.8.12-compact.zip | Bin 4870 -> 5887 bytes ...-decode-fixed-array.sol-0.8.13-compact.zip | Bin 4870 -> 5884 bytes ...-decode-fixed-array.sol-0.8.14-compact.zip | Bin 4862 -> 5921 bytes ...-decode-fixed-array.sol-0.8.15-compact.zip | Bin 4868 -> 5892 bytes ...i-decode-fixed-array.sol-0.8.8-compact.zip | Bin 4856 -> 5903 bytes ...decode-fixed-array.sol-0.8.10-compact.json | 3 ++- ...decode-fixed-array.sol-0.8.11-compact.json | 3 ++- ...decode-fixed-array.sol-0.8.12-compact.json | 3 ++- ...decode-fixed-array.sol-0.8.13-compact.json | 3 ++- ...decode-fixed-array.sol-0.8.14-compact.json | 3 ++- ...decode-fixed-array.sol-0.8.15-compact.json | 3 ++- ...-decode-fixed-array.sol-0.8.8-compact.json | 3 ++- .../abi-decode-fixed-array.sol | 7 ++++++- 15 files changed, 20 insertions(+), 8 deletions(-) diff --git a/tests/e2e/solc_parsing/test_data/compile/user_defined_value_type/abi-decode-fixed-array.sol-0.8.10-compact.zip b/tests/e2e/solc_parsing/test_data/compile/user_defined_value_type/abi-decode-fixed-array.sol-0.8.10-compact.zip index b65e511efb24373d3157a32071cdb114e9b73141..6c43440c91eb829cbb2b655a4ae3daf26a3a65ae 100644 GIT binary patch delta 5809 zcmV;i7EbB;C8jPIP)h>@KL7#%4gj`&u~>ZL^#y1a007d7kr-Zo@kbAZrIlV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W6V1s>V;;Ayo^7#Ri1XG-cl8G~&~eaFj` zD=s_?ORMfs5CVTF;-q{O1^=8ROLQpc?( zR?m`#(p?uo`G~P%>a?6Quy{90H=HOZKqjDk%u%gRmT$c z)#1i9n$v&QM*M@LgS@qC!)A}+voD%<iT+j5zeBA4iXwQZ_<^8e zEPh3?faJ{_Vb+u;q0Kp^g`O@EsTr<~Y5y4o%Hw~LKarkGJm`CnB-8W^<87*t>z(Mp zbY_?7$4+t0kwdm7p;__JtL}VHBEx-5fL0j{ZZR$SMT?=(HZo>SxW5I_;BFQ|pl@Il zg%D;v2BOUE6bbB#RrH8Now!;3g6CfR+#}Z7o|v0s{^{m5p8bf?K6uxP6X=G~tp*-z zj-`LsTk+*YHZTb-iK9JWpGN3el^}4G)D5IT#zYd}QWqC|1`oG2?O*-P|Tu&Nb(nWUip~*;z zto5&!@I0Npnh=>Px# diff --git a/tests/e2e/solc_parsing/test_data/compile/user_defined_value_type/abi-decode-fixed-array.sol-0.8.11-compact.zip b/tests/e2e/solc_parsing/test_data/compile/user_defined_value_type/abi-decode-fixed-array.sol-0.8.11-compact.zip index c9a78fceafc83990aa8d7df96d3f808a8e85035e..6c8b090357e180a9faa878a2620dbf7967c1cc80 100644 GIT binary patch delta 5732 zcmV-q7MtmdCfY3+P)h>@KL7#%4gj`&u~??*M|d0-007d7kr-Zo@kbAZrIlV+*LwgE zaqkuAn-IgLLRAF3Pj$b_d69BkdyAmw}Di;Nl+BoH%x*M>Hje7N74^>M?_m5|`0D&C%koxEWE> zn{xVDXIj}F-M1cAu&)qR$mG)!?r`_$>%?$14N%J2^Q$9&h6IGmzijkIEbbC-i`U@$ zk?Lil`t=2bkjUxAjusr!XZ^}nRT1h~TdOi|2q%WI63nXCTXO$pgOuk8#><&nUyQH; zhMK^Ny)6s{@O;Ks16rA7PCgA|)CP9KNR{Y;4}Z;fwO&z{@S0=9;F}r{kkzYKY4?HJ z^d@LW1gk=SOW$hi-Rj`z7&CjzACPI?j2sDnNPTR7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G$ zDdQske}&(nGP4)^;mtQ@lAjb_85SPNh=2j5s`(oXWlwqx#0YhE%5Aj=RCyO@%*7;9 zVF6nGEWI;5K@V*NH%z%Y)~_#V@J2^}qCJcrYtMOBT_=ZY&(^uY1=QRbNaX)MBVuYJ zIXk=ZjxkTwy-DycbUoYSRZ3a?mhO~U(>n!~NYgR!GO^4+YFHU#PV8qXhuwNrsX+3B z>1f_DQ3?Zq)-e8HiCwSxy#Hk0d{oQnYG`bfq3f-&Kb`fZA~&}u+tJCLXwYYW6AyGe z^aRC(6pSr8SqI@46iQ_n6_wh3@3py12-h4oUY0u@)PEXey((SrIH>|#foRD>9SX@5 zT=#h*R#RPxVjnvuV8ei)m+SX)tCpn_G7{a~cLme1 zSN%(un>;lhLEd*7h_bv7to+f&F%X$O4?hrz*lxK)?_dAEZWFCgO928u13v%)01f~g ziI!Gz=+6L65&!^;W&i*#00000000000001h0RR910AXTjEo5b5Z)9bYpcXU+nGyg1 F004_%7LWh{ diff --git a/tests/e2e/solc_parsing/test_data/compile/user_defined_value_type/abi-decode-fixed-array.sol-0.8.12-compact.zip b/tests/e2e/solc_parsing/test_data/compile/user_defined_value_type/abi-decode-fixed-array.sol-0.8.12-compact.zip index 1b69e8e3d5d10acd501881ea862de234b4eb0006..bdc1f1bfde0efeae5123dd6c6535718d7ed543ef 100644 GIT binary patch delta 5776 zcmV;B7H{c>CjTuPP)h>@KL7#%4gj`&u~;$XdJjPs007d7001tNzY;N#Oe%lzM-PRi zm0nlZdjJq|?-l5q5W}VAK!X$~yhYN!b#(5g+&e%nCd!7EfUFi6AerXVhG8zww5+rr zt8@}M{ABq+?ls#>N#jh&9{$PK8;!81v1t>n2v=}L0%u>0kb3$y*mDmUlDKEkW?V)l zgu7*><=)?~bB*%8UEm&G^I?B|W(TaQL=5FfeT$qnMv5Dc*LPijGmy&v%WMmW$$g%C zj5Hn_1B$X&kZtwdS~Oz`)XK8;vvdIfUECB_rJ z)^mSCj1vQzV|9rjFx8TWzA^mE0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qpqqi+^;D;IiHPI(!{_McfkrX1y_gp3<9n!MtG{(5X{vr>78!L0PL^>SpQB zs%ajoNFk3Noyl|#d1PC7NIZb|Upc!jz(c{UX9hgBWJ;}}+$qL*S7IDnsBX;*sKQfb)CCXphVrNsO;{b7kZzX8nVGR*8f&p_aR z`z_u6)gEvy&i)2LmBTLqR`19%84@ZxF`v)KX4O9r>e)zO)=?F?Gjo>#4d=PG@#GZH?0gXgvLD1}YXTJhaO^sLG;DVy0}=2eYfT0|e~9!>9~Qm#!T zAa=EKW1C3^{W3p!Y>;)(HT)jVe(@4KH=okhum%5}!ck8WI$y?YGoR+`ey1^isXS5k z%&BBgS+LAp+x*uAdZ_l&CakeLTvmdO=7LH}Sh@XO)7~JMAc0kZE|5_Mvj0P<&$5_X zq`d*T4t0pL!B2nm?1#%gu3={FkWFpE1kcPnd+_B8YlpYec_BMt2-uEUBO~=O#PD1j z`9y*OqdFWgQWk~pVzCY`9)EgVW;F@<;YmSJC2-QZrim@M#+ATjZxldFWgU^7KZ3JK zP*)k?BIjZEUq_QC%6@*hx30Rle*KL7#%4gejAmR9+D W6nsb$004_-lcyF^29y#20001Ok}kOb diff --git a/tests/e2e/solc_parsing/test_data/compile/user_defined_value_type/abi-decode-fixed-array.sol-0.8.13-compact.zip b/tests/e2e/solc_parsing/test_data/compile/user_defined_value_type/abi-decode-fixed-array.sol-0.8.13-compact.zip index 5661f465dadda930fb010264e9ceb5900ddc3d93..1d2d91bad44b85a37a7aa75bd851d7d82e6e52ce 100644 GIT binary patch delta 5773 zcmV;87INu^Cj2cMP)h>@KL7#%4gj}(u~_6}JkCBA007d7001tNzY;N#Oe%lzM-PRi zm0nlZdjJq|?-l5q5W}VAK!X$~yhYN!b#(5g+&e%nCd!7EfUFi6AerXVhG8zww5+rr zt8@}M{ABq+?ls#>N#jh&9{$PK8;!81v1t>n2v=}L0%u>0kb3$y*mDmUlDKEkW?V)l zgu7*><=+)eOO5irUEm&G^I?B|W(TaQL=5FfeT$qnMv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ldMKsE9>OO1j8oV$uVcKBn>bhTz8H4_IzTCmN?#cL53zp@QGiEN>3H>n5sZm}Ia zm~Asb#d#1x(1qWRLnSVdmIiQlYL{<0(DGOdxsE_WWu-C6k;PqqB76rdW--q#DVEE8 z#Lh|!7CK}*Cg*XPpig(o7XI3jzGGPYoC><9>5eVnPYsr_^TmE$ZcwS3psDo}P~!RZ zs2mnS_Ge!VFcQ9?%BH@USsN_E)Ws&tPl?B4JChn+4&^)kMKDZ^As=jwoLanc<}`Hd9JA1FhWQtnL5QV)n`lhsxp*3S!XrWTl z?i2mI2n8j7xyY3o{tevlIURc~w-Z*tf4u%bs@^^?Ej&#ic&UTf*EL?+xpClS)pSz( z(T?>fu|kLCQ!v3%hXES~UbF<0v8%U37&q!~vd57WTh!o8Od}A*xeQ(gGP^-FDp}Kj z9DhZs*>vz#dGZ_qtS714KB>{cdZvP<%FVi79&6KouKz;OYIGqv^Ty~ZQk;{+tzduj zX_7M<$Jmf%{VEYaA_l{fm)4IkCru5o!Y3j8dBv zip?)r2zs3EmVrxl+28OhnHU8-ho&&qXapo@^ZdldUx0|gEaTAda_b34J6N&O)h9Z~ zeIguK%ZU@=@cET_DQLCONkQrSwsRutYb1a+$onvYvjt;p2dX{KZ! z#2R*)?&7Eg&s)~<8f+0+p?R#*N}d9L!Pk1<`0bs>fte@B4@#UEs1X7E$!-22l773L&N3~J zvq?18GH&<@*Bc29Nj!IpS2_ptObLoFdD8RD|8WZVXOxP@*C1dRF6eQ!T|#t!KfkPo z`n28vbK>L0c_!U6zy(Vw8in|Yd8}+Z={_0~9&jT=JKy20f^PCIZOc!4g;o*&k7b!oc7kk2DrA`WXCoX;>P<Ky+c{-PD*yX2*A7ri0Rle*KL7#%4gesDmR4Cu W_en?+004_-lcW|>29y#20002I=nxtJ diff --git a/tests/e2e/solc_parsing/test_data/compile/user_defined_value_type/abi-decode-fixed-array.sol-0.8.14-compact.zip b/tests/e2e/solc_parsing/test_data/compile/user_defined_value_type/abi-decode-fix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vvVYLo0gFHS-o6!5n-&)I zx5TLhw5ZNyY};XGL2_%kH$=Tt=?+U`;wl0pvoEkg%jJP!g;Rf$Uc6Za+^|D%s<2+o zoVVjX!ri1}`4sgV(zV`)?>+9-9r6(3e}@6BFO zJ&>+mW9gYQJ#V|5;bSeYld$yU*DdE!`2a!QR_dG9_IvBk6hl@aNZNJve;4d91e@(r zC2bmyGa9PvxY2)fm)pe`f3zUfo^;r6mEM_tQ(FcuJ*x>0#dh#Jxrws&R4sGzQuzgF zEF&jQr!iHalv%EKV3+RwVO=0U=nO7!=KFG8S43S6c$z?wM9bU5e z@%<^ZWf|`A(X&BwGVBa4CNCZLUvamQ&J2|ry2<#Jj97n1aqTk0uYVSsMqrLDq1Vkb zkcW{W7z~`F3)tdmv>H_vCa90BOzC73fWmw^;1i}MJ}UJ{2RV{4Ab z+2|SB2??#@&SQ~qlZ!DgWvDL#T7i_6OWQlG=8FVMd?g!kkU>6uH0JjaYtUN#?ukZJ z77f3CUpRlgY@HgqCPxWR#}L4ZfkkL1y{OL@!1Au-U7eWC#gd@_n@p+1UbxAl|(udCJGui8W zjG}+2wS7cDo0r)!-Xd;ojLA!^h;^!?XEOsn`SF*=@s5}Y2e6coW29Wcsb|mL?8d;H^kOZO928u13v%)01f~n aiI!G#kGXe75&!^;W|OQIQw0(L0002H5HMf> diff --git a/tests/e2e/solc_parsing/test_data/compile/user_defined_value_type/abi-decode-fixed-array.sol-0.8.8-compact.zip b/tests/e2e/solc_parsing/test_data/compile/user_defined_value_type/abi-decode-fixed-array.sol-0.8.8-compact.zip index d574a7cb8486ac0764de875611abf38c434d2514..4c6db0a4249394f7d98511a9c3bae9f896c1953c 100644 GIT binary patch delta 5792 zcmV;R7GLT3C66u}P)h>@KL7#%4gj`&u~@S8FY!?p005N#jh&9{$PK8;!81v1t>n2v=}L0%u>0kb3$y*mDmUlDKEkW?V)l zgu7+D0-l+tG7{(Xt*=X}v~_<~WFP(g4COzeXIliij2_7ZFU1i^EuNCL^&fO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l-9{HfghBCiTRh3IY19LcmOoy%r)5 zJT&!hcFSk+(yFNJ>)zo1(Oq3sP)h*1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", - "test_decode_enum_array(bytes)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n" + "test_decode_enum_array(bytes)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "test_decode_struct_array(bytes)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" } } \ No newline at end of file diff --git a/tests/e2e/solc_parsing/test_data/expected/user_defined_value_type/abi-decode-fixed-array.sol-0.8.11-compact.json b/tests/e2e/solc_parsing/test_data/expected/user_defined_value_type/abi-decode-fixed-array.sol-0.8.11-compact.json index 070b687bd8..b040e9ab4d 100644 --- a/tests/e2e/solc_parsing/test_data/expected/user_defined_value_type/abi-decode-fixed-array.sol-0.8.11-compact.json +++ b/tests/e2e/solc_parsing/test_data/expected/user_defined_value_type/abi-decode-fixed-array.sol-0.8.11-compact.json @@ -2,6 +2,7 @@ "I": {}, "C": { "test_decode_interface_array(bytes)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", - "test_decode_enum_array(bytes)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n" + "test_decode_enum_array(bytes)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "test_decode_struct_array(bytes)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" } } \ No newline at end of file diff --git a/tests/e2e/solc_parsing/test_data/expected/user_defined_value_type/abi-decode-fixed-array.sol-0.8.12-compact.json b/tests/e2e/solc_parsing/test_data/expected/user_defined_value_type/abi-decode-fixed-array.sol-0.8.12-compact.json index 070b687bd8..b040e9ab4d 100644 --- a/tests/e2e/solc_parsing/test_data/expected/user_defined_value_type/abi-decode-fixed-array.sol-0.8.12-compact.json +++ b/tests/e2e/solc_parsing/test_data/expected/user_defined_value_type/abi-decode-fixed-array.sol-0.8.12-compact.json @@ -2,6 +2,7 @@ "I": {}, "C": { "test_decode_interface_array(bytes)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", - "test_decode_enum_array(bytes)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n" + "test_decode_enum_array(bytes)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "test_decode_struct_array(bytes)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" } } \ No newline at end of file diff --git a/tests/e2e/solc_parsing/test_data/expected/user_defined_value_type/abi-decode-fixed-array.sol-0.8.13-compact.json b/tests/e2e/solc_parsing/test_data/expected/user_defined_value_type/abi-decode-fixed-array.sol-0.8.13-compact.json index 070b687bd8..b040e9ab4d 100644 --- a/tests/e2e/solc_parsing/test_data/expected/user_defined_value_type/abi-decode-fixed-array.sol-0.8.13-compact.json +++ b/tests/e2e/solc_parsing/test_data/expected/user_defined_value_type/abi-decode-fixed-array.sol-0.8.13-compact.json @@ -2,6 +2,7 @@ "I": {}, "C": { "test_decode_interface_array(bytes)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", - "test_decode_enum_array(bytes)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n" + "test_decode_enum_array(bytes)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "test_decode_struct_array(bytes)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" } } \ No newline at end of file diff --git a/tests/e2e/solc_parsing/test_data/expected/user_defined_value_type/abi-decode-fixed-array.sol-0.8.14-compact.json b/tests/e2e/solc_parsing/test_data/expected/user_defined_value_type/abi-decode-fixed-array.sol-0.8.14-compact.json index 070b687bd8..b040e9ab4d 100644 --- a/tests/e2e/solc_parsing/test_data/expected/user_defined_value_type/abi-decode-fixed-array.sol-0.8.14-compact.json +++ b/tests/e2e/solc_parsing/test_data/expected/user_defined_value_type/abi-decode-fixed-array.sol-0.8.14-compact.json @@ -2,6 +2,7 @@ "I": {}, "C": { "test_decode_interface_array(bytes)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", - "test_decode_enum_array(bytes)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n" + "test_decode_enum_array(bytes)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "test_decode_struct_array(bytes)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" } } \ No newline at end of file diff --git a/tests/e2e/solc_parsing/test_data/expected/user_defined_value_type/abi-decode-fixed-array.sol-0.8.15-compact.json b/tests/e2e/solc_parsing/test_data/expected/user_defined_value_type/abi-decode-fixed-array.sol-0.8.15-compact.json index 070b687bd8..b040e9ab4d 100644 --- a/tests/e2e/solc_parsing/test_data/expected/user_defined_value_type/abi-decode-fixed-array.sol-0.8.15-compact.json +++ b/tests/e2e/solc_parsing/test_data/expected/user_defined_value_type/abi-decode-fixed-array.sol-0.8.15-compact.json @@ -2,6 +2,7 @@ "I": {}, "C": { "test_decode_interface_array(bytes)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", - "test_decode_enum_array(bytes)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n" + "test_decode_enum_array(bytes)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "test_decode_struct_array(bytes)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" } } \ No newline at end of file diff --git a/tests/e2e/solc_parsing/test_data/expected/user_defined_value_type/abi-decode-fixed-array.sol-0.8.8-compact.json b/tests/e2e/solc_parsing/test_data/expected/user_defined_value_type/abi-decode-fixed-array.sol-0.8.8-compact.json index 070b687bd8..b040e9ab4d 100644 --- a/tests/e2e/solc_parsing/test_data/expected/user_defined_value_type/abi-decode-fixed-array.sol-0.8.8-compact.json +++ b/tests/e2e/solc_parsing/test_data/expected/user_defined_value_type/abi-decode-fixed-array.sol-0.8.8-compact.json @@ -2,6 +2,7 @@ "I": {}, "C": { "test_decode_interface_array(bytes)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", - "test_decode_enum_array(bytes)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n" + "test_decode_enum_array(bytes)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "test_decode_struct_array(bytes)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" } } \ No newline at end of file diff --git a/tests/e2e/solc_parsing/test_data/user_defined_value_type/abi-decode-fixed-array.sol b/tests/e2e/solc_parsing/test_data/user_defined_value_type/abi-decode-fixed-array.sol index 14a59b5a2a..d5bddddc29 100644 --- a/tests/e2e/solc_parsing/test_data/user_defined_value_type/abi-decode-fixed-array.sol +++ b/tests/e2e/solc_parsing/test_data/user_defined_value_type/abi-decode-fixed-array.sol @@ -1,10 +1,11 @@ interface I {} enum A {a,b} - +struct S {uint256 a;} contract C { I[6] interfaceArray; A[6] enumArray; + function test_decode_interface_array(bytes memory data) public { interfaceArray = abi.decode(data, (I[6])); } @@ -13,4 +14,8 @@ contract C { enumArray = abi.decode(data, (A[6])); } + function test_decode_struct_array(bytes memory data) public { + S[6] memory structArray = abi.decode(data, (S[6])); + } + } From 40578aee4cdf4a63ed00c06722753f7982040778 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 22:40:36 +0000 Subject: [PATCH 36/45] --- updated-dependencies: - dependency-name: cachix/install-nix-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index afead53368..820223cbec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: - name: Set up nix if: matrix.type == 'dapp' - uses: cachix/install-nix-action@v26 + uses: cachix/install-nix-action@V27 - name: Set up cachix if: matrix.type == 'dapp' From 599edf78d8fe63f8c77ef7bc67f0525a1bc35a77 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 22:40:43 +0000 Subject: [PATCH 37/45] --- updated-dependencies: - dependency-name: cachix/cachix-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index afead53368..0c0682ae4d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,7 +71,7 @@ jobs: - name: Set up cachix if: matrix.type == 'dapp' - uses: cachix/cachix-action@v14 + uses: cachix/cachix-action@v15 with: name: dapp From 221cfc69ce628db819c56f1ece4c4e82867bc386 Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Mon, 3 Jun 2024 14:48:07 -0500 Subject: [PATCH 38/45] chore: remove unused scripts --- scripts/ci_test.sh | 84 -------------------------------------------- scripts/json_diff.py | 27 -------------- 2 files changed, 111 deletions(-) delete mode 100755 scripts/ci_test.sh delete mode 100644 scripts/json_diff.py diff --git a/scripts/ci_test.sh b/scripts/ci_test.sh deleted file mode 100755 index 6696a4e890..0000000000 --- a/scripts/ci_test.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env bash - -### Test Detectors - -DIR="$(cd "$(dirname "$0")" && pwd)" - -CURRENT_PATH=$(pwd) -TRAVIS_PATH='/home/travis/build/crytic/slither' - -# test_slither file.sol detectors -test_slither(){ - - expected="$DIR/../tests/expected_json/$(basename "$1" .sol).$2.json" - - # run slither detector on input file and save output as json - if ! slither "$1" --solc-disable-warnings --detect "$2" --json "$DIR/tmp-test.json"; - then - echo "Slither crashed" - exit 255 - fi - - if [ ! -f "$DIR/tmp-test.json" ]; then - echo "" - echo "Missing generated file" - echo "" - exit 1 - fi - sed "s|$CURRENT_PATH|$TRAVIS_PATH|g" "$DIR/tmp-test.json" -i - result=$(python "$DIR/json_diff.py" "$expected" "$DIR/tmp-test.json") - - rm "$DIR/tmp-test.json" - if [ "$result" != "{}" ]; then - echo "" - echo "failed test of file: $1, detector: $2" - echo "" - echo "$result" - echo "" - exit 1 - fi - - # run slither detector on input file and save output as json - if ! slither "$1" --solc-disable-warnings --detect "$2" --legacy-ast --json "$DIR/tmp-test.json"; - then - echo "Slither crashed" - exit 255 - fi - - if [ ! -f "$DIR/tmp-test.json" ]; then - echo "" - echo "Missing generated file" - echo "" - exit 1 - fi - - sed "s|$CURRENT_PATH|$TRAVIS_PATH|g" "$DIR/tmp-test.json" -i - result=$(python "$DIR/json_diff.py" "$expected" "$DIR/tmp-test.json") - - rm "$DIR/tmp-test.json" - if [ "$result" != "{}" ]; then - echo "" - echo "failed test of file: $1, detector: $2" - echo "" - echo "$result" - echo "" - exit 1 - fi -} - -# generate_expected_json file.sol detectors -generate_expected_json(){ - # generate output filename - # e.g. file: uninitialized.sol detector: uninitialized-state - # ---> uninitialized.uninitialized-state.json - output_filename="$DIR/../tests/expected_json/$(basename "$1" .sol).$2.json" - output_filename_txt="$DIR/../tests/expected_json/$(basename "$1" .sol).$2.txt" - - # run slither detector on input file and save output as json - slither "$1" --solc-disable-warnings --detect "$2" --json "$output_filename" > "$output_filename_txt" 2>&1 - - - sed "s|$CURRENT_PATH|$TRAVIS_PATH|g" "$output_filename" -i - sed "s|$CURRENT_PATH|$TRAVIS_PATH|g" "$output_filename_txt" -i -} - diff --git a/scripts/json_diff.py b/scripts/json_diff.py deleted file mode 100644 index 9422f6b8df..0000000000 --- a/scripts/json_diff.py +++ /dev/null @@ -1,27 +0,0 @@ -import sys -import json -from pprint import pprint -from deepdiff import DeepDiff # pip install deepdiff - - -if len(sys.argv) != 3: - print("Usage: python json_diff.py 1.json 2.json") - sys.exit(-1) - -with open(sys.argv[1], encoding="utf8") as f: - d1 = json.load(f) - -with open(sys.argv[2], encoding="utf8") as f: - d2 = json.load(f) - - -# Remove description field to allow non deterministic print -for elem in d1: - if "description" in elem: - del elem["description"] -for elem in d2: - if "description" in elem: - del elem["description"] - - -pprint(DeepDiff(d1, d2, ignore_order=True, verbose_level=2)) From ecf8b24f09567b3729aea73aaea6650629cb6ddc Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Tue, 4 Jun 2024 15:29:54 -0500 Subject: [PATCH 39/45] lint --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 4d9e1d10e1..1d05f02ebd 100644 --- a/README.md +++ b/README.md @@ -288,24 +288,24 @@ Slither is licensed and distributed under the AGPLv3 license. [Contact us](mailt Title | Usage | Authors | Venue | Code --- | --- | --- | --- | --- -[ReJection: A AST-Based Reentrancy Vulnerability Detection Method](https://www.researchgate.net/publication/339354823_ReJection_A_AST-Based_Reentrancy_Vulnerability_Detection_Method) | AST-based analysis built on top of Slither | Rui Ma, Zefeng Jian, Guangyuan Chen, Ke Ma, Yujia Chen | CTCIS 19 +[ReJection: A AST-Based Reentrancy Vulnerability Detection Method](https://www.researchgate.net/publication/339354823_ReJection_A_AST-Based_Reentrancy_Vulnerability_Detection_Method) | AST-based analysis built on top of Slither | Rui Ma, Zefeng Jian, Guangyuan Chen, Ke Ma, Yujia Chen | CTCIS 19 | - [MPro: Combining Static and Symbolic Analysis forScalable Testing of Smart Contract](https://arxiv.org/pdf/1911.00570.pdf) | Leverage data dependency through Slither | William Zhang, Sebastian Banescu, Leodardo Pasos, Steven Stewart, Vijay Ganesh | ISSRE 2019 | [MPro](https://github.com/QuanZhang-William/M-Pro) -[ETHPLOIT: From Fuzzing to Efficient Exploit Generation against Smart Contracts](https://wcventure.github.io/FuzzingPaper/Paper/SANER20_ETHPLOIT.pdf) | Leverage data dependency through Slither | Qingzhao Zhang, Yizhuo Wang, Juanru Li, Siqi Ma | SANER 20 -[Verification of Ethereum Smart Contracts: A Model Checking Approach](http://www.ijmlc.org/vol10/977-AM0059.pdf) | Symbolic execution built on top of Slither’s CFG | Tam Bang, Hoang H Nguyen, Dung Nguyen, Toan Trieu, Tho Quan | IJMLC 20 +[ETHPLOIT: From Fuzzing to Efficient Exploit Generation against Smart Contracts](https://wcventure.github.io/FuzzingPaper/Paper/SANER20_ETHPLOIT.pdf) | Leverage data dependency through Slither | Qingzhao Zhang, Yizhuo Wang, Juanru Li, Siqi Ma | SANER 20 | - +[Verification of Ethereum Smart Contracts: A Model Checking Approach](http://www.ijmlc.org/vol10/977-AM0059.pdf) | Symbolic execution built on top of Slither’s CFG | Tam Bang, Hoang H Nguyen, Dung Nguyen, Toan Trieu, Tho Quan | IJMLC 20 | - [Smart Contract Repair](https://arxiv.org/pdf/1912.05823.pdf) | Rely on Slither’s vulnerabilities detectors | Xiao Liang Yu, Omar Al-Bataineh, David Lo, Abhik Roychoudhury | TOSEM 20 | [SCRepair](https://github.com/xiaoly8/SCRepair/) -[Demystifying Loops in Smart Contracts](https://www.microsoft.com/en-us/research/uploads/prod/2020/08/loops_solidity__camera_ready-5f3fec3f15c69.pdf) | Leverage data dependency through Slither | Ben Mariano, Yanju Chen, Yu Feng, Shuvendu Lahiri, Isil Dillig | ASE 20 -[Trace-Based Dynamic Gas Estimation of Loops in Smart Contracts](https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=9268144) | Use Slither’s CFG to detect loops | Chunmiao Li, Shijie Nie, Yang Cao, Yijun Yu, Zhenjiang Hu | IEEE Open J. Comput. Soc. 1 (2020) +[Demystifying Loops in Smart Contracts](https://www.microsoft.com/en-us/research/uploads/prod/2020/08/loops_solidity__camera_ready-5f3fec3f15c69.pdf) | Leverage data dependency through Slither | Ben Mariano, Yanju Chen, Yu Feng, Shuvendu Lahiri, Isil Dillig | ASE 20 | - +[Trace-Based Dynamic Gas Estimation of Loops in Smart Contracts](https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=9268144) | Use Slither’s CFG to detect loops | Chunmiao Li, Shijie Nie, Yang Cao, Yijun Yu, Zhenjiang Hu | IEEE Open J. Comput. Soc. 1 (2020) | - [SAILFISH: Vetting Smart Contract State-Inconsistency Bugs in Seconds](https://arxiv.org/pdf/2104.08638.pdf) | Rely on SlithIR to build a *storage dependency graph* | Priyanka Bose, Dipanjan Das, Yanju Chen, Yu Feng, Christopher Kruegel, and Giovanni Vigna | S&P 22 | [Sailfish](https://github.com/ucsb-seclab/sailfish) -[SolType: Refinement Types for Arithmetic Overflow in Solidity](https://arxiv.org/abs/2110.00677) | Use Slither as frontend to build refinement type system | Bryan Tan, Benjamin Mariano, Shuvendu K. Lahiri, Isil Dillig, Yu Feng | POPL 22 -[Do Not Rug on Me: Leveraging Machine Learning Techniques for Automated Scam Detection](https://www.mdpi.com/2227-7390/10/6/949) | Use Slither to extract tokens' features (mintable, pausable, ..) | Mazorra, Bruno, Victor Adan, and Vanesa Daza | Mathematics 10.6 (2022) +[SolType: Refinement Types for Arithmetic Overflow in Solidity](https://arxiv.org/abs/2110.00677) | Use Slither as frontend to build refinement type system | Bryan Tan, Benjamin Mariano, Shuvendu K. Lahiri, Isil Dillig, Yu Feng | POPL 22 | - +[Do Not Rug on Me: Leveraging Machine Learning Techniques for Automated Scam Detection](https://www.mdpi.com/2227-7390/10/6/949) | Use Slither to extract tokens' features (mintable, pausable, ..) | Mazorra, Bruno, Victor Adan, and Vanesa Daza | Mathematics 10.6 (2022)| - [MANDO: Multi-Level Heterogeneous Graph Embeddings for Fine-Grained Detection of Smart Contract Vulnerabilities](https://arxiv.org/abs/2208.13252) | Use Slither to extract the CFG and call graph | Hoang Nguyen, Nhat-Minh Nguyen, Chunyao Xie, Zahra Ahmadi, Daniel Kudendo, Thanh-Nam Doan and Lingxiao Jiang| IEEE 9th International Conference on Data Science and Advanced Analytics (DSAA, 2022) | [ge-sc](https://github.com/MANDO-Project/ge-sc) [Automated Auditing of Price Gouging TOD Vulnerabilities in Smart Contracts](https://www.cs.toronto.edu/~fanl/papers/price-icbc22.pdf) | Use Slither to extract the CFG and data dependencies| Sidi Mohamed Beillahi, Eric Keilty, Keerthi Nelaturu, Andreas Veneris, and Fan Long | 2022 IEEE International Conference on Blockchain and Cryptocurrency (ICBC) | [Smart-Contract-Repair](https://github.com/Veneris-Group/TOD-Location-Rectification) [Modeling and Enforcing Access Control Policies for Smart Contracts](https://publikationen.bibliothek.kit.edu/1000152805/151859658) | Extend Slither's data dependencies | Jan-Philipp Toberg, Jonas Schiffl, Frederik Reiche, Bernhard Beckert, Robert Heinrich, Ralf Reussner | IEEE International Conference on Decentralized Applications and Infrastructures (DAPPS), 2022 | [SolidityAccessControlEnforcement](https://github.com/KASTEL-CSSDA/SolidityAccessControlEnforcement) -[Smart Contract Vulnerability Detection Based on Deep Learning and Multimodal Decision Fusion](https://www.mdpi.com/1424-8220/23/16/7246) | Use Slither to extract the CFG | Weichu Deng, Huanchun Wei, Teng Huang, Cong Cao, Yun Peng, and Xuan Hu | Sensors 2023, 23, 7246 -[Semantic-enriched Code Knowledge Graph to Reveal Unknowns in Smart Contract Code Reuse](https://www.researchgate.net/profile/Qing-Huang-26/publication/370638129_Semantic-enriched_Code_Knowledge_Graph_to_Reveal_Unknowns_in_Smart_Contract_Code_Reuse/links/645b7b8639c408339b3a54da/Semantic-Enriched-Code-Knowledge-Graph-to-Reveal-Unknowns-in-Smart-Contract-Code-Reuse.pdf) | Use Slither to extract the code features (CFG, function, parameters types, ..) | Qing Huang, Dianshu Liao, Zhenchang Xing, Zhengkang Zuo, Changjing Wang, Xin Xia | ACM Transactions on Software Engineering and Methodology, 2023 -[Smart Contract Parallel Execution with Fine-Grained State Accesses](https://personal.ntu.edu.sg/yi_li/files/Qi2023SCP.pdf) | Use Slither to build state access graphs | Xiaodong Qi, Jiao Jiao, Yi Li | International Conference on Distributed Computing Systems (ICDCS), 2023 -[Bad Apples: Understanding the Centralized Security Risks in Decentralized Ecosystems](https://diaowenrui.github.io/paper/www23-yan.pdf) | Implement an internal analysis on top of Slither | Kailun Yan , Jilian Zhang , Xiangyu Liu , Wenrui Diao , Shanqing Guo | ACM Web Conference April 2023 -[Identifying Vulnerabilities in Smart Contracts using Interval Analysis](https://arxiv.org/pdf/2309.13805.pdf) | Create 4 detectors on top of Slither | Ştefan-Claudiu Susan, Andrei Arusoaie | FROM 2023 +[Smart Contract Vulnerability Detection Based on Deep Learning and Multimodal Decision Fusion](https://www.mdpi.com/1424-8220/23/16/7246) | Use Slither to extract the CFG | Weichu Deng, Huanchun Wei, Teng Huang, Cong Cao, Yun Peng, and Xuan Hu | Sensors 2023, 23, 7246 | - +[Semantic-enriched Code Knowledge Graph to Reveal Unknowns in Smart Contract Code Reuse](https://www.researchgate.net/profile/Qing-Huang-26/publication/370638129_Semantic-enriched_Code_Knowledge_Graph_to_Reveal_Unknowns_in_Smart_Contract_Code_Reuse/links/645b7b8639c408339b3a54da/Semantic-Enriched-Code-Knowledge-Graph-to-Reveal-Unknowns-in-Smart-Contract-Code-Reuse.pdf) | Use Slither to extract the code features (CFG, function, parameters types, ..) | Qing Huang, Dianshu Liao, Zhenchang Xing, Zhengkang Zuo, Changjing Wang, Xin Xia | ACM Transactions on Software Engineering and Methodology, 2023 | - +[Smart Contract Parallel Execution with Fine-Grained State Accesses](https://personal.ntu.edu.sg/yi_li/files/Qi2023SCP.pdf) | Use Slither to build state access graphs | Xiaodong Qi, Jiao Jiao, Yi Li | International Conference on Distributed Computing Systems (ICDCS), 2023 | - +[Bad Apples: Understanding the Centralized Security Risks in Decentralized Ecosystems](https://diaowenrui.github.io/paper/www23-yan.pdf) | Implement an internal analysis on top of Slither | Kailun Yan , Jilian Zhang , Xiangyu Liu , Wenrui Diao , Shanqing Guo | ACM Web Conference April 2023 | - +[Identifying Vulnerabilities in Smart Contracts using Interval Analysis](https://arxiv.org/pdf/2309.13805.pdf) | Create 4 detectors on top of Slither | Ştefan-Claudiu Susan, Andrei Arusoaie | FROM 2023 | - Storage State Analysis and Extraction of Ethereum Blockchain Smart Contracts (no PDF in open access) | Rely on Slither's CFG and AST | Maha Ayub , Tania Saleem , Muhammad Janjua , Talha Ahmad | TOSEM 2023 | [SmartMuv](https://github.com/WaizKhan7/SmartMuv) If you are using Slither on an academic work, consider applying to the [Crytic $10k Research Prize](https://blog.trailofbits.com/2019/11/13/announcing-the-crytic-10k-research-prize/). From b9a3ea6189c374efc2c4508cdb25c3a067cb7b9f Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Tue, 4 Jun 2024 18:29:09 -0500 Subject: [PATCH 40/45] remove similar-names bc it's slow (#2469) --- slither/detectors/all_detectors.py | 1 - .../detectors/variables/similar_variables.py | 106 ------------------ ...ection_0_4_25_similar_variables_sol__0.txt | 2 - ...ection_0_5_16_similar_variables_sol__0.txt | 2 - ...ection_0_6_11_similar_variables_sol__0.txt | 2 - ...tection_0_7_6_similar_variables_sol__0.txt | 2 - .../0.4.25/similar_variables.sol | 7 -- .../0.4.25/similar_variables.sol-0.4.25.zip | Bin 1788 -> 0 bytes .../0.5.16/similar_variables.sol | 7 -- .../0.5.16/similar_variables.sol-0.5.16.zip | Bin 1787 -> 0 bytes .../0.6.11/similar_variables.sol | 7 -- .../0.6.11/similar_variables.sol-0.6.11.zip | Bin 1811 -> 0 bytes .../similar-names/0.7.6/similar_variables.sol | 7 -- .../0.7.6/similar_variables.sol-0.7.6.zip | Bin 1753 -> 0 bytes tests/e2e/detectors/test_detectors.py | 20 ---- 15 files changed, 163 deletions(-) delete mode 100644 slither/detectors/variables/similar_variables.py delete mode 100644 tests/e2e/detectors/snapshots/detectors__detector_SimilarVarsDetection_0_4_25_similar_variables_sol__0.txt delete mode 100644 tests/e2e/detectors/snapshots/detectors__detector_SimilarVarsDetection_0_5_16_similar_variables_sol__0.txt delete mode 100644 tests/e2e/detectors/snapshots/detectors__detector_SimilarVarsDetection_0_6_11_similar_variables_sol__0.txt delete mode 100644 tests/e2e/detectors/snapshots/detectors__detector_SimilarVarsDetection_0_7_6_similar_variables_sol__0.txt delete mode 100644 tests/e2e/detectors/test_data/similar-names/0.4.25/similar_variables.sol delete mode 100644 tests/e2e/detectors/test_data/similar-names/0.4.25/similar_variables.sol-0.4.25.zip delete mode 100644 tests/e2e/detectors/test_data/similar-names/0.5.16/similar_variables.sol delete mode 100644 tests/e2e/detectors/test_data/similar-names/0.5.16/similar_variables.sol-0.5.16.zip delete mode 100644 tests/e2e/detectors/test_data/similar-names/0.6.11/similar_variables.sol delete mode 100644 tests/e2e/detectors/test_data/similar-names/0.6.11/similar_variables.sol-0.6.11.zip delete mode 100644 tests/e2e/detectors/test_data/similar-names/0.7.6/similar_variables.sol delete mode 100644 tests/e2e/detectors/test_data/similar-names/0.7.6/similar_variables.sol-0.7.6.zip diff --git a/slither/detectors/all_detectors.py b/slither/detectors/all_detectors.py index ff1c352c31..7c54844316 100644 --- a/slither/detectors/all_detectors.py +++ b/slither/detectors/all_detectors.py @@ -57,7 +57,6 @@ from .functions.unimplemented import UnimplementedFunctionDetection from .statements.mapping_deletion import MappingDeletionDetection from .statements.array_length_assignment import ArrayLengthAssignment -from .variables.similar_variables import SimilarVarsDetection from .variables.function_init_state_variables import FunctionInitializedState from .statements.redundant_statements import RedundantStatements from .operations.bad_prng import BadPRNG diff --git a/slither/detectors/variables/similar_variables.py b/slither/detectors/variables/similar_variables.py deleted file mode 100644 index dccaf09c49..0000000000 --- a/slither/detectors/variables/similar_variables.py +++ /dev/null @@ -1,106 +0,0 @@ -""" -Check for state variables too similar -Do not check contract inheritance -""" -import difflib -from typing import List, Set, Tuple - -from slither.core.declarations.contract import Contract -from slither.core.variables.local_variable import LocalVariable -from slither.detectors.abstract_detector import ( - AbstractDetector, - DetectorClassification, - DETECTOR_INFO, -) -from slither.utils.output import Output - - -class SimilarVarsDetection(AbstractDetector): - """ - Variable similar detector - """ - - ARGUMENT = "similar-names" - HELP = "Variable names are too similar" - IMPACT = DetectorClassification.INFORMATIONAL - CONFIDENCE = DetectorClassification.MEDIUM - - WIKI = ( - "https://github.com/crytic/slither/wiki/Detector-Documentation#variable-names-too-similar" - ) - - WIKI_TITLE = "Variable names too similar" - WIKI_DESCRIPTION = "Detect variables with names that are too similar." - WIKI_EXPLOIT_SCENARIO = "Bob uses several variables with similar names. As a result, his code is difficult to review." - WIKI_RECOMMENDATION = "Prevent variables from having similar names." - - @staticmethod - def similar(seq1: str, seq2: str) -> bool: - """Test the name similarity - - Two name are similar if difflib.SequenceMatcher on the lowercase - version of the name is greater than 0.90 - See: https://docs.python.org/2/library/difflib.html - Args: - seq1 (str): first name - seq2 (str): second name - Returns: - bool: true if names are similar - """ - val = difflib.SequenceMatcher(a=seq1, b=seq2).ratio() - ret = val > 0.90 - return ret - - @staticmethod - def detect_sim(contract: Contract) -> Set[Tuple[LocalVariable, LocalVariable]]: - """Detect variables with similar name - - Returns: - bool: true if variables have similar name - """ - all_var = [x.variables for x in contract.functions] - all_var = [x for l in all_var for x in l] - - contract_var = contract.variables - - all_var = list(set(all_var + contract_var)) - - ret = set() - # pylint: disable=consider-using-enumerate - for i in range(len(all_var)): - v1 = all_var[i] - _v1_name_lower = v1.name.lower() - for j in range(i, len(all_var)): - v2 = all_var[j] - if len(v1.name) != len(v2.name): - continue - _v2_name_lower = v2.name.lower() - if _v1_name_lower != _v2_name_lower: - if SimilarVarsDetection.similar(_v1_name_lower, _v2_name_lower): - ret.add((v1, v2)) - - return ret - - def _detect(self) -> List[Output]: - """Detect similar variables name - - Returns: - list: {'vuln', 'filename,'contract','vars'} - """ - results = [] - for c in self.contracts: - allVars = self.detect_sim(c) - if allVars: - for (v1, v2) in sorted(allVars, key=lambda x: (x[0].name, x[1].name)): - v_left = v1 if v1.name < v2.name else v2 - v_right = v2 if v_left == v1 else v1 - info: DETECTOR_INFO = [ - "Variable ", - v_left, - " is too similar to ", - v_right, - "\n", - ] - json = self.generate_result(info) - results.append(json) - return results diff --git a/tests/e2e/detectors/snapshots/detectors__detector_SimilarVarsDetection_0_4_25_similar_variables_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_SimilarVarsDetection_0_4_25_similar_variables_sol__0.txt deleted file mode 100644 index 7f6fa4da1f..0000000000 --- a/tests/e2e/detectors/snapshots/detectors__detector_SimilarVarsDetection_0_4_25_similar_variables_sol__0.txt +++ /dev/null @@ -1,2 +0,0 @@ -Variable Similar.f().testVariable (tests/e2e/detectors/test_data/similar-names/0.4.25/similar_variables.sol#3) is too similar to Similar.f().textVariable (tests/e2e/detectors/test_data/similar-names/0.4.25/similar_variables.sol#4) - diff --git a/tests/e2e/detectors/snapshots/detectors__detector_SimilarVarsDetection_0_5_16_similar_variables_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_SimilarVarsDetection_0_5_16_similar_variables_sol__0.txt deleted file mode 100644 index 70b5c329b1..0000000000 --- a/tests/e2e/detectors/snapshots/detectors__detector_SimilarVarsDetection_0_5_16_similar_variables_sol__0.txt +++ /dev/null @@ -1,2 +0,0 @@ -Variable Similar.f().testVariable (tests/e2e/detectors/test_data/similar-names/0.5.16/similar_variables.sol#3) is too similar to Similar.f().textVariable (tests/e2e/detectors/test_data/similar-names/0.5.16/similar_variables.sol#4) - diff --git a/tests/e2e/detectors/snapshots/detectors__detector_SimilarVarsDetection_0_6_11_similar_variables_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_SimilarVarsDetection_0_6_11_similar_variables_sol__0.txt deleted file mode 100644 index efb92b5aa8..0000000000 --- a/tests/e2e/detectors/snapshots/detectors__detector_SimilarVarsDetection_0_6_11_similar_variables_sol__0.txt +++ /dev/null @@ -1,2 +0,0 @@ -Variable Similar.f().testVariable (tests/e2e/detectors/test_data/similar-names/0.6.11/similar_variables.sol#3) is too similar to Similar.f().textVariable (tests/e2e/detectors/test_data/similar-names/0.6.11/similar_variables.sol#4) - diff --git a/tests/e2e/detectors/snapshots/detectors__detector_SimilarVarsDetection_0_7_6_similar_variables_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_SimilarVarsDetection_0_7_6_similar_variables_sol__0.txt deleted file mode 100644 index 67d4823289..0000000000 --- a/tests/e2e/detectors/snapshots/detectors__detector_SimilarVarsDetection_0_7_6_similar_variables_sol__0.txt +++ /dev/null @@ -1,2 +0,0 @@ -Variable Similar.f().testVariable (tests/e2e/detectors/test_data/similar-names/0.7.6/similar_variables.sol#3) is too similar to Similar.f().textVariable (tests/e2e/detectors/test_data/similar-names/0.7.6/similar_variables.sol#4) - diff --git a/tests/e2e/detectors/test_data/similar-names/0.4.25/similar_variables.sol b/tests/e2e/detectors/test_data/similar-names/0.4.25/similar_variables.sol deleted file mode 100644 index 57f9698675..0000000000 --- a/tests/e2e/detectors/test_data/similar-names/0.4.25/similar_variables.sol +++ /dev/null @@ -1,7 +0,0 @@ -contract Similar { - function f() public returns (uint) { - uint testVariable = 1; - uint textVariable = 2; - return testVariable + textVariable; - } -} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/similar-names/0.4.25/similar_variables.sol-0.4.25.zip b/tests/e2e/detectors/test_data/similar-names/0.4.25/similar_variables.sol-0.4.25.zip deleted file mode 100644 index b91c8f6ffec918553447028a840b0e1095858ddf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1788 zcma*o_g~Tp0|)T0iWrmw_s;EQj&tS6osbuKS}IbmT;*19uM|gODQ2z`)N|lW%rpwM z!`VsXA{Ecd)JpRVJuy#n(9?6jKd;yG`TX#Ceg1;CD^dVt3-ALX0J1O$KF5klS)&Dm;EB625tcaV_UdB}$z6i0$fguZT2Hf?+?bUV%iMb-9nUdS;>dr?W)9aRKG&WLv0 zwhgx4NKOTb$i>=64t{El({{t;O(vdh z63=D~(P?(NN~aBNeN_2u4eTG33>K9AQq9~_Gib=Zgk04Glg+gwhnjT`_5n_d-klq& zE8zMA+VM##xpE8rdHl<=?Mf9`Zxh_iqx)|l&g5aBF6Gl*IaLFuKP^17RQa(JKoX{`0^7LFkz^@p3=&RrtsWwG4XOCVftyLJ0eMDk7Uj z67Li4rHT98<16m5!fm{4kZrS`C=#M4^TY>jZj9FtP!Ts}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&6Vgd<*seOmC9>_=HF7zIW%g}Cf_RalbwrI-@;FSb~T51hdJ8YMr8XclSa9E zI_s6OsPddoU0@u0;wCYLR`}x8l5~0r#lbV!T&N3+^@>cR_?oqcMmggY)3(1}w{c#_ zRYDh0)oOk*k!wo)L>gt0q8}eRBZ*d@2!zhXh!aSH-oH}RM%)mlSDKwjEwa+Ed(sr$ zC`~U_esQGTs@kdH!iy$)yS*8Nu&g1r*OpV|n&s?7!KtfHx$v=D61l$(5nlSg*2;eP zUH8n-Z3iCDm!4IiZD$R0sMZc1LK$60-{Sn(JjAUuShU_mZE)F1rxFb|ZwkT6{2 g|J!C?IR7SH=zsXn?m@YW?kfubg!b#RPyD~{AN^4 Date: Wed, 5 Jun 2024 16:48:57 +0200 Subject: [PATCH 41/45] Improve message error for when Crytic throws a KeyError. (#2418) * Improve message error for when Crytic throws a KeyError. * Remove unneeded logger usage and fix typo --- slither/core/source_mapping/source_mapping.py | 18 +++++++-- .../test_data/test_change/README.md | 3 ++ .../test_data/test_change/foundry.toml | 6 +++ .../test_data/test_change/src/Counter.sol | 16 ++++++++ tests/e2e/compilation/test_diagnostic.py | 40 +++++++++++++++++++ 5 files changed, 80 insertions(+), 3 deletions(-) create mode 100644 tests/e2e/compilation/test_data/test_change/README.md create mode 100644 tests/e2e/compilation/test_data/test_change/foundry.toml create mode 100644 tests/e2e/compilation/test_data/test_change/src/Counter.sol create mode 100644 tests/e2e/compilation/test_diagnostic.py diff --git a/slither/core/source_mapping/source_mapping.py b/slither/core/source_mapping/source_mapping.py index 8dda25a241..41841f1e80 100644 --- a/slither/core/source_mapping/source_mapping.py +++ b/slither/core/source_mapping/source_mapping.py @@ -4,6 +4,7 @@ from Crypto.Hash import SHA1 from crytic_compile.utils.naming import Filename from slither.core.context.context import Context +from slither.exceptions import SlitherException if TYPE_CHECKING: from slither.core.compilation_unit import SlitherCompilationUnit @@ -136,9 +137,20 @@ def _compute_line( start_line, starting_column = compilation_unit.core.crytic_compile.get_line_from_offset( filename, start ) - end_line, ending_column = compilation_unit.core.crytic_compile.get_line_from_offset( - filename, start + length - ) + try: + end_line, ending_column = compilation_unit.core.crytic_compile.get_line_from_offset( + filename, start + length + ) + except KeyError: + # This error may occur when the build is not synchronised with the source code on disk. + # See the GitHub issue https://github.com/crytic/slither/issues/2296 + msg = f"""The source code appears to be out of sync with the build artifacts on disk. + This discrepancy can occur after recent modifications to {filename.short}. To resolve this + issue, consider executing the clean command of the build system (e.g. forge clean). + """ + # We still re-raise the exception as a SlitherException here + raise SlitherException(msg) from None + return list(range(start_line, end_line + 1)), starting_column, ending_column diff --git a/tests/e2e/compilation/test_data/test_change/README.md b/tests/e2e/compilation/test_data/test_change/README.md new file mode 100644 index 0000000000..d541e925ad --- /dev/null +++ b/tests/e2e/compilation/test_data/test_change/README.md @@ -0,0 +1,3 @@ +# Foundry + +To init this test case, run `forge install --no-commit --no-git foundry-rs/forge-std` diff --git a/tests/e2e/compilation/test_data/test_change/foundry.toml b/tests/e2e/compilation/test_data/test_change/foundry.toml new file mode 100644 index 0000000000..25b918f9c9 --- /dev/null +++ b/tests/e2e/compilation/test_data/test_change/foundry.toml @@ -0,0 +1,6 @@ +[profile.default] +src = "src" +out = "out" +libs = ["lib"] + +# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options diff --git a/tests/e2e/compilation/test_data/test_change/src/Counter.sol b/tests/e2e/compilation/test_data/test_change/src/Counter.sol new file mode 100644 index 0000000000..1ca2a93194 --- /dev/null +++ b/tests/e2e/compilation/test_data/test_change/src/Counter.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.13; + +contract Counter { + uint256 public number; + + function setNumber(uint256 newNumber) public { + number = newNumber; + } + + //START + function increment() public { + number++; + } + //END +} \ No newline at end of file diff --git a/tests/e2e/compilation/test_diagnostic.py b/tests/e2e/compilation/test_diagnostic.py new file mode 100644 index 0000000000..3aa8071094 --- /dev/null +++ b/tests/e2e/compilation/test_diagnostic.py @@ -0,0 +1,40 @@ +from pathlib import Path +import shutil +import re + +import pytest + +from slither import Slither +from slither.exceptions import SlitherException + + +TEST_DATA_DIR = Path(__file__).resolve().parent / "test_data" + +foundry_available = shutil.which("forge") is not None +project_ready = Path(TEST_DATA_DIR, "test_change/lib/forge-std").exists() + + +@pytest.mark.skipif( + not foundry_available or not project_ready, reason="requires Foundry and project setup" +) +def test_diagnostic(): + + test_file_directory = TEST_DATA_DIR / "test_change" + + sl = Slither(test_file_directory.as_posix()) + assert len(sl.compilation_units) == 1 + + counter_file = test_file_directory / "src" / "Counter.sol" + shutil.copy(counter_file, counter_file.with_suffix(".bak")) + + with counter_file.open("r") as file: + content = file.read() + + with counter_file.open("w") as file: + file.write(re.sub(r"//START.*?//END\n?", "", content, flags=re.DOTALL)) + + with pytest.raises(SlitherException): + Slither(test_file_directory.as_posix(), ignore_compile=True) + + # Restore the original counter so the test is idempotent + Path(counter_file.with_suffix(".bak")).rename(counter_file) From 57842b0c862be667639ea21d46991fd132d5b835 Mon Sep 17 00:00:00 2001 From: dm Date: Wed, 5 Jun 2024 18:56:57 +0200 Subject: [PATCH 42/45] Fix regex patterns (#2442) --- slither/solc_parsing/expressions/expression_parsing.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/slither/solc_parsing/expressions/expression_parsing.py b/slither/solc_parsing/expressions/expression_parsing.py index 4991984ff7..afa5c367b2 100644 --- a/slither/solc_parsing/expressions/expression_parsing.py +++ b/slither/solc_parsing/expressions/expression_parsing.py @@ -501,7 +501,9 @@ def parse_expression(expression: Dict, caller_context: CallerContextExpression) referenced_declaration = expression["attributes"]["referencedDeclaration"] if t: - found = re.findall(r"[struct|enum|function|modifier] \(([\[\] ()a-zA-Z0-9\.,_]*)\)", t) + found = re.findall( + r"(?:struct|enum|function|modifier) \(([\[\] ()a-zA-Z0-9\.,_]*)\)", t + ) assert len(found) <= 1 if found: value = value + "(" + found[0] + ")" From 54432922f6c697cafbdca7281daf93e75faa9dfd Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Wed, 5 Jun 2024 16:36:00 -0500 Subject: [PATCH 43/45] fix: do not flag imports from import container as unused (#2471) --- slither/detectors/statements/unused_import.py | 58 +++++++++++++++++-- 1 file changed, 52 insertions(+), 6 deletions(-) diff --git a/slither/detectors/statements/unused_import.py b/slither/detectors/statements/unused_import.py index fe29a91d8f..0660a279e2 100644 --- a/slither/detectors/statements/unused_import.py +++ b/slither/detectors/statements/unused_import.py @@ -1,5 +1,6 @@ from typing import List from slither.detectors.abstract_detector import AbstractDetector, DetectorClassification, Output +from slither.core.scope.scope import FileScope # pylint: disable=protected-access,too-many-nested-blocks class UnusedImport(AbstractDetector): @@ -30,26 +31,71 @@ class UnusedImport(AbstractDetector): "Remove the unused import. If the import is needed later, it can be added back." ) + @staticmethod + def _is_import_container(scope: FileScope) -> bool: # pylint: disable=too-many-branches + """ + Returns True if a given file (provided as a `FileScope` object) contains only `import` directives (and pragmas). + Such a file doesn't need the imports it contains, but its purpose is to aggregate certain correlated imports. + """ + for c in scope.contracts.values(): + if c.file_scope == scope: + return False + for err in scope.custom_errors: + if err.file_scope == scope: + return False + for en in scope.enums.values(): + if en.file_scope == scope: + return False + for f in scope.functions: + if f.file_scope == scope: + return False + for st in scope.structures.values(): + if st.file_scope == scope: + return False + for ct in scope.type_aliases.values(): + if ct.source_mapping and ct.source_mapping.filename == scope.filename: + return False + for uf in scope.using_for_directives: + if uf.file_scope == scope: + return False + for v in scope.variables.values(): + if v.file_scope == scope: + return False + return True + def _detect(self) -> List[Output]: results: List[Output] = [] # This is computed lazily and then memoized so we need to trigger the computation. self.slither._compute_offsets_to_ref_impl_decl() for unit in self.slither.compilation_units: - for filename, scope in unit.scopes.items(): + for filename, current_scope in unit.scopes.items(): + # Skip files that are dependencies + if unit.crytic_compile.is_dependency(filename.absolute): + continue + unused = [] - for i in scope.imports: + for i in current_scope.imports: # `scope.imports` contains all transitive imports so we need to filter out imports not explicitly imported in the file. # Otherwise, we would recommend removing an import that is used by a leaf contract and cause compilation errors. - if i.scope != scope: + if i.scope != current_scope: + continue + + # If a scope doesn't define any contract, function, etc., it is an import container. + # The second case accounts for importing from an import container as a reference will only be in the definition's file. + if self._is_import_container(i.scope) or self._is_import_container( + unit.get_scope(i.filename) + ): continue - import_path = self.slither.crytic_compile.filename_lookup(i.filename) + imported_path = self.slither.crytic_compile.filename_lookup(i.filename) use_found = False # Search through all references to the imported file - for _, refs in self.slither._offset_to_references[import_path].items(): - for ref in refs: + for _, refs_to_imported_path in self.slither._offset_to_references[ + imported_path + ].items(): + for ref in refs_to_imported_path: # If there is a reference in this file to the imported file, it is used. if ref.filename == filename: use_found = True From a0afa2573e0b40188c73479703f01e84d456acf6 Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Wed, 5 Jun 2024 16:59:32 -0500 Subject: [PATCH 44/45] fix: filtering of unused-import,incorrect-solc, pragma (#2472) --- .../detectors/attributes/constant_pragma.py | 14 +++++----- .../detectors/attributes/incorrect_solc.py | 10 ++++--- slither/detectors/statements/unused_import.py | 26 +++++++++---------- ...tantPragma_0_4_25_pragma_0_4_25_sol__0.txt | 4 +-- ...tantPragma_0_5_16_pragma_0_5_16_sol__0.txt | 4 +-- ...tantPragma_0_6_11_pragma_0_6_11_sol__0.txt | 4 +-- ...nstantPragma_0_7_6_pragma_0_7_6_sol__0.txt | 4 +-- ...tor_IncorrectSolc_0_4_25_static_sol__0.txt | 8 +++--- ...tor_IncorrectSolc_0_5_14_static_sol__0.txt | 4 +-- ..._IncorrectSolc_0_5_16_dynamic_1_sol__0.txt | 4 +-- ..._IncorrectSolc_0_5_16_dynamic_2_sol__0.txt | 4 +-- ...tor_IncorrectSolc_0_5_16_static_sol__0.txt | 4 +-- ...tor_IncorrectSolc_0_6_10_static_sol__0.txt | 4 +-- ..._IncorrectSolc_0_6_11_dynamic_1_sol__0.txt | 4 +-- ..._IncorrectSolc_0_6_11_dynamic_2_sol__0.txt | 4 +-- ...tor_IncorrectSolc_0_6_11_static_sol__0.txt | 4 +-- ...ctor_IncorrectSolc_0_7_4_static_sol__0.txt | 8 +++--- ...r_IncorrectSolc_0_7_6_dynamic_1_sol__0.txt | 8 +++--- ...r_IncorrectSolc_0_7_6_dynamic_2_sol__0.txt | 8 +++--- ...ctor_IncorrectSolc_0_7_6_static_sol__0.txt | 8 +++--- ..._detector_UnusedImport_0_8_16_C_sol__0.txt | 8 +++--- 21 files changed, 72 insertions(+), 74 deletions(-) diff --git a/slither/detectors/attributes/constant_pragma.py b/slither/detectors/attributes/constant_pragma.py index 44a2cb791c..e391f1d56d 100644 --- a/slither/detectors/attributes/constant_pragma.py +++ b/slither/detectors/attributes/constant_pragma.py @@ -36,21 +36,19 @@ def _detect(self) -> List[Output]: for pragma in self.compilation_unit.pragma_directives: if pragma.is_solidity_version: if pragma.version not in pragma_directives_by_version: - pragma_directives_by_version[ - pragma.version - ] = f"\t\t- {str(pragma.source_mapping)}\n" + pragma_directives_by_version[pragma.version] = [pragma] else: - pragma_directives_by_version[ - pragma.version - ] += f"\t\t- {str(pragma.source_mapping)}\n" + pragma_directives_by_version[pragma.version].append(pragma) versions = list(pragma_directives_by_version.keys()) if len(versions) > 1: info: DETECTOR_INFO = [f"{len(versions)} different versions of Solidity are used:\n"] for version in versions: - pragma = pragma_directives_by_version[version] - info += [f"\t- Version constraint {version} is used by:\n {pragma}"] + pragmas = pragma_directives_by_version[version] + info += [f"\t- Version constraint {version} is used by:\n"] + for pragma in pragmas: + info += ["\t\t-", pragma, "\n"] res = self.generate_result(info) diff --git a/slither/detectors/attributes/incorrect_solc.py b/slither/detectors/attributes/incorrect_solc.py index 56ff13315d..532a964934 100644 --- a/slither/detectors/attributes/incorrect_solc.py +++ b/slither/detectors/attributes/incorrect_solc.py @@ -115,16 +115,18 @@ def _detect(self) -> List[Output]: continue if p.version in disallowed_pragmas and reason in disallowed_pragmas[p.version]: - disallowed_pragmas[p.version][reason] += f"\t- {str(p.source_mapping)}\n" + disallowed_pragmas[p.version][reason].append(p) else: - disallowed_pragmas[p.version] = {reason: f"\t- {str(p.source_mapping)}\n"} + disallowed_pragmas[p.version] = {reason: [p]} # If we found any disallowed pragmas, we output our findings. if len(disallowed_pragmas.keys()): for p, reasons in disallowed_pragmas.items(): info: DETECTOR_INFO = [] - for r, v in reasons.items(): - info += [f"Version constraint {p} {r}.\n It is used by:\n{v}"] + for r, vers in reasons.items(): + info += [f"Version constraint {p} {r}.\nIt is used by:\n"] + for ver in vers: + info += ["\t- ", ver, "\n"] json = self.generate_result(info) diff --git a/slither/detectors/statements/unused_import.py b/slither/detectors/statements/unused_import.py index 0660a279e2..d3447dcd81 100644 --- a/slither/detectors/statements/unused_import.py +++ b/slither/detectors/statements/unused_import.py @@ -63,7 +63,7 @@ def _is_import_container(scope: FileScope) -> bool: # pylint: disable=too-many- return False return True - def _detect(self) -> List[Output]: + def _detect(self) -> List[Output]: # pylint: disable=too-many-branches results: List[Output] = [] # This is computed lazily and then memoized so we need to trigger the computation. self.slither._compute_offsets_to_ref_impl_decl() @@ -74,7 +74,7 @@ def _detect(self) -> List[Output]: if unit.crytic_compile.is_dependency(filename.absolute): continue - unused = [] + unused_list = [] for i in current_scope.imports: # `scope.imports` contains all transitive imports so we need to filter out imports not explicitly imported in the file. # Otherwise, we would recommend removing an import that is used by a leaf contract and cause compilation errors. @@ -105,17 +105,15 @@ def _detect(self) -> List[Output]: break if not use_found: - unused.append(f"{i.source_mapping.content} ({i.source_mapping})") - - if len(unused) > 0: - unused_list = "\n\t-" + "\n\t-".join(unused) - - results.append( - self.generate_result( - [ - f"The following unused import(s) in {filename.used} should be removed: {unused_list}\n", - ] - ) - ) + unused_list.append(f"{i.source_mapping.content} ({i.source_mapping})") + + if len(unused_list) > 0: + info = [ + f"The following unused import(s) in {filename.used} should be removed:", + ] + for unused in unused_list: + info += ["\n\t-", unused, "\n"] + + results.append(self.generate_result(info)) return results diff --git a/tests/e2e/detectors/snapshots/detectors__detector_ConstantPragma_0_4_25_pragma_0_4_25_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_ConstantPragma_0_4_25_pragma_0_4_25_sol__0.txt index 717ca87499..971bb214db 100644 --- a/tests/e2e/detectors/snapshots/detectors__detector_ConstantPragma_0_4_25_pragma_0_4_25_sol__0.txt +++ b/tests/e2e/detectors/snapshots/detectors__detector_ConstantPragma_0_4_25_pragma_0_4_25_sol__0.txt @@ -1,6 +1,6 @@ 2 different versions of Solidity are used: - Version constraint ^0.4.25 is used by: - - tests/e2e/detectors/test_data/pragma/0.4.25/pragma.0.4.25.sol#1 + -^0.4.25 (tests/e2e/detectors/test_data/pragma/0.4.25/pragma.0.4.25.sol#1) - Version constraint ^0.4.24 is used by: - - tests/e2e/detectors/test_data/pragma/0.4.25/pragma.0.4.24.sol#1 + -^0.4.24 (tests/e2e/detectors/test_data/pragma/0.4.25/pragma.0.4.24.sol#1) diff --git a/tests/e2e/detectors/snapshots/detectors__detector_ConstantPragma_0_5_16_pragma_0_5_16_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_ConstantPragma_0_5_16_pragma_0_5_16_sol__0.txt index ae5543f3d5..cfb1d98196 100644 --- a/tests/e2e/detectors/snapshots/detectors__detector_ConstantPragma_0_5_16_pragma_0_5_16_sol__0.txt +++ b/tests/e2e/detectors/snapshots/detectors__detector_ConstantPragma_0_5_16_pragma_0_5_16_sol__0.txt @@ -1,6 +1,6 @@ 2 different versions of Solidity are used: - Version constraint ^0.5.16 is used by: - - tests/e2e/detectors/test_data/pragma/0.5.16/pragma.0.5.16.sol#1 + -^0.5.16 (tests/e2e/detectors/test_data/pragma/0.5.16/pragma.0.5.16.sol#1) - Version constraint ^0.5.15 is used by: - - tests/e2e/detectors/test_data/pragma/0.5.16/pragma.0.5.15.sol#1 + -^0.5.15 (tests/e2e/detectors/test_data/pragma/0.5.16/pragma.0.5.15.sol#1) diff --git a/tests/e2e/detectors/snapshots/detectors__detector_ConstantPragma_0_6_11_pragma_0_6_11_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_ConstantPragma_0_6_11_pragma_0_6_11_sol__0.txt index f8ccb74bb9..647e535f1a 100644 --- a/tests/e2e/detectors/snapshots/detectors__detector_ConstantPragma_0_6_11_pragma_0_6_11_sol__0.txt +++ b/tests/e2e/detectors/snapshots/detectors__detector_ConstantPragma_0_6_11_pragma_0_6_11_sol__0.txt @@ -1,6 +1,6 @@ 2 different versions of Solidity are used: - Version constraint ^0.6.11 is used by: - - tests/e2e/detectors/test_data/pragma/0.6.11/pragma.0.6.11.sol#1 + -^0.6.11 (tests/e2e/detectors/test_data/pragma/0.6.11/pragma.0.6.11.sol#1) - Version constraint ^0.6.10 is used by: - - tests/e2e/detectors/test_data/pragma/0.6.11/pragma.0.6.10.sol#1 + -^0.6.10 (tests/e2e/detectors/test_data/pragma/0.6.11/pragma.0.6.10.sol#1) diff --git a/tests/e2e/detectors/snapshots/detectors__detector_ConstantPragma_0_7_6_pragma_0_7_6_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_ConstantPragma_0_7_6_pragma_0_7_6_sol__0.txt index 4c1a821a3d..6b3309a768 100644 --- a/tests/e2e/detectors/snapshots/detectors__detector_ConstantPragma_0_7_6_pragma_0_7_6_sol__0.txt +++ b/tests/e2e/detectors/snapshots/detectors__detector_ConstantPragma_0_7_6_pragma_0_7_6_sol__0.txt @@ -1,6 +1,6 @@ 2 different versions of Solidity are used: - Version constraint ^0.7.6 is used by: - - tests/e2e/detectors/test_data/pragma/0.7.6/pragma.0.7.6.sol#1 + -^0.7.6 (tests/e2e/detectors/test_data/pragma/0.7.6/pragma.0.7.6.sol#1) - Version constraint ^0.7.5 is used by: - - tests/e2e/detectors/test_data/pragma/0.7.6/pragma.0.7.5.sol#1 + -^0.7.5 (tests/e2e/detectors/test_data/pragma/0.7.6/pragma.0.7.5.sol#1) diff --git a/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_4_25_static_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_4_25_static_sol__0.txt index 0a37cfba03..75c7b031da 100644 --- a/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_4_25_static_sol__0.txt +++ b/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_4_25_static_sol__0.txt @@ -1,5 +1,3 @@ -solc-0.4.25 is an outdated solc version. Use a more recent version (at least 0.8.0), if possible. - Version constraint 0.4.25 contains known severe issues (https://solidity.readthedocs.io/en/latest/bugs.html) - DirtyBytesArrayToStorage - ABIDecodeTwoDimensionalArrayMemory @@ -16,6 +14,8 @@ Version constraint 0.4.25 contains known severe issues (https://solidity.readthe - UninitializedFunctionPointerInConstructor_0.4.x - IncorrectEventSignatureInLibraries_0.4.x - ABIEncoderV2PackedStorage_0.4.x. - It is used by: - - tests/e2e/detectors/test_data/solc-version/0.4.25/static.sol#1 +It is used by: + - 0.4.25 (tests/e2e/detectors/test_data/solc-version/0.4.25/static.sol#1) + +solc-0.4.25 is an outdated solc version. Use a more recent version (at least 0.8.0), if possible. diff --git a/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_5_14_static_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_5_14_static_sol__0.txt index 7a65a5925d..9ae939c707 100644 --- a/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_5_14_static_sol__0.txt +++ b/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_5_14_static_sol__0.txt @@ -13,8 +13,8 @@ Version constraint 0.5.14 contains known severe issues (https://solidity.readthe - privateCanBeOverridden - YulOptimizerRedundantAssignmentBreakContinue0.5 - ABIEncoderV2LoopYulOptimizer. - It is used by: - - tests/e2e/detectors/test_data/solc-version/0.5.14/static.sol#1 +It is used by: + - 0.5.14 (tests/e2e/detectors/test_data/solc-version/0.5.14/static.sol#1) solc-0.5.14 is an outdated solc version. Use a more recent version (at least 0.8.0), if possible. diff --git a/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_5_16_dynamic_1_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_5_16_dynamic_1_sol__0.txt index 442355e38c..826d1d357a 100644 --- a/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_5_16_dynamic_1_sol__0.txt +++ b/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_5_16_dynamic_1_sol__0.txt @@ -12,8 +12,8 @@ Version constraint ^0.5.15 contains known severe issues (https://solidity.readth - MemoryArrayCreationOverflow - privateCanBeOverridden - YulOptimizerRedundantAssignmentBreakContinue0.5. - It is used by: - - tests/e2e/detectors/test_data/solc-version/0.5.16/dynamic_1.sol#1 +It is used by: + - ^0.5.15 (tests/e2e/detectors/test_data/solc-version/0.5.16/dynamic_1.sol#1) solc-0.5.16 is an outdated solc version. Use a more recent version (at least 0.8.0), if possible. diff --git a/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_5_16_dynamic_2_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_5_16_dynamic_2_sol__0.txt index 9cde284b52..b4cf6391e1 100644 --- a/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_5_16_dynamic_2_sol__0.txt +++ b/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_5_16_dynamic_2_sol__0.txt @@ -14,8 +14,8 @@ Version constraint >=0.5.0<0.6.0 contains known severe issues (https://solidity. - UninitializedFunctionPointerInConstructor - IncorrectEventSignatureInLibraries - ABIEncoderV2PackedStorage. - It is used by: - - tests/e2e/detectors/test_data/solc-version/0.5.16/dynamic_2.sol#1 +It is used by: + - >=0.5.0<0.6.0 (tests/e2e/detectors/test_data/solc-version/0.5.16/dynamic_2.sol#1) solc-0.5.16 is an outdated solc version. Use a more recent version (at least 0.8.0), if possible. diff --git a/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_5_16_static_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_5_16_static_sol__0.txt index 15f233fe73..36088f7dab 100644 --- a/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_5_16_static_sol__0.txt +++ b/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_5_16_static_sol__0.txt @@ -11,8 +11,8 @@ Version constraint 0.5.16 contains known severe issues (https://solidity.readthe - TupleAssignmentMultiStackSlotComponents - MemoryArrayCreationOverflow - privateCanBeOverridden. - It is used by: - - tests/e2e/detectors/test_data/solc-version/0.5.16/static.sol#1 +It is used by: + - 0.5.16 (tests/e2e/detectors/test_data/solc-version/0.5.16/static.sol#1) solc-0.5.16 is an outdated solc version. Use a more recent version (at least 0.8.0), if possible. diff --git a/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_6_10_static_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_6_10_static_sol__0.txt index de41146274..48301062fe 100644 --- a/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_6_10_static_sol__0.txt +++ b/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_6_10_static_sol__0.txt @@ -12,6 +12,6 @@ Version constraint 0.6.10 contains known severe issues (https://solidity.readthe - KeccakCaching - EmptyByteArrayCopy - DynamicArrayCleanup. - It is used by: - - tests/e2e/detectors/test_data/solc-version/0.6.10/static.sol#1 +It is used by: + - 0.6.10 (tests/e2e/detectors/test_data/solc-version/0.6.10/static.sol#1) diff --git a/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_6_11_dynamic_1_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_6_11_dynamic_1_sol__0.txt index 626683d0ee..88bc6b0cdb 100644 --- a/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_6_11_dynamic_1_sol__0.txt +++ b/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_6_11_dynamic_1_sol__0.txt @@ -10,8 +10,8 @@ Version constraint ^0.6.10 contains known severe issues (https://solidity.readth - KeccakCaching - EmptyByteArrayCopy - DynamicArrayCleanup. - It is used by: - - tests/e2e/detectors/test_data/solc-version/0.6.11/dynamic_1.sol#1 +It is used by: + - ^0.6.10 (tests/e2e/detectors/test_data/solc-version/0.6.11/dynamic_1.sol#1) solc-0.6.11 is an outdated solc version. Use a more recent version (at least 0.8.0), if possible. diff --git a/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_6_11_dynamic_2_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_6_11_dynamic_2_sol__0.txt index 2142313f28..d7959d2cff 100644 --- a/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_6_11_dynamic_2_sol__0.txt +++ b/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_6_11_dynamic_2_sol__0.txt @@ -12,8 +12,8 @@ Version constraint >=0.6.0<0.7.0 contains known severe issues (https://solidity. - TupleAssignmentMultiStackSlotComponents - MemoryArrayCreationOverflow - YulOptimizerRedundantAssignmentBreakContinue. - It is used by: - - tests/e2e/detectors/test_data/solc-version/0.6.11/dynamic_2.sol#1 +It is used by: + - >=0.6.0<0.7.0 (tests/e2e/detectors/test_data/solc-version/0.6.11/dynamic_2.sol#1) solc-0.6.11 is an outdated solc version. Use a more recent version (at least 0.8.0), if possible. diff --git a/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_6_11_static_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_6_11_static_sol__0.txt index ef330a1bbb..f5f5638bc7 100644 --- a/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_6_11_static_sol__0.txt +++ b/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_6_11_static_sol__0.txt @@ -10,8 +10,8 @@ Version constraint 0.6.11 contains known severe issues (https://solidity.readthe - KeccakCaching - EmptyByteArrayCopy - DynamicArrayCleanup. - It is used by: - - tests/e2e/detectors/test_data/solc-version/0.6.11/static.sol#1 +It is used by: + - 0.6.11 (tests/e2e/detectors/test_data/solc-version/0.6.11/static.sol#1) solc-0.6.11 is an outdated solc version. Use a more recent version (at least 0.8.0), if possible. diff --git a/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_7_4_static_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_7_4_static_sol__0.txt index 052d8cb271..06a5f98497 100644 --- a/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_7_4_static_sol__0.txt +++ b/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_7_4_static_sol__0.txt @@ -1,3 +1,5 @@ +solc-0.7.4 is an outdated solc version. Use a more recent version (at least 0.8.0), if possible. + Version constraint 0.7.4 contains known severe issues (https://solidity.readthedocs.io/en/latest/bugs.html) - FullInlinerNonExpressionSplitArgumentEvaluationOrder - MissingSideEffectsOnSelectorAccess @@ -8,8 +10,6 @@ Version constraint 0.7.4 contains known severe issues (https://solidity.readthed - SignedImmutables - ABIDecodeTwoDimensionalArrayMemory - KeccakCaching. - It is used by: - - tests/e2e/detectors/test_data/solc-version/0.7.4/static.sol#1 - -solc-0.7.4 is an outdated solc version. Use a more recent version (at least 0.8.0), if possible. +It is used by: + - 0.7.4 (tests/e2e/detectors/test_data/solc-version/0.7.4/static.sol#1) diff --git a/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_7_6_dynamic_1_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_7_6_dynamic_1_sol__0.txt index 0a67e6f3ea..2749ed44c2 100644 --- a/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_7_6_dynamic_1_sol__0.txt +++ b/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_7_6_dynamic_1_sol__0.txt @@ -1,5 +1,3 @@ -solc-0.7.6 is an outdated solc version. Use a more recent version (at least 0.8.0), if possible. - Version constraint ^0.7.4 contains known severe issues (https://solidity.readthedocs.io/en/latest/bugs.html) - FullInlinerNonExpressionSplitArgumentEvaluationOrder - MissingSideEffectsOnSelectorAccess @@ -10,6 +8,8 @@ Version constraint ^0.7.4 contains known severe issues (https://solidity.readthe - SignedImmutables - ABIDecodeTwoDimensionalArrayMemory - KeccakCaching. - It is used by: - - tests/e2e/detectors/test_data/solc-version/0.7.6/dynamic_1.sol#1 +It is used by: + - ^0.7.4 (tests/e2e/detectors/test_data/solc-version/0.7.6/dynamic_1.sol#1) + +solc-0.7.6 is an outdated solc version. Use a more recent version (at least 0.8.0), if possible. diff --git a/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_7_6_dynamic_2_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_7_6_dynamic_2_sol__0.txt index ae3793886c..84413fbc48 100644 --- a/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_7_6_dynamic_2_sol__0.txt +++ b/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_7_6_dynamic_2_sol__0.txt @@ -1,6 +1,6 @@ -Version constraint >=0.7.0<=0.7.6 is too complex. - It is used by: - - tests/e2e/detectors/test_data/solc-version/0.7.6/dynamic_2.sol#1 - solc-0.7.6 is an outdated solc version. Use a more recent version (at least 0.8.0), if possible. +Version constraint >=0.7.0<=0.7.6 is too complex. +It is used by: + - >=0.7.0<=0.7.6 (tests/e2e/detectors/test_data/solc-version/0.7.6/dynamic_2.sol#1) + diff --git a/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_7_6_static_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_7_6_static_sol__0.txt index 70bc412b75..b12f1d1f45 100644 --- a/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_7_6_static_sol__0.txt +++ b/tests/e2e/detectors/snapshots/detectors__detector_IncorrectSolc_0_7_6_static_sol__0.txt @@ -1,5 +1,3 @@ -solc-0.7.6 is an outdated solc version. Use a more recent version (at least 0.8.0), if possible. - Version constraint 0.7.6 contains known severe issues (https://solidity.readthedocs.io/en/latest/bugs.html) - FullInlinerNonExpressionSplitArgumentEvaluationOrder - MissingSideEffectsOnSelectorAccess @@ -10,6 +8,8 @@ Version constraint 0.7.6 contains known severe issues (https://solidity.readthed - SignedImmutables - ABIDecodeTwoDimensionalArrayMemory - KeccakCaching. - It is used by: - - tests/e2e/detectors/test_data/solc-version/0.7.6/static.sol#1 +It is used by: + - 0.7.6 (tests/e2e/detectors/test_data/solc-version/0.7.6/static.sol#1) + +solc-0.7.6 is an outdated solc version. Use a more recent version (at least 0.8.0), if possible. diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_C_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_C_sol__0.txt index f5556857be..df4d95471d 100644 --- a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_C_sol__0.txt +++ b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_C_sol__0.txt @@ -1,6 +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: +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) +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) + From 02df0dcf37bca9b70e6a43acf6a5deceeba12b45 Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Wed, 5 Jun 2024 17:34:47 -0500 Subject: [PATCH 45/45] prepare 0.10.3 release (#2474) --- README.md | 13 ++++++------- setup.py | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index d7f0fd3e3d..515d6a9f7d 100644 --- a/README.md +++ b/README.md @@ -196,13 +196,12 @@ Num | Detector | What it Detects | Impact | Confidence 85 | `costly-loop` | [Costly operations in a loop](https://github.com/crytic/slither/wiki/Detector-Documentation#costly-operations-inside-a-loop) | Informational | Medium 86 | `dead-code` | [Functions that are not used](https://github.com/crytic/slither/wiki/Detector-Documentation#dead-code) | Informational | Medium 87 | `reentrancy-unlimited-gas` | [Reentrancy vulnerabilities through send and transfer](https://github.com/crytic/slither/wiki/Detector-Documentation#reentrancy-vulnerabilities-4) | Informational | Medium -88 | `similar-names` | [Variable names are too similar](https://github.com/crytic/slither/wiki/Detector-Documentation#variable-names-too-similar) | Informational | Medium -89 | `too-many-digits` | [Conformance to numeric notation best practices](https://github.com/crytic/slither/wiki/Detector-Documentation#too-many-digits) | Informational | Medium -90 | `cache-array-length` | [Detects `for` loops that use `length` member of some storage array in their loop condition and don't modify it.](https://github.com/crytic/slither/wiki/Detector-Documentation#cache-array-length) | Optimization | High -91 | `constable-states` | [State variables that could be declared constant](https://github.com/crytic/slither/wiki/Detector-Documentation#state-variables-that-could-be-declared-constant) | Optimization | High -92 | `external-function` | [Public function that could be declared external](https://github.com/crytic/slither/wiki/Detector-Documentation#public-function-that-could-be-declared-external) | Optimization | High -93 | `immutable-states` | [State variables that could be declared immutable](https://github.com/crytic/slither/wiki/Detector-Documentation#state-variables-that-could-be-declared-immutable) | Optimization | High -94 | `var-read-using-this` | [Contract reads its own variable using `this`](https://github.com/crytic/slither/wiki/Detector-Documentation#public-variable-read-in-external-context) | Optimization | High +88 | `too-many-digits` | [Conformance to numeric notation best practices](https://github.com/crytic/slither/wiki/Detector-Documentation#too-many-digits) | Informational | Medium +89 | `cache-array-length` | [Detects `for` loops that use `length` member of some storage array in their loop condition and don't modify it.](https://github.com/crytic/slither/wiki/Detector-Documentation#cache-array-length) | Optimization | High +90 | `constable-states` | [State variables that could be declared constant](https://github.com/crytic/slither/wiki/Detector-Documentation#state-variables-that-could-be-declared-constant) | Optimization | High +91 | `external-function` | [Public function that could be declared external](https://github.com/crytic/slither/wiki/Detector-Documentation#public-function-that-could-be-declared-external) | Optimization | High +92 | `immutable-states` | [State variables that could be declared immutable](https://github.com/crytic/slither/wiki/Detector-Documentation#state-variables-that-could-be-declared-immutable) | Optimization | High +93 | `var-read-using-this` | [Contract reads its own variable using `this`](https://github.com/crytic/slither/wiki/Detector-Documentation#public-variable-read-in-external-context) | Optimization | High For more information, see diff --git a/setup.py b/setup.py index 873edd3fe2..a669b82a30 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ description="Slither is a Solidity and Vyper static analysis framework written in Python 3.", url="https://github.com/crytic/slither", author="Trail of Bits", - version="0.10.2", + version="0.10.3", packages=find_packages(), python_requires=">=3.8", install_requires=[