diff --git a/slither/solc_parsing/declarations/function.py b/slither/solc_parsing/declarations/function.py index def68a8a30..95cb2feadc 100644 --- a/slither/solc_parsing/declarations/function.py +++ b/slither/solc_parsing/declarations/function.py @@ -282,7 +282,13 @@ def analyze_content(self) -> None: body = self._functionNotParsed.get("body", None) if body and body[self.get_key()] == "Block": - self._function.is_implemented = True + if ( + len(body["statements"]) > 0 + or len(self._functionNotParsed["modifiers"]) > 0 + or self._function.function_type + in [FunctionType.FALLBACK, FunctionType.RECEIVE, FunctionType.CONSTRUCTOR] + ): + self._function.is_implemented = True self._parse_cfg(body) for modifier in self._functionNotParsed["modifiers"]: @@ -293,13 +299,19 @@ def analyze_content(self) -> None: self._function.is_implemented = False for child in children[2:]: if child[self.get_key()] == "Block": - self._function.is_implemented = True + if len(child["children"]) > 0 or self._function.function_type in [ + FunctionType.FALLBACK, + FunctionType.RECEIVE, + FunctionType.CONSTRUCTOR, + ]: + self._function.is_implemented = True self._parse_cfg(child) # Parse modifier after parsing all the block # In the case a local variable is used in the modifier for child in children[2:]: if child[self.get_key()] == "ModifierInvocation": + self._function.is_implemented = True self._parse_modifier(child) for local_var_parser in self._local_variables_parser: diff --git a/tests/e2e/detectors/snapshots/detectors__detector_StateShadowing_0_7_5_public_gap_variable_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_StateShadowing_0_7_5_public_gap_variable_sol__0.txt index 3c007c1602..efda19d9f4 100644 --- a/tests/e2e/detectors/snapshots/detectors__detector_StateShadowing_0_7_5_public_gap_variable_sol__0.txt +++ b/tests/e2e/detectors/snapshots/detectors__detector_StateShadowing_0_7_5_public_gap_variable_sol__0.txt @@ -1,3 +1,3 @@ -DerivedContract.__gap (tests/e2e/detectors/test_data/shadowing-state/0.7.5/public_gap_variable.sol#8) shadows: +DerivedContract.__gap (tests/e2e/detectors/test_data/shadowing-state/0.7.5/public_gap_variable.sol#10) shadows: - BaseContract.__gap (tests/e2e/detectors/test_data/shadowing-state/0.7.5/public_gap_variable.sol#3) diff --git a/tests/e2e/detectors/test_data/dead-code/0.8.0/dead-code.sol b/tests/e2e/detectors/test_data/dead-code/0.8.0/dead-code.sol index 309c8fb767..1000870b10 100644 --- a/tests/e2e/detectors/test_data/dead-code/0.8.0/dead-code.sol +++ b/tests/e2e/detectors/test_data/dead-code/0.8.0/dead-code.sol @@ -1,6 +1,6 @@ contract Test{ function unused() internal{ - + uint i = 1; } } @@ -8,13 +8,13 @@ contract Test{ contract Test2{ function unused_but_shadowed() internal virtual{ - + uint i = 1; } } contract Test3 is Test2{ function unused_but_shadowed() internal override{ - + uint i = 1; } function f() public{ @@ -24,7 +24,7 @@ contract Test3 is Test2{ contract Test4 is Test2{ function unused_but_shadowed() internal override{ - + uint i = 1; } } diff --git a/tests/e2e/detectors/test_data/dead-code/0.8.0/dead-code.sol-0.8.0.zip b/tests/e2e/detectors/test_data/dead-code/0.8.0/dead-code.sol-0.8.0.zip index ce3aaea1c9..cbe1433aff 100644 Binary files a/tests/e2e/detectors/test_data/dead-code/0.8.0/dead-code.sol-0.8.0.zip and b/tests/e2e/detectors/test_data/dead-code/0.8.0/dead-code.sol-0.8.0.zip differ diff --git a/tests/e2e/detectors/test_data/reused-constructor/0.4.21/reused_base_constructor.sol b/tests/e2e/detectors/test_data/reused-constructor/0.4.21/reused_base_constructor.sol index e38d4f9ac0..3588a35a9d 100644 --- a/tests/e2e/detectors/test_data/reused-constructor/0.4.21/reused_base_constructor.sol +++ b/tests/e2e/detectors/test_data/reused-constructor/0.4.21/reused_base_constructor.sol @@ -7,31 +7,31 @@ contract A{ contract B is A{ function B(uint y) A(y * 3) public{ - + uint i = 1; } } contract C is B{ function C(uint y) A(y * 2) public{ - + uint i = 1; } } contract D is B(1), C(1) { function D() B(3) C(2) public { - + uint i = 1; } } contract E is B(1), C, D() { function E() B(1) C(2) D() public { - + uint i = 1; } } contract F is B { function F() A(1) public { - + uint i = 1; } } \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/reused-constructor/0.4.21/reused_base_constructor.sol-0.4.21.zip b/tests/e2e/detectors/test_data/reused-constructor/0.4.21/reused_base_constructor.sol-0.4.21.zip index 4523d0c440..bc93366de6 100644 Binary files a/tests/e2e/detectors/test_data/reused-constructor/0.4.21/reused_base_constructor.sol-0.4.21.zip and b/tests/e2e/detectors/test_data/reused-constructor/0.4.21/reused_base_constructor.sol-0.4.21.zip differ diff --git a/tests/e2e/detectors/test_data/reused-constructor/0.4.25/reused_base_constructor.sol b/tests/e2e/detectors/test_data/reused-constructor/0.4.25/reused_base_constructor.sol index 2567eef027..1e7e48a35f 100644 --- a/tests/e2e/detectors/test_data/reused-constructor/0.4.25/reused_base_constructor.sol +++ b/tests/e2e/detectors/test_data/reused-constructor/0.4.25/reused_base_constructor.sol @@ -7,31 +7,31 @@ contract A{ contract B is A{ constructor(uint y) A(y * 3) public{ - + uint i = 1; } } contract C is B{ constructor(uint y) A(y * 2) public{ - + uint i = 1; } } contract D is B(1), C(1) { constructor() B(3) C(2) public { - + uint i = 1; } } contract E is B(1), C, D() { constructor() B(1) C(2) D() public { - + uint i = 1; } } contract F is B { constructor() A(1) public { - + uint i = 1; } } \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/reused-constructor/0.4.25/reused_base_constructor.sol-0.4.25.zip b/tests/e2e/detectors/test_data/reused-constructor/0.4.25/reused_base_constructor.sol-0.4.25.zip index ed154ea226..851c6c570f 100644 Binary files a/tests/e2e/detectors/test_data/reused-constructor/0.4.25/reused_base_constructor.sol-0.4.25.zip and b/tests/e2e/detectors/test_data/reused-constructor/0.4.25/reused_base_constructor.sol-0.4.25.zip differ diff --git a/tests/e2e/detectors/test_data/shadowing-state/0.4.25/shadowing_state_variable.sol-0.4.25.zip b/tests/e2e/detectors/test_data/shadowing-state/0.4.25/shadowing_state_variable.sol-0.4.25.zip index 957736aba8..fff01a45d2 100644 Binary files a/tests/e2e/detectors/test_data/shadowing-state/0.4.25/shadowing_state_variable.sol-0.4.25.zip and b/tests/e2e/detectors/test_data/shadowing-state/0.4.25/shadowing_state_variable.sol-0.4.25.zip differ diff --git a/tests/e2e/detectors/test_data/shadowing-state/0.7.5/public_gap_variable.sol b/tests/e2e/detectors/test_data/shadowing-state/0.7.5/public_gap_variable.sol index 5bf5d2fa69..edf02f9d13 100644 --- a/tests/e2e/detectors/test_data/shadowing-state/0.7.5/public_gap_variable.sol +++ b/tests/e2e/detectors/test_data/shadowing-state/0.7.5/public_gap_variable.sol @@ -1,10 +1,14 @@ pragma solidity ^0.7.5; contract BaseContract{ uint256[50] private __gap; - function f() external {} + function f() external { + uint i = 1; + } } contract DerivedContract is BaseContract{ uint256[50] public __gap; - function g() external {} + function g() external { + uint j = 2; + } } diff --git a/tests/e2e/detectors/test_data/shadowing-state/0.7.5/public_gap_variable.sol-0.7.5.zip b/tests/e2e/detectors/test_data/shadowing-state/0.7.5/public_gap_variable.sol-0.7.5.zip index 516c1d36df..0bb80171ab 100644 Binary files a/tests/e2e/detectors/test_data/shadowing-state/0.7.5/public_gap_variable.sol-0.7.5.zip and b/tests/e2e/detectors/test_data/shadowing-state/0.7.5/public_gap_variable.sol-0.7.5.zip differ diff --git a/tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/Fixed.sol b/tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/Fixed.sol index b3b21f5fe5..dd48a5a157 100644 --- a/tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/Fixed.sol +++ b/tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/Fixed.sol @@ -40,7 +40,9 @@ contract UpgradeableNoDestruct is Initializable{ contract Fixed2 is Initializable { address owner; - constructor() public initializer {} + constructor() public initializer { + uint i = 1; + } function initialize() external initializer { require(owner == address(0)); diff --git a/tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/Fixed.sol-0.4.25.zip b/tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/Fixed.sol-0.4.25.zip index 7e500f26f3..b02203b1e8 100644 Binary files a/tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/Fixed.sol-0.4.25.zip and b/tests/e2e/detectors/test_data/unprotected-upgrade/0.4.25/Fixed.sol-0.4.25.zip differ diff --git a/tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/Fixed.sol b/tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/Fixed.sol index c1e0833adf..cea7a99501 100644 --- a/tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/Fixed.sol +++ b/tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/Fixed.sol @@ -40,7 +40,9 @@ contract UpgradeableNoDestruct is Initializable{ contract Fixed2 is Initializable { address payable owner; - constructor() public initializer {} + constructor() public initializer { + uint i = 1; + } function initialize() external initializer { require(owner == address(0)); diff --git a/tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/Fixed.sol-0.5.16.zip b/tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/Fixed.sol-0.5.16.zip index 4af3693936..f9297180d0 100644 Binary files a/tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/Fixed.sol-0.5.16.zip and b/tests/e2e/detectors/test_data/unprotected-upgrade/0.5.16/Fixed.sol-0.5.16.zip differ diff --git a/tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/Fixed.sol b/tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/Fixed.sol index d3936f85a6..32d11a5568 100644 --- a/tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/Fixed.sol +++ b/tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/Fixed.sol @@ -41,7 +41,9 @@ contract UpgradeableNoDestruct is Initializable{ contract Fixed2 is Initializable { address payable owner; - constructor() public initializer {} + constructor() public initializer { + uint i = 1; + } function initialize() external initializer { require(owner == address(0)); diff --git a/tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/Fixed.sol-0.6.11.zip b/tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/Fixed.sol-0.6.11.zip index cfd1482b27..5941750a1e 100644 Binary files a/tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/Fixed.sol-0.6.11.zip and b/tests/e2e/detectors/test_data/unprotected-upgrade/0.6.11/Fixed.sol-0.6.11.zip differ diff --git a/tests/e2e/detectors/test_data/unprotected-upgrade/0.7.6/Fixed.sol b/tests/e2e/detectors/test_data/unprotected-upgrade/0.7.6/Fixed.sol index 53a949ee03..a6709a0c78 100644 --- a/tests/e2e/detectors/test_data/unprotected-upgrade/0.7.6/Fixed.sol +++ b/tests/e2e/detectors/test_data/unprotected-upgrade/0.7.6/Fixed.sol @@ -40,7 +40,9 @@ contract UpgradeableNoDestruct is Initializable{ contract Fixed2 is Initializable { address payable owner; - constructor() initializer {} + constructor() initializer { + uint i = 1; + } function initialize() external initializer { require(owner == address(0)); diff --git a/tests/e2e/detectors/test_data/unprotected-upgrade/0.7.6/Fixed.sol-0.7.6.zip b/tests/e2e/detectors/test_data/unprotected-upgrade/0.7.6/Fixed.sol-0.7.6.zip index f0647b2f33..b269a3db82 100644 Binary files a/tests/e2e/detectors/test_data/unprotected-upgrade/0.7.6/Fixed.sol-0.7.6.zip and b/tests/e2e/detectors/test_data/unprotected-upgrade/0.7.6/Fixed.sol-0.7.6.zip differ diff --git a/tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/Fixed.sol b/tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/Fixed.sol index a4ae7b2069..c06d43e3df 100644 --- a/tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/Fixed.sol +++ b/tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/Fixed.sol @@ -41,7 +41,9 @@ contract UpgradeableNoDestruct is Initializable{ contract Fixed2 is Initializable { address payable owner; - constructor() initializer {} + constructor() initializer { + uint i = 1; + } function initialize() external initializer { require(owner == address(0)); diff --git a/tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/Fixed.sol-0.8.15.zip b/tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/Fixed.sol-0.8.15.zip index ab77415193..4d7612e6c7 100644 Binary files a/tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/Fixed.sol-0.8.15.zip and b/tests/e2e/detectors/test_data/unprotected-upgrade/0.8.15/Fixed.sol-0.8.15.zip differ diff --git a/tests/e2e/detectors/test_data/void-cst/0.4.25/void-cst.sol b/tests/e2e/detectors/test_data/void-cst/0.4.25/void-cst.sol index 43edc9d9a3..fd8407057f 100644 --- a/tests/e2e/detectors/test_data/void-cst/0.4.25/void-cst.sol +++ b/tests/e2e/detectors/test_data/void-cst/0.4.25/void-cst.sol @@ -8,7 +8,7 @@ contract C{ contract D is C{ constructor() public C(){ - + uint i = 1; } } diff --git a/tests/e2e/detectors/test_data/void-cst/0.4.25/void-cst.sol-0.4.25.zip b/tests/e2e/detectors/test_data/void-cst/0.4.25/void-cst.sol-0.4.25.zip index 828a6ee51c..804a7a0f97 100644 Binary files a/tests/e2e/detectors/test_data/void-cst/0.4.25/void-cst.sol-0.4.25.zip and b/tests/e2e/detectors/test_data/void-cst/0.4.25/void-cst.sol-0.4.25.zip differ diff --git a/tests/e2e/detectors/test_data/void-cst/0.5.16/void-cst.sol b/tests/e2e/detectors/test_data/void-cst/0.5.16/void-cst.sol index 43edc9d9a3..fd8407057f 100644 --- a/tests/e2e/detectors/test_data/void-cst/0.5.16/void-cst.sol +++ b/tests/e2e/detectors/test_data/void-cst/0.5.16/void-cst.sol @@ -8,7 +8,7 @@ contract C{ contract D is C{ constructor() public C(){ - + uint i = 1; } } diff --git a/tests/e2e/detectors/test_data/void-cst/0.5.16/void-cst.sol-0.5.16.zip b/tests/e2e/detectors/test_data/void-cst/0.5.16/void-cst.sol-0.5.16.zip index b048aab563..76b9e78925 100644 Binary files a/tests/e2e/detectors/test_data/void-cst/0.5.16/void-cst.sol-0.5.16.zip and b/tests/e2e/detectors/test_data/void-cst/0.5.16/void-cst.sol-0.5.16.zip differ diff --git a/tests/e2e/detectors/test_data/void-cst/0.6.11/void-cst.sol b/tests/e2e/detectors/test_data/void-cst/0.6.11/void-cst.sol index 43edc9d9a3..fd8407057f 100644 --- a/tests/e2e/detectors/test_data/void-cst/0.6.11/void-cst.sol +++ b/tests/e2e/detectors/test_data/void-cst/0.6.11/void-cst.sol @@ -8,7 +8,7 @@ contract C{ contract D is C{ constructor() public C(){ - + uint i = 1; } } diff --git a/tests/e2e/detectors/test_data/void-cst/0.6.11/void-cst.sol-0.6.11.zip b/tests/e2e/detectors/test_data/void-cst/0.6.11/void-cst.sol-0.6.11.zip index 8e325aea90..11102e378c 100644 Binary files a/tests/e2e/detectors/test_data/void-cst/0.6.11/void-cst.sol-0.6.11.zip and b/tests/e2e/detectors/test_data/void-cst/0.6.11/void-cst.sol-0.6.11.zip differ diff --git a/tests/e2e/detectors/test_data/void-cst/0.7.6/void-cst.sol b/tests/e2e/detectors/test_data/void-cst/0.7.6/void-cst.sol index 43edc9d9a3..fd8407057f 100644 --- a/tests/e2e/detectors/test_data/void-cst/0.7.6/void-cst.sol +++ b/tests/e2e/detectors/test_data/void-cst/0.7.6/void-cst.sol @@ -8,7 +8,7 @@ contract C{ contract D is C{ constructor() public C(){ - + uint i = 1; } } diff --git a/tests/e2e/detectors/test_data/void-cst/0.7.6/void-cst.sol-0.7.6.zip b/tests/e2e/detectors/test_data/void-cst/0.7.6/void-cst.sol-0.7.6.zip index dc42512b72..3bd8919666 100644 Binary files a/tests/e2e/detectors/test_data/void-cst/0.7.6/void-cst.sol-0.7.6.zip and b/tests/e2e/detectors/test_data/void-cst/0.7.6/void-cst.sol-0.7.6.zip differ diff --git a/tests/e2e/solc_parsing/test_data/contract-0.4.0.sol b/tests/e2e/solc_parsing/test_data/contract-0.4.0.sol index 85298231b0..eb66c538f2 100644 --- a/tests/e2e/solc_parsing/test_data/contract-0.4.0.sol +++ b/tests/e2e/solc_parsing/test_data/contract-0.4.0.sol @@ -7,7 +7,7 @@ contract A { // inheritance, no constructor contract B is A { function B(uint a) { - + uint i = 1; } } @@ -19,7 +19,7 @@ contract C is B(4) { // inheritance, init in constructor contract D is B { function D() B(2) { - + uint i = 1; } } diff --git a/tests/e2e/solc_parsing/test_data/contract-0.4.22.sol b/tests/e2e/solc_parsing/test_data/contract-0.4.22.sol index ed7b1107e2..d35e85d396 100644 --- a/tests/e2e/solc_parsing/test_data/contract-0.4.22.sol +++ b/tests/e2e/solc_parsing/test_data/contract-0.4.22.sol @@ -7,7 +7,7 @@ contract A { // inheritance, no constructor contract B is A { constructor(uint a) public { - + uint i = 1; } } @@ -19,7 +19,7 @@ contract C is B(4) { // inheritance, init in constructor contract D is B { constructor() B(2) public { - + uint i = 1; } } diff --git a/tests/e2e/solc_parsing/test_data/contract-0.6.0.sol b/tests/e2e/solc_parsing/test_data/contract-0.6.0.sol index 1b815da385..2842b5a9c8 100644 --- a/tests/e2e/solc_parsing/test_data/contract-0.6.0.sol +++ b/tests/e2e/solc_parsing/test_data/contract-0.6.0.sol @@ -7,7 +7,7 @@ contract A { // inheritance, no constructor contract B is A { constructor(uint a) public { - + uint i = 1; } } @@ -19,7 +19,7 @@ contract C is B(4) { // inheritance, init in constructor contract D is B { constructor() B(2) public { - + uint i = 1; } } diff --git a/tests/e2e/solc_parsing/test_data/expected/yul-top-level-0.8.0.sol-0.8.0-compact.json b/tests/e2e/solc_parsing/test_data/expected/yul-top-level-0.8.0.sol-0.8.0-compact.json new file mode 100644 index 0000000000..f9655dff57 --- /dev/null +++ b/tests/e2e/solc_parsing/test_data/expected/yul-top-level-0.8.0.sol-0.8.0-compact.json @@ -0,0 +1,5 @@ +{ + "Test": { + "test()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/e2e/solc_parsing/test_data/function-0.4.0.sol b/tests/e2e/solc_parsing/test_data/function-0.4.0.sol index 4c22ba9777..6298677730 100644 --- a/tests/e2e/solc_parsing/test_data/function-0.4.0.sol +++ b/tests/e2e/solc_parsing/test_data/function-0.4.0.sol @@ -21,7 +21,9 @@ contract C3 { modifier modifierNoArgs() { _; } modifier modifierWithArgs(uint a) { _; } - function f() public modifierNoArgs modifierWithArgs(block.timestamp) {} + function f() public modifierNoArgs modifierWithArgs(block.timestamp) { + uint i = 1; + } } contract C4 { diff --git a/tests/e2e/solc_parsing/test_data/function-0.4.16.sol b/tests/e2e/solc_parsing/test_data/function-0.4.16.sol index 406e5c1abd..aa2df70689 100644 --- a/tests/e2e/solc_parsing/test_data/function-0.4.16.sol +++ b/tests/e2e/solc_parsing/test_data/function-0.4.16.sol @@ -21,7 +21,9 @@ contract C3 { modifier modifierNoArgs() { _; } modifier modifierWithArgs(uint a) { _; } - function f() public modifierNoArgs modifierWithArgs(block.timestamp) {} + function f() public modifierNoArgs modifierWithArgs(block.timestamp) { + uint i = 1; + } } contract C4 { diff --git a/tests/e2e/solc_parsing/test_data/function-0.4.22.sol b/tests/e2e/solc_parsing/test_data/function-0.4.22.sol index e387cbe93f..1ba27c0ca8 100644 --- a/tests/e2e/solc_parsing/test_data/function-0.4.22.sol +++ b/tests/e2e/solc_parsing/test_data/function-0.4.22.sol @@ -39,7 +39,9 @@ contract C3 { modifier modifierNoArgs() { _; } modifier modifierWithArgs(uint a) { _; } - function f() public modifierNoArgs modifierWithArgs(block.timestamp) {} + function f() public modifierNoArgs modifierWithArgs(block.timestamp) { + uint i = 1; + } } contract C4 { diff --git a/tests/e2e/solc_parsing/test_data/function-0.4.23.sol b/tests/e2e/solc_parsing/test_data/function-0.4.23.sol index 08264e01e3..4e9ec54b8e 100644 --- a/tests/e2e/solc_parsing/test_data/function-0.4.23.sol +++ b/tests/e2e/solc_parsing/test_data/function-0.4.23.sol @@ -29,7 +29,9 @@ contract C3 { modifier modifierNoArgs() { _; } modifier modifierWithArgs(uint a) { _; } - function f() public modifierNoArgs modifierWithArgs(block.timestamp) {} + function f() public modifierNoArgs modifierWithArgs(block.timestamp) { + uint i = 1; + } } contract C4 { diff --git a/tests/e2e/solc_parsing/test_data/function-0.5.0.sol b/tests/e2e/solc_parsing/test_data/function-0.5.0.sol index 0d02aceb9d..2e3fb0e5d9 100644 --- a/tests/e2e/solc_parsing/test_data/function-0.5.0.sol +++ b/tests/e2e/solc_parsing/test_data/function-0.5.0.sol @@ -21,7 +21,9 @@ contract C3 { modifier modifierNoArgs() { _; } modifier modifierWithArgs(uint a) { _; } - function f() public modifierNoArgs modifierWithArgs(block.timestamp) {} + function f() public modifierNoArgs modifierWithArgs(block.timestamp) { + uint i = 1; + } } contract C4 { diff --git a/tests/e2e/solc_parsing/test_data/function-0.6.0.sol b/tests/e2e/solc_parsing/test_data/function-0.6.0.sol index a31ffec45c..cf8d9a8e4d 100644 --- a/tests/e2e/solc_parsing/test_data/function-0.6.0.sol +++ b/tests/e2e/solc_parsing/test_data/function-0.6.0.sol @@ -23,7 +23,9 @@ contract C3 { modifier modifierNoArgs() { _; } modifier modifierWithArgs(uint a) { _; } - function f() public modifierNoArgs modifierWithArgs(block.timestamp) {} + function f() public modifierNoArgs modifierWithArgs(block.timestamp) { + uint i = 1; + } } contract C4 { diff --git a/tests/e2e/solc_parsing/test_data/function-0.7.0.sol b/tests/e2e/solc_parsing/test_data/function-0.7.0.sol index 2ac13804e4..bfb1b0ec44 100644 --- a/tests/e2e/solc_parsing/test_data/function-0.7.0.sol +++ b/tests/e2e/solc_parsing/test_data/function-0.7.0.sol @@ -23,7 +23,9 @@ abstract contract C3 { modifier modifierNoArgs() { _; } modifier modifierWithArgs(uint a) { _; } - function f() public modifierNoArgs modifierWithArgs(block.timestamp) {} + function f() public modifierNoArgs modifierWithArgs(block.timestamp) { + uint i = 1; + } } contract C4 { diff --git a/tests/e2e/solc_parsing/test_data/function-0.7.1.sol b/tests/e2e/solc_parsing/test_data/function-0.7.1.sol index 564f17d670..add8dcb0bf 100644 --- a/tests/e2e/solc_parsing/test_data/function-0.7.1.sol +++ b/tests/e2e/solc_parsing/test_data/function-0.7.1.sol @@ -23,7 +23,9 @@ abstract contract C3 { modifier modifierNoArgs() { _; } modifier modifierWithArgs(uint a) { _; } - function f() public modifierNoArgs modifierWithArgs(block.timestamp) {} + function f() public modifierNoArgs modifierWithArgs(block.timestamp) { + uint i = 1; + } } contract C4 { diff --git a/tests/e2e/solc_parsing/test_data/modifier-0.7.0.sol b/tests/e2e/solc_parsing/test_data/modifier-0.7.0.sol index 24240ad5e0..e6f975ffad 100644 --- a/tests/e2e/solc_parsing/test_data/modifier-0.7.0.sol +++ b/tests/e2e/solc_parsing/test_data/modifier-0.7.0.sol @@ -2,7 +2,7 @@ abstract contract A{ modifier m() virtual; function f() public m(){ - + uint i = 1; } } diff --git a/tests/e2e/solc_parsing/test_data/modifier_identifier_path.sol b/tests/e2e/solc_parsing/test_data/modifier_identifier_path.sol index 196de8d61a..0f2843687a 100644 --- a/tests/e2e/solc_parsing/test_data/modifier_identifier_path.sol +++ b/tests/e2e/solc_parsing/test_data/modifier_identifier_path.sol @@ -1,6 +1,8 @@ contract A{ - function f() public m {} + function f() public m { + uint i = 1; + } modifier m()virtual {_;} }