From fa22b6263471a3ec87f649a0dca6cb56283b1f06 Mon Sep 17 00:00:00 2001 From: Alexander Remie Date: Mon, 12 Apr 2021 20:10:26 +0200 Subject: [PATCH 1/3] restructure tests/ --- .../storage_ABIEncoderV2_array.sol | 0 ...V2_array.sol.0.4.25.ABIEncoderV2Array.json | 346 +- .../0.5.10/storage_ABIEncoderV2_array.sol | 99 + ...V2_array.sol.0.5.10.ABIEncoderV2Array.json | 1828 +++++++ .../0.5.11/storage_ABIEncoderV2_array.sol | 99 + ...2_array.sol.0.5.11.ABIEncoderV2Array.json} | 0 .../{ => 0.4.25}/arbitrary_send.sol | 0 ...bitrary_send.sol.0.4.25.ArbitrarySend.json | 388 ++ .../arbitrary_send.sol} | 0 ...bitrary_send.sol.0.5.16.ArbitrarySend.json | 388 ++ .../arbitrary-send/0.6.11/arbitrary_send.sol | 41 + ...bitrary_send.sol.0.4.25.ArbitrarySend.json | 0 ...bitrary_send.sol.0.6.11.ArbitrarySend.json | 388 ++ .../arbitrary-send/0.7.6/arbitrary_send.sol | 41 + ...bitrary_send.sol.0.7.6.ArbitrarySend.json} | 52 +- .../{ => 0.4.25}/array_by_reference.sol | 0 ...reference.sol.0.4.25.ArrayByReference.json | 176 +- .../0.5.16/array_by_reference.sol | 51 + ...reference.sol.0.5.16.ArrayByReference.json | 1333 +++++ .../0.6.11/array_by_reference.sol | 51 + ...reference.sol.0.6.11.ArrayByReference.json | 1333 +++++ .../0.7.6/array_by_reference.sol | 51 + ..._reference.sol.0.7.6.ArrayByReference.json | 1333 +++++ .../{ => 0.4.25}/inline_assembly_contract.sol | 0 ...assembly_contract.sol.0.4.25.Assembly.json | 26 +- .../{ => 0.4.25}/inline_assembly_library.sol | 0 ..._assembly_library.sol.0.4.25.Assembly.json | 52 +- .../inline_assembly_contract.sol} | 0 ...ssembly_contract.sol.0.5.16.Assembly.json} | 33 +- .../inline_assembly_library.sol} | 0 ...assembly_library.sol.0.5.16.Assembly.json} | 66 +- .../0.6.11/inline_assembly_contract.sol | 20 + ...assembly_contract.sol.0.6.11.Assembly.json | 184 + .../0.6.11/inline_assembly_library.sol | 47 + ..._assembly_library.sol.0.6.11.Assembly.json | 470 ++ .../0.7.6/inline_assembly_contract.sol | 20 + ..._assembly_contract.sol.0.7.6.Assembly.json | 184 + .../0.7.6/inline_assembly_library.sol | 47 + ...e_assembly_library.sol.0.7.6.Assembly.json | 470 ++ .../{ => 0.4.25}/assert_state_change.sol | 0 ...e_change.sol.0.4.25.AssertStateChange.json | 568 ++ .../0.5.16/assert_state_change.sol | 39 + ...e_change.sol.0.5.16.AssertStateChange.json | 568 ++ .../0.6.11/assert_state_change.sol | 39 + ...e_change.sol.0.6.11.AssertStateChange.json | 568 ++ .../0.7.6/assert_state_change.sol | 39 + ...e_change.sol.0.7.6.AssertStateChange.json} | 78 +- .../backdoor/{ => 0.4.25}/backdoor.sol | 0 .../backdoor.sol.0.4.25.Backdoor.json | 12 +- tests/detectors/backdoor/0.5.16/backdoor.sol | 8 + .../0.5.16/backdoor.sol.0.5.16.Backdoor.json | 61 + tests/detectors/backdoor/0.6.11/backdoor.sol | 8 + .../0.6.11/backdoor.sol.0.6.11.Backdoor.json | 61 + tests/detectors/backdoor/0.7.6/backdoor.sol | 8 + .../backdoor.sol.0.7.6.Backdoor.json} | 12 +- .../boolean-constant-equality.sol | 0 ...t-equality.sol.0.4.25.BooleanEquality.json | 26 +- .../0.5.16/boolean-constant-equality.sol | 27 + ...t-equality.sol.0.5.16.BooleanEquality.json | 170 + .../0.6.11/boolean-constant-equality.sol | 27 + ...t-equality.sol.0.6.11.BooleanEquality.json | 170 + .../0.7.6/boolean-constant-equality.sol | 27 + ...t-equality.sol.0.7.6.BooleanEquality.json} | 56 +- .../{ => 0.4.25}/boolean-constant-misuse.sol | 0 ...suse.sol.0.4.25.BooleanConstantMisuse.json | 208 + .../0.5.16/boolean-constant-misuse.sol | 46 + ...suse.sol.0.5.16.BooleanConstantMisuse.json | 208 + .../0.6.11/boolean-constant-misuse.sol | 46 + ...suse.sol.0.6.11.BooleanConstantMisuse.json | 208 + .../0.7.6/boolean-constant-misuse.sol | 46 + ...suse.sol.0.7.6.BooleanConstantMisuse.json} | 26 +- .../{ => 0.4.25}/multiple_calls_in_loop.sol | 0 ...n_loop.sol.0.4.25.MultipleCallsInLoop.json | 26 +- .../0.5.16/multiple_calls_in_loop.sol | 15 + ...n_loop.sol.0.5.16.MultipleCallsInLoop.json | 148 + .../0.6.11/multiple_calls_in_loop.sol | 15 + ...n_loop.sol.0.6.11.MultipleCallsInLoop.json | 148 + .../0.7.6/multiple_calls_in_loop.sol | 15 + ...in_loop.sol.0.7.6.MultipleCallsInLoop.json | 148 + .../{ => 0.4.25}/const_state_variables.sol | 0 ...es.sol.0.4.25.ConstCandidateStateVars.json | 72 +- .../0.5.16/const_state_variables.sol | 52 + ...es.sol.0.5.16.ConstCandidateStateVars.json | 382 ++ .../0.6.11/const_state_variables.sol | 52 + ...es.sol.0.6.11.ConstCandidateStateVars.json | 382 ++ .../0.7.6/const_state_variables.sol | 52 + ...es.sol.0.7.6.ConstCandidateStateVars.json} | 72 +- .../constant/{ => 0.4.25}/constant.sol | 0 ...stant.sol.0.4.25.ConstantFunctionsAsm.json | 12 +- ...ant.sol.0.4.25.ConstantFunctionsState.json | 40 +- .../constant.sol} | 2 +- ...tant.sol.0.5.16.ConstantFunctionsAsm.json} | 0 ...nt.sol.0.5.16.ConstantFunctionsState.json} | 0 tests/detectors/constant/0.6.11/constant.sol | 20 + ...tant.sol.0.6.11.ConstantFunctionsAsm.json} | 0 ...nt.sol.0.6.11.ConstantFunctionsState.json} | 0 tests/detectors/constant/0.7.6/constant.sol | 20 + ...stant.sol.0.7.6.ConstantFunctionsAsm.json} | 0 ...ant.sol.0.7.6.ConstantFunctionsState.json} | 0 .../{ => 0.4.25}/array_length_assignment.sol | 0 ...ment.sol.0.4.25.ArrayLengthAssignment.json | 98 +- .../0.5.16/array_length_assignment.sol | 46 + ...ment.sol.0.5.16.ArrayLengthAssignment.json | 604 +++ .../{ => 0.4.25}/controlled_delegatecall.sol | 0 ...all.sol.0.4.25.ControlledDelegateCall.json | 52 +- .../0.5.16/controlled_delegatecall.sol | 25 + ...all.sol.0.5.16.ControlledDelegateCall.json | 326 ++ .../0.6.11/controlled_delegatecall.sol | 25 + ...all.sol.0.6.11.ControlledDelegateCall.json | 326 ++ .../0.7.6/controlled_delegatecall.sol | 25 + ...all.sol.0.7.6.ControlledDelegateCall.json} | 52 +- .../multiple_costly_operations_in_loop.sol | 0 ...oop.sol.0.4.25.CostlyOperationsInLoop.json | 26 +- .../multiple_costly_operations_in_loop.sol | 35 + ...oop.sol.0.5.16.CostlyOperationsInLoop.json | 184 + .../multiple_costly_operations_in_loop.sol | 35 + ...oop.sol.0.6.11.CostlyOperationsInLoop.json | 184 + .../multiple_costly_operations_in_loop.sol | 35 + ...loop.sol.0.7.6.CostlyOperationsInLoop.json | 184 + .../{ => 0.4.25}/erc20_indexed.sol | 0 ....0.4.25.UnindexedERC20EventParameters.json | 48 +- .../erc20-indexed/0.5.16/erc20_indexed.sol | 25 + ....0.5.16.UnindexedERC20EventParameters.json | 248 + .../erc20-indexed/0.6.11/erc20_indexed.sol | 25 + ....0.6.11.UnindexedERC20EventParameters.json | 248 + .../erc20-indexed/0.7.6/erc20_indexed.sol | 25 + ...l.0.7.6.UnindexedERC20EventParameters.json | 248 + .../incorrect_erc20_interface.sol | 0 ...4.25.IncorrectERC20InterfaceDetection.json | 96 +- .../0.5.16/incorrect_erc20_interface.sol | 10 + ...5.16.IncorrectERC20InterfaceDetection.json | 490 ++ .../0.6.11/incorrect_erc20_interface.sol | 10 + ...6.11.IncorrectERC20InterfaceDetection.json | 490 ++ .../0.7.6/incorrect_erc20_interface.sol | 10 + ....7.6.IncorrectERC20InterfaceDetection.json | 490 ++ .../incorrect_erc721_interface.sol | 0 ....25.IncorrectERC721InterfaceDetection.json | 160 +- .../0.5.16/incorrect_erc721_interface.sol | 16 + ....16.IncorrectERC721InterfaceDetection.json | 866 +++ .../0.6.11/incorrect_erc721_interface.sol | 16 + ....11.IncorrectERC721InterfaceDetection.json | 866 +++ .../0.7.6/incorrect_erc721_interface.sol | 16 + ...7.6.IncorrectERC721InterfaceDetection.json | 866 +++ .../missing_events_access_control.sol | 0 ...sol.0.4.25.MissingEventsAccessControl.json | 648 +++ .../0.5.16/missing_events_access_control.sol | 52 + ...sol.0.5.16.MissingEventsAccessControl.json | 648 +++ .../0.6.11/missing_events_access_control.sol | 52 + ...sol.0.6.11.MissingEventsAccessControl.json | 648 +++ .../0.7.6/missing_events_access_control.sol | 52 + ....sol.0.7.6.MissingEventsAccessControl.json | 648 +++ .../missing_events_arithmetic.sol | 0 ...ic.sol.0.4.25.MissingEventsArithmetic.json | 512 ++ .../0.5.16/missing_events_arithmetic.sol | 72 + ...ic.sol.0.5.16.MissingEventsArithmetic.json | 512 ++ .../0.6.11/missing_events_arithmetic.sol | 72 + ...ic.sol.0.6.11.MissingEventsArithmetic.json | 512 ++ .../0.7.6/missing_events_arithmetic.sol | 72 + ...ic.sol.0.7.6.MissingEventsArithmetic.json} | 52 +- .../{ => 0.4.25}/external_function.sol | 0 ..._function.sol.0.4.25.ExternalFunction.json | 60 +- .../{ => 0.4.25}/external_function_2.sol | 0 ...nction_2.sol.0.4.25.ExternalFunction.json} | 0 .../{ => 0.4.25}/external_function_import.sol | 0 .../0.5.16/external_function.sol | 82 + ..._function.sol.0.5.16.ExternalFunction.json | 337 ++ .../0.5.16/external_function_2.sol | 55 + ...unction_2.sol.0.5.16.ExternalFunction.json | 3 + .../0.5.16/external_function_import.sol | 7 + .../0.6.11/external_function.sol | 82 + ..._function.sol.0.6.11.ExternalFunction.json | 337 ++ .../0.6.11/external_function_2.sol | 55 + ...unction_2.sol.0.6.11.ExternalFunction.json | 3 + .../0.6.11/external_function_import.sol | 7 + .../0.7.6/external_function.sol | 82 + ..._function.sol.0.7.6.ExternalFunction.json} | 60 +- .../0.7.6/external_function_2.sol | 55 + ...function_2.sol.0.7.6.ExternalFunction.json | 3 + .../0.7.6/external_function_import.sol | 7 + .../function_init_state_variables.sol | 0 ...s.sol.0.4.25.FunctionInitializedState.json | 60 +- .../0.5.16/function_init_state_variables.sol | 46 + ...s.sol.0.5.16.FunctionInitializedState.json | 464 ++ .../0.6.11/function_init_state_variables.sol | 46 + ...s.sol.0.6.11.FunctionInitializedState.json | 464 ++ .../0.7.6/function_init_state_variables.sol | 46 + ...es.sol.0.7.6.FunctionInitializedState.json | 464 ++ .../{ => 0.4.25}/incorrect_equality.sol | 0 ...y.sol.0.4.25.IncorrectStrictEquality.json} | 312 +- .../0.5.16/incorrect_equality.sol | 136 + ...ty.sol.0.5.16.IncorrectStrictEquality.json | 2600 ++++++++++ .../0.6.11/incorrect_equality.sol | 136 + ...ty.sol.0.6.11.IncorrectStrictEquality.json | 2600 ++++++++++ .../0.7.6/incorrect_equality.sol | 136 + ...ity.sol.0.7.6.IncorrectStrictEquality.json | 2600 ++++++++++ .../{ => 0.4.25}/modifier_default.sol | 0 ...t.sol.0.4.25.ModifierDefaultDetection.json | 36 +- .../0.5.16/modifier_default.sol | 52 + ...t.sol.0.5.16.ModifierDefaultDetection.json | 323 ++ .../0.6.11/modifier_default.sol | 52 + ...t.sol.0.6.11.ModifierDefaultDetection.json | 323 ++ .../0.7.6/modifier_default.sol | 52 + ...lt.sol.0.7.6.ModifierDefaultDetection.json | 323 ++ .../{ => 0.4.25}/invalid_unary_expression.sol | 0 ....25.IncorrectUnaryExpressionDetection.json | 90 +- .../{ => 0.4.25}/locked_ether.sol | 0 .../locked_ether.sol.0.4.25.LockedEther.json | 16 +- .../locked_ether.sol} | 0 .../locked_ether.sol.0.5.16.LockedEther.json} | 16 +- .../locked-ether/0.6.11/locked_ether.sol | 26 + .../locked_ether.sol.0.6.11.LockedEther.json | 79 + .../locked-ether/0.7.6/locked_ether.sol | 26 + .../locked_ether.sol.0.7.6.LockedEther.json | 79 + .../{ => 0.4.25}/low_level_calls.sol | 0 ..._level_calls.sol.0.4.25.LowLevelCalls.json | 26 +- .../0.5.16/low_level_calls.sol | 17 + ...level_calls.sol.0.5.16.LowLevelCalls.json} | 26 +- .../0.6.11/low_level_calls.sol | 17 + ..._level_calls.sol.0.6.11.LowLevelCalls.json | 124 + .../low-level-calls/0.7.6/low_level_calls.sol | 17 + ...w_level_calls.sol.0.7.6.LowLevelCalls.json | 124 + .../{ => 0.4.25}/MappingDeletion.sol | 2 +- ...n.sol.0.4.25.MappingDeletionDetection.json | 96 +- .../0.5.16/MappingDeletion.sol | 44 + ...n.sol.0.5.16.MappingDeletionDetection.json | 428 ++ .../0.6.11/MappingDeletion.sol | 44 + ...n.sol.0.6.11.MappingDeletionDetection.json | 428 ++ .../0.7.6/MappingDeletion.sol | 44 + ...on.sol.0.7.6.MappingDeletionDetection.json | 428 ++ .../{ => 0.5.16}/unimplemented_interfaces.sol | 0 ...0.5.16.UnimplementedFunctionDetection.json | 3 + .../0.6.11/unimplemented_interfaces.sol | 72 + ...0.6.11.UnimplementedFunctionDetection.json | 3 + .../0.7.6/unimplemented_interfaces.sol | 72 + ....0.7.6.UnimplementedFunctionDetection.json | 3 + .../missing_zero_address_validation.sol | 71 + ...l.0.4.25.MissingZeroAddressValidation.json | 1500 ++++++ .../missing_zero_address_validation.sol | 0 ...l.0.5.16.MissingZeroAddressValidation.json | 1500 ++++++ .../missing_zero_address_validation.sol | 71 + ...l.0.6.11.MissingZeroAddressValidation.json | 1500 ++++++ .../0.7.6/missing_zero_address_validation.sol | 71 + ...l.0.7.6.MissingZeroAddressValidation.json} | 164 +- .../multiple-constructors.sol.compact.json | 785 --- .../{ => 0.4.25}/naming_convention.sol | 0 ...onvention.sol.0.4.25.NamingConvention.json | 148 +- .../{ => 0.4.25}/naming_convention_ignore.sol | 0 ...on_ignore.sol.0.4.25.NamingConvention.json | 12 +- .../0.5.16/naming_convention.sol | 75 + ...onvention.sol.0.5.16.NamingConvention.json | 1111 ++++ .../0.5.16/naming_convention_ignore.sol | 22 + ...on_ignore.sol.0.5.16.NamingConvention.json | 76 + .../0.6.11/naming_convention.sol | 75 + ...onvention.sol.0.6.11.NamingConvention.json | 1111 ++++ .../0.6.11/naming_convention_ignore.sol | 22 + ...on_ignore.sol.0.6.11.NamingConvention.json | 76 + .../0.7.6/naming_convention.sol | 75 + ...onvention.sol.0.7.6.NamingConvention.json} | 148 +- .../0.7.6/naming_convention_ignore.sol | 22 + ...ion_ignore.sol.0.7.6.NamingConvention.json | 76 + .../detectors/pragma/0.4.25/pragma.0.4.24.sol | 1 + .../detectors/pragma/0.4.25/pragma.0.4.25.sol | 5 + ...gma.0.4.25.sol.0.4.25.ConstantPragma.json} | 22 +- .../detectors/pragma/0.5.16/pragma.0.5.15.sol | 1 + .../detectors/pragma/0.5.16/pragma.0.5.16.sol | 5 + ...agma.0.5.16.sol.0.5.16.ConstantPragma.json | 66 + .../detectors/pragma/0.6.11/pragma.0.6.10.sol | 1 + .../detectors/pragma/0.6.11/pragma.0.6.11.sol | 5 + ...agma.0.6.11.sol.0.6.11.ConstantPragma.json | 66 + tests/detectors/pragma/0.7.6/pragma.0.7.5.sol | 1 + tests/detectors/pragma/0.7.6/pragma.0.7.6.sol | 5 + ...pragma.0.7.6.sol.0.7.6.ConstantPragma.json | 66 + tests/detectors/pragma/pragma.0.4.23.sol | 1 - tests/detectors/pragma/pragma.0.4.24.sol | 5 - .../{ => 0.4.25}/public_mappings_nested.sol | 0 ...nested.sol.0.4.25.PublicMappingNested.json | 12 +- .../{ => 0.4.25}/redundant_statements.sol | 0 ...ements.sol.0.4.25.RedundantStatements.json | 132 +- .../0.5.16/redundant_statements.sol | 17 + ...ements.sol.0.5.16.RedundantStatements.json | 733 +++ .../0.6.11/redundant_statements.sol | 17 + ...ements.sol.0.6.11.RedundantStatements.json | 733 +++ .../0.7.6/redundant_statements.sol | 17 + ...tements.sol.0.7.6.RedundantStatements.json | 733 +++ .../{ => 0.4.25}/reentrancy-write.sol | 2 +- ...l.0.4.25.ReentrancyReadBeforeWritten.json} | 162 +- .../0.5.16/reentrancy-write.sol | 31 + ...ol.0.5.16.ReentrancyReadBeforeWritten.json | 846 +++ .../0.6.11/reentrancy-write.sol | 31 + ...ol.0.6.11.ReentrancyReadBeforeWritten.json | 846 +++ .../0.7.6/reentrancy-write.sol | 31 + ...sol.0.7.6.ReentrancyReadBeforeWritten.json | 846 +++ .../{ => 0.4.25}/reentrancy-benign.sol | 0 ...y-benign.sol.0.4.25.ReentrancyBenign.json} | 456 +- .../0.5.16/reentrancy-benign.sol | 62 + ...cy-benign.sol.0.5.16.ReentrancyBenign.json | 4621 +++++++++++++++++ .../0.6.11/reentrancy-benign.sol | 62 + ...cy-benign.sol.0.6.11.ReentrancyBenign.json | 4621 +++++++++++++++++ .../0.7.6/reentrancy-benign.sol | 62 + ...ncy-benign.sol.0.7.6.ReentrancyBenign.json | 4621 +++++++++++++++++ .../{ => 0.4.25}/reentrancy.sol | 0 .../reentrancy.sol.0.4.25.ReentrancyEth.json | 76 +- .../{ => 0.4.25}/reentrancy_indirect.sol | 0 ...ncy_indirect.sol.0.4.25.ReentrancyEth.json | 62 +- .../reentrancy.sol} | 2 +- .../reentrancy.sol.0.5.16.ReentrancyEth.json} | 108 +- .../0.5.16/reentrancy_indirect.sol | 31 + ...ncy_indirect.sol.0.5.16.ReentrancyEth.json | 453 ++ .../reentrancy-eth/0.6.11/reentrancy.sol | 54 + .../reentrancy.sol.0.6.11.ReentrancyEth.json | 709 +++ .../0.6.11/reentrancy_indirect.sol | 31 + ...ncy_indirect.sol.0.6.11.ReentrancyEth.json | 453 ++ .../reentrancy-eth/0.7.6/reentrancy.sol | 54 + .../reentrancy.sol.0.7.6.ReentrancyEth.json | 709 +++ .../0.7.6/reentrancy_indirect.sol | 31 + ...ancy_indirect.sol.0.7.6.ReentrancyEth.json | 453 ++ .../reentrancy-events.sol} | 0 ...ncy-events.sol.0.5.16.ReentrancyEvent.json | 225 + .../0.6.11/reentrancy-events.sol | 24 + ...ncy-events.sol.0.6.11.ReentrancyEvent.json | 225 + .../0.7.6/reentrancy-events.sol | 24 + ...ncy-events.sol.0.7.6.ReentrancyEvent.json} | 38 +- .../0.4.21/reused_base_constructor.sol | 37 + ...ctor.sol.0.4.21.ReusedBaseConstructor.json | 736 +++ .../{ => 0.4.25}/reused_base_constructor.sol | 0 ...ctor.sol.0.4.25.ReusedBaseConstructor.json | 204 +- .../{ => 0.4.25}/right_to_left_override.sol | 0 ...erride.sol.0.4.25.RightToLeftOverride.json | 10 +- .../rtlo/0.5.16/right_to_left_override.sol | 15 + ...erride.sol.0.5.16.RightToLeftOverride.json | 32 + .../rtlo/0.6.11/right_to_left_override.sol | 15 + ...erride.sol.0.6.11.RightToLeftOverride.json | 32 + .../{ => 0.4.25}/shadowing_abstract.sol | 0 ...sol.0.4.25.ShadowingAbstractDetection.json | 20 +- .../0.5.16/shadowing_abstract.sol | 9 + ...sol.0.5.16.ShadowingAbstractDetection.json | 96 + .../shadowing_builtin_symbols.sol | 0 ...ols.sol.0.4.25.BuiltinSymbolShadowing.json | 168 +- .../0.5.16/shadowing_builtin_symbols.sol | 35 + ...ols.sol.0.5.16.BuiltinSymbolShadowing.json | 764 +++ .../{ => 0.4.25}/shadowing_local_variable.sol | 0 ...al_variable.sol.0.4.25.LocalShadowing.json | 136 +- .../0.5.16/shadowing_local_variable.sol | 26 + ...al_variable.sol.0.5.16.LocalShadowing.json | 715 +++ .../0.6.11/shadowing_local_variable.sol | 26 + ...al_variable.sol.0.6.11.LocalShadowing.json | 630 +++ .../0.7.6/shadowing_local_variable.sol | 26 + ...cal_variable.sol.0.7.6.LocalShadowing.json | 630 +++ .../{ => 0.4.25}/shadowing_state_variable.sol | 0 ...te_variable.sol.0.4.25.StateShadowing.json | 20 +- .../0.5.16/shadowing_state_variable.sol | 21 + ...te_variable.sol.0.5.16.StateShadowing.json | 108 + .../0.6.11/shadowing_state_variable.sol | 21 + ...te_variable.sol.0.6.11.StateShadowing.json | 3 + .../0.7.6/shadowing_state_variable.sol | 21 + ...ate_variable.sol.0.7.6.StateShadowing.json | 3 + .../detectors/solc-version/0.4.25/static.sol | 5 + .../static.sol.0.4.25.IncorrectSolc.json} | 20 +- .../detectors/solc-version/0.5.14/static.sol | 5 + .../static.sol.0.5.14.IncorrectSolc.json | 48 + .../solc-version/0.5.16/dynamic_1.sol | 5 + .../dynamic_1.sol.0.5.16.IncorrectSolc.json | 40 + .../solc-version/0.5.16/dynamic_2.sol | 5 + .../dynamic_2.sol.0.5.16.IncorrectSolc.json | 43 + .../detectors/solc-version/0.5.16/static.sol | 5 + .../static.sol.0.5.16.IncorrectSolc.json | 3 + .../detectors/solc-version/0.6.10/static.sol | 5 + .../static.sol.0.6.10.IncorrectSolc.json | 48 + .../solc-version/0.6.11/dynamic_1.sol | 5 + .../dynamic_1.sol.0.6.11.IncorrectSolc.json | 40 + .../solc-version/0.6.11/dynamic_2.sol | 5 + .../dynamic_2.sol.0.6.11.IncorrectSolc.json | 43 + .../detectors/solc-version/0.6.11/static.sol | 5 + .../static.sol.0.6.11.IncorrectSolc.json | 3 + tests/detectors/solc-version/0.7.4/static.sol | 5 + .../0.7.4/static.sol.0.7.4.IncorrectSolc.json | 48 + .../solc-version/0.7.6/dynamic_1.sol | 5 + .../dynamic_1.sol.0.7.6.IncorrectSolc.json | 40 + .../solc-version/0.7.6/dynamic_2.sol | 5 + .../dynamic_2.sol.0.7.6.IncorrectSolc.json | 43 + tests/detectors/solc-version/0.7.6/static.sol | 5 + .../0.7.6/static.sol.0.7.6.IncorrectSolc.json | 3 + tests/detectors/solc-version/old_solc.sol | 5 - .../solc-version/solc_version_incorrect.sol | 6 - ...on_incorrect.sol.0.4.25.IncorrectSolc.json | 88 - .../solc_version_incorrect_05.sol | 7 - ..._incorrect_05.sol.0.5.7.IncorrectSolc.json | 84 - .../storage_signed_integer_array.sol | 0 ...sol.0.5.10.StorageSignedIntegerArray.json} | 136 +- .../0.5.16/storage_signed_integer_array.sol | 45 + ....sol.0.5.16.StorageSignedIntegerArray.json | 3 + tests/detectors/suicidal/0.4.25/suicidal.sol | 8 + .../0.4.25/suicidal.sol.0.4.25.Suicidal.json} | 12 +- tests/detectors/suicidal/0.5.16/suicidal.sol | 8 + .../0.5.16/suicidal.sol.0.5.16.Suicidal.json | 61 + tests/detectors/suicidal/0.6.11/suicidal.sol | 8 + .../0.6.11/suicidal.sol.0.6.11.Suicidal.json | 61 + tests/detectors/suicidal/0.7.6/suicidal.sol | 8 + .../0.7.6/suicidal.sol.0.7.6.Suicidal.json} | 12 +- .../timestamp/{ => 0.4.25}/timestamp.sol | 0 .../timestamp.sol.0.4.25.Timestamp.json | 78 +- .../detectors/timestamp/0.5.16/timestamp.sol | 21 + .../timestamp.sol.0.5.16.Timestamp.json | 456 ++ .../detectors/timestamp/0.6.11/timestamp.sol | 21 + .../timestamp.sol.0.6.11.Timestamp.json | 456 ++ tests/detectors/timestamp/0.7.6/timestamp.sol | 21 + .../timestamp.sol.0.7.6.Timestamp.json} | 78 +- .../{ => 0.4.25}/too_many_digits.sol | 2 +- ...many_digits.sol.0.4.25.TooManyDigits.json} | 180 +- .../0.5.16/too_many_digits.sol | 40 + ..._many_digits.sol.0.5.16.TooManyDigits.json | 970 ++++ .../0.6.11/too_many_digits.sol | 40 + ..._many_digits.sol.0.6.11.TooManyDigits.json | 970 ++++ .../too-many-digits/0.7.6/too_many_digits.sol | 39 + ...o_many_digits.sol.0.7.6.TooManyDigits.json | 960 ++++ .../tx-origin/{ => 0.4.25}/tx_origin.sol | 0 .../tx_origin.sol.0.4.25.TxOrigin.json | 52 +- .../tx_origin.sol} | 0 .../tx_origin.sol.0.5.16.TxOrigin.json} | 52 +- .../detectors/tx-origin/0.6.11/tx_origin.sol | 26 + .../0.6.11/tx_origin.sol.0.6.11.TxOrigin.json | 324 ++ tests/detectors/tx-origin/0.7.6/tx_origin.sol | 26 + .../0.7.6/tx_origin.sol.0.7.6.TxOrigin.json | 324 ++ .../{ => 0.4.25}/unchecked_lowlevel.sol | 0 ...lowlevel.sol.0.4.25.UncheckedLowLevel.json | 26 +- .../unchecked_lowlevel.sol} | 0 ...owlevel.sol.0.5.16.UncheckedLowLevel.json} | 26 +- .../0.6.11/unchecked_lowlevel.sol | 11 + ...lowlevel.sol.0.6.11.UncheckedLowLevel.json | 136 + .../0.7.6/unchecked_lowlevel.sol | 11 + ..._lowlevel.sol.0.7.6.UncheckedLowLevel.json | 136 + .../unchecked-send/0.4.25/unchecked_send.sol | 18 + ...checked_send.sol.0.4.25.UncheckedSend.json | 150 + .../unchecked_send.sol} | 0 ...checked_send.sol.0.5.16.UncheckedSend.json | 150 + .../unchecked-send/0.6.11/unchecked_send.sol | 18 + ...checked_send.sol.0.6.11.UncheckedSend.json | 150 + .../unchecked-send/0.7.6/unchecked_send.sol | 18 + ...checked_send.sol.0.7.6.UncheckedSend.json} | 26 +- .../{ => 0.4.25}/unimplemented.sol | 0 ...0.4.25.UnimplementedFunctionDetection.json | 72 +- .../0.5.16/unimplemented.sol | 41 + ...0.5.16.UnimplementedFunctionDetection.json | 196 + .../0.6.11/unimplemented.sol | 41 + ...0.6.11.UnimplementedFunctionDetection.json | 271 + .../0.7.6/unimplemented.sol | 41 + ....0.7.6.UnimplementedFunctionDetection.json | 271 + ...uninitialized_function_ptr_constructor.sol | 2 +- ....UninitializedFunctionPtrsConstructor.json | 433 ++ ...uninitialized_function_ptr_constructor.sol | 136 + ....UninitializedFunctionPtrsConstructor.json | 3 + ...uninitialized_function_ptr_constructor.sol | 136 + ....UninitializedFunctionPtrsConstructor.json | 90 +- .../uninitialized_local_variable.sol | 0 ...ble.sol.0.4.25.UninitializedLocalVars.json | 16 +- .../0.5.16/uninitialized_local_variable.sol | 9 + ...ble.sol.0.5.16.UninitializedLocalVars.json | 85 + .../0.6.11/uninitialized_local_variable.sol | 9 + ...ble.sol.0.6.11.UninitializedLocalVars.json | 85 + .../0.7.6/uninitialized_local_variable.sol | 9 + ...able.sol.0.7.6.UninitializedLocalVars.json | 85 + .../{ => 0.4.25}/uninitialized.sol | 2 +- ....4.25.UninitializedStateVarsDetection.json | 112 +- .../uninitialized.sol} | 2 +- ....5.16.UninitializedStateVarsDetection.json | 468 ++ .../0.6.11/uninitialized.sol | 58 + ....6.11.UninitializedStateVarsDetection.json | 468 ++ .../0.7.6/uninitialized.sol | 58 + ....7.6.UninitializedStateVarsDetection.json} | 112 +- .../uninitialized_storage_pointer.sol | 0 ...r.sol.0.4.25.UninitializedStorageVars.json | 16 +- .../unprotected-upgrade/0.4.25/Buggy.sol | 14 + ...ggy.sol.0.4.25.UnprotectedUpgradeable.json | 152 + .../unprotected-upgrade/0.4.25/Fixed.sol | 39 + ...xed.sol.0.4.25.UnprotectedUpgradeable.json | 3 + .../{ => 0.4.25}/Initializable.sol | 0 .../{ => 0.5.16}/Buggy.sol | 0 ...ggy.sol.0.5.16.UnprotectedUpgradeable.json | 152 + .../{ => 0.5.16}/Fixed.sol | 0 ...xed.sol.0.5.16.UnprotectedUpgradeable.json | 3 + .../0.5.16/Initializable.sol | 5 + .../unprotected-upgrade/0.6.11/Buggy.sol | 14 + ...ggy.sol.0.6.11.UnprotectedUpgradeable.json | 152 + .../unprotected-upgrade/0.6.11/Fixed.sol | 39 + ...xed.sol.0.6.11.UnprotectedUpgradeable.json | 3 + .../0.6.11/Initializable.sol | 5 + .../unprotected-upgrade/0.7.6/Buggy.sol | 14 + ...ggy.sol.0.7.6.UnprotectedUpgradeable.json} | 24 +- .../unprotected-upgrade/0.7.6/Fixed.sol | 39 + ...ixed.sol.0.7.6.UnprotectedUpgradeable.json | 3 + .../0.7.6/Initializable.sol | 5 + .../{ => 0.4.25}/unused_return.sol | 0 ..._return.sol.0.4.25.UnusedReturnValues.json | 52 +- .../unused-return/0.5.16/unused_return.sol | 30 + ...return.sol.0.5.16.UnusedReturnValues.json} | 52 +- .../unused-return/0.6.11/unused_return.sol | 30 + ..._return.sol.0.6.11.UnusedReturnValues.json | 336 ++ .../unused-return/0.7.6/unused_return.sol | 30 + ...d_return.sol.0.7.6.UnusedReturnValues.json | 336 ++ .../{ => 0.4.25}/unused_state.sol | 0 ...used_state.sol.0.4.25.UnusedStateVars.json | 64 +- .../unused-state/0.5.16/unused_state.sol | 16 + ...used_state.sol.0.5.16.UnusedStateVars.json | 312 ++ .../unused-state/0.6.11/unused_state.sol | 16 + ...used_state.sol.0.6.11.UnusedStateVars.json | 312 ++ .../unused-state/0.7.6/unused_state.sol | 16 + ...used_state.sol.0.7.6.UnusedStateVars.json} | 64 +- .../predeclaration_usage_local.sol | 0 ...l.sol.0.4.25.PredeclarationUsageLocal.json | 190 +- .../void-cst/{ => 0.4.25}/void-cst.sol | 0 .../void-cst.sol.0.4.25.VoidConstructor.json | 128 + tests/detectors/void-cst/0.5.16/void-cst.sol | 14 + .../void-cst.sol.0.5.16.VoidConstructor.json | 128 + tests/detectors/void-cst/0.6.11/void-cst.sol | 14 + .../void-cst.sol.0.6.11.VoidConstructor.json | 128 + tests/detectors/void-cst/0.7.6/void-cst.sol | 14 + .../void-cst.sol.0.7.6.VoidConstructor.json} | 26 +- .../weak-prng/{ => 0.4.25}/bad_prng.sol | 0 .../bad_prng.sol.0.4.25.BadPRNG.json | 104 +- tests/detectors/weak-prng/0.5.16/bad_prng.sol | 28 + .../0.5.16/bad_prng.sol.0.5.16.BadPRNG.json | 660 +++ tests/detectors/weak-prng/0.6.11/bad_prng.sol | 28 + .../0.6.11/bad_prng.sol.0.6.11.BadPRNG.json | 660 +++ tests/detectors/weak-prng/0.7.6/bad_prng.sol | 28 + .../0.7.6/bad_prng.sol.0.7.6.BadPRNG.json | 660 +++ tests/test_detectors.py | 980 +++- 526 files changed, 90774 insertions(+), 4291 deletions(-) rename tests/detectors/abiencoderv2-array/{ => 0.4.25}/storage_ABIEncoderV2_array.sol (100%) rename tests/detectors/abiencoderv2-array/{ => 0.4.25}/storage_ABIEncoderV2_array.sol.0.4.25.ABIEncoderV2Array.json (92%) create mode 100644 tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol create mode 100644 tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol.0.5.10.ABIEncoderV2Array.json create mode 100644 tests/detectors/abiencoderv2-array/0.5.11/storage_ABIEncoderV2_array.sol rename tests/detectors/{constant/constant-0.5.1.sol.0.5.1.ConstantFunctionsAsm.json => abiencoderv2-array/0.5.11/storage_ABIEncoderV2_array.sol.0.5.11.ABIEncoderV2Array.json} (100%) rename tests/detectors/arbitrary-send/{ => 0.4.25}/arbitrary_send.sol (100%) create mode 100644 tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol.0.4.25.ArbitrarySend.json rename tests/detectors/arbitrary-send/{arbitrary_send-0.5.1.sol => 0.5.16/arbitrary_send.sol} (100%) create mode 100644 tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol.0.5.16.ArbitrarySend.json create mode 100644 tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol rename tests/detectors/arbitrary-send/{ => 0.6.11}/arbitrary_send.sol.0.4.25.ArbitrarySend.json (100%) create mode 100644 tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol.0.6.11.ArbitrarySend.json create mode 100644 tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol rename tests/detectors/arbitrary-send/{arbitrary_send-0.5.1.sol.0.5.1.ArbitrarySend.json => 0.7.6/arbitrary_send.sol.0.7.6.ArbitrarySend.json} (91%) rename tests/detectors/array-by-reference/{ => 0.4.25}/array_by_reference.sol (100%) rename tests/detectors/array-by-reference/{ => 0.4.25}/array_by_reference.sol.0.4.25.ArrayByReference.json (88%) create mode 100644 tests/detectors/array-by-reference/0.5.16/array_by_reference.sol create mode 100644 tests/detectors/array-by-reference/0.5.16/array_by_reference.sol.0.5.16.ArrayByReference.json create mode 100644 tests/detectors/array-by-reference/0.6.11/array_by_reference.sol create mode 100644 tests/detectors/array-by-reference/0.6.11/array_by_reference.sol.0.6.11.ArrayByReference.json create mode 100644 tests/detectors/array-by-reference/0.7.6/array_by_reference.sol create mode 100644 tests/detectors/array-by-reference/0.7.6/array_by_reference.sol.0.7.6.ArrayByReference.json rename tests/detectors/assembly/{ => 0.4.25}/inline_assembly_contract.sol (100%) rename tests/detectors/assembly/{ => 0.4.25}/inline_assembly_contract.sol.0.4.25.Assembly.json (89%) rename tests/detectors/assembly/{ => 0.4.25}/inline_assembly_library.sol (100%) rename tests/detectors/assembly/{ => 0.4.25}/inline_assembly_library.sol.0.4.25.Assembly.json (91%) rename tests/detectors/assembly/{inline_assembly_contract-0.5.1.sol => 0.5.16/inline_assembly_contract.sol} (100%) rename tests/detectors/assembly/{inline_assembly_contract-0.5.1.sol.0.5.1.Assembly.json => 0.5.16/inline_assembly_contract.sol.0.5.16.Assembly.json} (87%) rename tests/detectors/assembly/{inline_assembly_library-0.5.1.sol => 0.5.16/inline_assembly_library.sol} (100%) rename tests/detectors/assembly/{inline_assembly_library-0.5.1.sol.0.5.1.Assembly.json => 0.5.16/inline_assembly_library.sol.0.5.16.Assembly.json} (90%) create mode 100644 tests/detectors/assembly/0.6.11/inline_assembly_contract.sol create mode 100644 tests/detectors/assembly/0.6.11/inline_assembly_contract.sol.0.6.11.Assembly.json create mode 100644 tests/detectors/assembly/0.6.11/inline_assembly_library.sol create mode 100644 tests/detectors/assembly/0.6.11/inline_assembly_library.sol.0.6.11.Assembly.json create mode 100644 tests/detectors/assembly/0.7.6/inline_assembly_contract.sol create mode 100644 tests/detectors/assembly/0.7.6/inline_assembly_contract.sol.0.7.6.Assembly.json create mode 100644 tests/detectors/assembly/0.7.6/inline_assembly_library.sol create mode 100644 tests/detectors/assembly/0.7.6/inline_assembly_library.sol.0.7.6.Assembly.json rename tests/detectors/assert-state-change/{ => 0.4.25}/assert_state_change.sol (100%) create mode 100644 tests/detectors/assert-state-change/0.4.25/assert_state_change.sol.0.4.25.AssertStateChange.json create mode 100644 tests/detectors/assert-state-change/0.5.16/assert_state_change.sol create mode 100644 tests/detectors/assert-state-change/0.5.16/assert_state_change.sol.0.5.16.AssertStateChange.json create mode 100644 tests/detectors/assert-state-change/0.6.11/assert_state_change.sol create mode 100644 tests/detectors/assert-state-change/0.6.11/assert_state_change.sol.0.6.11.AssertStateChange.json create mode 100644 tests/detectors/assert-state-change/0.7.6/assert_state_change.sol rename tests/detectors/assert-state-change/{assert_state_change.sol.0.5.8.AssertStateChange.json => 0.7.6/assert_state_change.sol.0.7.6.AssertStateChange.json} (87%) rename tests/detectors/backdoor/{ => 0.4.25}/backdoor.sol (100%) rename tests/detectors/backdoor/{ => 0.4.25}/backdoor.sol.0.4.25.Backdoor.json (90%) create mode 100644 tests/detectors/backdoor/0.5.16/backdoor.sol create mode 100644 tests/detectors/backdoor/0.5.16/backdoor.sol.0.5.16.Backdoor.json create mode 100644 tests/detectors/backdoor/0.6.11/backdoor.sol create mode 100644 tests/detectors/backdoor/0.6.11/backdoor.sol.0.6.11.Backdoor.json create mode 100644 tests/detectors/backdoor/0.7.6/backdoor.sol rename tests/detectors/backdoor/{backdoor.sol.0.5.1.Backdoor.json => 0.7.6/backdoor.sol.0.7.6.Backdoor.json} (90%) rename tests/detectors/boolean-constant-equality/{ => 0.4.25}/boolean-constant-equality.sol (100%) rename tests/detectors/boolean-constant-equality/{ => 0.4.25}/boolean-constant-equality.sol.0.4.25.BooleanEquality.json (86%) create mode 100644 tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol create mode 100644 tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol.0.5.16.BooleanEquality.json create mode 100644 tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol create mode 100644 tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol.0.6.11.BooleanEquality.json create mode 100644 tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol rename tests/detectors/{boolean-equality/boolean-equality.sol.0.5.1.BooleanEquality.json => boolean-constant-equality/0.7.6/boolean-constant-equality.sol.0.7.6.BooleanEquality.json} (78%) rename tests/detectors/boolean-constant-misuse/{ => 0.4.25}/boolean-constant-misuse.sol (100%) create mode 100644 tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol.0.4.25.BooleanConstantMisuse.json create mode 100644 tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol create mode 100644 tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol.0.5.16.BooleanConstantMisuse.json create mode 100644 tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol create mode 100644 tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol.0.6.11.BooleanConstantMisuse.json create mode 100644 tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol rename tests/detectors/boolean-constant-misuse/{boolean-constant-misuse.sol.0.6.0.BooleanConstantMisuse.json => 0.7.6/boolean-constant-misuse.sol.0.7.6.BooleanConstantMisuse.json} (88%) rename tests/detectors/calls-loop/{ => 0.4.25}/multiple_calls_in_loop.sol (100%) rename tests/detectors/calls-loop/{ => 0.4.25}/multiple_calls_in_loop.sol.0.4.25.MultipleCallsInLoop.json (86%) create mode 100644 tests/detectors/calls-loop/0.5.16/multiple_calls_in_loop.sol create mode 100644 tests/detectors/calls-loop/0.5.16/multiple_calls_in_loop.sol.0.5.16.MultipleCallsInLoop.json create mode 100644 tests/detectors/calls-loop/0.6.11/multiple_calls_in_loop.sol create mode 100644 tests/detectors/calls-loop/0.6.11/multiple_calls_in_loop.sol.0.6.11.MultipleCallsInLoop.json create mode 100644 tests/detectors/calls-loop/0.7.6/multiple_calls_in_loop.sol create mode 100644 tests/detectors/calls-loop/0.7.6/multiple_calls_in_loop.sol.0.7.6.MultipleCallsInLoop.json rename tests/detectors/constable-states/{ => 0.4.25}/const_state_variables.sol (100%) rename tests/detectors/constable-states/{ => 0.4.25}/const_state_variables.sol.0.4.25.ConstCandidateStateVars.json (88%) create mode 100644 tests/detectors/constable-states/0.5.16/const_state_variables.sol create mode 100644 tests/detectors/constable-states/0.5.16/const_state_variables.sol.0.5.16.ConstCandidateStateVars.json create mode 100644 tests/detectors/constable-states/0.6.11/const_state_variables.sol create mode 100644 tests/detectors/constable-states/0.6.11/const_state_variables.sol.0.6.11.ConstCandidateStateVars.json create mode 100644 tests/detectors/constable-states/0.7.6/const_state_variables.sol rename tests/detectors/constable-states/{const_state_variables.sol.0.5.1.ConstCandidateStateVars.json => 0.7.6/const_state_variables.sol.0.7.6.ConstCandidateStateVars.json} (88%) rename tests/detectors/constant/{ => 0.4.25}/constant.sol (100%) rename tests/detectors/constant/{ => 0.4.25}/constant.sol.0.4.25.ConstantFunctionsAsm.json (91%) rename tests/detectors/constant/{ => 0.4.25}/constant.sol.0.4.25.ConstantFunctionsState.json (91%) rename tests/detectors/constant/{constant-0.5.1.sol => 0.5.16/constant.sol} (90%) rename tests/detectors/constant/{constant-0.5.1.sol.0.5.1.ConstantFunctionsState.json => 0.5.16/constant.sol.0.5.16.ConstantFunctionsAsm.json} (100%) rename tests/detectors/{events-access/missing_events_access_control.sol.0.5.12.MissingEventsArithmetic.json => constant/0.5.16/constant.sol.0.5.16.ConstantFunctionsState.json} (100%) create mode 100644 tests/detectors/constant/0.6.11/constant.sol rename tests/detectors/{external-function/external_function_2.sol.0.4.25.ExternalFunction.json => constant/0.6.11/constant.sol.0.6.11.ConstantFunctionsAsm.json} (100%) rename tests/detectors/{external-function/external_function_2.sol.0.5.1.ExternalFunction.json => constant/0.6.11/constant.sol.0.6.11.ConstantFunctionsState.json} (100%) create mode 100644 tests/detectors/constant/0.7.6/constant.sol rename tests/detectors/{missing-inheritance/unimplemented_interfaces.sol.0.5.12.UnimplementedFunctionDetection.json => constant/0.7.6/constant.sol.0.7.6.ConstantFunctionsAsm.json} (100%) rename tests/detectors/{storage-array/storage_signed_integer_array.sol.0.5.12.StorageSignedIntegerArray.json => constant/0.7.6/constant.sol.0.7.6.ConstantFunctionsState.json} (100%) rename tests/detectors/controlled-array-length/{ => 0.4.25}/array_length_assignment.sol (100%) rename tests/detectors/controlled-array-length/{ => 0.4.25}/array_length_assignment.sol.0.4.25.ArrayLengthAssignment.json (88%) create mode 100644 tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol create mode 100644 tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol.0.5.16.ArrayLengthAssignment.json rename tests/detectors/controlled-delegatecall/{ => 0.4.25}/controlled_delegatecall.sol (100%) rename tests/detectors/controlled-delegatecall/{ => 0.4.25}/controlled_delegatecall.sol.0.4.25.ControlledDelegateCall.json (85%) create mode 100644 tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol create mode 100644 tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol.0.5.16.ControlledDelegateCall.json create mode 100644 tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol create mode 100644 tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol.0.6.11.ControlledDelegateCall.json create mode 100644 tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol rename tests/detectors/controlled-delegatecall/{controlled_delegatecall.sol.0.5.1.ControlledDelegateCall.json => 0.7.6/controlled_delegatecall.sol.0.7.6.ControlledDelegateCall.json} (85%) rename tests/detectors/costly-loop/{ => 0.4.25}/multiple_costly_operations_in_loop.sol (100%) rename tests/detectors/costly-loop/{ => 0.4.25}/multiple_costly_operations_in_loop.sol.0.4.25.CostlyOperationsInLoop.json (87%) create mode 100644 tests/detectors/costly-loop/0.5.16/multiple_costly_operations_in_loop.sol create mode 100644 tests/detectors/costly-loop/0.5.16/multiple_costly_operations_in_loop.sol.0.5.16.CostlyOperationsInLoop.json create mode 100644 tests/detectors/costly-loop/0.6.11/multiple_costly_operations_in_loop.sol create mode 100644 tests/detectors/costly-loop/0.6.11/multiple_costly_operations_in_loop.sol.0.6.11.CostlyOperationsInLoop.json create mode 100644 tests/detectors/costly-loop/0.7.6/multiple_costly_operations_in_loop.sol create mode 100644 tests/detectors/costly-loop/0.7.6/multiple_costly_operations_in_loop.sol.0.7.6.CostlyOperationsInLoop.json rename tests/detectors/erc20-indexed/{ => 0.4.25}/erc20_indexed.sol (100%) rename tests/detectors/erc20-indexed/{ => 0.4.25}/erc20_indexed.sol.0.4.25.UnindexedERC20EventParameters.json (87%) create mode 100644 tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol create mode 100644 tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol.0.5.16.UnindexedERC20EventParameters.json create mode 100644 tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol create mode 100644 tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol.0.6.11.UnindexedERC20EventParameters.json create mode 100644 tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol create mode 100644 tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol.0.7.6.UnindexedERC20EventParameters.json rename tests/detectors/erc20-interface/{ => 0.4.25}/incorrect_erc20_interface.sol (100%) rename tests/detectors/erc20-interface/{ => 0.4.25}/incorrect_erc20_interface.sol.0.4.25.IncorrectERC20InterfaceDetection.json (82%) create mode 100644 tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol create mode 100644 tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol.0.5.16.IncorrectERC20InterfaceDetection.json create mode 100644 tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol create mode 100644 tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol.0.6.11.IncorrectERC20InterfaceDetection.json create mode 100644 tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol create mode 100644 tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol.0.7.6.IncorrectERC20InterfaceDetection.json rename tests/detectors/erc721-interface/{ => 0.4.25}/incorrect_erc721_interface.sol (100%) rename tests/detectors/erc721-interface/{ => 0.4.25}/incorrect_erc721_interface.sol.0.4.25.IncorrectERC721InterfaceDetection.json (82%) create mode 100644 tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol create mode 100644 tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol.0.5.16.IncorrectERC721InterfaceDetection.json create mode 100644 tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol create mode 100644 tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol.0.6.11.IncorrectERC721InterfaceDetection.json create mode 100644 tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol create mode 100644 tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol.0.7.6.IncorrectERC721InterfaceDetection.json rename tests/detectors/events-access/{ => 0.4.25}/missing_events_access_control.sol (100%) create mode 100644 tests/detectors/events-access/0.4.25/missing_events_access_control.sol.0.4.25.MissingEventsAccessControl.json create mode 100644 tests/detectors/events-access/0.5.16/missing_events_access_control.sol create mode 100644 tests/detectors/events-access/0.5.16/missing_events_access_control.sol.0.5.16.MissingEventsAccessControl.json create mode 100644 tests/detectors/events-access/0.6.11/missing_events_access_control.sol create mode 100644 tests/detectors/events-access/0.6.11/missing_events_access_control.sol.0.6.11.MissingEventsAccessControl.json create mode 100644 tests/detectors/events-access/0.7.6/missing_events_access_control.sol create mode 100644 tests/detectors/events-access/0.7.6/missing_events_access_control.sol.0.7.6.MissingEventsAccessControl.json rename tests/detectors/events-maths/{ => 0.4.25}/missing_events_arithmetic.sol (100%) create mode 100644 tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol.0.4.25.MissingEventsArithmetic.json create mode 100644 tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol create mode 100644 tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol.0.5.16.MissingEventsArithmetic.json create mode 100644 tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol create mode 100644 tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol.0.6.11.MissingEventsArithmetic.json create mode 100644 tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol rename tests/detectors/events-maths/{missing_events_arithmetic.sol.0.5.12.MissingEventsArithmetic.json => 0.7.6/missing_events_arithmetic.sol.0.7.6.MissingEventsArithmetic.json} (91%) rename tests/detectors/external-function/{ => 0.4.25}/external_function.sol (100%) rename tests/detectors/external-function/{ => 0.4.25}/external_function.sol.0.4.25.ExternalFunction.json (89%) rename tests/detectors/external-function/{ => 0.4.25}/external_function_2.sol (100%) rename tests/detectors/{unprotected-upgrade/Fixed.sol.0.6.12.UnprotectedUpgradeable.json => external-function/0.4.25/external_function_2.sol.0.4.25.ExternalFunction.json} (100%) rename tests/detectors/external-function/{ => 0.4.25}/external_function_import.sol (100%) create mode 100644 tests/detectors/external-function/0.5.16/external_function.sol create mode 100644 tests/detectors/external-function/0.5.16/external_function.sol.0.5.16.ExternalFunction.json create mode 100644 tests/detectors/external-function/0.5.16/external_function_2.sol create mode 100644 tests/detectors/external-function/0.5.16/external_function_2.sol.0.5.16.ExternalFunction.json create mode 100644 tests/detectors/external-function/0.5.16/external_function_import.sol create mode 100644 tests/detectors/external-function/0.6.11/external_function.sol create mode 100644 tests/detectors/external-function/0.6.11/external_function.sol.0.6.11.ExternalFunction.json create mode 100644 tests/detectors/external-function/0.6.11/external_function_2.sol create mode 100644 tests/detectors/external-function/0.6.11/external_function_2.sol.0.6.11.ExternalFunction.json create mode 100644 tests/detectors/external-function/0.6.11/external_function_import.sol create mode 100644 tests/detectors/external-function/0.7.6/external_function.sol rename tests/detectors/external-function/{external_function.sol.0.5.1.ExternalFunction.json => 0.7.6/external_function.sol.0.7.6.ExternalFunction.json} (90%) create mode 100644 tests/detectors/external-function/0.7.6/external_function_2.sol create mode 100644 tests/detectors/external-function/0.7.6/external_function_2.sol.0.7.6.ExternalFunction.json create mode 100644 tests/detectors/external-function/0.7.6/external_function_import.sol rename tests/detectors/function-init-state/{ => 0.4.25}/function_init_state_variables.sol (100%) rename tests/detectors/function-init-state/{ => 0.4.25}/function_init_state_variables.sol.0.4.25.FunctionInitializedState.json (86%) create mode 100644 tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol create mode 100644 tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol.0.5.16.FunctionInitializedState.json create mode 100644 tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol create mode 100644 tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol.0.6.11.FunctionInitializedState.json create mode 100644 tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol create mode 100644 tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol.0.7.6.FunctionInitializedState.json rename tests/detectors/incorrect-equality/{ => 0.4.25}/incorrect_equality.sol (100%) rename tests/detectors/incorrect-equality/{incorrect_equality.sol.0.5.1.IncorrectStrictEquality.json => 0.4.25/incorrect_equality.sol.0.4.25.IncorrectStrictEquality.json} (89%) create mode 100644 tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol create mode 100644 tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol.0.5.16.IncorrectStrictEquality.json create mode 100644 tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol create mode 100644 tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol.0.6.11.IncorrectStrictEquality.json create mode 100644 tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol create mode 100644 tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol.0.7.6.IncorrectStrictEquality.json rename tests/detectors/incorrect-modifier/{ => 0.4.25}/modifier_default.sol (100%) rename tests/detectors/incorrect-modifier/{ => 0.4.25}/modifier_default.sol.0.4.25.ModifierDefaultDetection.json (91%) create mode 100644 tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol create mode 100644 tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol.0.5.16.ModifierDefaultDetection.json create mode 100644 tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol create mode 100644 tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol.0.6.11.ModifierDefaultDetection.json create mode 100644 tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol create mode 100644 tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol.0.7.6.ModifierDefaultDetection.json rename tests/detectors/incorrect-unary/{ => 0.4.25}/invalid_unary_expression.sol (100%) rename tests/detectors/incorrect-unary/{ => 0.4.25}/invalid_unary_expression.sol.0.4.25.IncorrectUnaryExpressionDetection.json (86%) rename tests/detectors/locked-ether/{ => 0.4.25}/locked_ether.sol (100%) rename tests/detectors/locked-ether/{ => 0.4.25}/locked_ether.sol.0.4.25.LockedEther.json (83%) rename tests/detectors/locked-ether/{locked_ether-0.5.1.sol => 0.5.16/locked_ether.sol} (100%) rename tests/detectors/locked-ether/{locked_ether-0.5.1.sol.0.5.1.LockedEther.json => 0.5.16/locked_ether.sol.0.5.16.LockedEther.json} (82%) create mode 100644 tests/detectors/locked-ether/0.6.11/locked_ether.sol create mode 100644 tests/detectors/locked-ether/0.6.11/locked_ether.sol.0.6.11.LockedEther.json create mode 100644 tests/detectors/locked-ether/0.7.6/locked_ether.sol create mode 100644 tests/detectors/locked-ether/0.7.6/locked_ether.sol.0.7.6.LockedEther.json rename tests/detectors/low-level-calls/{ => 0.4.25}/low_level_calls.sol (100%) rename tests/detectors/low-level-calls/{ => 0.4.25}/low_level_calls.sol.0.4.25.LowLevelCalls.json (85%) create mode 100644 tests/detectors/low-level-calls/0.5.16/low_level_calls.sol rename tests/detectors/low-level-calls/{low_level_calls.sol.0.5.1.LowLevelCalls.json => 0.5.16/low_level_calls.sol.0.5.16.LowLevelCalls.json} (85%) create mode 100644 tests/detectors/low-level-calls/0.6.11/low_level_calls.sol create mode 100644 tests/detectors/low-level-calls/0.6.11/low_level_calls.sol.0.6.11.LowLevelCalls.json create mode 100644 tests/detectors/low-level-calls/0.7.6/low_level_calls.sol create mode 100644 tests/detectors/low-level-calls/0.7.6/low_level_calls.sol.0.7.6.LowLevelCalls.json rename tests/detectors/mapping-deletion/{ => 0.4.25}/MappingDeletion.sol (97%) rename tests/detectors/mapping-deletion/{ => 0.4.25}/MappingDeletion.sol.0.4.25.MappingDeletionDetection.json (84%) create mode 100644 tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol create mode 100644 tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol.0.5.16.MappingDeletionDetection.json create mode 100644 tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol create mode 100644 tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol.0.6.11.MappingDeletionDetection.json create mode 100644 tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol create mode 100644 tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol.0.7.6.MappingDeletionDetection.json rename tests/detectors/missing-inheritance/{ => 0.5.16}/unimplemented_interfaces.sol (100%) create mode 100644 tests/detectors/missing-inheritance/0.5.16/unimplemented_interfaces.sol.0.5.16.UnimplementedFunctionDetection.json create mode 100644 tests/detectors/missing-inheritance/0.6.11/unimplemented_interfaces.sol create mode 100644 tests/detectors/missing-inheritance/0.6.11/unimplemented_interfaces.sol.0.6.11.UnimplementedFunctionDetection.json create mode 100644 tests/detectors/missing-inheritance/0.7.6/unimplemented_interfaces.sol create mode 100644 tests/detectors/missing-inheritance/0.7.6/unimplemented_interfaces.sol.0.7.6.UnimplementedFunctionDetection.json create mode 100644 tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol create mode 100644 tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol.0.4.25.MissingZeroAddressValidation.json rename tests/detectors/missing-zero-check/{ => 0.5.16}/missing_zero_address_validation.sol (100%) create mode 100644 tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol.0.5.16.MissingZeroAddressValidation.json create mode 100644 tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol create mode 100644 tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol.0.6.11.MissingZeroAddressValidation.json create mode 100644 tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol rename tests/detectors/missing-zero-check/{missing_zero_address_validation.sol.0.5.12.MissingZeroAddressValidation.json => 0.7.6/missing_zero_address_validation.sol.0.7.6.MissingZeroAddressValidation.json} (90%) delete mode 100644 tests/detectors/multiple-constructors/multiple-constructors.sol.compact.json rename tests/detectors/naming-convention/{ => 0.4.25}/naming_convention.sol (100%) rename tests/detectors/naming-convention/{ => 0.4.25}/naming_convention.sol.0.4.25.NamingConvention.json (91%) rename tests/detectors/naming-convention/{ => 0.4.25}/naming_convention_ignore.sol (100%) rename tests/detectors/naming-convention/{ => 0.4.25}/naming_convention_ignore.sol.0.4.25.NamingConvention.json (88%) create mode 100644 tests/detectors/naming-convention/0.5.16/naming_convention.sol create mode 100644 tests/detectors/naming-convention/0.5.16/naming_convention.sol.0.5.16.NamingConvention.json create mode 100644 tests/detectors/naming-convention/0.5.16/naming_convention_ignore.sol create mode 100644 tests/detectors/naming-convention/0.5.16/naming_convention_ignore.sol.0.5.16.NamingConvention.json create mode 100644 tests/detectors/naming-convention/0.6.11/naming_convention.sol create mode 100644 tests/detectors/naming-convention/0.6.11/naming_convention.sol.0.6.11.NamingConvention.json create mode 100644 tests/detectors/naming-convention/0.6.11/naming_convention_ignore.sol create mode 100644 tests/detectors/naming-convention/0.6.11/naming_convention_ignore.sol.0.6.11.NamingConvention.json create mode 100644 tests/detectors/naming-convention/0.7.6/naming_convention.sol rename tests/detectors/naming-convention/{naming_convention.sol.0.5.1.NamingConvention.json => 0.7.6/naming_convention.sol.0.7.6.NamingConvention.json} (91%) create mode 100644 tests/detectors/naming-convention/0.7.6/naming_convention_ignore.sol create mode 100644 tests/detectors/naming-convention/0.7.6/naming_convention_ignore.sol.0.7.6.NamingConvention.json create mode 100644 tests/detectors/pragma/0.4.25/pragma.0.4.24.sol create mode 100644 tests/detectors/pragma/0.4.25/pragma.0.4.25.sol rename tests/detectors/pragma/{pragma.0.4.24.sol.0.4.25.ConstantPragma.json => 0.4.25/pragma.0.4.25.sol.0.4.25.ConstantPragma.json} (77%) create mode 100644 tests/detectors/pragma/0.5.16/pragma.0.5.15.sol create mode 100644 tests/detectors/pragma/0.5.16/pragma.0.5.16.sol create mode 100644 tests/detectors/pragma/0.5.16/pragma.0.5.16.sol.0.5.16.ConstantPragma.json create mode 100644 tests/detectors/pragma/0.6.11/pragma.0.6.10.sol create mode 100644 tests/detectors/pragma/0.6.11/pragma.0.6.11.sol create mode 100644 tests/detectors/pragma/0.6.11/pragma.0.6.11.sol.0.6.11.ConstantPragma.json create mode 100644 tests/detectors/pragma/0.7.6/pragma.0.7.5.sol create mode 100644 tests/detectors/pragma/0.7.6/pragma.0.7.6.sol create mode 100644 tests/detectors/pragma/0.7.6/pragma.0.7.6.sol.0.7.6.ConstantPragma.json delete mode 100644 tests/detectors/pragma/pragma.0.4.23.sol delete mode 100644 tests/detectors/pragma/pragma.0.4.24.sol rename tests/detectors/public-mappings-nested/{ => 0.4.25}/public_mappings_nested.sol (100%) rename tests/detectors/public-mappings-nested/{ => 0.4.25}/public_mappings_nested.sol.0.4.25.PublicMappingNested.json (86%) rename tests/detectors/redundant-statements/{ => 0.4.25}/redundant_statements.sol (100%) rename tests/detectors/redundant-statements/{ => 0.4.25}/redundant_statements.sol.0.4.25.RedundantStatements.json (85%) create mode 100644 tests/detectors/redundant-statements/0.5.16/redundant_statements.sol create mode 100644 tests/detectors/redundant-statements/0.5.16/redundant_statements.sol.0.5.16.RedundantStatements.json create mode 100644 tests/detectors/redundant-statements/0.6.11/redundant_statements.sol create mode 100644 tests/detectors/redundant-statements/0.6.11/redundant_statements.sol.0.6.11.RedundantStatements.json create mode 100644 tests/detectors/redundant-statements/0.7.6/redundant_statements.sol create mode 100644 tests/detectors/redundant-statements/0.7.6/redundant_statements.sol.0.7.6.RedundantStatements.json rename tests/detectors/reentrancy-before-write/{ => 0.4.25}/reentrancy-write.sol (95%) rename tests/detectors/reentrancy-before-write/{reentrancy-write.sol.0.4.26.ReentrancyReadBeforeWritten.json => 0.4.25/reentrancy-write.sol.0.4.25.ReentrancyReadBeforeWritten.json} (85%) create mode 100644 tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol create mode 100644 tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol.0.5.16.ReentrancyReadBeforeWritten.json create mode 100644 tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol create mode 100644 tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol.0.6.11.ReentrancyReadBeforeWritten.json create mode 100644 tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol create mode 100644 tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol.0.7.6.ReentrancyReadBeforeWritten.json rename tests/detectors/reentrancy-benign/{ => 0.4.25}/reentrancy-benign.sol (100%) rename tests/detectors/reentrancy-benign/{reentrancy-benign.sol.0.4.26.ReentrancyBenign.json => 0.4.25/reentrancy-benign.sol.0.4.25.ReentrancyBenign.json} (92%) create mode 100644 tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol create mode 100644 tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol.0.5.16.ReentrancyBenign.json create mode 100644 tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol create mode 100644 tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol.0.6.11.ReentrancyBenign.json create mode 100644 tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol create mode 100644 tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol.0.7.6.ReentrancyBenign.json rename tests/detectors/reentrancy-eth/{ => 0.4.25}/reentrancy.sol (100%) rename tests/detectors/reentrancy-eth/{ => 0.4.25}/reentrancy.sol.0.4.25.ReentrancyEth.json (92%) rename tests/detectors/reentrancy-eth/{ => 0.4.25}/reentrancy_indirect.sol (100%) rename tests/detectors/reentrancy-eth/{ => 0.4.25}/reentrancy_indirect.sol.0.4.25.ReentrancyEth.json (87%) rename tests/detectors/reentrancy-eth/{reentrancy-0.5.1.sol => 0.5.16/reentrancy.sol} (98%) rename tests/detectors/reentrancy-eth/{reentrancy-0.5.1.sol.0.5.1.ReentrancyEth.json => 0.5.16/reentrancy.sol.0.5.16.ReentrancyEth.json} (89%) create mode 100644 tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol create mode 100644 tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol.0.5.16.ReentrancyEth.json create mode 100644 tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol create mode 100644 tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol.0.6.11.ReentrancyEth.json create mode 100644 tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol create mode 100644 tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol.0.6.11.ReentrancyEth.json create mode 100644 tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol create mode 100644 tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol.0.7.6.ReentrancyEth.json create mode 100644 tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol create mode 100644 tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol.0.7.6.ReentrancyEth.json rename tests/detectors/reentrancy-events/{reentrancy-0.5.1-events.sol => 0.5.16/reentrancy-events.sol} (100%) create mode 100644 tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol.0.5.16.ReentrancyEvent.json create mode 100644 tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol create mode 100644 tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol.0.6.11.ReentrancyEvent.json create mode 100644 tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol rename tests/detectors/reentrancy-events/{reentrancy-0.5.1-events.sol.0.5.1.ReentrancyEvent.json => 0.7.6/reentrancy-events.sol.0.7.6.ReentrancyEvent.json} (87%) create mode 100644 tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol create mode 100644 tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol.0.4.21.ReusedBaseConstructor.json rename tests/detectors/reused-constructor/{ => 0.4.25}/reused_base_constructor.sol (100%) rename tests/detectors/reused-constructor/{ => 0.4.25}/reused_base_constructor.sol.0.4.25.ReusedBaseConstructor.json (77%) rename tests/detectors/rtlo/{ => 0.4.25}/right_to_left_override.sol (100%) rename tests/detectors/rtlo/{ => 0.4.25}/right_to_left_override.sol.0.4.25.RightToLeftOverride.json (59%) create mode 100644 tests/detectors/rtlo/0.5.16/right_to_left_override.sol create mode 100644 tests/detectors/rtlo/0.5.16/right_to_left_override.sol.0.5.16.RightToLeftOverride.json create mode 100644 tests/detectors/rtlo/0.6.11/right_to_left_override.sol create mode 100644 tests/detectors/rtlo/0.6.11/right_to_left_override.sol.0.6.11.RightToLeftOverride.json rename tests/detectors/shadowing-abstract/{ => 0.4.25}/shadowing_abstract.sol (100%) rename tests/detectors/shadowing-abstract/{ => 0.4.25}/shadowing_abstract.sol.0.4.25.ShadowingAbstractDetection.json (84%) create mode 100644 tests/detectors/shadowing-abstract/0.5.16/shadowing_abstract.sol create mode 100644 tests/detectors/shadowing-abstract/0.5.16/shadowing_abstract.sol.0.5.16.ShadowingAbstractDetection.json rename tests/detectors/shadowing-builtin/{ => 0.4.25}/shadowing_builtin_symbols.sol (100%) rename tests/detectors/shadowing-builtin/{ => 0.4.25}/shadowing_builtin_symbols.sol.0.4.25.BuiltinSymbolShadowing.json (85%) create mode 100644 tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol create mode 100644 tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol.0.5.16.BuiltinSymbolShadowing.json rename tests/detectors/shadowing-local/{ => 0.4.25}/shadowing_local_variable.sol (100%) rename tests/detectors/shadowing-local/{ => 0.4.25}/shadowing_local_variable.sol.0.4.25.LocalShadowing.json (84%) create mode 100644 tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol create mode 100644 tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol.0.5.16.LocalShadowing.json create mode 100644 tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol create mode 100644 tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol.0.6.11.LocalShadowing.json create mode 100644 tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol create mode 100644 tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol.0.7.6.LocalShadowing.json rename tests/detectors/shadowing-state/{ => 0.4.25}/shadowing_state_variable.sol (100%) rename tests/detectors/shadowing-state/{ => 0.4.25}/shadowing_state_variable.sol.0.4.25.StateShadowing.json (85%) create mode 100644 tests/detectors/shadowing-state/0.5.16/shadowing_state_variable.sol create mode 100644 tests/detectors/shadowing-state/0.5.16/shadowing_state_variable.sol.0.5.16.StateShadowing.json create mode 100644 tests/detectors/shadowing-state/0.6.11/shadowing_state_variable.sol create mode 100644 tests/detectors/shadowing-state/0.6.11/shadowing_state_variable.sol.0.6.11.StateShadowing.json create mode 100644 tests/detectors/shadowing-state/0.7.6/shadowing_state_variable.sol create mode 100644 tests/detectors/shadowing-state/0.7.6/shadowing_state_variable.sol.0.7.6.StateShadowing.json create mode 100644 tests/detectors/solc-version/0.4.25/static.sol rename tests/detectors/solc-version/{old_solc.sol.0.4.21.IncorrectSolc.json => 0.4.25/static.sol.0.4.25.IncorrectSolc.json} (65%) create mode 100644 tests/detectors/solc-version/0.5.14/static.sol create mode 100644 tests/detectors/solc-version/0.5.14/static.sol.0.5.14.IncorrectSolc.json create mode 100644 tests/detectors/solc-version/0.5.16/dynamic_1.sol create mode 100644 tests/detectors/solc-version/0.5.16/dynamic_1.sol.0.5.16.IncorrectSolc.json create mode 100644 tests/detectors/solc-version/0.5.16/dynamic_2.sol create mode 100644 tests/detectors/solc-version/0.5.16/dynamic_2.sol.0.5.16.IncorrectSolc.json create mode 100644 tests/detectors/solc-version/0.5.16/static.sol create mode 100644 tests/detectors/solc-version/0.5.16/static.sol.0.5.16.IncorrectSolc.json create mode 100644 tests/detectors/solc-version/0.6.10/static.sol create mode 100644 tests/detectors/solc-version/0.6.10/static.sol.0.6.10.IncorrectSolc.json create mode 100644 tests/detectors/solc-version/0.6.11/dynamic_1.sol create mode 100644 tests/detectors/solc-version/0.6.11/dynamic_1.sol.0.6.11.IncorrectSolc.json create mode 100644 tests/detectors/solc-version/0.6.11/dynamic_2.sol create mode 100644 tests/detectors/solc-version/0.6.11/dynamic_2.sol.0.6.11.IncorrectSolc.json create mode 100644 tests/detectors/solc-version/0.6.11/static.sol create mode 100644 tests/detectors/solc-version/0.6.11/static.sol.0.6.11.IncorrectSolc.json create mode 100644 tests/detectors/solc-version/0.7.4/static.sol create mode 100644 tests/detectors/solc-version/0.7.4/static.sol.0.7.4.IncorrectSolc.json create mode 100644 tests/detectors/solc-version/0.7.6/dynamic_1.sol create mode 100644 tests/detectors/solc-version/0.7.6/dynamic_1.sol.0.7.6.IncorrectSolc.json create mode 100644 tests/detectors/solc-version/0.7.6/dynamic_2.sol create mode 100644 tests/detectors/solc-version/0.7.6/dynamic_2.sol.0.7.6.IncorrectSolc.json create mode 100644 tests/detectors/solc-version/0.7.6/static.sol create mode 100644 tests/detectors/solc-version/0.7.6/static.sol.0.7.6.IncorrectSolc.json delete mode 100644 tests/detectors/solc-version/old_solc.sol delete mode 100644 tests/detectors/solc-version/solc_version_incorrect.sol delete mode 100644 tests/detectors/solc-version/solc_version_incorrect.sol.0.4.25.IncorrectSolc.json delete mode 100644 tests/detectors/solc-version/solc_version_incorrect_05.sol delete mode 100644 tests/detectors/solc-version/solc_version_incorrect_05.sol.0.5.7.IncorrectSolc.json rename tests/detectors/storage-array/{ => 0.5.10}/storage_signed_integer_array.sol (100%) rename tests/detectors/storage-array/{storage_signed_integer_array.sol.0.5.8.StorageSignedIntegerArray.json => 0.5.10/storage_signed_integer_array.sol.0.5.10.StorageSignedIntegerArray.json} (88%) create mode 100644 tests/detectors/storage-array/0.5.16/storage_signed_integer_array.sol create mode 100644 tests/detectors/storage-array/0.5.16/storage_signed_integer_array.sol.0.5.16.StorageSignedIntegerArray.json create mode 100644 tests/detectors/suicidal/0.4.25/suicidal.sol rename tests/detectors/{backdoor/backdoor.sol.0.5.1.Suicidal.json => suicidal/0.4.25/suicidal.sol.0.4.25.Suicidal.json} (82%) create mode 100644 tests/detectors/suicidal/0.5.16/suicidal.sol create mode 100644 tests/detectors/suicidal/0.5.16/suicidal.sol.0.5.16.Suicidal.json create mode 100644 tests/detectors/suicidal/0.6.11/suicidal.sol create mode 100644 tests/detectors/suicidal/0.6.11/suicidal.sol.0.6.11.Suicidal.json create mode 100644 tests/detectors/suicidal/0.7.6/suicidal.sol rename tests/detectors/{backdoor/backdoor.sol.0.4.25.Suicidal.json => suicidal/0.7.6/suicidal.sol.0.7.6.Suicidal.json} (82%) rename tests/detectors/timestamp/{ => 0.4.25}/timestamp.sol (100%) rename tests/detectors/timestamp/{ => 0.4.25}/timestamp.sol.0.4.25.Timestamp.json (89%) create mode 100644 tests/detectors/timestamp/0.5.16/timestamp.sol create mode 100644 tests/detectors/timestamp/0.5.16/timestamp.sol.0.5.16.Timestamp.json create mode 100644 tests/detectors/timestamp/0.6.11/timestamp.sol create mode 100644 tests/detectors/timestamp/0.6.11/timestamp.sol.0.6.11.Timestamp.json create mode 100644 tests/detectors/timestamp/0.7.6/timestamp.sol rename tests/detectors/timestamp/{timestamp.sol.0.5.1.Timestamp.json => 0.7.6/timestamp.sol.0.7.6.Timestamp.json} (89%) rename tests/detectors/too-many-digits/{ => 0.4.25}/too_many_digits.sol (97%) rename tests/detectors/too-many-digits/{too_many_digits.sol.0.5.1.TooManyDigits.json => 0.4.25/too_many_digits.sol.0.4.25.TooManyDigits.json} (88%) create mode 100644 tests/detectors/too-many-digits/0.5.16/too_many_digits.sol create mode 100644 tests/detectors/too-many-digits/0.5.16/too_many_digits.sol.0.5.16.TooManyDigits.json create mode 100644 tests/detectors/too-many-digits/0.6.11/too_many_digits.sol create mode 100644 tests/detectors/too-many-digits/0.6.11/too_many_digits.sol.0.6.11.TooManyDigits.json create mode 100644 tests/detectors/too-many-digits/0.7.6/too_many_digits.sol create mode 100644 tests/detectors/too-many-digits/0.7.6/too_many_digits.sol.0.7.6.TooManyDigits.json rename tests/detectors/tx-origin/{ => 0.4.25}/tx_origin.sol (100%) rename tests/detectors/tx-origin/{ => 0.4.25}/tx_origin.sol.0.4.25.TxOrigin.json (90%) rename tests/detectors/tx-origin/{tx_origin-0.5.1.sol => 0.5.16/tx_origin.sol} (100%) rename tests/detectors/tx-origin/{tx_origin-0.5.1.sol.0.5.1.TxOrigin.json => 0.5.16/tx_origin.sol.0.5.16.TxOrigin.json} (90%) create mode 100644 tests/detectors/tx-origin/0.6.11/tx_origin.sol create mode 100644 tests/detectors/tx-origin/0.6.11/tx_origin.sol.0.6.11.TxOrigin.json create mode 100644 tests/detectors/tx-origin/0.7.6/tx_origin.sol create mode 100644 tests/detectors/tx-origin/0.7.6/tx_origin.sol.0.7.6.TxOrigin.json rename tests/detectors/unchecked-lowlevel/{ => 0.4.25}/unchecked_lowlevel.sol (100%) rename tests/detectors/unchecked-lowlevel/{ => 0.4.25}/unchecked_lowlevel.sol.0.4.25.UncheckedLowLevel.json (85%) rename tests/detectors/unchecked-lowlevel/{unchecked_lowlevel-0.5.1.sol => 0.5.16/unchecked_lowlevel.sol} (100%) rename tests/detectors/unchecked-lowlevel/{unchecked_lowlevel-0.5.1.sol.0.5.1.UncheckedLowLevel.json => 0.5.16/unchecked_lowlevel.sol.0.5.16.UncheckedLowLevel.json} (85%) create mode 100644 tests/detectors/unchecked-lowlevel/0.6.11/unchecked_lowlevel.sol create mode 100644 tests/detectors/unchecked-lowlevel/0.6.11/unchecked_lowlevel.sol.0.6.11.UncheckedLowLevel.json create mode 100644 tests/detectors/unchecked-lowlevel/0.7.6/unchecked_lowlevel.sol create mode 100644 tests/detectors/unchecked-lowlevel/0.7.6/unchecked_lowlevel.sol.0.7.6.UncheckedLowLevel.json create mode 100644 tests/detectors/unchecked-send/0.4.25/unchecked_send.sol create mode 100644 tests/detectors/unchecked-send/0.4.25/unchecked_send.sol.0.4.25.UncheckedSend.json rename tests/detectors/unchecked-send/{unchecked_send-0.5.1.sol => 0.5.16/unchecked_send.sol} (100%) create mode 100644 tests/detectors/unchecked-send/0.5.16/unchecked_send.sol.0.5.16.UncheckedSend.json create mode 100644 tests/detectors/unchecked-send/0.6.11/unchecked_send.sol create mode 100644 tests/detectors/unchecked-send/0.6.11/unchecked_send.sol.0.6.11.UncheckedSend.json create mode 100644 tests/detectors/unchecked-send/0.7.6/unchecked_send.sol rename tests/detectors/unchecked-send/{unchecked_send-0.5.1.sol.0.5.1.UncheckedSend.json => 0.7.6/unchecked_send.sol.0.7.6.UncheckedSend.json} (88%) rename tests/detectors/unimplemented-functions/{ => 0.4.25}/unimplemented.sol (100%) rename tests/detectors/unimplemented-functions/{ => 0.4.25}/unimplemented.sol.0.4.25.UnimplementedFunctionDetection.json (82%) create mode 100644 tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol create mode 100644 tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol.0.5.16.UnimplementedFunctionDetection.json create mode 100644 tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol create mode 100644 tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol.0.6.11.UnimplementedFunctionDetection.json create mode 100644 tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol create mode 100644 tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol.0.7.6.UnimplementedFunctionDetection.json rename tests/detectors/uninitialized-fptr-cst/{ => 0.4.25}/uninitialized_function_ptr_constructor.sol (99%) create mode 100644 tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol.0.4.25.UninitializedFunctionPtrsConstructor.json create mode 100644 tests/detectors/uninitialized-fptr-cst/0.5.16/uninitialized_function_ptr_constructor.sol create mode 100644 tests/detectors/uninitialized-fptr-cst/0.5.16/uninitialized_function_ptr_constructor.sol.0.5.16.UninitializedFunctionPtrsConstructor.json create mode 100644 tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol rename tests/detectors/uninitialized-fptr-cst/{ => 0.5.8}/uninitialized_function_ptr_constructor.sol.0.5.8.UninitializedFunctionPtrsConstructor.json (76%) rename tests/detectors/uninitialized-local/{ => 0.4.25}/uninitialized_local_variable.sol (100%) rename tests/detectors/uninitialized-local/{ => 0.4.25}/uninitialized_local_variable.sol.0.4.25.UninitializedLocalVars.json (85%) create mode 100644 tests/detectors/uninitialized-local/0.5.16/uninitialized_local_variable.sol create mode 100644 tests/detectors/uninitialized-local/0.5.16/uninitialized_local_variable.sol.0.5.16.UninitializedLocalVars.json create mode 100644 tests/detectors/uninitialized-local/0.6.11/uninitialized_local_variable.sol create mode 100644 tests/detectors/uninitialized-local/0.6.11/uninitialized_local_variable.sol.0.6.11.UninitializedLocalVars.json create mode 100644 tests/detectors/uninitialized-local/0.7.6/uninitialized_local_variable.sol create mode 100644 tests/detectors/uninitialized-local/0.7.6/uninitialized_local_variable.sol.0.7.6.UninitializedLocalVars.json rename tests/detectors/uninitialized-state/{ => 0.4.25}/uninitialized.sol (97%) rename tests/detectors/uninitialized-state/{ => 0.4.25}/uninitialized.sol.0.4.25.UninitializedStateVarsDetection.json (84%) rename tests/detectors/uninitialized-state/{uninitialized-0.5.1.sol => 0.5.16/uninitialized.sol} (97%) create mode 100644 tests/detectors/uninitialized-state/0.5.16/uninitialized.sol.0.5.16.UninitializedStateVarsDetection.json create mode 100644 tests/detectors/uninitialized-state/0.6.11/uninitialized.sol create mode 100644 tests/detectors/uninitialized-state/0.6.11/uninitialized.sol.0.6.11.UninitializedStateVarsDetection.json create mode 100644 tests/detectors/uninitialized-state/0.7.6/uninitialized.sol rename tests/detectors/uninitialized-state/{uninitialized-0.5.1.sol.0.5.1.UninitializedStateVarsDetection.json => 0.7.6/uninitialized.sol.0.7.6.UninitializedStateVarsDetection.json} (86%) rename tests/detectors/uninitialized-storage/{ => 0.4.25}/uninitialized_storage_pointer.sol (100%) rename tests/detectors/uninitialized-storage/{ => 0.4.25}/uninitialized_storage_pointer.sol.0.4.25.UninitializedStorageVars.json (85%) create mode 100644 tests/detectors/unprotected-upgrade/0.4.25/Buggy.sol create mode 100644 tests/detectors/unprotected-upgrade/0.4.25/Buggy.sol.0.4.25.UnprotectedUpgradeable.json create mode 100644 tests/detectors/unprotected-upgrade/0.4.25/Fixed.sol create mode 100644 tests/detectors/unprotected-upgrade/0.4.25/Fixed.sol.0.4.25.UnprotectedUpgradeable.json rename tests/detectors/unprotected-upgrade/{ => 0.4.25}/Initializable.sol (100%) rename tests/detectors/unprotected-upgrade/{ => 0.5.16}/Buggy.sol (100%) create mode 100644 tests/detectors/unprotected-upgrade/0.5.16/Buggy.sol.0.5.16.UnprotectedUpgradeable.json rename tests/detectors/unprotected-upgrade/{ => 0.5.16}/Fixed.sol (100%) create mode 100644 tests/detectors/unprotected-upgrade/0.5.16/Fixed.sol.0.5.16.UnprotectedUpgradeable.json create mode 100644 tests/detectors/unprotected-upgrade/0.5.16/Initializable.sol create mode 100644 tests/detectors/unprotected-upgrade/0.6.11/Buggy.sol create mode 100644 tests/detectors/unprotected-upgrade/0.6.11/Buggy.sol.0.6.11.UnprotectedUpgradeable.json create mode 100644 tests/detectors/unprotected-upgrade/0.6.11/Fixed.sol create mode 100644 tests/detectors/unprotected-upgrade/0.6.11/Fixed.sol.0.6.11.UnprotectedUpgradeable.json create mode 100644 tests/detectors/unprotected-upgrade/0.6.11/Initializable.sol create mode 100644 tests/detectors/unprotected-upgrade/0.7.6/Buggy.sol rename tests/detectors/unprotected-upgrade/{Buggy.sol.0.6.12.UnprotectedUpgradeable.json => 0.7.6/Buggy.sol.0.7.6.UnprotectedUpgradeable.json} (86%) create mode 100644 tests/detectors/unprotected-upgrade/0.7.6/Fixed.sol create mode 100644 tests/detectors/unprotected-upgrade/0.7.6/Fixed.sol.0.7.6.UnprotectedUpgradeable.json create mode 100644 tests/detectors/unprotected-upgrade/0.7.6/Initializable.sol rename tests/detectors/unused-return/{ => 0.4.25}/unused_return.sol (100%) rename tests/detectors/unused-return/{ => 0.4.25}/unused_return.sol.0.4.25.UnusedReturnValues.json (89%) create mode 100644 tests/detectors/unused-return/0.5.16/unused_return.sol rename tests/detectors/unused-return/{unused_return.sol.0.5.1.UnusedReturnValues.json => 0.5.16/unused_return.sol.0.5.16.UnusedReturnValues.json} (89%) create mode 100644 tests/detectors/unused-return/0.6.11/unused_return.sol create mode 100644 tests/detectors/unused-return/0.6.11/unused_return.sol.0.6.11.UnusedReturnValues.json create mode 100644 tests/detectors/unused-return/0.7.6/unused_return.sol create mode 100644 tests/detectors/unused-return/0.7.6/unused_return.sol.0.7.6.UnusedReturnValues.json rename tests/detectors/unused-state/{ => 0.4.25}/unused_state.sol (100%) rename tests/detectors/unused-state/{ => 0.4.25}/unused_state.sol.0.4.25.UnusedStateVars.json (87%) create mode 100644 tests/detectors/unused-state/0.5.16/unused_state.sol create mode 100644 tests/detectors/unused-state/0.5.16/unused_state.sol.0.5.16.UnusedStateVars.json create mode 100644 tests/detectors/unused-state/0.6.11/unused_state.sol create mode 100644 tests/detectors/unused-state/0.6.11/unused_state.sol.0.6.11.UnusedStateVars.json create mode 100644 tests/detectors/unused-state/0.7.6/unused_state.sol rename tests/detectors/unused-state/{unused_state.sol.0.5.1.UnusedStateVars.json => 0.7.6/unused_state.sol.0.7.6.UnusedStateVars.json} (87%) rename tests/detectors/variable-scope/{ => 0.4.25}/predeclaration_usage_local.sol (100%) rename tests/detectors/variable-scope/{ => 0.4.25}/predeclaration_usage_local.sol.0.4.25.PredeclarationUsageLocal.json (88%) rename tests/detectors/void-cst/{ => 0.4.25}/void-cst.sol (100%) create mode 100644 tests/detectors/void-cst/0.4.25/void-cst.sol.0.4.25.VoidConstructor.json create mode 100644 tests/detectors/void-cst/0.5.16/void-cst.sol create mode 100644 tests/detectors/void-cst/0.5.16/void-cst.sol.0.5.16.VoidConstructor.json create mode 100644 tests/detectors/void-cst/0.6.11/void-cst.sol create mode 100644 tests/detectors/void-cst/0.6.11/void-cst.sol.0.6.11.VoidConstructor.json create mode 100644 tests/detectors/void-cst/0.7.6/void-cst.sol rename tests/detectors/void-cst/{void-cst.sol.0.5.1.VoidConstructor.json => 0.7.6/void-cst.sol.0.7.6.VoidConstructor.json} (89%) rename tests/detectors/weak-prng/{ => 0.4.25}/bad_prng.sol (100%) rename tests/detectors/weak-prng/{ => 0.4.25}/bad_prng.sol.0.4.25.BadPRNG.json (91%) create mode 100644 tests/detectors/weak-prng/0.5.16/bad_prng.sol create mode 100644 tests/detectors/weak-prng/0.5.16/bad_prng.sol.0.5.16.BadPRNG.json create mode 100644 tests/detectors/weak-prng/0.6.11/bad_prng.sol create mode 100644 tests/detectors/weak-prng/0.6.11/bad_prng.sol.0.6.11.BadPRNG.json create mode 100644 tests/detectors/weak-prng/0.7.6/bad_prng.sol create mode 100644 tests/detectors/weak-prng/0.7.6/bad_prng.sol.0.7.6.BadPRNG.json diff --git a/tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol b/tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol similarity index 100% rename from tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol rename to tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol diff --git a/tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol.0.4.25.ABIEncoderV2Array.json b/tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol.0.4.25.ABIEncoderV2Array.json similarity index 92% rename from tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol.0.4.25.ABIEncoderV2Array.json rename to tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol.0.4.25.ABIEncoderV2Array.json index 5aad584064..5efc65c52a 100644 --- a/tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol.0.4.25.ABIEncoderV2Array.json +++ b/tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol.0.4.25.ABIEncoderV2Array.json @@ -4,19 +4,19 @@ "elements": [ { "type": "function", - "name": "bad3", + "name": "bad4", "source_mapping": { - "start": 1076, - "length": 154, + "start": 1296, + "length": 148, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 39, - 40, - 41 + 44, + 45, + 46 ], "starting_column": 3, "ending_column": 4 @@ -29,9 +29,9 @@ "start": 35, "length": 2982, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ 3, @@ -136,42 +136,42 @@ "ending_column": 2 } }, - "signature": "bad3()" + "signature": "bad4()" } }, { "type": "node", - "name": "b = abi.encode(s)", + "name": "event1_bad(bad_arr)", "source_mapping": { - "start": 1195, - "length": 30, + "start": 1415, + "length": 24, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 40 + 45 ], "starting_column": 5, - "ending_column": 35 + "ending_column": 29 }, "type_specific_fields": { "parent": { "type": "function", - "name": "bad3", + "name": "bad4", "source_mapping": { - "start": 1076, - "length": 154, + "start": 1296, + "length": 148, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 39, - 40, - 41 + 44, + 45, + 46 ], "starting_column": 3, "ending_column": 4 @@ -184,9 +184,9 @@ "start": 35, "length": 2982, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ 3, @@ -291,15 +291,15 @@ "ending_column": 2 } }, - "signature": "bad3()" + "signature": "bad4()" } } } } ], - "description": "Function A.bad3() (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#39-41) trigger an abi encoding bug:\n\t- b = abi.encode(s) (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#40)\n", - "markdown": "Function [A.bad3()](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L39-L41) trigger an abi encoding bug:\n\t- [b = abi.encode(s)](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L40)\n", - "id": "2052add742fb8dc3fa2c9ce9f9adcf8515d049c55f39f32a405ef0f6c29b9c7f", + "description": "Function A.bad4() (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#44-46) trigger an abi encoding bug:\n\t- event1_bad(bad_arr) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#45)\n", + "markdown": "Function [A.bad4()](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L44-L46) trigger an abi encoding bug:\n\t- [event1_bad(bad_arr)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L45)\n", + "id": "144c77aebb4037fe38c2864892ecb888a4fb7d5e92e321e664b2d2226658a166", "check": "abiencoderv2-array", "impact": "High", "confidence": "High" @@ -308,19 +308,19 @@ "elements": [ { "type": "function", - "name": "bad0", + "name": "bad3", "source_mapping": { - "start": 540, - "length": 61, + "start": 1076, + "length": 154, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 21, - 22, - 23 + 39, + 40, + 41 ], "starting_column": 3, "ending_column": 4 @@ -333,9 +333,9 @@ "start": 35, "length": 2982, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ 3, @@ -440,42 +440,42 @@ "ending_column": 2 } }, - "signature": "bad0()" + "signature": "bad3()" } }, { "type": "node", - "name": "this.bad0_external(bad_arr)", + "name": "b = abi.encode(s)", "source_mapping": { - "start": 569, - "length": 27, + "start": 1195, + "length": 30, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 22 + 40 ], "starting_column": 5, - "ending_column": 32 + "ending_column": 35 }, "type_specific_fields": { "parent": { "type": "function", - "name": "bad0", + "name": "bad3", "source_mapping": { - "start": 540, - "length": 61, + "start": 1076, + "length": 154, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 21, - 22, - 23 + 39, + 40, + 41 ], "starting_column": 3, "ending_column": 4 @@ -488,9 +488,9 @@ "start": 35, "length": 2982, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ 3, @@ -595,15 +595,15 @@ "ending_column": 2 } }, - "signature": "bad0()" + "signature": "bad3()" } } } } ], - "description": "Function A.bad0() (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#21-23) trigger an abi encoding bug:\n\t- this.bad0_external(bad_arr) (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#22)\n", - "markdown": "Function [A.bad0()](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L21-L23) trigger an abi encoding bug:\n\t- [this.bad0_external(bad_arr)](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L22)\n", - "id": "42e7d1c56e5298ef4ddfcc69b4e6119d356b34740cde285337501b656b0d2e04", + "description": "Function A.bad3() (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#39-41) trigger an abi encoding bug:\n\t- b = abi.encode(s) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#40)\n", + "markdown": "Function [A.bad3()](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L39-L41) trigger an abi encoding bug:\n\t- [b = abi.encode(s)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L40)\n", + "id": "0c50cf7f7b16d965ef04035beb09d25f3fa1fa4afeeb079ea42f2db879e8f1e9", "check": "abiencoderv2-array", "impact": "High", "confidence": "High" @@ -617,9 +617,9 @@ "start": 852, "length": 160, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ 34, @@ -637,9 +637,9 @@ "start": 35, "length": 2982, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ 3, @@ -754,9 +754,9 @@ "start": 971, "length": 36, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ 35 @@ -772,9 +772,9 @@ "start": 852, "length": 160, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ 34, @@ -792,9 +792,9 @@ "start": 35, "length": 2982, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ 3, @@ -905,9 +905,9 @@ } } ], - "description": "Function A.bad2() (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#34-36) trigger an abi encoding bug:\n\t- b = abi.encode(bad_arr) (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#35)\n", - "markdown": "Function [A.bad2()](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L34-L36) trigger an abi encoding bug:\n\t- [b = abi.encode(bad_arr)](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L35)\n", - "id": "767bd12bc81a7530972b0f2b069fb167efe0f2d6b6ec6d1b95aa39d1dd836a5d", + "description": "Function A.bad2() (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#34-36) trigger an abi encoding bug:\n\t- b = abi.encode(bad_arr) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#35)\n", + "markdown": "Function [A.bad2()](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L34-L36) trigger an abi encoding bug:\n\t- [b = abi.encode(bad_arr)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L35)\n", + "id": "d5860309d331920d1e3f44508fea706df75a4a7c2e93666ca96ca00ef32d7e01", "check": "abiencoderv2-array", "impact": "High", "confidence": "High" @@ -916,19 +916,19 @@ "elements": [ { "type": "function", - "name": "bad4", + "name": "bad0", "source_mapping": { - "start": 1296, - "length": 148, + "start": 540, + "length": 61, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 44, - 45, - 46 + 21, + 22, + 23 ], "starting_column": 3, "ending_column": 4 @@ -941,9 +941,9 @@ "start": 35, "length": 2982, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ 3, @@ -1048,42 +1048,42 @@ "ending_column": 2 } }, - "signature": "bad4()" + "signature": "bad0()" } }, { "type": "node", - "name": "event1_bad(bad_arr)", + "name": "this.bad0_external(bad_arr)", "source_mapping": { - "start": 1415, - "length": 24, + "start": 569, + "length": 27, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 45 + 22 ], "starting_column": 5, - "ending_column": 29 + "ending_column": 32 }, "type_specific_fields": { "parent": { "type": "function", - "name": "bad4", + "name": "bad0", "source_mapping": { - "start": 1296, - "length": 148, + "start": 540, + "length": 61, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 44, - 45, - 46 + 21, + 22, + 23 ], "starting_column": 3, "ending_column": 4 @@ -1096,9 +1096,9 @@ "start": 35, "length": 2982, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ 3, @@ -1203,15 +1203,15 @@ "ending_column": 2 } }, - "signature": "bad4()" + "signature": "bad0()" } } } } ], - "description": "Function A.bad4() (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#44-46) trigger an abi encoding bug:\n\t- event1_bad(bad_arr) (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#45)\n", - "markdown": "Function [A.bad4()](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L44-L46) trigger an abi encoding bug:\n\t- [event1_bad(bad_arr)](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L45)\n", - "id": "a0f90ebd7deb3917f2b20550e5edc7749a3459d075ada68b6422521732674f8c", + "description": "Function A.bad0() (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#21-23) trigger an abi encoding bug:\n\t- this.bad0_external(bad_arr) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#22)\n", + "markdown": "Function [A.bad0()](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L21-L23) trigger an abi encoding bug:\n\t- [this.bad0_external(bad_arr)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L22)\n", + "id": "3752da45df0ba78cc9ac01a10b398e4ad74e6ddd572764cf2f361e523a43a998", "check": "abiencoderv2-array", "impact": "High", "confidence": "High" @@ -1220,19 +1220,19 @@ "elements": [ { "type": "function", - "name": "bad1", + "name": "bad5", "source_mapping": { - "start": 726, - "length": 63, + "start": 1511, + "length": 142, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 29, - 30, - 31 + 49, + 50, + 51 ], "starting_column": 3, "ending_column": 4 @@ -1245,9 +1245,9 @@ "start": 35, "length": 2982, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ 3, @@ -1352,42 +1352,42 @@ "ending_column": 2 } }, - "signature": "bad1(A.S[3])" + "signature": "bad5()" } }, { "type": "node", - "name": "this.bad1_external(s)", + "name": "event2_bad(s)", "source_mapping": { - "start": 763, - "length": 21, + "start": 1630, + "length": 18, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 30 + 50 ], "starting_column": 5, - "ending_column": 26 + "ending_column": 23 }, "type_specific_fields": { "parent": { "type": "function", - "name": "bad1", + "name": "bad5", "source_mapping": { - "start": 726, - "length": 63, + "start": 1511, + "length": 142, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 29, - 30, - 31 + 49, + 50, + 51 ], "starting_column": 3, "ending_column": 4 @@ -1400,9 +1400,9 @@ "start": 35, "length": 2982, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ 3, @@ -1507,15 +1507,15 @@ "ending_column": 2 } }, - "signature": "bad1(A.S[3])" + "signature": "bad5()" } } } } ], - "description": "Function A.bad1(A.S[3]) (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#29-31) trigger an abi encoding bug:\n\t- this.bad1_external(s) (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#30)\n", - "markdown": "Function [A.bad1(A.S[3])](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L29-L31) trigger an abi encoding bug:\n\t- [this.bad1_external(s)](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L30)\n", - "id": "b57e7fe9f889943ab7d2d9879a1b13f52d3ed64db56ae2f14cbea6e8dafcd70b", + "description": "Function A.bad5() (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#49-51) trigger an abi encoding bug:\n\t- event2_bad(s) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#50)\n", + "markdown": "Function [A.bad5()](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L49-L51) trigger an abi encoding bug:\n\t- [event2_bad(s)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L50)\n", + "id": "e77767c95f4548636027a859ca0c63402cfb50af242f116dd3cfc5b038a4128e", "check": "abiencoderv2-array", "impact": "High", "confidence": "High" @@ -1524,19 +1524,19 @@ "elements": [ { "type": "function", - "name": "bad5", + "name": "bad1", "source_mapping": { - "start": 1511, - "length": 142, + "start": 726, + "length": 63, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 49, - 50, - 51 + 29, + 30, + 31 ], "starting_column": 3, "ending_column": 4 @@ -1549,9 +1549,9 @@ "start": 35, "length": 2982, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ 3, @@ -1656,42 +1656,42 @@ "ending_column": 2 } }, - "signature": "bad5()" + "signature": "bad1(A.S[3])" } }, { "type": "node", - "name": "event2_bad(s)", + "name": "this.bad1_external(s)", "source_mapping": { - "start": 1630, - "length": 18, + "start": 763, + "length": 21, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 50 + 30 ], "starting_column": 5, - "ending_column": 23 + "ending_column": 26 }, "type_specific_fields": { "parent": { "type": "function", - "name": "bad5", + "name": "bad1", "source_mapping": { - "start": 1511, - "length": 142, + "start": 726, + "length": 63, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 49, - 50, - 51 + 29, + 30, + 31 ], "starting_column": 3, "ending_column": 4 @@ -1704,9 +1704,9 @@ "start": 35, "length": 2982, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ 3, @@ -1811,15 +1811,15 @@ "ending_column": 2 } }, - "signature": "bad5()" + "signature": "bad1(A.S[3])" } } } } ], - "description": "Function A.bad5() (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#49-51) trigger an abi encoding bug:\n\t- event2_bad(s) (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#50)\n", - "markdown": "Function [A.bad5()](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L49-L51) trigger an abi encoding bug:\n\t- [event2_bad(s)](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L50)\n", - "id": "1bb85eee97769e9220dcde2102945a4a66fb96f01f789049334828e9f002aef5", + "description": "Function A.bad1(A.S[3]) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#29-31) trigger an abi encoding bug:\n\t- this.bad1_external(s) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#30)\n", + "markdown": "Function [A.bad1(A.S[3])](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L29-L31) trigger an abi encoding bug:\n\t- [this.bad1_external(s)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L30)\n", + "id": "3febdd98f71332c80290c9557c5ef89ea9dbea4f520a084b0307f21b00da5010", "check": "abiencoderv2-array", "impact": "High", "confidence": "High" diff --git a/tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol b/tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol new file mode 100644 index 0000000000..4c3eed8aa4 --- /dev/null +++ b/tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol @@ -0,0 +1,99 @@ +pragma experimental ABIEncoderV2; + +contract A { + + struct S { + uint i; + } + + uint[2][3] bad_arr = [[1, 2], [3, 4], [5, 6]]; + uint[3] good_arr = [1, 2, 3]; + S[3] s; + + event event1_bad(uint[2][3] bad_arr); + event event1_good(uint[3] good_arr); + event event2_bad(S[3] s); + + function bad0_external(uint [2][3] calldata arr1) external { + } + + /* Array of arrays passed to an external function is vulnerable */ + function bad0() public { + this.bad0_external(bad_arr); + } + + function bad1_external (S[3] calldata s1) external { + } + + /* Array of structs passed to an external function is vulnerable */ + function bad1 (S[3] memory s1) public { + this.bad1_external(s); + } + + /* Array of arrays passed to abi.encode is vulnerable */ + function bad2() public { + bytes memory b = abi.encode(bad_arr); + } + + /* Array of structs passed to abi.encode is vulnerable */ + function bad3() public { + bytes memory b = abi.encode(s); + } + + /* Array of arrays passed to an event emit is vulnerable */ + function bad4() public { + emit event1_bad(bad_arr); + } + + /* Array of structs passed to an event emit is vulnerable */ + function bad5() public { + emit event2_bad(s); + } + + function good0_public (uint[2][3] memory arr1) public { + } + + /* Array of arrays passed to a public function is benign */ + function good0() public { + good0_public(bad_arr); + } + + function good1_public (S[3] memory s1) public { + } + + /* Array of structs passed to a public function is benign */ + function good1 (S[3] memory s1) public { + good1_public(s); + } + + /* Array of arrays in-memory passed to abi.encode is benign */ + function good2() public { + uint8 [2][3] memory bad_arr_mem = [[1, 2], [3, 4], [5, 6]]; + bytes memory b = abi.encode(bad_arr_mem); + } + + /* Array of structs in-memory passed to abi.encode is benign */ + function good3() public { + S[3] memory s_mem; + bytes memory b = abi.encode(s_mem); + } + + function good4_external(uint[3] calldata arr1) external { + } + + /* Array of elementary types passed to external function is benign */ + function good4() public { + this.good4_external(good_arr); + } + + /* Array of elementary types passed to abi.encode is benign */ + function good5() public { + bytes memory b = abi.encode(good_arr); + } + + /* Array of elementary types passed to event emit is benign */ + function good6() public { + emit event1_good(good_arr); + } + +} diff --git a/tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol.0.5.10.ABIEncoderV2Array.json b/tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol.0.5.10.ABIEncoderV2Array.json new file mode 100644 index 0000000000..1616cc0e48 --- /dev/null +++ b/tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol.0.5.10.ABIEncoderV2Array.json @@ -0,0 +1,1828 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad4", + "source_mapping": { + "start": 1321, + "length": 148, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 44, + 45, + 46 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 35, + "length": 3044, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97, + 98, + 99 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad4()" + } + }, + { + "type": "node", + "name": "event1_bad(bad_arr)", + "source_mapping": { + "start": 1440, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 45 + ], + "starting_column": 5, + "ending_column": 29 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad4", + "source_mapping": { + "start": 1321, + "length": 148, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 44, + 45, + 46 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 35, + "length": 3044, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97, + 98, + 99 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad4()" + } + } + } + } + ], + "description": "Function A.bad4() (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#44-46) trigger an abi encoding bug:\n\t- event1_bad(bad_arr) (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#45)\n", + "markdown": "Function [A.bad4()](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L44-L46) trigger an abi encoding bug:\n\t- [event1_bad(bad_arr)](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L45)\n", + "id": "41b64698d5678d4095816d22b2d431371ca18801800bcf35b077e2675724a4e6", + "check": "abiencoderv2-array", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 549, + "length": 61, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 35, + "length": 3044, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97, + 98, + 99 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + }, + { + "type": "node", + "name": "this.bad0_external(bad_arr)", + "source_mapping": { + "start": 578, + "length": 27, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 22 + ], + "starting_column": 5, + "ending_column": 32 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 549, + "length": 61, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 35, + "length": 3044, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97, + 98, + 99 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + } + } + ], + "description": "Function A.bad0() (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#21-23) trigger an abi encoding bug:\n\t- this.bad0_external(bad_arr) (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#22)\n", + "markdown": "Function [A.bad0()](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L21-L23) trigger an abi encoding bug:\n\t- [this.bad0_external(bad_arr)](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L22)\n", + "id": "f9335a48cb948e294b54605d1c63d61e863a824f3346be2db07c923896aafac0", + "check": "abiencoderv2-array", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad5", + "source_mapping": { + "start": 1536, + "length": 142, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 49, + 50, + 51 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 35, + "length": 3044, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97, + 98, + 99 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad5()" + } + }, + { + "type": "node", + "name": "event2_bad(s)", + "source_mapping": { + "start": 1655, + "length": 18, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 50 + ], + "starting_column": 5, + "ending_column": 23 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad5", + "source_mapping": { + "start": 1536, + "length": 142, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 49, + 50, + 51 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 35, + "length": 3044, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97, + 98, + 99 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad5()" + } + } + } + } + ], + "description": "Function A.bad5() (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#49-51) trigger an abi encoding bug:\n\t- event2_bad(s) (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#50)\n", + "markdown": "Function [A.bad5()](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L49-L51) trigger an abi encoding bug:\n\t- [event2_bad(s)](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L50)\n", + "id": "eeb6e1300bf8056da088cb4f3e2703471fee9fdca73774ce3643fb884954d216", + "check": "abiencoderv2-array", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 877, + "length": 160, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 34, + 35, + 36 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 35, + "length": 3044, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97, + 98, + 99 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + }, + { + "type": "node", + "name": "b = abi.encode(bad_arr)", + "source_mapping": { + "start": 996, + "length": 36, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 35 + ], + "starting_column": 5, + "ending_column": 41 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 877, + "length": 160, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 34, + 35, + 36 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 35, + "length": 3044, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97, + 98, + 99 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + } + } + } + ], + "description": "Function A.bad2() (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#34-36) trigger an abi encoding bug:\n\t- b = abi.encode(bad_arr) (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#35)\n", + "markdown": "Function [A.bad2()](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L34-L36) trigger an abi encoding bug:\n\t- [b = abi.encode(bad_arr)](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L35)\n", + "id": "fb8e8ba854095891e3a490b43b126215858286a4a59902e7c63394a83befab0b", + "check": "abiencoderv2-array", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad3", + "source_mapping": { + "start": 1101, + "length": 154, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 39, + 40, + 41 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 35, + "length": 3044, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97, + 98, + 99 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad3()" + } + }, + { + "type": "node", + "name": "b = abi.encode(s)", + "source_mapping": { + "start": 1220, + "length": 30, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 40 + ], + "starting_column": 5, + "ending_column": 35 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad3", + "source_mapping": { + "start": 1101, + "length": 154, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 39, + 40, + 41 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 35, + "length": 3044, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97, + 98, + 99 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad3()" + } + } + } + } + ], + "description": "Function A.bad3() (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#39-41) trigger an abi encoding bug:\n\t- b = abi.encode(s) (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#40)\n", + "markdown": "Function [A.bad3()](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L39-L41) trigger an abi encoding bug:\n\t- [b = abi.encode(s)](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L40)\n", + "id": "3bda232f70109507c2cc575917cb69423e6d045e3b1d084ef881a411f54b2069", + "check": "abiencoderv2-array", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 744, + "length": 70, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 29, + 30, + 31 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 35, + "length": 3044, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97, + 98, + 99 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(A.S[3])" + } + }, + { + "type": "node", + "name": "this.bad1_external(s)", + "source_mapping": { + "start": 788, + "length": 21, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 30 + ], + "starting_column": 5, + "ending_column": 26 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 744, + "length": 70, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 29, + 30, + 31 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 35, + "length": 3044, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97, + 98, + 99 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(A.S[3])" + } + } + } + } + ], + "description": "Function A.bad1(A.S[3]) (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#29-31) trigger an abi encoding bug:\n\t- this.bad1_external(s) (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#30)\n", + "markdown": "Function [A.bad1(A.S[3])](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L29-L31) trigger an abi encoding bug:\n\t- [this.bad1_external(s)](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L30)\n", + "id": "e432c7633b89e67459b76c1265a299e59fe6a651edd8888067df47200840451d", + "check": "abiencoderv2-array", + "impact": "High", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/abiencoderv2-array/0.5.11/storage_ABIEncoderV2_array.sol b/tests/detectors/abiencoderv2-array/0.5.11/storage_ABIEncoderV2_array.sol new file mode 100644 index 0000000000..17f30eed93 --- /dev/null +++ b/tests/detectors/abiencoderv2-array/0.5.11/storage_ABIEncoderV2_array.sol @@ -0,0 +1,99 @@ +pragma experimental ABIEncoderV2; + +contract A { + + struct S { + uint i; + } + + uint[2][3] bad_arr = [[1, 2], [3, 4], [5, 6]]; + uint[3] good_arr = [1, 2, 3]; + S[3] s; + + event event1_bad(uint[2][3] bad_arr); + event event1_good(uint[3] good_arr); + event event2_bad(S[3] s); + + function good7_external(uint [2][3] calldata arr1) external { + } + + /* Array of arrays passed to an external function is vulnerable */ + function good7() public { + this.good7_external(bad_arr); + } + + function good8_external (S[3] calldata s1) external { + } + + /* Array of structs passed to an external function is vulnerable */ + function good8 (S[3] memory s1) public { + this.good8_external(s); + } + + /* Array of arrays passed to abi.encode is vulnerable */ + function good9() public { + bytes memory b = abi.encode(bad_arr); + } + + /* Array of structs passed to abi.encode is vulnerable */ + function good10() public { + bytes memory b = abi.encode(s); + } + + /* Array of arrays passed to an event emit is vulnerable */ + function good11() public { + emit event1_bad(bad_arr); + } + + /* Array of structs passed to an event emit is vulnerable */ + function good12() public { + emit event2_bad(s); + } + + function good0_public (uint[2][3] memory arr1) public { + } + + /* Array of arrays passed to a public function is benign */ + function good0() public { + good0_public(bad_arr); + } + + function good1_public (S[3] memory s1) public { + } + + /* Array of structs passed to a public function is benign */ + function good1 (S[3] memory s1) public { + good1_public(s); + } + + /* Array of arrays in-memory passed to abi.encode is benign */ + function good2() public { + uint8 [2][3] memory bad_arr_mem = [[1, 2], [3, 4], [5, 6]]; + bytes memory b = abi.encode(bad_arr_mem); + } + + /* Array of structs in-memory passed to abi.encode is benign */ + function good3() public { + S[3] memory s_mem; + bytes memory b = abi.encode(s_mem); + } + + function good4_external(uint[3] calldata arr1) external { + } + + /* Array of elementary types passed to external function is benign */ + function good4() public { + this.good4_external(good_arr); + } + + /* Array of elementary types passed to abi.encode is benign */ + function good5() public { + bytes memory b = abi.encode(good_arr); + } + + /* Array of elementary types passed to event emit is benign */ + function good6() public { + emit event1_good(good_arr); + } + +} diff --git a/tests/detectors/constant/constant-0.5.1.sol.0.5.1.ConstantFunctionsAsm.json b/tests/detectors/abiencoderv2-array/0.5.11/storage_ABIEncoderV2_array.sol.0.5.11.ABIEncoderV2Array.json similarity index 100% rename from tests/detectors/constant/constant-0.5.1.sol.0.5.1.ConstantFunctionsAsm.json rename to tests/detectors/abiencoderv2-array/0.5.11/storage_ABIEncoderV2_array.sol.0.5.11.ABIEncoderV2Array.json diff --git a/tests/detectors/arbitrary-send/arbitrary_send.sol b/tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol similarity index 100% rename from tests/detectors/arbitrary-send/arbitrary_send.sol rename to tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol diff --git a/tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol.0.4.25.ArbitrarySend.json b/tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol.0.4.25.ArbitrarySend.json new file mode 100644 index 0000000000..9e1130404e --- /dev/null +++ b/tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol.0.4.25.ArbitrarySend.json @@ -0,0 +1,388 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "direct", + "source_mapping": { + "start": 147, + "length": 79, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 0, + "length": 869, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "direct()" + } + }, + { + "type": "node", + "name": "msg.sender.send(address(this).balance)", + "source_mapping": { + "start": 181, + "length": 38, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 9, + "ending_column": 47 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "direct", + "source_mapping": { + "start": 147, + "length": 79, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 0, + "length": 869, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "direct()" + } + } + } + } + ], + "description": "Test.direct() (tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol#11-13) sends eth to arbitrary user\n\tDangerous calls:\n\t- msg.sender.send(address(this).balance) (tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol#12)\n", + "markdown": "[Test.direct()](tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol#L11-L13) sends eth to arbitrary user\n\tDangerous calls:\n\t- [msg.sender.send(address(this).balance)](tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol#L12)\n", + "id": "477cc1ab9fa3d2263400e47d09146eaed3e478f5eecf7856b59d49a2a5093a1c", + "check": "arbitrary-send", + "impact": "High", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "indirect", + "source_mapping": { + "start": 301, + "length": 82, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 19, + 20, + 21 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 0, + "length": 869, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "indirect()" + } + }, + { + "type": "node", + "name": "destination.send(address(this).balance)", + "source_mapping": { + "start": 337, + "length": 39, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 20 + ], + "starting_column": 9, + "ending_column": 48 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "indirect", + "source_mapping": { + "start": 301, + "length": 82, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 19, + 20, + 21 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 0, + "length": 869, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "indirect()" + } + } + } + } + ], + "description": "Test.indirect() (tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol#19-21) sends eth to arbitrary user\n\tDangerous calls:\n\t- destination.send(address(this).balance) (tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol#20)\n", + "markdown": "[Test.indirect()](tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol#L19-L21) sends eth to arbitrary user\n\tDangerous calls:\n\t- [destination.send(address(this).balance)](tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol#L20)\n", + "id": "4759805615df746a3d8a6c068ce885d2c18c46edf411f83ae004593958caafe7", + "check": "arbitrary-send", + "impact": "High", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol b/tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol similarity index 100% rename from tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol rename to tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol diff --git a/tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol.0.5.16.ArbitrarySend.json b/tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol.0.5.16.ArbitrarySend.json new file mode 100644 index 0000000000..870a5ed67e --- /dev/null +++ b/tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol.0.5.16.ArbitrarySend.json @@ -0,0 +1,388 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "direct", + "source_mapping": { + "start": 162, + "length": 79, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 0, + "length": 884, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "direct()" + } + }, + { + "type": "node", + "name": "msg.sender.send(address(this).balance)", + "source_mapping": { + "start": 196, + "length": 38, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 9, + "ending_column": 47 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "direct", + "source_mapping": { + "start": 162, + "length": 79, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 0, + "length": 884, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "direct()" + } + } + } + } + ], + "description": "Test.direct() (tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol#11-13) sends eth to arbitrary user\n\tDangerous calls:\n\t- msg.sender.send(address(this).balance) (tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol#12)\n", + "markdown": "[Test.direct()](tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol#L11-L13) sends eth to arbitrary user\n\tDangerous calls:\n\t- [msg.sender.send(address(this).balance)](tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol#L12)\n", + "id": "9531cafd91af4d7b54f22fa933dae983077df1c51bd855c2516ffee812911f43", + "check": "arbitrary-send", + "impact": "High", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "indirect", + "source_mapping": { + "start": 316, + "length": 82, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 19, + 20, + 21 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 0, + "length": 884, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "indirect()" + } + }, + { + "type": "node", + "name": "destination.send(address(this).balance)", + "source_mapping": { + "start": 352, + "length": 39, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 20 + ], + "starting_column": 9, + "ending_column": 48 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "indirect", + "source_mapping": { + "start": 316, + "length": 82, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 19, + 20, + 21 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 0, + "length": 884, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "indirect()" + } + } + } + } + ], + "description": "Test.indirect() (tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol#19-21) sends eth to arbitrary user\n\tDangerous calls:\n\t- destination.send(address(this).balance) (tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol#20)\n", + "markdown": "[Test.indirect()](tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol#L19-L21) sends eth to arbitrary user\n\tDangerous calls:\n\t- [destination.send(address(this).balance)](tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol#L20)\n", + "id": "f1395ebf21de9f8fb2c5d254c5990cce55b239c05a6a5e074813f58c6cd32834", + "check": "arbitrary-send", + "impact": "High", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol b/tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol new file mode 100644 index 0000000000..9a0c743c48 --- /dev/null +++ b/tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol @@ -0,0 +1,41 @@ +contract Test{ + + address payable destination; + + mapping (address => uint) balances; + + constructor() public{ + balances[msg.sender] = 0; + } + + function direct() public{ + msg.sender.send(address(this).balance); + } + + function init() public{ + destination = msg.sender; + } + + function indirect() public{ + destination.send(address(this).balance); + } + + // these are legitimate calls + // and should not be detected + function repay() payable public{ + msg.sender.transfer(msg.value); + } + + function withdraw() public{ + uint val = balances[msg.sender]; + msg.sender.send(val); + } + + function buy() payable public{ + uint value_send = msg.value; + uint value_spent = 0 ; // simulate a buy of tokens + uint remaining = value_send - value_spent; + msg.sender.send(remaining); +} + +} diff --git a/tests/detectors/arbitrary-send/arbitrary_send.sol.0.4.25.ArbitrarySend.json b/tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol.0.4.25.ArbitrarySend.json similarity index 100% rename from tests/detectors/arbitrary-send/arbitrary_send.sol.0.4.25.ArbitrarySend.json rename to tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol.0.4.25.ArbitrarySend.json diff --git a/tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol.0.6.11.ArbitrarySend.json b/tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol.0.6.11.ArbitrarySend.json new file mode 100644 index 0000000000..a51b72abdb --- /dev/null +++ b/tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol.0.6.11.ArbitrarySend.json @@ -0,0 +1,388 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "direct", + "source_mapping": { + "start": 162, + "length": 79, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 0, + "length": 884, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "direct()" + } + }, + { + "type": "node", + "name": "msg.sender.send(address(this).balance)", + "source_mapping": { + "start": 196, + "length": 38, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 9, + "ending_column": 47 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "direct", + "source_mapping": { + "start": 162, + "length": 79, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 0, + "length": 884, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "direct()" + } + } + } + } + ], + "description": "Test.direct() (tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol#11-13) sends eth to arbitrary user\n\tDangerous calls:\n\t- msg.sender.send(address(this).balance) (tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol#12)\n", + "markdown": "[Test.direct()](tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol#L11-L13) sends eth to arbitrary user\n\tDangerous calls:\n\t- [msg.sender.send(address(this).balance)](tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol#L12)\n", + "id": "8a1de239f630f10fef9ef6a9c439fc10aad2f6caba7ee43d1a7f7bacf6028f1e", + "check": "arbitrary-send", + "impact": "High", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "indirect", + "source_mapping": { + "start": 316, + "length": 82, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 19, + 20, + 21 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 0, + "length": 884, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "indirect()" + } + }, + { + "type": "node", + "name": "destination.send(address(this).balance)", + "source_mapping": { + "start": 352, + "length": 39, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 20 + ], + "starting_column": 9, + "ending_column": 48 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "indirect", + "source_mapping": { + "start": 316, + "length": 82, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 19, + 20, + 21 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 0, + "length": 884, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "indirect()" + } + } + } + } + ], + "description": "Test.indirect() (tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol#19-21) sends eth to arbitrary user\n\tDangerous calls:\n\t- destination.send(address(this).balance) (tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol#20)\n", + "markdown": "[Test.indirect()](tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol#L19-L21) sends eth to arbitrary user\n\tDangerous calls:\n\t- [destination.send(address(this).balance)](tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol#L20)\n", + "id": "f272e05d9741895fc22051ed09afa6ce4af8ad4cd74b3452224dfb29eb4b9df6", + "check": "arbitrary-send", + "impact": "High", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol b/tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol new file mode 100644 index 0000000000..9a0c743c48 --- /dev/null +++ b/tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol @@ -0,0 +1,41 @@ +contract Test{ + + address payable destination; + + mapping (address => uint) balances; + + constructor() public{ + balances[msg.sender] = 0; + } + + function direct() public{ + msg.sender.send(address(this).balance); + } + + function init() public{ + destination = msg.sender; + } + + function indirect() public{ + destination.send(address(this).balance); + } + + // these are legitimate calls + // and should not be detected + function repay() payable public{ + msg.sender.transfer(msg.value); + } + + function withdraw() public{ + uint val = balances[msg.sender]; + msg.sender.send(val); + } + + function buy() payable public{ + uint value_send = msg.value; + uint value_spent = 0 ; // simulate a buy of tokens + uint remaining = value_send - value_spent; + msg.sender.send(remaining); +} + +} diff --git a/tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol.0.5.1.ArbitrarySend.json b/tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol.0.7.6.ArbitrarySend.json similarity index 91% rename from tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol.0.5.1.ArbitrarySend.json rename to tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol.0.7.6.ArbitrarySend.json index 2d5442d5a5..f2b630eb69 100644 --- a/tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol.0.5.1.ArbitrarySend.json +++ b/tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol.0.7.6.ArbitrarySend.json @@ -9,9 +9,9 @@ "start": 162, "length": 79, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol", + "filename_relative": "tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol", + "filename_short": "tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol", "is_dependency": false, "lines": [ 11, @@ -29,9 +29,9 @@ "start": 0, "length": 884, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol", + "filename_relative": "tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol", + "filename_short": "tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol", "is_dependency": false, "lines": [ 1, @@ -90,9 +90,9 @@ "start": 196, "length": 38, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol", + "filename_relative": "tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol", + "filename_short": "tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol", "is_dependency": false, "lines": [ 12 @@ -108,9 +108,9 @@ "start": 162, "length": 79, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol", + "filename_relative": "tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol", + "filename_short": "tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol", "is_dependency": false, "lines": [ 11, @@ -128,9 +128,9 @@ "start": 0, "length": 884, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol", + "filename_relative": "tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol", + "filename_short": "tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol", "is_dependency": false, "lines": [ 1, @@ -185,9 +185,9 @@ } } ], - "description": "Test.direct() (tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol#11-13) sends eth to arbitrary user\n\tDangerous calls:\n\t- msg.sender.send(address(this).balance) (tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol#12)\n", - "markdown": "[Test.direct()](tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol#L11-L13) sends eth to arbitrary user\n\tDangerous calls:\n\t- [msg.sender.send(address(this).balance)](tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol#L12)\n", - "id": "f541c43a03086c95960bfcf05b8d4941008505120331df11a91d0187dc4640c5", + "description": "Test.direct() (tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol#11-13) sends eth to arbitrary user\n\tDangerous calls:\n\t- msg.sender.send(address(this).balance) (tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol#12)\n", + "markdown": "[Test.direct()](tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol#L11-L13) sends eth to arbitrary user\n\tDangerous calls:\n\t- [msg.sender.send(address(this).balance)](tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol#L12)\n", + "id": "90d9178119fb586af18c2298136d7f1af4d33a9b702b94d2ca0fcdbe6ee783c6", "check": "arbitrary-send", "impact": "High", "confidence": "Medium" @@ -201,9 +201,9 @@ "start": 316, "length": 82, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol", + "filename_relative": "tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol", + "filename_short": "tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol", "is_dependency": false, "lines": [ 19, @@ -221,9 +221,9 @@ "start": 0, "length": 884, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol", + "filename_relative": "tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol", + "filename_short": "tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol", "is_dependency": false, "lines": [ 1, @@ -282,9 +282,9 @@ "start": 352, "length": 39, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol", + "filename_relative": "tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol", + "filename_short": "tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol", "is_dependency": false, "lines": [ 20 @@ -300,9 +300,9 @@ "start": 316, "length": 82, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol", + "filename_relative": "tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol", + "filename_short": "tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol", "is_dependency": false, "lines": [ 19, @@ -320,9 +320,9 @@ "start": 0, "length": 884, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol", + "filename_relative": "tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol", + "filename_short": "tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol", "is_dependency": false, "lines": [ 1, @@ -377,9 +377,9 @@ } } ], - "description": "Test.indirect() (tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol#19-21) sends eth to arbitrary user\n\tDangerous calls:\n\t- destination.send(address(this).balance) (tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol#20)\n", - "markdown": "[Test.indirect()](tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol#L19-L21) sends eth to arbitrary user\n\tDangerous calls:\n\t- [destination.send(address(this).balance)](tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol#L20)\n", - "id": "6399c3b0638ef3e8fb62de3d7ad760649d315b03ebdf5a11d2674970f12452d9", + "description": "Test.indirect() (tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol#19-21) sends eth to arbitrary user\n\tDangerous calls:\n\t- destination.send(address(this).balance) (tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol#20)\n", + "markdown": "[Test.indirect()](tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol#L19-L21) sends eth to arbitrary user\n\tDangerous calls:\n\t- [destination.send(address(this).balance)](tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol#L20)\n", + "id": "3bf41470de6f5fec21d1da5741e7d63ee1d3b63cfd2646d697274f4495e3f1a9", "check": "arbitrary-send", "impact": "High", "confidence": "Medium" diff --git a/tests/detectors/array-by-reference/array_by_reference.sol b/tests/detectors/array-by-reference/0.4.25/array_by_reference.sol similarity index 100% rename from tests/detectors/array-by-reference/array_by_reference.sol rename to tests/detectors/array-by-reference/0.4.25/array_by_reference.sol diff --git a/tests/detectors/array-by-reference/array_by_reference.sol.0.4.25.ArrayByReference.json b/tests/detectors/array-by-reference/0.4.25/array_by_reference.sol.0.4.25.ArrayByReference.json similarity index 88% rename from tests/detectors/array-by-reference/array_by_reference.sol.0.4.25.ArrayByReference.json rename to tests/detectors/array-by-reference/0.4.25/array_by_reference.sol.0.4.25.ArrayByReference.json index ecbba2da3b..322f54fb9e 100644 --- a/tests/detectors/array-by-reference/array_by_reference.sol.0.4.25.ArrayByReference.json +++ b/tests/detectors/array-by-reference/0.4.25/array_by_reference.sol.0.4.25.ArrayByReference.json @@ -9,9 +9,9 @@ "start": 40, "length": 167, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 4, @@ -31,9 +31,9 @@ "start": 0, "length": 686, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 1, @@ -80,9 +80,9 @@ "start": 17, "length": 16, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 2 @@ -98,9 +98,9 @@ "start": 0, "length": 686, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 1, @@ -146,9 +146,9 @@ "start": 498, "length": 67, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 21, @@ -166,9 +166,9 @@ "start": 0, "length": 686, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 1, @@ -209,8 +209,8 @@ } } ], - "description": "C.f() (tests/detectors/array-by-reference/array_by_reference.sol#4-8) passes array C.x (tests/detectors/array-by-reference/array_by_reference.sol#2)by reference to C.setByValue(uint256[1]) (tests/detectors/array-by-reference/array_by_reference.sol#21-23)which only takes arrays by value\n", - "markdown": "[C.f()](tests/detectors/array-by-reference/array_by_reference.sol#L4-L8) passes array [C.x](tests/detectors/array-by-reference/array_by_reference.sol#L2)by reference to [C.setByValue(uint256[1])](tests/detectors/array-by-reference/array_by_reference.sol#L21-L23)which only takes arrays by value\n", + "description": "C.f() (tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#4-8) passes array C.x (tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#2)by reference to C.setByValue(uint256[1]) (tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#21-23)which only takes arrays by value\n", + "markdown": "[C.f()](tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#L4-L8) passes array [C.x](tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#L2)by reference to [C.setByValue(uint256[1])](tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#L21-L23)which only takes arrays by value\n", "id": "79a462bf06ae529ad099f2170100298da30766fcc06884e03436d2b53110d208", "check": "array-by-reference", "impact": "High", @@ -225,9 +225,9 @@ "start": 40, "length": 167, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 4, @@ -247,9 +247,9 @@ "start": 0, "length": 686, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 1, @@ -296,9 +296,9 @@ "start": 17, "length": 16, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 2 @@ -314,9 +314,9 @@ "start": 0, "length": 686, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 1, @@ -362,9 +362,9 @@ "start": 571, "length": 113, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 25, @@ -383,9 +383,9 @@ "start": 0, "length": 686, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 1, @@ -426,8 +426,8 @@ } } ], - "description": "C.f() (tests/detectors/array-by-reference/array_by_reference.sol#4-8) passes array C.x (tests/detectors/array-by-reference/array_by_reference.sol#2)by reference to C.setByValueAndReturn(uint256[1]) (tests/detectors/array-by-reference/array_by_reference.sol#25-28)which only takes arrays by value\n", - "markdown": "[C.f()](tests/detectors/array-by-reference/array_by_reference.sol#L4-L8) passes array [C.x](tests/detectors/array-by-reference/array_by_reference.sol#L2)by reference to [C.setByValueAndReturn(uint256[1])](tests/detectors/array-by-reference/array_by_reference.sol#L25-L28)which only takes arrays by value\n", + "description": "C.f() (tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#4-8) passes array C.x (tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#2)by reference to C.setByValueAndReturn(uint256[1]) (tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#25-28)which only takes arrays by value\n", + "markdown": "[C.f()](tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#L4-L8) passes array [C.x](tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#L2)by reference to [C.setByValueAndReturn(uint256[1])](tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#L25-L28)which only takes arrays by value\n", "id": "7f1eda9be40002affd2e8e31d172d3ee3374f37b1106118c79f4add7a133bbd0", "check": "array-by-reference", "impact": "High", @@ -442,9 +442,9 @@ "start": 213, "length": 198, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 10, @@ -465,9 +465,9 @@ "start": 0, "length": 686, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 1, @@ -514,9 +514,9 @@ "start": 243, "length": 21, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 11 @@ -532,9 +532,9 @@ "start": 213, "length": 198, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 10, @@ -555,9 +555,9 @@ "start": 0, "length": 686, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 1, @@ -606,9 +606,9 @@ "start": 498, "length": 67, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 21, @@ -626,9 +626,9 @@ "start": 0, "length": 686, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 1, @@ -669,8 +669,8 @@ } } ], - "description": "C.g() (tests/detectors/array-by-reference/array_by_reference.sol#10-15) passes array C.g().y (tests/detectors/array-by-reference/array_by_reference.sol#11)by reference to C.setByValue(uint256[1]) (tests/detectors/array-by-reference/array_by_reference.sol#21-23)which only takes arrays by value\n", - "markdown": "[C.g()](tests/detectors/array-by-reference/array_by_reference.sol#L10-L15) passes array [C.g().y](tests/detectors/array-by-reference/array_by_reference.sol#L11)by reference to [C.setByValue(uint256[1])](tests/detectors/array-by-reference/array_by_reference.sol#L21-L23)which only takes arrays by value\n", + "description": "C.g() (tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#10-15) passes array C.g().y (tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#11)by reference to C.setByValue(uint256[1]) (tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#21-23)which only takes arrays by value\n", + "markdown": "[C.g()](tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#L10-L15) passes array [C.g().y](tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#L11)by reference to [C.setByValue(uint256[1])](tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#L21-L23)which only takes arrays by value\n", "id": "d039169712808e785bf2e53f322c1c6fcd6b93a0a0c17f1a701addd09ed83996", "check": "array-by-reference", "impact": "High", @@ -685,9 +685,9 @@ "start": 213, "length": 198, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 10, @@ -708,9 +708,9 @@ "start": 0, "length": 686, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 1, @@ -757,9 +757,9 @@ "start": 243, "length": 21, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 11 @@ -775,9 +775,9 @@ "start": 213, "length": 198, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 10, @@ -798,9 +798,9 @@ "start": 0, "length": 686, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 1, @@ -849,9 +849,9 @@ "start": 571, "length": 113, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 25, @@ -870,9 +870,9 @@ "start": 0, "length": 686, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 1, @@ -913,8 +913,8 @@ } } ], - "description": "C.g() (tests/detectors/array-by-reference/array_by_reference.sol#10-15) passes array C.g().y (tests/detectors/array-by-reference/array_by_reference.sol#11)by reference to C.setByValueAndReturn(uint256[1]) (tests/detectors/array-by-reference/array_by_reference.sol#25-28)which only takes arrays by value\n", - "markdown": "[C.g()](tests/detectors/array-by-reference/array_by_reference.sol#L10-L15) passes array [C.g().y](tests/detectors/array-by-reference/array_by_reference.sol#L11)by reference to [C.setByValueAndReturn(uint256[1])](tests/detectors/array-by-reference/array_by_reference.sol#L25-L28)which only takes arrays by value\n", + "description": "C.g() (tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#10-15) passes array C.g().y (tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#11)by reference to C.setByValueAndReturn(uint256[1]) (tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#25-28)which only takes arrays by value\n", + "markdown": "[C.g()](tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#L10-L15) passes array [C.g().y](tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#L11)by reference to [C.setByValueAndReturn(uint256[1])](tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#L25-L28)which only takes arrays by value\n", "id": "8655e8acd84a6e8152acd2d9730ea0dfdda0723e09b2dcbfdbbeb8da8bd04fa5", "check": "array-by-reference", "impact": "High", @@ -929,9 +929,9 @@ "start": 855, "length": 269, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 42, @@ -953,9 +953,9 @@ "start": 688, "length": 440, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 31, @@ -995,9 +995,9 @@ "start": 822, "length": 9, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 39 @@ -1013,9 +1013,9 @@ "start": 688, "length": 440, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 31, @@ -1054,9 +1054,9 @@ "start": 498, "length": 67, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 21, @@ -1074,9 +1074,9 @@ "start": 0, "length": 686, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 1, @@ -1117,8 +1117,8 @@ } } ], - "description": "D.f() (tests/detectors/array-by-reference/array_by_reference.sol#42-48) passes array D.x (tests/detectors/array-by-reference/array_by_reference.sol#39)by reference to C.setByValue(uint256[1]) (tests/detectors/array-by-reference/array_by_reference.sol#21-23)which only takes arrays by value\n", - "markdown": "[D.f()](tests/detectors/array-by-reference/array_by_reference.sol#L42-L48) passes array [D.x](tests/detectors/array-by-reference/array_by_reference.sol#L39)by reference to [C.setByValue(uint256[1])](tests/detectors/array-by-reference/array_by_reference.sol#L21-L23)which only takes arrays by value\n", + "description": "D.f() (tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#42-48) passes array D.x (tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#39)by reference to C.setByValue(uint256[1]) (tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#21-23)which only takes arrays by value\n", + "markdown": "[D.f()](tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#L42-L48) passes array [D.x](tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#L39)by reference to [C.setByValue(uint256[1])](tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#L21-L23)which only takes arrays by value\n", "id": "1520955a53c36e391abbaf648a91a5a12d432f0f4746b0a8187d0988a6a66846", "check": "array-by-reference", "impact": "High", @@ -1133,9 +1133,9 @@ "start": 855, "length": 269, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 42, @@ -1157,9 +1157,9 @@ "start": 688, "length": 440, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 31, @@ -1199,9 +1199,9 @@ "start": 822, "length": 9, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 39 @@ -1217,9 +1217,9 @@ "start": 688, "length": 440, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 31, @@ -1258,9 +1258,9 @@ "start": 571, "length": 113, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 25, @@ -1279,9 +1279,9 @@ "start": 0, "length": 686, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_relative": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/array-by-reference/array_by_reference.sol", + "filename_short": "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "is_dependency": false, "lines": [ 1, @@ -1322,8 +1322,8 @@ } } ], - "description": "D.f() (tests/detectors/array-by-reference/array_by_reference.sol#42-48) passes array D.x (tests/detectors/array-by-reference/array_by_reference.sol#39)by reference to C.setByValueAndReturn(uint256[1]) (tests/detectors/array-by-reference/array_by_reference.sol#25-28)which only takes arrays by value\n", - "markdown": "[D.f()](tests/detectors/array-by-reference/array_by_reference.sol#L42-L48) passes array [D.x](tests/detectors/array-by-reference/array_by_reference.sol#L39)by reference to [C.setByValueAndReturn(uint256[1])](tests/detectors/array-by-reference/array_by_reference.sol#L25-L28)which only takes arrays by value\n", + "description": "D.f() (tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#42-48) passes array D.x (tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#39)by reference to C.setByValueAndReturn(uint256[1]) (tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#25-28)which only takes arrays by value\n", + "markdown": "[D.f()](tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#L42-L48) passes array [D.x](tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#L39)by reference to [C.setByValueAndReturn(uint256[1])](tests/detectors/array-by-reference/0.4.25/array_by_reference.sol#L25-L28)which only takes arrays by value\n", "id": "019912974eabe7e8b1e67ca05b342e5106de13fa93fa0adf599a4259c425bd54", "check": "array-by-reference", "impact": "High", diff --git a/tests/detectors/array-by-reference/0.5.16/array_by_reference.sol b/tests/detectors/array-by-reference/0.5.16/array_by_reference.sol new file mode 100644 index 0000000000..c477c6b0e1 --- /dev/null +++ b/tests/detectors/array-by-reference/0.5.16/array_by_reference.sol @@ -0,0 +1,51 @@ +contract C { + uint[1] public x; + + function f() public { + setByRef(x); // can set x. + setByValue(x); // cannot set x. + uint test = 1 + setByValueAndReturn(x); // cannot set x. + } + + function g() public { + uint[1] storage y = x; + setByRef(y); // can set y. + setByValue(y); // cannot set y. + uint test = 1 + setByValueAndReturn(y); // cannot set y. + } + + function setByRef(uint[1] storage arr) internal { + arr[0] = 1; + } + + function setByValue(uint[1] memory arr) public { + arr[0] = 2; + } + + function setByValueAndReturn(uint[1] memory arr) public returns(uint) { + arr[0] = 2; + return arr[0]; + } +} + +contract D { + // Struct definition + struct TestStruct { + uint[1] x; + } + + // State Variables + TestStruct ts; + uint[1] x; + + // Functions + function f() public { + C c = new C(); + c.setByValue(ts.x); // cannot set x. + uint test = 1 + c.setByValueAndReturn(ts.x); // cannot set x. + c.setByValue(x); // cannot set x. + test = 1 + c.setByValueAndReturn(x); // cannot set x. + } + + +} \ No newline at end of file diff --git a/tests/detectors/array-by-reference/0.5.16/array_by_reference.sol.0.5.16.ArrayByReference.json b/tests/detectors/array-by-reference/0.5.16/array_by_reference.sol.0.5.16.ArrayByReference.json new file mode 100644 index 0000000000..185922283c --- /dev/null +++ b/tests/detectors/array-by-reference/0.5.16/array_by_reference.sol.0.5.16.ArrayByReference.json @@ -0,0 +1,1333 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "f", + "source_mapping": { + "start": 40, + "length": 167, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6, + 7, + 8 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + }, + { + "type": "variable", + "name": "x", + "source_mapping": { + "start": 17, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 2 + ], + "starting_column": 5, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "function", + "name": "setByValue", + "source_mapping": { + "start": 498, + "length": 74, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "setByValue(uint256[1])" + } + } + ], + "description": "C.f() (tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#4-8) passes array C.x (tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#2)by reference to C.setByValue(uint256[1]) (tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#21-23)which only takes arrays by value\n", + "markdown": "[C.f()](tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#L4-L8) passes array [C.x](tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#L2)by reference to [C.setByValue(uint256[1])](tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#L21-L23)which only takes arrays by value\n", + "id": "79a462bf06ae529ad099f2170100298da30766fcc06884e03436d2b53110d208", + "check": "array-by-reference", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "f", + "source_mapping": { + "start": 40, + "length": 167, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6, + 7, + 8 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + }, + { + "type": "variable", + "name": "x", + "source_mapping": { + "start": 17, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 2 + ], + "starting_column": 5, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "function", + "name": "setByValueAndReturn", + "source_mapping": { + "start": 578, + "length": 120, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 25, + 26, + 27, + 28 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "setByValueAndReturn(uint256[1])" + } + } + ], + "description": "C.f() (tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#4-8) passes array C.x (tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#2)by reference to C.setByValueAndReturn(uint256[1]) (tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#25-28)which only takes arrays by value\n", + "markdown": "[C.f()](tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#L4-L8) passes array [C.x](tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#L2)by reference to [C.setByValueAndReturn(uint256[1])](tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#L25-L28)which only takes arrays by value\n", + "id": "7f1eda9be40002affd2e8e31d172d3ee3374f37b1106118c79f4add7a133bbd0", + "check": "array-by-reference", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "g", + "source_mapping": { + "start": 213, + "length": 198, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "g()" + } + }, + { + "type": "variable", + "name": "y", + "source_mapping": { + "start": 243, + "length": 21, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 11 + ], + "starting_column": 9, + "ending_column": 30 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "g", + "source_mapping": { + "start": 213, + "length": 198, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "g()" + } + } + } + }, + { + "type": "function", + "name": "setByValue", + "source_mapping": { + "start": 498, + "length": 74, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "setByValue(uint256[1])" + } + } + ], + "description": "C.g() (tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#10-15) passes array C.g().y (tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#11)by reference to C.setByValue(uint256[1]) (tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#21-23)which only takes arrays by value\n", + "markdown": "[C.g()](tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#L10-L15) passes array [C.g().y](tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#L11)by reference to [C.setByValue(uint256[1])](tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#L21-L23)which only takes arrays by value\n", + "id": "d039169712808e785bf2e53f322c1c6fcd6b93a0a0c17f1a701addd09ed83996", + "check": "array-by-reference", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "g", + "source_mapping": { + "start": 213, + "length": 198, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "g()" + } + }, + { + "type": "variable", + "name": "y", + "source_mapping": { + "start": 243, + "length": 21, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 11 + ], + "starting_column": 9, + "ending_column": 30 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "g", + "source_mapping": { + "start": 213, + "length": 198, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "g()" + } + } + } + }, + { + "type": "function", + "name": "setByValueAndReturn", + "source_mapping": { + "start": 578, + "length": 120, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 25, + 26, + 27, + 28 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "setByValueAndReturn(uint256[1])" + } + } + ], + "description": "C.g() (tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#10-15) passes array C.g().y (tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#11)by reference to C.setByValueAndReturn(uint256[1]) (tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#25-28)which only takes arrays by value\n", + "markdown": "[C.g()](tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#L10-L15) passes array [C.g().y](tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#L11)by reference to [C.setByValueAndReturn(uint256[1])](tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#L25-L28)which only takes arrays by value\n", + "id": "8655e8acd84a6e8152acd2d9730ea0dfdda0723e09b2dcbfdbbeb8da8bd04fa5", + "check": "array-by-reference", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "f", + "source_mapping": { + "start": 869, + "length": 269, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 42, + 43, + 44, + 45, + 46, + 47, + 48 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "D", + "source_mapping": { + "start": 702, + "length": 440, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "f()" + } + }, + { + "type": "variable", + "name": "x", + "source_mapping": { + "start": 836, + "length": 9, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 39 + ], + "starting_column": 5, + "ending_column": 14 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "D", + "source_mapping": { + "start": 702, + "length": 440, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 0 + } + } + } + }, + { + "type": "function", + "name": "setByValue", + "source_mapping": { + "start": 498, + "length": 74, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "setByValue(uint256[1])" + } + } + ], + "description": "D.f() (tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#42-48) passes array D.x (tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#39)by reference to C.setByValue(uint256[1]) (tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#21-23)which only takes arrays by value\n", + "markdown": "[D.f()](tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#L42-L48) passes array [D.x](tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#L39)by reference to [C.setByValue(uint256[1])](tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#L21-L23)which only takes arrays by value\n", + "id": "1520955a53c36e391abbaf648a91a5a12d432f0f4746b0a8187d0988a6a66846", + "check": "array-by-reference", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "f", + "source_mapping": { + "start": 869, + "length": 269, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 42, + 43, + 44, + 45, + 46, + 47, + 48 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "D", + "source_mapping": { + "start": 702, + "length": 440, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "f()" + } + }, + { + "type": "variable", + "name": "x", + "source_mapping": { + "start": 836, + "length": 9, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 39 + ], + "starting_column": 5, + "ending_column": 14 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "D", + "source_mapping": { + "start": 702, + "length": 440, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 0 + } + } + } + }, + { + "type": "function", + "name": "setByValueAndReturn", + "source_mapping": { + "start": 578, + "length": 120, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 25, + 26, + 27, + 28 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "setByValueAndReturn(uint256[1])" + } + } + ], + "description": "D.f() (tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#42-48) passes array D.x (tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#39)by reference to C.setByValueAndReturn(uint256[1]) (tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#25-28)which only takes arrays by value\n", + "markdown": "[D.f()](tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#L42-L48) passes array [D.x](tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#L39)by reference to [C.setByValueAndReturn(uint256[1])](tests/detectors/array-by-reference/0.5.16/array_by_reference.sol#L25-L28)which only takes arrays by value\n", + "id": "019912974eabe7e8b1e67ca05b342e5106de13fa93fa0adf599a4259c425bd54", + "check": "array-by-reference", + "impact": "High", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/array-by-reference/0.6.11/array_by_reference.sol b/tests/detectors/array-by-reference/0.6.11/array_by_reference.sol new file mode 100644 index 0000000000..c477c6b0e1 --- /dev/null +++ b/tests/detectors/array-by-reference/0.6.11/array_by_reference.sol @@ -0,0 +1,51 @@ +contract C { + uint[1] public x; + + function f() public { + setByRef(x); // can set x. + setByValue(x); // cannot set x. + uint test = 1 + setByValueAndReturn(x); // cannot set x. + } + + function g() public { + uint[1] storage y = x; + setByRef(y); // can set y. + setByValue(y); // cannot set y. + uint test = 1 + setByValueAndReturn(y); // cannot set y. + } + + function setByRef(uint[1] storage arr) internal { + arr[0] = 1; + } + + function setByValue(uint[1] memory arr) public { + arr[0] = 2; + } + + function setByValueAndReturn(uint[1] memory arr) public returns(uint) { + arr[0] = 2; + return arr[0]; + } +} + +contract D { + // Struct definition + struct TestStruct { + uint[1] x; + } + + // State Variables + TestStruct ts; + uint[1] x; + + // Functions + function f() public { + C c = new C(); + c.setByValue(ts.x); // cannot set x. + uint test = 1 + c.setByValueAndReturn(ts.x); // cannot set x. + c.setByValue(x); // cannot set x. + test = 1 + c.setByValueAndReturn(x); // cannot set x. + } + + +} \ No newline at end of file diff --git a/tests/detectors/array-by-reference/0.6.11/array_by_reference.sol.0.6.11.ArrayByReference.json b/tests/detectors/array-by-reference/0.6.11/array_by_reference.sol.0.6.11.ArrayByReference.json new file mode 100644 index 0000000000..6e9fdeb42c --- /dev/null +++ b/tests/detectors/array-by-reference/0.6.11/array_by_reference.sol.0.6.11.ArrayByReference.json @@ -0,0 +1,1333 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "f", + "source_mapping": { + "start": 40, + "length": 167, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6, + 7, + 8 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + }, + { + "type": "variable", + "name": "x", + "source_mapping": { + "start": 17, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 2 + ], + "starting_column": 5, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "function", + "name": "setByValue", + "source_mapping": { + "start": 498, + "length": 74, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "setByValue(uint256[1])" + } + } + ], + "description": "C.f() (tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#4-8) passes array C.x (tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#2)by reference to C.setByValue(uint256[1]) (tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#21-23)which only takes arrays by value\n", + "markdown": "[C.f()](tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#L4-L8) passes array [C.x](tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#L2)by reference to [C.setByValue(uint256[1])](tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#L21-L23)which only takes arrays by value\n", + "id": "79a462bf06ae529ad099f2170100298da30766fcc06884e03436d2b53110d208", + "check": "array-by-reference", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "f", + "source_mapping": { + "start": 40, + "length": 167, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6, + 7, + 8 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + }, + { + "type": "variable", + "name": "x", + "source_mapping": { + "start": 17, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 2 + ], + "starting_column": 5, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "function", + "name": "setByValueAndReturn", + "source_mapping": { + "start": 578, + "length": 120, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 25, + 26, + 27, + 28 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "setByValueAndReturn(uint256[1])" + } + } + ], + "description": "C.f() (tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#4-8) passes array C.x (tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#2)by reference to C.setByValueAndReturn(uint256[1]) (tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#25-28)which only takes arrays by value\n", + "markdown": "[C.f()](tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#L4-L8) passes array [C.x](tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#L2)by reference to [C.setByValueAndReturn(uint256[1])](tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#L25-L28)which only takes arrays by value\n", + "id": "7f1eda9be40002affd2e8e31d172d3ee3374f37b1106118c79f4add7a133bbd0", + "check": "array-by-reference", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "g", + "source_mapping": { + "start": 213, + "length": 198, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "g()" + } + }, + { + "type": "variable", + "name": "y", + "source_mapping": { + "start": 243, + "length": 21, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 11 + ], + "starting_column": 9, + "ending_column": 30 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "g", + "source_mapping": { + "start": 213, + "length": 198, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "g()" + } + } + } + }, + { + "type": "function", + "name": "setByValue", + "source_mapping": { + "start": 498, + "length": 74, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "setByValue(uint256[1])" + } + } + ], + "description": "C.g() (tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#10-15) passes array C.g().y (tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#11)by reference to C.setByValue(uint256[1]) (tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#21-23)which only takes arrays by value\n", + "markdown": "[C.g()](tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#L10-L15) passes array [C.g().y](tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#L11)by reference to [C.setByValue(uint256[1])](tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#L21-L23)which only takes arrays by value\n", + "id": "d039169712808e785bf2e53f322c1c6fcd6b93a0a0c17f1a701addd09ed83996", + "check": "array-by-reference", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "g", + "source_mapping": { + "start": 213, + "length": 198, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "g()" + } + }, + { + "type": "variable", + "name": "y", + "source_mapping": { + "start": 243, + "length": 21, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 11 + ], + "starting_column": 9, + "ending_column": 30 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "g", + "source_mapping": { + "start": 213, + "length": 198, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "g()" + } + } + } + }, + { + "type": "function", + "name": "setByValueAndReturn", + "source_mapping": { + "start": 578, + "length": 120, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 25, + 26, + 27, + 28 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "setByValueAndReturn(uint256[1])" + } + } + ], + "description": "C.g() (tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#10-15) passes array C.g().y (tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#11)by reference to C.setByValueAndReturn(uint256[1]) (tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#25-28)which only takes arrays by value\n", + "markdown": "[C.g()](tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#L10-L15) passes array [C.g().y](tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#L11)by reference to [C.setByValueAndReturn(uint256[1])](tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#L25-L28)which only takes arrays by value\n", + "id": "8655e8acd84a6e8152acd2d9730ea0dfdda0723e09b2dcbfdbbeb8da8bd04fa5", + "check": "array-by-reference", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "f", + "source_mapping": { + "start": 869, + "length": 269, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 42, + 43, + 44, + 45, + 46, + 47, + 48 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "D", + "source_mapping": { + "start": 702, + "length": 440, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "f()" + } + }, + { + "type": "variable", + "name": "x", + "source_mapping": { + "start": 836, + "length": 9, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 39 + ], + "starting_column": 5, + "ending_column": 14 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "D", + "source_mapping": { + "start": 702, + "length": 440, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 0 + } + } + } + }, + { + "type": "function", + "name": "setByValue", + "source_mapping": { + "start": 498, + "length": 74, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "setByValue(uint256[1])" + } + } + ], + "description": "D.f() (tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#42-48) passes array D.x (tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#39)by reference to C.setByValue(uint256[1]) (tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#21-23)which only takes arrays by value\n", + "markdown": "[D.f()](tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#L42-L48) passes array [D.x](tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#L39)by reference to [C.setByValue(uint256[1])](tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#L21-L23)which only takes arrays by value\n", + "id": "1520955a53c36e391abbaf648a91a5a12d432f0f4746b0a8187d0988a6a66846", + "check": "array-by-reference", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "f", + "source_mapping": { + "start": 869, + "length": 269, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 42, + 43, + 44, + 45, + 46, + 47, + 48 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "D", + "source_mapping": { + "start": 702, + "length": 440, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "f()" + } + }, + { + "type": "variable", + "name": "x", + "source_mapping": { + "start": 836, + "length": 9, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 39 + ], + "starting_column": 5, + "ending_column": 14 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "D", + "source_mapping": { + "start": 702, + "length": 440, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 0 + } + } + } + }, + { + "type": "function", + "name": "setByValueAndReturn", + "source_mapping": { + "start": 578, + "length": 120, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 25, + 26, + 27, + 28 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "setByValueAndReturn(uint256[1])" + } + } + ], + "description": "D.f() (tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#42-48) passes array D.x (tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#39)by reference to C.setByValueAndReturn(uint256[1]) (tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#25-28)which only takes arrays by value\n", + "markdown": "[D.f()](tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#L42-L48) passes array [D.x](tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#L39)by reference to [C.setByValueAndReturn(uint256[1])](tests/detectors/array-by-reference/0.6.11/array_by_reference.sol#L25-L28)which only takes arrays by value\n", + "id": "019912974eabe7e8b1e67ca05b342e5106de13fa93fa0adf599a4259c425bd54", + "check": "array-by-reference", + "impact": "High", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/array-by-reference/0.7.6/array_by_reference.sol b/tests/detectors/array-by-reference/0.7.6/array_by_reference.sol new file mode 100644 index 0000000000..c477c6b0e1 --- /dev/null +++ b/tests/detectors/array-by-reference/0.7.6/array_by_reference.sol @@ -0,0 +1,51 @@ +contract C { + uint[1] public x; + + function f() public { + setByRef(x); // can set x. + setByValue(x); // cannot set x. + uint test = 1 + setByValueAndReturn(x); // cannot set x. + } + + function g() public { + uint[1] storage y = x; + setByRef(y); // can set y. + setByValue(y); // cannot set y. + uint test = 1 + setByValueAndReturn(y); // cannot set y. + } + + function setByRef(uint[1] storage arr) internal { + arr[0] = 1; + } + + function setByValue(uint[1] memory arr) public { + arr[0] = 2; + } + + function setByValueAndReturn(uint[1] memory arr) public returns(uint) { + arr[0] = 2; + return arr[0]; + } +} + +contract D { + // Struct definition + struct TestStruct { + uint[1] x; + } + + // State Variables + TestStruct ts; + uint[1] x; + + // Functions + function f() public { + C c = new C(); + c.setByValue(ts.x); // cannot set x. + uint test = 1 + c.setByValueAndReturn(ts.x); // cannot set x. + c.setByValue(x); // cannot set x. + test = 1 + c.setByValueAndReturn(x); // cannot set x. + } + + +} \ No newline at end of file diff --git a/tests/detectors/array-by-reference/0.7.6/array_by_reference.sol.0.7.6.ArrayByReference.json b/tests/detectors/array-by-reference/0.7.6/array_by_reference.sol.0.7.6.ArrayByReference.json new file mode 100644 index 0000000000..356a84b954 --- /dev/null +++ b/tests/detectors/array-by-reference/0.7.6/array_by_reference.sol.0.7.6.ArrayByReference.json @@ -0,0 +1,1333 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "f", + "source_mapping": { + "start": 40, + "length": 167, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6, + 7, + 8 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + }, + { + "type": "variable", + "name": "x", + "source_mapping": { + "start": 17, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 2 + ], + "starting_column": 5, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "function", + "name": "setByValue", + "source_mapping": { + "start": 498, + "length": 74, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "setByValue(uint256[1])" + } + } + ], + "description": "C.f() (tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#4-8) passes array C.x (tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#2)by reference to C.setByValue(uint256[1]) (tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#21-23)which only takes arrays by value\n", + "markdown": "[C.f()](tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#L4-L8) passes array [C.x](tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#L2)by reference to [C.setByValue(uint256[1])](tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#L21-L23)which only takes arrays by value\n", + "id": "79a462bf06ae529ad099f2170100298da30766fcc06884e03436d2b53110d208", + "check": "array-by-reference", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "f", + "source_mapping": { + "start": 40, + "length": 167, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6, + 7, + 8 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + }, + { + "type": "variable", + "name": "x", + "source_mapping": { + "start": 17, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 2 + ], + "starting_column": 5, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "function", + "name": "setByValueAndReturn", + "source_mapping": { + "start": 578, + "length": 120, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 25, + 26, + 27, + 28 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "setByValueAndReturn(uint256[1])" + } + } + ], + "description": "C.f() (tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#4-8) passes array C.x (tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#2)by reference to C.setByValueAndReturn(uint256[1]) (tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#25-28)which only takes arrays by value\n", + "markdown": "[C.f()](tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#L4-L8) passes array [C.x](tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#L2)by reference to [C.setByValueAndReturn(uint256[1])](tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#L25-L28)which only takes arrays by value\n", + "id": "7f1eda9be40002affd2e8e31d172d3ee3374f37b1106118c79f4add7a133bbd0", + "check": "array-by-reference", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "g", + "source_mapping": { + "start": 213, + "length": 198, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "g()" + } + }, + { + "type": "variable", + "name": "y", + "source_mapping": { + "start": 243, + "length": 21, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 11 + ], + "starting_column": 9, + "ending_column": 30 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "g", + "source_mapping": { + "start": 213, + "length": 198, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "g()" + } + } + } + }, + { + "type": "function", + "name": "setByValue", + "source_mapping": { + "start": 498, + "length": 74, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "setByValue(uint256[1])" + } + } + ], + "description": "C.g() (tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#10-15) passes array C.g().y (tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#11)by reference to C.setByValue(uint256[1]) (tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#21-23)which only takes arrays by value\n", + "markdown": "[C.g()](tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#L10-L15) passes array [C.g().y](tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#L11)by reference to [C.setByValue(uint256[1])](tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#L21-L23)which only takes arrays by value\n", + "id": "d039169712808e785bf2e53f322c1c6fcd6b93a0a0c17f1a701addd09ed83996", + "check": "array-by-reference", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "g", + "source_mapping": { + "start": 213, + "length": 198, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "g()" + } + }, + { + "type": "variable", + "name": "y", + "source_mapping": { + "start": 243, + "length": 21, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 11 + ], + "starting_column": 9, + "ending_column": 30 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "g", + "source_mapping": { + "start": 213, + "length": 198, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "g()" + } + } + } + }, + { + "type": "function", + "name": "setByValueAndReturn", + "source_mapping": { + "start": 578, + "length": 120, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 25, + 26, + 27, + 28 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "setByValueAndReturn(uint256[1])" + } + } + ], + "description": "C.g() (tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#10-15) passes array C.g().y (tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#11)by reference to C.setByValueAndReturn(uint256[1]) (tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#25-28)which only takes arrays by value\n", + "markdown": "[C.g()](tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#L10-L15) passes array [C.g().y](tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#L11)by reference to [C.setByValueAndReturn(uint256[1])](tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#L25-L28)which only takes arrays by value\n", + "id": "8655e8acd84a6e8152acd2d9730ea0dfdda0723e09b2dcbfdbbeb8da8bd04fa5", + "check": "array-by-reference", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "f", + "source_mapping": { + "start": 869, + "length": 269, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 42, + 43, + 44, + 45, + 46, + 47, + 48 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "D", + "source_mapping": { + "start": 702, + "length": 440, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "f()" + } + }, + { + "type": "variable", + "name": "x", + "source_mapping": { + "start": 836, + "length": 9, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 39 + ], + "starting_column": 5, + "ending_column": 14 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "D", + "source_mapping": { + "start": 702, + "length": 440, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 0 + } + } + } + }, + { + "type": "function", + "name": "setByValue", + "source_mapping": { + "start": 498, + "length": 74, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "setByValue(uint256[1])" + } + } + ], + "description": "D.f() (tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#42-48) passes array D.x (tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#39)by reference to C.setByValue(uint256[1]) (tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#21-23)which only takes arrays by value\n", + "markdown": "[D.f()](tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#L42-L48) passes array [D.x](tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#L39)by reference to [C.setByValue(uint256[1])](tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#L21-L23)which only takes arrays by value\n", + "id": "1520955a53c36e391abbaf648a91a5a12d432f0f4746b0a8187d0988a6a66846", + "check": "array-by-reference", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "f", + "source_mapping": { + "start": 869, + "length": 269, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 42, + 43, + 44, + 45, + 46, + 47, + 48 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "D", + "source_mapping": { + "start": 702, + "length": 440, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "f()" + } + }, + { + "type": "variable", + "name": "x", + "source_mapping": { + "start": 836, + "length": 9, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 39 + ], + "starting_column": 5, + "ending_column": 14 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "D", + "source_mapping": { + "start": 702, + "length": 440, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 0 + } + } + } + }, + { + "type": "function", + "name": "setByValueAndReturn", + "source_mapping": { + "start": 578, + "length": 120, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 25, + 26, + 27, + 28 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 700, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "setByValueAndReturn(uint256[1])" + } + } + ], + "description": "D.f() (tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#42-48) passes array D.x (tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#39)by reference to C.setByValueAndReturn(uint256[1]) (tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#25-28)which only takes arrays by value\n", + "markdown": "[D.f()](tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#L42-L48) passes array [D.x](tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#L39)by reference to [C.setByValueAndReturn(uint256[1])](tests/detectors/array-by-reference/0.7.6/array_by_reference.sol#L25-L28)which only takes arrays by value\n", + "id": "019912974eabe7e8b1e67ca05b342e5106de13fa93fa0adf599a4259c425bd54", + "check": "array-by-reference", + "impact": "High", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/assembly/inline_assembly_contract.sol b/tests/detectors/assembly/0.4.25/inline_assembly_contract.sol similarity index 100% rename from tests/detectors/assembly/inline_assembly_contract.sol rename to tests/detectors/assembly/0.4.25/inline_assembly_contract.sol diff --git a/tests/detectors/assembly/inline_assembly_contract.sol.0.4.25.Assembly.json b/tests/detectors/assembly/0.4.25/inline_assembly_contract.sol.0.4.25.Assembly.json similarity index 89% rename from tests/detectors/assembly/inline_assembly_contract.sol.0.4.25.Assembly.json rename to tests/detectors/assembly/0.4.25/inline_assembly_contract.sol.0.4.25.Assembly.json index 36e35794ee..ce12d64612 100644 --- a/tests/detectors/assembly/inline_assembly_contract.sol.0.4.25.Assembly.json +++ b/tests/detectors/assembly/0.4.25/inline_assembly_contract.sol.0.4.25.Assembly.json @@ -9,9 +9,9 @@ "start": 119, "length": 700, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_contract.sol", + "filename_relative": "tests/detectors/assembly/0.4.25/inline_assembly_contract.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_contract.sol", + "filename_short": "tests/detectors/assembly/0.4.25/inline_assembly_contract.sol", "is_dependency": false, "lines": [ 6, @@ -41,9 +41,9 @@ "start": 97, "length": 724, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_contract.sol", + "filename_relative": "tests/detectors/assembly/0.4.25/inline_assembly_contract.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_contract.sol", + "filename_short": "tests/detectors/assembly/0.4.25/inline_assembly_contract.sol", "is_dependency": false, "lines": [ 5, @@ -78,9 +78,9 @@ "start": 191, "length": 628, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_contract.sol", + "filename_relative": "tests/detectors/assembly/0.4.25/inline_assembly_contract.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_contract.sol", + "filename_short": "tests/detectors/assembly/0.4.25/inline_assembly_contract.sol", "is_dependency": false, "lines": [ 7, @@ -109,9 +109,9 @@ "start": 119, "length": 700, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_contract.sol", + "filename_relative": "tests/detectors/assembly/0.4.25/inline_assembly_contract.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_contract.sol", + "filename_short": "tests/detectors/assembly/0.4.25/inline_assembly_contract.sol", "is_dependency": false, "lines": [ 6, @@ -141,9 +141,9 @@ "start": 97, "length": 724, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_contract.sol", + "filename_relative": "tests/detectors/assembly/0.4.25/inline_assembly_contract.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_contract.sol", + "filename_short": "tests/detectors/assembly/0.4.25/inline_assembly_contract.sol", "is_dependency": false, "lines": [ 5, @@ -174,9 +174,9 @@ } } ], - "description": "GetCode.at(address) (tests/detectors/assembly/inline_assembly_contract.sol#6-20) uses assembly\n\t- INLINE ASM (tests/detectors/assembly/inline_assembly_contract.sol#7-20)\n", - "markdown": "[GetCode.at(address)](tests/detectors/assembly/inline_assembly_contract.sol#L6-L20) uses assembly\n\t- [INLINE ASM](tests/detectors/assembly/inline_assembly_contract.sol#L7-L20)\n", - "id": "076a663af9edac0ed5fd4b04bb521be77206cde70d71f430b80d13896d7ad54d", + "description": "GetCode.at(address) (tests/detectors/assembly/0.4.25/inline_assembly_contract.sol#6-20) uses assembly\n\t- INLINE ASM (tests/detectors/assembly/0.4.25/inline_assembly_contract.sol#7-20)\n", + "markdown": "[GetCode.at(address)](tests/detectors/assembly/0.4.25/inline_assembly_contract.sol#L6-L20) uses assembly\n\t- [INLINE ASM](tests/detectors/assembly/0.4.25/inline_assembly_contract.sol#L7-L20)\n", + "id": "37ca62e9af93d1648d3a1aa845426ec5395eab836277e3a8baa52621bf1df7c3", "check": "assembly", "impact": "Informational", "confidence": "High" diff --git a/tests/detectors/assembly/inline_assembly_library.sol b/tests/detectors/assembly/0.4.25/inline_assembly_library.sol similarity index 100% rename from tests/detectors/assembly/inline_assembly_library.sol rename to tests/detectors/assembly/0.4.25/inline_assembly_library.sol diff --git a/tests/detectors/assembly/inline_assembly_library.sol.0.4.25.Assembly.json b/tests/detectors/assembly/0.4.25/inline_assembly_library.sol.0.4.25.Assembly.json similarity index 91% rename from tests/detectors/assembly/inline_assembly_library.sol.0.4.25.Assembly.json rename to tests/detectors/assembly/0.4.25/inline_assembly_library.sol.0.4.25.Assembly.json index 7438f7d371..828a2eb70a 100644 --- a/tests/detectors/assembly/inline_assembly_library.sol.0.4.25.Assembly.json +++ b/tests/detectors/assembly/0.4.25/inline_assembly_library.sol.0.4.25.Assembly.json @@ -9,9 +9,9 @@ "start": 593, "length": 247, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_library.sol", + "filename_relative": "tests/detectors/assembly/0.4.25/inline_assembly_library.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_library.sol", + "filename_short": "tests/detectors/assembly/0.4.25/inline_assembly_library.sol", "is_dependency": false, "lines": [ 16, @@ -33,9 +33,9 @@ "start": 98, "length": 1581, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_library.sol", + "filename_relative": "tests/detectors/assembly/0.4.25/inline_assembly_library.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_library.sol", + "filename_short": "tests/detectors/assembly/0.4.25/inline_assembly_library.sol", "is_dependency": false, "lines": [ 5, @@ -97,9 +97,9 @@ "start": 720, "length": 114, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_library.sol", + "filename_relative": "tests/detectors/assembly/0.4.25/inline_assembly_library.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_library.sol", + "filename_short": "tests/detectors/assembly/0.4.25/inline_assembly_library.sol", "is_dependency": false, "lines": [ 18, @@ -118,9 +118,9 @@ "start": 593, "length": 247, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_library.sol", + "filename_relative": "tests/detectors/assembly/0.4.25/inline_assembly_library.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_library.sol", + "filename_short": "tests/detectors/assembly/0.4.25/inline_assembly_library.sol", "is_dependency": false, "lines": [ 16, @@ -142,9 +142,9 @@ "start": 98, "length": 1581, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_library.sol", + "filename_relative": "tests/detectors/assembly/0.4.25/inline_assembly_library.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_library.sol", + "filename_short": "tests/detectors/assembly/0.4.25/inline_assembly_library.sol", "is_dependency": false, "lines": [ 5, @@ -202,9 +202,9 @@ } } ], - "description": "VectorSum.sumAsm(uint256[]) (tests/detectors/assembly/inline_assembly_library.sol#16-22) uses assembly\n\t- INLINE ASM (tests/detectors/assembly/inline_assembly_library.sol#18-21)\n", - "markdown": "[VectorSum.sumAsm(uint256[])](tests/detectors/assembly/inline_assembly_library.sol#L16-L22) uses assembly\n\t- [INLINE ASM](tests/detectors/assembly/inline_assembly_library.sol#L18-L21)\n", - "id": "bb3664625e0b8ea9d3b3a564687e6ec0b403f90fe433eae80801a31e51a390b6", + "description": "VectorSum.sumAsm(uint256[]) (tests/detectors/assembly/0.4.25/inline_assembly_library.sol#16-22) uses assembly\n\t- INLINE ASM (tests/detectors/assembly/0.4.25/inline_assembly_library.sol#18-21)\n", + "markdown": "[VectorSum.sumAsm(uint256[])](tests/detectors/assembly/0.4.25/inline_assembly_library.sol#L16-L22) uses assembly\n\t- [INLINE ASM](tests/detectors/assembly/0.4.25/inline_assembly_library.sol#L18-L21)\n", + "id": "7009ef6498fa29901fbf3e9e1971a19f6fa48c87be3b2592c632e05a4321e1d3", "check": "assembly", "impact": "Informational", "confidence": "High" @@ -218,9 +218,9 @@ "start": 923, "length": 754, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_library.sol", + "filename_relative": "tests/detectors/assembly/0.4.25/inline_assembly_library.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_library.sol", + "filename_short": "tests/detectors/assembly/0.4.25/inline_assembly_library.sol", "is_dependency": false, "lines": [ 25, @@ -258,9 +258,9 @@ "start": 98, "length": 1581, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_library.sol", + "filename_relative": "tests/detectors/assembly/0.4.25/inline_assembly_library.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_library.sol", + "filename_short": "tests/detectors/assembly/0.4.25/inline_assembly_library.sol", "is_dependency": false, "lines": [ 5, @@ -322,9 +322,9 @@ "start": 1000, "length": 677, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_library.sol", + "filename_relative": "tests/detectors/assembly/0.4.25/inline_assembly_library.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_library.sol", + "filename_short": "tests/detectors/assembly/0.4.25/inline_assembly_library.sol", "is_dependency": false, "lines": [ 26, @@ -361,9 +361,9 @@ "start": 923, "length": 754, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_library.sol", + "filename_relative": "tests/detectors/assembly/0.4.25/inline_assembly_library.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_library.sol", + "filename_short": "tests/detectors/assembly/0.4.25/inline_assembly_library.sol", "is_dependency": false, "lines": [ 25, @@ -401,9 +401,9 @@ "start": 98, "length": 1581, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_library.sol", + "filename_relative": "tests/detectors/assembly/0.4.25/inline_assembly_library.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_library.sol", + "filename_short": "tests/detectors/assembly/0.4.25/inline_assembly_library.sol", "is_dependency": false, "lines": [ 5, @@ -461,9 +461,9 @@ } } ], - "description": "VectorSum.sumPureAsm(uint256[]) (tests/detectors/assembly/inline_assembly_library.sol#25-47) uses assembly\n\t- INLINE ASM (tests/detectors/assembly/inline_assembly_library.sol#26-47)\n", - "markdown": "[VectorSum.sumPureAsm(uint256[])](tests/detectors/assembly/inline_assembly_library.sol#L25-L47) uses assembly\n\t- [INLINE ASM](tests/detectors/assembly/inline_assembly_library.sol#L26-L47)\n", - "id": "3d84d91aaec8956d18b205c8fb9c0ae40794c87060ed0bbbb0dc94eecf5b8fcb", + "description": "VectorSum.sumPureAsm(uint256[]) (tests/detectors/assembly/0.4.25/inline_assembly_library.sol#25-47) uses assembly\n\t- INLINE ASM (tests/detectors/assembly/0.4.25/inline_assembly_library.sol#26-47)\n", + "markdown": "[VectorSum.sumPureAsm(uint256[])](tests/detectors/assembly/0.4.25/inline_assembly_library.sol#L25-L47) uses assembly\n\t- [INLINE ASM](tests/detectors/assembly/0.4.25/inline_assembly_library.sol#L26-L47)\n", + "id": "e6c5e2eab9e98c206f4092988fc006a6333e737680610667cba168fe739a3cf6", "check": "assembly", "impact": "Informational", "confidence": "High" diff --git a/tests/detectors/assembly/inline_assembly_contract-0.5.1.sol b/tests/detectors/assembly/0.5.16/inline_assembly_contract.sol similarity index 100% rename from tests/detectors/assembly/inline_assembly_contract-0.5.1.sol rename to tests/detectors/assembly/0.5.16/inline_assembly_contract.sol diff --git a/tests/detectors/assembly/inline_assembly_contract-0.5.1.sol.0.5.1.Assembly.json b/tests/detectors/assembly/0.5.16/inline_assembly_contract.sol.0.5.16.Assembly.json similarity index 87% rename from tests/detectors/assembly/inline_assembly_contract-0.5.1.sol.0.5.1.Assembly.json rename to tests/detectors/assembly/0.5.16/inline_assembly_contract.sol.0.5.16.Assembly.json index 3d4b64198e..868a4fc181 100644 --- a/tests/detectors/assembly/inline_assembly_contract-0.5.1.sol.0.5.1.Assembly.json +++ b/tests/detectors/assembly/0.5.16/inline_assembly_contract.sol.0.5.16.Assembly.json @@ -9,9 +9,9 @@ "start": 119, "length": 707, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_contract-0.5.1.sol", + "filename_relative": "tests/detectors/assembly/0.5.16/inline_assembly_contract.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_contract-0.5.1.sol", + "filename_short": "tests/detectors/assembly/0.5.16/inline_assembly_contract.sol", "is_dependency": false, "lines": [ 6, @@ -41,9 +41,9 @@ "start": 97, "length": 731, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_contract-0.5.1.sol", + "filename_relative": "tests/detectors/assembly/0.5.16/inline_assembly_contract.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_contract-0.5.1.sol", + "filename_short": "tests/detectors/assembly/0.5.16/inline_assembly_contract.sol", "is_dependency": false, "lines": [ 5, @@ -76,11 +76,11 @@ "name": "", "source_mapping": { "start": 198, - "length": 628, + "length": 622, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_contract-0.5.1.sol", + "filename_relative": "tests/detectors/assembly/0.5.16/inline_assembly_contract.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_contract-0.5.1.sol", + "filename_short": "tests/detectors/assembly/0.5.16/inline_assembly_contract.sol", "is_dependency": false, "lines": [ 7, @@ -95,11 +95,10 @@ 16, 17, 18, - 19, - 20 + 19 ], "starting_column": 9, - "ending_column": 6 + "ending_column": 10 }, "type_specific_fields": { "parent": { @@ -109,9 +108,9 @@ "start": 119, "length": 707, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_contract-0.5.1.sol", + "filename_relative": "tests/detectors/assembly/0.5.16/inline_assembly_contract.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_contract-0.5.1.sol", + "filename_short": "tests/detectors/assembly/0.5.16/inline_assembly_contract.sol", "is_dependency": false, "lines": [ 6, @@ -141,9 +140,9 @@ "start": 97, "length": 731, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_contract-0.5.1.sol", + "filename_relative": "tests/detectors/assembly/0.5.16/inline_assembly_contract.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_contract-0.5.1.sol", + "filename_short": "tests/detectors/assembly/0.5.16/inline_assembly_contract.sol", "is_dependency": false, "lines": [ 5, @@ -174,9 +173,9 @@ } } ], - "description": "GetCode.at(address) (tests/detectors/assembly/inline_assembly_contract-0.5.1.sol#6-20) uses assembly\n\t- INLINE ASM (tests/detectors/assembly/inline_assembly_contract-0.5.1.sol#7-20)\n", - "markdown": "[GetCode.at(address)](tests/detectors/assembly/inline_assembly_contract-0.5.1.sol#L6-L20) uses assembly\n\t- [INLINE ASM](tests/detectors/assembly/inline_assembly_contract-0.5.1.sol#L7-L20)\n", - "id": "a454219cba72113d0a6d0d732b998ba66db41cc59910efea1862a05d4d27f385", + "description": "GetCode.at(address) (tests/detectors/assembly/0.5.16/inline_assembly_contract.sol#6-20) uses assembly\n\t- INLINE ASM (tests/detectors/assembly/0.5.16/inline_assembly_contract.sol#7-19)\n", + "markdown": "[GetCode.at(address)](tests/detectors/assembly/0.5.16/inline_assembly_contract.sol#L6-L20) uses assembly\n\t- [INLINE ASM](tests/detectors/assembly/0.5.16/inline_assembly_contract.sol#L7-L19)\n", + "id": "ac5f8f89c2d7459785200d5d861616e04a1bbcfbb2a39cef8bef6a03222c7c21", "check": "assembly", "impact": "Informational", "confidence": "High" diff --git a/tests/detectors/assembly/inline_assembly_library-0.5.1.sol b/tests/detectors/assembly/0.5.16/inline_assembly_library.sol similarity index 100% rename from tests/detectors/assembly/inline_assembly_library-0.5.1.sol rename to tests/detectors/assembly/0.5.16/inline_assembly_library.sol diff --git a/tests/detectors/assembly/inline_assembly_library-0.5.1.sol.0.5.1.Assembly.json b/tests/detectors/assembly/0.5.16/inline_assembly_library.sol.0.5.16.Assembly.json similarity index 90% rename from tests/detectors/assembly/inline_assembly_library-0.5.1.sol.0.5.1.Assembly.json rename to tests/detectors/assembly/0.5.16/inline_assembly_library.sol.0.5.16.Assembly.json index 199c3f22da..4f656370b4 100644 --- a/tests/detectors/assembly/inline_assembly_library-0.5.1.sol.0.5.1.Assembly.json +++ b/tests/detectors/assembly/0.5.16/inline_assembly_library.sol.0.5.16.Assembly.json @@ -9,9 +9,9 @@ "start": 599, "length": 254, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_library-0.5.1.sol", + "filename_relative": "tests/detectors/assembly/0.5.16/inline_assembly_library.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_library-0.5.1.sol", + "filename_short": "tests/detectors/assembly/0.5.16/inline_assembly_library.sol", "is_dependency": false, "lines": [ 16, @@ -33,9 +33,9 @@ "start": 97, "length": 1602, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_library-0.5.1.sol", + "filename_relative": "tests/detectors/assembly/0.5.16/inline_assembly_library.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_library-0.5.1.sol", + "filename_short": "tests/detectors/assembly/0.5.16/inline_assembly_library.sol", "is_dependency": false, "lines": [ 5, @@ -95,20 +95,19 @@ "name": "", "source_mapping": { "start": 733, - "length": 114, + "length": 104, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_library-0.5.1.sol", + "filename_relative": "tests/detectors/assembly/0.5.16/inline_assembly_library.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_library-0.5.1.sol", + "filename_short": "tests/detectors/assembly/0.5.16/inline_assembly_library.sol", "is_dependency": false, "lines": [ 18, 19, - 20, - 21 + 20 ], "starting_column": 13, - "ending_column": 10 + "ending_column": 14 }, "type_specific_fields": { "parent": { @@ -118,9 +117,9 @@ "start": 599, "length": 254, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_library-0.5.1.sol", + "filename_relative": "tests/detectors/assembly/0.5.16/inline_assembly_library.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_library-0.5.1.sol", + "filename_short": "tests/detectors/assembly/0.5.16/inline_assembly_library.sol", "is_dependency": false, "lines": [ 16, @@ -142,9 +141,9 @@ "start": 97, "length": 1602, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_library-0.5.1.sol", + "filename_relative": "tests/detectors/assembly/0.5.16/inline_assembly_library.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_library-0.5.1.sol", + "filename_short": "tests/detectors/assembly/0.5.16/inline_assembly_library.sol", "is_dependency": false, "lines": [ 5, @@ -202,9 +201,9 @@ } } ], - "description": "VectorSum.sumAsm(uint256[]) (tests/detectors/assembly/inline_assembly_library-0.5.1.sol#16-22) uses assembly\n\t- INLINE ASM (tests/detectors/assembly/inline_assembly_library-0.5.1.sol#18-21)\n", - "markdown": "[VectorSum.sumAsm(uint256[])](tests/detectors/assembly/inline_assembly_library-0.5.1.sol#L16-L22) uses assembly\n\t- [INLINE ASM](tests/detectors/assembly/inline_assembly_library-0.5.1.sol#L18-L21)\n", - "id": "86a697fcaa68e521bef3fcba0cf80a381efeb961011f90562eab06ca08b8dc00", + "description": "VectorSum.sumAsm(uint256[]) (tests/detectors/assembly/0.5.16/inline_assembly_library.sol#16-22) uses assembly\n\t- INLINE ASM (tests/detectors/assembly/0.5.16/inline_assembly_library.sol#18-20)\n", + "markdown": "[VectorSum.sumAsm(uint256[])](tests/detectors/assembly/0.5.16/inline_assembly_library.sol#L16-L22) uses assembly\n\t- [INLINE ASM](tests/detectors/assembly/0.5.16/inline_assembly_library.sol#L18-L20)\n", + "id": "abf9dce26719358da77702aa40f23104cc83044d0b1cffb492e318360fb72b6f", "check": "assembly", "impact": "Informational", "confidence": "High" @@ -218,9 +217,9 @@ "start": 936, "length": 761, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_library-0.5.1.sol", + "filename_relative": "tests/detectors/assembly/0.5.16/inline_assembly_library.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_library-0.5.1.sol", + "filename_short": "tests/detectors/assembly/0.5.16/inline_assembly_library.sol", "is_dependency": false, "lines": [ 25, @@ -258,9 +257,9 @@ "start": 97, "length": 1602, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_library-0.5.1.sol", + "filename_relative": "tests/detectors/assembly/0.5.16/inline_assembly_library.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_library-0.5.1.sol", + "filename_short": "tests/detectors/assembly/0.5.16/inline_assembly_library.sol", "is_dependency": false, "lines": [ 5, @@ -320,11 +319,11 @@ "name": "", "source_mapping": { "start": 1020, - "length": 677, + "length": 671, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_library-0.5.1.sol", + "filename_relative": "tests/detectors/assembly/0.5.16/inline_assembly_library.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_library-0.5.1.sol", + "filename_short": "tests/detectors/assembly/0.5.16/inline_assembly_library.sol", "is_dependency": false, "lines": [ 26, @@ -347,11 +346,10 @@ 43, 44, 45, - 46, - 47 + 46 ], "starting_column": 9, - "ending_column": 6 + "ending_column": 10 }, "type_specific_fields": { "parent": { @@ -361,9 +359,9 @@ "start": 936, "length": 761, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_library-0.5.1.sol", + "filename_relative": "tests/detectors/assembly/0.5.16/inline_assembly_library.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_library-0.5.1.sol", + "filename_short": "tests/detectors/assembly/0.5.16/inline_assembly_library.sol", "is_dependency": false, "lines": [ 25, @@ -401,9 +399,9 @@ "start": 97, "length": 1602, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assembly/inline_assembly_library-0.5.1.sol", + "filename_relative": "tests/detectors/assembly/0.5.16/inline_assembly_library.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assembly/inline_assembly_library-0.5.1.sol", + "filename_short": "tests/detectors/assembly/0.5.16/inline_assembly_library.sol", "is_dependency": false, "lines": [ 5, @@ -461,9 +459,9 @@ } } ], - "description": "VectorSum.sumPureAsm(uint256[]) (tests/detectors/assembly/inline_assembly_library-0.5.1.sol#25-47) uses assembly\n\t- INLINE ASM (tests/detectors/assembly/inline_assembly_library-0.5.1.sol#26-47)\n", - "markdown": "[VectorSum.sumPureAsm(uint256[])](tests/detectors/assembly/inline_assembly_library-0.5.1.sol#L25-L47) uses assembly\n\t- [INLINE ASM](tests/detectors/assembly/inline_assembly_library-0.5.1.sol#L26-L47)\n", - "id": "e18b822185c318b5197d4704d8524a2f025a68be527e542392467920f35723b8", + "description": "VectorSum.sumPureAsm(uint256[]) (tests/detectors/assembly/0.5.16/inline_assembly_library.sol#25-47) uses assembly\n\t- INLINE ASM (tests/detectors/assembly/0.5.16/inline_assembly_library.sol#26-46)\n", + "markdown": "[VectorSum.sumPureAsm(uint256[])](tests/detectors/assembly/0.5.16/inline_assembly_library.sol#L25-L47) uses assembly\n\t- [INLINE ASM](tests/detectors/assembly/0.5.16/inline_assembly_library.sol#L26-L46)\n", + "id": "c0078585e7d2fe02dda5ea48ddb48b40916db51afbee078f77bea648d1aa0315", "check": "assembly", "impact": "Informational", "confidence": "High" diff --git a/tests/detectors/assembly/0.6.11/inline_assembly_contract.sol b/tests/detectors/assembly/0.6.11/inline_assembly_contract.sol new file mode 100644 index 0000000000..3288bf9841 --- /dev/null +++ b/tests/detectors/assembly/0.6.11/inline_assembly_contract.sol @@ -0,0 +1,20 @@ +// taken from https://solidity.readthedocs.io/en/v0.4.25/assembly.html + +library GetCode { + function at(address _addr) public view returns (bytes memory o_code) { + assembly { + // retrieve the size of the code, this needs assembly + let size := extcodesize(_addr) + // allocate output byte array - this could also be done without assembly + // by using o_code = new bytes(size) + o_code := mload(0x40) + // new "memory end" including padding + mstore(0x40, add(o_code, and(add(add(size, 0x20), 0x1f), not(0x1f)))) + // store length in memory + mstore(o_code, size) + // actually retrieve the code, this needs assembly + extcodecopy(_addr, add(o_code, 0x20), 0, size) + } + } +} + diff --git a/tests/detectors/assembly/0.6.11/inline_assembly_contract.sol.0.6.11.Assembly.json b/tests/detectors/assembly/0.6.11/inline_assembly_contract.sol.0.6.11.Assembly.json new file mode 100644 index 0000000000..d6a49a6685 --- /dev/null +++ b/tests/detectors/assembly/0.6.11/inline_assembly_contract.sol.0.6.11.Assembly.json @@ -0,0 +1,184 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "at", + "source_mapping": { + "start": 94, + "length": 707, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.6.11/inline_assembly_contract.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.6.11/inline_assembly_contract.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "GetCode", + "source_mapping": { + "start": 72, + "length": 731, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.6.11/inline_assembly_contract.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.6.11/inline_assembly_contract.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "at(address)" + } + }, + { + "type": "node", + "name": "", + "source_mapping": { + "start": 173, + "length": 622, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.6.11/inline_assembly_contract.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.6.11/inline_assembly_contract.sol", + "is_dependency": false, + "lines": [ + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17 + ], + "starting_column": 9, + "ending_column": 10 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "at", + "source_mapping": { + "start": 94, + "length": 707, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.6.11/inline_assembly_contract.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.6.11/inline_assembly_contract.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "GetCode", + "source_mapping": { + "start": 72, + "length": 731, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.6.11/inline_assembly_contract.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.6.11/inline_assembly_contract.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "at(address)" + } + } + } + } + ], + "description": "GetCode.at(address) (tests/detectors/assembly/0.6.11/inline_assembly_contract.sol#4-18) uses assembly\n\t- INLINE ASM (tests/detectors/assembly/0.6.11/inline_assembly_contract.sol#5-17)\n", + "markdown": "[GetCode.at(address)](tests/detectors/assembly/0.6.11/inline_assembly_contract.sol#L4-L18) uses assembly\n\t- [INLINE ASM](tests/detectors/assembly/0.6.11/inline_assembly_contract.sol#L5-L17)\n", + "id": "00e51f7f223289ebaad73cd6e77329b37ff5be360d9a682614cb6b72b8e3d9b4", + "check": "assembly", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/assembly/0.6.11/inline_assembly_library.sol b/tests/detectors/assembly/0.6.11/inline_assembly_library.sol new file mode 100644 index 0000000000..201ff100b0 --- /dev/null +++ b/tests/detectors/assembly/0.6.11/inline_assembly_library.sol @@ -0,0 +1,47 @@ +// taken from https://solidity.readthedocs.io/en/v0.4.25/assembly.html + +library VectorSum { + // This function is less efficient because the optimizer currently fails to + // remove the bounds checks in array access. + function sumSolidity(uint[] memory _data) public view returns (uint o_sum) { + for (uint i = 0; i < _data.length; ++i) + o_sum += _data[i]; + } + + // We know that we only access the array in bounds, so we can avoid the check. + // 0x20 needs to be added to an array because the first slot contains the + // array length. + function sumAsm(uint[] memory _data) public view returns (uint o_sum) { + for (uint i = 0; i < _data.length; ++i) { + assembly { + o_sum := add(o_sum, mload(add(add(_data, 0x20), mul(i, 0x20)))) + } + } + } + + // Same as above, but accomplish the entire code within inline assembly. + function sumPureAsm(uint[] memory _data) public view returns (uint o_sum) { + assembly { + // Load the length (first 32 bytes) + let len := mload(_data) + + // Skip over the length field. + // + // Keep temporary variable so it can be incremented in place. + // + // NOTE: incrementing _data would result in an unusable + // _data variable after this assembly block + let data := add(_data, 0x20) + + // Iterate until the bound is not met. + for + { let end := add(data, len) } + lt(data, end) + { data := add(data, 0x20) } + { + o_sum := add(o_sum, mload(data)) + } + } + } +} + diff --git a/tests/detectors/assembly/0.6.11/inline_assembly_library.sol.0.6.11.Assembly.json b/tests/detectors/assembly/0.6.11/inline_assembly_library.sol.0.6.11.Assembly.json new file mode 100644 index 0000000000..419567a472 --- /dev/null +++ b/tests/detectors/assembly/0.6.11/inline_assembly_library.sol.0.6.11.Assembly.json @@ -0,0 +1,470 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "sumAsm", + "source_mapping": { + "start": 574, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.6.11/inline_assembly_library.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.6.11/inline_assembly_library.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "VectorSum", + "source_mapping": { + "start": 72, + "length": 1602, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.6.11/inline_assembly_library.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.6.11/inline_assembly_library.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "sumAsm(uint256[])" + } + }, + { + "type": "node", + "name": "", + "source_mapping": { + "start": 708, + "length": 104, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.6.11/inline_assembly_library.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.6.11/inline_assembly_library.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18 + ], + "starting_column": 13, + "ending_column": 14 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "sumAsm", + "source_mapping": { + "start": 574, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.6.11/inline_assembly_library.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.6.11/inline_assembly_library.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "VectorSum", + "source_mapping": { + "start": 72, + "length": 1602, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.6.11/inline_assembly_library.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.6.11/inline_assembly_library.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "sumAsm(uint256[])" + } + } + } + } + ], + "description": "VectorSum.sumAsm(uint256[]) (tests/detectors/assembly/0.6.11/inline_assembly_library.sol#14-20) uses assembly\n\t- INLINE ASM (tests/detectors/assembly/0.6.11/inline_assembly_library.sol#16-18)\n", + "markdown": "[VectorSum.sumAsm(uint256[])](tests/detectors/assembly/0.6.11/inline_assembly_library.sol#L14-L20) uses assembly\n\t- [INLINE ASM](tests/detectors/assembly/0.6.11/inline_assembly_library.sol#L16-L18)\n", + "id": "a8d71513166310212c49c4edecbdf8fbc3040b1cb5b5756f0ad1971ae7d4cdb1", + "check": "assembly", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "sumPureAsm", + "source_mapping": { + "start": 911, + "length": 761, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.6.11/inline_assembly_library.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.6.11/inline_assembly_library.sol", + "is_dependency": false, + "lines": [ + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "VectorSum", + "source_mapping": { + "start": 72, + "length": 1602, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.6.11/inline_assembly_library.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.6.11/inline_assembly_library.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "sumPureAsm(uint256[])" + } + }, + { + "type": "node", + "name": "", + "source_mapping": { + "start": 995, + "length": 671, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.6.11/inline_assembly_library.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.6.11/inline_assembly_library.sol", + "is_dependency": false, + "lines": [ + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44 + ], + "starting_column": 9, + "ending_column": 10 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "sumPureAsm", + "source_mapping": { + "start": 911, + "length": 761, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.6.11/inline_assembly_library.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.6.11/inline_assembly_library.sol", + "is_dependency": false, + "lines": [ + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "VectorSum", + "source_mapping": { + "start": 72, + "length": 1602, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.6.11/inline_assembly_library.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.6.11/inline_assembly_library.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "sumPureAsm(uint256[])" + } + } + } + } + ], + "description": "VectorSum.sumPureAsm(uint256[]) (tests/detectors/assembly/0.6.11/inline_assembly_library.sol#23-45) uses assembly\n\t- INLINE ASM (tests/detectors/assembly/0.6.11/inline_assembly_library.sol#24-44)\n", + "markdown": "[VectorSum.sumPureAsm(uint256[])](tests/detectors/assembly/0.6.11/inline_assembly_library.sol#L23-L45) uses assembly\n\t- [INLINE ASM](tests/detectors/assembly/0.6.11/inline_assembly_library.sol#L24-L44)\n", + "id": "5964c7440a9efb78bf78544bcdc60c789e3d9dff73438108bcb07ac98d60876a", + "check": "assembly", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/assembly/0.7.6/inline_assembly_contract.sol b/tests/detectors/assembly/0.7.6/inline_assembly_contract.sol new file mode 100644 index 0000000000..3288bf9841 --- /dev/null +++ b/tests/detectors/assembly/0.7.6/inline_assembly_contract.sol @@ -0,0 +1,20 @@ +// taken from https://solidity.readthedocs.io/en/v0.4.25/assembly.html + +library GetCode { + function at(address _addr) public view returns (bytes memory o_code) { + assembly { + // retrieve the size of the code, this needs assembly + let size := extcodesize(_addr) + // allocate output byte array - this could also be done without assembly + // by using o_code = new bytes(size) + o_code := mload(0x40) + // new "memory end" including padding + mstore(0x40, add(o_code, and(add(add(size, 0x20), 0x1f), not(0x1f)))) + // store length in memory + mstore(o_code, size) + // actually retrieve the code, this needs assembly + extcodecopy(_addr, add(o_code, 0x20), 0, size) + } + } +} + diff --git a/tests/detectors/assembly/0.7.6/inline_assembly_contract.sol.0.7.6.Assembly.json b/tests/detectors/assembly/0.7.6/inline_assembly_contract.sol.0.7.6.Assembly.json new file mode 100644 index 0000000000..0d9af7ef9a --- /dev/null +++ b/tests/detectors/assembly/0.7.6/inline_assembly_contract.sol.0.7.6.Assembly.json @@ -0,0 +1,184 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "at", + "source_mapping": { + "start": 94, + "length": 707, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.7.6/inline_assembly_contract.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.7.6/inline_assembly_contract.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "GetCode", + "source_mapping": { + "start": 72, + "length": 731, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.7.6/inline_assembly_contract.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.7.6/inline_assembly_contract.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "at(address)" + } + }, + { + "type": "node", + "name": "", + "source_mapping": { + "start": 173, + "length": 622, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.7.6/inline_assembly_contract.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.7.6/inline_assembly_contract.sol", + "is_dependency": false, + "lines": [ + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17 + ], + "starting_column": 9, + "ending_column": 10 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "at", + "source_mapping": { + "start": 94, + "length": 707, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.7.6/inline_assembly_contract.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.7.6/inline_assembly_contract.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "GetCode", + "source_mapping": { + "start": 72, + "length": 731, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.7.6/inline_assembly_contract.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.7.6/inline_assembly_contract.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "at(address)" + } + } + } + } + ], + "description": "GetCode.at(address) (tests/detectors/assembly/0.7.6/inline_assembly_contract.sol#4-18) uses assembly\n\t- INLINE ASM (tests/detectors/assembly/0.7.6/inline_assembly_contract.sol#5-17)\n", + "markdown": "[GetCode.at(address)](tests/detectors/assembly/0.7.6/inline_assembly_contract.sol#L4-L18) uses assembly\n\t- [INLINE ASM](tests/detectors/assembly/0.7.6/inline_assembly_contract.sol#L5-L17)\n", + "id": "3b2ace4ab64f4fdd4436ae22d38a7db3efe8d2b65dca270af7fb18f281323670", + "check": "assembly", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/assembly/0.7.6/inline_assembly_library.sol b/tests/detectors/assembly/0.7.6/inline_assembly_library.sol new file mode 100644 index 0000000000..201ff100b0 --- /dev/null +++ b/tests/detectors/assembly/0.7.6/inline_assembly_library.sol @@ -0,0 +1,47 @@ +// taken from https://solidity.readthedocs.io/en/v0.4.25/assembly.html + +library VectorSum { + // This function is less efficient because the optimizer currently fails to + // remove the bounds checks in array access. + function sumSolidity(uint[] memory _data) public view returns (uint o_sum) { + for (uint i = 0; i < _data.length; ++i) + o_sum += _data[i]; + } + + // We know that we only access the array in bounds, so we can avoid the check. + // 0x20 needs to be added to an array because the first slot contains the + // array length. + function sumAsm(uint[] memory _data) public view returns (uint o_sum) { + for (uint i = 0; i < _data.length; ++i) { + assembly { + o_sum := add(o_sum, mload(add(add(_data, 0x20), mul(i, 0x20)))) + } + } + } + + // Same as above, but accomplish the entire code within inline assembly. + function sumPureAsm(uint[] memory _data) public view returns (uint o_sum) { + assembly { + // Load the length (first 32 bytes) + let len := mload(_data) + + // Skip over the length field. + // + // Keep temporary variable so it can be incremented in place. + // + // NOTE: incrementing _data would result in an unusable + // _data variable after this assembly block + let data := add(_data, 0x20) + + // Iterate until the bound is not met. + for + { let end := add(data, len) } + lt(data, end) + { data := add(data, 0x20) } + { + o_sum := add(o_sum, mload(data)) + } + } + } +} + diff --git a/tests/detectors/assembly/0.7.6/inline_assembly_library.sol.0.7.6.Assembly.json b/tests/detectors/assembly/0.7.6/inline_assembly_library.sol.0.7.6.Assembly.json new file mode 100644 index 0000000000..7f523bc9c9 --- /dev/null +++ b/tests/detectors/assembly/0.7.6/inline_assembly_library.sol.0.7.6.Assembly.json @@ -0,0 +1,470 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "sumAsm", + "source_mapping": { + "start": 574, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.7.6/inline_assembly_library.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.7.6/inline_assembly_library.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "VectorSum", + "source_mapping": { + "start": 72, + "length": 1602, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.7.6/inline_assembly_library.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.7.6/inline_assembly_library.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "sumAsm(uint256[])" + } + }, + { + "type": "node", + "name": "", + "source_mapping": { + "start": 708, + "length": 104, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.7.6/inline_assembly_library.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.7.6/inline_assembly_library.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18 + ], + "starting_column": 13, + "ending_column": 14 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "sumAsm", + "source_mapping": { + "start": 574, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.7.6/inline_assembly_library.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.7.6/inline_assembly_library.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "VectorSum", + "source_mapping": { + "start": 72, + "length": 1602, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.7.6/inline_assembly_library.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.7.6/inline_assembly_library.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "sumAsm(uint256[])" + } + } + } + } + ], + "description": "VectorSum.sumAsm(uint256[]) (tests/detectors/assembly/0.7.6/inline_assembly_library.sol#14-20) uses assembly\n\t- INLINE ASM (tests/detectors/assembly/0.7.6/inline_assembly_library.sol#16-18)\n", + "markdown": "[VectorSum.sumAsm(uint256[])](tests/detectors/assembly/0.7.6/inline_assembly_library.sol#L14-L20) uses assembly\n\t- [INLINE ASM](tests/detectors/assembly/0.7.6/inline_assembly_library.sol#L16-L18)\n", + "id": "a83582beb2c0460617fa82fbdfc38a050004e285749b17141b63e8051062248b", + "check": "assembly", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "sumPureAsm", + "source_mapping": { + "start": 911, + "length": 761, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.7.6/inline_assembly_library.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.7.6/inline_assembly_library.sol", + "is_dependency": false, + "lines": [ + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "VectorSum", + "source_mapping": { + "start": 72, + "length": 1602, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.7.6/inline_assembly_library.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.7.6/inline_assembly_library.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "sumPureAsm(uint256[])" + } + }, + { + "type": "node", + "name": "", + "source_mapping": { + "start": 995, + "length": 671, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.7.6/inline_assembly_library.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.7.6/inline_assembly_library.sol", + "is_dependency": false, + "lines": [ + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44 + ], + "starting_column": 9, + "ending_column": 10 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "sumPureAsm", + "source_mapping": { + "start": 911, + "length": 761, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.7.6/inline_assembly_library.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.7.6/inline_assembly_library.sol", + "is_dependency": false, + "lines": [ + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "VectorSum", + "source_mapping": { + "start": 72, + "length": 1602, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assembly/0.7.6/inline_assembly_library.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assembly/0.7.6/inline_assembly_library.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "sumPureAsm(uint256[])" + } + } + } + } + ], + "description": "VectorSum.sumPureAsm(uint256[]) (tests/detectors/assembly/0.7.6/inline_assembly_library.sol#23-45) uses assembly\n\t- INLINE ASM (tests/detectors/assembly/0.7.6/inline_assembly_library.sol#24-44)\n", + "markdown": "[VectorSum.sumPureAsm(uint256[])](tests/detectors/assembly/0.7.6/inline_assembly_library.sol#L23-L45) uses assembly\n\t- [INLINE ASM](tests/detectors/assembly/0.7.6/inline_assembly_library.sol#L24-L44)\n", + "id": "5cafb3e9d7d87c17203cf2c296eeec7de6b774b2a8d71908f8cfc9b8d916cb4b", + "check": "assembly", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/assert-state-change/assert_state_change.sol b/tests/detectors/assert-state-change/0.4.25/assert_state_change.sol similarity index 100% rename from tests/detectors/assert-state-change/assert_state_change.sol rename to tests/detectors/assert-state-change/0.4.25/assert_state_change.sol diff --git a/tests/detectors/assert-state-change/0.4.25/assert_state_change.sol.0.4.25.AssertStateChange.json b/tests/detectors/assert-state-change/0.4.25/assert_state_change.sol.0.4.25.AssertStateChange.json new file mode 100644 index 0000000000..b3c8084ffb --- /dev/null +++ b/tests/detectors/assert-state-change/0.4.25/assert_state_change.sol.0.4.25.AssertStateChange.json @@ -0,0 +1,568 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 77, + "length": 57, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 0, + "length": 759, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + }, + { + "type": "node", + "name": "assert(bool)((s_a += 1) > 10)", + "source_mapping": { + "start": 106, + "length": 23, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 7 + ], + "starting_column": 5, + "ending_column": 28 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 77, + "length": 57, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 0, + "length": 759, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + } + } + ], + "description": "A.bad0() (tests/detectors/assert-state-change/0.4.25/assert_state_change.sol#6-8) has an assert() call which possibly changes state.\n\t-assert(bool)((s_a += 1) > 10) (tests/detectors/assert-state-change/0.4.25/assert_state_change.sol#7)\nConsider using require() or change the invariant to not modify the state.\n", + "markdown": "[A.bad0()](tests/detectors/assert-state-change/0.4.25/assert_state_change.sol#L6-L8) has an assert() call which possibly changes state.\n\t-[assert(bool)((s_a += 1) > 10)](tests/detectors/assert-state-change/0.4.25/assert_state_change.sol#L7)\nConsider using require() or change the invariant to not modify the state.\n", + "id": "a01104ede08ddc5107a2d63d851930d477642029aeef70d6cb44eb2a640b282a", + "check": "assert-state-change", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 186, + "length": 66, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 0, + "length": 759, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(uint256)" + } + }, + { + "type": "node", + "name": "assert(bool)((s_a += a) > 10)", + "source_mapping": { + "start": 224, + "length": 23, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 5, + "ending_column": 28 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 186, + "length": 66, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 0, + "length": 759, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(uint256)" + } + } + } + } + ], + "description": "A.bad1(uint256) (tests/detectors/assert-state-change/0.4.25/assert_state_change.sol#11-13) has an assert() call which possibly changes state.\n\t-assert(bool)((s_a += a) > 10) (tests/detectors/assert-state-change/0.4.25/assert_state_change.sol#12)\nConsider using require() or change the invariant to not modify the state.\n", + "markdown": "[A.bad1(uint256)](tests/detectors/assert-state-change/0.4.25/assert_state_change.sol#L11-L13) has an assert() call which possibly changes state.\n\t-[assert(bool)((s_a += a) > 10)](tests/detectors/assert-state-change/0.4.25/assert_state_change.sol#L12)\nConsider using require() or change the invariant to not modify the state.\n", + "id": "849934acf882563bb79caed681f16909f03795bbbbe8338455d104d66a52314c", + "check": "assert-state-change", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 398, + "length": 55, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 19, + 20, + 21 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 0, + "length": 759, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + }, + { + "type": "node", + "name": "assert(bool)(bad2_callee())", + "source_mapping": { + "start": 427, + "length": 21, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 20 + ], + "starting_column": 5, + "ending_column": 26 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 398, + "length": 55, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 19, + 20, + 21 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 0, + "length": 759, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + } + } + } + ], + "description": "A.bad2() (tests/detectors/assert-state-change/0.4.25/assert_state_change.sol#19-21) has an assert() call which possibly changes state.\n\t-assert(bool)(bad2_callee()) (tests/detectors/assert-state-change/0.4.25/assert_state_change.sol#20)\nConsider using require() or change the invariant to not modify the state.\n", + "markdown": "[A.bad2()](tests/detectors/assert-state-change/0.4.25/assert_state_change.sol#L19-L21) has an assert() call which possibly changes state.\n\t-[assert(bool)(bad2_callee())](tests/detectors/assert-state-change/0.4.25/assert_state_change.sol#L20)\nConsider using require() or change the invariant to not modify the state.\n", + "id": "47c8c39b084f8d339822d44f892cb049c1a3834f52fd48d2dcef80bac56996a3", + "check": "assert-state-change", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/assert-state-change/0.5.16/assert_state_change.sol b/tests/detectors/assert-state-change/0.5.16/assert_state_change.sol new file mode 100644 index 0000000000..d5d7094198 --- /dev/null +++ b/tests/detectors/assert-state-change/0.5.16/assert_state_change.sol @@ -0,0 +1,39 @@ +contract A { + + uint s_a; + + /* Direct state change in assert is NOT ok */ + function bad0() public { + assert((s_a += 1) > 10); + } + + /* Direct state change in assert is NOT ok */ + function bad1(uint256 a) public { + assert((s_a += a) > 10); + } + + /* State change via functions calls in assert is NOT ok */ + function bad2_callee() public returns (bool) { + return (s_a += 1) > 10; + } + function bad2() public { + assert(bad2_callee()); + } + + + /* Parameter use is ok */ + function good0(uint256 a) public { + assert(a > 10); + } + + /* Parameter change is ok */ + function good1(uint256 a) public { + assert((a += 1) > 10); + } + + /* State change in require is ok */ + function good2(uint256 a) public { + require(a == (s_a += 1)); + } + +} diff --git a/tests/detectors/assert-state-change/0.5.16/assert_state_change.sol.0.5.16.AssertStateChange.json b/tests/detectors/assert-state-change/0.5.16/assert_state_change.sol.0.5.16.AssertStateChange.json new file mode 100644 index 0000000000..eed136381f --- /dev/null +++ b/tests/detectors/assert-state-change/0.5.16/assert_state_change.sol.0.5.16.AssertStateChange.json @@ -0,0 +1,568 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 77, + "length": 57, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 0, + "length": 759, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + }, + { + "type": "node", + "name": "assert(bool)((s_a += 1) > 10)", + "source_mapping": { + "start": 106, + "length": 23, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 7 + ], + "starting_column": 5, + "ending_column": 28 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 77, + "length": 57, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 0, + "length": 759, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + } + } + ], + "description": "A.bad0() (tests/detectors/assert-state-change/0.5.16/assert_state_change.sol#6-8) has an assert() call which possibly changes state.\n\t-assert(bool)((s_a += 1) > 10) (tests/detectors/assert-state-change/0.5.16/assert_state_change.sol#7)\nConsider using require() or change the invariant to not modify the state.\n", + "markdown": "[A.bad0()](tests/detectors/assert-state-change/0.5.16/assert_state_change.sol#L6-L8) has an assert() call which possibly changes state.\n\t-[assert(bool)((s_a += 1) > 10)](tests/detectors/assert-state-change/0.5.16/assert_state_change.sol#L7)\nConsider using require() or change the invariant to not modify the state.\n", + "id": "ed7344e23d057576887c7e524b215bd0b52464ce035f686bab51b271460e43a0", + "check": "assert-state-change", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 186, + "length": 66, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 0, + "length": 759, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(uint256)" + } + }, + { + "type": "node", + "name": "assert(bool)((s_a += a) > 10)", + "source_mapping": { + "start": 224, + "length": 23, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 5, + "ending_column": 28 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 186, + "length": 66, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 0, + "length": 759, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(uint256)" + } + } + } + } + ], + "description": "A.bad1(uint256) (tests/detectors/assert-state-change/0.5.16/assert_state_change.sol#11-13) has an assert() call which possibly changes state.\n\t-assert(bool)((s_a += a) > 10) (tests/detectors/assert-state-change/0.5.16/assert_state_change.sol#12)\nConsider using require() or change the invariant to not modify the state.\n", + "markdown": "[A.bad1(uint256)](tests/detectors/assert-state-change/0.5.16/assert_state_change.sol#L11-L13) has an assert() call which possibly changes state.\n\t-[assert(bool)((s_a += a) > 10)](tests/detectors/assert-state-change/0.5.16/assert_state_change.sol#L12)\nConsider using require() or change the invariant to not modify the state.\n", + "id": "ea912d34e8adabfd2ce93ecd5723df8d2e7ebec7e66de5fc56f3304c780488b3", + "check": "assert-state-change", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 398, + "length": 55, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 19, + 20, + 21 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 0, + "length": 759, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + }, + { + "type": "node", + "name": "assert(bool)(bad2_callee())", + "source_mapping": { + "start": 427, + "length": 21, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 20 + ], + "starting_column": 5, + "ending_column": 26 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 398, + "length": 55, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 19, + 20, + 21 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 0, + "length": 759, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + } + } + } + ], + "description": "A.bad2() (tests/detectors/assert-state-change/0.5.16/assert_state_change.sol#19-21) has an assert() call which possibly changes state.\n\t-assert(bool)(bad2_callee()) (tests/detectors/assert-state-change/0.5.16/assert_state_change.sol#20)\nConsider using require() or change the invariant to not modify the state.\n", + "markdown": "[A.bad2()](tests/detectors/assert-state-change/0.5.16/assert_state_change.sol#L19-L21) has an assert() call which possibly changes state.\n\t-[assert(bool)(bad2_callee())](tests/detectors/assert-state-change/0.5.16/assert_state_change.sol#L20)\nConsider using require() or change the invariant to not modify the state.\n", + "id": "feb1fef411c094fe2d2dac33e4932217dd550b8a89548417ef8a4da2fe99eea2", + "check": "assert-state-change", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/assert-state-change/0.6.11/assert_state_change.sol b/tests/detectors/assert-state-change/0.6.11/assert_state_change.sol new file mode 100644 index 0000000000..d5d7094198 --- /dev/null +++ b/tests/detectors/assert-state-change/0.6.11/assert_state_change.sol @@ -0,0 +1,39 @@ +contract A { + + uint s_a; + + /* Direct state change in assert is NOT ok */ + function bad0() public { + assert((s_a += 1) > 10); + } + + /* Direct state change in assert is NOT ok */ + function bad1(uint256 a) public { + assert((s_a += a) > 10); + } + + /* State change via functions calls in assert is NOT ok */ + function bad2_callee() public returns (bool) { + return (s_a += 1) > 10; + } + function bad2() public { + assert(bad2_callee()); + } + + + /* Parameter use is ok */ + function good0(uint256 a) public { + assert(a > 10); + } + + /* Parameter change is ok */ + function good1(uint256 a) public { + assert((a += 1) > 10); + } + + /* State change in require is ok */ + function good2(uint256 a) public { + require(a == (s_a += 1)); + } + +} diff --git a/tests/detectors/assert-state-change/0.6.11/assert_state_change.sol.0.6.11.AssertStateChange.json b/tests/detectors/assert-state-change/0.6.11/assert_state_change.sol.0.6.11.AssertStateChange.json new file mode 100644 index 0000000000..a031f708c7 --- /dev/null +++ b/tests/detectors/assert-state-change/0.6.11/assert_state_change.sol.0.6.11.AssertStateChange.json @@ -0,0 +1,568 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 77, + "length": 57, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 0, + "length": 759, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + }, + { + "type": "node", + "name": "assert(bool)((s_a += 1) > 10)", + "source_mapping": { + "start": 106, + "length": 23, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 7 + ], + "starting_column": 5, + "ending_column": 28 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 77, + "length": 57, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 0, + "length": 759, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + } + } + ], + "description": "A.bad0() (tests/detectors/assert-state-change/0.6.11/assert_state_change.sol#6-8) has an assert() call which possibly changes state.\n\t-assert(bool)((s_a += 1) > 10) (tests/detectors/assert-state-change/0.6.11/assert_state_change.sol#7)\nConsider using require() or change the invariant to not modify the state.\n", + "markdown": "[A.bad0()](tests/detectors/assert-state-change/0.6.11/assert_state_change.sol#L6-L8) has an assert() call which possibly changes state.\n\t-[assert(bool)((s_a += 1) > 10)](tests/detectors/assert-state-change/0.6.11/assert_state_change.sol#L7)\nConsider using require() or change the invariant to not modify the state.\n", + "id": "5b8574d24925d841b9f041ba70166cc219ea6bcdd06c27d2f570740722b38380", + "check": "assert-state-change", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 186, + "length": 66, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 0, + "length": 759, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(uint256)" + } + }, + { + "type": "node", + "name": "assert(bool)((s_a += a) > 10)", + "source_mapping": { + "start": 224, + "length": 23, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 5, + "ending_column": 28 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 186, + "length": 66, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 0, + "length": 759, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(uint256)" + } + } + } + } + ], + "description": "A.bad1(uint256) (tests/detectors/assert-state-change/0.6.11/assert_state_change.sol#11-13) has an assert() call which possibly changes state.\n\t-assert(bool)((s_a += a) > 10) (tests/detectors/assert-state-change/0.6.11/assert_state_change.sol#12)\nConsider using require() or change the invariant to not modify the state.\n", + "markdown": "[A.bad1(uint256)](tests/detectors/assert-state-change/0.6.11/assert_state_change.sol#L11-L13) has an assert() call which possibly changes state.\n\t-[assert(bool)((s_a += a) > 10)](tests/detectors/assert-state-change/0.6.11/assert_state_change.sol#L12)\nConsider using require() or change the invariant to not modify the state.\n", + "id": "c27ede68d9d7c6159032f3aef6bf9fa491390317da33307fa783a93c1b675bd7", + "check": "assert-state-change", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 398, + "length": 55, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 19, + 20, + 21 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 0, + "length": 759, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + }, + { + "type": "node", + "name": "assert(bool)(bad2_callee())", + "source_mapping": { + "start": 427, + "length": 21, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 20 + ], + "starting_column": 5, + "ending_column": 26 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 398, + "length": 55, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 19, + 20, + 21 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 0, + "length": 759, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + } + } + } + ], + "description": "A.bad2() (tests/detectors/assert-state-change/0.6.11/assert_state_change.sol#19-21) has an assert() call which possibly changes state.\n\t-assert(bool)(bad2_callee()) (tests/detectors/assert-state-change/0.6.11/assert_state_change.sol#20)\nConsider using require() or change the invariant to not modify the state.\n", + "markdown": "[A.bad2()](tests/detectors/assert-state-change/0.6.11/assert_state_change.sol#L19-L21) has an assert() call which possibly changes state.\n\t-[assert(bool)(bad2_callee())](tests/detectors/assert-state-change/0.6.11/assert_state_change.sol#L20)\nConsider using require() or change the invariant to not modify the state.\n", + "id": "6f4b2360043bf3035cc152b583d3462d8cc98e91de8577091fe3a0af569d5285", + "check": "assert-state-change", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/assert-state-change/0.7.6/assert_state_change.sol b/tests/detectors/assert-state-change/0.7.6/assert_state_change.sol new file mode 100644 index 0000000000..d5d7094198 --- /dev/null +++ b/tests/detectors/assert-state-change/0.7.6/assert_state_change.sol @@ -0,0 +1,39 @@ +contract A { + + uint s_a; + + /* Direct state change in assert is NOT ok */ + function bad0() public { + assert((s_a += 1) > 10); + } + + /* Direct state change in assert is NOT ok */ + function bad1(uint256 a) public { + assert((s_a += a) > 10); + } + + /* State change via functions calls in assert is NOT ok */ + function bad2_callee() public returns (bool) { + return (s_a += 1) > 10; + } + function bad2() public { + assert(bad2_callee()); + } + + + /* Parameter use is ok */ + function good0(uint256 a) public { + assert(a > 10); + } + + /* Parameter change is ok */ + function good1(uint256 a) public { + assert((a += 1) > 10); + } + + /* State change in require is ok */ + function good2(uint256 a) public { + require(a == (s_a += 1)); + } + +} diff --git a/tests/detectors/assert-state-change/assert_state_change.sol.0.5.8.AssertStateChange.json b/tests/detectors/assert-state-change/0.7.6/assert_state_change.sol.0.7.6.AssertStateChange.json similarity index 87% rename from tests/detectors/assert-state-change/assert_state_change.sol.0.5.8.AssertStateChange.json rename to tests/detectors/assert-state-change/0.7.6/assert_state_change.sol.0.7.6.AssertStateChange.json index a0be936fbe..6ccafe8b34 100644 --- a/tests/detectors/assert-state-change/assert_state_change.sol.0.5.8.AssertStateChange.json +++ b/tests/detectors/assert-state-change/0.7.6/assert_state_change.sol.0.7.6.AssertStateChange.json @@ -9,9 +9,9 @@ "start": 77, "length": 57, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_relative": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_short": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "is_dependency": false, "lines": [ 6, @@ -29,9 +29,9 @@ "start": 0, "length": 759, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_relative": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_short": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "is_dependency": false, "lines": [ 1, @@ -88,9 +88,9 @@ "start": 106, "length": 23, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_relative": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_short": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "is_dependency": false, "lines": [ 7 @@ -106,9 +106,9 @@ "start": 77, "length": 57, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_relative": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_short": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "is_dependency": false, "lines": [ 6, @@ -126,9 +126,9 @@ "start": 0, "length": 759, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_relative": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_short": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "is_dependency": false, "lines": [ 1, @@ -181,9 +181,9 @@ } } ], - "description": "A.bad0() (tests/detectors/assert-state-change/assert_state_change.sol#6-8) has an assert() call which possibly changes state.\n\t-assert(bool)((s_a += 1) > 10) (tests/detectors/assert-state-change/assert_state_change.sol#7)\nConsider using require() or change the invariant to not modify the state.\n", - "markdown": "[A.bad0()](tests/detectors/assert-state-change/assert_state_change.sol#L6-L8) has an assert() call which possibly changes state.\n\t-[assert(bool)((s_a += 1) > 10)](tests/detectors/assert-state-change/assert_state_change.sol#L7)\nConsider using require() or change the invariant to not modify the state.\n", - "id": "a4f5ea904ad28f8c83aa1bab8284b485e1fe638545b500ca0c8a0fa8e442203e", + "description": "A.bad0() (tests/detectors/assert-state-change/0.7.6/assert_state_change.sol#6-8) has an assert() call which possibly changes state.\n\t-assert(bool)((s_a += 1) > 10) (tests/detectors/assert-state-change/0.7.6/assert_state_change.sol#7)\nConsider using require() or change the invariant to not modify the state.\n", + "markdown": "[A.bad0()](tests/detectors/assert-state-change/0.7.6/assert_state_change.sol#L6-L8) has an assert() call which possibly changes state.\n\t-[assert(bool)((s_a += 1) > 10)](tests/detectors/assert-state-change/0.7.6/assert_state_change.sol#L7)\nConsider using require() or change the invariant to not modify the state.\n", + "id": "a710d11e5510f0eb3acb2c1ec524779253f25bf2931bce4cb9c5c048ec586b80", "check": "assert-state-change", "impact": "Informational", "confidence": "High" @@ -197,9 +197,9 @@ "start": 186, "length": 66, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_relative": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_short": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "is_dependency": false, "lines": [ 11, @@ -217,9 +217,9 @@ "start": 0, "length": 759, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_relative": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_short": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "is_dependency": false, "lines": [ 1, @@ -276,9 +276,9 @@ "start": 224, "length": 23, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_relative": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_short": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "is_dependency": false, "lines": [ 12 @@ -294,9 +294,9 @@ "start": 186, "length": 66, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_relative": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_short": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "is_dependency": false, "lines": [ 11, @@ -314,9 +314,9 @@ "start": 0, "length": 759, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_relative": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_short": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "is_dependency": false, "lines": [ 1, @@ -369,9 +369,9 @@ } } ], - "description": "A.bad1(uint256) (tests/detectors/assert-state-change/assert_state_change.sol#11-13) has an assert() call which possibly changes state.\n\t-assert(bool)((s_a += a) > 10) (tests/detectors/assert-state-change/assert_state_change.sol#12)\nConsider using require() or change the invariant to not modify the state.\n", - "markdown": "[A.bad1(uint256)](tests/detectors/assert-state-change/assert_state_change.sol#L11-L13) has an assert() call which possibly changes state.\n\t-[assert(bool)((s_a += a) > 10)](tests/detectors/assert-state-change/assert_state_change.sol#L12)\nConsider using require() or change the invariant to not modify the state.\n", - "id": "2b42e9f701ebd94656a026702bf90f31c62710a301600e0c05cfed04bfefabf9", + "description": "A.bad1(uint256) (tests/detectors/assert-state-change/0.7.6/assert_state_change.sol#11-13) has an assert() call which possibly changes state.\n\t-assert(bool)((s_a += a) > 10) (tests/detectors/assert-state-change/0.7.6/assert_state_change.sol#12)\nConsider using require() or change the invariant to not modify the state.\n", + "markdown": "[A.bad1(uint256)](tests/detectors/assert-state-change/0.7.6/assert_state_change.sol#L11-L13) has an assert() call which possibly changes state.\n\t-[assert(bool)((s_a += a) > 10)](tests/detectors/assert-state-change/0.7.6/assert_state_change.sol#L12)\nConsider using require() or change the invariant to not modify the state.\n", + "id": "60ad080e2f9647b400851918171383a9aac2900cc0828121e441db4240911fba", "check": "assert-state-change", "impact": "Informational", "confidence": "High" @@ -385,9 +385,9 @@ "start": 398, "length": 55, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_relative": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_short": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "is_dependency": false, "lines": [ 19, @@ -405,9 +405,9 @@ "start": 0, "length": 759, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_relative": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_short": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "is_dependency": false, "lines": [ 1, @@ -464,9 +464,9 @@ "start": 427, "length": 21, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_relative": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_short": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "is_dependency": false, "lines": [ 20 @@ -482,9 +482,9 @@ "start": 398, "length": 55, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_relative": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_short": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "is_dependency": false, "lines": [ 19, @@ -502,9 +502,9 @@ "start": 0, "length": 759, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_relative": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/assert-state-change/assert_state_change.sol", + "filename_short": "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", "is_dependency": false, "lines": [ 1, @@ -557,9 +557,9 @@ } } ], - "description": "A.bad2() (tests/detectors/assert-state-change/assert_state_change.sol#19-21) has an assert() call which possibly changes state.\n\t-assert(bool)(bad2_callee()) (tests/detectors/assert-state-change/assert_state_change.sol#20)\nConsider using require() or change the invariant to not modify the state.\n", - "markdown": "[A.bad2()](tests/detectors/assert-state-change/assert_state_change.sol#L19-L21) has an assert() call which possibly changes state.\n\t-[assert(bool)(bad2_callee())](tests/detectors/assert-state-change/assert_state_change.sol#L20)\nConsider using require() or change the invariant to not modify the state.\n", - "id": "a72f3e7eef408be55123fbf5c290bfd20aed4f095d659f5df0857d64d61df011", + "description": "A.bad2() (tests/detectors/assert-state-change/0.7.6/assert_state_change.sol#19-21) has an assert() call which possibly changes state.\n\t-assert(bool)(bad2_callee()) (tests/detectors/assert-state-change/0.7.6/assert_state_change.sol#20)\nConsider using require() or change the invariant to not modify the state.\n", + "markdown": "[A.bad2()](tests/detectors/assert-state-change/0.7.6/assert_state_change.sol#L19-L21) has an assert() call which possibly changes state.\n\t-[assert(bool)(bad2_callee())](tests/detectors/assert-state-change/0.7.6/assert_state_change.sol#L20)\nConsider using require() or change the invariant to not modify the state.\n", + "id": "4b31923b05dec7d68f1bf133b986b4ec06fcc82ff3b8f0414d3ee3d623b69265", "check": "assert-state-change", "impact": "Informational", "confidence": "High" diff --git a/tests/detectors/backdoor/backdoor.sol b/tests/detectors/backdoor/0.4.25/backdoor.sol similarity index 100% rename from tests/detectors/backdoor/backdoor.sol rename to tests/detectors/backdoor/0.4.25/backdoor.sol diff --git a/tests/detectors/backdoor/backdoor.sol.0.4.25.Backdoor.json b/tests/detectors/backdoor/0.4.25/backdoor.sol.0.4.25.Backdoor.json similarity index 90% rename from tests/detectors/backdoor/backdoor.sol.0.4.25.Backdoor.json rename to tests/detectors/backdoor/0.4.25/backdoor.sol.0.4.25.Backdoor.json index ba5a9f15ac..14f4539df6 100644 --- a/tests/detectors/backdoor/backdoor.sol.0.4.25.Backdoor.json +++ b/tests/detectors/backdoor/0.4.25/backdoor.sol.0.4.25.Backdoor.json @@ -9,9 +9,9 @@ "start": 18, "length": 74, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/backdoor/backdoor.sol", + "filename_relative": "tests/detectors/backdoor/0.4.25/backdoor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/backdoor/backdoor.sol", + "filename_short": "tests/detectors/backdoor/0.4.25/backdoor.sol", "is_dependency": false, "lines": [ 4, @@ -29,9 +29,9 @@ "start": 1, "length": 94, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/backdoor/backdoor.sol", + "filename_relative": "tests/detectors/backdoor/0.4.25/backdoor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/backdoor/backdoor.sol", + "filename_short": "tests/detectors/backdoor/0.4.25/backdoor.sol", "is_dependency": false, "lines": [ 2, @@ -50,8 +50,8 @@ } } ], - "description": "Backdoor function found in C.i_am_a_backdoor() (tests/detectors/backdoor/backdoor.sol#4-6)\n", - "markdown": "Backdoor function found in [C.i_am_a_backdoor()](tests/detectors/backdoor/backdoor.sol#L4-L6)\n", + "description": "Backdoor function found in C.i_am_a_backdoor() (tests/detectors/backdoor/0.4.25/backdoor.sol#4-6)\n", + "markdown": "Backdoor function found in [C.i_am_a_backdoor()](tests/detectors/backdoor/0.4.25/backdoor.sol#L4-L6)\n", "id": "8a9008f2f5cd23b34feb0235dcc30ecb8d09a10eff151b522939caead117ef7a", "check": "backdoor", "impact": "High", diff --git a/tests/detectors/backdoor/0.5.16/backdoor.sol b/tests/detectors/backdoor/0.5.16/backdoor.sol new file mode 100644 index 0000000000..428c794d4d --- /dev/null +++ b/tests/detectors/backdoor/0.5.16/backdoor.sol @@ -0,0 +1,8 @@ + +contract C{ + + function i_am_a_backdoor() public{ + selfdestruct(msg.sender); + } + +} diff --git a/tests/detectors/backdoor/0.5.16/backdoor.sol.0.5.16.Backdoor.json b/tests/detectors/backdoor/0.5.16/backdoor.sol.0.5.16.Backdoor.json new file mode 100644 index 0000000000..3e46dadf64 --- /dev/null +++ b/tests/detectors/backdoor/0.5.16/backdoor.sol.0.5.16.Backdoor.json @@ -0,0 +1,61 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "i_am_a_backdoor", + "source_mapping": { + "start": 18, + "length": 74, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/backdoor/0.5.16/backdoor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/backdoor/0.5.16/backdoor.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 1, + "length": 94, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/backdoor/0.5.16/backdoor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/backdoor/0.5.16/backdoor.sol", + "is_dependency": false, + "lines": [ + 2, + 3, + 4, + 5, + 6, + 7, + 8 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "i_am_a_backdoor()" + } + } + ], + "description": "Backdoor function found in C.i_am_a_backdoor() (tests/detectors/backdoor/0.5.16/backdoor.sol#4-6)\n", + "markdown": "Backdoor function found in [C.i_am_a_backdoor()](tests/detectors/backdoor/0.5.16/backdoor.sol#L4-L6)\n", + "id": "8a9008f2f5cd23b34feb0235dcc30ecb8d09a10eff151b522939caead117ef7a", + "check": "backdoor", + "impact": "High", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/backdoor/0.6.11/backdoor.sol b/tests/detectors/backdoor/0.6.11/backdoor.sol new file mode 100644 index 0000000000..428c794d4d --- /dev/null +++ b/tests/detectors/backdoor/0.6.11/backdoor.sol @@ -0,0 +1,8 @@ + +contract C{ + + function i_am_a_backdoor() public{ + selfdestruct(msg.sender); + } + +} diff --git a/tests/detectors/backdoor/0.6.11/backdoor.sol.0.6.11.Backdoor.json b/tests/detectors/backdoor/0.6.11/backdoor.sol.0.6.11.Backdoor.json new file mode 100644 index 0000000000..fa492e30a8 --- /dev/null +++ b/tests/detectors/backdoor/0.6.11/backdoor.sol.0.6.11.Backdoor.json @@ -0,0 +1,61 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "i_am_a_backdoor", + "source_mapping": { + "start": 18, + "length": 74, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/backdoor/0.6.11/backdoor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/backdoor/0.6.11/backdoor.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 1, + "length": 94, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/backdoor/0.6.11/backdoor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/backdoor/0.6.11/backdoor.sol", + "is_dependency": false, + "lines": [ + 2, + 3, + 4, + 5, + 6, + 7, + 8 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "i_am_a_backdoor()" + } + } + ], + "description": "Backdoor function found in C.i_am_a_backdoor() (tests/detectors/backdoor/0.6.11/backdoor.sol#4-6)\n", + "markdown": "Backdoor function found in [C.i_am_a_backdoor()](tests/detectors/backdoor/0.6.11/backdoor.sol#L4-L6)\n", + "id": "8a9008f2f5cd23b34feb0235dcc30ecb8d09a10eff151b522939caead117ef7a", + "check": "backdoor", + "impact": "High", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/backdoor/0.7.6/backdoor.sol b/tests/detectors/backdoor/0.7.6/backdoor.sol new file mode 100644 index 0000000000..428c794d4d --- /dev/null +++ b/tests/detectors/backdoor/0.7.6/backdoor.sol @@ -0,0 +1,8 @@ + +contract C{ + + function i_am_a_backdoor() public{ + selfdestruct(msg.sender); + } + +} diff --git a/tests/detectors/backdoor/backdoor.sol.0.5.1.Backdoor.json b/tests/detectors/backdoor/0.7.6/backdoor.sol.0.7.6.Backdoor.json similarity index 90% rename from tests/detectors/backdoor/backdoor.sol.0.5.1.Backdoor.json rename to tests/detectors/backdoor/0.7.6/backdoor.sol.0.7.6.Backdoor.json index ba5a9f15ac..8639812fbb 100644 --- a/tests/detectors/backdoor/backdoor.sol.0.5.1.Backdoor.json +++ b/tests/detectors/backdoor/0.7.6/backdoor.sol.0.7.6.Backdoor.json @@ -9,9 +9,9 @@ "start": 18, "length": 74, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/backdoor/backdoor.sol", + "filename_relative": "tests/detectors/backdoor/0.7.6/backdoor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/backdoor/backdoor.sol", + "filename_short": "tests/detectors/backdoor/0.7.6/backdoor.sol", "is_dependency": false, "lines": [ 4, @@ -29,9 +29,9 @@ "start": 1, "length": 94, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/backdoor/backdoor.sol", + "filename_relative": "tests/detectors/backdoor/0.7.6/backdoor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/backdoor/backdoor.sol", + "filename_short": "tests/detectors/backdoor/0.7.6/backdoor.sol", "is_dependency": false, "lines": [ 2, @@ -50,8 +50,8 @@ } } ], - "description": "Backdoor function found in C.i_am_a_backdoor() (tests/detectors/backdoor/backdoor.sol#4-6)\n", - "markdown": "Backdoor function found in [C.i_am_a_backdoor()](tests/detectors/backdoor/backdoor.sol#L4-L6)\n", + "description": "Backdoor function found in C.i_am_a_backdoor() (tests/detectors/backdoor/0.7.6/backdoor.sol#4-6)\n", + "markdown": "Backdoor function found in [C.i_am_a_backdoor()](tests/detectors/backdoor/0.7.6/backdoor.sol#L4-L6)\n", "id": "8a9008f2f5cd23b34feb0235dcc30ecb8d09a10eff151b522939caead117ef7a", "check": "backdoor", "impact": "High", diff --git a/tests/detectors/boolean-constant-equality/boolean-constant-equality.sol b/tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol similarity index 100% rename from tests/detectors/boolean-constant-equality/boolean-constant-equality.sol rename to tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol diff --git a/tests/detectors/boolean-constant-equality/boolean-constant-equality.sol.0.4.25.BooleanEquality.json b/tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol.0.4.25.BooleanEquality.json similarity index 86% rename from tests/detectors/boolean-constant-equality/boolean-constant-equality.sol.0.4.25.BooleanEquality.json rename to tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol.0.4.25.BooleanEquality.json index 72c1bcbbe2..a04357142d 100644 --- a/tests/detectors/boolean-constant-equality/boolean-constant-equality.sol.0.4.25.BooleanEquality.json +++ b/tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol.0.4.25.BooleanEquality.json @@ -9,9 +9,9 @@ "start": 139, "length": 84, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-equality/boolean-constant-equality.sol", + "filename_relative": "tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-equality/boolean-constant-equality.sol", + "filename_short": "tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol", "is_dependency": false, "lines": [ 7, @@ -29,9 +29,9 @@ "start": 0, "length": 578, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-equality/boolean-constant-equality.sol", + "filename_relative": "tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-equality/boolean-constant-equality.sol", + "filename_short": "tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol", "is_dependency": false, "lines": [ 1, @@ -77,9 +77,9 @@ "start": 198, "length": 18, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-equality/boolean-constant-equality.sol", + "filename_relative": "tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-equality/boolean-constant-equality.sol", + "filename_short": "tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol", "is_dependency": false, "lines": [ 8 @@ -95,9 +95,9 @@ "start": 139, "length": 84, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-equality/boolean-constant-equality.sol", + "filename_relative": "tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-equality/boolean-constant-equality.sol", + "filename_short": "tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol", "is_dependency": false, "lines": [ 7, @@ -115,9 +115,9 @@ "start": 0, "length": 578, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-equality/boolean-constant-equality.sol", + "filename_relative": "tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-equality/boolean-constant-equality.sol", + "filename_short": "tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol", "is_dependency": false, "lines": [ 1, @@ -159,9 +159,9 @@ } } ], - "description": "MyConc.bad1(bool) (tests/detectors/boolean-constant-equality/boolean-constant-equality.sol#7-9) compares to a boolean constant:\n\t-(b == true) (tests/detectors/boolean-constant-equality/boolean-constant-equality.sol#8)\n", - "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-constant-equality/boolean-constant-equality.sol#L7-L9) compares to a boolean constant:\n\t-[(b == true)](tests/detectors/boolean-constant-equality/boolean-constant-equality.sol#L8)\n", - "id": "4a53e773c88b730f07c2e4106545df03b44679c56ee0d9dbd75dca010320e69c", + "description": "MyConc.bad1(bool) (tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol#7-9) compares to a boolean constant:\n\t-(b == true) (tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol#8)\n", + "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol#L7-L9) compares to a boolean constant:\n\t-[(b == true)](tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol#L8)\n", + "id": "953771b4660b92d842bccca2554dbcb5bc0988f4b0875b573a0b1211959c84be", "check": "boolean-equal", "impact": "Informational", "confidence": "High" diff --git a/tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol b/tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol new file mode 100644 index 0000000000..799f433357 --- /dev/null +++ b/tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol @@ -0,0 +1,27 @@ +contract MyConc { + function bad0(bool foo) public pure returns (bool) { + if (foo) { + return true; + } + } + function bad1(bool b) public pure returns (bool) { + return (b == true); + } + + function bad2(bool x, uint8 y) public pure returns (bool) { + if (x == (y > 0)) { + return true; + } + } + + function bad3() public pure returns (bool) { + uint256 a; + if (a == 10) { + return true; + } + } + + function good(uint8 a) public pure returns (bool) { + return a >= 1; + } +} \ No newline at end of file diff --git a/tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol.0.5.16.BooleanEquality.json b/tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol.0.5.16.BooleanEquality.json new file mode 100644 index 0000000000..1ca1294048 --- /dev/null +++ b/tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol.0.5.16.BooleanEquality.json @@ -0,0 +1,170 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 139, + "length": 84, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol", + "is_dependency": false, + "lines": [ + 7, + 8, + 9 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "MyConc", + "source_mapping": { + "start": 0, + "length": 578, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad1(bool)" + } + }, + { + "type": "node", + "name": "(b == true)", + "source_mapping": { + "start": 198, + "length": 18, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol", + "is_dependency": false, + "lines": [ + 8 + ], + "starting_column": 9, + "ending_column": 27 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 139, + "length": 84, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol", + "is_dependency": false, + "lines": [ + 7, + 8, + 9 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "MyConc", + "source_mapping": { + "start": 0, + "length": 578, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad1(bool)" + } + } + } + } + ], + "description": "MyConc.bad1(bool) (tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol#7-9) compares to a boolean constant:\n\t-(b == true) (tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol#8)\n", + "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol#L7-L9) compares to a boolean constant:\n\t-[(b == true)](tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol#L8)\n", + "id": "55f3ed7ce9767b07a34113bd35c34e61c20eb8ec35174086cdfea6c0063bd946", + "check": "boolean-equal", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol b/tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol new file mode 100644 index 0000000000..799f433357 --- /dev/null +++ b/tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol @@ -0,0 +1,27 @@ +contract MyConc { + function bad0(bool foo) public pure returns (bool) { + if (foo) { + return true; + } + } + function bad1(bool b) public pure returns (bool) { + return (b == true); + } + + function bad2(bool x, uint8 y) public pure returns (bool) { + if (x == (y > 0)) { + return true; + } + } + + function bad3() public pure returns (bool) { + uint256 a; + if (a == 10) { + return true; + } + } + + function good(uint8 a) public pure returns (bool) { + return a >= 1; + } +} \ No newline at end of file diff --git a/tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol.0.6.11.BooleanEquality.json b/tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol.0.6.11.BooleanEquality.json new file mode 100644 index 0000000000..645981de85 --- /dev/null +++ b/tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol.0.6.11.BooleanEquality.json @@ -0,0 +1,170 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 139, + "length": 84, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol", + "is_dependency": false, + "lines": [ + 7, + 8, + 9 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "MyConc", + "source_mapping": { + "start": 0, + "length": 578, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad1(bool)" + } + }, + { + "type": "node", + "name": "(b == true)", + "source_mapping": { + "start": 198, + "length": 18, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol", + "is_dependency": false, + "lines": [ + 8 + ], + "starting_column": 9, + "ending_column": 27 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 139, + "length": 84, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol", + "is_dependency": false, + "lines": [ + 7, + 8, + 9 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "MyConc", + "source_mapping": { + "start": 0, + "length": 578, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad1(bool)" + } + } + } + } + ], + "description": "MyConc.bad1(bool) (tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol#7-9) compares to a boolean constant:\n\t-(b == true) (tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol#8)\n", + "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol#L7-L9) compares to a boolean constant:\n\t-[(b == true)](tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol#L8)\n", + "id": "c51b5452fc3e68aff071a2c4ab0963cbbb1b55871b53c0131c11d4cf8abd046f", + "check": "boolean-equal", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol b/tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol new file mode 100644 index 0000000000..799f433357 --- /dev/null +++ b/tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol @@ -0,0 +1,27 @@ +contract MyConc { + function bad0(bool foo) public pure returns (bool) { + if (foo) { + return true; + } + } + function bad1(bool b) public pure returns (bool) { + return (b == true); + } + + function bad2(bool x, uint8 y) public pure returns (bool) { + if (x == (y > 0)) { + return true; + } + } + + function bad3() public pure returns (bool) { + uint256 a; + if (a == 10) { + return true; + } + } + + function good(uint8 a) public pure returns (bool) { + return a >= 1; + } +} \ No newline at end of file diff --git a/tests/detectors/boolean-equality/boolean-equality.sol.0.5.1.BooleanEquality.json b/tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol.0.7.6.BooleanEquality.json similarity index 78% rename from tests/detectors/boolean-equality/boolean-equality.sol.0.5.1.BooleanEquality.json rename to tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol.0.7.6.BooleanEquality.json index 1565729021..367bb3d6f0 100644 --- a/tests/detectors/boolean-equality/boolean-equality.sol.0.5.1.BooleanEquality.json +++ b/tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol.0.7.6.BooleanEquality.json @@ -6,17 +6,17 @@ "type": "function", "name": "bad1", "source_mapping": { - "start": 134, + "start": 139, "length": 84, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-equality/boolean-equality.sol", + "filename_relative": "tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-equality/boolean-equality.sol", + "filename_short": "tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol", "is_dependency": false, "lines": [ + 7, 8, - 9, - 10 + 9 ], "starting_column": 5, "ending_column": 6 @@ -27,11 +27,11 @@ "name": "MyConc", "source_mapping": { "start": 0, - "length": 573, + "length": 578, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-equality/boolean-equality.sol", + "filename_relative": "tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-equality/boolean-equality.sol", + "filename_short": "tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol", "is_dependency": false, "lines": [ 1, @@ -60,10 +60,11 @@ 24, 25, 26, - 27 + 27, + 28 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, "signature": "bad1(bool)" @@ -73,15 +74,15 @@ "type": "node", "name": "(b == true)", "source_mapping": { - "start": 193, + "start": 198, "length": 18, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-equality/boolean-equality.sol", + "filename_relative": "tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-equality/boolean-equality.sol", + "filename_short": "tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol", "is_dependency": false, "lines": [ - 9 + 8 ], "starting_column": 9, "ending_column": 27 @@ -91,17 +92,17 @@ "type": "function", "name": "bad1", "source_mapping": { - "start": 134, + "start": 139, "length": 84, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-equality/boolean-equality.sol", + "filename_relative": "tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-equality/boolean-equality.sol", + "filename_short": "tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol", "is_dependency": false, "lines": [ + 7, 8, - 9, - 10 + 9 ], "starting_column": 5, "ending_column": 6 @@ -112,11 +113,11 @@ "name": "MyConc", "source_mapping": { "start": 0, - "length": 573, + "length": 578, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-equality/boolean-equality.sol", + "filename_relative": "tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-equality/boolean-equality.sol", + "filename_short": "tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol", "is_dependency": false, "lines": [ 1, @@ -145,10 +146,11 @@ 24, 25, 26, - 27 + 27, + 28 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, "signature": "bad1(bool)" @@ -157,9 +159,9 @@ } } ], - "description": "MyConc.bad1(bool) (tests/detectors/boolean-equality/boolean-equality.sol#8-10) compares to a boolean constant:\n\t-(b == true) (tests/detectors/boolean-equality/boolean-equality.sol#9)\n", - "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-equality/boolean-equality.sol#L8-L10) compares to a boolean constant:\n\t-[(b == true)](tests/detectors/boolean-equality/boolean-equality.sol#L9)\n", - "id": "62abb2589dfdb591044c10941ebc076ca56579e64bb3076c82c3acc761805495", + "description": "MyConc.bad1(bool) (tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol#7-9) compares to a boolean constant:\n\t-(b == true) (tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol#8)\n", + "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol#L7-L9) compares to a boolean constant:\n\t-[(b == true)](tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol#L8)\n", + "id": "f74a4de05a37e9f8a5f8926e2981a611972623fd7a0281f6d2bc4ec32899abfe", "check": "boolean-equal", "impact": "Informational", "confidence": "High" diff --git a/tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol b/tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol similarity index 100% rename from tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol rename to tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol diff --git a/tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol.0.4.25.BooleanConstantMisuse.json b/tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol.0.4.25.BooleanConstantMisuse.json new file mode 100644 index 0000000000..0ab8443637 --- /dev/null +++ b/tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol.0.4.25.BooleanConstantMisuse.json @@ -0,0 +1,208 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 162, + "length": 84, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "MyConc", + "source_mapping": { + "start": 0, + "length": 923, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad1(bool)" + } + }, + { + "type": "node", + "name": "(b || true)", + "source_mapping": { + "start": 221, + "length": 18, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 9, + "ending_column": 27 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 162, + "length": 84, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "MyConc", + "source_mapping": { + "start": 0, + "length": 923, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad1(bool)" + } + } + } + } + ], + "description": "MyConc.bad1(bool) (tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol#9-11) uses a Boolean constant improperly:\n\t-(b || true) (tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol#10)\n", + "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol#L9-L11) uses a Boolean constant improperly:\n\t-[(b || true)](tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol#L10)\n", + "id": "c8c323396d19d9ddfd97f18ed731c7f07bb1cc030c198c830b595a770aeb26c2", + "check": "boolean-cst", + "impact": "Medium", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol b/tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol new file mode 100644 index 0000000000..6d3df44f32 --- /dev/null +++ b/tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol @@ -0,0 +1,46 @@ +contract MyConc { + function bad0(bool foo) public pure returns (bool) { + if (foo) { + return true; + } + return false; + } + + function bad1(bool b) public pure returns (bool) { + return (b || true); + } + + function bad2(bool x, uint8 y) public pure returns (bool) { + while (x == (y > 0)) { + return true; + } + return false; + } + + function bad3(bool a) public pure returns (bool) { + uint256 b = 0; + while (a) { + b++; + } + return true; + } + + function bad4() public pure returns (bool) { + uint256 b = 0; + while (true) { + b++; + } + return true; + } + + function bad5() public pure returns (bool) { + while (true) { + return true; + } + return false; + } + + function good() public pure returns (bool) { + return true; + } +} \ No newline at end of file diff --git a/tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol.0.5.16.BooleanConstantMisuse.json b/tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol.0.5.16.BooleanConstantMisuse.json new file mode 100644 index 0000000000..a30e3ec86e --- /dev/null +++ b/tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol.0.5.16.BooleanConstantMisuse.json @@ -0,0 +1,208 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 162, + "length": 84, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "MyConc", + "source_mapping": { + "start": 0, + "length": 923, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad1(bool)" + } + }, + { + "type": "node", + "name": "(b || true)", + "source_mapping": { + "start": 221, + "length": 18, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 9, + "ending_column": 27 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 162, + "length": 84, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "MyConc", + "source_mapping": { + "start": 0, + "length": 923, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad1(bool)" + } + } + } + } + ], + "description": "MyConc.bad1(bool) (tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol#9-11) uses a Boolean constant improperly:\n\t-(b || true) (tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol#10)\n", + "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol#L9-L11) uses a Boolean constant improperly:\n\t-[(b || true)](tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol#L10)\n", + "id": "f6ceb7e0651a96a88da265b955956fb4a3878f1491c81cf6bc8e433b5006e6aa", + "check": "boolean-cst", + "impact": "Medium", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol b/tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol new file mode 100644 index 0000000000..6d3df44f32 --- /dev/null +++ b/tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol @@ -0,0 +1,46 @@ +contract MyConc { + function bad0(bool foo) public pure returns (bool) { + if (foo) { + return true; + } + return false; + } + + function bad1(bool b) public pure returns (bool) { + return (b || true); + } + + function bad2(bool x, uint8 y) public pure returns (bool) { + while (x == (y > 0)) { + return true; + } + return false; + } + + function bad3(bool a) public pure returns (bool) { + uint256 b = 0; + while (a) { + b++; + } + return true; + } + + function bad4() public pure returns (bool) { + uint256 b = 0; + while (true) { + b++; + } + return true; + } + + function bad5() public pure returns (bool) { + while (true) { + return true; + } + return false; + } + + function good() public pure returns (bool) { + return true; + } +} \ No newline at end of file diff --git a/tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol.0.6.11.BooleanConstantMisuse.json b/tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol.0.6.11.BooleanConstantMisuse.json new file mode 100644 index 0000000000..e1330807b8 --- /dev/null +++ b/tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol.0.6.11.BooleanConstantMisuse.json @@ -0,0 +1,208 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 162, + "length": 84, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "MyConc", + "source_mapping": { + "start": 0, + "length": 923, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad1(bool)" + } + }, + { + "type": "node", + "name": "(b || true)", + "source_mapping": { + "start": 221, + "length": 18, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 9, + "ending_column": 27 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 162, + "length": 84, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "MyConc", + "source_mapping": { + "start": 0, + "length": 923, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad1(bool)" + } + } + } + } + ], + "description": "MyConc.bad1(bool) (tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol#9-11) uses a Boolean constant improperly:\n\t-(b || true) (tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol#10)\n", + "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol#L9-L11) uses a Boolean constant improperly:\n\t-[(b || true)](tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol#L10)\n", + "id": "0b2599e627a1163a49a4113426fe385f5987d7e247cdbe8e2d9b39988b95478a", + "check": "boolean-cst", + "impact": "Medium", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol b/tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol new file mode 100644 index 0000000000..6d3df44f32 --- /dev/null +++ b/tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol @@ -0,0 +1,46 @@ +contract MyConc { + function bad0(bool foo) public pure returns (bool) { + if (foo) { + return true; + } + return false; + } + + function bad1(bool b) public pure returns (bool) { + return (b || true); + } + + function bad2(bool x, uint8 y) public pure returns (bool) { + while (x == (y > 0)) { + return true; + } + return false; + } + + function bad3(bool a) public pure returns (bool) { + uint256 b = 0; + while (a) { + b++; + } + return true; + } + + function bad4() public pure returns (bool) { + uint256 b = 0; + while (true) { + b++; + } + return true; + } + + function bad5() public pure returns (bool) { + while (true) { + return true; + } + return false; + } + + function good() public pure returns (bool) { + return true; + } +} \ No newline at end of file diff --git a/tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol.0.6.0.BooleanConstantMisuse.json b/tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol.0.7.6.BooleanConstantMisuse.json similarity index 88% rename from tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol.0.6.0.BooleanConstantMisuse.json rename to tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol.0.7.6.BooleanConstantMisuse.json index a4bf8607d3..62b170eb16 100644 --- a/tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol.0.6.0.BooleanConstantMisuse.json +++ b/tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol.0.7.6.BooleanConstantMisuse.json @@ -9,9 +9,9 @@ "start": 162, "length": 84, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol", + "filename_relative": "tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol", + "filename_short": "tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol", "is_dependency": false, "lines": [ 9, @@ -29,9 +29,9 @@ "start": 0, "length": 923, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol", + "filename_relative": "tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol", + "filename_short": "tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol", "is_dependency": false, "lines": [ 1, @@ -96,9 +96,9 @@ "start": 221, "length": 18, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol", + "filename_relative": "tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol", + "filename_short": "tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol", "is_dependency": false, "lines": [ 10 @@ -114,9 +114,9 @@ "start": 162, "length": 84, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol", + "filename_relative": "tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol", + "filename_short": "tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol", "is_dependency": false, "lines": [ 9, @@ -134,9 +134,9 @@ "start": 0, "length": 923, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol", + "filename_relative": "tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol", + "filename_short": "tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol", "is_dependency": false, "lines": [ 1, @@ -197,9 +197,9 @@ } } ], - "description": "MyConc.bad1(bool) (tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol#9-11) uses a Boolean constant improperly:\n\t-(b || true) (tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol#10)\n", - "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol#L9-L11) uses a Boolean constant improperly:\n\t-[(b || true)](tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol#L10)\n", - "id": "12517fed0ec8f0a2232b467a6add9fd94a6a84325017e02e8a48794fc9112c6b", + "description": "MyConc.bad1(bool) (tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol#9-11) uses a Boolean constant improperly:\n\t-(b || true) (tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol#10)\n", + "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol#L9-L11) uses a Boolean constant improperly:\n\t-[(b || true)](tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol#L10)\n", + "id": "a7e009ec0e6c5e4bf5dd828bcbeff63d020b9e2a10ad7ad350c13ad8cd277697", "check": "boolean-cst", "impact": "Medium", "confidence": "Medium" diff --git a/tests/detectors/calls-loop/multiple_calls_in_loop.sol b/tests/detectors/calls-loop/0.4.25/multiple_calls_in_loop.sol similarity index 100% rename from tests/detectors/calls-loop/multiple_calls_in_loop.sol rename to tests/detectors/calls-loop/0.4.25/multiple_calls_in_loop.sol diff --git a/tests/detectors/calls-loop/multiple_calls_in_loop.sol.0.4.25.MultipleCallsInLoop.json b/tests/detectors/calls-loop/0.4.25/multiple_calls_in_loop.sol.0.4.25.MultipleCallsInLoop.json similarity index 86% rename from tests/detectors/calls-loop/multiple_calls_in_loop.sol.0.4.25.MultipleCallsInLoop.json rename to tests/detectors/calls-loop/0.4.25/multiple_calls_in_loop.sol.0.4.25.MultipleCallsInLoop.json index e36eaaa64b..151351f60d 100644 --- a/tests/detectors/calls-loop/multiple_calls_in_loop.sol.0.4.25.MultipleCallsInLoop.json +++ b/tests/detectors/calls-loop/0.4.25/multiple_calls_in_loop.sol.0.4.25.MultipleCallsInLoop.json @@ -9,9 +9,9 @@ "start": 153, "length": 135, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/calls-loop/multiple_calls_in_loop.sol", + "filename_relative": "tests/detectors/calls-loop/0.4.25/multiple_calls_in_loop.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/calls-loop/multiple_calls_in_loop.sol", + "filename_short": "tests/detectors/calls-loop/0.4.25/multiple_calls_in_loop.sol", "is_dependency": false, "lines": [ 9, @@ -31,9 +31,9 @@ "start": 0, "length": 291, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/calls-loop/multiple_calls_in_loop.sol", + "filename_relative": "tests/detectors/calls-loop/0.4.25/multiple_calls_in_loop.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/calls-loop/multiple_calls_in_loop.sol", + "filename_short": "tests/detectors/calls-loop/0.4.25/multiple_calls_in_loop.sol", "is_dependency": false, "lines": [ 1, @@ -66,9 +66,9 @@ "start": 244, "length": 27, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/calls-loop/multiple_calls_in_loop.sol", + "filename_relative": "tests/detectors/calls-loop/0.4.25/multiple_calls_in_loop.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/calls-loop/multiple_calls_in_loop.sol", + "filename_short": "tests/detectors/calls-loop/0.4.25/multiple_calls_in_loop.sol", "is_dependency": false, "lines": [ 11 @@ -84,9 +84,9 @@ "start": 153, "length": 135, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/calls-loop/multiple_calls_in_loop.sol", + "filename_relative": "tests/detectors/calls-loop/0.4.25/multiple_calls_in_loop.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/calls-loop/multiple_calls_in_loop.sol", + "filename_short": "tests/detectors/calls-loop/0.4.25/multiple_calls_in_loop.sol", "is_dependency": false, "lines": [ 9, @@ -106,9 +106,9 @@ "start": 0, "length": 291, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/calls-loop/multiple_calls_in_loop.sol", + "filename_relative": "tests/detectors/calls-loop/0.4.25/multiple_calls_in_loop.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/calls-loop/multiple_calls_in_loop.sol", + "filename_short": "tests/detectors/calls-loop/0.4.25/multiple_calls_in_loop.sol", "is_dependency": false, "lines": [ 1, @@ -137,9 +137,9 @@ } } ], - "description": "CallInLoop.bad() (tests/detectors/calls-loop/multiple_calls_in_loop.sol#9-13) has external calls inside a loop: destinations[i].transfer(i) (tests/detectors/calls-loop/multiple_calls_in_loop.sol#11)\n", - "markdown": "[CallInLoop.bad()](tests/detectors/calls-loop/multiple_calls_in_loop.sol#L9-L13) has external calls inside a loop: [destinations[i].transfer(i)](tests/detectors/calls-loop/multiple_calls_in_loop.sol#L11)\n", - "id": "b5ddb0f2f8ab2160ca8a3f429672693f7a82cb9c5b69c571aa114385b13005e7", + "description": "CallInLoop.bad() (tests/detectors/calls-loop/0.4.25/multiple_calls_in_loop.sol#9-13) has external calls inside a loop: destinations[i].transfer(i) (tests/detectors/calls-loop/0.4.25/multiple_calls_in_loop.sol#11)\n", + "markdown": "[CallInLoop.bad()](tests/detectors/calls-loop/0.4.25/multiple_calls_in_loop.sol#L9-L13) has external calls inside a loop: [destinations[i].transfer(i)](tests/detectors/calls-loop/0.4.25/multiple_calls_in_loop.sol#L11)\n", + "id": "997dd7de40b82c6ac8e98324329bd99f827ed067c22d5b508b2e56c87ad49c0a", "check": "calls-loop", "impact": "Low", "confidence": "Medium" diff --git a/tests/detectors/calls-loop/0.5.16/multiple_calls_in_loop.sol b/tests/detectors/calls-loop/0.5.16/multiple_calls_in_loop.sol new file mode 100644 index 0000000000..ba79a4e6af --- /dev/null +++ b/tests/detectors/calls-loop/0.5.16/multiple_calls_in_loop.sol @@ -0,0 +1,15 @@ +contract CallInLoop{ + + address[] destinations; + + constructor(address[] memory newDestinations) public{ + destinations = newDestinations; + } + + function bad() external{ + for (uint i=0; i < destinations.length; i++){ + address(uint160(destinations[i])).transfer(i); + } + } + +} diff --git a/tests/detectors/calls-loop/0.5.16/multiple_calls_in_loop.sol.0.5.16.MultipleCallsInLoop.json b/tests/detectors/calls-loop/0.5.16/multiple_calls_in_loop.sol.0.5.16.MultipleCallsInLoop.json new file mode 100644 index 0000000000..11fc8491aa --- /dev/null +++ b/tests/detectors/calls-loop/0.5.16/multiple_calls_in_loop.sol.0.5.16.MultipleCallsInLoop.json @@ -0,0 +1,148 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad", + "source_mapping": { + "start": 160, + "length": 153, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/calls-loop/0.5.16/multiple_calls_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/calls-loop/0.5.16/multiple_calls_in_loop.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "CallInLoop", + "source_mapping": { + "start": 0, + "length": 316, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/calls-loop/0.5.16/multiple_calls_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/calls-loop/0.5.16/multiple_calls_in_loop.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad()" + } + }, + { + "type": "node", + "name": "address(uint160(destinations[i])).transfer(i)", + "source_mapping": { + "start": 251, + "length": 45, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/calls-loop/0.5.16/multiple_calls_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/calls-loop/0.5.16/multiple_calls_in_loop.sol", + "is_dependency": false, + "lines": [ + 11 + ], + "starting_column": 13, + "ending_column": 58 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad", + "source_mapping": { + "start": 160, + "length": 153, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/calls-loop/0.5.16/multiple_calls_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/calls-loop/0.5.16/multiple_calls_in_loop.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "CallInLoop", + "source_mapping": { + "start": 0, + "length": 316, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/calls-loop/0.5.16/multiple_calls_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/calls-loop/0.5.16/multiple_calls_in_loop.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad()" + } + } + } + } + ], + "description": "CallInLoop.bad() (tests/detectors/calls-loop/0.5.16/multiple_calls_in_loop.sol#9-13) has external calls inside a loop: address(uint160(destinations[i])).transfer(i) (tests/detectors/calls-loop/0.5.16/multiple_calls_in_loop.sol#11)\n", + "markdown": "[CallInLoop.bad()](tests/detectors/calls-loop/0.5.16/multiple_calls_in_loop.sol#L9-L13) has external calls inside a loop: [address(uint160(destinations[i])).transfer(i)](tests/detectors/calls-loop/0.5.16/multiple_calls_in_loop.sol#L11)\n", + "id": "47b82a76ee810d93f014f425eefea8adbb806036dfee401a9883b1aa3ca85c44", + "check": "calls-loop", + "impact": "Low", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/calls-loop/0.6.11/multiple_calls_in_loop.sol b/tests/detectors/calls-loop/0.6.11/multiple_calls_in_loop.sol new file mode 100644 index 0000000000..ba79a4e6af --- /dev/null +++ b/tests/detectors/calls-loop/0.6.11/multiple_calls_in_loop.sol @@ -0,0 +1,15 @@ +contract CallInLoop{ + + address[] destinations; + + constructor(address[] memory newDestinations) public{ + destinations = newDestinations; + } + + function bad() external{ + for (uint i=0; i < destinations.length; i++){ + address(uint160(destinations[i])).transfer(i); + } + } + +} diff --git a/tests/detectors/calls-loop/0.6.11/multiple_calls_in_loop.sol.0.6.11.MultipleCallsInLoop.json b/tests/detectors/calls-loop/0.6.11/multiple_calls_in_loop.sol.0.6.11.MultipleCallsInLoop.json new file mode 100644 index 0000000000..705c749959 --- /dev/null +++ b/tests/detectors/calls-loop/0.6.11/multiple_calls_in_loop.sol.0.6.11.MultipleCallsInLoop.json @@ -0,0 +1,148 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad", + "source_mapping": { + "start": 160, + "length": 153, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/calls-loop/0.6.11/multiple_calls_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/calls-loop/0.6.11/multiple_calls_in_loop.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "CallInLoop", + "source_mapping": { + "start": 0, + "length": 316, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/calls-loop/0.6.11/multiple_calls_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/calls-loop/0.6.11/multiple_calls_in_loop.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad()" + } + }, + { + "type": "node", + "name": "address(uint160(destinations[i])).transfer(i)", + "source_mapping": { + "start": 251, + "length": 45, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/calls-loop/0.6.11/multiple_calls_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/calls-loop/0.6.11/multiple_calls_in_loop.sol", + "is_dependency": false, + "lines": [ + 11 + ], + "starting_column": 13, + "ending_column": 58 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad", + "source_mapping": { + "start": 160, + "length": 153, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/calls-loop/0.6.11/multiple_calls_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/calls-loop/0.6.11/multiple_calls_in_loop.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "CallInLoop", + "source_mapping": { + "start": 0, + "length": 316, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/calls-loop/0.6.11/multiple_calls_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/calls-loop/0.6.11/multiple_calls_in_loop.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad()" + } + } + } + } + ], + "description": "CallInLoop.bad() (tests/detectors/calls-loop/0.6.11/multiple_calls_in_loop.sol#9-13) has external calls inside a loop: address(uint160(destinations[i])).transfer(i) (tests/detectors/calls-loop/0.6.11/multiple_calls_in_loop.sol#11)\n", + "markdown": "[CallInLoop.bad()](tests/detectors/calls-loop/0.6.11/multiple_calls_in_loop.sol#L9-L13) has external calls inside a loop: [address(uint160(destinations[i])).transfer(i)](tests/detectors/calls-loop/0.6.11/multiple_calls_in_loop.sol#L11)\n", + "id": "f7fa2b373fe4eb9207d3ed267d99d7ca34ec7d786898816bc113c3e20079a411", + "check": "calls-loop", + "impact": "Low", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/calls-loop/0.7.6/multiple_calls_in_loop.sol b/tests/detectors/calls-loop/0.7.6/multiple_calls_in_loop.sol new file mode 100644 index 0000000000..ba79a4e6af --- /dev/null +++ b/tests/detectors/calls-loop/0.7.6/multiple_calls_in_loop.sol @@ -0,0 +1,15 @@ +contract CallInLoop{ + + address[] destinations; + + constructor(address[] memory newDestinations) public{ + destinations = newDestinations; + } + + function bad() external{ + for (uint i=0; i < destinations.length; i++){ + address(uint160(destinations[i])).transfer(i); + } + } + +} diff --git a/tests/detectors/calls-loop/0.7.6/multiple_calls_in_loop.sol.0.7.6.MultipleCallsInLoop.json b/tests/detectors/calls-loop/0.7.6/multiple_calls_in_loop.sol.0.7.6.MultipleCallsInLoop.json new file mode 100644 index 0000000000..6381a802d3 --- /dev/null +++ b/tests/detectors/calls-loop/0.7.6/multiple_calls_in_loop.sol.0.7.6.MultipleCallsInLoop.json @@ -0,0 +1,148 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad", + "source_mapping": { + "start": 160, + "length": 153, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/calls-loop/0.7.6/multiple_calls_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/calls-loop/0.7.6/multiple_calls_in_loop.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "CallInLoop", + "source_mapping": { + "start": 0, + "length": 316, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/calls-loop/0.7.6/multiple_calls_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/calls-loop/0.7.6/multiple_calls_in_loop.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad()" + } + }, + { + "type": "node", + "name": "address(uint160(destinations[i])).transfer(i)", + "source_mapping": { + "start": 251, + "length": 45, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/calls-loop/0.7.6/multiple_calls_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/calls-loop/0.7.6/multiple_calls_in_loop.sol", + "is_dependency": false, + "lines": [ + 11 + ], + "starting_column": 13, + "ending_column": 58 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad", + "source_mapping": { + "start": 160, + "length": 153, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/calls-loop/0.7.6/multiple_calls_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/calls-loop/0.7.6/multiple_calls_in_loop.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "CallInLoop", + "source_mapping": { + "start": 0, + "length": 316, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/calls-loop/0.7.6/multiple_calls_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/calls-loop/0.7.6/multiple_calls_in_loop.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad()" + } + } + } + } + ], + "description": "CallInLoop.bad() (tests/detectors/calls-loop/0.7.6/multiple_calls_in_loop.sol#9-13) has external calls inside a loop: address(uint160(destinations[i])).transfer(i) (tests/detectors/calls-loop/0.7.6/multiple_calls_in_loop.sol#11)\n", + "markdown": "[CallInLoop.bad()](tests/detectors/calls-loop/0.7.6/multiple_calls_in_loop.sol#L9-L13) has external calls inside a loop: [address(uint160(destinations[i])).transfer(i)](tests/detectors/calls-loop/0.7.6/multiple_calls_in_loop.sol#L11)\n", + "id": "c06ed4f7f79cddc5fbc2f828500766cab0a6d18b262a0f8e9c227cef7e6607df", + "check": "calls-loop", + "impact": "Low", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/constable-states/const_state_variables.sol b/tests/detectors/constable-states/0.4.25/const_state_variables.sol similarity index 100% rename from tests/detectors/constable-states/const_state_variables.sol rename to tests/detectors/constable-states/0.4.25/const_state_variables.sol diff --git a/tests/detectors/constable-states/const_state_variables.sol.0.4.25.ConstCandidateStateVars.json b/tests/detectors/constable-states/0.4.25/const_state_variables.sol.0.4.25.ConstCandidateStateVars.json similarity index 88% rename from tests/detectors/constable-states/const_state_variables.sol.0.4.25.ConstCandidateStateVars.json rename to tests/detectors/constable-states/0.4.25/const_state_variables.sol.0.4.25.ConstCandidateStateVars.json index 2fa7ffab4f..55846237be 100644 --- a/tests/detectors/constable-states/const_state_variables.sol.0.4.25.ConstCandidateStateVars.json +++ b/tests/detectors/constable-states/0.4.25/const_state_variables.sol.0.4.25.ConstCandidateStateVars.json @@ -9,9 +9,9 @@ "start": 132, "length": 76, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constable-states/const_state_variables.sol", + "filename_relative": "tests/detectors/constable-states/0.4.25/const_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constable-states/const_state_variables.sol", + "filename_short": "tests/detectors/constable-states/0.4.25/const_state_variables.sol", "is_dependency": false, "lines": [ 7 @@ -27,9 +27,9 @@ "start": 29, "length": 441, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constable-states/const_state_variables.sol", + "filename_relative": "tests/detectors/constable-states/0.4.25/const_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constable-states/const_state_variables.sol", + "filename_short": "tests/detectors/constable-states/0.4.25/const_state_variables.sol", "is_dependency": false, "lines": [ 4, @@ -58,8 +58,8 @@ } } ], - "description": "A.myFriendsAddress (tests/detectors/constable-states/const_state_variables.sol#7) should be constant\n", - "markdown": "[A.myFriendsAddress](tests/detectors/constable-states/const_state_variables.sol#L7) should be constant\n", + "description": "A.myFriendsAddress (tests/detectors/constable-states/0.4.25/const_state_variables.sol#7) should be constant\n", + "markdown": "[A.myFriendsAddress](tests/detectors/constable-states/0.4.25/const_state_variables.sol#L7) should be constant\n", "id": "1454db80653b732bf6acbe54ff0ae4707002207a2a8216708c12d61c88a43e5f", "check": "constable-states", "impact": "Optimization", @@ -74,9 +74,9 @@ "start": 237, "length": 20, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constable-states/const_state_variables.sol", + "filename_relative": "tests/detectors/constable-states/0.4.25/const_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constable-states/const_state_variables.sol", + "filename_short": "tests/detectors/constable-states/0.4.25/const_state_variables.sol", "is_dependency": false, "lines": [ 10 @@ -92,9 +92,9 @@ "start": 29, "length": 441, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constable-states/const_state_variables.sol", + "filename_relative": "tests/detectors/constable-states/0.4.25/const_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constable-states/const_state_variables.sol", + "filename_short": "tests/detectors/constable-states/0.4.25/const_state_variables.sol", "is_dependency": false, "lines": [ 4, @@ -123,8 +123,8 @@ } } ], - "description": "A.test (tests/detectors/constable-states/const_state_variables.sol#10) should be constant\n", - "markdown": "[A.test](tests/detectors/constable-states/const_state_variables.sol#L10) should be constant\n", + "description": "A.test (tests/detectors/constable-states/0.4.25/const_state_variables.sol#10) should be constant\n", + "markdown": "[A.test](tests/detectors/constable-states/0.4.25/const_state_variables.sol#L10) should be constant\n", "id": "5d9e3fb413322b71a93e90f7e89bd8c83cd4884d577d039598c681fe9db38b1d", "check": "constable-states", "impact": "Optimization", @@ -139,9 +139,9 @@ "start": 333, "length": 20, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constable-states/const_state_variables.sol", + "filename_relative": "tests/detectors/constable-states/0.4.25/const_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constable-states/const_state_variables.sol", + "filename_short": "tests/detectors/constable-states/0.4.25/const_state_variables.sol", "is_dependency": false, "lines": [ 14 @@ -157,9 +157,9 @@ "start": 29, "length": 441, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constable-states/const_state_variables.sol", + "filename_relative": "tests/detectors/constable-states/0.4.25/const_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constable-states/const_state_variables.sol", + "filename_short": "tests/detectors/constable-states/0.4.25/const_state_variables.sol", "is_dependency": false, "lines": [ 4, @@ -188,8 +188,8 @@ } } ], - "description": "A.text2 (tests/detectors/constable-states/const_state_variables.sol#14) should be constant\n", - "markdown": "[A.text2](tests/detectors/constable-states/const_state_variables.sol#L14) should be constant\n", + "description": "A.text2 (tests/detectors/constable-states/0.4.25/const_state_variables.sol#14) should be constant\n", + "markdown": "[A.text2](tests/detectors/constable-states/0.4.25/const_state_variables.sol#L14) should be constant\n", "id": "df11e6201c4558a8c5cd90b55b134b9ca8f07203b2264d3aa93bd7745e8cb4ba", "check": "constable-states", "impact": "Optimization", @@ -204,9 +204,9 @@ "start": 496, "length": 76, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constable-states/const_state_variables.sol", + "filename_relative": "tests/detectors/constable-states/0.4.25/const_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constable-states/const_state_variables.sol", + "filename_short": "tests/detectors/constable-states/0.4.25/const_state_variables.sol", "is_dependency": false, "lines": [ 26 @@ -222,9 +222,9 @@ "start": 473, "length": 271, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constable-states/const_state_variables.sol", + "filename_relative": "tests/detectors/constable-states/0.4.25/const_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constable-states/const_state_variables.sol", + "filename_short": "tests/detectors/constable-states/0.4.25/const_state_variables.sol", "is_dependency": false, "lines": [ 24, @@ -249,8 +249,8 @@ } } ], - "description": "B.mySistersAddress (tests/detectors/constable-states/const_state_variables.sol#26) should be constant\n", - "markdown": "[B.mySistersAddress](tests/detectors/constable-states/const_state_variables.sol#L26) should be constant\n", + "description": "B.mySistersAddress (tests/detectors/constable-states/0.4.25/const_state_variables.sol#26) should be constant\n", + "markdown": "[B.mySistersAddress](tests/detectors/constable-states/0.4.25/const_state_variables.sol#L26) should be constant\n", "id": "bee93a722c8eae4a48aade67d8ef537d84c106f48fc9eb738c795fce10d3bc63", "check": "constable-states", "impact": "Optimization", @@ -265,9 +265,9 @@ "start": 793, "length": 42, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constable-states/const_state_variables.sol", + "filename_relative": "tests/detectors/constable-states/0.4.25/const_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constable-states/const_state_variables.sol", + "filename_short": "tests/detectors/constable-states/0.4.25/const_state_variables.sol", "is_dependency": false, "lines": [ 42 @@ -283,9 +283,9 @@ "start": 746, "length": 342, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constable-states/const_state_variables.sol", + "filename_relative": "tests/detectors/constable-states/0.4.25/const_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constable-states/const_state_variables.sol", + "filename_short": "tests/detectors/constable-states/0.4.25/const_state_variables.sol", "is_dependency": false, "lines": [ 39, @@ -310,8 +310,8 @@ } } ], - "description": "MyConc.should_be_constant (tests/detectors/constable-states/const_state_variables.sol#42) should be constant\n", - "markdown": "[MyConc.should_be_constant](tests/detectors/constable-states/const_state_variables.sol#L42) should be constant\n", + "description": "MyConc.should_be_constant (tests/detectors/constable-states/0.4.25/const_state_variables.sol#42) should be constant\n", + "markdown": "[MyConc.should_be_constant](tests/detectors/constable-states/0.4.25/const_state_variables.sol#L42) should be constant\n", "id": "cbcafa2a3efba4d21ac1b51b4b823e5082d556bc3d6cf3fd2ab3188f9f218fc1", "check": "constable-states", "impact": "Optimization", @@ -326,9 +326,9 @@ "start": 841, "length": 33, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constable-states/const_state_variables.sol", + "filename_relative": "tests/detectors/constable-states/0.4.25/const_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constable-states/const_state_variables.sol", + "filename_short": "tests/detectors/constable-states/0.4.25/const_state_variables.sol", "is_dependency": false, "lines": [ 43 @@ -344,9 +344,9 @@ "start": 746, "length": 342, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constable-states/const_state_variables.sol", + "filename_relative": "tests/detectors/constable-states/0.4.25/const_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constable-states/const_state_variables.sol", + "filename_short": "tests/detectors/constable-states/0.4.25/const_state_variables.sol", "is_dependency": false, "lines": [ 39, @@ -371,8 +371,8 @@ } } ], - "description": "MyConc.should_be_constant_2 (tests/detectors/constable-states/const_state_variables.sol#43) should be constant\n", - "markdown": "[MyConc.should_be_constant_2](tests/detectors/constable-states/const_state_variables.sol#L43) should be constant\n", + "description": "MyConc.should_be_constant_2 (tests/detectors/constable-states/0.4.25/const_state_variables.sol#43) should be constant\n", + "markdown": "[MyConc.should_be_constant_2](tests/detectors/constable-states/0.4.25/const_state_variables.sol#L43) should be constant\n", "id": "9a48a4122de1a6a4774a9f1e0d4917bd0fa08f17b4af41b86ba07689e51bf711", "check": "constable-states", "impact": "Optimization", diff --git a/tests/detectors/constable-states/0.5.16/const_state_variables.sol b/tests/detectors/constable-states/0.5.16/const_state_variables.sol new file mode 100644 index 0000000000..aed05d97fb --- /dev/null +++ b/tests/detectors/constable-states/0.5.16/const_state_variables.sol @@ -0,0 +1,52 @@ +//pragma solidity ^0.4.24; + + +contract A { + + address constant public MY_ADDRESS = 0xE0f5206BBD039e7b0592d8918820024e2a7437b9; + address public myFriendsAddress = 0xc0ffee254729296a45a3885639AC7E10F9d54979; + + uint public used; + uint public test = 5; + + uint constant X = 32**22 + 8; + string constant TEXT1 = "abc"; + string text2 = "xyz"; + + function setUsed() public { + if (msg.sender == MY_ADDRESS) { + used = test; + } + } +} + + +contract B is A { + + address public mySistersAddress = 0x999999cf1046e68e36E1aA2E0E07105eDDD1f08E; + + function () external { + used = 0; + } + + function setUsed(uint a) public { + if (msg.sender == MY_ADDRESS) { + used = a; + } + } +} + +contract MyConc{ + + uint constant A = 1; + bytes32 should_be_constant = sha256('abc'); + uint should_be_constant_2 = A + 1; + address not_constant = msg.sender; + uint not_constant_2 = getNumber(); + uint not_constant_3 = 10 + block.number; + + function getNumber() public returns(uint){ + return block.number; + } + +} diff --git a/tests/detectors/constable-states/0.5.16/const_state_variables.sol.0.5.16.ConstCandidateStateVars.json b/tests/detectors/constable-states/0.5.16/const_state_variables.sol.0.5.16.ConstCandidateStateVars.json new file mode 100644 index 0000000000..d13d11be48 --- /dev/null +++ b/tests/detectors/constable-states/0.5.16/const_state_variables.sol.0.5.16.ConstCandidateStateVars.json @@ -0,0 +1,382 @@ +[ + [ + { + "elements": [ + { + "type": "variable", + "name": "myFriendsAddress", + "source_mapping": { + "start": 132, + "length": 76, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/constable-states/0.5.16/const_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/constable-states/0.5.16/const_state_variables.sol", + "is_dependency": false, + "lines": [ + 7 + ], + "starting_column": 5, + "ending_column": 81 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 29, + "length": 441, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/constable-states/0.5.16/const_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/constable-states/0.5.16/const_state_variables.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + } + ], + "description": "A.myFriendsAddress (tests/detectors/constable-states/0.5.16/const_state_variables.sol#7) should be constant\n", + "markdown": "[A.myFriendsAddress](tests/detectors/constable-states/0.5.16/const_state_variables.sol#L7) should be constant\n", + "id": "1454db80653b732bf6acbe54ff0ae4707002207a2a8216708c12d61c88a43e5f", + "check": "constable-states", + "impact": "Optimization", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "test", + "source_mapping": { + "start": 237, + "length": 20, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/constable-states/0.5.16/const_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/constable-states/0.5.16/const_state_variables.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 5, + "ending_column": 25 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 29, + "length": 441, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/constable-states/0.5.16/const_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/constable-states/0.5.16/const_state_variables.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + } + ], + "description": "A.test (tests/detectors/constable-states/0.5.16/const_state_variables.sol#10) should be constant\n", + "markdown": "[A.test](tests/detectors/constable-states/0.5.16/const_state_variables.sol#L10) should be constant\n", + "id": "5d9e3fb413322b71a93e90f7e89bd8c83cd4884d577d039598c681fe9db38b1d", + "check": "constable-states", + "impact": "Optimization", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "text2", + "source_mapping": { + "start": 333, + "length": 20, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/constable-states/0.5.16/const_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/constable-states/0.5.16/const_state_variables.sol", + "is_dependency": false, + "lines": [ + 14 + ], + "starting_column": 5, + "ending_column": 25 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 29, + "length": 441, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/constable-states/0.5.16/const_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/constable-states/0.5.16/const_state_variables.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + } + ], + "description": "A.text2 (tests/detectors/constable-states/0.5.16/const_state_variables.sol#14) should be constant\n", + "markdown": "[A.text2](tests/detectors/constable-states/0.5.16/const_state_variables.sol#L14) should be constant\n", + "id": "df11e6201c4558a8c5cd90b55b134b9ca8f07203b2264d3aa93bd7745e8cb4ba", + "check": "constable-states", + "impact": "Optimization", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "mySistersAddress", + "source_mapping": { + "start": 496, + "length": 76, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/constable-states/0.5.16/const_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/constable-states/0.5.16/const_state_variables.sol", + "is_dependency": false, + "lines": [ + 26 + ], + "starting_column": 5, + "ending_column": 81 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "B", + "source_mapping": { + "start": 473, + "length": 271, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/constable-states/0.5.16/const_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/constable-states/0.5.16/const_state_variables.sol", + "is_dependency": false, + "lines": [ + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + } + ], + "description": "B.mySistersAddress (tests/detectors/constable-states/0.5.16/const_state_variables.sol#26) should be constant\n", + "markdown": "[B.mySistersAddress](tests/detectors/constable-states/0.5.16/const_state_variables.sol#L26) should be constant\n", + "id": "bee93a722c8eae4a48aade67d8ef537d84c106f48fc9eb738c795fce10d3bc63", + "check": "constable-states", + "impact": "Optimization", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "should_be_constant", + "source_mapping": { + "start": 793, + "length": 42, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/constable-states/0.5.16/const_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/constable-states/0.5.16/const_state_variables.sol", + "is_dependency": false, + "lines": [ + 42 + ], + "starting_column": 5, + "ending_column": 47 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "MyConc", + "source_mapping": { + "start": 746, + "length": 342, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/constable-states/0.5.16/const_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/constable-states/0.5.16/const_state_variables.sol", + "is_dependency": false, + "lines": [ + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + } + ], + "description": "MyConc.should_be_constant (tests/detectors/constable-states/0.5.16/const_state_variables.sol#42) should be constant\n", + "markdown": "[MyConc.should_be_constant](tests/detectors/constable-states/0.5.16/const_state_variables.sol#L42) should be constant\n", + "id": "cbcafa2a3efba4d21ac1b51b4b823e5082d556bc3d6cf3fd2ab3188f9f218fc1", + "check": "constable-states", + "impact": "Optimization", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "should_be_constant_2", + "source_mapping": { + "start": 841, + "length": 33, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/constable-states/0.5.16/const_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/constable-states/0.5.16/const_state_variables.sol", + "is_dependency": false, + "lines": [ + 43 + ], + "starting_column": 5, + "ending_column": 38 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "MyConc", + "source_mapping": { + "start": 746, + "length": 342, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/constable-states/0.5.16/const_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/constable-states/0.5.16/const_state_variables.sol", + "is_dependency": false, + "lines": [ + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + } + ], + "description": "MyConc.should_be_constant_2 (tests/detectors/constable-states/0.5.16/const_state_variables.sol#43) should be constant\n", + "markdown": "[MyConc.should_be_constant_2](tests/detectors/constable-states/0.5.16/const_state_variables.sol#L43) should be constant\n", + "id": "9a48a4122de1a6a4774a9f1e0d4917bd0fa08f17b4af41b86ba07689e51bf711", + "check": "constable-states", + "impact": "Optimization", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/constable-states/0.6.11/const_state_variables.sol b/tests/detectors/constable-states/0.6.11/const_state_variables.sol new file mode 100644 index 0000000000..3b0c1a436a --- /dev/null +++ b/tests/detectors/constable-states/0.6.11/const_state_variables.sol @@ -0,0 +1,52 @@ +//pragma solidity ^0.4.24; + + +contract A { + + address constant public MY_ADDRESS = 0xE0f5206BBD039e7b0592d8918820024e2a7437b9; + address public myFriendsAddress = 0xc0ffee254729296a45a3885639AC7E10F9d54979; + + uint public used; + uint public test = 5; + + uint constant X = 32**22 + 8; + string constant TEXT1 = "abc"; + string text2 = "xyz"; + + function setUsed() public { + if (msg.sender == MY_ADDRESS) { + used = test; + } + } +} + + +contract B is A { + + address public mySistersAddress = 0x999999cf1046e68e36E1aA2E0E07105eDDD1f08E; + + fallback () external { + used = 0; + } + + function setUsed(uint a) public { + if (msg.sender == MY_ADDRESS) { + used = a; + } + } +} + +contract MyConc{ + + uint constant A = 1; + bytes32 should_be_constant = sha256('abc'); + uint should_be_constant_2 = A + 1; + address not_constant = msg.sender; + uint not_constant_2 = getNumber(); + uint not_constant_3 = 10 + block.number; + + function getNumber() public returns(uint){ + return block.number; + } + +} diff --git a/tests/detectors/constable-states/0.6.11/const_state_variables.sol.0.6.11.ConstCandidateStateVars.json b/tests/detectors/constable-states/0.6.11/const_state_variables.sol.0.6.11.ConstCandidateStateVars.json new file mode 100644 index 0000000000..18dab74624 --- /dev/null +++ b/tests/detectors/constable-states/0.6.11/const_state_variables.sol.0.6.11.ConstCandidateStateVars.json @@ -0,0 +1,382 @@ +[ + [ + { + "elements": [ + { + "type": "variable", + "name": "myFriendsAddress", + "source_mapping": { + "start": 132, + "length": 76, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/constable-states/0.6.11/const_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/constable-states/0.6.11/const_state_variables.sol", + "is_dependency": false, + "lines": [ + 7 + ], + "starting_column": 5, + "ending_column": 81 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 29, + "length": 441, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/constable-states/0.6.11/const_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/constable-states/0.6.11/const_state_variables.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + } + ], + "description": "A.myFriendsAddress (tests/detectors/constable-states/0.6.11/const_state_variables.sol#7) should be constant\n", + "markdown": "[A.myFriendsAddress](tests/detectors/constable-states/0.6.11/const_state_variables.sol#L7) should be constant\n", + "id": "1454db80653b732bf6acbe54ff0ae4707002207a2a8216708c12d61c88a43e5f", + "check": "constable-states", + "impact": "Optimization", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "test", + "source_mapping": { + "start": 237, + "length": 20, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/constable-states/0.6.11/const_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/constable-states/0.6.11/const_state_variables.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 5, + "ending_column": 25 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 29, + "length": 441, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/constable-states/0.6.11/const_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/constable-states/0.6.11/const_state_variables.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + } + ], + "description": "A.test (tests/detectors/constable-states/0.6.11/const_state_variables.sol#10) should be constant\n", + "markdown": "[A.test](tests/detectors/constable-states/0.6.11/const_state_variables.sol#L10) should be constant\n", + "id": "5d9e3fb413322b71a93e90f7e89bd8c83cd4884d577d039598c681fe9db38b1d", + "check": "constable-states", + "impact": "Optimization", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "text2", + "source_mapping": { + "start": 333, + "length": 20, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/constable-states/0.6.11/const_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/constable-states/0.6.11/const_state_variables.sol", + "is_dependency": false, + "lines": [ + 14 + ], + "starting_column": 5, + "ending_column": 25 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 29, + "length": 441, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/constable-states/0.6.11/const_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/constable-states/0.6.11/const_state_variables.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + } + ], + "description": "A.text2 (tests/detectors/constable-states/0.6.11/const_state_variables.sol#14) should be constant\n", + "markdown": "[A.text2](tests/detectors/constable-states/0.6.11/const_state_variables.sol#L14) should be constant\n", + "id": "df11e6201c4558a8c5cd90b55b134b9ca8f07203b2264d3aa93bd7745e8cb4ba", + "check": "constable-states", + "impact": "Optimization", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "mySistersAddress", + "source_mapping": { + "start": 496, + "length": 76, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/constable-states/0.6.11/const_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/constable-states/0.6.11/const_state_variables.sol", + "is_dependency": false, + "lines": [ + 26 + ], + "starting_column": 5, + "ending_column": 81 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "B", + "source_mapping": { + "start": 473, + "length": 271, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/constable-states/0.6.11/const_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/constable-states/0.6.11/const_state_variables.sol", + "is_dependency": false, + "lines": [ + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + } + ], + "description": "B.mySistersAddress (tests/detectors/constable-states/0.6.11/const_state_variables.sol#26) should be constant\n", + "markdown": "[B.mySistersAddress](tests/detectors/constable-states/0.6.11/const_state_variables.sol#L26) should be constant\n", + "id": "bee93a722c8eae4a48aade67d8ef537d84c106f48fc9eb738c795fce10d3bc63", + "check": "constable-states", + "impact": "Optimization", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "should_be_constant", + "source_mapping": { + "start": 793, + "length": 42, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/constable-states/0.6.11/const_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/constable-states/0.6.11/const_state_variables.sol", + "is_dependency": false, + "lines": [ + 42 + ], + "starting_column": 5, + "ending_column": 47 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "MyConc", + "source_mapping": { + "start": 746, + "length": 342, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/constable-states/0.6.11/const_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/constable-states/0.6.11/const_state_variables.sol", + "is_dependency": false, + "lines": [ + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + } + ], + "description": "MyConc.should_be_constant (tests/detectors/constable-states/0.6.11/const_state_variables.sol#42) should be constant\n", + "markdown": "[MyConc.should_be_constant](tests/detectors/constable-states/0.6.11/const_state_variables.sol#L42) should be constant\n", + "id": "cbcafa2a3efba4d21ac1b51b4b823e5082d556bc3d6cf3fd2ab3188f9f218fc1", + "check": "constable-states", + "impact": "Optimization", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "should_be_constant_2", + "source_mapping": { + "start": 841, + "length": 33, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/constable-states/0.6.11/const_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/constable-states/0.6.11/const_state_variables.sol", + "is_dependency": false, + "lines": [ + 43 + ], + "starting_column": 5, + "ending_column": 38 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "MyConc", + "source_mapping": { + "start": 746, + "length": 342, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/constable-states/0.6.11/const_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/constable-states/0.6.11/const_state_variables.sol", + "is_dependency": false, + "lines": [ + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + } + ], + "description": "MyConc.should_be_constant_2 (tests/detectors/constable-states/0.6.11/const_state_variables.sol#43) should be constant\n", + "markdown": "[MyConc.should_be_constant_2](tests/detectors/constable-states/0.6.11/const_state_variables.sol#L43) should be constant\n", + "id": "9a48a4122de1a6a4774a9f1e0d4917bd0fa08f17b4af41b86ba07689e51bf711", + "check": "constable-states", + "impact": "Optimization", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/constable-states/0.7.6/const_state_variables.sol b/tests/detectors/constable-states/0.7.6/const_state_variables.sol new file mode 100644 index 0000000000..3b0c1a436a --- /dev/null +++ b/tests/detectors/constable-states/0.7.6/const_state_variables.sol @@ -0,0 +1,52 @@ +//pragma solidity ^0.4.24; + + +contract A { + + address constant public MY_ADDRESS = 0xE0f5206BBD039e7b0592d8918820024e2a7437b9; + address public myFriendsAddress = 0xc0ffee254729296a45a3885639AC7E10F9d54979; + + uint public used; + uint public test = 5; + + uint constant X = 32**22 + 8; + string constant TEXT1 = "abc"; + string text2 = "xyz"; + + function setUsed() public { + if (msg.sender == MY_ADDRESS) { + used = test; + } + } +} + + +contract B is A { + + address public mySistersAddress = 0x999999cf1046e68e36E1aA2E0E07105eDDD1f08E; + + fallback () external { + used = 0; + } + + function setUsed(uint a) public { + if (msg.sender == MY_ADDRESS) { + used = a; + } + } +} + +contract MyConc{ + + uint constant A = 1; + bytes32 should_be_constant = sha256('abc'); + uint should_be_constant_2 = A + 1; + address not_constant = msg.sender; + uint not_constant_2 = getNumber(); + uint not_constant_3 = 10 + block.number; + + function getNumber() public returns(uint){ + return block.number; + } + +} diff --git a/tests/detectors/constable-states/const_state_variables.sol.0.5.1.ConstCandidateStateVars.json b/tests/detectors/constable-states/0.7.6/const_state_variables.sol.0.7.6.ConstCandidateStateVars.json similarity index 88% rename from tests/detectors/constable-states/const_state_variables.sol.0.5.1.ConstCandidateStateVars.json rename to tests/detectors/constable-states/0.7.6/const_state_variables.sol.0.7.6.ConstCandidateStateVars.json index 2fa7ffab4f..bd7ce74203 100644 --- a/tests/detectors/constable-states/const_state_variables.sol.0.5.1.ConstCandidateStateVars.json +++ b/tests/detectors/constable-states/0.7.6/const_state_variables.sol.0.7.6.ConstCandidateStateVars.json @@ -9,9 +9,9 @@ "start": 132, "length": 76, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constable-states/const_state_variables.sol", + "filename_relative": "tests/detectors/constable-states/0.7.6/const_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constable-states/const_state_variables.sol", + "filename_short": "tests/detectors/constable-states/0.7.6/const_state_variables.sol", "is_dependency": false, "lines": [ 7 @@ -27,9 +27,9 @@ "start": 29, "length": 441, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constable-states/const_state_variables.sol", + "filename_relative": "tests/detectors/constable-states/0.7.6/const_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constable-states/const_state_variables.sol", + "filename_short": "tests/detectors/constable-states/0.7.6/const_state_variables.sol", "is_dependency": false, "lines": [ 4, @@ -58,8 +58,8 @@ } } ], - "description": "A.myFriendsAddress (tests/detectors/constable-states/const_state_variables.sol#7) should be constant\n", - "markdown": "[A.myFriendsAddress](tests/detectors/constable-states/const_state_variables.sol#L7) should be constant\n", + "description": "A.myFriendsAddress (tests/detectors/constable-states/0.7.6/const_state_variables.sol#7) should be constant\n", + "markdown": "[A.myFriendsAddress](tests/detectors/constable-states/0.7.6/const_state_variables.sol#L7) should be constant\n", "id": "1454db80653b732bf6acbe54ff0ae4707002207a2a8216708c12d61c88a43e5f", "check": "constable-states", "impact": "Optimization", @@ -74,9 +74,9 @@ "start": 237, "length": 20, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constable-states/const_state_variables.sol", + "filename_relative": "tests/detectors/constable-states/0.7.6/const_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constable-states/const_state_variables.sol", + "filename_short": "tests/detectors/constable-states/0.7.6/const_state_variables.sol", "is_dependency": false, "lines": [ 10 @@ -92,9 +92,9 @@ "start": 29, "length": 441, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constable-states/const_state_variables.sol", + "filename_relative": "tests/detectors/constable-states/0.7.6/const_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constable-states/const_state_variables.sol", + "filename_short": "tests/detectors/constable-states/0.7.6/const_state_variables.sol", "is_dependency": false, "lines": [ 4, @@ -123,8 +123,8 @@ } } ], - "description": "A.test (tests/detectors/constable-states/const_state_variables.sol#10) should be constant\n", - "markdown": "[A.test](tests/detectors/constable-states/const_state_variables.sol#L10) should be constant\n", + "description": "A.test (tests/detectors/constable-states/0.7.6/const_state_variables.sol#10) should be constant\n", + "markdown": "[A.test](tests/detectors/constable-states/0.7.6/const_state_variables.sol#L10) should be constant\n", "id": "5d9e3fb413322b71a93e90f7e89bd8c83cd4884d577d039598c681fe9db38b1d", "check": "constable-states", "impact": "Optimization", @@ -139,9 +139,9 @@ "start": 333, "length": 20, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constable-states/const_state_variables.sol", + "filename_relative": "tests/detectors/constable-states/0.7.6/const_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constable-states/const_state_variables.sol", + "filename_short": "tests/detectors/constable-states/0.7.6/const_state_variables.sol", "is_dependency": false, "lines": [ 14 @@ -157,9 +157,9 @@ "start": 29, "length": 441, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constable-states/const_state_variables.sol", + "filename_relative": "tests/detectors/constable-states/0.7.6/const_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constable-states/const_state_variables.sol", + "filename_short": "tests/detectors/constable-states/0.7.6/const_state_variables.sol", "is_dependency": false, "lines": [ 4, @@ -188,8 +188,8 @@ } } ], - "description": "A.text2 (tests/detectors/constable-states/const_state_variables.sol#14) should be constant\n", - "markdown": "[A.text2](tests/detectors/constable-states/const_state_variables.sol#L14) should be constant\n", + "description": "A.text2 (tests/detectors/constable-states/0.7.6/const_state_variables.sol#14) should be constant\n", + "markdown": "[A.text2](tests/detectors/constable-states/0.7.6/const_state_variables.sol#L14) should be constant\n", "id": "df11e6201c4558a8c5cd90b55b134b9ca8f07203b2264d3aa93bd7745e8cb4ba", "check": "constable-states", "impact": "Optimization", @@ -204,9 +204,9 @@ "start": 496, "length": 76, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constable-states/const_state_variables.sol", + "filename_relative": "tests/detectors/constable-states/0.7.6/const_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constable-states/const_state_variables.sol", + "filename_short": "tests/detectors/constable-states/0.7.6/const_state_variables.sol", "is_dependency": false, "lines": [ 26 @@ -222,9 +222,9 @@ "start": 473, "length": 271, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constable-states/const_state_variables.sol", + "filename_relative": "tests/detectors/constable-states/0.7.6/const_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constable-states/const_state_variables.sol", + "filename_short": "tests/detectors/constable-states/0.7.6/const_state_variables.sol", "is_dependency": false, "lines": [ 24, @@ -249,8 +249,8 @@ } } ], - "description": "B.mySistersAddress (tests/detectors/constable-states/const_state_variables.sol#26) should be constant\n", - "markdown": "[B.mySistersAddress](tests/detectors/constable-states/const_state_variables.sol#L26) should be constant\n", + "description": "B.mySistersAddress (tests/detectors/constable-states/0.7.6/const_state_variables.sol#26) should be constant\n", + "markdown": "[B.mySistersAddress](tests/detectors/constable-states/0.7.6/const_state_variables.sol#L26) should be constant\n", "id": "bee93a722c8eae4a48aade67d8ef537d84c106f48fc9eb738c795fce10d3bc63", "check": "constable-states", "impact": "Optimization", @@ -265,9 +265,9 @@ "start": 793, "length": 42, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constable-states/const_state_variables.sol", + "filename_relative": "tests/detectors/constable-states/0.7.6/const_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constable-states/const_state_variables.sol", + "filename_short": "tests/detectors/constable-states/0.7.6/const_state_variables.sol", "is_dependency": false, "lines": [ 42 @@ -283,9 +283,9 @@ "start": 746, "length": 342, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constable-states/const_state_variables.sol", + "filename_relative": "tests/detectors/constable-states/0.7.6/const_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constable-states/const_state_variables.sol", + "filename_short": "tests/detectors/constable-states/0.7.6/const_state_variables.sol", "is_dependency": false, "lines": [ 39, @@ -310,8 +310,8 @@ } } ], - "description": "MyConc.should_be_constant (tests/detectors/constable-states/const_state_variables.sol#42) should be constant\n", - "markdown": "[MyConc.should_be_constant](tests/detectors/constable-states/const_state_variables.sol#L42) should be constant\n", + "description": "MyConc.should_be_constant (tests/detectors/constable-states/0.7.6/const_state_variables.sol#42) should be constant\n", + "markdown": "[MyConc.should_be_constant](tests/detectors/constable-states/0.7.6/const_state_variables.sol#L42) should be constant\n", "id": "cbcafa2a3efba4d21ac1b51b4b823e5082d556bc3d6cf3fd2ab3188f9f218fc1", "check": "constable-states", "impact": "Optimization", @@ -326,9 +326,9 @@ "start": 841, "length": 33, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constable-states/const_state_variables.sol", + "filename_relative": "tests/detectors/constable-states/0.7.6/const_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constable-states/const_state_variables.sol", + "filename_short": "tests/detectors/constable-states/0.7.6/const_state_variables.sol", "is_dependency": false, "lines": [ 43 @@ -344,9 +344,9 @@ "start": 746, "length": 342, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constable-states/const_state_variables.sol", + "filename_relative": "tests/detectors/constable-states/0.7.6/const_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constable-states/const_state_variables.sol", + "filename_short": "tests/detectors/constable-states/0.7.6/const_state_variables.sol", "is_dependency": false, "lines": [ 39, @@ -371,8 +371,8 @@ } } ], - "description": "MyConc.should_be_constant_2 (tests/detectors/constable-states/const_state_variables.sol#43) should be constant\n", - "markdown": "[MyConc.should_be_constant_2](tests/detectors/constable-states/const_state_variables.sol#L43) should be constant\n", + "description": "MyConc.should_be_constant_2 (tests/detectors/constable-states/0.7.6/const_state_variables.sol#43) should be constant\n", + "markdown": "[MyConc.should_be_constant_2](tests/detectors/constable-states/0.7.6/const_state_variables.sol#L43) should be constant\n", "id": "9a48a4122de1a6a4774a9f1e0d4917bd0fa08f17b4af41b86ba07689e51bf711", "check": "constable-states", "impact": "Optimization", diff --git a/tests/detectors/constant/constant.sol b/tests/detectors/constant/0.4.25/constant.sol similarity index 100% rename from tests/detectors/constant/constant.sol rename to tests/detectors/constant/0.4.25/constant.sol diff --git a/tests/detectors/constant/constant.sol.0.4.25.ConstantFunctionsAsm.json b/tests/detectors/constant/0.4.25/constant.sol.0.4.25.ConstantFunctionsAsm.json similarity index 91% rename from tests/detectors/constant/constant.sol.0.4.25.ConstantFunctionsAsm.json rename to tests/detectors/constant/0.4.25/constant.sol.0.4.25.ConstantFunctionsAsm.json index e50e063b0f..672df1efca 100644 --- a/tests/detectors/constant/constant.sol.0.4.25.ConstantFunctionsAsm.json +++ b/tests/detectors/constant/0.4.25/constant.sol.0.4.25.ConstantFunctionsAsm.json @@ -9,9 +9,9 @@ "start": 324, "length": 66, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constant/constant.sol", + "filename_relative": "tests/detectors/constant/0.4.25/constant.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constant/constant.sol", + "filename_short": "tests/detectors/constant/0.4.25/constant.sol", "is_dependency": false, "lines": [ 22, @@ -29,9 +29,9 @@ "start": 0, "length": 392, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constant/constant.sol", + "filename_relative": "tests/detectors/constant/0.4.25/constant.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constant/constant.sol", + "filename_short": "tests/detectors/constant/0.4.25/constant.sol", "is_dependency": false, "lines": [ 1, @@ -68,8 +68,8 @@ } } ], - "description": "Constant.test_assembly_bug() (tests/detectors/constant/constant.sol#22-24) is declared view but contains assembly code\n", - "markdown": "[Constant.test_assembly_bug()](tests/detectors/constant/constant.sol#L22-L24) is declared view but contains assembly code\n", + "description": "Constant.test_assembly_bug() (tests/detectors/constant/0.4.25/constant.sol#22-24) is declared view but contains assembly code\n", + "markdown": "[Constant.test_assembly_bug()](tests/detectors/constant/0.4.25/constant.sol#L22-L24) is declared view but contains assembly code\n", "id": "1f892cae08b89096bdc4d6ecdf55a3adc4b4314390e054fe2547d9c8e9f76e23", "additional_fields": { "contains_assembly": true diff --git a/tests/detectors/constant/constant.sol.0.4.25.ConstantFunctionsState.json b/tests/detectors/constant/0.4.25/constant.sol.0.4.25.ConstantFunctionsState.json similarity index 91% rename from tests/detectors/constant/constant.sol.0.4.25.ConstantFunctionsState.json rename to tests/detectors/constant/0.4.25/constant.sol.0.4.25.ConstantFunctionsState.json index 7e1d3916ad..2ee21c819a 100644 --- a/tests/detectors/constant/constant.sol.0.4.25.ConstantFunctionsState.json +++ b/tests/detectors/constant/0.4.25/constant.sol.0.4.25.ConstantFunctionsState.json @@ -9,9 +9,9 @@ "start": 45, "length": 58, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constant/constant.sol", + "filename_relative": "tests/detectors/constant/0.4.25/constant.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constant/constant.sol", + "filename_short": "tests/detectors/constant/0.4.25/constant.sol", "is_dependency": false, "lines": [ 5, @@ -29,9 +29,9 @@ "start": 0, "length": 392, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constant/constant.sol", + "filename_relative": "tests/detectors/constant/0.4.25/constant.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constant/constant.sol", + "filename_short": "tests/detectors/constant/0.4.25/constant.sol", "is_dependency": false, "lines": [ 1, @@ -74,9 +74,9 @@ "start": 28, "length": 6, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constant/constant.sol", + "filename_relative": "tests/detectors/constant/0.4.25/constant.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constant/constant.sol", + "filename_short": "tests/detectors/constant/0.4.25/constant.sol", "is_dependency": false, "lines": [ 3 @@ -92,9 +92,9 @@ "start": 0, "length": 392, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constant/constant.sol", + "filename_relative": "tests/detectors/constant/0.4.25/constant.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constant/constant.sol", + "filename_short": "tests/detectors/constant/0.4.25/constant.sol", "is_dependency": false, "lines": [ 1, @@ -130,8 +130,8 @@ } } ], - "description": "Constant.test_view_bug() (tests/detectors/constant/constant.sol#5-7) is declared view but changes state variables:\n\t- Constant.a (tests/detectors/constant/constant.sol#3)\n", - "markdown": "[Constant.test_view_bug()](tests/detectors/constant/constant.sol#L5-L7) is declared view but changes state variables:\n\t- [Constant.a](tests/detectors/constant/constant.sol#L3)\n", + "description": "Constant.test_view_bug() (tests/detectors/constant/0.4.25/constant.sol#5-7) is declared view but changes state variables:\n\t- Constant.a (tests/detectors/constant/0.4.25/constant.sol#3)\n", + "markdown": "[Constant.test_view_bug()](tests/detectors/constant/0.4.25/constant.sol#L5-L7) is declared view but changes state variables:\n\t- [Constant.a](tests/detectors/constant/0.4.25/constant.sol#L3)\n", "id": "4dee61d8835d20c6f1f7c195d8bd1e9de5dbcc096396a5b8db391136f9f5fdf1", "additional_fields": { "contains_assembly": false @@ -149,9 +149,9 @@ "start": 113, "length": 66, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constant/constant.sol", + "filename_relative": "tests/detectors/constant/0.4.25/constant.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constant/constant.sol", + "filename_short": "tests/detectors/constant/0.4.25/constant.sol", "is_dependency": false, "lines": [ 9, @@ -169,9 +169,9 @@ "start": 0, "length": 392, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constant/constant.sol", + "filename_relative": "tests/detectors/constant/0.4.25/constant.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constant/constant.sol", + "filename_short": "tests/detectors/constant/0.4.25/constant.sol", "is_dependency": false, "lines": [ 1, @@ -214,9 +214,9 @@ "start": 28, "length": 6, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constant/constant.sol", + "filename_relative": "tests/detectors/constant/0.4.25/constant.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constant/constant.sol", + "filename_short": "tests/detectors/constant/0.4.25/constant.sol", "is_dependency": false, "lines": [ 3 @@ -232,9 +232,9 @@ "start": 0, "length": 392, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constant/constant.sol", + "filename_relative": "tests/detectors/constant/0.4.25/constant.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constant/constant.sol", + "filename_short": "tests/detectors/constant/0.4.25/constant.sol", "is_dependency": false, "lines": [ 1, @@ -270,8 +270,8 @@ } } ], - "description": "Constant.test_constant_bug() (tests/detectors/constant/constant.sol#9-11) is declared view but changes state variables:\n\t- Constant.a (tests/detectors/constant/constant.sol#3)\n", - "markdown": "[Constant.test_constant_bug()](tests/detectors/constant/constant.sol#L9-L11) is declared view but changes state variables:\n\t- [Constant.a](tests/detectors/constant/constant.sol#L3)\n", + "description": "Constant.test_constant_bug() (tests/detectors/constant/0.4.25/constant.sol#9-11) is declared view but changes state variables:\n\t- Constant.a (tests/detectors/constant/0.4.25/constant.sol#3)\n", + "markdown": "[Constant.test_constant_bug()](tests/detectors/constant/0.4.25/constant.sol#L9-L11) is declared view but changes state variables:\n\t- [Constant.a](tests/detectors/constant/0.4.25/constant.sol#L3)\n", "id": "145e2d34dfc5b932c8d67d480c0eaec9baa8c728e2a310529572c0c4a5c6046a", "additional_fields": { "contains_assembly": false diff --git a/tests/detectors/constant/constant-0.5.1.sol b/tests/detectors/constant/0.5.16/constant.sol similarity index 90% rename from tests/detectors/constant/constant-0.5.1.sol rename to tests/detectors/constant/0.5.16/constant.sol index fd3a4a192d..5f01a0d7e4 100644 --- a/tests/detectors/constant/constant-0.5.1.sol +++ b/tests/detectors/constant/0.5.16/constant.sol @@ -1,4 +1,4 @@ -pragma solidity 0.5.1; +// pragma solidity 0.5.1; contract Constant { diff --git a/tests/detectors/constant/constant-0.5.1.sol.0.5.1.ConstantFunctionsState.json b/tests/detectors/constant/0.5.16/constant.sol.0.5.16.ConstantFunctionsAsm.json similarity index 100% rename from tests/detectors/constant/constant-0.5.1.sol.0.5.1.ConstantFunctionsState.json rename to tests/detectors/constant/0.5.16/constant.sol.0.5.16.ConstantFunctionsAsm.json diff --git a/tests/detectors/events-access/missing_events_access_control.sol.0.5.12.MissingEventsArithmetic.json b/tests/detectors/constant/0.5.16/constant.sol.0.5.16.ConstantFunctionsState.json similarity index 100% rename from tests/detectors/events-access/missing_events_access_control.sol.0.5.12.MissingEventsArithmetic.json rename to tests/detectors/constant/0.5.16/constant.sol.0.5.16.ConstantFunctionsState.json diff --git a/tests/detectors/constant/0.6.11/constant.sol b/tests/detectors/constant/0.6.11/constant.sol new file mode 100644 index 0000000000..5f01a0d7e4 --- /dev/null +++ b/tests/detectors/constant/0.6.11/constant.sol @@ -0,0 +1,20 @@ +// pragma solidity 0.5.1; + +contract Constant { + + uint a; + + + function test_view_shadow() public view{ + uint a; + a = 0; + } + + function test_view() public view{ + a; + } + + function test_assembly_bug() public view{ + assembly{} + } +} diff --git a/tests/detectors/external-function/external_function_2.sol.0.4.25.ExternalFunction.json b/tests/detectors/constant/0.6.11/constant.sol.0.6.11.ConstantFunctionsAsm.json similarity index 100% rename from tests/detectors/external-function/external_function_2.sol.0.4.25.ExternalFunction.json rename to tests/detectors/constant/0.6.11/constant.sol.0.6.11.ConstantFunctionsAsm.json diff --git a/tests/detectors/external-function/external_function_2.sol.0.5.1.ExternalFunction.json b/tests/detectors/constant/0.6.11/constant.sol.0.6.11.ConstantFunctionsState.json similarity index 100% rename from tests/detectors/external-function/external_function_2.sol.0.5.1.ExternalFunction.json rename to tests/detectors/constant/0.6.11/constant.sol.0.6.11.ConstantFunctionsState.json diff --git a/tests/detectors/constant/0.7.6/constant.sol b/tests/detectors/constant/0.7.6/constant.sol new file mode 100644 index 0000000000..5f01a0d7e4 --- /dev/null +++ b/tests/detectors/constant/0.7.6/constant.sol @@ -0,0 +1,20 @@ +// pragma solidity 0.5.1; + +contract Constant { + + uint a; + + + function test_view_shadow() public view{ + uint a; + a = 0; + } + + function test_view() public view{ + a; + } + + function test_assembly_bug() public view{ + assembly{} + } +} diff --git a/tests/detectors/missing-inheritance/unimplemented_interfaces.sol.0.5.12.UnimplementedFunctionDetection.json b/tests/detectors/constant/0.7.6/constant.sol.0.7.6.ConstantFunctionsAsm.json similarity index 100% rename from tests/detectors/missing-inheritance/unimplemented_interfaces.sol.0.5.12.UnimplementedFunctionDetection.json rename to tests/detectors/constant/0.7.6/constant.sol.0.7.6.ConstantFunctionsAsm.json diff --git a/tests/detectors/storage-array/storage_signed_integer_array.sol.0.5.12.StorageSignedIntegerArray.json b/tests/detectors/constant/0.7.6/constant.sol.0.7.6.ConstantFunctionsState.json similarity index 100% rename from tests/detectors/storage-array/storage_signed_integer_array.sol.0.5.12.StorageSignedIntegerArray.json rename to tests/detectors/constant/0.7.6/constant.sol.0.7.6.ConstantFunctionsState.json diff --git a/tests/detectors/controlled-array-length/array_length_assignment.sol b/tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol similarity index 100% rename from tests/detectors/controlled-array-length/array_length_assignment.sol rename to tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol diff --git a/tests/detectors/controlled-array-length/array_length_assignment.sol.0.4.25.ArrayLengthAssignment.json b/tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol.0.4.25.ArrayLengthAssignment.json similarity index 88% rename from tests/detectors/controlled-array-length/array_length_assignment.sol.0.4.25.ArrayLengthAssignment.json rename to tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol.0.4.25.ArrayLengthAssignment.json index 61e98c59ca..9dff96a8d0 100644 --- a/tests/detectors/controlled-array-length/array_length_assignment.sol.0.4.25.ArrayLengthAssignment.json +++ b/tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol.0.4.25.ArrayLengthAssignment.json @@ -9,9 +9,9 @@ "start": 0, "length": 1055, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-array-length/array_length_assignment.sol", + "filename_relative": "tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-array-length/array_length_assignment.sol", + "filename_short": "tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol", "is_dependency": false, "lines": [ 1, @@ -67,20 +67,20 @@ }, { "type": "node", - "name": "b.subStruct.x.length = param + 1", + "name": "arr.length = param", "source_mapping": { - "start": 964, - "length": 32, + "start": 527, + "length": 18, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-array-length/array_length_assignment.sol", + "filename_relative": "tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-array-length/array_length_assignment.sol", + "filename_short": "tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol", "is_dependency": false, "lines": [ - 41 + 26 ], - "starting_column": 9, - "ending_column": 41 + "starting_column": 13, + "ending_column": 31 }, "type_specific_fields": { "parent": { @@ -90,9 +90,9 @@ "start": 406, "length": 647, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-array-length/array_length_assignment.sol", + "filename_relative": "tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-array-length/array_length_assignment.sol", + "filename_short": "tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol", "is_dependency": false, "lines": [ 22, @@ -131,9 +131,9 @@ "start": 0, "length": 1055, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-array-length/array_length_assignment.sol", + "filename_relative": "tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-array-length/array_length_assignment.sol", + "filename_short": "tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol", "is_dependency": false, "lines": [ 1, @@ -193,9 +193,9 @@ } } ], - "description": "ArrayLengthAssignment (tests/detectors/controlled-array-length/array_length_assignment.sol#1-46) contract sets array length with a user-controlled value:\n\t- b.subStruct.x.length = param + 1 (tests/detectors/controlled-array-length/array_length_assignment.sol#41)\n", - "markdown": "[ArrayLengthAssignment](tests/detectors/controlled-array-length/array_length_assignment.sol#L1-L46) contract sets array length with a user-controlled value:\n\t- [b.subStruct.x.length = param + 1](tests/detectors/controlled-array-length/array_length_assignment.sol#L41)\n", - "id": "15164b2025ba6106829ae6e7baa9a73e931c0aa3e16a8d95ee30158667b4b7f5", + "description": "ArrayLengthAssignment (tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol#1-46) contract sets array length with a user-controlled value:\n\t- arr.length = param (tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol#26)\n", + "markdown": "[ArrayLengthAssignment](tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol#L1-L46) contract sets array length with a user-controlled value:\n\t- [arr.length = param](tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol#L26)\n", + "id": "13e0633277a811f9416912f4404d805c1aaaaaacbc94989215c41de964718b0b", "check": "controlled-array-length", "impact": "High", "confidence": "Medium" @@ -209,9 +209,9 @@ "start": 0, "length": 1055, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-array-length/array_length_assignment.sol", + "filename_relative": "tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-array-length/array_length_assignment.sol", + "filename_short": "tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol", "is_dependency": false, "lines": [ 1, @@ -267,20 +267,20 @@ }, { "type": "node", - "name": "arr.length = param", + "name": "a.x.length = param", "source_mapping": { - "start": 527, + "start": 818, "length": 18, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-array-length/array_length_assignment.sol", + "filename_relative": "tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-array-length/array_length_assignment.sol", + "filename_short": "tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol", "is_dependency": false, "lines": [ - 26 + 36 ], - "starting_column": 13, - "ending_column": 31 + "starting_column": 9, + "ending_column": 27 }, "type_specific_fields": { "parent": { @@ -290,9 +290,9 @@ "start": 406, "length": 647, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-array-length/array_length_assignment.sol", + "filename_relative": "tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-array-length/array_length_assignment.sol", + "filename_short": "tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol", "is_dependency": false, "lines": [ 22, @@ -331,9 +331,9 @@ "start": 0, "length": 1055, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-array-length/array_length_assignment.sol", + "filename_relative": "tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-array-length/array_length_assignment.sol", + "filename_short": "tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol", "is_dependency": false, "lines": [ 1, @@ -393,9 +393,9 @@ } } ], - "description": "ArrayLengthAssignment (tests/detectors/controlled-array-length/array_length_assignment.sol#1-46) contract sets array length with a user-controlled value:\n\t- arr.length = param (tests/detectors/controlled-array-length/array_length_assignment.sol#26)\n", - "markdown": "[ArrayLengthAssignment](tests/detectors/controlled-array-length/array_length_assignment.sol#L1-L46) contract sets array length with a user-controlled value:\n\t- [arr.length = param](tests/detectors/controlled-array-length/array_length_assignment.sol#L26)\n", - "id": "cb96ef1555863b421997853215ad3533faaffd35215987c6a2ebf21716d9bd1a", + "description": "ArrayLengthAssignment (tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol#1-46) contract sets array length with a user-controlled value:\n\t- a.x.length = param (tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol#36)\n", + "markdown": "[ArrayLengthAssignment](tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol#L1-L46) contract sets array length with a user-controlled value:\n\t- [a.x.length = param](tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol#L36)\n", + "id": "f455c672028771f21282b59fb58b5eac51185eae4ac44e65a2e1f4df6db0c6e4", "check": "controlled-array-length", "impact": "High", "confidence": "Medium" @@ -409,9 +409,9 @@ "start": 0, "length": 1055, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-array-length/array_length_assignment.sol", + "filename_relative": "tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-array-length/array_length_assignment.sol", + "filename_short": "tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol", "is_dependency": false, "lines": [ 1, @@ -467,20 +467,20 @@ }, { "type": "node", - "name": "a.x.length = param", + "name": "b.subStruct.x.length = param + 1", "source_mapping": { - "start": 818, - "length": 18, + "start": 964, + "length": 32, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-array-length/array_length_assignment.sol", + "filename_relative": "tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-array-length/array_length_assignment.sol", + "filename_short": "tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol", "is_dependency": false, "lines": [ - 36 + 41 ], "starting_column": 9, - "ending_column": 27 + "ending_column": 41 }, "type_specific_fields": { "parent": { @@ -490,9 +490,9 @@ "start": 406, "length": 647, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-array-length/array_length_assignment.sol", + "filename_relative": "tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-array-length/array_length_assignment.sol", + "filename_short": "tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol", "is_dependency": false, "lines": [ 22, @@ -531,9 +531,9 @@ "start": 0, "length": 1055, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-array-length/array_length_assignment.sol", + "filename_relative": "tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-array-length/array_length_assignment.sol", + "filename_short": "tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol", "is_dependency": false, "lines": [ 1, @@ -593,9 +593,9 @@ } } ], - "description": "ArrayLengthAssignment (tests/detectors/controlled-array-length/array_length_assignment.sol#1-46) contract sets array length with a user-controlled value:\n\t- a.x.length = param (tests/detectors/controlled-array-length/array_length_assignment.sol#36)\n", - "markdown": "[ArrayLengthAssignment](tests/detectors/controlled-array-length/array_length_assignment.sol#L1-L46) contract sets array length with a user-controlled value:\n\t- [a.x.length = param](tests/detectors/controlled-array-length/array_length_assignment.sol#L36)\n", - "id": "6a72386e40ef24dd02adf92179022559e26da5e66be4bb925d02756f90f38953", + "description": "ArrayLengthAssignment (tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol#1-46) contract sets array length with a user-controlled value:\n\t- b.subStruct.x.length = param + 1 (tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol#41)\n", + "markdown": "[ArrayLengthAssignment](tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol#L1-L46) contract sets array length with a user-controlled value:\n\t- [b.subStruct.x.length = param + 1](tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol#L41)\n", + "id": "82175a5c24c40a1afe4c59f4271a2c12e577ad25e89e6e319e47b4f8f2a76943", "check": "controlled-array-length", "impact": "High", "confidence": "Medium" diff --git a/tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol b/tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol new file mode 100644 index 0000000000..a5c9d2e748 --- /dev/null +++ b/tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol @@ -0,0 +1,46 @@ +contract ArrayLengthAssignment { + uint x; + uint120[] arr; + uint120[] arr2; + uint256[] arr3; + constructor() public { + x = 7; + } + + struct TestStructWithArray { + uint[] x; + uint[][] y; + } + struct TestStructWithStructWithArray { + TestStructWithArray subStruct; + uint[] z; + } + + TestStructWithArray a; + TestStructWithStructWithArray b; + + function f(uint param, uint param2) public { + x += 1; + if(x > 3) { + arr.length = 7; + arr.length = param; + } + else{ + // Array length that is incremented/decremented should not be found. + x = arr2.length++; + x = 7 + 3; + } + + // Array length setting in structs should not be detected too. + a.x.length++; + a.x.length = param; + + + // Array length setting in embedded structs should not be detected too. + b.subStruct.x.length--; + b.subStruct.x.length = param + 1; + + arr3[0] = param2; + arr3.length++; + } +} diff --git a/tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol.0.5.16.ArrayLengthAssignment.json b/tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol.0.5.16.ArrayLengthAssignment.json new file mode 100644 index 0000000000..e3c44d7dbf --- /dev/null +++ b/tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol.0.5.16.ArrayLengthAssignment.json @@ -0,0 +1,604 @@ +[ + [ + { + "elements": [ + { + "type": "contract", + "name": "ArrayLengthAssignment", + "source_mapping": { + "start": 0, + "length": 1055, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "node", + "name": "b.subStruct.x.length = param + 1", + "source_mapping": { + "start": 964, + "length": 32, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", + "is_dependency": false, + "lines": [ + 41 + ], + "starting_column": 9, + "ending_column": 41 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "f", + "source_mapping": { + "start": 406, + "length": 647, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", + "is_dependency": false, + "lines": [ + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ArrayLengthAssignment", + "source_mapping": { + "start": 0, + "length": 1055, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f(uint256,uint256)" + } + } + } + } + ], + "description": "ArrayLengthAssignment (tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#1-46) contract sets array length with a user-controlled value:\n\t- b.subStruct.x.length = param + 1 (tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#41)\n", + "markdown": "[ArrayLengthAssignment](tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#L1-L46) contract sets array length with a user-controlled value:\n\t- [b.subStruct.x.length = param + 1](tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#L41)\n", + "id": "ba005d0d2665bc40c7c33b2a6a32bf426b4a5ccea38e75a6265976a20c9b7ae3", + "check": "controlled-array-length", + "impact": "High", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "contract", + "name": "ArrayLengthAssignment", + "source_mapping": { + "start": 0, + "length": 1055, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "node", + "name": "a.x.length = param", + "source_mapping": { + "start": 818, + "length": 18, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", + "is_dependency": false, + "lines": [ + 36 + ], + "starting_column": 9, + "ending_column": 27 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "f", + "source_mapping": { + "start": 406, + "length": 647, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", + "is_dependency": false, + "lines": [ + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ArrayLengthAssignment", + "source_mapping": { + "start": 0, + "length": 1055, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f(uint256,uint256)" + } + } + } + } + ], + "description": "ArrayLengthAssignment (tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#1-46) contract sets array length with a user-controlled value:\n\t- a.x.length = param (tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#36)\n", + "markdown": "[ArrayLengthAssignment](tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#L1-L46) contract sets array length with a user-controlled value:\n\t- [a.x.length = param](tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#L36)\n", + "id": "3ee7c4c1f07506f88bcd3b42a86641b32b24a3978768cbcb99301bd8a1fcb975", + "check": "controlled-array-length", + "impact": "High", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "contract", + "name": "ArrayLengthAssignment", + "source_mapping": { + "start": 0, + "length": 1055, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "node", + "name": "arr.length = param", + "source_mapping": { + "start": 527, + "length": 18, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", + "is_dependency": false, + "lines": [ + 26 + ], + "starting_column": 13, + "ending_column": 31 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "f", + "source_mapping": { + "start": 406, + "length": 647, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", + "is_dependency": false, + "lines": [ + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ArrayLengthAssignment", + "source_mapping": { + "start": 0, + "length": 1055, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f(uint256,uint256)" + } + } + } + } + ], + "description": "ArrayLengthAssignment (tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#1-46) contract sets array length with a user-controlled value:\n\t- arr.length = param (tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#26)\n", + "markdown": "[ArrayLengthAssignment](tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#L1-L46) contract sets array length with a user-controlled value:\n\t- [arr.length = param](tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#L26)\n", + "id": "5120add82e5b674971638ddcd430301e4fd0ff0abc12b425d78bb09baa519dd0", + "check": "controlled-array-length", + "impact": "High", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/controlled-delegatecall/controlled_delegatecall.sol b/tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol similarity index 100% rename from tests/detectors/controlled-delegatecall/controlled_delegatecall.sol rename to tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol diff --git a/tests/detectors/controlled-delegatecall/controlled_delegatecall.sol.0.4.25.ControlledDelegateCall.json b/tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol.0.4.25.ControlledDelegateCall.json similarity index 85% rename from tests/detectors/controlled-delegatecall/controlled_delegatecall.sol.0.4.25.ControlledDelegateCall.json rename to tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol.0.4.25.ControlledDelegateCall.json index 114ba8299d..4e319b56d3 100644 --- a/tests/detectors/controlled-delegatecall/controlled_delegatecall.sol.0.4.25.ControlledDelegateCall.json +++ b/tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol.0.4.25.ControlledDelegateCall.json @@ -9,9 +9,9 @@ "start": 101, "length": 134, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_relative": "tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_short": "tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol", "is_dependency": false, "lines": [ 8, @@ -30,9 +30,9 @@ "start": 0, "length": 585, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_relative": "tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_short": "tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol", "is_dependency": false, "lines": [ 1, @@ -75,9 +75,9 @@ "start": 201, "length": 27, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_relative": "tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_short": "tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol", "is_dependency": false, "lines": [ 10 @@ -93,9 +93,9 @@ "start": 101, "length": 134, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_relative": "tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_short": "tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol", "is_dependency": false, "lines": [ 8, @@ -114,9 +114,9 @@ "start": 0, "length": 585, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_relative": "tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_short": "tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol", "is_dependency": false, "lines": [ 1, @@ -155,9 +155,9 @@ } } ], - "description": "C.bad_delegate_call(bytes) (tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#8-11) uses delegatecall to a input-controlled function id\n\t- addr_bad.delegatecall(data) (tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#10)\n", - "markdown": "[C.bad_delegate_call(bytes)](tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#L8-L11) uses delegatecall to a input-controlled function id\n\t- [addr_bad.delegatecall(data)](tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#L10)\n", - "id": "d4aa9719b93dc4f3a3ec9b915071763b38d6881ddee6eaa86dade09f3caa1e5e", + "description": "C.bad_delegate_call(bytes) (tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol#8-11) uses delegatecall to a input-controlled function id\n\t- addr_bad.delegatecall(data) (tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol#10)\n", + "markdown": "[C.bad_delegate_call(bytes)](tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol#L8-L11) uses delegatecall to a input-controlled function id\n\t- [addr_bad.delegatecall(data)](tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol#L10)\n", + "id": "90d4f387ca3c669975a3ed4d7a5b09665b786a1078e16ced61adf1c3f9f6efb8", "check": "controlled-delegatecall", "impact": "High", "confidence": "Medium" @@ -171,9 +171,9 @@ "start": 337, "length": 118, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_relative": "tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_short": "tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol", "is_dependency": false, "lines": [ 18, @@ -191,9 +191,9 @@ "start": 0, "length": 585, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_relative": "tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_short": "tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol", "is_dependency": false, "lines": [ 1, @@ -236,9 +236,9 @@ "start": 400, "length": 48, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_relative": "tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_short": "tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol", "is_dependency": false, "lines": [ 19 @@ -254,9 +254,9 @@ "start": 337, "length": 118, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_relative": "tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_short": "tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol", "is_dependency": false, "lines": [ 18, @@ -274,9 +274,9 @@ "start": 0, "length": 585, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_relative": "tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_short": "tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol", "is_dependency": false, "lines": [ 1, @@ -315,9 +315,9 @@ } } ], - "description": "C.bad_delegate_call2(bytes) (tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#18-20) uses delegatecall to a input-controlled function id\n\t- addr_bad.delegatecall(abi.encode(func_id,data)) (tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#19)\n", - "markdown": "[C.bad_delegate_call2(bytes)](tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#L18-L20) uses delegatecall to a input-controlled function id\n\t- [addr_bad.delegatecall(abi.encode(func_id,data))](tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#L19)\n", - "id": "3358bd7774f1a574c5521fe2e084afa81e866adf9a77f3f25e3009f17d8c9fe7", + "description": "C.bad_delegate_call2(bytes) (tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol#18-20) uses delegatecall to a input-controlled function id\n\t- addr_bad.delegatecall(abi.encode(func_id,data)) (tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol#19)\n", + "markdown": "[C.bad_delegate_call2(bytes)](tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol#L18-L20) uses delegatecall to a input-controlled function id\n\t- [addr_bad.delegatecall(abi.encode(func_id,data))](tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol#L19)\n", + "id": "12d6ba2d0139326b442352b37028ff77dfbdc625870a5ae858e6107cfa89cfbb", "check": "controlled-delegatecall", "impact": "High", "confidence": "Medium" diff --git a/tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol b/tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol new file mode 100644 index 0000000000..d3d3a78dd2 --- /dev/null +++ b/tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol @@ -0,0 +1,25 @@ +contract C{ + + address addr_good = address(0x41); + address addr_bad ; + + bytes4 func_id; + + function bad_delegate_call(bytes memory data) public{ + addr_good.delegatecall(data); + addr_bad.delegatecall(data); + } + + function set(bytes4 id) public{ + func_id = id; + addr_bad = msg.sender; + } + + function bad_delegate_call2(bytes memory data) public{ + addr_bad.delegatecall(abi.encode(func_id, data)); + } + + function good_delegate_call(bytes memory data) public{ + addr_good.delegatecall(abi.encode(bytes4(""), data)); + } +} diff --git a/tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol.0.5.16.ControlledDelegateCall.json b/tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol.0.5.16.ControlledDelegateCall.json new file mode 100644 index 0000000000..13f9a767ee --- /dev/null +++ b/tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol.0.5.16.ControlledDelegateCall.json @@ -0,0 +1,326 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad_delegate_call", + "source_mapping": { + "start": 101, + "length": 134, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 585, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad_delegate_call(bytes)" + } + }, + { + "type": "node", + "name": "addr_bad.delegatecall(data)", + "source_mapping": { + "start": 201, + "length": 27, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 9, + "ending_column": 36 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad_delegate_call", + "source_mapping": { + "start": 101, + "length": 134, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 585, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad_delegate_call(bytes)" + } + } + } + } + ], + "description": "C.bad_delegate_call(bytes) (tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol#8-11) uses delegatecall to a input-controlled function id\n\t- addr_bad.delegatecall(data) (tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol#10)\n", + "markdown": "[C.bad_delegate_call(bytes)](tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol#L8-L11) uses delegatecall to a input-controlled function id\n\t- [addr_bad.delegatecall(data)](tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol#L10)\n", + "id": "5ffc12fd6e122f0e70986a5d7f8d14c087f538145910100ea15192a63391a2b7", + "check": "controlled-delegatecall", + "impact": "High", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad_delegate_call2", + "source_mapping": { + "start": 337, + "length": 118, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol", + "is_dependency": false, + "lines": [ + 18, + 19, + 20 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 585, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad_delegate_call2(bytes)" + } + }, + { + "type": "node", + "name": "addr_bad.delegatecall(abi.encode(func_id,data))", + "source_mapping": { + "start": 400, + "length": 48, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol", + "is_dependency": false, + "lines": [ + 19 + ], + "starting_column": 9, + "ending_column": 57 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad_delegate_call2", + "source_mapping": { + "start": 337, + "length": 118, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol", + "is_dependency": false, + "lines": [ + 18, + 19, + 20 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 585, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad_delegate_call2(bytes)" + } + } + } + } + ], + "description": "C.bad_delegate_call2(bytes) (tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol#18-20) uses delegatecall to a input-controlled function id\n\t- addr_bad.delegatecall(abi.encode(func_id,data)) (tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol#19)\n", + "markdown": "[C.bad_delegate_call2(bytes)](tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol#L18-L20) uses delegatecall to a input-controlled function id\n\t- [addr_bad.delegatecall(abi.encode(func_id,data))](tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol#L19)\n", + "id": "a8749733eb415695ac990f9045813c8c1aadfb54f6de912cff1927db64a6d8d6", + "check": "controlled-delegatecall", + "impact": "High", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol b/tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol new file mode 100644 index 0000000000..d3d3a78dd2 --- /dev/null +++ b/tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol @@ -0,0 +1,25 @@ +contract C{ + + address addr_good = address(0x41); + address addr_bad ; + + bytes4 func_id; + + function bad_delegate_call(bytes memory data) public{ + addr_good.delegatecall(data); + addr_bad.delegatecall(data); + } + + function set(bytes4 id) public{ + func_id = id; + addr_bad = msg.sender; + } + + function bad_delegate_call2(bytes memory data) public{ + addr_bad.delegatecall(abi.encode(func_id, data)); + } + + function good_delegate_call(bytes memory data) public{ + addr_good.delegatecall(abi.encode(bytes4(""), data)); + } +} diff --git a/tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol.0.6.11.ControlledDelegateCall.json b/tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol.0.6.11.ControlledDelegateCall.json new file mode 100644 index 0000000000..c37f8f5935 --- /dev/null +++ b/tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol.0.6.11.ControlledDelegateCall.json @@ -0,0 +1,326 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad_delegate_call", + "source_mapping": { + "start": 101, + "length": 134, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 585, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad_delegate_call(bytes)" + } + }, + { + "type": "node", + "name": "addr_bad.delegatecall(data)", + "source_mapping": { + "start": 201, + "length": 27, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 9, + "ending_column": 36 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad_delegate_call", + "source_mapping": { + "start": 101, + "length": 134, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 585, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad_delegate_call(bytes)" + } + } + } + } + ], + "description": "C.bad_delegate_call(bytes) (tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol#8-11) uses delegatecall to a input-controlled function id\n\t- addr_bad.delegatecall(data) (tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol#10)\n", + "markdown": "[C.bad_delegate_call(bytes)](tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol#L8-L11) uses delegatecall to a input-controlled function id\n\t- [addr_bad.delegatecall(data)](tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol#L10)\n", + "id": "bed67f615a2f3a872e24eedf23fdedbdfbe5a540dc3f3ea4ca1430581997a8f6", + "check": "controlled-delegatecall", + "impact": "High", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad_delegate_call2", + "source_mapping": { + "start": 337, + "length": 118, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol", + "is_dependency": false, + "lines": [ + 18, + 19, + 20 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 585, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad_delegate_call2(bytes)" + } + }, + { + "type": "node", + "name": "addr_bad.delegatecall(abi.encode(func_id,data))", + "source_mapping": { + "start": 400, + "length": 48, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol", + "is_dependency": false, + "lines": [ + 19 + ], + "starting_column": 9, + "ending_column": 57 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad_delegate_call2", + "source_mapping": { + "start": 337, + "length": 118, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol", + "is_dependency": false, + "lines": [ + 18, + 19, + 20 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 585, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad_delegate_call2(bytes)" + } + } + } + } + ], + "description": "C.bad_delegate_call2(bytes) (tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol#18-20) uses delegatecall to a input-controlled function id\n\t- addr_bad.delegatecall(abi.encode(func_id,data)) (tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol#19)\n", + "markdown": "[C.bad_delegate_call2(bytes)](tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol#L18-L20) uses delegatecall to a input-controlled function id\n\t- [addr_bad.delegatecall(abi.encode(func_id,data))](tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol#L19)\n", + "id": "82fc8a33f6b16eff457087ec9961f2bce3c61289628dac8284009c8275cea790", + "check": "controlled-delegatecall", + "impact": "High", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol b/tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol new file mode 100644 index 0000000000..d3d3a78dd2 --- /dev/null +++ b/tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol @@ -0,0 +1,25 @@ +contract C{ + + address addr_good = address(0x41); + address addr_bad ; + + bytes4 func_id; + + function bad_delegate_call(bytes memory data) public{ + addr_good.delegatecall(data); + addr_bad.delegatecall(data); + } + + function set(bytes4 id) public{ + func_id = id; + addr_bad = msg.sender; + } + + function bad_delegate_call2(bytes memory data) public{ + addr_bad.delegatecall(abi.encode(func_id, data)); + } + + function good_delegate_call(bytes memory data) public{ + addr_good.delegatecall(abi.encode(bytes4(""), data)); + } +} diff --git a/tests/detectors/controlled-delegatecall/controlled_delegatecall.sol.0.5.1.ControlledDelegateCall.json b/tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol.0.7.6.ControlledDelegateCall.json similarity index 85% rename from tests/detectors/controlled-delegatecall/controlled_delegatecall.sol.0.5.1.ControlledDelegateCall.json rename to tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol.0.7.6.ControlledDelegateCall.json index 114ba8299d..fd6a5ae12a 100644 --- a/tests/detectors/controlled-delegatecall/controlled_delegatecall.sol.0.5.1.ControlledDelegateCall.json +++ b/tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol.0.7.6.ControlledDelegateCall.json @@ -9,9 +9,9 @@ "start": 101, "length": 134, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_relative": "tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_short": "tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol", "is_dependency": false, "lines": [ 8, @@ -30,9 +30,9 @@ "start": 0, "length": 585, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_relative": "tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_short": "tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol", "is_dependency": false, "lines": [ 1, @@ -75,9 +75,9 @@ "start": 201, "length": 27, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_relative": "tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_short": "tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol", "is_dependency": false, "lines": [ 10 @@ -93,9 +93,9 @@ "start": 101, "length": 134, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_relative": "tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_short": "tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol", "is_dependency": false, "lines": [ 8, @@ -114,9 +114,9 @@ "start": 0, "length": 585, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_relative": "tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_short": "tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol", "is_dependency": false, "lines": [ 1, @@ -155,9 +155,9 @@ } } ], - "description": "C.bad_delegate_call(bytes) (tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#8-11) uses delegatecall to a input-controlled function id\n\t- addr_bad.delegatecall(data) (tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#10)\n", - "markdown": "[C.bad_delegate_call(bytes)](tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#L8-L11) uses delegatecall to a input-controlled function id\n\t- [addr_bad.delegatecall(data)](tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#L10)\n", - "id": "d4aa9719b93dc4f3a3ec9b915071763b38d6881ddee6eaa86dade09f3caa1e5e", + "description": "C.bad_delegate_call(bytes) (tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol#8-11) uses delegatecall to a input-controlled function id\n\t- addr_bad.delegatecall(data) (tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol#10)\n", + "markdown": "[C.bad_delegate_call(bytes)](tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol#L8-L11) uses delegatecall to a input-controlled function id\n\t- [addr_bad.delegatecall(data)](tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol#L10)\n", + "id": "59a70e53c14de214629ffde4abab9700cbb3bc66a99e281954e3b9f285a28c2d", "check": "controlled-delegatecall", "impact": "High", "confidence": "Medium" @@ -171,9 +171,9 @@ "start": 337, "length": 118, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_relative": "tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_short": "tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol", "is_dependency": false, "lines": [ 18, @@ -191,9 +191,9 @@ "start": 0, "length": 585, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_relative": "tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_short": "tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol", "is_dependency": false, "lines": [ 1, @@ -236,9 +236,9 @@ "start": 400, "length": 48, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_relative": "tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_short": "tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol", "is_dependency": false, "lines": [ 19 @@ -254,9 +254,9 @@ "start": 337, "length": 118, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_relative": "tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_short": "tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol", "is_dependency": false, "lines": [ 18, @@ -274,9 +274,9 @@ "start": 0, "length": 585, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_relative": "tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "filename_short": "tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol", "is_dependency": false, "lines": [ 1, @@ -315,9 +315,9 @@ } } ], - "description": "C.bad_delegate_call2(bytes) (tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#18-20) uses delegatecall to a input-controlled function id\n\t- addr_bad.delegatecall(abi.encode(func_id,data)) (tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#19)\n", - "markdown": "[C.bad_delegate_call2(bytes)](tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#L18-L20) uses delegatecall to a input-controlled function id\n\t- [addr_bad.delegatecall(abi.encode(func_id,data))](tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#L19)\n", - "id": "3358bd7774f1a574c5521fe2e084afa81e866adf9a77f3f25e3009f17d8c9fe7", + "description": "C.bad_delegate_call2(bytes) (tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol#18-20) uses delegatecall to a input-controlled function id\n\t- addr_bad.delegatecall(abi.encode(func_id,data)) (tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol#19)\n", + "markdown": "[C.bad_delegate_call2(bytes)](tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol#L18-L20) uses delegatecall to a input-controlled function id\n\t- [addr_bad.delegatecall(abi.encode(func_id,data))](tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol#L19)\n", + "id": "04a4aed45b4c803d9fa03d70198a8f6d7f4228d2fd5e06bd61c4c68431be2c90", "check": "controlled-delegatecall", "impact": "High", "confidence": "Medium" diff --git a/tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol b/tests/detectors/costly-loop/0.4.25/multiple_costly_operations_in_loop.sol similarity index 100% rename from tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol rename to tests/detectors/costly-loop/0.4.25/multiple_costly_operations_in_loop.sol diff --git a/tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol.0.4.25.CostlyOperationsInLoop.json b/tests/detectors/costly-loop/0.4.25/multiple_costly_operations_in_loop.sol.0.4.25.CostlyOperationsInLoop.json similarity index 87% rename from tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol.0.4.25.CostlyOperationsInLoop.json rename to tests/detectors/costly-loop/0.4.25/multiple_costly_operations_in_loop.sol.0.4.25.CostlyOperationsInLoop.json index e9662ab318..800a468ffc 100644 --- a/tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol.0.4.25.CostlyOperationsInLoop.json +++ b/tests/detectors/costly-loop/0.4.25/multiple_costly_operations_in_loop.sol.0.4.25.CostlyOperationsInLoop.json @@ -9,9 +9,9 @@ "start": 252, "length": 373, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol", + "filename_relative": "tests/detectors/costly-loop/0.4.25/multiple_costly_operations_in_loop.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol", + "filename_short": "tests/detectors/costly-loop/0.4.25/multiple_costly_operations_in_loop.sol", "is_dependency": false, "lines": [ 10, @@ -31,9 +31,9 @@ "start": 26, "length": 1081, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol", + "filename_relative": "tests/detectors/costly-loop/0.4.25/multiple_costly_operations_in_loop.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol", + "filename_short": "tests/detectors/costly-loop/0.4.25/multiple_costly_operations_in_loop.sol", "is_dependency": false, "lines": [ 3, @@ -84,9 +84,9 @@ "start": 410, "length": 16, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol", + "filename_relative": "tests/detectors/costly-loop/0.4.25/multiple_costly_operations_in_loop.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol", + "filename_short": "tests/detectors/costly-loop/0.4.25/multiple_costly_operations_in_loop.sol", "is_dependency": false, "lines": [ 12 @@ -102,9 +102,9 @@ "start": 252, "length": 373, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol", + "filename_relative": "tests/detectors/costly-loop/0.4.25/multiple_costly_operations_in_loop.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol", + "filename_short": "tests/detectors/costly-loop/0.4.25/multiple_costly_operations_in_loop.sol", "is_dependency": false, "lines": [ 10, @@ -124,9 +124,9 @@ "start": 26, "length": 1081, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol", + "filename_relative": "tests/detectors/costly-loop/0.4.25/multiple_costly_operations_in_loop.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol", + "filename_short": "tests/detectors/costly-loop/0.4.25/multiple_costly_operations_in_loop.sol", "is_dependency": false, "lines": [ 3, @@ -173,9 +173,9 @@ } } ], - "description": "CostlyOperationsInLoop.bad() (tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol#10-14) has costly operations inside a loop:\n\t- state_variable ++ (tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol#12)\n", - "markdown": "[CostlyOperationsInLoop.bad()](tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol#L10-L14) has costly operations inside a loop:\n\t- [state_variable ++](tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol#L12)\n", - "id": "245dbe07302f785326efd84e8b711d1691f045726e1098601f7e1058f1e72b2a", + "description": "CostlyOperationsInLoop.bad() (tests/detectors/costly-loop/0.4.25/multiple_costly_operations_in_loop.sol#10-14) has costly operations inside a loop:\n\t- state_variable ++ (tests/detectors/costly-loop/0.4.25/multiple_costly_operations_in_loop.sol#12)\n", + "markdown": "[CostlyOperationsInLoop.bad()](tests/detectors/costly-loop/0.4.25/multiple_costly_operations_in_loop.sol#L10-L14) has costly operations inside a loop:\n\t- [state_variable ++](tests/detectors/costly-loop/0.4.25/multiple_costly_operations_in_loop.sol#L12)\n", + "id": "d00641f4d08f61911f58d8c73e60ce3f655d045c8f6207b7fdf91a029fd14962", "check": "costly-loop", "impact": "Informational", "confidence": "Medium" diff --git a/tests/detectors/costly-loop/0.5.16/multiple_costly_operations_in_loop.sol b/tests/detectors/costly-loop/0.5.16/multiple_costly_operations_in_loop.sol new file mode 100644 index 0000000000..514b60fb3c --- /dev/null +++ b/tests/detectors/costly-loop/0.5.16/multiple_costly_operations_in_loop.sol @@ -0,0 +1,35 @@ +// pragma solidity ^0.4.24; + +contract CostlyOperationsInLoop{ + + uint loop_count = 100; + uint state_variable=0; + mapping (uint=>uint) map; + uint[100] arr; + + function bad() external{ + for (uint i=0; i < loop_count; i++){ + state_variable++; + } + } + + function ignore_for_now1() external { + for (uint i=0; i < 100; i++){ + map[i] = i+1; + } + } + + function ignore_for_now2() external { + for (uint i=0; i < 100; i++){ + arr[i] = i+1; + } + } + + function good() external{ + uint local_variable = state_variable; + for (uint i=0; i < loop_count; i++){ + local_variable++; + } + state_variable = local_variable; + } +} diff --git a/tests/detectors/costly-loop/0.5.16/multiple_costly_operations_in_loop.sol.0.5.16.CostlyOperationsInLoop.json b/tests/detectors/costly-loop/0.5.16/multiple_costly_operations_in_loop.sol.0.5.16.CostlyOperationsInLoop.json new file mode 100644 index 0000000000..0f95879212 --- /dev/null +++ b/tests/detectors/costly-loop/0.5.16/multiple_costly_operations_in_loop.sol.0.5.16.CostlyOperationsInLoop.json @@ -0,0 +1,184 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad", + "source_mapping": { + "start": 255, + "length": 373, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/costly-loop/0.5.16/multiple_costly_operations_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/costly-loop/0.5.16/multiple_costly_operations_in_loop.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "CostlyOperationsInLoop", + "source_mapping": { + "start": 29, + "length": 1081, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/costly-loop/0.5.16/multiple_costly_operations_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/costly-loop/0.5.16/multiple_costly_operations_in_loop.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad()" + } + }, + { + "type": "node", + "name": "state_variable ++", + "source_mapping": { + "start": 413, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/costly-loop/0.5.16/multiple_costly_operations_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/costly-loop/0.5.16/multiple_costly_operations_in_loop.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 7, + "ending_column": 23 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad", + "source_mapping": { + "start": 255, + "length": 373, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/costly-loop/0.5.16/multiple_costly_operations_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/costly-loop/0.5.16/multiple_costly_operations_in_loop.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "CostlyOperationsInLoop", + "source_mapping": { + "start": 29, + "length": 1081, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/costly-loop/0.5.16/multiple_costly_operations_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/costly-loop/0.5.16/multiple_costly_operations_in_loop.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad()" + } + } + } + } + ], + "description": "CostlyOperationsInLoop.bad() (tests/detectors/costly-loop/0.5.16/multiple_costly_operations_in_loop.sol#10-14) has costly operations inside a loop:\n\t- state_variable ++ (tests/detectors/costly-loop/0.5.16/multiple_costly_operations_in_loop.sol#12)\n", + "markdown": "[CostlyOperationsInLoop.bad()](tests/detectors/costly-loop/0.5.16/multiple_costly_operations_in_loop.sol#L10-L14) has costly operations inside a loop:\n\t- [state_variable ++](tests/detectors/costly-loop/0.5.16/multiple_costly_operations_in_loop.sol#L12)\n", + "id": "1496f0664c18be47e9b27df825eb148e11f5458abbe2c0b8758c0645a220d802", + "check": "costly-loop", + "impact": "Informational", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/costly-loop/0.6.11/multiple_costly_operations_in_loop.sol b/tests/detectors/costly-loop/0.6.11/multiple_costly_operations_in_loop.sol new file mode 100644 index 0000000000..514b60fb3c --- /dev/null +++ b/tests/detectors/costly-loop/0.6.11/multiple_costly_operations_in_loop.sol @@ -0,0 +1,35 @@ +// pragma solidity ^0.4.24; + +contract CostlyOperationsInLoop{ + + uint loop_count = 100; + uint state_variable=0; + mapping (uint=>uint) map; + uint[100] arr; + + function bad() external{ + for (uint i=0; i < loop_count; i++){ + state_variable++; + } + } + + function ignore_for_now1() external { + for (uint i=0; i < 100; i++){ + map[i] = i+1; + } + } + + function ignore_for_now2() external { + for (uint i=0; i < 100; i++){ + arr[i] = i+1; + } + } + + function good() external{ + uint local_variable = state_variable; + for (uint i=0; i < loop_count; i++){ + local_variable++; + } + state_variable = local_variable; + } +} diff --git a/tests/detectors/costly-loop/0.6.11/multiple_costly_operations_in_loop.sol.0.6.11.CostlyOperationsInLoop.json b/tests/detectors/costly-loop/0.6.11/multiple_costly_operations_in_loop.sol.0.6.11.CostlyOperationsInLoop.json new file mode 100644 index 0000000000..184d7a6230 --- /dev/null +++ b/tests/detectors/costly-loop/0.6.11/multiple_costly_operations_in_loop.sol.0.6.11.CostlyOperationsInLoop.json @@ -0,0 +1,184 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad", + "source_mapping": { + "start": 255, + "length": 373, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/costly-loop/0.6.11/multiple_costly_operations_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/costly-loop/0.6.11/multiple_costly_operations_in_loop.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "CostlyOperationsInLoop", + "source_mapping": { + "start": 29, + "length": 1081, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/costly-loop/0.6.11/multiple_costly_operations_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/costly-loop/0.6.11/multiple_costly_operations_in_loop.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad()" + } + }, + { + "type": "node", + "name": "state_variable ++", + "source_mapping": { + "start": 413, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/costly-loop/0.6.11/multiple_costly_operations_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/costly-loop/0.6.11/multiple_costly_operations_in_loop.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 7, + "ending_column": 23 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad", + "source_mapping": { + "start": 255, + "length": 373, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/costly-loop/0.6.11/multiple_costly_operations_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/costly-loop/0.6.11/multiple_costly_operations_in_loop.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "CostlyOperationsInLoop", + "source_mapping": { + "start": 29, + "length": 1081, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/costly-loop/0.6.11/multiple_costly_operations_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/costly-loop/0.6.11/multiple_costly_operations_in_loop.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad()" + } + } + } + } + ], + "description": "CostlyOperationsInLoop.bad() (tests/detectors/costly-loop/0.6.11/multiple_costly_operations_in_loop.sol#10-14) has costly operations inside a loop:\n\t- state_variable ++ (tests/detectors/costly-loop/0.6.11/multiple_costly_operations_in_loop.sol#12)\n", + "markdown": "[CostlyOperationsInLoop.bad()](tests/detectors/costly-loop/0.6.11/multiple_costly_operations_in_loop.sol#L10-L14) has costly operations inside a loop:\n\t- [state_variable ++](tests/detectors/costly-loop/0.6.11/multiple_costly_operations_in_loop.sol#L12)\n", + "id": "aad1cf92bc7ec06342b0fa39a1affa4e06b09bdb3b0c8fae61aeb4221236041a", + "check": "costly-loop", + "impact": "Informational", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/costly-loop/0.7.6/multiple_costly_operations_in_loop.sol b/tests/detectors/costly-loop/0.7.6/multiple_costly_operations_in_loop.sol new file mode 100644 index 0000000000..514b60fb3c --- /dev/null +++ b/tests/detectors/costly-loop/0.7.6/multiple_costly_operations_in_loop.sol @@ -0,0 +1,35 @@ +// pragma solidity ^0.4.24; + +contract CostlyOperationsInLoop{ + + uint loop_count = 100; + uint state_variable=0; + mapping (uint=>uint) map; + uint[100] arr; + + function bad() external{ + for (uint i=0; i < loop_count; i++){ + state_variable++; + } + } + + function ignore_for_now1() external { + for (uint i=0; i < 100; i++){ + map[i] = i+1; + } + } + + function ignore_for_now2() external { + for (uint i=0; i < 100; i++){ + arr[i] = i+1; + } + } + + function good() external{ + uint local_variable = state_variable; + for (uint i=0; i < loop_count; i++){ + local_variable++; + } + state_variable = local_variable; + } +} diff --git a/tests/detectors/costly-loop/0.7.6/multiple_costly_operations_in_loop.sol.0.7.6.CostlyOperationsInLoop.json b/tests/detectors/costly-loop/0.7.6/multiple_costly_operations_in_loop.sol.0.7.6.CostlyOperationsInLoop.json new file mode 100644 index 0000000000..c5e089ee29 --- /dev/null +++ b/tests/detectors/costly-loop/0.7.6/multiple_costly_operations_in_loop.sol.0.7.6.CostlyOperationsInLoop.json @@ -0,0 +1,184 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad", + "source_mapping": { + "start": 255, + "length": 373, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/costly-loop/0.7.6/multiple_costly_operations_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/costly-loop/0.7.6/multiple_costly_operations_in_loop.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "CostlyOperationsInLoop", + "source_mapping": { + "start": 29, + "length": 1081, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/costly-loop/0.7.6/multiple_costly_operations_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/costly-loop/0.7.6/multiple_costly_operations_in_loop.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad()" + } + }, + { + "type": "node", + "name": "state_variable ++", + "source_mapping": { + "start": 413, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/costly-loop/0.7.6/multiple_costly_operations_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/costly-loop/0.7.6/multiple_costly_operations_in_loop.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 7, + "ending_column": 23 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad", + "source_mapping": { + "start": 255, + "length": 373, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/costly-loop/0.7.6/multiple_costly_operations_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/costly-loop/0.7.6/multiple_costly_operations_in_loop.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "CostlyOperationsInLoop", + "source_mapping": { + "start": 29, + "length": 1081, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/costly-loop/0.7.6/multiple_costly_operations_in_loop.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/costly-loop/0.7.6/multiple_costly_operations_in_loop.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad()" + } + } + } + } + ], + "description": "CostlyOperationsInLoop.bad() (tests/detectors/costly-loop/0.7.6/multiple_costly_operations_in_loop.sol#10-14) has costly operations inside a loop:\n\t- state_variable ++ (tests/detectors/costly-loop/0.7.6/multiple_costly_operations_in_loop.sol#12)\n", + "markdown": "[CostlyOperationsInLoop.bad()](tests/detectors/costly-loop/0.7.6/multiple_costly_operations_in_loop.sol#L10-L14) has costly operations inside a loop:\n\t- [state_variable ++](tests/detectors/costly-loop/0.7.6/multiple_costly_operations_in_loop.sol#L12)\n", + "id": "d6753ee3bfd5d2bb35baf5f9aa672d98eb00b2a771cbbfe37d5bac0d009f56ad", + "check": "costly-loop", + "impact": "Informational", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/erc20-indexed/erc20_indexed.sol b/tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol similarity index 100% rename from tests/detectors/erc20-indexed/erc20_indexed.sol rename to tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol diff --git a/tests/detectors/erc20-indexed/erc20_indexed.sol.0.4.25.UnindexedERC20EventParameters.json b/tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol.0.4.25.UnindexedERC20EventParameters.json similarity index 87% rename from tests/detectors/erc20-indexed/erc20_indexed.sol.0.4.25.UnindexedERC20EventParameters.json rename to tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol.0.4.25.UnindexedERC20EventParameters.json index e721dfaca6..8583d5b314 100644 --- a/tests/detectors/erc20-indexed/erc20_indexed.sol.0.4.25.UnindexedERC20EventParameters.json +++ b/tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol.0.4.25.UnindexedERC20EventParameters.json @@ -9,9 +9,9 @@ "start": 1090, "length": 53, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc20-indexed/erc20_indexed.sol", + "filename_relative": "tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc20-indexed/erc20_indexed.sol", + "filename_short": "tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol", "is_dependency": false, "lines": [ 19 @@ -27,9 +27,9 @@ "start": 622, "length": 587, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc20-indexed/erc20_indexed.sol", + "filename_relative": "tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc20-indexed/erc20_indexed.sol", + "filename_short": "tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol", "is_dependency": false, "lines": [ 12, @@ -54,8 +54,8 @@ } } ], - "description": "ERC20 event IERC20BadTransfer(address,address,uint256) (tests/detectors/erc20-indexed/erc20_indexed.sol#19)does not index parameter from\n", - "markdown": "ERC20 event [IERC20BadTransfer(address,address,uint256)](tests/detectors/erc20-indexed/erc20_indexed.sol#L19)does not index parameter from\n", + "description": "ERC20 event IERC20BadTransfer(address,address,uint256) (tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol#19)does not index parameter from\n", + "markdown": "ERC20 event [IERC20BadTransfer(address,address,uint256)](tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol#L19)does not index parameter from\n", "id": "a86c7a54115f270548e82d71570dc4d2900b622b0f82c6fce137f3a35314af53", "check": "erc20-indexed", "impact": "Informational", @@ -70,9 +70,9 @@ "start": 1090, "length": 53, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc20-indexed/erc20_indexed.sol", + "filename_relative": "tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc20-indexed/erc20_indexed.sol", + "filename_short": "tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol", "is_dependency": false, "lines": [ 19 @@ -88,9 +88,9 @@ "start": 622, "length": 587, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc20-indexed/erc20_indexed.sol", + "filename_relative": "tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc20-indexed/erc20_indexed.sol", + "filename_short": "tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol", "is_dependency": false, "lines": [ 12, @@ -115,8 +115,8 @@ } } ], - "description": "ERC20 event IERC20BadTransfer(address,address,uint256) (tests/detectors/erc20-indexed/erc20_indexed.sol#19)does not index parameter to\n", - "markdown": "ERC20 event [IERC20BadTransfer(address,address,uint256)](tests/detectors/erc20-indexed/erc20_indexed.sol#L19)does not index parameter to\n", + "description": "ERC20 event IERC20BadTransfer(address,address,uint256) (tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol#19)does not index parameter to\n", + "markdown": "ERC20 event [IERC20BadTransfer(address,address,uint256)](tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol#L19)does not index parameter to\n", "id": "29c46eb3a4695004959847ae09377729cdf3aa583de95560090b9bd49977c49b", "check": "erc20-indexed", "impact": "Informational", @@ -131,9 +131,9 @@ "start": 1148, "length": 59, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc20-indexed/erc20_indexed.sol", + "filename_relative": "tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc20-indexed/erc20_indexed.sol", + "filename_short": "tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol", "is_dependency": false, "lines": [ 20 @@ -149,9 +149,9 @@ "start": 622, "length": 587, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc20-indexed/erc20_indexed.sol", + "filename_relative": "tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc20-indexed/erc20_indexed.sol", + "filename_short": "tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol", "is_dependency": false, "lines": [ 12, @@ -176,8 +176,8 @@ } } ], - "description": "ERC20 event IERC20BadApproval(address,address,uint256) (tests/detectors/erc20-indexed/erc20_indexed.sol#20)does not index parameter owner\n", - "markdown": "ERC20 event [IERC20BadApproval(address,address,uint256)](tests/detectors/erc20-indexed/erc20_indexed.sol#L20)does not index parameter owner\n", + "description": "ERC20 event IERC20BadApproval(address,address,uint256) (tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol#20)does not index parameter owner\n", + "markdown": "ERC20 event [IERC20BadApproval(address,address,uint256)](tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol#L20)does not index parameter owner\n", "id": "7d72b56a71ca96db304878f25484c496af1d283a9b777dc788f1473974057025", "check": "erc20-indexed", "impact": "Informational", @@ -192,9 +192,9 @@ "start": 1148, "length": 59, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc20-indexed/erc20_indexed.sol", + "filename_relative": "tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc20-indexed/erc20_indexed.sol", + "filename_short": "tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol", "is_dependency": false, "lines": [ 20 @@ -210,9 +210,9 @@ "start": 622, "length": 587, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc20-indexed/erc20_indexed.sol", + "filename_relative": "tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc20-indexed/erc20_indexed.sol", + "filename_short": "tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol", "is_dependency": false, "lines": [ 12, @@ -237,8 +237,8 @@ } } ], - "description": "ERC20 event IERC20BadApproval(address,address,uint256) (tests/detectors/erc20-indexed/erc20_indexed.sol#20)does not index parameter spender\n", - "markdown": "ERC20 event [IERC20BadApproval(address,address,uint256)](tests/detectors/erc20-indexed/erc20_indexed.sol#L20)does not index parameter spender\n", + "description": "ERC20 event IERC20BadApproval(address,address,uint256) (tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol#20)does not index parameter spender\n", + "markdown": "ERC20 event [IERC20BadApproval(address,address,uint256)](tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol#L20)does not index parameter spender\n", "id": "df4d927d202bdca1fc411d6960d3f62ed2784f5eca7435cb0503f4154f2e3bc6", "check": "erc20-indexed", "impact": "Informational", diff --git a/tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol b/tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol new file mode 100644 index 0000000000..0381d65d4c --- /dev/null +++ b/tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol @@ -0,0 +1,25 @@ +contract IERC20Good { + function transfer(address to, uint value) external returns (bool); + function approve(address spender, uint value) external returns (bool); + function transferFrom(address from, address to, uint value) external returns (bool); + function totalSupply() external view returns (uint); + function balanceOf(address who) external view returns (uint); + function allowance(address owner, address spender) external view returns (uint); + event Transfer(address indexed from, address indexed to, uint value); + event Approval(address indexed owner, address indexed spender, uint value); +} + +contract IERC20Bad { + function transfer(address to, uint value) external returns (bool); + function approve(address spender, uint value) external returns (bool); + function transferFrom(address from, address to, uint value) external returns (bool); + function totalSupply() external view returns (uint); + function balanceOf(address who) external view returns (uint); + function allowance(address owner, address spender) external view returns (uint); + event Transfer(address from, address to, uint value); + event Approval(address owner, address spender, uint value); +} + +contract ERC20BadDerived is IERC20Bad { + +} \ No newline at end of file diff --git a/tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol.0.5.16.UnindexedERC20EventParameters.json b/tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol.0.5.16.UnindexedERC20EventParameters.json new file mode 100644 index 0000000000..97ede6f2bd --- /dev/null +++ b/tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol.0.5.16.UnindexedERC20EventParameters.json @@ -0,0 +1,248 @@ +[ + [ + { + "elements": [ + { + "type": "event", + "name": "Transfer", + "source_mapping": { + "start": 1090, + "length": 53, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol", + "is_dependency": false, + "lines": [ + 19 + ], + "starting_column": 5, + "ending_column": 58 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "IERC20Bad", + "source_mapping": { + "start": 622, + "length": 587, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol", + "is_dependency": false, + "lines": [ + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "Transfer(address,address,uint256)" + }, + "additional_fields": { + "parameter_name": "from" + } + } + ], + "description": "ERC20 event IERC20BadTransfer(address,address,uint256) (tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol#19)does not index parameter from\n", + "markdown": "ERC20 event [IERC20BadTransfer(address,address,uint256)](tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol#L19)does not index parameter from\n", + "id": "a86c7a54115f270548e82d71570dc4d2900b622b0f82c6fce137f3a35314af53", + "check": "erc20-indexed", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "event", + "name": "Transfer", + "source_mapping": { + "start": 1090, + "length": 53, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol", + "is_dependency": false, + "lines": [ + 19 + ], + "starting_column": 5, + "ending_column": 58 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "IERC20Bad", + "source_mapping": { + "start": 622, + "length": 587, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol", + "is_dependency": false, + "lines": [ + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "Transfer(address,address,uint256)" + }, + "additional_fields": { + "parameter_name": "to" + } + } + ], + "description": "ERC20 event IERC20BadTransfer(address,address,uint256) (tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol#19)does not index parameter to\n", + "markdown": "ERC20 event [IERC20BadTransfer(address,address,uint256)](tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol#L19)does not index parameter to\n", + "id": "29c46eb3a4695004959847ae09377729cdf3aa583de95560090b9bd49977c49b", + "check": "erc20-indexed", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "event", + "name": "Approval", + "source_mapping": { + "start": 1148, + "length": 59, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol", + "is_dependency": false, + "lines": [ + 20 + ], + "starting_column": 5, + "ending_column": 64 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "IERC20Bad", + "source_mapping": { + "start": 622, + "length": 587, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol", + "is_dependency": false, + "lines": [ + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "Approval(address,address,uint256)" + }, + "additional_fields": { + "parameter_name": "owner" + } + } + ], + "description": "ERC20 event IERC20BadApproval(address,address,uint256) (tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol#20)does not index parameter owner\n", + "markdown": "ERC20 event [IERC20BadApproval(address,address,uint256)](tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol#L20)does not index parameter owner\n", + "id": "7d72b56a71ca96db304878f25484c496af1d283a9b777dc788f1473974057025", + "check": "erc20-indexed", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "event", + "name": "Approval", + "source_mapping": { + "start": 1148, + "length": 59, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol", + "is_dependency": false, + "lines": [ + 20 + ], + "starting_column": 5, + "ending_column": 64 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "IERC20Bad", + "source_mapping": { + "start": 622, + "length": 587, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol", + "is_dependency": false, + "lines": [ + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "Approval(address,address,uint256)" + }, + "additional_fields": { + "parameter_name": "spender" + } + } + ], + "description": "ERC20 event IERC20BadApproval(address,address,uint256) (tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol#20)does not index parameter spender\n", + "markdown": "ERC20 event [IERC20BadApproval(address,address,uint256)](tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol#L20)does not index parameter spender\n", + "id": "df4d927d202bdca1fc411d6960d3f62ed2784f5eca7435cb0503f4154f2e3bc6", + "check": "erc20-indexed", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol b/tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol new file mode 100644 index 0000000000..32bd941b33 --- /dev/null +++ b/tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol @@ -0,0 +1,25 @@ +abstract contract IERC20Good { + function transfer(address to, uint value) external virtual returns (bool); + function approve(address spender, uint value) external virtual returns (bool); + function transferFrom(address from, address to, uint value) external virtual returns (bool); + function totalSupply() external view virtual returns (uint); + function balanceOf(address who) external view virtual returns (uint); + function allowance(address owner, address spender) external view virtual returns (uint); + event Transfer(address indexed from, address indexed to, uint value); + event Approval(address indexed owner, address indexed spender, uint value); +} + +abstract contract IERC20Bad { + function transfer(address to, uint value) external virtual returns (bool); + function approve(address spender, uint value) external virtual returns (bool); + function transferFrom(address from, address to, uint value) external virtual returns (bool); + function totalSupply() external view virtual returns (uint); + function balanceOf(address who) external view virtual returns (uint); + function allowance(address owner, address spender) external view virtual returns (uint); + event Transfer(address from, address to, uint value); + event Approval(address owner, address spender, uint value); +} + +abstract contract ERC20BadDerived is IERC20Bad { + +} \ No newline at end of file diff --git a/tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol.0.6.11.UnindexedERC20EventParameters.json b/tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol.0.6.11.UnindexedERC20EventParameters.json new file mode 100644 index 0000000000..e3aad45a25 --- /dev/null +++ b/tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol.0.6.11.UnindexedERC20EventParameters.json @@ -0,0 +1,248 @@ +[ + [ + { + "elements": [ + { + "type": "event", + "name": "Transfer", + "source_mapping": { + "start": 1204, + "length": 53, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol", + "is_dependency": false, + "lines": [ + 19 + ], + "starting_column": 5, + "ending_column": 58 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "IERC20Bad", + "source_mapping": { + "start": 679, + "length": 644, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol", + "is_dependency": false, + "lines": [ + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "Transfer(address,address,uint256)" + }, + "additional_fields": { + "parameter_name": "from" + } + } + ], + "description": "ERC20 event IERC20BadTransfer(address,address,uint256) (tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol#19)does not index parameter from\n", + "markdown": "ERC20 event [IERC20BadTransfer(address,address,uint256)](tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol#L19)does not index parameter from\n", + "id": "a86c7a54115f270548e82d71570dc4d2900b622b0f82c6fce137f3a35314af53", + "check": "erc20-indexed", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "event", + "name": "Transfer", + "source_mapping": { + "start": 1204, + "length": 53, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol", + "is_dependency": false, + "lines": [ + 19 + ], + "starting_column": 5, + "ending_column": 58 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "IERC20Bad", + "source_mapping": { + "start": 679, + "length": 644, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol", + "is_dependency": false, + "lines": [ + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "Transfer(address,address,uint256)" + }, + "additional_fields": { + "parameter_name": "to" + } + } + ], + "description": "ERC20 event IERC20BadTransfer(address,address,uint256) (tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol#19)does not index parameter to\n", + "markdown": "ERC20 event [IERC20BadTransfer(address,address,uint256)](tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol#L19)does not index parameter to\n", + "id": "29c46eb3a4695004959847ae09377729cdf3aa583de95560090b9bd49977c49b", + "check": "erc20-indexed", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "event", + "name": "Approval", + "source_mapping": { + "start": 1262, + "length": 59, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol", + "is_dependency": false, + "lines": [ + 20 + ], + "starting_column": 5, + "ending_column": 64 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "IERC20Bad", + "source_mapping": { + "start": 679, + "length": 644, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol", + "is_dependency": false, + "lines": [ + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "Approval(address,address,uint256)" + }, + "additional_fields": { + "parameter_name": "owner" + } + } + ], + "description": "ERC20 event IERC20BadApproval(address,address,uint256) (tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol#20)does not index parameter owner\n", + "markdown": "ERC20 event [IERC20BadApproval(address,address,uint256)](tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol#L20)does not index parameter owner\n", + "id": "7d72b56a71ca96db304878f25484c496af1d283a9b777dc788f1473974057025", + "check": "erc20-indexed", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "event", + "name": "Approval", + "source_mapping": { + "start": 1262, + "length": 59, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol", + "is_dependency": false, + "lines": [ + 20 + ], + "starting_column": 5, + "ending_column": 64 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "IERC20Bad", + "source_mapping": { + "start": 679, + "length": 644, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol", + "is_dependency": false, + "lines": [ + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "Approval(address,address,uint256)" + }, + "additional_fields": { + "parameter_name": "spender" + } + } + ], + "description": "ERC20 event IERC20BadApproval(address,address,uint256) (tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol#20)does not index parameter spender\n", + "markdown": "ERC20 event [IERC20BadApproval(address,address,uint256)](tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol#L20)does not index parameter spender\n", + "id": "df4d927d202bdca1fc411d6960d3f62ed2784f5eca7435cb0503f4154f2e3bc6", + "check": "erc20-indexed", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol b/tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol new file mode 100644 index 0000000000..32bd941b33 --- /dev/null +++ b/tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol @@ -0,0 +1,25 @@ +abstract contract IERC20Good { + function transfer(address to, uint value) external virtual returns (bool); + function approve(address spender, uint value) external virtual returns (bool); + function transferFrom(address from, address to, uint value) external virtual returns (bool); + function totalSupply() external view virtual returns (uint); + function balanceOf(address who) external view virtual returns (uint); + function allowance(address owner, address spender) external view virtual returns (uint); + event Transfer(address indexed from, address indexed to, uint value); + event Approval(address indexed owner, address indexed spender, uint value); +} + +abstract contract IERC20Bad { + function transfer(address to, uint value) external virtual returns (bool); + function approve(address spender, uint value) external virtual returns (bool); + function transferFrom(address from, address to, uint value) external virtual returns (bool); + function totalSupply() external view virtual returns (uint); + function balanceOf(address who) external view virtual returns (uint); + function allowance(address owner, address spender) external view virtual returns (uint); + event Transfer(address from, address to, uint value); + event Approval(address owner, address spender, uint value); +} + +abstract contract ERC20BadDerived is IERC20Bad { + +} \ No newline at end of file diff --git a/tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol.0.7.6.UnindexedERC20EventParameters.json b/tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol.0.7.6.UnindexedERC20EventParameters.json new file mode 100644 index 0000000000..ca7437e74d --- /dev/null +++ b/tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol.0.7.6.UnindexedERC20EventParameters.json @@ -0,0 +1,248 @@ +[ + [ + { + "elements": [ + { + "type": "event", + "name": "Transfer", + "source_mapping": { + "start": 1204, + "length": 53, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol", + "is_dependency": false, + "lines": [ + 19 + ], + "starting_column": 5, + "ending_column": 58 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "IERC20Bad", + "source_mapping": { + "start": 679, + "length": 644, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol", + "is_dependency": false, + "lines": [ + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "Transfer(address,address,uint256)" + }, + "additional_fields": { + "parameter_name": "from" + } + } + ], + "description": "ERC20 event IERC20BadTransfer(address,address,uint256) (tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol#19)does not index parameter from\n", + "markdown": "ERC20 event [IERC20BadTransfer(address,address,uint256)](tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol#L19)does not index parameter from\n", + "id": "a86c7a54115f270548e82d71570dc4d2900b622b0f82c6fce137f3a35314af53", + "check": "erc20-indexed", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "event", + "name": "Transfer", + "source_mapping": { + "start": 1204, + "length": 53, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol", + "is_dependency": false, + "lines": [ + 19 + ], + "starting_column": 5, + "ending_column": 58 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "IERC20Bad", + "source_mapping": { + "start": 679, + "length": 644, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol", + "is_dependency": false, + "lines": [ + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "Transfer(address,address,uint256)" + }, + "additional_fields": { + "parameter_name": "to" + } + } + ], + "description": "ERC20 event IERC20BadTransfer(address,address,uint256) (tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol#19)does not index parameter to\n", + "markdown": "ERC20 event [IERC20BadTransfer(address,address,uint256)](tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol#L19)does not index parameter to\n", + "id": "29c46eb3a4695004959847ae09377729cdf3aa583de95560090b9bd49977c49b", + "check": "erc20-indexed", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "event", + "name": "Approval", + "source_mapping": { + "start": 1262, + "length": 59, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol", + "is_dependency": false, + "lines": [ + 20 + ], + "starting_column": 5, + "ending_column": 64 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "IERC20Bad", + "source_mapping": { + "start": 679, + "length": 644, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol", + "is_dependency": false, + "lines": [ + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "Approval(address,address,uint256)" + }, + "additional_fields": { + "parameter_name": "owner" + } + } + ], + "description": "ERC20 event IERC20BadApproval(address,address,uint256) (tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol#20)does not index parameter owner\n", + "markdown": "ERC20 event [IERC20BadApproval(address,address,uint256)](tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol#L20)does not index parameter owner\n", + "id": "7d72b56a71ca96db304878f25484c496af1d283a9b777dc788f1473974057025", + "check": "erc20-indexed", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "event", + "name": "Approval", + "source_mapping": { + "start": 1262, + "length": 59, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol", + "is_dependency": false, + "lines": [ + 20 + ], + "starting_column": 5, + "ending_column": 64 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "IERC20Bad", + "source_mapping": { + "start": 679, + "length": 644, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol", + "is_dependency": false, + "lines": [ + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "Approval(address,address,uint256)" + }, + "additional_fields": { + "parameter_name": "spender" + } + } + ], + "description": "ERC20 event IERC20BadApproval(address,address,uint256) (tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol#20)does not index parameter spender\n", + "markdown": "ERC20 event [IERC20BadApproval(address,address,uint256)](tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol#L20)does not index parameter spender\n", + "id": "df4d927d202bdca1fc411d6960d3f62ed2784f5eca7435cb0503f4154f2e3bc6", + "check": "erc20-indexed", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/erc20-interface/incorrect_erc20_interface.sol b/tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol similarity index 100% rename from tests/detectors/erc20-interface/incorrect_erc20_interface.sol rename to tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol diff --git a/tests/detectors/erc20-interface/incorrect_erc20_interface.sol.0.4.25.IncorrectERC20InterfaceDetection.json b/tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol.0.4.25.IncorrectERC20InterfaceDetection.json similarity index 82% rename from tests/detectors/erc20-interface/incorrect_erc20_interface.sol.0.4.25.IncorrectERC20InterfaceDetection.json rename to tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol.0.4.25.IncorrectERC20InterfaceDetection.json index f95b046750..47e418579c 100644 --- a/tests/detectors/erc20-interface/incorrect_erc20_interface.sol.0.4.25.IncorrectERC20InterfaceDetection.json +++ b/tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol.0.4.25.IncorrectERC20InterfaceDetection.json @@ -9,9 +9,9 @@ "start": 26, "length": 355, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_relative": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_short": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "is_dependency": false, "lines": [ 3, @@ -34,9 +34,9 @@ "start": 46, "length": 51, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_relative": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_short": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "is_dependency": false, "lines": [ 4 @@ -52,9 +52,9 @@ "start": 26, "length": 355, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_relative": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_short": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "is_dependency": false, "lines": [ 3, @@ -74,8 +74,8 @@ } } ], - "description": "Token (tests/detectors/erc20-interface/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.transfer(address,uint256) (tests/detectors/erc20-interface/incorrect_erc20_interface.sol#4)\n", - "markdown": "[Token](tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.transfer(address,uint256)](tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L4)\n", + "description": "Token (tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.transfer(address,uint256) (tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol#4)\n", + "markdown": "[Token](tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.transfer(address,uint256)](tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol#L4)\n", "id": "d3df2e48ae6e8a1b05b275de574b480853a0839c272ce889e8a1664ae432698e", "check": "erc20-interface", "impact": "Medium", @@ -90,9 +90,9 @@ "start": 26, "length": 355, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_relative": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_short": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "is_dependency": false, "lines": [ 3, @@ -115,9 +115,9 @@ "start": 102, "length": 55, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_relative": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_short": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "is_dependency": false, "lines": [ 5 @@ -133,9 +133,9 @@ "start": 26, "length": 355, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_relative": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_short": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "is_dependency": false, "lines": [ 3, @@ -155,8 +155,8 @@ } } ], - "description": "Token (tests/detectors/erc20-interface/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.approve(address,uint256) (tests/detectors/erc20-interface/incorrect_erc20_interface.sol#5)\n", - "markdown": "[Token](tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.approve(address,uint256)](tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L5)\n", + "description": "Token (tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.approve(address,uint256) (tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol#5)\n", + "markdown": "[Token](tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.approve(address,uint256)](tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol#L5)\n", "id": "0fced3029cf59cf348a6b79c58dbb032d837fdd5a5f355600edebda1878e9e2e", "check": "erc20-interface", "impact": "Medium", @@ -171,9 +171,9 @@ "start": 26, "length": 355, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_relative": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_short": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "is_dependency": false, "lines": [ 3, @@ -196,9 +196,9 @@ "start": 162, "length": 69, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_relative": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_short": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "is_dependency": false, "lines": [ 6 @@ -214,9 +214,9 @@ "start": 26, "length": 355, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_relative": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_short": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "is_dependency": false, "lines": [ 3, @@ -236,8 +236,8 @@ } } ], - "description": "Token (tests/detectors/erc20-interface/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.transferFrom(address,address,uint256) (tests/detectors/erc20-interface/incorrect_erc20_interface.sol#6)\n", - "markdown": "[Token](tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.transferFrom(address,address,uint256)](tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L6)\n", + "description": "Token (tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.transferFrom(address,address,uint256) (tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol#6)\n", + "markdown": "[Token](tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.transferFrom(address,address,uint256)](tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol#L6)\n", "id": "ba13a1588595032984a3fad39610a2414bb8fcb522d1e632d52fa947ff207d73", "check": "erc20-interface", "impact": "Medium", @@ -252,9 +252,9 @@ "start": 26, "length": 355, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_relative": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_short": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "is_dependency": false, "lines": [ 3, @@ -277,9 +277,9 @@ "start": 236, "length": 32, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_relative": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_short": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "is_dependency": false, "lines": [ 7 @@ -295,9 +295,9 @@ "start": 26, "length": 355, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_relative": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_short": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "is_dependency": false, "lines": [ 3, @@ -317,8 +317,8 @@ } } ], - "description": "Token (tests/detectors/erc20-interface/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.totalSupply() (tests/detectors/erc20-interface/incorrect_erc20_interface.sol#7)\n", - "markdown": "[Token](tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.totalSupply()](tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L7)\n", + "description": "Token (tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.totalSupply() (tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol#7)\n", + "markdown": "[Token](tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.totalSupply()](tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol#L7)\n", "id": "c951e429e546af28ac08e241d391e874c1c9c70b0732ccfb63f3bbfb3eaac16e", "check": "erc20-interface", "impact": "Medium", @@ -333,9 +333,9 @@ "start": 26, "length": 355, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_relative": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_short": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "is_dependency": false, "lines": [ 3, @@ -358,9 +358,9 @@ "start": 273, "length": 41, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_relative": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_short": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "is_dependency": false, "lines": [ 8 @@ -376,9 +376,9 @@ "start": 26, "length": 355, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_relative": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_short": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "is_dependency": false, "lines": [ 3, @@ -398,8 +398,8 @@ } } ], - "description": "Token (tests/detectors/erc20-interface/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.balanceOf(address) (tests/detectors/erc20-interface/incorrect_erc20_interface.sol#8)\n", - "markdown": "[Token](tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.balanceOf(address)](tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L8)\n", + "description": "Token (tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.balanceOf(address) (tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol#8)\n", + "markdown": "[Token](tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.balanceOf(address)](tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol#L8)\n", "id": "758ca2456030a36dbd6115f2ccb1a43f53f1dabd66ed079806df0f6b7b4d21ef", "check": "erc20-interface", "impact": "Medium", @@ -414,9 +414,9 @@ "start": 26, "length": 355, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_relative": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_short": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "is_dependency": false, "lines": [ 3, @@ -439,9 +439,9 @@ "start": 319, "length": 60, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_relative": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_short": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "is_dependency": false, "lines": [ 9 @@ -457,9 +457,9 @@ "start": 26, "length": 355, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_relative": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "filename_short": "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "is_dependency": false, "lines": [ 3, @@ -479,8 +479,8 @@ } } ], - "description": "Token (tests/detectors/erc20-interface/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.allowance(address,address) (tests/detectors/erc20-interface/incorrect_erc20_interface.sol#9)\n", - "markdown": "[Token](tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.allowance(address,address)](tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L9)\n", + "description": "Token (tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.allowance(address,address) (tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol#9)\n", + "markdown": "[Token](tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.allowance(address,address)](tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol#L9)\n", "id": "1286abfe21b09e21e1cec8b991f73664e104fa39f7f4190690ece3af45bc0c7a", "check": "erc20-interface", "impact": "Medium", diff --git a/tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol b/tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol new file mode 100644 index 0000000000..47af2c624c --- /dev/null +++ b/tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol @@ -0,0 +1,10 @@ +// pragma solidity ^0.4.24; + +contract Token{ + function transfer(address to, uint value) external; + function approve(address spender, uint value) external; + function transferFrom(address from, address to, uint value) external; + function totalSupply() external; + function balanceOf(address who) external; + function allowance(address owner, address spender) external; +} diff --git a/tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol.0.5.16.IncorrectERC20InterfaceDetection.json b/tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol.0.5.16.IncorrectERC20InterfaceDetection.json new file mode 100644 index 0000000000..1abcc668f6 --- /dev/null +++ b/tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol.0.5.16.IncorrectERC20InterfaceDetection.json @@ -0,0 +1,490 @@ +[ + [ + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 355, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "transfer", + "source_mapping": { + "start": 49, + "length": 51, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 4 + ], + "starting_column": 5, + "ending_column": 56 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 355, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "transfer(address,uint256)" + } + } + ], + "description": "Token (tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.transfer(address,uint256) (tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol#4)\n", + "markdown": "[Token](tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.transfer(address,uint256)](tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol#L4)\n", + "id": "d3df2e48ae6e8a1b05b275de574b480853a0839c272ce889e8a1664ae432698e", + "check": "erc20-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 355, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "approve", + "source_mapping": { + "start": 105, + "length": 55, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 5 + ], + "starting_column": 5, + "ending_column": 60 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 355, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "approve(address,uint256)" + } + } + ], + "description": "Token (tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.approve(address,uint256) (tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol#5)\n", + "markdown": "[Token](tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.approve(address,uint256)](tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol#L5)\n", + "id": "0fced3029cf59cf348a6b79c58dbb032d837fdd5a5f355600edebda1878e9e2e", + "check": "erc20-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 355, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "transferFrom", + "source_mapping": { + "start": 165, + "length": 69, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 6 + ], + "starting_column": 5, + "ending_column": 74 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 355, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "transferFrom(address,address,uint256)" + } + } + ], + "description": "Token (tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.transferFrom(address,address,uint256) (tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol#6)\n", + "markdown": "[Token](tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.transferFrom(address,address,uint256)](tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol#L6)\n", + "id": "ba13a1588595032984a3fad39610a2414bb8fcb522d1e632d52fa947ff207d73", + "check": "erc20-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 355, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "totalSupply", + "source_mapping": { + "start": 239, + "length": 32, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 7 + ], + "starting_column": 5, + "ending_column": 37 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 355, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "totalSupply()" + } + } + ], + "description": "Token (tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.totalSupply() (tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol#7)\n", + "markdown": "[Token](tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.totalSupply()](tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol#L7)\n", + "id": "c951e429e546af28ac08e241d391e874c1c9c70b0732ccfb63f3bbfb3eaac16e", + "check": "erc20-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 355, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "balanceOf", + "source_mapping": { + "start": 276, + "length": 41, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 8 + ], + "starting_column": 5, + "ending_column": 46 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 355, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "balanceOf(address)" + } + } + ], + "description": "Token (tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.balanceOf(address) (tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol#8)\n", + "markdown": "[Token](tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.balanceOf(address)](tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol#L8)\n", + "id": "758ca2456030a36dbd6115f2ccb1a43f53f1dabd66ed079806df0f6b7b4d21ef", + "check": "erc20-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 355, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "allowance", + "source_mapping": { + "start": 322, + "length": 60, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 9 + ], + "starting_column": 5, + "ending_column": 65 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 355, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "allowance(address,address)" + } + } + ], + "description": "Token (tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.allowance(address,address) (tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol#9)\n", + "markdown": "[Token](tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.allowance(address,address)](tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol#L9)\n", + "id": "1286abfe21b09e21e1cec8b991f73664e104fa39f7f4190690ece3af45bc0c7a", + "check": "erc20-interface", + "impact": "Medium", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol b/tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol new file mode 100644 index 0000000000..301d23b144 --- /dev/null +++ b/tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol @@ -0,0 +1,10 @@ +// pragma solidity ^0.4.24; + +abstract contract Token{ + function transfer(address to, uint value) external virtual; + function approve(address spender, uint value) external virtual; + function transferFrom(address from, address to, uint value) external virtual; + function totalSupply() external virtual; + function balanceOf(address who) external virtual; + function allowance(address owner, address spender) external virtual; +} diff --git a/tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol.0.6.11.IncorrectERC20InterfaceDetection.json b/tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol.0.6.11.IncorrectERC20InterfaceDetection.json new file mode 100644 index 0000000000..c0a6a49232 --- /dev/null +++ b/tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol.0.6.11.IncorrectERC20InterfaceDetection.json @@ -0,0 +1,490 @@ +[ + [ + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 412, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "transfer", + "source_mapping": { + "start": 58, + "length": 59, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 4 + ], + "starting_column": 5, + "ending_column": 64 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 412, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "transfer(address,uint256)" + } + } + ], + "description": "Token (tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.transfer(address,uint256) (tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol#4)\n", + "markdown": "[Token](tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.transfer(address,uint256)](tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol#L4)\n", + "id": "d3df2e48ae6e8a1b05b275de574b480853a0839c272ce889e8a1664ae432698e", + "check": "erc20-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 412, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "approve", + "source_mapping": { + "start": 122, + "length": 63, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 5 + ], + "starting_column": 5, + "ending_column": 68 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 412, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "approve(address,uint256)" + } + } + ], + "description": "Token (tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.approve(address,uint256) (tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol#5)\n", + "markdown": "[Token](tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.approve(address,uint256)](tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol#L5)\n", + "id": "0fced3029cf59cf348a6b79c58dbb032d837fdd5a5f355600edebda1878e9e2e", + "check": "erc20-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 412, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "transferFrom", + "source_mapping": { + "start": 190, + "length": 77, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 6 + ], + "starting_column": 5, + "ending_column": 82 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 412, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "transferFrom(address,address,uint256)" + } + } + ], + "description": "Token (tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.transferFrom(address,address,uint256) (tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol#6)\n", + "markdown": "[Token](tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.transferFrom(address,address,uint256)](tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol#L6)\n", + "id": "ba13a1588595032984a3fad39610a2414bb8fcb522d1e632d52fa947ff207d73", + "check": "erc20-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 412, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "totalSupply", + "source_mapping": { + "start": 272, + "length": 40, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 7 + ], + "starting_column": 5, + "ending_column": 45 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 412, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "totalSupply()" + } + } + ], + "description": "Token (tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.totalSupply() (tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol#7)\n", + "markdown": "[Token](tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.totalSupply()](tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol#L7)\n", + "id": "c951e429e546af28ac08e241d391e874c1c9c70b0732ccfb63f3bbfb3eaac16e", + "check": "erc20-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 412, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "balanceOf", + "source_mapping": { + "start": 317, + "length": 49, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 8 + ], + "starting_column": 5, + "ending_column": 54 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 412, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "balanceOf(address)" + } + } + ], + "description": "Token (tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.balanceOf(address) (tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol#8)\n", + "markdown": "[Token](tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.balanceOf(address)](tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol#L8)\n", + "id": "758ca2456030a36dbd6115f2ccb1a43f53f1dabd66ed079806df0f6b7b4d21ef", + "check": "erc20-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 412, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "allowance", + "source_mapping": { + "start": 371, + "length": 68, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 9 + ], + "starting_column": 5, + "ending_column": 73 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 412, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "allowance(address,address)" + } + } + ], + "description": "Token (tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.allowance(address,address) (tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol#9)\n", + "markdown": "[Token](tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.allowance(address,address)](tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol#L9)\n", + "id": "1286abfe21b09e21e1cec8b991f73664e104fa39f7f4190690ece3af45bc0c7a", + "check": "erc20-interface", + "impact": "Medium", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol b/tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol new file mode 100644 index 0000000000..301d23b144 --- /dev/null +++ b/tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol @@ -0,0 +1,10 @@ +// pragma solidity ^0.4.24; + +abstract contract Token{ + function transfer(address to, uint value) external virtual; + function approve(address spender, uint value) external virtual; + function transferFrom(address from, address to, uint value) external virtual; + function totalSupply() external virtual; + function balanceOf(address who) external virtual; + function allowance(address owner, address spender) external virtual; +} diff --git a/tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol.0.7.6.IncorrectERC20InterfaceDetection.json b/tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol.0.7.6.IncorrectERC20InterfaceDetection.json new file mode 100644 index 0000000000..7bc10f6317 --- /dev/null +++ b/tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol.0.7.6.IncorrectERC20InterfaceDetection.json @@ -0,0 +1,490 @@ +[ + [ + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 412, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "transfer", + "source_mapping": { + "start": 58, + "length": 59, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 4 + ], + "starting_column": 5, + "ending_column": 64 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 412, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "transfer(address,uint256)" + } + } + ], + "description": "Token (tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.transfer(address,uint256) (tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol#4)\n", + "markdown": "[Token](tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.transfer(address,uint256)](tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol#L4)\n", + "id": "d3df2e48ae6e8a1b05b275de574b480853a0839c272ce889e8a1664ae432698e", + "check": "erc20-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 412, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "approve", + "source_mapping": { + "start": 122, + "length": 63, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 5 + ], + "starting_column": 5, + "ending_column": 68 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 412, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "approve(address,uint256)" + } + } + ], + "description": "Token (tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.approve(address,uint256) (tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol#5)\n", + "markdown": "[Token](tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.approve(address,uint256)](tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol#L5)\n", + "id": "0fced3029cf59cf348a6b79c58dbb032d837fdd5a5f355600edebda1878e9e2e", + "check": "erc20-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 412, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "transferFrom", + "source_mapping": { + "start": 190, + "length": 77, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 6 + ], + "starting_column": 5, + "ending_column": 82 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 412, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "transferFrom(address,address,uint256)" + } + } + ], + "description": "Token (tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.transferFrom(address,address,uint256) (tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol#6)\n", + "markdown": "[Token](tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.transferFrom(address,address,uint256)](tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol#L6)\n", + "id": "ba13a1588595032984a3fad39610a2414bb8fcb522d1e632d52fa947ff207d73", + "check": "erc20-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 412, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "totalSupply", + "source_mapping": { + "start": 272, + "length": 40, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 7 + ], + "starting_column": 5, + "ending_column": 45 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 412, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "totalSupply()" + } + } + ], + "description": "Token (tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.totalSupply() (tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol#7)\n", + "markdown": "[Token](tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.totalSupply()](tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol#L7)\n", + "id": "c951e429e546af28ac08e241d391e874c1c9c70b0732ccfb63f3bbfb3eaac16e", + "check": "erc20-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 412, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "balanceOf", + "source_mapping": { + "start": 317, + "length": 49, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 8 + ], + "starting_column": 5, + "ending_column": 54 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 412, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "balanceOf(address)" + } + } + ], + "description": "Token (tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.balanceOf(address) (tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol#8)\n", + "markdown": "[Token](tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.balanceOf(address)](tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol#L8)\n", + "id": "758ca2456030a36dbd6115f2ccb1a43f53f1dabd66ed079806df0f6b7b4d21ef", + "check": "erc20-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 412, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "allowance", + "source_mapping": { + "start": 371, + "length": 68, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 9 + ], + "starting_column": 5, + "ending_column": 73 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 29, + "length": 412, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "allowance(address,address)" + } + } + ], + "description": "Token (tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.allowance(address,address) (tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol#9)\n", + "markdown": "[Token](tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.allowance(address,address)](tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol#L9)\n", + "id": "1286abfe21b09e21e1cec8b991f73664e104fa39f7f4190690ece3af45bc0c7a", + "check": "erc20-interface", + "impact": "Medium", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/erc721-interface/incorrect_erc721_interface.sol b/tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol similarity index 100% rename from tests/detectors/erc721-interface/incorrect_erc721_interface.sol rename to tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol diff --git a/tests/detectors/erc721-interface/incorrect_erc721_interface.sol.0.4.25.IncorrectERC721InterfaceDetection.json b/tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol.0.4.25.IncorrectERC721InterfaceDetection.json similarity index 82% rename from tests/detectors/erc721-interface/incorrect_erc721_interface.sol.0.4.25.IncorrectERC721InterfaceDetection.json rename to tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol.0.4.25.IncorrectERC721InterfaceDetection.json index 973dcf35f9..a9f0f1fb41 100644 --- a/tests/detectors/erc721-interface/incorrect_erc721_interface.sol.0.4.25.IncorrectERC721InterfaceDetection.json +++ b/tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol.0.4.25.IncorrectERC721InterfaceDetection.json @@ -9,9 +9,9 @@ "start": 109, "length": 739, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 6, @@ -37,9 +37,9 @@ "start": 50, "length": 56, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 4 @@ -55,9 +55,9 @@ "start": 26, "length": 82, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 3, @@ -72,8 +72,8 @@ } } ], - "description": "Token (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:IERC165.supportsInterface(bytes4) (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#4)\n", - "markdown": "[Token](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[IERC165.supportsInterface(bytes4)](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L4)\n", + "description": "Token (tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:IERC165.supportsInterface(bytes4) (tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#4)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[IERC165.supportsInterface(bytes4)](tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#L4)\n", "id": "a8593587ca70c51a9ab827843babec3b3eb7f9a08d76eea1e5528e668f7b291d", "check": "erc721-interface", "impact": "Medium", @@ -88,9 +88,9 @@ "start": 109, "length": 739, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 6, @@ -116,9 +116,9 @@ "start": 140, "length": 44, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 7 @@ -134,9 +134,9 @@ "start": 109, "length": 739, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 6, @@ -159,8 +159,8 @@ } } ], - "description": "Token (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.balanceOf(address) (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#7)\n", - "markdown": "[Token](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.balanceOf(address)](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L7)\n", + "description": "Token (tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.balanceOf(address) (tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#7)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.balanceOf(address)](tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#L7)\n", "id": "6fb9d0320e0b63e2c70f9844d5bea2be958e73beb6eaa4ccb2323ead0c7ef991", "check": "erc721-interface", "impact": "Medium", @@ -175,9 +175,9 @@ "start": 109, "length": 739, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 6, @@ -203,9 +203,9 @@ "start": 189, "length": 44, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 8 @@ -221,9 +221,9 @@ "start": 109, "length": 739, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 6, @@ -246,8 +246,8 @@ } } ], - "description": "Token (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.ownerOf(uint256) (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#8)\n", - "markdown": "[Token](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.ownerOf(uint256)](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L8)\n", + "description": "Token (tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.ownerOf(uint256) (tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#8)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.ownerOf(uint256)](tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#L8)\n", "id": "7d9235dd4ef8bc29a3b7700597cc1e4efb846377c928e5e50c5f49cb37f288d2", "check": "erc721-interface", "impact": "Medium", @@ -262,9 +262,9 @@ "start": 109, "length": 739, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 6, @@ -290,9 +290,9 @@ "start": 238, "length": 108, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 9 @@ -308,9 +308,9 @@ "start": 109, "length": 739, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 6, @@ -333,8 +333,8 @@ } } ], - "description": "Token (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.safeTransferFrom(address,address,uint256,bytes) (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#9)\n", - "markdown": "[Token](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.safeTransferFrom(address,address,uint256,bytes)](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L9)\n", + "description": "Token (tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.safeTransferFrom(address,address,uint256,bytes) (tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#9)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.safeTransferFrom(address,address,uint256,bytes)](tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#L9)\n", "id": "ccec612c4b5db00ab59b766b5dde3f8d3a8c6408ef595ab08bff21628587e2a1", "check": "erc721-interface", "impact": "Medium", @@ -349,9 +349,9 @@ "start": 109, "length": 739, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 6, @@ -377,9 +377,9 @@ "start": 351, "length": 96, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 10 @@ -395,9 +395,9 @@ "start": 109, "length": 739, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 6, @@ -420,8 +420,8 @@ } } ], - "description": "Token (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.safeTransferFrom(address,address,uint256) (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#10)\n", - "markdown": "[Token](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.safeTransferFrom(address,address,uint256)](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L10)\n", + "description": "Token (tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.safeTransferFrom(address,address,uint256) (tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#10)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.safeTransferFrom(address,address,uint256)](tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#L10)\n", "id": "50ab7b0f39f327ac6deccf3c16b4e6fee1dc249072ac41a4bd485ccf0c12315b", "check": "erc721-interface", "impact": "Medium", @@ -436,9 +436,9 @@ "start": 109, "length": 739, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 6, @@ -464,9 +464,9 @@ "start": 452, "length": 92, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 11 @@ -482,9 +482,9 @@ "start": 109, "length": 739, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 6, @@ -507,8 +507,8 @@ } } ], - "description": "Token (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.transferFrom(address,address,uint256) (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#11)\n", - "markdown": "[Token](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.transferFrom(address,address,uint256)](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L11)\n", + "description": "Token (tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.transferFrom(address,address,uint256) (tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#11)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.transferFrom(address,address,uint256)](tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#L11)\n", "id": "847b11227f3bfc9b120e0ea573f385a4bbc61c4b7f89f434864612a679b1133e", "check": "erc721-interface", "impact": "Medium", @@ -523,9 +523,9 @@ "start": 109, "length": 739, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 6, @@ -551,9 +551,9 @@ "start": 549, "length": 78, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 12 @@ -569,9 +569,9 @@ "start": 109, "length": 739, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 6, @@ -594,8 +594,8 @@ } } ], - "description": "Token (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.approve(address,uint256) (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#12)\n", - "markdown": "[Token](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.approve(address,uint256)](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L12)\n", + "description": "Token (tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.approve(address,uint256) (tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#12)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.approve(address,uint256)](tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#L12)\n", "id": "439c95972d0e084aff057161164b13ab63f85bee31d80b568b7155e58eac4b5d", "check": "erc721-interface", "impact": "Medium", @@ -610,9 +610,9 @@ "start": 109, "length": 739, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 6, @@ -638,9 +638,9 @@ "start": 632, "length": 86, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 13 @@ -656,9 +656,9 @@ "start": 109, "length": 739, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 6, @@ -681,8 +681,8 @@ } } ], - "description": "Token (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.setApprovalForAll(address,bool) (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#13)\n", - "markdown": "[Token](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.setApprovalForAll(address,bool)](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L13)\n", + "description": "Token (tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.setApprovalForAll(address,bool) (tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#13)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.setApprovalForAll(address,bool)](tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#L13)\n", "id": "b95e9bb000fb073c25fdbd9fff7bf0a3c44e04e70fc1a7da27c94c6b7fb8be40", "check": "erc721-interface", "impact": "Medium", @@ -697,9 +697,9 @@ "start": 109, "length": 739, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 6, @@ -725,9 +725,9 @@ "start": 723, "length": 48, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 14 @@ -743,9 +743,9 @@ "start": 109, "length": 739, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 6, @@ -768,8 +768,8 @@ } } ], - "description": "Token (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.getApproved(uint256) (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#14)\n", - "markdown": "[Token](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.getApproved(uint256)](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L14)\n", + "description": "Token (tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.getApproved(uint256) (tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#14)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.getApproved(uint256)](tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#L14)\n", "id": "2dce4891c7abea0fa8a8a20a8b8482e7e1d46d54bfd750701c604d5dadd8b937", "check": "erc721-interface", "impact": "Medium", @@ -784,9 +784,9 @@ "start": 109, "length": 739, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 6, @@ -812,9 +812,9 @@ "start": 776, "length": 70, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 15 @@ -830,9 +830,9 @@ "start": 109, "length": 739, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_relative": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "filename_short": "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "is_dependency": false, "lines": [ 6, @@ -855,8 +855,8 @@ } } ], - "description": "Token (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.isApprovedForAll(address,address) (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#15)\n", - "markdown": "[Token](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.isApprovedForAll(address,address)](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L15)\n", + "description": "Token (tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.isApprovedForAll(address,address) (tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#15)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.isApprovedForAll(address,address)](tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol#L15)\n", "id": "fa9985c505689f9a45d1ac51e1dd8cf79eeb2c939946abfb5ac78f46e692d0eb", "check": "erc721-interface", "impact": "Medium", diff --git a/tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol b/tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol new file mode 100644 index 0000000000..49f8699dbb --- /dev/null +++ b/tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol @@ -0,0 +1,16 @@ +// pragma solidity ^0.4.24; + +interface IERC165 { + function supportsInterface(bytes4 interfaceID) external; +} +contract Token is IERC165{ + function balanceOf(address _owner) external; + function ownerOf(uint256 _tokenId) external; + function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes calldata data) external returns (bool); + function safeTransferFrom(address _from, address _to, uint256 _tokenId) external returns (bool); + function transferFrom(address _from, address _to, uint256 _tokenId) external returns (bool); + function approve(address _approved, uint256 _tokenId) external returns (bool); + function setApprovalForAll(address _operator, bool _approved) external returns (bool); + function getApproved(uint256 _tokenId) external; + function isApprovedForAll(address _owner, address _operator) external; +} diff --git a/tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol.0.5.16.IncorrectERC721InterfaceDetection.json b/tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol.0.5.16.IncorrectERC721InterfaceDetection.json new file mode 100644 index 0000000000..abc113d722 --- /dev/null +++ b/tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol.0.5.16.IncorrectERC721InterfaceDetection.json @@ -0,0 +1,866 @@ +[ + [ + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 748, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "supportsInterface", + "source_mapping": { + "start": 53, + "length": 56, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 4 + ], + "starting_column": 5, + "ending_column": 61 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "IERC165", + "source_mapping": { + "start": 29, + "length": 82, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "supportsInterface(bytes4)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:IERC165.supportsInterface(bytes4) (tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#4)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[IERC165.supportsInterface(bytes4)](tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#L4)\n", + "id": "a8593587ca70c51a9ab827843babec3b3eb7f9a08d76eea1e5528e668f7b291d", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 748, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "balanceOf", + "source_mapping": { + "start": 143, + "length": 44, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 7 + ], + "starting_column": 5, + "ending_column": 49 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 748, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "balanceOf(address)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.balanceOf(address) (tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#7)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.balanceOf(address)](tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#L7)\n", + "id": "6fb9d0320e0b63e2c70f9844d5bea2be958e73beb6eaa4ccb2323ead0c7ef991", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 748, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "ownerOf", + "source_mapping": { + "start": 192, + "length": 44, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 8 + ], + "starting_column": 5, + "ending_column": 49 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 748, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "ownerOf(uint256)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.ownerOf(uint256) (tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#8)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.ownerOf(uint256)](tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#L8)\n", + "id": "7d9235dd4ef8bc29a3b7700597cc1e4efb846377c928e5e50c5f49cb37f288d2", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 748, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "safeTransferFrom", + "source_mapping": { + "start": 241, + "length": 117, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 9 + ], + "starting_column": 5, + "ending_column": 122 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 748, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "safeTransferFrom(address,address,uint256,bytes)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.safeTransferFrom(address,address,uint256,bytes) (tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#9)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.safeTransferFrom(address,address,uint256,bytes)](tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#L9)\n", + "id": "ccec612c4b5db00ab59b766b5dde3f8d3a8c6408ef595ab08bff21628587e2a1", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 748, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "safeTransferFrom", + "source_mapping": { + "start": 363, + "length": 96, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 5, + "ending_column": 101 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 748, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "safeTransferFrom(address,address,uint256)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.safeTransferFrom(address,address,uint256) (tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#10)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.safeTransferFrom(address,address,uint256)](tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#L10)\n", + "id": "50ab7b0f39f327ac6deccf3c16b4e6fee1dc249072ac41a4bd485ccf0c12315b", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 748, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "transferFrom", + "source_mapping": { + "start": 464, + "length": 92, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 11 + ], + "starting_column": 5, + "ending_column": 97 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 748, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "transferFrom(address,address,uint256)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.transferFrom(address,address,uint256) (tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#11)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.transferFrom(address,address,uint256)](tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#L11)\n", + "id": "847b11227f3bfc9b120e0ea573f385a4bbc61c4b7f89f434864612a679b1133e", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 748, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "approve", + "source_mapping": { + "start": 561, + "length": 78, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 5, + "ending_column": 83 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 748, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "approve(address,uint256)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.approve(address,uint256) (tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#12)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.approve(address,uint256)](tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#L12)\n", + "id": "439c95972d0e084aff057161164b13ab63f85bee31d80b568b7155e58eac4b5d", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 748, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "setApprovalForAll", + "source_mapping": { + "start": 644, + "length": 86, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 13 + ], + "starting_column": 5, + "ending_column": 91 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 748, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "setApprovalForAll(address,bool)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.setApprovalForAll(address,bool) (tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#13)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.setApprovalForAll(address,bool)](tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#L13)\n", + "id": "b95e9bb000fb073c25fdbd9fff7bf0a3c44e04e70fc1a7da27c94c6b7fb8be40", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 748, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "getApproved", + "source_mapping": { + "start": 735, + "length": 48, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 14 + ], + "starting_column": 5, + "ending_column": 53 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 748, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "getApproved(uint256)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.getApproved(uint256) (tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#14)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.getApproved(uint256)](tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#L14)\n", + "id": "2dce4891c7abea0fa8a8a20a8b8482e7e1d46d54bfd750701c604d5dadd8b937", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 748, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "isApprovedForAll", + "source_mapping": { + "start": 788, + "length": 70, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 15 + ], + "starting_column": 5, + "ending_column": 75 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 748, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "isApprovedForAll(address,address)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.isApprovedForAll(address,address) (tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#15)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.isApprovedForAll(address,address)](tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol#L15)\n", + "id": "fa9985c505689f9a45d1ac51e1dd8cf79eeb2c939946abfb5ac78f46e692d0eb", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol b/tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol new file mode 100644 index 0000000000..d13ed28a9d --- /dev/null +++ b/tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol @@ -0,0 +1,16 @@ +// pragma solidity ^0.4.24; + +interface IERC165 { + function supportsInterface(bytes4 interfaceID) external; +} +abstract contract Token is IERC165{ + function balanceOf(address _owner) external virtual; + function ownerOf(uint256 _tokenId) external virtual; + function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes calldata data) external virtual returns (bool); + function safeTransferFrom(address _from, address _to, uint256 _tokenId) external virtual returns (bool); + function transferFrom(address _from, address _to, uint256 _tokenId) external virtual returns (bool); + function approve(address _approved, uint256 _tokenId) external virtual returns (bool); + function setApprovalForAll(address _operator, bool _approved) external virtual returns (bool); + function getApproved(uint256 _tokenId) external virtual; + function isApprovedForAll(address _owner, address _operator) external virtual; +} diff --git a/tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol.0.6.11.IncorrectERC721InterfaceDetection.json b/tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol.0.6.11.IncorrectERC721InterfaceDetection.json new file mode 100644 index 0000000000..5658e5c89e --- /dev/null +++ b/tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol.0.6.11.IncorrectERC721InterfaceDetection.json @@ -0,0 +1,866 @@ +[ + [ + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "supportsInterface", + "source_mapping": { + "start": 53, + "length": 56, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 4 + ], + "starting_column": 5, + "ending_column": 61 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "IERC165", + "source_mapping": { + "start": 29, + "length": 82, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "supportsInterface(bytes4)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:IERC165.supportsInterface(bytes4) (tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#4)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[IERC165.supportsInterface(bytes4)](tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#L4)\n", + "id": "a8593587ca70c51a9ab827843babec3b3eb7f9a08d76eea1e5528e668f7b291d", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "balanceOf", + "source_mapping": { + "start": 152, + "length": 52, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 7 + ], + "starting_column": 5, + "ending_column": 57 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "balanceOf(address)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.balanceOf(address) (tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#7)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.balanceOf(address)](tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#L7)\n", + "id": "6fb9d0320e0b63e2c70f9844d5bea2be958e73beb6eaa4ccb2323ead0c7ef991", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "ownerOf", + "source_mapping": { + "start": 209, + "length": 52, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 8 + ], + "starting_column": 5, + "ending_column": 57 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "ownerOf(uint256)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.ownerOf(uint256) (tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#8)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.ownerOf(uint256)](tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#L8)\n", + "id": "7d9235dd4ef8bc29a3b7700597cc1e4efb846377c928e5e50c5f49cb37f288d2", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "safeTransferFrom", + "source_mapping": { + "start": 266, + "length": 125, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 9 + ], + "starting_column": 5, + "ending_column": 130 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "safeTransferFrom(address,address,uint256,bytes)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.safeTransferFrom(address,address,uint256,bytes) (tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#9)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.safeTransferFrom(address,address,uint256,bytes)](tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#L9)\n", + "id": "ccec612c4b5db00ab59b766b5dde3f8d3a8c6408ef595ab08bff21628587e2a1", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "safeTransferFrom", + "source_mapping": { + "start": 396, + "length": 104, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 5, + "ending_column": 109 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "safeTransferFrom(address,address,uint256)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.safeTransferFrom(address,address,uint256) (tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#10)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.safeTransferFrom(address,address,uint256)](tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#L10)\n", + "id": "50ab7b0f39f327ac6deccf3c16b4e6fee1dc249072ac41a4bd485ccf0c12315b", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "transferFrom", + "source_mapping": { + "start": 505, + "length": 100, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 11 + ], + "starting_column": 5, + "ending_column": 105 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "transferFrom(address,address,uint256)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.transferFrom(address,address,uint256) (tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#11)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.transferFrom(address,address,uint256)](tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#L11)\n", + "id": "847b11227f3bfc9b120e0ea573f385a4bbc61c4b7f89f434864612a679b1133e", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "approve", + "source_mapping": { + "start": 610, + "length": 86, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 5, + "ending_column": 91 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "approve(address,uint256)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.approve(address,uint256) (tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#12)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.approve(address,uint256)](tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#L12)\n", + "id": "439c95972d0e084aff057161164b13ab63f85bee31d80b568b7155e58eac4b5d", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "setApprovalForAll", + "source_mapping": { + "start": 701, + "length": 94, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 13 + ], + "starting_column": 5, + "ending_column": 99 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "setApprovalForAll(address,bool)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.setApprovalForAll(address,bool) (tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#13)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.setApprovalForAll(address,bool)](tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#L13)\n", + "id": "b95e9bb000fb073c25fdbd9fff7bf0a3c44e04e70fc1a7da27c94c6b7fb8be40", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "getApproved", + "source_mapping": { + "start": 800, + "length": 56, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 14 + ], + "starting_column": 5, + "ending_column": 61 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "getApproved(uint256)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.getApproved(uint256) (tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#14)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.getApproved(uint256)](tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#L14)\n", + "id": "2dce4891c7abea0fa8a8a20a8b8482e7e1d46d54bfd750701c604d5dadd8b937", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "isApprovedForAll", + "source_mapping": { + "start": 861, + "length": 78, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 15 + ], + "starting_column": 5, + "ending_column": 83 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "isApprovedForAll(address,address)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.isApprovedForAll(address,address) (tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#15)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.isApprovedForAll(address,address)](tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol#L15)\n", + "id": "fa9985c505689f9a45d1ac51e1dd8cf79eeb2c939946abfb5ac78f46e692d0eb", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol b/tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol new file mode 100644 index 0000000000..d13ed28a9d --- /dev/null +++ b/tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol @@ -0,0 +1,16 @@ +// pragma solidity ^0.4.24; + +interface IERC165 { + function supportsInterface(bytes4 interfaceID) external; +} +abstract contract Token is IERC165{ + function balanceOf(address _owner) external virtual; + function ownerOf(uint256 _tokenId) external virtual; + function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes calldata data) external virtual returns (bool); + function safeTransferFrom(address _from, address _to, uint256 _tokenId) external virtual returns (bool); + function transferFrom(address _from, address _to, uint256 _tokenId) external virtual returns (bool); + function approve(address _approved, uint256 _tokenId) external virtual returns (bool); + function setApprovalForAll(address _operator, bool _approved) external virtual returns (bool); + function getApproved(uint256 _tokenId) external virtual; + function isApprovedForAll(address _owner, address _operator) external virtual; +} diff --git a/tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol.0.7.6.IncorrectERC721InterfaceDetection.json b/tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol.0.7.6.IncorrectERC721InterfaceDetection.json new file mode 100644 index 0000000000..f1c31ef5ad --- /dev/null +++ b/tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol.0.7.6.IncorrectERC721InterfaceDetection.json @@ -0,0 +1,866 @@ +[ + [ + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "supportsInterface", + "source_mapping": { + "start": 53, + "length": 56, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 4 + ], + "starting_column": 5, + "ending_column": 61 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "IERC165", + "source_mapping": { + "start": 29, + "length": 82, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "supportsInterface(bytes4)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:IERC165.supportsInterface(bytes4) (tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#4)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[IERC165.supportsInterface(bytes4)](tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#L4)\n", + "id": "a8593587ca70c51a9ab827843babec3b3eb7f9a08d76eea1e5528e668f7b291d", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "balanceOf", + "source_mapping": { + "start": 152, + "length": 52, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 7 + ], + "starting_column": 5, + "ending_column": 57 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "balanceOf(address)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.balanceOf(address) (tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#7)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.balanceOf(address)](tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#L7)\n", + "id": "6fb9d0320e0b63e2c70f9844d5bea2be958e73beb6eaa4ccb2323ead0c7ef991", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "ownerOf", + "source_mapping": { + "start": 209, + "length": 52, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 8 + ], + "starting_column": 5, + "ending_column": 57 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "ownerOf(uint256)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.ownerOf(uint256) (tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#8)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.ownerOf(uint256)](tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#L8)\n", + "id": "7d9235dd4ef8bc29a3b7700597cc1e4efb846377c928e5e50c5f49cb37f288d2", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "safeTransferFrom", + "source_mapping": { + "start": 266, + "length": 125, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 9 + ], + "starting_column": 5, + "ending_column": 130 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "safeTransferFrom(address,address,uint256,bytes)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.safeTransferFrom(address,address,uint256,bytes) (tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#9)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.safeTransferFrom(address,address,uint256,bytes)](tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#L9)\n", + "id": "ccec612c4b5db00ab59b766b5dde3f8d3a8c6408ef595ab08bff21628587e2a1", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "safeTransferFrom", + "source_mapping": { + "start": 396, + "length": 104, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 5, + "ending_column": 109 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "safeTransferFrom(address,address,uint256)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.safeTransferFrom(address,address,uint256) (tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#10)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.safeTransferFrom(address,address,uint256)](tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#L10)\n", + "id": "50ab7b0f39f327ac6deccf3c16b4e6fee1dc249072ac41a4bd485ccf0c12315b", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "transferFrom", + "source_mapping": { + "start": 505, + "length": 100, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 11 + ], + "starting_column": 5, + "ending_column": 105 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "transferFrom(address,address,uint256)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.transferFrom(address,address,uint256) (tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#11)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.transferFrom(address,address,uint256)](tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#L11)\n", + "id": "847b11227f3bfc9b120e0ea573f385a4bbc61c4b7f89f434864612a679b1133e", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "approve", + "source_mapping": { + "start": 610, + "length": 86, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 5, + "ending_column": 91 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "approve(address,uint256)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.approve(address,uint256) (tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#12)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.approve(address,uint256)](tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#L12)\n", + "id": "439c95972d0e084aff057161164b13ab63f85bee31d80b568b7155e58eac4b5d", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "setApprovalForAll", + "source_mapping": { + "start": 701, + "length": 94, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 13 + ], + "starting_column": 5, + "ending_column": 99 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "setApprovalForAll(address,bool)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.setApprovalForAll(address,bool) (tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#13)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.setApprovalForAll(address,bool)](tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#L13)\n", + "id": "b95e9bb000fb073c25fdbd9fff7bf0a3c44e04e70fc1a7da27c94c6b7fb8be40", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "getApproved", + "source_mapping": { + "start": 800, + "length": 56, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 14 + ], + "starting_column": 5, + "ending_column": 61 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "getApproved(uint256)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.getApproved(uint256) (tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#14)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.getApproved(uint256)](tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#L14)\n", + "id": "2dce4891c7abea0fa8a8a20a8b8482e7e1d46d54bfd750701c604d5dadd8b937", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "isApprovedForAll", + "source_mapping": { + "start": 861, + "length": 78, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 15 + ], + "starting_column": 5, + "ending_column": 83 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 112, + "length": 829, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "isApprovedForAll(address,address)" + } + } + ], + "description": "Token (tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.isApprovedForAll(address,address) (tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#15)\n", + "markdown": "[Token](tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.isApprovedForAll(address,address)](tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol#L15)\n", + "id": "fa9985c505689f9a45d1ac51e1dd8cf79eeb2c939946abfb5ac78f46e692d0eb", + "check": "erc721-interface", + "impact": "Medium", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/events-access/missing_events_access_control.sol b/tests/detectors/events-access/0.4.25/missing_events_access_control.sol similarity index 100% rename from tests/detectors/events-access/missing_events_access_control.sol rename to tests/detectors/events-access/0.4.25/missing_events_access_control.sol diff --git a/tests/detectors/events-access/0.4.25/missing_events_access_control.sol.0.4.25.MissingEventsAccessControl.json b/tests/detectors/events-access/0.4.25/missing_events_access_control.sol.0.4.25.MissingEventsAccessControl.json new file mode 100644 index 0000000000..915dc09fb1 --- /dev/null +++ b/tests/detectors/events-access/0.4.25/missing_events_access_control.sol.0.4.25.MissingEventsAccessControl.json @@ -0,0 +1,648 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 284, + "length": 76, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1309, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + }, + { + "type": "node", + "name": "owner = msg.sender", + "source_mapping": { + "start": 325, + "length": 18, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 16 + ], + "starting_column": 5, + "ending_column": 23 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 284, + "length": 76, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1309, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + } + } + ], + "description": "Bug.bad0() (tests/detectors/events-access/0.4.25/missing_events_access_control.sol#15-17) should emit an event for: \n\t- owner = msg.sender (tests/detectors/events-access/0.4.25/missing_events_access_control.sol#16) \n", + "markdown": "[Bug.bad0()](tests/detectors/events-access/0.4.25/missing_events_access_control.sol#L15-L17) should emit an event for: \n\t- [owner = msg.sender](tests/detectors/events-access/0.4.25/missing_events_access_control.sol#L16) \n", + "id": "4d3c0f7336bc2f5248fb9488caa06bf496a1076398fca7a730a4e18ef9eedb23", + "check": "events-access", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 364, + "length": 90, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 19, + 20, + 21 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1309, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(address)" + } + }, + { + "type": "node", + "name": "owner = newOwner", + "source_mapping": { + "start": 421, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 20 + ], + "starting_column": 5, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 364, + "length": 90, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 19, + 20, + 21 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1309, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(address)" + } + } + } + } + ], + "description": "Bug.bad1(address) (tests/detectors/events-access/0.4.25/missing_events_access_control.sol#19-21) should emit an event for: \n\t- owner = newOwner (tests/detectors/events-access/0.4.25/missing_events_access_control.sol#20) \n", + "markdown": "[Bug.bad1(address)](tests/detectors/events-access/0.4.25/missing_events_access_control.sol#L19-L21) should emit an event for: \n\t- [owner = newOwner](tests/detectors/events-access/0.4.25/missing_events_access_control.sol#L20) \n", + "id": "b2bf34ab3d02054c5f803cd517689d1e3d055b46ca612b2457d845d8d4b94731", + "check": "events-access", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 458, + "length": 127, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 23, + 24, + 25, + 26 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1309, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2(address)" + } + }, + { + "type": "node", + "name": "owner = newOwner", + "source_mapping": { + "start": 552, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 5, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 458, + "length": 127, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 23, + 24, + 25, + 26 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1309, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2(address)" + } + } + } + } + ], + "description": "Bug.bad2(address) (tests/detectors/events-access/0.4.25/missing_events_access_control.sol#23-26) should emit an event for: \n\t- owner = newOwner (tests/detectors/events-access/0.4.25/missing_events_access_control.sol#25) \n", + "markdown": "[Bug.bad2(address)](tests/detectors/events-access/0.4.25/missing_events_access_control.sol#L23-L26) should emit an event for: \n\t- [owner = newOwner](tests/detectors/events-access/0.4.25/missing_events_access_control.sol#L25) \n", + "id": "9411f6b4b3e6f3833a72789f341adf88796bcb58b4a12a47a6f7117746d09c53", + "check": "events-access", + "impact": "Low", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/events-access/0.5.16/missing_events_access_control.sol b/tests/detectors/events-access/0.5.16/missing_events_access_control.sol new file mode 100644 index 0000000000..4b7ab47946 --- /dev/null +++ b/tests/detectors/events-access/0.5.16/missing_events_access_control.sol @@ -0,0 +1,52 @@ +contract Bug{ + uint totalSupply; + uint price; + address owner; + address operator; + address addr = 0x123F681646d4A755815f9CB19e1aCc8565A0c2AC; + event Supply(uint totalSupply); + event Owner(address owner); + + modifier onlyAdmin { + require(msg.sender != owner); + _; + } + + function bad0() onlyAdmin external { + owner = msg.sender; // Tainting + } + + function bad1(address newOwner) onlyAdmin external { + owner = newOwner; // Tainting + } + + function bad2(address newOwner) onlyAdmin external { + require(newOwner != address(0)); + owner = newOwner; // Tainting + } + + function good0(uint a) external { // Not Protected breaks detector heuristic + totalSupply += a; + } + + function good1() onlyAdmin external { + owner = msg.sender; + emit Owner(owner); // Event present breaks detector heuristic + } + + function good2() onlyAdmin external { + owner = addr; // No tainting breaks detector heuristic + } + + function good3(address newOwner) onlyAdmin private { // Private functions are ignored + owner = newOwner; + } + + function good4(uint newPrice) onlyAdmin public { // non-address types are ignored + price = newPrice; + } + + function good5(address newOwner) onlyAdmin external { + operator = newOwner; // operator is not used for access control in any modifier + } +} diff --git a/tests/detectors/events-access/0.5.16/missing_events_access_control.sol.0.5.16.MissingEventsAccessControl.json b/tests/detectors/events-access/0.5.16/missing_events_access_control.sol.0.5.16.MissingEventsAccessControl.json new file mode 100644 index 0000000000..84576230ac --- /dev/null +++ b/tests/detectors/events-access/0.5.16/missing_events_access_control.sol.0.5.16.MissingEventsAccessControl.json @@ -0,0 +1,648 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 284, + "length": 76, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1309, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + }, + { + "type": "node", + "name": "owner = msg.sender", + "source_mapping": { + "start": 325, + "length": 18, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 16 + ], + "starting_column": 5, + "ending_column": 23 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 284, + "length": 76, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1309, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + } + } + ], + "description": "Bug.bad0() (tests/detectors/events-access/0.5.16/missing_events_access_control.sol#15-17) should emit an event for: \n\t- owner = msg.sender (tests/detectors/events-access/0.5.16/missing_events_access_control.sol#16) \n", + "markdown": "[Bug.bad0()](tests/detectors/events-access/0.5.16/missing_events_access_control.sol#L15-L17) should emit an event for: \n\t- [owner = msg.sender](tests/detectors/events-access/0.5.16/missing_events_access_control.sol#L16) \n", + "id": "99e09713b41d4b164cc0f4a88f48e6d0bd94128636c57b1bee357ac1fda130d7", + "check": "events-access", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 364, + "length": 90, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 19, + 20, + 21 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1309, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(address)" + } + }, + { + "type": "node", + "name": "owner = newOwner", + "source_mapping": { + "start": 421, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 20 + ], + "starting_column": 5, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 364, + "length": 90, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 19, + 20, + 21 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1309, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(address)" + } + } + } + } + ], + "description": "Bug.bad1(address) (tests/detectors/events-access/0.5.16/missing_events_access_control.sol#19-21) should emit an event for: \n\t- owner = newOwner (tests/detectors/events-access/0.5.16/missing_events_access_control.sol#20) \n", + "markdown": "[Bug.bad1(address)](tests/detectors/events-access/0.5.16/missing_events_access_control.sol#L19-L21) should emit an event for: \n\t- [owner = newOwner](tests/detectors/events-access/0.5.16/missing_events_access_control.sol#L20) \n", + "id": "a8b5423d1085668a105afd674978791ad0b57f1c9ab15b7db682c3dfac7a49b2", + "check": "events-access", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 458, + "length": 127, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 23, + 24, + 25, + 26 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1309, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2(address)" + } + }, + { + "type": "node", + "name": "owner = newOwner", + "source_mapping": { + "start": 552, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 5, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 458, + "length": 127, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 23, + 24, + 25, + 26 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1309, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2(address)" + } + } + } + } + ], + "description": "Bug.bad2(address) (tests/detectors/events-access/0.5.16/missing_events_access_control.sol#23-26) should emit an event for: \n\t- owner = newOwner (tests/detectors/events-access/0.5.16/missing_events_access_control.sol#25) \n", + "markdown": "[Bug.bad2(address)](tests/detectors/events-access/0.5.16/missing_events_access_control.sol#L23-L26) should emit an event for: \n\t- [owner = newOwner](tests/detectors/events-access/0.5.16/missing_events_access_control.sol#L25) \n", + "id": "1562e590ef85efee605bdbf837a010ad06cdb04cec40ac4a7ca7c8cc25cf4161", + "check": "events-access", + "impact": "Low", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/events-access/0.6.11/missing_events_access_control.sol b/tests/detectors/events-access/0.6.11/missing_events_access_control.sol new file mode 100644 index 0000000000..4b7ab47946 --- /dev/null +++ b/tests/detectors/events-access/0.6.11/missing_events_access_control.sol @@ -0,0 +1,52 @@ +contract Bug{ + uint totalSupply; + uint price; + address owner; + address operator; + address addr = 0x123F681646d4A755815f9CB19e1aCc8565A0c2AC; + event Supply(uint totalSupply); + event Owner(address owner); + + modifier onlyAdmin { + require(msg.sender != owner); + _; + } + + function bad0() onlyAdmin external { + owner = msg.sender; // Tainting + } + + function bad1(address newOwner) onlyAdmin external { + owner = newOwner; // Tainting + } + + function bad2(address newOwner) onlyAdmin external { + require(newOwner != address(0)); + owner = newOwner; // Tainting + } + + function good0(uint a) external { // Not Protected breaks detector heuristic + totalSupply += a; + } + + function good1() onlyAdmin external { + owner = msg.sender; + emit Owner(owner); // Event present breaks detector heuristic + } + + function good2() onlyAdmin external { + owner = addr; // No tainting breaks detector heuristic + } + + function good3(address newOwner) onlyAdmin private { // Private functions are ignored + owner = newOwner; + } + + function good4(uint newPrice) onlyAdmin public { // non-address types are ignored + price = newPrice; + } + + function good5(address newOwner) onlyAdmin external { + operator = newOwner; // operator is not used for access control in any modifier + } +} diff --git a/tests/detectors/events-access/0.6.11/missing_events_access_control.sol.0.6.11.MissingEventsAccessControl.json b/tests/detectors/events-access/0.6.11/missing_events_access_control.sol.0.6.11.MissingEventsAccessControl.json new file mode 100644 index 0000000000..f4419cb3e5 --- /dev/null +++ b/tests/detectors/events-access/0.6.11/missing_events_access_control.sol.0.6.11.MissingEventsAccessControl.json @@ -0,0 +1,648 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 284, + "length": 76, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1309, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + }, + { + "type": "node", + "name": "owner = msg.sender", + "source_mapping": { + "start": 325, + "length": 18, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 16 + ], + "starting_column": 5, + "ending_column": 23 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 284, + "length": 76, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1309, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + } + } + ], + "description": "Bug.bad0() (tests/detectors/events-access/0.6.11/missing_events_access_control.sol#15-17) should emit an event for: \n\t- owner = msg.sender (tests/detectors/events-access/0.6.11/missing_events_access_control.sol#16) \n", + "markdown": "[Bug.bad0()](tests/detectors/events-access/0.6.11/missing_events_access_control.sol#L15-L17) should emit an event for: \n\t- [owner = msg.sender](tests/detectors/events-access/0.6.11/missing_events_access_control.sol#L16) \n", + "id": "81ef3707d2eed91cd30ba6e7368fa40206ec32eec757bb0af632c4b7885bd92c", + "check": "events-access", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 364, + "length": 90, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 19, + 20, + 21 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1309, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(address)" + } + }, + { + "type": "node", + "name": "owner = newOwner", + "source_mapping": { + "start": 421, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 20 + ], + "starting_column": 5, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 364, + "length": 90, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 19, + 20, + 21 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1309, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(address)" + } + } + } + } + ], + "description": "Bug.bad1(address) (tests/detectors/events-access/0.6.11/missing_events_access_control.sol#19-21) should emit an event for: \n\t- owner = newOwner (tests/detectors/events-access/0.6.11/missing_events_access_control.sol#20) \n", + "markdown": "[Bug.bad1(address)](tests/detectors/events-access/0.6.11/missing_events_access_control.sol#L19-L21) should emit an event for: \n\t- [owner = newOwner](tests/detectors/events-access/0.6.11/missing_events_access_control.sol#L20) \n", + "id": "7dd824ee9b2f6100abf2b1e95d84c1b1393a4ab27a06676b2a5d7da164788a00", + "check": "events-access", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 458, + "length": 127, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 23, + 24, + 25, + 26 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1309, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2(address)" + } + }, + { + "type": "node", + "name": "owner = newOwner", + "source_mapping": { + "start": 552, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 5, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 458, + "length": 127, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 23, + 24, + 25, + 26 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1309, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2(address)" + } + } + } + } + ], + "description": "Bug.bad2(address) (tests/detectors/events-access/0.6.11/missing_events_access_control.sol#23-26) should emit an event for: \n\t- owner = newOwner (tests/detectors/events-access/0.6.11/missing_events_access_control.sol#25) \n", + "markdown": "[Bug.bad2(address)](tests/detectors/events-access/0.6.11/missing_events_access_control.sol#L23-L26) should emit an event for: \n\t- [owner = newOwner](tests/detectors/events-access/0.6.11/missing_events_access_control.sol#L25) \n", + "id": "a1b2818a2d7f222d9f8e8d8f7730fe9e8b24c9863637b9ecd2f395eb68fa3511", + "check": "events-access", + "impact": "Low", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/events-access/0.7.6/missing_events_access_control.sol b/tests/detectors/events-access/0.7.6/missing_events_access_control.sol new file mode 100644 index 0000000000..4b7ab47946 --- /dev/null +++ b/tests/detectors/events-access/0.7.6/missing_events_access_control.sol @@ -0,0 +1,52 @@ +contract Bug{ + uint totalSupply; + uint price; + address owner; + address operator; + address addr = 0x123F681646d4A755815f9CB19e1aCc8565A0c2AC; + event Supply(uint totalSupply); + event Owner(address owner); + + modifier onlyAdmin { + require(msg.sender != owner); + _; + } + + function bad0() onlyAdmin external { + owner = msg.sender; // Tainting + } + + function bad1(address newOwner) onlyAdmin external { + owner = newOwner; // Tainting + } + + function bad2(address newOwner) onlyAdmin external { + require(newOwner != address(0)); + owner = newOwner; // Tainting + } + + function good0(uint a) external { // Not Protected breaks detector heuristic + totalSupply += a; + } + + function good1() onlyAdmin external { + owner = msg.sender; + emit Owner(owner); // Event present breaks detector heuristic + } + + function good2() onlyAdmin external { + owner = addr; // No tainting breaks detector heuristic + } + + function good3(address newOwner) onlyAdmin private { // Private functions are ignored + owner = newOwner; + } + + function good4(uint newPrice) onlyAdmin public { // non-address types are ignored + price = newPrice; + } + + function good5(address newOwner) onlyAdmin external { + operator = newOwner; // operator is not used for access control in any modifier + } +} diff --git a/tests/detectors/events-access/0.7.6/missing_events_access_control.sol.0.7.6.MissingEventsAccessControl.json b/tests/detectors/events-access/0.7.6/missing_events_access_control.sol.0.7.6.MissingEventsAccessControl.json new file mode 100644 index 0000000000..590ba4f790 --- /dev/null +++ b/tests/detectors/events-access/0.7.6/missing_events_access_control.sol.0.7.6.MissingEventsAccessControl.json @@ -0,0 +1,648 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 284, + "length": 76, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1309, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + }, + { + "type": "node", + "name": "owner = msg.sender", + "source_mapping": { + "start": 325, + "length": 18, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 16 + ], + "starting_column": 5, + "ending_column": 23 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 284, + "length": 76, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1309, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + } + } + ], + "description": "Bug.bad0() (tests/detectors/events-access/0.7.6/missing_events_access_control.sol#15-17) should emit an event for: \n\t- owner = msg.sender (tests/detectors/events-access/0.7.6/missing_events_access_control.sol#16) \n", + "markdown": "[Bug.bad0()](tests/detectors/events-access/0.7.6/missing_events_access_control.sol#L15-L17) should emit an event for: \n\t- [owner = msg.sender](tests/detectors/events-access/0.7.6/missing_events_access_control.sol#L16) \n", + "id": "2fb533ae76197f4d08ef6a97b9f0ee983db552644ae44807c761889fc5a86c22", + "check": "events-access", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 364, + "length": 90, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 19, + 20, + 21 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1309, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(address)" + } + }, + { + "type": "node", + "name": "owner = newOwner", + "source_mapping": { + "start": 421, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 20 + ], + "starting_column": 5, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 364, + "length": 90, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 19, + 20, + 21 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1309, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(address)" + } + } + } + } + ], + "description": "Bug.bad1(address) (tests/detectors/events-access/0.7.6/missing_events_access_control.sol#19-21) should emit an event for: \n\t- owner = newOwner (tests/detectors/events-access/0.7.6/missing_events_access_control.sol#20) \n", + "markdown": "[Bug.bad1(address)](tests/detectors/events-access/0.7.6/missing_events_access_control.sol#L19-L21) should emit an event for: \n\t- [owner = newOwner](tests/detectors/events-access/0.7.6/missing_events_access_control.sol#L20) \n", + "id": "d319284c1ad2023a792ace9e7b2371966f789c5acf5ab90b1cc5935060f855f0", + "check": "events-access", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 458, + "length": 127, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 23, + 24, + 25, + 26 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1309, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2(address)" + } + }, + { + "type": "node", + "name": "owner = newOwner", + "source_mapping": { + "start": 552, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 5, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 458, + "length": 127, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 23, + 24, + 25, + 26 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1309, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2(address)" + } + } + } + } + ], + "description": "Bug.bad2(address) (tests/detectors/events-access/0.7.6/missing_events_access_control.sol#23-26) should emit an event for: \n\t- owner = newOwner (tests/detectors/events-access/0.7.6/missing_events_access_control.sol#25) \n", + "markdown": "[Bug.bad2(address)](tests/detectors/events-access/0.7.6/missing_events_access_control.sol#L23-L26) should emit an event for: \n\t- [owner = newOwner](tests/detectors/events-access/0.7.6/missing_events_access_control.sol#L25) \n", + "id": "3b63f24bd57a54fab8af7d3292bd8444c3dc834bf43dfd96be0e06ca0027299c", + "check": "events-access", + "impact": "Low", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/events-maths/missing_events_arithmetic.sol b/tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol similarity index 100% rename from tests/detectors/events-maths/missing_events_arithmetic.sol rename to tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol diff --git a/tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol.0.4.25.MissingEventsArithmetic.json b/tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol.0.4.25.MissingEventsArithmetic.json new file mode 100644 index 0000000000..9a962d3a44 --- /dev/null +++ b/tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol.0.4.25.MissingEventsArithmetic.json @@ -0,0 +1,512 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 392, + "length": 71, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 22, + 23, + 24 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1522, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0(uint8)" + } + }, + { + "type": "node", + "name": "uprice8 = _price", + "source_mapping": { + "start": 442, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 23 + ], + "starting_column": 5, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 392, + "length": 71, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 22, + 23, + 24 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1522, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0(uint8)" + } + } + } + } + ], + "description": "Bug.bad0(uint8) (tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol#22-24) should emit an event for: \n\t- uprice8 = _price (tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol#23) \n", + "markdown": "[Bug.bad0(uint8)](tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol#L22-L24) should emit an event for: \n\t- [uprice8 = _price](tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol#L23) \n", + "id": "5bdc3116ab3855778ce4857872000648491e61af71273e503cc9439c5e8740c1", + "check": "events-maths", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 535, + "length": 72, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1522, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(int16)" + } + }, + { + "type": "node", + "name": "iprice16 = _price", + "source_mapping": { + "start": 585, + "length": 17, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 31 + ], + "starting_column": 5, + "ending_column": 22 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 535, + "length": 72, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1522, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(int16)" + } + } + } + } + ], + "description": "Bug.bad1(int16) (tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol#30-32) should emit an event for: \n\t- iprice16 = _price (tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol#31) \n", + "markdown": "[Bug.bad1(int16)](tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol#L30-L32) should emit an event for: \n\t- [iprice16 = _price](tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol#L31) \n", + "id": "a8bc1236abe35dd73049b7e452352ea609772a11ca5cc92e0ee958ac94e5a577", + "check": "events-maths", + "impact": "Low", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol b/tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol new file mode 100644 index 0000000000..a82cc007ad --- /dev/null +++ b/tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol @@ -0,0 +1,72 @@ +contract Bug{ + address owner; + address addr = 0x123F681646d4A755815f9CB19e1aCc8565A0c2AC; + event Price(uint8 uprice8); + uint8 uprice8; + uint8 uprice8_2; + uint8 uprice8_3; + int16 iprice16; + uint8 ufee; + int16 ifee; + + modifier onlyAdmin { + require(msg.sender != owner); + _; + } + + function bad0_helper() public{ + require(uprice8 > 0); + ufee = uprice8 * 100; + } + + function bad0(uint8 _price) onlyAdmin public{ + uprice8 = _price; + } + + function bad1_helper() public{ + ifee = iprice16 * 100; + } + + function bad1(int16 _price) onlyAdmin public{ + iprice16 = _price; + } + + function good0(uint8 _price) public { // Not protected + uprice8_2 = _price; + } + + function good1__helper() onlyAdmin public { // Protected + ufee = uprice8_2 * 100; + } + + function good1(uint8 _price) onlyAdmin public { + uprice8_2 = _price; // Used in another protected function good1_helper + } + + function good2__helper() public { + ufee = uprice8_3 * 100; + } + + function good2(uint8 _price) onlyAdmin public { + uprice8_3 = _price; + emit Price(uprice8_3); // Event present + } + + function good3() onlyAdmin public { + uprice8_2 = 0; // No tainting breaks detector heuristic + } + + function good4(uint8 _price) onlyAdmin private { // Private functions are ignored + uprice8_2 = _price; + } + + function good5_helper() public { + require(addr != address(0)); + } + + function good5(address _addr) onlyAdmin public{ // non-int/non-uint types are ignored + addr = _addr; + } + + +} diff --git a/tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol.0.5.16.MissingEventsArithmetic.json b/tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol.0.5.16.MissingEventsArithmetic.json new file mode 100644 index 0000000000..f6e7dae229 --- /dev/null +++ b/tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol.0.5.16.MissingEventsArithmetic.json @@ -0,0 +1,512 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 392, + "length": 71, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 22, + 23, + 24 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1522, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0(uint8)" + } + }, + { + "type": "node", + "name": "uprice8 = _price", + "source_mapping": { + "start": 442, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 23 + ], + "starting_column": 5, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 392, + "length": 71, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 22, + 23, + 24 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1522, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0(uint8)" + } + } + } + } + ], + "description": "Bug.bad0(uint8) (tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol#22-24) should emit an event for: \n\t- uprice8 = _price (tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol#23) \n", + "markdown": "[Bug.bad0(uint8)](tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol#L22-L24) should emit an event for: \n\t- [uprice8 = _price](tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol#L23) \n", + "id": "07662c5e48ff5320e1a777c6014a5c08a4afe75e11a9c5219acab83b345345d0", + "check": "events-maths", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 535, + "length": 72, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1522, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(int16)" + } + }, + { + "type": "node", + "name": "iprice16 = _price", + "source_mapping": { + "start": 585, + "length": 17, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 31 + ], + "starting_column": 5, + "ending_column": 22 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 535, + "length": 72, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1522, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(int16)" + } + } + } + } + ], + "description": "Bug.bad1(int16) (tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol#30-32) should emit an event for: \n\t- iprice16 = _price (tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol#31) \n", + "markdown": "[Bug.bad1(int16)](tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol#L30-L32) should emit an event for: \n\t- [iprice16 = _price](tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol#L31) \n", + "id": "57f7648cceb76092e0e6102aa9787e808eb435435277dbde46ef016eb1047aa6", + "check": "events-maths", + "impact": "Low", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol b/tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol new file mode 100644 index 0000000000..a82cc007ad --- /dev/null +++ b/tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol @@ -0,0 +1,72 @@ +contract Bug{ + address owner; + address addr = 0x123F681646d4A755815f9CB19e1aCc8565A0c2AC; + event Price(uint8 uprice8); + uint8 uprice8; + uint8 uprice8_2; + uint8 uprice8_3; + int16 iprice16; + uint8 ufee; + int16 ifee; + + modifier onlyAdmin { + require(msg.sender != owner); + _; + } + + function bad0_helper() public{ + require(uprice8 > 0); + ufee = uprice8 * 100; + } + + function bad0(uint8 _price) onlyAdmin public{ + uprice8 = _price; + } + + function bad1_helper() public{ + ifee = iprice16 * 100; + } + + function bad1(int16 _price) onlyAdmin public{ + iprice16 = _price; + } + + function good0(uint8 _price) public { // Not protected + uprice8_2 = _price; + } + + function good1__helper() onlyAdmin public { // Protected + ufee = uprice8_2 * 100; + } + + function good1(uint8 _price) onlyAdmin public { + uprice8_2 = _price; // Used in another protected function good1_helper + } + + function good2__helper() public { + ufee = uprice8_3 * 100; + } + + function good2(uint8 _price) onlyAdmin public { + uprice8_3 = _price; + emit Price(uprice8_3); // Event present + } + + function good3() onlyAdmin public { + uprice8_2 = 0; // No tainting breaks detector heuristic + } + + function good4(uint8 _price) onlyAdmin private { // Private functions are ignored + uprice8_2 = _price; + } + + function good5_helper() public { + require(addr != address(0)); + } + + function good5(address _addr) onlyAdmin public{ // non-int/non-uint types are ignored + addr = _addr; + } + + +} diff --git a/tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol.0.6.11.MissingEventsArithmetic.json b/tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol.0.6.11.MissingEventsArithmetic.json new file mode 100644 index 0000000000..9fca2d9fcf --- /dev/null +++ b/tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol.0.6.11.MissingEventsArithmetic.json @@ -0,0 +1,512 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 392, + "length": 71, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 22, + 23, + 24 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1522, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0(uint8)" + } + }, + { + "type": "node", + "name": "uprice8 = _price", + "source_mapping": { + "start": 442, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 23 + ], + "starting_column": 5, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 392, + "length": 71, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 22, + 23, + 24 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1522, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0(uint8)" + } + } + } + } + ], + "description": "Bug.bad0(uint8) (tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol#22-24) should emit an event for: \n\t- uprice8 = _price (tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol#23) \n", + "markdown": "[Bug.bad0(uint8)](tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol#L22-L24) should emit an event for: \n\t- [uprice8 = _price](tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol#L23) \n", + "id": "8939d396ba9831d820e0960a02ce00dcc748cf3c833cb57bec01898a8782ce10", + "check": "events-maths", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 535, + "length": 72, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1522, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(int16)" + } + }, + { + "type": "node", + "name": "iprice16 = _price", + "source_mapping": { + "start": 585, + "length": 17, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 31 + ], + "starting_column": 5, + "ending_column": 22 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 535, + "length": 72, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Bug", + "source_mapping": { + "start": 0, + "length": 1522, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(int16)" + } + } + } + } + ], + "description": "Bug.bad1(int16) (tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol#30-32) should emit an event for: \n\t- iprice16 = _price (tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol#31) \n", + "markdown": "[Bug.bad1(int16)](tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol#L30-L32) should emit an event for: \n\t- [iprice16 = _price](tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol#L31) \n", + "id": "8cfd768ccce23b341e194537946d6ae90c8bbfb9ab94658a7044848969769e1a", + "check": "events-maths", + "impact": "Low", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol b/tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol new file mode 100644 index 0000000000..a82cc007ad --- /dev/null +++ b/tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol @@ -0,0 +1,72 @@ +contract Bug{ + address owner; + address addr = 0x123F681646d4A755815f9CB19e1aCc8565A0c2AC; + event Price(uint8 uprice8); + uint8 uprice8; + uint8 uprice8_2; + uint8 uprice8_3; + int16 iprice16; + uint8 ufee; + int16 ifee; + + modifier onlyAdmin { + require(msg.sender != owner); + _; + } + + function bad0_helper() public{ + require(uprice8 > 0); + ufee = uprice8 * 100; + } + + function bad0(uint8 _price) onlyAdmin public{ + uprice8 = _price; + } + + function bad1_helper() public{ + ifee = iprice16 * 100; + } + + function bad1(int16 _price) onlyAdmin public{ + iprice16 = _price; + } + + function good0(uint8 _price) public { // Not protected + uprice8_2 = _price; + } + + function good1__helper() onlyAdmin public { // Protected + ufee = uprice8_2 * 100; + } + + function good1(uint8 _price) onlyAdmin public { + uprice8_2 = _price; // Used in another protected function good1_helper + } + + function good2__helper() public { + ufee = uprice8_3 * 100; + } + + function good2(uint8 _price) onlyAdmin public { + uprice8_3 = _price; + emit Price(uprice8_3); // Event present + } + + function good3() onlyAdmin public { + uprice8_2 = 0; // No tainting breaks detector heuristic + } + + function good4(uint8 _price) onlyAdmin private { // Private functions are ignored + uprice8_2 = _price; + } + + function good5_helper() public { + require(addr != address(0)); + } + + function good5(address _addr) onlyAdmin public{ // non-int/non-uint types are ignored + addr = _addr; + } + + +} diff --git a/tests/detectors/events-maths/missing_events_arithmetic.sol.0.5.12.MissingEventsArithmetic.json b/tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol.0.7.6.MissingEventsArithmetic.json similarity index 91% rename from tests/detectors/events-maths/missing_events_arithmetic.sol.0.5.12.MissingEventsArithmetic.json rename to tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol.0.7.6.MissingEventsArithmetic.json index d7929eb4b6..2b09e14e17 100644 --- a/tests/detectors/events-maths/missing_events_arithmetic.sol.0.5.12.MissingEventsArithmetic.json +++ b/tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol.0.7.6.MissingEventsArithmetic.json @@ -9,9 +9,9 @@ "start": 392, "length": 71, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/events-maths/missing_events_arithmetic.sol", + "filename_relative": "tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/events-maths/missing_events_arithmetic.sol", + "filename_short": "tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol", "is_dependency": false, "lines": [ 22, @@ -29,9 +29,9 @@ "start": 0, "length": 1522, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/events-maths/missing_events_arithmetic.sol", + "filename_relative": "tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/events-maths/missing_events_arithmetic.sol", + "filename_short": "tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol", "is_dependency": false, "lines": [ 1, @@ -121,9 +121,9 @@ "start": 442, "length": 16, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/events-maths/missing_events_arithmetic.sol", + "filename_relative": "tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/events-maths/missing_events_arithmetic.sol", + "filename_short": "tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol", "is_dependency": false, "lines": [ 23 @@ -139,9 +139,9 @@ "start": 392, "length": 71, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/events-maths/missing_events_arithmetic.sol", + "filename_relative": "tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/events-maths/missing_events_arithmetic.sol", + "filename_short": "tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol", "is_dependency": false, "lines": [ 22, @@ -159,9 +159,9 @@ "start": 0, "length": 1522, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/events-maths/missing_events_arithmetic.sol", + "filename_relative": "tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/events-maths/missing_events_arithmetic.sol", + "filename_short": "tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol", "is_dependency": false, "lines": [ 1, @@ -247,9 +247,9 @@ } } ], - "description": "Bug.bad0(uint8) (tests/detectors/events-maths/missing_events_arithmetic.sol#22-24) should emit an event for: \n\t- uprice8 = _price (tests/detectors/events-maths/missing_events_arithmetic.sol#23) \n", - "markdown": "[Bug.bad0(uint8)](tests/detectors/events-maths/missing_events_arithmetic.sol#L22-L24) should emit an event for: \n\t- [uprice8 = _price](tests/detectors/events-maths/missing_events_arithmetic.sol#L23) \n", - "id": "d06657a1dc1f8c46e77dbcdd93667a379d95d84ca14ca94351c3a1eb799b9f3b", + "description": "Bug.bad0(uint8) (tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol#22-24) should emit an event for: \n\t- uprice8 = _price (tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol#23) \n", + "markdown": "[Bug.bad0(uint8)](tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol#L22-L24) should emit an event for: \n\t- [uprice8 = _price](tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol#L23) \n", + "id": "833efa3b1dab85aef7a00a7bf77bfe290cb2933e11eed34150a1e54a9644a093", "check": "events-maths", "impact": "Low", "confidence": "Medium" @@ -263,9 +263,9 @@ "start": 535, "length": 72, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/events-maths/missing_events_arithmetic.sol", + "filename_relative": "tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/events-maths/missing_events_arithmetic.sol", + "filename_short": "tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol", "is_dependency": false, "lines": [ 30, @@ -283,9 +283,9 @@ "start": 0, "length": 1522, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/events-maths/missing_events_arithmetic.sol", + "filename_relative": "tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/events-maths/missing_events_arithmetic.sol", + "filename_short": "tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol", "is_dependency": false, "lines": [ 1, @@ -375,9 +375,9 @@ "start": 585, "length": 17, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/events-maths/missing_events_arithmetic.sol", + "filename_relative": "tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/events-maths/missing_events_arithmetic.sol", + "filename_short": "tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol", "is_dependency": false, "lines": [ 31 @@ -393,9 +393,9 @@ "start": 535, "length": 72, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/events-maths/missing_events_arithmetic.sol", + "filename_relative": "tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/events-maths/missing_events_arithmetic.sol", + "filename_short": "tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol", "is_dependency": false, "lines": [ 30, @@ -413,9 +413,9 @@ "start": 0, "length": 1522, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/events-maths/missing_events_arithmetic.sol", + "filename_relative": "tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/events-maths/missing_events_arithmetic.sol", + "filename_short": "tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol", "is_dependency": false, "lines": [ 1, @@ -501,9 +501,9 @@ } } ], - "description": "Bug.bad1(int16) (tests/detectors/events-maths/missing_events_arithmetic.sol#30-32) should emit an event for: \n\t- iprice16 = _price (tests/detectors/events-maths/missing_events_arithmetic.sol#31) \n", - "markdown": "[Bug.bad1(int16)](tests/detectors/events-maths/missing_events_arithmetic.sol#L30-L32) should emit an event for: \n\t- [iprice16 = _price](tests/detectors/events-maths/missing_events_arithmetic.sol#L31) \n", - "id": "d155849bc5f174fe5fe9619b4722bdbb9e99282f0ace605cf629b48862ca0195", + "description": "Bug.bad1(int16) (tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol#30-32) should emit an event for: \n\t- iprice16 = _price (tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol#31) \n", + "markdown": "[Bug.bad1(int16)](tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol#L30-L32) should emit an event for: \n\t- [iprice16 = _price](tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol#L31) \n", + "id": "22cd7f2678dfbd4185d6254ad55b620bd3b20a406d88d9f53412ca97d9c3bf03", "check": "events-maths", "impact": "Low", "confidence": "Medium" diff --git a/tests/detectors/external-function/external_function.sol b/tests/detectors/external-function/0.4.25/external_function.sol similarity index 100% rename from tests/detectors/external-function/external_function.sol rename to tests/detectors/external-function/0.4.25/external_function.sol diff --git a/tests/detectors/external-function/external_function.sol.0.4.25.ExternalFunction.json b/tests/detectors/external-function/0.4.25/external_function.sol.0.4.25.ExternalFunction.json similarity index 89% rename from tests/detectors/external-function/external_function.sol.0.4.25.ExternalFunction.json rename to tests/detectors/external-function/0.4.25/external_function.sol.0.4.25.ExternalFunction.json index 11c3b7d3ae..b74beda676 100644 --- a/tests/detectors/external-function/external_function.sol.0.4.25.ExternalFunction.json +++ b/tests/detectors/external-function/0.4.25/external_function.sol.0.4.25.ExternalFunction.json @@ -9,9 +9,9 @@ "start": 259, "length": 41, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/external-function/external_function.sol", + "filename_relative": "tests/detectors/external-function/0.4.25/external_function.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/external-function/external_function.sol", + "filename_short": "tests/detectors/external-function/0.4.25/external_function.sol", "is_dependency": false, "lines": [ 13, @@ -29,9 +29,9 @@ "start": 213, "length": 258, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/external-function/external_function.sol", + "filename_relative": "tests/detectors/external-function/0.4.25/external_function.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/external-function/external_function.sol", + "filename_short": "tests/detectors/external-function/0.4.25/external_function.sol", "is_dependency": false, "lines": [ 11, @@ -62,8 +62,8 @@ } } ], - "description": "funcNotCalled3() should be declared external:\n\t- ContractWithFunctionNotCalled.funcNotCalled3() (tests/detectors/external-function/external_function.sol#13-15)\n", - "markdown": "funcNotCalled3() should be declared external:\n\t- [ContractWithFunctionNotCalled.funcNotCalled3()](tests/detectors/external-function/external_function.sol#L13-L15)\n", + "description": "funcNotCalled3() should be declared external:\n\t- ContractWithFunctionNotCalled.funcNotCalled3() (tests/detectors/external-function/0.4.25/external_function.sol#13-15)\n", + "markdown": "funcNotCalled3() should be declared external:\n\t- [ContractWithFunctionNotCalled.funcNotCalled3()](tests/detectors/external-function/0.4.25/external_function.sol#L13-L15)\n", "id": "026d9a579ea0304e58c8a5174296494f4b672e4ea032f4e17504f3dac327c4e6", "check": "external-function", "impact": "Optimization", @@ -78,9 +78,9 @@ "start": 306, "length": 41, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/external-function/external_function.sol", + "filename_relative": "tests/detectors/external-function/0.4.25/external_function.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/external-function/external_function.sol", + "filename_short": "tests/detectors/external-function/0.4.25/external_function.sol", "is_dependency": false, "lines": [ 17, @@ -98,9 +98,9 @@ "start": 213, "length": 258, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/external-function/external_function.sol", + "filename_relative": "tests/detectors/external-function/0.4.25/external_function.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/external-function/external_function.sol", + "filename_short": "tests/detectors/external-function/0.4.25/external_function.sol", "is_dependency": false, "lines": [ 11, @@ -131,8 +131,8 @@ } } ], - "description": "funcNotCalled2() should be declared external:\n\t- ContractWithFunctionNotCalled.funcNotCalled2() (tests/detectors/external-function/external_function.sol#17-19)\n", - "markdown": "funcNotCalled2() should be declared external:\n\t- [ContractWithFunctionNotCalled.funcNotCalled2()](tests/detectors/external-function/external_function.sol#L17-L19)\n", + "description": "funcNotCalled2() should be declared external:\n\t- ContractWithFunctionNotCalled.funcNotCalled2() (tests/detectors/external-function/0.4.25/external_function.sol#17-19)\n", + "markdown": "funcNotCalled2() should be declared external:\n\t- [ContractWithFunctionNotCalled.funcNotCalled2()](tests/detectors/external-function/0.4.25/external_function.sol#L17-L19)\n", "id": "1ef1f19a92a8ab8d27df156d50dd75628ec3057b5f5eb16b7d1faa0e5c3850a0", "check": "external-function", "impact": "Optimization", @@ -147,9 +147,9 @@ "start": 353, "length": 40, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/external-function/external_function.sol", + "filename_relative": "tests/detectors/external-function/0.4.25/external_function.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/external-function/external_function.sol", + "filename_short": "tests/detectors/external-function/0.4.25/external_function.sol", "is_dependency": false, "lines": [ 21, @@ -167,9 +167,9 @@ "start": 213, "length": 258, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/external-function/external_function.sol", + "filename_relative": "tests/detectors/external-function/0.4.25/external_function.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/external-function/external_function.sol", + "filename_short": "tests/detectors/external-function/0.4.25/external_function.sol", "is_dependency": false, "lines": [ 11, @@ -200,8 +200,8 @@ } } ], - "description": "funcNotCalled() should be declared external:\n\t- ContractWithFunctionNotCalled.funcNotCalled() (tests/detectors/external-function/external_function.sol#21-23)\n", - "markdown": "funcNotCalled() should be declared external:\n\t- [ContractWithFunctionNotCalled.funcNotCalled()](tests/detectors/external-function/external_function.sol#L21-L23)\n", + "description": "funcNotCalled() should be declared external:\n\t- ContractWithFunctionNotCalled.funcNotCalled() (tests/detectors/external-function/0.4.25/external_function.sol#21-23)\n", + "markdown": "funcNotCalled() should be declared external:\n\t- [ContractWithFunctionNotCalled.funcNotCalled()](tests/detectors/external-function/0.4.25/external_function.sol#L21-L23)\n", "id": "369a2f3d071735755ff4f5bc43081fe858bbfb07eed94e5c6dda3c8daa22ba26", "check": "external-function", "impact": "Optimization", @@ -216,9 +216,9 @@ "start": 554, "length": 325, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/external-function/external_function.sol", + "filename_relative": "tests/detectors/external-function/0.4.25/external_function.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/external-function/external_function.sol", + "filename_short": "tests/detectors/external-function/0.4.25/external_function.sol", "is_dependency": false, "lines": [ 32, @@ -241,9 +241,9 @@ "start": 473, "length": 408, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/external-function/external_function.sol", + "filename_relative": "tests/detectors/external-function/0.4.25/external_function.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/external-function/external_function.sol", + "filename_short": "tests/detectors/external-function/0.4.25/external_function.sol", "is_dependency": false, "lines": [ 31, @@ -265,8 +265,8 @@ } } ], - "description": "funcNotCalled() should be declared external:\n\t- ContractWithFunctionNotCalled2.funcNotCalled() (tests/detectors/external-function/external_function.sol#32-39)\n", - "markdown": "funcNotCalled() should be declared external:\n\t- [ContractWithFunctionNotCalled2.funcNotCalled()](tests/detectors/external-function/external_function.sol#L32-L39)\n", + "description": "funcNotCalled() should be declared external:\n\t- ContractWithFunctionNotCalled2.funcNotCalled() (tests/detectors/external-function/0.4.25/external_function.sol#32-39)\n", + "markdown": "funcNotCalled() should be declared external:\n\t- [ContractWithFunctionNotCalled2.funcNotCalled()](tests/detectors/external-function/0.4.25/external_function.sol#L32-L39)\n", "id": "80a0a3a3954cc6e314079a1d8d96d6739d521ddbcf738e63078d7f210e443562", "check": "external-function", "impact": "Optimization", @@ -281,9 +281,9 @@ "start": 1420, "length": 81, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/external-function/external_function.sol", + "filename_relative": "tests/detectors/external-function/0.4.25/external_function.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/external-function/external_function.sol", + "filename_short": "tests/detectors/external-function/0.4.25/external_function.sol", "is_dependency": false, "lines": [ 74, @@ -301,9 +301,9 @@ "start": 1381, "length": 234, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/external-function/external_function.sol", + "filename_relative": "tests/detectors/external-function/0.4.25/external_function.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/external-function/external_function.sol", + "filename_short": "tests/detectors/external-function/0.4.25/external_function.sol", "is_dependency": false, "lines": [ 72, @@ -326,8 +326,8 @@ } } ], - "description": "parameter_read_ok_for_external(uint256) should be declared external:\n\t- FunctionParameterWrite.parameter_read_ok_for_external(uint256) (tests/detectors/external-function/external_function.sol#74-76)\n", - "markdown": "parameter_read_ok_for_external(uint256) should be declared external:\n\t- [FunctionParameterWrite.parameter_read_ok_for_external(uint256)](tests/detectors/external-function/external_function.sol#L74-L76)\n", + "description": "parameter_read_ok_for_external(uint256) should be declared external:\n\t- FunctionParameterWrite.parameter_read_ok_for_external(uint256) (tests/detectors/external-function/0.4.25/external_function.sol#74-76)\n", + "markdown": "parameter_read_ok_for_external(uint256) should be declared external:\n\t- [FunctionParameterWrite.parameter_read_ok_for_external(uint256)](tests/detectors/external-function/0.4.25/external_function.sol#L74-L76)\n", "id": "3a0a42d128eff9fb04d8f7605bf2d6f7574c2cbbdffa2dcabbae66d7568ecc59", "check": "external-function", "impact": "Optimization", diff --git a/tests/detectors/external-function/external_function_2.sol b/tests/detectors/external-function/0.4.25/external_function_2.sol similarity index 100% rename from tests/detectors/external-function/external_function_2.sol rename to tests/detectors/external-function/0.4.25/external_function_2.sol diff --git a/tests/detectors/unprotected-upgrade/Fixed.sol.0.6.12.UnprotectedUpgradeable.json b/tests/detectors/external-function/0.4.25/external_function_2.sol.0.4.25.ExternalFunction.json similarity index 100% rename from tests/detectors/unprotected-upgrade/Fixed.sol.0.6.12.UnprotectedUpgradeable.json rename to tests/detectors/external-function/0.4.25/external_function_2.sol.0.4.25.ExternalFunction.json diff --git a/tests/detectors/external-function/external_function_import.sol b/tests/detectors/external-function/0.4.25/external_function_import.sol similarity index 100% rename from tests/detectors/external-function/external_function_import.sol rename to tests/detectors/external-function/0.4.25/external_function_import.sol diff --git a/tests/detectors/external-function/0.5.16/external_function.sol b/tests/detectors/external-function/0.5.16/external_function.sol new file mode 100644 index 0000000000..cc2910aa40 --- /dev/null +++ b/tests/detectors/external-function/0.5.16/external_function.sol @@ -0,0 +1,82 @@ +//pragma solidity ^0.4.24; + +import "./external_function_import.sol"; + +contract ContractWithFunctionCalledSuper is ContractWithFunctionCalled { + function callWithSuper() public { + uint256 i = 0; + } +} + +contract ContractWithFunctionNotCalled { + + function funcNotCalled3() public { + + } + + function funcNotCalled2() public { + + } + + function funcNotCalled() public { + + } + + function my_func() internal returns(bool){ + return true; + } + +} + +contract ContractWithFunctionNotCalled2 is ContractWithFunctionCalledSuper { + function funcNotCalled() public { + uint256 i = 0; + address three = address(new ContractWithFunctionNotCalled()); + three.call(abi.encode(bytes4(keccak256("helloTwo()")))); + super.callWithSuper(); + ContractWithFunctionCalled c = new ContractWithFunctionCalled(); + c.funcCalled(); + } +} + +contract InternalCall { + + function() returns(uint) ptr; + + function set_test1() external{ + ptr = test1; + } + + function set_test2() external{ + ptr = test2; + } + + function test1() public returns(uint){ + return 1; + } + + function test2() public returns(uint){ + return 2; + } + + function test3() public returns(uint){ + return 3; + } + + function exec() external returns(uint){ + return ptr(); + } + +} + +contract FunctionParameterWrite { + + function parameter_read_ok_for_external (uint i) public { + uint local = i; + } + + function parameter_read_not_ok_for_external (uint i) public returns (uint) { + i += 1; + return (i); + } +} diff --git a/tests/detectors/external-function/0.5.16/external_function.sol.0.5.16.ExternalFunction.json b/tests/detectors/external-function/0.5.16/external_function.sol.0.5.16.ExternalFunction.json new file mode 100644 index 0000000000..2bd6ce0c63 --- /dev/null +++ b/tests/detectors/external-function/0.5.16/external_function.sol.0.5.16.ExternalFunction.json @@ -0,0 +1,337 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "funcNotCalled3", + "source_mapping": { + "start": 259, + "length": 41, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/external-function/0.5.16/external_function.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/external-function/0.5.16/external_function.sol", + "is_dependency": false, + "lines": [ + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ContractWithFunctionNotCalled", + "source_mapping": { + "start": 213, + "length": 258, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/external-function/0.5.16/external_function.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/external-function/0.5.16/external_function.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "funcNotCalled3()" + } + } + ], + "description": "funcNotCalled3() should be declared external:\n\t- ContractWithFunctionNotCalled.funcNotCalled3() (tests/detectors/external-function/0.5.16/external_function.sol#13-15)\n", + "markdown": "funcNotCalled3() should be declared external:\n\t- [ContractWithFunctionNotCalled.funcNotCalled3()](tests/detectors/external-function/0.5.16/external_function.sol#L13-L15)\n", + "id": "026d9a579ea0304e58c8a5174296494f4b672e4ea032f4e17504f3dac327c4e6", + "check": "external-function", + "impact": "Optimization", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "funcNotCalled2", + "source_mapping": { + "start": 306, + "length": 41, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/external-function/0.5.16/external_function.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/external-function/0.5.16/external_function.sol", + "is_dependency": false, + "lines": [ + 17, + 18, + 19 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ContractWithFunctionNotCalled", + "source_mapping": { + "start": 213, + "length": 258, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/external-function/0.5.16/external_function.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/external-function/0.5.16/external_function.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "funcNotCalled2()" + } + } + ], + "description": "funcNotCalled2() should be declared external:\n\t- ContractWithFunctionNotCalled.funcNotCalled2() (tests/detectors/external-function/0.5.16/external_function.sol#17-19)\n", + "markdown": "funcNotCalled2() should be declared external:\n\t- [ContractWithFunctionNotCalled.funcNotCalled2()](tests/detectors/external-function/0.5.16/external_function.sol#L17-L19)\n", + "id": "1ef1f19a92a8ab8d27df156d50dd75628ec3057b5f5eb16b7d1faa0e5c3850a0", + "check": "external-function", + "impact": "Optimization", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "funcNotCalled", + "source_mapping": { + "start": 353, + "length": 40, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/external-function/0.5.16/external_function.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/external-function/0.5.16/external_function.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ContractWithFunctionNotCalled", + "source_mapping": { + "start": 213, + "length": 258, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/external-function/0.5.16/external_function.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/external-function/0.5.16/external_function.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "funcNotCalled()" + } + } + ], + "description": "funcNotCalled() should be declared external:\n\t- ContractWithFunctionNotCalled.funcNotCalled() (tests/detectors/external-function/0.5.16/external_function.sol#21-23)\n", + "markdown": "funcNotCalled() should be declared external:\n\t- [ContractWithFunctionNotCalled.funcNotCalled()](tests/detectors/external-function/0.5.16/external_function.sol#L21-L23)\n", + "id": "369a2f3d071735755ff4f5bc43081fe858bbfb07eed94e5c6dda3c8daa22ba26", + "check": "external-function", + "impact": "Optimization", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "funcNotCalled", + "source_mapping": { + "start": 554, + "length": 325, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/external-function/0.5.16/external_function.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/external-function/0.5.16/external_function.sol", + "is_dependency": false, + "lines": [ + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ContractWithFunctionNotCalled2", + "source_mapping": { + "start": 473, + "length": 408, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/external-function/0.5.16/external_function.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/external-function/0.5.16/external_function.sol", + "is_dependency": false, + "lines": [ + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "funcNotCalled()" + } + } + ], + "description": "funcNotCalled() should be declared external:\n\t- ContractWithFunctionNotCalled2.funcNotCalled() (tests/detectors/external-function/0.5.16/external_function.sol#32-39)\n", + "markdown": "funcNotCalled() should be declared external:\n\t- [ContractWithFunctionNotCalled2.funcNotCalled()](tests/detectors/external-function/0.5.16/external_function.sol#L32-L39)\n", + "id": "80a0a3a3954cc6e314079a1d8d96d6739d521ddbcf738e63078d7f210e443562", + "check": "external-function", + "impact": "Optimization", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "parameter_read_ok_for_external", + "source_mapping": { + "start": 1420, + "length": 81, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/external-function/0.5.16/external_function.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/external-function/0.5.16/external_function.sol", + "is_dependency": false, + "lines": [ + 74, + 75, + 76 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FunctionParameterWrite", + "source_mapping": { + "start": 1381, + "length": 234, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/external-function/0.5.16/external_function.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/external-function/0.5.16/external_function.sol", + "is_dependency": false, + "lines": [ + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "parameter_read_ok_for_external(uint256)" + } + } + ], + "description": "parameter_read_ok_for_external(uint256) should be declared external:\n\t- FunctionParameterWrite.parameter_read_ok_for_external(uint256) (tests/detectors/external-function/0.5.16/external_function.sol#74-76)\n", + "markdown": "parameter_read_ok_for_external(uint256) should be declared external:\n\t- [FunctionParameterWrite.parameter_read_ok_for_external(uint256)](tests/detectors/external-function/0.5.16/external_function.sol#L74-L76)\n", + "id": "3a0a42d128eff9fb04d8f7605bf2d6f7574c2cbbdffa2dcabbae66d7568ecc59", + "check": "external-function", + "impact": "Optimization", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/external-function/0.5.16/external_function_2.sol b/tests/detectors/external-function/0.5.16/external_function_2.sol new file mode 100644 index 0000000000..97eed10a01 --- /dev/null +++ b/tests/detectors/external-function/0.5.16/external_function_2.sol @@ -0,0 +1,55 @@ +// This tests against false-positives. This test should output no recommendations from the external-function detector. + + +contract ContractWithBaseFunctionCalled { + function getsCalledByBase() public; + function callsOverrideMe() external { + getsCalledByBase(); + } +} + + +contract DerivingContractWithBaseCalled is ContractWithBaseFunctionCalled { + function getsCalledByBase() public { + // This should not be recommended to be marked external because it is called by the base class. + } +} + + +// All the contracts below should not recommend changing to external since inherited contracts have dynamic calls. +contract ContractWithDynamicCall { + function() returns(uint) ptr; + + function test1() public returns(uint){ + return 1; + } + + function test2() public returns(uint){ + return 2; + } + + function setTest1() external{ + ptr = test1; + } + + function setTest2() external{ + ptr = test2; + } + + function exec() external returns(uint){ + return ptr(); + } +} + +contract DerivesFromDynamicCall is ContractWithDynamicCall{ + function getsCalledDynamically() public returns (uint){ + // This should not be recommended because it is called dynamically. + return 3; + } + function setTest3() public { + // This should not be recommended because we inherit from a contract that calls dynamically, and we cannot be + // sure it did not somehow call this function. + + ptr = getsCalledDynamically; + } +} diff --git a/tests/detectors/external-function/0.5.16/external_function_2.sol.0.5.16.ExternalFunction.json b/tests/detectors/external-function/0.5.16/external_function_2.sol.0.5.16.ExternalFunction.json new file mode 100644 index 0000000000..5825bcacc6 --- /dev/null +++ b/tests/detectors/external-function/0.5.16/external_function_2.sol.0.5.16.ExternalFunction.json @@ -0,0 +1,3 @@ +[ + [] +] \ No newline at end of file diff --git a/tests/detectors/external-function/0.5.16/external_function_import.sol b/tests/detectors/external-function/0.5.16/external_function_import.sol new file mode 100644 index 0000000000..efddea28e7 --- /dev/null +++ b/tests/detectors/external-function/0.5.16/external_function_import.sol @@ -0,0 +1,7 @@ +// This file is imported by external_function.sol + +contract ContractWithFunctionCalled { + function funcCalled() external { + uint256 i = 0; + } +} diff --git a/tests/detectors/external-function/0.6.11/external_function.sol b/tests/detectors/external-function/0.6.11/external_function.sol new file mode 100644 index 0000000000..cc2910aa40 --- /dev/null +++ b/tests/detectors/external-function/0.6.11/external_function.sol @@ -0,0 +1,82 @@ +//pragma solidity ^0.4.24; + +import "./external_function_import.sol"; + +contract ContractWithFunctionCalledSuper is ContractWithFunctionCalled { + function callWithSuper() public { + uint256 i = 0; + } +} + +contract ContractWithFunctionNotCalled { + + function funcNotCalled3() public { + + } + + function funcNotCalled2() public { + + } + + function funcNotCalled() public { + + } + + function my_func() internal returns(bool){ + return true; + } + +} + +contract ContractWithFunctionNotCalled2 is ContractWithFunctionCalledSuper { + function funcNotCalled() public { + uint256 i = 0; + address three = address(new ContractWithFunctionNotCalled()); + three.call(abi.encode(bytes4(keccak256("helloTwo()")))); + super.callWithSuper(); + ContractWithFunctionCalled c = new ContractWithFunctionCalled(); + c.funcCalled(); + } +} + +contract InternalCall { + + function() returns(uint) ptr; + + function set_test1() external{ + ptr = test1; + } + + function set_test2() external{ + ptr = test2; + } + + function test1() public returns(uint){ + return 1; + } + + function test2() public returns(uint){ + return 2; + } + + function test3() public returns(uint){ + return 3; + } + + function exec() external returns(uint){ + return ptr(); + } + +} + +contract FunctionParameterWrite { + + function parameter_read_ok_for_external (uint i) public { + uint local = i; + } + + function parameter_read_not_ok_for_external (uint i) public returns (uint) { + i += 1; + return (i); + } +} diff --git a/tests/detectors/external-function/0.6.11/external_function.sol.0.6.11.ExternalFunction.json b/tests/detectors/external-function/0.6.11/external_function.sol.0.6.11.ExternalFunction.json new file mode 100644 index 0000000000..e3246b546b --- /dev/null +++ b/tests/detectors/external-function/0.6.11/external_function.sol.0.6.11.ExternalFunction.json @@ -0,0 +1,337 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "funcNotCalled3", + "source_mapping": { + "start": 259, + "length": 41, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/external-function/0.6.11/external_function.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/external-function/0.6.11/external_function.sol", + "is_dependency": false, + "lines": [ + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ContractWithFunctionNotCalled", + "source_mapping": { + "start": 213, + "length": 258, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/external-function/0.6.11/external_function.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/external-function/0.6.11/external_function.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "funcNotCalled3()" + } + } + ], + "description": "funcNotCalled3() should be declared external:\n\t- ContractWithFunctionNotCalled.funcNotCalled3() (tests/detectors/external-function/0.6.11/external_function.sol#13-15)\n", + "markdown": "funcNotCalled3() should be declared external:\n\t- [ContractWithFunctionNotCalled.funcNotCalled3()](tests/detectors/external-function/0.6.11/external_function.sol#L13-L15)\n", + "id": "026d9a579ea0304e58c8a5174296494f4b672e4ea032f4e17504f3dac327c4e6", + "check": "external-function", + "impact": "Optimization", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "funcNotCalled2", + "source_mapping": { + "start": 306, + "length": 41, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/external-function/0.6.11/external_function.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/external-function/0.6.11/external_function.sol", + "is_dependency": false, + "lines": [ + 17, + 18, + 19 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ContractWithFunctionNotCalled", + "source_mapping": { + "start": 213, + "length": 258, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/external-function/0.6.11/external_function.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/external-function/0.6.11/external_function.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "funcNotCalled2()" + } + } + ], + "description": "funcNotCalled2() should be declared external:\n\t- ContractWithFunctionNotCalled.funcNotCalled2() (tests/detectors/external-function/0.6.11/external_function.sol#17-19)\n", + "markdown": "funcNotCalled2() should be declared external:\n\t- [ContractWithFunctionNotCalled.funcNotCalled2()](tests/detectors/external-function/0.6.11/external_function.sol#L17-L19)\n", + "id": "1ef1f19a92a8ab8d27df156d50dd75628ec3057b5f5eb16b7d1faa0e5c3850a0", + "check": "external-function", + "impact": "Optimization", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "funcNotCalled", + "source_mapping": { + "start": 353, + "length": 40, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/external-function/0.6.11/external_function.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/external-function/0.6.11/external_function.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ContractWithFunctionNotCalled", + "source_mapping": { + "start": 213, + "length": 258, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/external-function/0.6.11/external_function.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/external-function/0.6.11/external_function.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "funcNotCalled()" + } + } + ], + "description": "funcNotCalled() should be declared external:\n\t- ContractWithFunctionNotCalled.funcNotCalled() (tests/detectors/external-function/0.6.11/external_function.sol#21-23)\n", + "markdown": "funcNotCalled() should be declared external:\n\t- [ContractWithFunctionNotCalled.funcNotCalled()](tests/detectors/external-function/0.6.11/external_function.sol#L21-L23)\n", + "id": "369a2f3d071735755ff4f5bc43081fe858bbfb07eed94e5c6dda3c8daa22ba26", + "check": "external-function", + "impact": "Optimization", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "funcNotCalled", + "source_mapping": { + "start": 554, + "length": 325, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/external-function/0.6.11/external_function.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/external-function/0.6.11/external_function.sol", + "is_dependency": false, + "lines": [ + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ContractWithFunctionNotCalled2", + "source_mapping": { + "start": 473, + "length": 408, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/external-function/0.6.11/external_function.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/external-function/0.6.11/external_function.sol", + "is_dependency": false, + "lines": [ + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "funcNotCalled()" + } + } + ], + "description": "funcNotCalled() should be declared external:\n\t- ContractWithFunctionNotCalled2.funcNotCalled() (tests/detectors/external-function/0.6.11/external_function.sol#32-39)\n", + "markdown": "funcNotCalled() should be declared external:\n\t- [ContractWithFunctionNotCalled2.funcNotCalled()](tests/detectors/external-function/0.6.11/external_function.sol#L32-L39)\n", + "id": "80a0a3a3954cc6e314079a1d8d96d6739d521ddbcf738e63078d7f210e443562", + "check": "external-function", + "impact": "Optimization", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "parameter_read_ok_for_external", + "source_mapping": { + "start": 1420, + "length": 81, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/external-function/0.6.11/external_function.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/external-function/0.6.11/external_function.sol", + "is_dependency": false, + "lines": [ + 74, + 75, + 76 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FunctionParameterWrite", + "source_mapping": { + "start": 1381, + "length": 234, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/external-function/0.6.11/external_function.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/external-function/0.6.11/external_function.sol", + "is_dependency": false, + "lines": [ + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "parameter_read_ok_for_external(uint256)" + } + } + ], + "description": "parameter_read_ok_for_external(uint256) should be declared external:\n\t- FunctionParameterWrite.parameter_read_ok_for_external(uint256) (tests/detectors/external-function/0.6.11/external_function.sol#74-76)\n", + "markdown": "parameter_read_ok_for_external(uint256) should be declared external:\n\t- [FunctionParameterWrite.parameter_read_ok_for_external(uint256)](tests/detectors/external-function/0.6.11/external_function.sol#L74-L76)\n", + "id": "3a0a42d128eff9fb04d8f7605bf2d6f7574c2cbbdffa2dcabbae66d7568ecc59", + "check": "external-function", + "impact": "Optimization", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/external-function/0.6.11/external_function_2.sol b/tests/detectors/external-function/0.6.11/external_function_2.sol new file mode 100644 index 0000000000..2cb2f59f94 --- /dev/null +++ b/tests/detectors/external-function/0.6.11/external_function_2.sol @@ -0,0 +1,55 @@ +// This tests against false-positives. This test should output no recommendations from the external-function detector. + + +abstract contract ContractWithBaseFunctionCalled { + function getsCalledByBase() public virtual; + function callsOverrideMe() external { + getsCalledByBase(); + } +} + + +contract DerivingContractWithBaseCalled is ContractWithBaseFunctionCalled { + function getsCalledByBase() public override { + // This should not be recommended to be marked external because it is called by the base class. + } +} + + +// All the contracts below should not recommend changing to external since inherited contracts have dynamic calls. +contract ContractWithDynamicCall { + function() returns(uint) ptr; + + function test1() public returns(uint){ + return 1; + } + + function test2() public returns(uint){ + return 2; + } + + function setTest1() external{ + ptr = test1; + } + + function setTest2() external{ + ptr = test2; + } + + function exec() external returns(uint){ + return ptr(); + } +} + +contract DerivesFromDynamicCall is ContractWithDynamicCall{ + function getsCalledDynamically() public returns (uint){ + // This should not be recommended because it is called dynamically. + return 3; + } + function setTest3() public { + // This should not be recommended because we inherit from a contract that calls dynamically, and we cannot be + // sure it did not somehow call this function. + + ptr = getsCalledDynamically; + } +} diff --git a/tests/detectors/external-function/0.6.11/external_function_2.sol.0.6.11.ExternalFunction.json b/tests/detectors/external-function/0.6.11/external_function_2.sol.0.6.11.ExternalFunction.json new file mode 100644 index 0000000000..5825bcacc6 --- /dev/null +++ b/tests/detectors/external-function/0.6.11/external_function_2.sol.0.6.11.ExternalFunction.json @@ -0,0 +1,3 @@ +[ + [] +] \ No newline at end of file diff --git a/tests/detectors/external-function/0.6.11/external_function_import.sol b/tests/detectors/external-function/0.6.11/external_function_import.sol new file mode 100644 index 0000000000..efddea28e7 --- /dev/null +++ b/tests/detectors/external-function/0.6.11/external_function_import.sol @@ -0,0 +1,7 @@ +// This file is imported by external_function.sol + +contract ContractWithFunctionCalled { + function funcCalled() external { + uint256 i = 0; + } +} diff --git a/tests/detectors/external-function/0.7.6/external_function.sol b/tests/detectors/external-function/0.7.6/external_function.sol new file mode 100644 index 0000000000..cc2910aa40 --- /dev/null +++ b/tests/detectors/external-function/0.7.6/external_function.sol @@ -0,0 +1,82 @@ +//pragma solidity ^0.4.24; + +import "./external_function_import.sol"; + +contract ContractWithFunctionCalledSuper is ContractWithFunctionCalled { + function callWithSuper() public { + uint256 i = 0; + } +} + +contract ContractWithFunctionNotCalled { + + function funcNotCalled3() public { + + } + + function funcNotCalled2() public { + + } + + function funcNotCalled() public { + + } + + function my_func() internal returns(bool){ + return true; + } + +} + +contract ContractWithFunctionNotCalled2 is ContractWithFunctionCalledSuper { + function funcNotCalled() public { + uint256 i = 0; + address three = address(new ContractWithFunctionNotCalled()); + three.call(abi.encode(bytes4(keccak256("helloTwo()")))); + super.callWithSuper(); + ContractWithFunctionCalled c = new ContractWithFunctionCalled(); + c.funcCalled(); + } +} + +contract InternalCall { + + function() returns(uint) ptr; + + function set_test1() external{ + ptr = test1; + } + + function set_test2() external{ + ptr = test2; + } + + function test1() public returns(uint){ + return 1; + } + + function test2() public returns(uint){ + return 2; + } + + function test3() public returns(uint){ + return 3; + } + + function exec() external returns(uint){ + return ptr(); + } + +} + +contract FunctionParameterWrite { + + function parameter_read_ok_for_external (uint i) public { + uint local = i; + } + + function parameter_read_not_ok_for_external (uint i) public returns (uint) { + i += 1; + return (i); + } +} diff --git a/tests/detectors/external-function/external_function.sol.0.5.1.ExternalFunction.json b/tests/detectors/external-function/0.7.6/external_function.sol.0.7.6.ExternalFunction.json similarity index 90% rename from tests/detectors/external-function/external_function.sol.0.5.1.ExternalFunction.json rename to tests/detectors/external-function/0.7.6/external_function.sol.0.7.6.ExternalFunction.json index 11c3b7d3ae..a36860728a 100644 --- a/tests/detectors/external-function/external_function.sol.0.5.1.ExternalFunction.json +++ b/tests/detectors/external-function/0.7.6/external_function.sol.0.7.6.ExternalFunction.json @@ -9,9 +9,9 @@ "start": 259, "length": 41, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/external-function/external_function.sol", + "filename_relative": "tests/detectors/external-function/0.7.6/external_function.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/external-function/external_function.sol", + "filename_short": "tests/detectors/external-function/0.7.6/external_function.sol", "is_dependency": false, "lines": [ 13, @@ -29,9 +29,9 @@ "start": 213, "length": 258, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/external-function/external_function.sol", + "filename_relative": "tests/detectors/external-function/0.7.6/external_function.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/external-function/external_function.sol", + "filename_short": "tests/detectors/external-function/0.7.6/external_function.sol", "is_dependency": false, "lines": [ 11, @@ -62,8 +62,8 @@ } } ], - "description": "funcNotCalled3() should be declared external:\n\t- ContractWithFunctionNotCalled.funcNotCalled3() (tests/detectors/external-function/external_function.sol#13-15)\n", - "markdown": "funcNotCalled3() should be declared external:\n\t- [ContractWithFunctionNotCalled.funcNotCalled3()](tests/detectors/external-function/external_function.sol#L13-L15)\n", + "description": "funcNotCalled3() should be declared external:\n\t- ContractWithFunctionNotCalled.funcNotCalled3() (tests/detectors/external-function/0.7.6/external_function.sol#13-15)\n", + "markdown": "funcNotCalled3() should be declared external:\n\t- [ContractWithFunctionNotCalled.funcNotCalled3()](tests/detectors/external-function/0.7.6/external_function.sol#L13-L15)\n", "id": "026d9a579ea0304e58c8a5174296494f4b672e4ea032f4e17504f3dac327c4e6", "check": "external-function", "impact": "Optimization", @@ -78,9 +78,9 @@ "start": 306, "length": 41, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/external-function/external_function.sol", + "filename_relative": "tests/detectors/external-function/0.7.6/external_function.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/external-function/external_function.sol", + "filename_short": "tests/detectors/external-function/0.7.6/external_function.sol", "is_dependency": false, "lines": [ 17, @@ -98,9 +98,9 @@ "start": 213, "length": 258, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/external-function/external_function.sol", + "filename_relative": "tests/detectors/external-function/0.7.6/external_function.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/external-function/external_function.sol", + "filename_short": "tests/detectors/external-function/0.7.6/external_function.sol", "is_dependency": false, "lines": [ 11, @@ -131,8 +131,8 @@ } } ], - "description": "funcNotCalled2() should be declared external:\n\t- ContractWithFunctionNotCalled.funcNotCalled2() (tests/detectors/external-function/external_function.sol#17-19)\n", - "markdown": "funcNotCalled2() should be declared external:\n\t- [ContractWithFunctionNotCalled.funcNotCalled2()](tests/detectors/external-function/external_function.sol#L17-L19)\n", + "description": "funcNotCalled2() should be declared external:\n\t- ContractWithFunctionNotCalled.funcNotCalled2() (tests/detectors/external-function/0.7.6/external_function.sol#17-19)\n", + "markdown": "funcNotCalled2() should be declared external:\n\t- [ContractWithFunctionNotCalled.funcNotCalled2()](tests/detectors/external-function/0.7.6/external_function.sol#L17-L19)\n", "id": "1ef1f19a92a8ab8d27df156d50dd75628ec3057b5f5eb16b7d1faa0e5c3850a0", "check": "external-function", "impact": "Optimization", @@ -147,9 +147,9 @@ "start": 353, "length": 40, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/external-function/external_function.sol", + "filename_relative": "tests/detectors/external-function/0.7.6/external_function.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/external-function/external_function.sol", + "filename_short": "tests/detectors/external-function/0.7.6/external_function.sol", "is_dependency": false, "lines": [ 21, @@ -167,9 +167,9 @@ "start": 213, "length": 258, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/external-function/external_function.sol", + "filename_relative": "tests/detectors/external-function/0.7.6/external_function.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/external-function/external_function.sol", + "filename_short": "tests/detectors/external-function/0.7.6/external_function.sol", "is_dependency": false, "lines": [ 11, @@ -200,8 +200,8 @@ } } ], - "description": "funcNotCalled() should be declared external:\n\t- ContractWithFunctionNotCalled.funcNotCalled() (tests/detectors/external-function/external_function.sol#21-23)\n", - "markdown": "funcNotCalled() should be declared external:\n\t- [ContractWithFunctionNotCalled.funcNotCalled()](tests/detectors/external-function/external_function.sol#L21-L23)\n", + "description": "funcNotCalled() should be declared external:\n\t- ContractWithFunctionNotCalled.funcNotCalled() (tests/detectors/external-function/0.7.6/external_function.sol#21-23)\n", + "markdown": "funcNotCalled() should be declared external:\n\t- [ContractWithFunctionNotCalled.funcNotCalled()](tests/detectors/external-function/0.7.6/external_function.sol#L21-L23)\n", "id": "369a2f3d071735755ff4f5bc43081fe858bbfb07eed94e5c6dda3c8daa22ba26", "check": "external-function", "impact": "Optimization", @@ -216,9 +216,9 @@ "start": 554, "length": 325, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/external-function/external_function.sol", + "filename_relative": "tests/detectors/external-function/0.7.6/external_function.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/external-function/external_function.sol", + "filename_short": "tests/detectors/external-function/0.7.6/external_function.sol", "is_dependency": false, "lines": [ 32, @@ -241,9 +241,9 @@ "start": 473, "length": 408, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/external-function/external_function.sol", + "filename_relative": "tests/detectors/external-function/0.7.6/external_function.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/external-function/external_function.sol", + "filename_short": "tests/detectors/external-function/0.7.6/external_function.sol", "is_dependency": false, "lines": [ 31, @@ -265,8 +265,8 @@ } } ], - "description": "funcNotCalled() should be declared external:\n\t- ContractWithFunctionNotCalled2.funcNotCalled() (tests/detectors/external-function/external_function.sol#32-39)\n", - "markdown": "funcNotCalled() should be declared external:\n\t- [ContractWithFunctionNotCalled2.funcNotCalled()](tests/detectors/external-function/external_function.sol#L32-L39)\n", + "description": "funcNotCalled() should be declared external:\n\t- ContractWithFunctionNotCalled2.funcNotCalled() (tests/detectors/external-function/0.7.6/external_function.sol#32-39)\n", + "markdown": "funcNotCalled() should be declared external:\n\t- [ContractWithFunctionNotCalled2.funcNotCalled()](tests/detectors/external-function/0.7.6/external_function.sol#L32-L39)\n", "id": "80a0a3a3954cc6e314079a1d8d96d6739d521ddbcf738e63078d7f210e443562", "check": "external-function", "impact": "Optimization", @@ -281,9 +281,9 @@ "start": 1420, "length": 81, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/external-function/external_function.sol", + "filename_relative": "tests/detectors/external-function/0.7.6/external_function.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/external-function/external_function.sol", + "filename_short": "tests/detectors/external-function/0.7.6/external_function.sol", "is_dependency": false, "lines": [ 74, @@ -301,9 +301,9 @@ "start": 1381, "length": 234, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/external-function/external_function.sol", + "filename_relative": "tests/detectors/external-function/0.7.6/external_function.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/external-function/external_function.sol", + "filename_short": "tests/detectors/external-function/0.7.6/external_function.sol", "is_dependency": false, "lines": [ 72, @@ -326,8 +326,8 @@ } } ], - "description": "parameter_read_ok_for_external(uint256) should be declared external:\n\t- FunctionParameterWrite.parameter_read_ok_for_external(uint256) (tests/detectors/external-function/external_function.sol#74-76)\n", - "markdown": "parameter_read_ok_for_external(uint256) should be declared external:\n\t- [FunctionParameterWrite.parameter_read_ok_for_external(uint256)](tests/detectors/external-function/external_function.sol#L74-L76)\n", + "description": "parameter_read_ok_for_external(uint256) should be declared external:\n\t- FunctionParameterWrite.parameter_read_ok_for_external(uint256) (tests/detectors/external-function/0.7.6/external_function.sol#74-76)\n", + "markdown": "parameter_read_ok_for_external(uint256) should be declared external:\n\t- [FunctionParameterWrite.parameter_read_ok_for_external(uint256)](tests/detectors/external-function/0.7.6/external_function.sol#L74-L76)\n", "id": "3a0a42d128eff9fb04d8f7605bf2d6f7574c2cbbdffa2dcabbae66d7568ecc59", "check": "external-function", "impact": "Optimization", diff --git a/tests/detectors/external-function/0.7.6/external_function_2.sol b/tests/detectors/external-function/0.7.6/external_function_2.sol new file mode 100644 index 0000000000..2cb2f59f94 --- /dev/null +++ b/tests/detectors/external-function/0.7.6/external_function_2.sol @@ -0,0 +1,55 @@ +// This tests against false-positives. This test should output no recommendations from the external-function detector. + + +abstract contract ContractWithBaseFunctionCalled { + function getsCalledByBase() public virtual; + function callsOverrideMe() external { + getsCalledByBase(); + } +} + + +contract DerivingContractWithBaseCalled is ContractWithBaseFunctionCalled { + function getsCalledByBase() public override { + // This should not be recommended to be marked external because it is called by the base class. + } +} + + +// All the contracts below should not recommend changing to external since inherited contracts have dynamic calls. +contract ContractWithDynamicCall { + function() returns(uint) ptr; + + function test1() public returns(uint){ + return 1; + } + + function test2() public returns(uint){ + return 2; + } + + function setTest1() external{ + ptr = test1; + } + + function setTest2() external{ + ptr = test2; + } + + function exec() external returns(uint){ + return ptr(); + } +} + +contract DerivesFromDynamicCall is ContractWithDynamicCall{ + function getsCalledDynamically() public returns (uint){ + // This should not be recommended because it is called dynamically. + return 3; + } + function setTest3() public { + // This should not be recommended because we inherit from a contract that calls dynamically, and we cannot be + // sure it did not somehow call this function. + + ptr = getsCalledDynamically; + } +} diff --git a/tests/detectors/external-function/0.7.6/external_function_2.sol.0.7.6.ExternalFunction.json b/tests/detectors/external-function/0.7.6/external_function_2.sol.0.7.6.ExternalFunction.json new file mode 100644 index 0000000000..5825bcacc6 --- /dev/null +++ b/tests/detectors/external-function/0.7.6/external_function_2.sol.0.7.6.ExternalFunction.json @@ -0,0 +1,3 @@ +[ + [] +] \ No newline at end of file diff --git a/tests/detectors/external-function/0.7.6/external_function_import.sol b/tests/detectors/external-function/0.7.6/external_function_import.sol new file mode 100644 index 0000000000..efddea28e7 --- /dev/null +++ b/tests/detectors/external-function/0.7.6/external_function_import.sol @@ -0,0 +1,7 @@ +// This file is imported by external_function.sol + +contract ContractWithFunctionCalled { + function funcCalled() external { + uint256 i = 0; + } +} diff --git a/tests/detectors/function-init-state/function_init_state_variables.sol b/tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol similarity index 100% rename from tests/detectors/function-init-state/function_init_state_variables.sol rename to tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol diff --git a/tests/detectors/function-init-state/function_init_state_variables.sol.0.4.25.FunctionInitializedState.json b/tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol.0.4.25.FunctionInitializedState.json similarity index 86% rename from tests/detectors/function-init-state/function_init_state_variables.sol.0.4.25.FunctionInitializedState.json rename to tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol.0.4.25.FunctionInitializedState.json index af973568f2..f2993d18c0 100644 --- a/tests/detectors/function-init-state/function_init_state_variables.sol.0.4.25.FunctionInitializedState.json +++ b/tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol.0.4.25.FunctionInitializedState.json @@ -9,9 +9,9 @@ "start": 157, "length": 21, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/function-init-state/function_init_state_variables.sol", + "filename_relative": "tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/function-init-state/function_init_state_variables.sol", + "filename_short": "tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol", "is_dependency": false, "lines": [ 5 @@ -27,9 +27,9 @@ "start": 116, "length": 1567, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/function-init-state/function_init_state_variables.sol", + "filename_relative": "tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/function-init-state/function_init_state_variables.sol", + "filename_short": "tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol", "is_dependency": false, "lines": [ 3, @@ -85,8 +85,8 @@ } } ], - "description": "StateVarInitFromFunction.v (tests/detectors/function-init-state/function_init_state_variables.sol#5) is set pre-construction with a non-constant function or state variable:\n\t- set()\n", - "markdown": "[StateVarInitFromFunction.v](tests/detectors/function-init-state/function_init_state_variables.sol#L5) is set pre-construction with a non-constant function or state variable:\n\t- set()\n", + "description": "StateVarInitFromFunction.v (tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol#5) is set pre-construction with a non-constant function or state variable:\n\t- set()\n", + "markdown": "[StateVarInitFromFunction.v](tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol#L5) is set pre-construction with a non-constant function or state variable:\n\t- set()\n", "id": "4b87ea4c0a3b72be79ffde12c56c9dc7440445b79ff4b228e0937b3a05540e4b", "check": "function-init-state", "impact": "Informational", @@ -101,9 +101,9 @@ "start": 268, "length": 21, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/function-init-state/function_init_state_variables.sol", + "filename_relative": "tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/function-init-state/function_init_state_variables.sol", + "filename_short": "tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol", "is_dependency": false, "lines": [ 7 @@ -119,9 +119,9 @@ "start": 116, "length": 1567, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/function-init-state/function_init_state_variables.sol", + "filename_relative": "tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/function-init-state/function_init_state_variables.sol", + "filename_short": "tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol", "is_dependency": false, "lines": [ 3, @@ -177,8 +177,8 @@ } } ], - "description": "StateVarInitFromFunction.x (tests/detectors/function-init-state/function_init_state_variables.sol#7) is set pre-construction with a non-constant function or state variable:\n\t- set()\n", - "markdown": "[StateVarInitFromFunction.x](tests/detectors/function-init-state/function_init_state_variables.sol#L7) is set pre-construction with a non-constant function or state variable:\n\t- set()\n", + "description": "StateVarInitFromFunction.x (tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol#7) is set pre-construction with a non-constant function or state variable:\n\t- set()\n", + "markdown": "[StateVarInitFromFunction.x](tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol#L7) is set pre-construction with a non-constant function or state variable:\n\t- set()\n", "id": "adfa394934c8669a556cfa10c364fe526dd1e295a63959e1e88fe84a919ef354", "check": "function-init-state", "impact": "Informational", @@ -193,9 +193,9 @@ "start": 357, "length": 26, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/function-init-state/function_init_state_variables.sol", + "filename_relative": "tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/function-init-state/function_init_state_variables.sol", + "filename_short": "tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol", "is_dependency": false, "lines": [ 9 @@ -211,9 +211,9 @@ "start": 116, "length": 1567, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/function-init-state/function_init_state_variables.sol", + "filename_relative": "tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/function-init-state/function_init_state_variables.sol", + "filename_short": "tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol", "is_dependency": false, "lines": [ 3, @@ -269,8 +269,8 @@ } } ], - "description": "StateVarInitFromFunction.y1 (tests/detectors/function-init-state/function_init_state_variables.sol#9) is set pre-construction with a non-constant function or state variable:\n\t- 5 + get()\n", - "markdown": "[StateVarInitFromFunction.y1](tests/detectors/function-init-state/function_init_state_variables.sol#L9) is set pre-construction with a non-constant function or state variable:\n\t- 5 + get()\n", + "description": "StateVarInitFromFunction.y1 (tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol#9) is set pre-construction with a non-constant function or state variable:\n\t- 5 + get()\n", + "markdown": "[StateVarInitFromFunction.y1](tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol#L9) is set pre-construction with a non-constant function or state variable:\n\t- 5 + get()\n", "id": "b26f83c06e9aca87637dea02a0f4080fd4226c1ed90c6c2c63da85cb142d67ab", "check": "function-init-state", "impact": "Informational", @@ -285,9 +285,9 @@ "start": 453, "length": 35, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/function-init-state/function_init_state_variables.sol", + "filename_relative": "tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/function-init-state/function_init_state_variables.sol", + "filename_short": "tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol", "is_dependency": false, "lines": [ 10 @@ -303,9 +303,9 @@ "start": 116, "length": 1567, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/function-init-state/function_init_state_variables.sol", + "filename_relative": "tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/function-init-state/function_init_state_variables.sol", + "filename_short": "tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol", "is_dependency": false, "lines": [ 3, @@ -361,8 +361,8 @@ } } ], - "description": "StateVarInitFromFunction.y2 (tests/detectors/function-init-state/function_init_state_variables.sol#10) is set pre-construction with a non-constant function or state variable:\n\t- (10 + (5 + get()))\n", - "markdown": "[StateVarInitFromFunction.y2](tests/detectors/function-init-state/function_init_state_variables.sol#L10) is set pre-construction with a non-constant function or state variable:\n\t- (10 + (5 + get()))\n", + "description": "StateVarInitFromFunction.y2 (tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol#10) is set pre-construction with a non-constant function or state variable:\n\t- (10 + (5 + get()))\n", + "markdown": "[StateVarInitFromFunction.y2](tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol#L10) is set pre-construction with a non-constant function or state variable:\n\t- (10 + (5 + get()))\n", "id": "b6e231b9b735794e00b73dddb86b2ba8f7a738d916c99f302fb32b1095c67472", "check": "function-init-state", "impact": "Informational", @@ -377,9 +377,9 @@ "start": 842, "length": 23, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/function-init-state/function_init_state_variables.sol", + "filename_relative": "tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/function-init-state/function_init_state_variables.sol", + "filename_short": "tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol", "is_dependency": false, "lines": [ 17 @@ -395,9 +395,9 @@ "start": 116, "length": 1567, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/function-init-state/function_init_state_variables.sol", + "filename_relative": "tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/function-init-state/function_init_state_variables.sol", + "filename_short": "tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol", "is_dependency": false, "lines": [ 3, @@ -453,8 +453,8 @@ } } ], - "description": "StateVarInitFromFunction.z4 (tests/detectors/function-init-state/function_init_state_variables.sol#17) is set pre-construction with a non-constant function or state variable:\n\t- z3 + 5\n", - "markdown": "[StateVarInitFromFunction.z4](tests/detectors/function-init-state/function_init_state_variables.sol#L17) is set pre-construction with a non-constant function or state variable:\n\t- z3 + 5\n", + "description": "StateVarInitFromFunction.z4 (tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol#17) is set pre-construction with a non-constant function or state variable:\n\t- z3 + 5\n", + "markdown": "[StateVarInitFromFunction.z4](tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol#L17) is set pre-construction with a non-constant function or state variable:\n\t- z3 + 5\n", "id": "8b7eb9ab16397c2f23479d2c3043a675ab5e2b1da07e2697631812d6d7b68525", "check": "function-init-state", "impact": "Informational", diff --git a/tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol b/tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol new file mode 100644 index 0000000000..fb15d4df9d --- /dev/null +++ b/tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol @@ -0,0 +1,46 @@ +// This tests the detection of initializing a state variable using a non-constant function call or state variable. + +contract StateVarInitFromFunction { + + uint public v = set(); // should be flagged, initialized from function (sets to 77) + uint public w = 5; + uint public x = set(); // should be flagged, initialized from function (sets to 88) + + uint public y1 = 5 + get(); // should be flagged, initialized from function (in expression) + uint public y2 = (10 + (5 + get())); // should be flagged, initialized from function (in expression) + + uint public z1 = 5 + getPure(); // should not be flagged, is a pure function + uint public z2 = (10 + (5 + getPure())); // should not be flagged, is a pure function + + uint constant public c1 = 40; + uint public z3 = c1 + 5; // should not be flagged, references a constant + uint public z4 = z3 + 5; // should be flagged, uses a non-constant state variable. + + address public shouldntBeReported = address(8); // should not be flagged, not a *real* function call. + uint public constructorV; + uint public constructorX; + + constructor() public { + // By the time this code is hit, all state variable initialization has completed. + constructorV = v; + constructorX = x; + } + + function set() public returns(uint) { + // If this function is being used to initialize a state variable before w, w will be zero. + // If it is declared after w, w will be set. + if(w == 0) { + return 77; + } + + return 88; + } + + function get() public returns(uint) { + return 55; + } + + function getPure() public pure returns(uint) { + return 55; + } +} \ No newline at end of file diff --git a/tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol.0.5.16.FunctionInitializedState.json b/tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol.0.5.16.FunctionInitializedState.json new file mode 100644 index 0000000000..e6b89db79a --- /dev/null +++ b/tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol.0.5.16.FunctionInitializedState.json @@ -0,0 +1,464 @@ +[ + [ + { + "elements": [ + { + "type": "variable", + "name": "v", + "source_mapping": { + "start": 157, + "length": 21, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 5 + ], + "starting_column": 5, + "ending_column": 26 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "StateVarInitFromFunction", + "source_mapping": { + "start": 116, + "length": 1575, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47 + ], + "starting_column": 1, + "ending_column": 0 + } + } + } + } + ], + "description": "StateVarInitFromFunction.v (tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol#5) is set pre-construction with a non-constant function or state variable:\n\t- set()\n", + "markdown": "[StateVarInitFromFunction.v](tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol#L5) is set pre-construction with a non-constant function or state variable:\n\t- set()\n", + "id": "4b87ea4c0a3b72be79ffde12c56c9dc7440445b79ff4b228e0937b3a05540e4b", + "check": "function-init-state", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "x", + "source_mapping": { + "start": 268, + "length": 21, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 7 + ], + "starting_column": 5, + "ending_column": 26 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "StateVarInitFromFunction", + "source_mapping": { + "start": 116, + "length": 1575, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47 + ], + "starting_column": 1, + "ending_column": 0 + } + } + } + } + ], + "description": "StateVarInitFromFunction.x (tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol#7) is set pre-construction with a non-constant function or state variable:\n\t- set()\n", + "markdown": "[StateVarInitFromFunction.x](tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol#L7) is set pre-construction with a non-constant function or state variable:\n\t- set()\n", + "id": "adfa394934c8669a556cfa10c364fe526dd1e295a63959e1e88fe84a919ef354", + "check": "function-init-state", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "y1", + "source_mapping": { + "start": 357, + "length": 26, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 9 + ], + "starting_column": 5, + "ending_column": 31 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "StateVarInitFromFunction", + "source_mapping": { + "start": 116, + "length": 1575, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47 + ], + "starting_column": 1, + "ending_column": 0 + } + } + } + } + ], + "description": "StateVarInitFromFunction.y1 (tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol#9) is set pre-construction with a non-constant function or state variable:\n\t- 5 + get()\n", + "markdown": "[StateVarInitFromFunction.y1](tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol#L9) is set pre-construction with a non-constant function or state variable:\n\t- 5 + get()\n", + "id": "b26f83c06e9aca87637dea02a0f4080fd4226c1ed90c6c2c63da85cb142d67ab", + "check": "function-init-state", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "y2", + "source_mapping": { + "start": 453, + "length": 35, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 5, + "ending_column": 40 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "StateVarInitFromFunction", + "source_mapping": { + "start": 116, + "length": 1575, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47 + ], + "starting_column": 1, + "ending_column": 0 + } + } + } + } + ], + "description": "StateVarInitFromFunction.y2 (tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol#10) is set pre-construction with a non-constant function or state variable:\n\t- (10 + (5 + get()))\n", + "markdown": "[StateVarInitFromFunction.y2](tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol#L10) is set pre-construction with a non-constant function or state variable:\n\t- (10 + (5 + get()))\n", + "id": "b6e231b9b735794e00b73dddb86b2ba8f7a738d916c99f302fb32b1095c67472", + "check": "function-init-state", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "z4", + "source_mapping": { + "start": 842, + "length": 23, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 17 + ], + "starting_column": 5, + "ending_column": 28 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "StateVarInitFromFunction", + "source_mapping": { + "start": 116, + "length": 1575, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47 + ], + "starting_column": 1, + "ending_column": 0 + } + } + } + } + ], + "description": "StateVarInitFromFunction.z4 (tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol#17) is set pre-construction with a non-constant function or state variable:\n\t- z3 + 5\n", + "markdown": "[StateVarInitFromFunction.z4](tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol#L17) is set pre-construction with a non-constant function or state variable:\n\t- z3 + 5\n", + "id": "8b7eb9ab16397c2f23479d2c3043a675ab5e2b1da07e2697631812d6d7b68525", + "check": "function-init-state", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol b/tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol new file mode 100644 index 0000000000..fb15d4df9d --- /dev/null +++ b/tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol @@ -0,0 +1,46 @@ +// This tests the detection of initializing a state variable using a non-constant function call or state variable. + +contract StateVarInitFromFunction { + + uint public v = set(); // should be flagged, initialized from function (sets to 77) + uint public w = 5; + uint public x = set(); // should be flagged, initialized from function (sets to 88) + + uint public y1 = 5 + get(); // should be flagged, initialized from function (in expression) + uint public y2 = (10 + (5 + get())); // should be flagged, initialized from function (in expression) + + uint public z1 = 5 + getPure(); // should not be flagged, is a pure function + uint public z2 = (10 + (5 + getPure())); // should not be flagged, is a pure function + + uint constant public c1 = 40; + uint public z3 = c1 + 5; // should not be flagged, references a constant + uint public z4 = z3 + 5; // should be flagged, uses a non-constant state variable. + + address public shouldntBeReported = address(8); // should not be flagged, not a *real* function call. + uint public constructorV; + uint public constructorX; + + constructor() public { + // By the time this code is hit, all state variable initialization has completed. + constructorV = v; + constructorX = x; + } + + function set() public returns(uint) { + // If this function is being used to initialize a state variable before w, w will be zero. + // If it is declared after w, w will be set. + if(w == 0) { + return 77; + } + + return 88; + } + + function get() public returns(uint) { + return 55; + } + + function getPure() public pure returns(uint) { + return 55; + } +} \ No newline at end of file diff --git a/tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol.0.6.11.FunctionInitializedState.json b/tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol.0.6.11.FunctionInitializedState.json new file mode 100644 index 0000000000..b66129a3ea --- /dev/null +++ b/tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol.0.6.11.FunctionInitializedState.json @@ -0,0 +1,464 @@ +[ + [ + { + "elements": [ + { + "type": "variable", + "name": "v", + "source_mapping": { + "start": 157, + "length": 21, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 5 + ], + "starting_column": 5, + "ending_column": 26 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "StateVarInitFromFunction", + "source_mapping": { + "start": 116, + "length": 1575, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47 + ], + "starting_column": 1, + "ending_column": 0 + } + } + } + } + ], + "description": "StateVarInitFromFunction.v (tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol#5) is set pre-construction with a non-constant function or state variable:\n\t- set()\n", + "markdown": "[StateVarInitFromFunction.v](tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol#L5) is set pre-construction with a non-constant function or state variable:\n\t- set()\n", + "id": "4b87ea4c0a3b72be79ffde12c56c9dc7440445b79ff4b228e0937b3a05540e4b", + "check": "function-init-state", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "x", + "source_mapping": { + "start": 268, + "length": 21, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 7 + ], + "starting_column": 5, + "ending_column": 26 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "StateVarInitFromFunction", + "source_mapping": { + "start": 116, + "length": 1575, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47 + ], + "starting_column": 1, + "ending_column": 0 + } + } + } + } + ], + "description": "StateVarInitFromFunction.x (tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol#7) is set pre-construction with a non-constant function or state variable:\n\t- set()\n", + "markdown": "[StateVarInitFromFunction.x](tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol#L7) is set pre-construction with a non-constant function or state variable:\n\t- set()\n", + "id": "adfa394934c8669a556cfa10c364fe526dd1e295a63959e1e88fe84a919ef354", + "check": "function-init-state", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "y1", + "source_mapping": { + "start": 357, + "length": 26, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 9 + ], + "starting_column": 5, + "ending_column": 31 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "StateVarInitFromFunction", + "source_mapping": { + "start": 116, + "length": 1575, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47 + ], + "starting_column": 1, + "ending_column": 0 + } + } + } + } + ], + "description": "StateVarInitFromFunction.y1 (tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol#9) is set pre-construction with a non-constant function or state variable:\n\t- 5 + get()\n", + "markdown": "[StateVarInitFromFunction.y1](tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol#L9) is set pre-construction with a non-constant function or state variable:\n\t- 5 + get()\n", + "id": "b26f83c06e9aca87637dea02a0f4080fd4226c1ed90c6c2c63da85cb142d67ab", + "check": "function-init-state", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "y2", + "source_mapping": { + "start": 453, + "length": 35, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 5, + "ending_column": 40 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "StateVarInitFromFunction", + "source_mapping": { + "start": 116, + "length": 1575, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47 + ], + "starting_column": 1, + "ending_column": 0 + } + } + } + } + ], + "description": "StateVarInitFromFunction.y2 (tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol#10) is set pre-construction with a non-constant function or state variable:\n\t- (10 + (5 + get()))\n", + "markdown": "[StateVarInitFromFunction.y2](tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol#L10) is set pre-construction with a non-constant function or state variable:\n\t- (10 + (5 + get()))\n", + "id": "b6e231b9b735794e00b73dddb86b2ba8f7a738d916c99f302fb32b1095c67472", + "check": "function-init-state", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "z4", + "source_mapping": { + "start": 842, + "length": 23, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 17 + ], + "starting_column": 5, + "ending_column": 28 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "StateVarInitFromFunction", + "source_mapping": { + "start": 116, + "length": 1575, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47 + ], + "starting_column": 1, + "ending_column": 0 + } + } + } + } + ], + "description": "StateVarInitFromFunction.z4 (tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol#17) is set pre-construction with a non-constant function or state variable:\n\t- z3 + 5\n", + "markdown": "[StateVarInitFromFunction.z4](tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol#L17) is set pre-construction with a non-constant function or state variable:\n\t- z3 + 5\n", + "id": "8b7eb9ab16397c2f23479d2c3043a675ab5e2b1da07e2697631812d6d7b68525", + "check": "function-init-state", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol b/tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol new file mode 100644 index 0000000000..1428cb8fee --- /dev/null +++ b/tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol @@ -0,0 +1,46 @@ +// This tests the detection of initializing a state variable using a non-constant function call or state variable. + +contract StateVarInitFromFunction { + + uint public v = set(); // should be flagged, initialized from function (sets to 77) + uint public w = 5; + uint public x = set(); // should be flagged, initialized from function (sets to 88) + + uint public y1 = 5 + get(); // should be flagged, initialized from function (in expression) + uint public y2 = (10 + (5 + get())); // should be flagged, initialized from function (in expression) + + uint public z1 = 5 + getPure(); // should not be flagged, is a pure function + uint public z2 = (10 + (5 + getPure())); // should not be flagged, is a pure function + + uint constant public c1 = 40; + uint public z3 = c1 + 5; // should not be flagged, references a constant + uint public z4 = z3 + 5; // should be flagged, uses a non-constant state variable. + + address public shouldntBeReported = address(8); // should not be flagged, not a *real* function call. + uint public constructorV; + uint public constructorX; + + constructor(){ + // By the time this code is hit, all state variable initialization has completed. + constructorV = v; + constructorX = x; + } + + function set() public returns(uint) { + // If this function is being used to initialize a state variable before w, w will be zero. + // If it is declared after w, w will be set. + if(w == 0) { + return 77; + } + + return 88; + } + + function get() public returns(uint) { + return 55; + } + + function getPure() public pure returns(uint) { + return 55; + } +} \ No newline at end of file diff --git a/tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol.0.7.6.FunctionInitializedState.json b/tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol.0.7.6.FunctionInitializedState.json new file mode 100644 index 0000000000..a34b2f854b --- /dev/null +++ b/tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol.0.7.6.FunctionInitializedState.json @@ -0,0 +1,464 @@ +[ + [ + { + "elements": [ + { + "type": "variable", + "name": "v", + "source_mapping": { + "start": 157, + "length": 21, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 5 + ], + "starting_column": 5, + "ending_column": 26 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "StateVarInitFromFunction", + "source_mapping": { + "start": 116, + "length": 1567, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47 + ], + "starting_column": 1, + "ending_column": 0 + } + } + } + } + ], + "description": "StateVarInitFromFunction.v (tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol#5) is set pre-construction with a non-constant function or state variable:\n\t- set()\n", + "markdown": "[StateVarInitFromFunction.v](tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol#L5) is set pre-construction with a non-constant function or state variable:\n\t- set()\n", + "id": "4b87ea4c0a3b72be79ffde12c56c9dc7440445b79ff4b228e0937b3a05540e4b", + "check": "function-init-state", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "x", + "source_mapping": { + "start": 268, + "length": 21, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 7 + ], + "starting_column": 5, + "ending_column": 26 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "StateVarInitFromFunction", + "source_mapping": { + "start": 116, + "length": 1567, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47 + ], + "starting_column": 1, + "ending_column": 0 + } + } + } + } + ], + "description": "StateVarInitFromFunction.x (tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol#7) is set pre-construction with a non-constant function or state variable:\n\t- set()\n", + "markdown": "[StateVarInitFromFunction.x](tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol#L7) is set pre-construction with a non-constant function or state variable:\n\t- set()\n", + "id": "adfa394934c8669a556cfa10c364fe526dd1e295a63959e1e88fe84a919ef354", + "check": "function-init-state", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "y1", + "source_mapping": { + "start": 357, + "length": 26, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 9 + ], + "starting_column": 5, + "ending_column": 31 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "StateVarInitFromFunction", + "source_mapping": { + "start": 116, + "length": 1567, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47 + ], + "starting_column": 1, + "ending_column": 0 + } + } + } + } + ], + "description": "StateVarInitFromFunction.y1 (tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol#9) is set pre-construction with a non-constant function or state variable:\n\t- 5 + get()\n", + "markdown": "[StateVarInitFromFunction.y1](tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol#L9) is set pre-construction with a non-constant function or state variable:\n\t- 5 + get()\n", + "id": "b26f83c06e9aca87637dea02a0f4080fd4226c1ed90c6c2c63da85cb142d67ab", + "check": "function-init-state", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "y2", + "source_mapping": { + "start": 453, + "length": 35, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 5, + "ending_column": 40 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "StateVarInitFromFunction", + "source_mapping": { + "start": 116, + "length": 1567, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47 + ], + "starting_column": 1, + "ending_column": 0 + } + } + } + } + ], + "description": "StateVarInitFromFunction.y2 (tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol#10) is set pre-construction with a non-constant function or state variable:\n\t- (10 + (5 + get()))\n", + "markdown": "[StateVarInitFromFunction.y2](tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol#L10) is set pre-construction with a non-constant function or state variable:\n\t- (10 + (5 + get()))\n", + "id": "b6e231b9b735794e00b73dddb86b2ba8f7a738d916c99f302fb32b1095c67472", + "check": "function-init-state", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "z4", + "source_mapping": { + "start": 842, + "length": 23, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 17 + ], + "starting_column": 5, + "ending_column": 28 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "StateVarInitFromFunction", + "source_mapping": { + "start": 116, + "length": 1567, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47 + ], + "starting_column": 1, + "ending_column": 0 + } + } + } + } + ], + "description": "StateVarInitFromFunction.z4 (tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol#17) is set pre-construction with a non-constant function or state variable:\n\t- z3 + 5\n", + "markdown": "[StateVarInitFromFunction.z4](tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol#L17) is set pre-construction with a non-constant function or state variable:\n\t- z3 + 5\n", + "id": "8b7eb9ab16397c2f23479d2c3043a675ab5e2b1da07e2697631812d6d7b68525", + "check": "function-init-state", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/incorrect-equality/incorrect_equality.sol b/tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol similarity index 100% rename from tests/detectors/incorrect-equality/incorrect_equality.sol rename to tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol diff --git a/tests/detectors/incorrect-equality/incorrect_equality.sol.0.5.1.IncorrectStrictEquality.json b/tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol.0.4.25.IncorrectStrictEquality.json similarity index 89% rename from tests/detectors/incorrect-equality/incorrect_equality.sol.0.5.1.IncorrectStrictEquality.json rename to tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol.0.4.25.IncorrectStrictEquality.json index 3f651bcb31..a0290b0a26 100644 --- a/tests/detectors/incorrect-equality/incorrect_equality.sol.0.5.1.IncorrectStrictEquality.json +++ b/tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol.0.4.25.IncorrectStrictEquality.json @@ -9,9 +9,9 @@ "start": 404, "length": 101, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 21, @@ -29,9 +29,9 @@ "start": 165, "length": 445, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 10, @@ -68,9 +68,9 @@ "start": 455, "length": 43, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 22 @@ -86,9 +86,9 @@ "start": 404, "length": 101, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 21, @@ -106,9 +106,9 @@ "start": 165, "length": 445, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 10, @@ -141,9 +141,9 @@ } } ], - "description": "ERC20TestBalance.bad0(ERC20Function) (tests/detectors/incorrect-equality/incorrect_equality.sol#21-23) uses a dangerous strict equality:\n\t- require(bool)(erc.balanceOf(address(this)) == 10) (tests/detectors/incorrect-equality/incorrect_equality.sol#22)\n", - "markdown": "[ERC20TestBalance.bad0(ERC20Function)](tests/detectors/incorrect-equality/incorrect_equality.sol#L21-L23) uses a dangerous strict equality:\n\t- [require(bool)(erc.balanceOf(address(this)) == 10)](tests/detectors/incorrect-equality/incorrect_equality.sol#L22)\n", - "id": "294a51197ec2777645430044c421cfe296f6407dd6bc867cd4420397548ac6a0", + "description": "ERC20TestBalance.bad0(ERC20Function) (tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#21-23) uses a dangerous strict equality:\n\t- require(bool)(erc.balanceOf(address(this)) == 10) (tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#22)\n", + "markdown": "[ERC20TestBalance.bad0(ERC20Function)](tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#L21-L23) uses a dangerous strict equality:\n\t- [require(bool)(erc.balanceOf(address(this)) == 10)](tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#L22)\n", + "id": "d887566c310fa756ee60c8a838f09bf3165adda30dff76b4d8f7bd85f6561610", "check": "incorrect-equality", "impact": "Medium", "confidence": "High" @@ -157,9 +157,9 @@ "start": 511, "length": 97, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 25, @@ -177,9 +177,9 @@ "start": 165, "length": 445, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 10, @@ -216,9 +216,9 @@ "start": 562, "length": 39, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 26 @@ -234,9 +234,9 @@ "start": 511, "length": 97, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 25, @@ -254,9 +254,9 @@ "start": 165, "length": 445, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 10, @@ -289,9 +289,9 @@ } } ], - "description": "ERC20TestBalance.bad1(ERC20Variable) (tests/detectors/incorrect-equality/incorrect_equality.sol#25-27) uses a dangerous strict equality:\n\t- require(bool)(erc.balanceOf(msg.sender) == 10) (tests/detectors/incorrect-equality/incorrect_equality.sol#26)\n", - "markdown": "[ERC20TestBalance.bad1(ERC20Variable)](tests/detectors/incorrect-equality/incorrect_equality.sol#L25-L27) uses a dangerous strict equality:\n\t- [require(bool)(erc.balanceOf(msg.sender) == 10)](tests/detectors/incorrect-equality/incorrect_equality.sol#L26)\n", - "id": "640263d06fa2e0c7166f3e674530f15e8742bf273f242187fbb82ad0e609b4ab", + "description": "ERC20TestBalance.bad1(ERC20Variable) (tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#25-27) uses a dangerous strict equality:\n\t- require(bool)(erc.balanceOf(msg.sender) == 10) (tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#26)\n", + "markdown": "[ERC20TestBalance.bad1(ERC20Variable)](tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#L25-L27) uses a dangerous strict equality:\n\t- [require(bool)(erc.balanceOf(msg.sender) == 10)](tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#L26)\n", + "id": "a962a2c49344b2acce83236c339daa07cce98d240dd8869bb7d8c5e96d412ff0", "check": "incorrect-equality", "impact": "Medium", "confidence": "High" @@ -305,9 +305,9 @@ "start": 648, "length": 133, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 32, @@ -326,9 +326,9 @@ "start": 612, "length": 1754, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 30, @@ -414,9 +414,9 @@ "start": 683, "length": 51, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 33 @@ -432,9 +432,9 @@ "start": 648, "length": 133, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 32, @@ -453,9 +453,9 @@ "start": 612, "length": 1754, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 30, @@ -537,9 +537,9 @@ } } ], - "description": "TestContractBalance.bad0() (tests/detectors/incorrect-equality/incorrect_equality.sol#32-35) uses a dangerous strict equality:\n\t- require(bool)(address(address(this)).balance == 10000000000000000000) (tests/detectors/incorrect-equality/incorrect_equality.sol#33)\n", - "markdown": "[TestContractBalance.bad0()](tests/detectors/incorrect-equality/incorrect_equality.sol#L32-L35) uses a dangerous strict equality:\n\t- [require(bool)(address(address(this)).balance == 10000000000000000000)](tests/detectors/incorrect-equality/incorrect_equality.sol#L33)\n", - "id": "b0f68fc1884acee397d2f83064b7a096d432f82b6dad75efd852eb4cfc58c3e1", + "description": "TestContractBalance.bad0() (tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#32-35) uses a dangerous strict equality:\n\t- require(bool)(address(address(this)).balance == 10000000000000000000) (tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#33)\n", + "markdown": "[TestContractBalance.bad0()](tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#L32-L35) uses a dangerous strict equality:\n\t- [require(bool)(address(address(this)).balance == 10000000000000000000)](tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#L33)\n", + "id": "126f956451cb4dcbdac6edb66148b23eabc789962d4fa3a8bd22a682c6c5bfd4", "check": "incorrect-equality", "impact": "Medium", "confidence": "High" @@ -553,9 +553,9 @@ "start": 787, "length": 133, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 37, @@ -574,9 +574,9 @@ "start": 612, "length": 1754, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 30, @@ -662,9 +662,9 @@ "start": 822, "length": 51, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 38 @@ -680,9 +680,9 @@ "start": 787, "length": 133, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 37, @@ -701,9 +701,9 @@ "start": 612, "length": 1754, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 30, @@ -785,9 +785,9 @@ } } ], - "description": "TestContractBalance.bad1() (tests/detectors/incorrect-equality/incorrect_equality.sol#37-40) uses a dangerous strict equality:\n\t- require(bool)(10000000000000000000 == address(address(this)).balance) (tests/detectors/incorrect-equality/incorrect_equality.sol#38)\n", - "markdown": "[TestContractBalance.bad1()](tests/detectors/incorrect-equality/incorrect_equality.sol#L37-L40) uses a dangerous strict equality:\n\t- [require(bool)(10000000000000000000 == address(address(this)).balance)](tests/detectors/incorrect-equality/incorrect_equality.sol#L38)\n", - "id": "448f29d6485c6cd2719c07c9152520610973e1be01c8b99cb6dc7c2d857aeb42", + "description": "TestContractBalance.bad1() (tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#37-40) uses a dangerous strict equality:\n\t- require(bool)(10000000000000000000 == address(address(this)).balance) (tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#38)\n", + "markdown": "[TestContractBalance.bad1()](tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#L37-L40) uses a dangerous strict equality:\n\t- [require(bool)(10000000000000000000 == address(address(this)).balance)](tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#L38)\n", + "id": "de67d7a1010855e47722500e73f1156c1c2c222414e661624300ea395102af1a", "check": "incorrect-equality", "impact": "Medium", "confidence": "High" @@ -801,9 +801,9 @@ "start": 926, "length": 124, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 42, @@ -822,9 +822,9 @@ "start": 612, "length": 1754, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 30, @@ -910,9 +910,9 @@ "start": 961, "length": 42, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 43 @@ -928,9 +928,9 @@ "start": 926, "length": 124, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 42, @@ -949,9 +949,9 @@ "start": 612, "length": 1754, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 30, @@ -1033,9 +1033,9 @@ } } ], - "description": "TestContractBalance.bad2() (tests/detectors/incorrect-equality/incorrect_equality.sol#42-45) uses a dangerous strict equality:\n\t- require(bool)(address(this).balance == 10000000000000000000) (tests/detectors/incorrect-equality/incorrect_equality.sol#43)\n", - "markdown": "[TestContractBalance.bad2()](tests/detectors/incorrect-equality/incorrect_equality.sol#L42-L45) uses a dangerous strict equality:\n\t- [require(bool)(address(this).balance == 10000000000000000000)](tests/detectors/incorrect-equality/incorrect_equality.sol#L43)\n", - "id": "8fd870cb63ea7244cabccdce377d3ab3d7821e47c1cd1db26ec67d1a0ead433f", + "description": "TestContractBalance.bad2() (tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#42-45) uses a dangerous strict equality:\n\t- require(bool)(address(this).balance == 10000000000000000000) (tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#43)\n", + "markdown": "[TestContractBalance.bad2()](tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#L42-L45) uses a dangerous strict equality:\n\t- [require(bool)(address(this).balance == 10000000000000000000)](tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#L43)\n", + "id": "b6c0963403d985cfcd3eda6d43bc2716eaebcd0d936d9a57d35df4adfbb01e46", "check": "incorrect-equality", "impact": "Medium", "confidence": "High" @@ -1049,9 +1049,9 @@ "start": 1056, "length": 124, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 47, @@ -1070,9 +1070,9 @@ "start": 612, "length": 1754, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 30, @@ -1158,9 +1158,9 @@ "start": 1091, "length": 42, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 48 @@ -1176,9 +1176,9 @@ "start": 1056, "length": 124, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 47, @@ -1197,9 +1197,9 @@ "start": 612, "length": 1754, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 30, @@ -1281,9 +1281,9 @@ } } ], - "description": "TestContractBalance.bad3() (tests/detectors/incorrect-equality/incorrect_equality.sol#47-50) uses a dangerous strict equality:\n\t- require(bool)(10000000000000000000 == address(this).balance) (tests/detectors/incorrect-equality/incorrect_equality.sol#48)\n", - "markdown": "[TestContractBalance.bad3()](tests/detectors/incorrect-equality/incorrect_equality.sol#L47-L50) uses a dangerous strict equality:\n\t- [require(bool)(10000000000000000000 == address(this).balance)](tests/detectors/incorrect-equality/incorrect_equality.sol#L48)\n", - "id": "e66548a0ff1d43d4fdc9eff9d88483b677cd5147c38618d8d10db3a212daf801", + "description": "TestContractBalance.bad3() (tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#47-50) uses a dangerous strict equality:\n\t- require(bool)(10000000000000000000 == address(this).balance) (tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#48)\n", + "markdown": "[TestContractBalance.bad3()](tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#L47-L50) uses a dangerous strict equality:\n\t- [require(bool)(10000000000000000000 == address(this).balance)](tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#L48)\n", + "id": "8f08cca8ee4d2d51c2bf5717f78aa1dd13c6499e430a43b89e5309f20920b11d", "check": "incorrect-equality", "impact": "Medium", "confidence": "High" @@ -1297,9 +1297,9 @@ "start": 1186, "length": 170, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 52, @@ -1320,9 +1320,9 @@ "start": 612, "length": 1754, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 30, @@ -1408,9 +1408,9 @@ "start": 1274, "length": 19, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 54 @@ -1426,9 +1426,9 @@ "start": 1186, "length": 170, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 52, @@ -1449,9 +1449,9 @@ "start": 612, "length": 1754, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 30, @@ -1533,9 +1533,9 @@ } } ], - "description": "TestContractBalance.bad4() (tests/detectors/incorrect-equality/incorrect_equality.sol#52-57) uses a dangerous strict equality:\n\t- balance == 10000000000000000000 (tests/detectors/incorrect-equality/incorrect_equality.sol#54)\n", - "markdown": "[TestContractBalance.bad4()](tests/detectors/incorrect-equality/incorrect_equality.sol#L52-L57) uses a dangerous strict equality:\n\t- [balance == 10000000000000000000](tests/detectors/incorrect-equality/incorrect_equality.sol#L54)\n", - "id": "feb30557490c10419bfd41c37e25f98d8927a1831f8e58da24b2c327e622d410", + "description": "TestContractBalance.bad4() (tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#52-57) uses a dangerous strict equality:\n\t- balance == 10000000000000000000 (tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#54)\n", + "markdown": "[TestContractBalance.bad4()](tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#L52-L57) uses a dangerous strict equality:\n\t- [balance == 10000000000000000000](tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#L54)\n", + "id": "b7b40be64de7150ba57e0f2b6379c672ee431675bbab8b607a82acdd29338d42", "check": "incorrect-equality", "impact": "Medium", "confidence": "High" @@ -1549,9 +1549,9 @@ "start": 1362, "length": 170, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 59, @@ -1572,9 +1572,9 @@ "start": 612, "length": 1754, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 30, @@ -1660,9 +1660,9 @@ "start": 1450, "length": 19, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 61 @@ -1678,9 +1678,9 @@ "start": 1362, "length": 170, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 59, @@ -1701,9 +1701,9 @@ "start": 612, "length": 1754, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 30, @@ -1785,9 +1785,9 @@ } } ], - "description": "TestContractBalance.bad5() (tests/detectors/incorrect-equality/incorrect_equality.sol#59-64) uses a dangerous strict equality:\n\t- 10000000000000000000 == balance (tests/detectors/incorrect-equality/incorrect_equality.sol#61)\n", - "markdown": "[TestContractBalance.bad5()](tests/detectors/incorrect-equality/incorrect_equality.sol#L59-L64) uses a dangerous strict equality:\n\t- [10000000000000000000 == balance](tests/detectors/incorrect-equality/incorrect_equality.sol#L61)\n", - "id": "ef5acc7638533a4c3851662c1a1deb26737ee655c997bd66609e5f8f44450537", + "description": "TestContractBalance.bad5() (tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#59-64) uses a dangerous strict equality:\n\t- 10000000000000000000 == balance (tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#61)\n", + "markdown": "[TestContractBalance.bad5()](tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#L59-L64) uses a dangerous strict equality:\n\t- [10000000000000000000 == balance](tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#L61)\n", + "id": "781645f52e6eb4c7a0e38a58537907a6421ded2703ae8b18be68251a02901e7a", "check": "incorrect-equality", "impact": "Medium", "confidence": "High" @@ -1801,9 +1801,9 @@ "start": 1538, "length": 179, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 66, @@ -1824,9 +1824,9 @@ "start": 612, "length": 1754, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 30, @@ -1912,9 +1912,9 @@ "start": 1635, "length": 19, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 68 @@ -1930,9 +1930,9 @@ "start": 1538, "length": 179, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 66, @@ -1953,9 +1953,9 @@ "start": 612, "length": 1754, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 30, @@ -2037,9 +2037,9 @@ } } ], - "description": "TestContractBalance.bad6() (tests/detectors/incorrect-equality/incorrect_equality.sol#66-71) uses a dangerous strict equality:\n\t- balance == 10000000000000000000 (tests/detectors/incorrect-equality/incorrect_equality.sol#68)\n", - "markdown": "[TestContractBalance.bad6()](tests/detectors/incorrect-equality/incorrect_equality.sol#L66-L71) uses a dangerous strict equality:\n\t- [balance == 10000000000000000000](tests/detectors/incorrect-equality/incorrect_equality.sol#L68)\n", - "id": "5515950c15517f81d4973f0937db8199d9515c3ef5cc8f4e2459a1f5f2b10519", + "description": "TestContractBalance.bad6() (tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#66-71) uses a dangerous strict equality:\n\t- balance == 10000000000000000000 (tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#68)\n", + "markdown": "[TestContractBalance.bad6()](tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#L66-L71) uses a dangerous strict equality:\n\t- [balance == 10000000000000000000](tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#L68)\n", + "id": "2cc246058513fdfe2178c6e9b552bcae42d3c29bc104c3b95734323aeda57396", "check": "incorrect-equality", "impact": "Medium", "confidence": "High" @@ -2053,9 +2053,9 @@ "start": 2935, "length": 59, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 123, @@ -2073,9 +2073,9 @@ "start": 2368, "length": 774, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 99, @@ -2130,9 +2130,9 @@ "start": 2969, "length": 18, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 124 @@ -2148,9 +2148,9 @@ "start": 2935, "length": 59, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 123, @@ -2168,9 +2168,9 @@ "start": 2368, "length": 774, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 99, @@ -2221,9 +2221,9 @@ } } ], - "description": "TestSolidityKeyword.bad0() (tests/detectors/incorrect-equality/incorrect_equality.sol#123-125) uses a dangerous strict equality:\n\t- require(bool)(now == 0) (tests/detectors/incorrect-equality/incorrect_equality.sol#124)\n", - "markdown": "[TestSolidityKeyword.bad0()](tests/detectors/incorrect-equality/incorrect_equality.sol#L123-L125) uses a dangerous strict equality:\n\t- [require(bool)(now == 0)](tests/detectors/incorrect-equality/incorrect_equality.sol#L124)\n", - "id": "3c0287d7827cffc855ee2366a85204a9840c570f3df2a946ee8fef4ae7020f67", + "description": "TestSolidityKeyword.bad0() (tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#123-125) uses a dangerous strict equality:\n\t- require(bool)(now == 0) (tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#124)\n", + "markdown": "[TestSolidityKeyword.bad0()](tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#L123-L125) uses a dangerous strict equality:\n\t- [require(bool)(now == 0)](tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#L124)\n", + "id": "abcb113fde0b01cb4a653968a235bf5f3ee70a6f97ae3fa68c3a161c8ca5f6b8", "check": "incorrect-equality", "impact": "Medium", "confidence": "High" @@ -2237,9 +2237,9 @@ "start": 3000, "length": 66, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 127, @@ -2257,9 +2257,9 @@ "start": 2368, "length": 774, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 99, @@ -2314,9 +2314,9 @@ "start": 3034, "length": 25, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 128 @@ -2332,9 +2332,9 @@ "start": 3000, "length": 66, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 127, @@ -2352,9 +2352,9 @@ "start": 2368, "length": 774, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 99, @@ -2405,9 +2405,9 @@ } } ], - "description": "TestSolidityKeyword.bad1() (tests/detectors/incorrect-equality/incorrect_equality.sol#127-129) uses a dangerous strict equality:\n\t- require(bool)(block.number == 0) (tests/detectors/incorrect-equality/incorrect_equality.sol#128)\n", - "markdown": "[TestSolidityKeyword.bad1()](tests/detectors/incorrect-equality/incorrect_equality.sol#L127-L129) uses a dangerous strict equality:\n\t- [require(bool)(block.number == 0)](tests/detectors/incorrect-equality/incorrect_equality.sol#L128)\n", - "id": "ad2bdecc821ce70ea7719cb08115739f7c2dfa5d78588b928dc6c41498c3b94f", + "description": "TestSolidityKeyword.bad1() (tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#127-129) uses a dangerous strict equality:\n\t- require(bool)(block.number == 0) (tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#128)\n", + "markdown": "[TestSolidityKeyword.bad1()](tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#L127-L129) uses a dangerous strict equality:\n\t- [require(bool)(block.number == 0)](tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#L128)\n", + "id": "d17755463242fbfeef570c2504ff13729a74d8633ade693da26127635b145892", "check": "incorrect-equality", "impact": "Medium", "confidence": "High" @@ -2421,9 +2421,9 @@ "start": 3072, "length": 67, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 131, @@ -2441,9 +2441,9 @@ "start": 2368, "length": 774, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 99, @@ -2498,9 +2498,9 @@ "start": 3106, "length": 26, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 132 @@ -2516,9 +2516,9 @@ "start": 3072, "length": 67, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 131, @@ -2536,9 +2536,9 @@ "start": 2368, "length": 774, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_relative": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-equality/incorrect_equality.sol", + "filename_short": "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", "is_dependency": false, "lines": [ 99, @@ -2589,9 +2589,9 @@ } } ], - "description": "TestSolidityKeyword.bad2() (tests/detectors/incorrect-equality/incorrect_equality.sol#131-133) uses a dangerous strict equality:\n\t- require(bool)(block.number == 0) (tests/detectors/incorrect-equality/incorrect_equality.sol#132)\n", - "markdown": "[TestSolidityKeyword.bad2()](tests/detectors/incorrect-equality/incorrect_equality.sol#L131-L133) uses a dangerous strict equality:\n\t- [require(bool)(block.number == 0)](tests/detectors/incorrect-equality/incorrect_equality.sol#L132)\n", - "id": "7f5d37ef2678b64eb2b3a0745a348e7571b58afac6a3037430c23c7b5d4c5422", + "description": "TestSolidityKeyword.bad2() (tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#131-133) uses a dangerous strict equality:\n\t- require(bool)(block.number == 0) (tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#132)\n", + "markdown": "[TestSolidityKeyword.bad2()](tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#L131-L133) uses a dangerous strict equality:\n\t- [require(bool)(block.number == 0)](tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol#L132)\n", + "id": "a65d9228ffbebf6de7f455df00a0de91ee0e23c7f13a306bdc90e16e69a043b3", "check": "incorrect-equality", "impact": "Medium", "confidence": "High" diff --git a/tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol b/tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol new file mode 100644 index 0000000000..d37d0663da --- /dev/null +++ b/tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol @@ -0,0 +1,136 @@ +contract ERC20Function{ + function balanceOf(address _owner) external returns(uint); +} + +contract ERC20Variable{ + mapping(address => uint) public balanceOf; +} + + +contract ERC20TestBalance{ + + + function good0(ERC20Function erc) external{ + require(erc.balanceOf(msg.sender) > 0); + } + + function good1(ERC20Variable erc) external{ + require(erc.balanceOf(msg.sender) > 0); + } + + function bad0(ERC20Function erc) external{ + require(erc.balanceOf(address(this)) == 10); + } + + function bad1(ERC20Variable erc) external{ + require(erc.balanceOf(msg.sender) ==10); + } +} + +contract TestContractBalance { + + function bad0() external { + require(address(address(this)).balance == 10 ether); + msg.sender.transfer(0.1 ether); + } + + function bad1() external { + require(10 ether == address(address(this)).balance); + msg.sender.transfer(0.1 ether); + } + + function bad2() external { + require(address(this).balance == 10 ether); + msg.sender.transfer(0.1 ether); + } + + function bad3() external { + require(10 ether == address(this).balance); + msg.sender.transfer(0.1 ether); + } + + function bad4() external { + uint256 balance = address(this).balance; + if (balance == 10 ether) { + msg.sender.transfer(0.1 ether); + } + } + + function bad5() external { + uint256 balance = address(this).balance; + if (10 ether == balance) { + msg.sender.transfer(0.1 ether); + } + } + + function bad6() external { + uint256 balance = address(address(this)).balance; + if (balance == 10 ether) { + msg.sender.transfer(0.1 ether); + } + } + + function myfunc(uint256 balance) pure internal returns (uint256) { + return balance - balance; + } + + function good1() external { + require (address(address(this)).balance >= 10 ether); + msg.sender.transfer(0.1 ether); + } + + function good2() external { + require (10 <= address(address(this)).balance); + msg.sender.transfer(0.1 ether); + } + + function good3() external { + require (address(this).balance >= 10 ether); + msg.sender.transfer(0.1 ether); + } + + function good4() external { + require (10 <= address(this).balance); + msg.sender.transfer(0.1 ether); + } + +} + +contract TestSolidityKeyword{ + + function good0() external{ + require(now > 0); + } + + function good1() external{ + require(block.number > 0); + } + + function good2() external{ + require(block.timestamp > 0); + } + + function good3(uint param) public{ + // address(this) simulate a particular corner case + // where the SSA is better + // the naive data dependency without SSA + // will consider param and block.number to have a dep + if(param == 0){ + param = block.number; + } + } + + function bad0() external{ + require(now == 0); + } + + function bad1() external{ + require(block.number== 0); + } + + function bad2() external{ + require(block.number == 0); + } + +} + diff --git a/tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol.0.5.16.IncorrectStrictEquality.json b/tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol.0.5.16.IncorrectStrictEquality.json new file mode 100644 index 0000000000..1593cb86f3 --- /dev/null +++ b/tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol.0.5.16.IncorrectStrictEquality.json @@ -0,0 +1,2600 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 404, + "length": 101, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ERC20TestBalance", + "source_mapping": { + "start": 165, + "length": 445, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0(ERC20Function)" + } + }, + { + "type": "node", + "name": "require(bool)(erc.balanceOf(address(this)) == 10)", + "source_mapping": { + "start": 455, + "length": 43, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 22 + ], + "starting_column": 9, + "ending_column": 52 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 404, + "length": 101, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ERC20TestBalance", + "source_mapping": { + "start": 165, + "length": 445, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0(ERC20Function)" + } + } + } + } + ], + "description": "ERC20TestBalance.bad0(ERC20Function) (tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#21-23) uses a dangerous strict equality:\n\t- require(bool)(erc.balanceOf(address(this)) == 10) (tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#22)\n", + "markdown": "[ERC20TestBalance.bad0(ERC20Function)](tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#L21-L23) uses a dangerous strict equality:\n\t- [require(bool)(erc.balanceOf(address(this)) == 10)](tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#L22)\n", + "id": "f1b10c19ed186a854e281f6b2f29e08d5da8892045a928b0565355802998088a", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 511, + "length": 97, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 25, + 26, + 27 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ERC20TestBalance", + "source_mapping": { + "start": 165, + "length": 445, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(ERC20Variable)" + } + }, + { + "type": "node", + "name": "require(bool)(erc.balanceOf(msg.sender) == 10)", + "source_mapping": { + "start": 562, + "length": 39, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 26 + ], + "starting_column": 9, + "ending_column": 48 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 511, + "length": 97, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 25, + 26, + 27 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ERC20TestBalance", + "source_mapping": { + "start": 165, + "length": 445, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(ERC20Variable)" + } + } + } + } + ], + "description": "ERC20TestBalance.bad1(ERC20Variable) (tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#25-27) uses a dangerous strict equality:\n\t- require(bool)(erc.balanceOf(msg.sender) == 10) (tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#26)\n", + "markdown": "[ERC20TestBalance.bad1(ERC20Variable)](tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#L25-L27) uses a dangerous strict equality:\n\t- [require(bool)(erc.balanceOf(msg.sender) == 10)](tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#L26)\n", + "id": "43d01e301a135af4627eded0afd320a3cc986834dcd0c77ccec4d85e7ac05b57", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 648, + "length": 133, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 32, + 33, + 34, + 35 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 612, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + }, + { + "type": "node", + "name": "require(bool)(address(address(this)).balance == 10000000000000000000)", + "source_mapping": { + "start": 683, + "length": 51, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 33 + ], + "starting_column": 9, + "ending_column": 60 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 648, + "length": 133, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 32, + 33, + 34, + 35 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 612, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + } + } + ], + "description": "TestContractBalance.bad0() (tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#32-35) uses a dangerous strict equality:\n\t- require(bool)(address(address(this)).balance == 10000000000000000000) (tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#33)\n", + "markdown": "[TestContractBalance.bad0()](tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#L32-L35) uses a dangerous strict equality:\n\t- [require(bool)(address(address(this)).balance == 10000000000000000000)](tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#L33)\n", + "id": "d00ea5300293e9fe66a52421f56fbb2e48ba4ba942f1d8845e3c2e5bfbbbe66f", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 787, + "length": 133, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 37, + 38, + 39, + 40 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 612, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1()" + } + }, + { + "type": "node", + "name": "require(bool)(10000000000000000000 == address(address(this)).balance)", + "source_mapping": { + "start": 822, + "length": 51, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 38 + ], + "starting_column": 9, + "ending_column": 60 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 787, + "length": 133, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 37, + 38, + 39, + 40 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 612, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1()" + } + } + } + } + ], + "description": "TestContractBalance.bad1() (tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#37-40) uses a dangerous strict equality:\n\t- require(bool)(10000000000000000000 == address(address(this)).balance) (tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#38)\n", + "markdown": "[TestContractBalance.bad1()](tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#L37-L40) uses a dangerous strict equality:\n\t- [require(bool)(10000000000000000000 == address(address(this)).balance)](tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#L38)\n", + "id": "aee531d35272d761a573246a7f901716f6d1aa6906a0eab19bee4f6f570eb166", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 926, + "length": 124, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 42, + 43, + 44, + 45 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 612, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + }, + { + "type": "node", + "name": "require(bool)(address(this).balance == 10000000000000000000)", + "source_mapping": { + "start": 961, + "length": 42, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 43 + ], + "starting_column": 9, + "ending_column": 51 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 926, + "length": 124, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 42, + 43, + 44, + 45 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 612, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + } + } + } + ], + "description": "TestContractBalance.bad2() (tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#42-45) uses a dangerous strict equality:\n\t- require(bool)(address(this).balance == 10000000000000000000) (tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#43)\n", + "markdown": "[TestContractBalance.bad2()](tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#L42-L45) uses a dangerous strict equality:\n\t- [require(bool)(address(this).balance == 10000000000000000000)](tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#L43)\n", + "id": "7d0195ec395960b56eb4249c96481aec69f59da34ea15128734721ff1844d469", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad3", + "source_mapping": { + "start": 1056, + "length": 124, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 47, + 48, + 49, + 50 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 612, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad3()" + } + }, + { + "type": "node", + "name": "require(bool)(10000000000000000000 == address(this).balance)", + "source_mapping": { + "start": 1091, + "length": 42, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 48 + ], + "starting_column": 9, + "ending_column": 51 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad3", + "source_mapping": { + "start": 1056, + "length": 124, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 47, + 48, + 49, + 50 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 612, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad3()" + } + } + } + } + ], + "description": "TestContractBalance.bad3() (tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#47-50) uses a dangerous strict equality:\n\t- require(bool)(10000000000000000000 == address(this).balance) (tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#48)\n", + "markdown": "[TestContractBalance.bad3()](tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#L47-L50) uses a dangerous strict equality:\n\t- [require(bool)(10000000000000000000 == address(this).balance)](tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#L48)\n", + "id": "a987ef061c48551aeeb83ad7556a7d00d13d4dc5fade167c6dc6d586738bda14", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad4", + "source_mapping": { + "start": 1186, + "length": 170, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 52, + 53, + 54, + 55, + 56, + 57 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 612, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad4()" + } + }, + { + "type": "node", + "name": "balance == 10000000000000000000", + "source_mapping": { + "start": 1274, + "length": 19, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 54 + ], + "starting_column": 13, + "ending_column": 32 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad4", + "source_mapping": { + "start": 1186, + "length": 170, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 52, + 53, + 54, + 55, + 56, + 57 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 612, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad4()" + } + } + } + } + ], + "description": "TestContractBalance.bad4() (tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#52-57) uses a dangerous strict equality:\n\t- balance == 10000000000000000000 (tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#54)\n", + "markdown": "[TestContractBalance.bad4()](tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#L52-L57) uses a dangerous strict equality:\n\t- [balance == 10000000000000000000](tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#L54)\n", + "id": "7d7ebf1738fffe12204ace79edbf67edb9962c03af58dbb9fa9c133d711eaa38", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad5", + "source_mapping": { + "start": 1362, + "length": 170, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 59, + 60, + 61, + 62, + 63, + 64 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 612, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad5()" + } + }, + { + "type": "node", + "name": "10000000000000000000 == balance", + "source_mapping": { + "start": 1450, + "length": 19, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 61 + ], + "starting_column": 13, + "ending_column": 32 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad5", + "source_mapping": { + "start": 1362, + "length": 170, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 59, + 60, + 61, + 62, + 63, + 64 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 612, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad5()" + } + } + } + } + ], + "description": "TestContractBalance.bad5() (tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#59-64) uses a dangerous strict equality:\n\t- 10000000000000000000 == balance (tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#61)\n", + "markdown": "[TestContractBalance.bad5()](tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#L59-L64) uses a dangerous strict equality:\n\t- [10000000000000000000 == balance](tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#L61)\n", + "id": "2fddf13889b45374114f11585944ef935efb365935aff518b505f01d4f6c1c97", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad6", + "source_mapping": { + "start": 1538, + "length": 179, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 612, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad6()" + } + }, + { + "type": "node", + "name": "balance == 10000000000000000000", + "source_mapping": { + "start": 1635, + "length": 19, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 68 + ], + "starting_column": 13, + "ending_column": 32 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad6", + "source_mapping": { + "start": 1538, + "length": 179, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 612, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad6()" + } + } + } + } + ], + "description": "TestContractBalance.bad6() (tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#66-71) uses a dangerous strict equality:\n\t- balance == 10000000000000000000 (tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#68)\n", + "markdown": "[TestContractBalance.bad6()](tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#L66-L71) uses a dangerous strict equality:\n\t- [balance == 10000000000000000000](tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#L68)\n", + "id": "280c7848636dd05a32dbdff744714307aa1350aebc6031dd862af9aeb6bdebe3", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 2935, + "length": 59, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 123, + 124, + 125 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestSolidityKeyword", + "source_mapping": { + "start": 2368, + "length": 774, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + }, + { + "type": "node", + "name": "require(bool)(now == 0)", + "source_mapping": { + "start": 2969, + "length": 18, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 124 + ], + "starting_column": 9, + "ending_column": 27 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 2935, + "length": 59, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 123, + 124, + 125 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestSolidityKeyword", + "source_mapping": { + "start": 2368, + "length": 774, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + } + } + ], + "description": "TestSolidityKeyword.bad0() (tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#123-125) uses a dangerous strict equality:\n\t- require(bool)(now == 0) (tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#124)\n", + "markdown": "[TestSolidityKeyword.bad0()](tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#L123-L125) uses a dangerous strict equality:\n\t- [require(bool)(now == 0)](tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#L124)\n", + "id": "9f08ac90026e6fb8bcd20c0ab8f967fe7680689841262bb91747d967ac2564c4", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 3000, + "length": 66, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 127, + 128, + 129 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestSolidityKeyword", + "source_mapping": { + "start": 2368, + "length": 774, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1()" + } + }, + { + "type": "node", + "name": "require(bool)(block.number == 0)", + "source_mapping": { + "start": 3034, + "length": 25, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 128 + ], + "starting_column": 9, + "ending_column": 34 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 3000, + "length": 66, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 127, + 128, + 129 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestSolidityKeyword", + "source_mapping": { + "start": 2368, + "length": 774, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1()" + } + } + } + } + ], + "description": "TestSolidityKeyword.bad1() (tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#127-129) uses a dangerous strict equality:\n\t- require(bool)(block.number == 0) (tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#128)\n", + "markdown": "[TestSolidityKeyword.bad1()](tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#L127-L129) uses a dangerous strict equality:\n\t- [require(bool)(block.number == 0)](tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#L128)\n", + "id": "27fb1eed66075f0883f327ce69bfa39000a4cc6841a39342114cb892a1a0b23b", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 3072, + "length": 67, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 131, + 132, + 133 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestSolidityKeyword", + "source_mapping": { + "start": 2368, + "length": 774, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + }, + { + "type": "node", + "name": "require(bool)(block.number == 0)", + "source_mapping": { + "start": 3106, + "length": 26, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 132 + ], + "starting_column": 9, + "ending_column": 35 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 3072, + "length": 67, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 131, + 132, + 133 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestSolidityKeyword", + "source_mapping": { + "start": 2368, + "length": 774, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + } + } + } + ], + "description": "TestSolidityKeyword.bad2() (tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#131-133) uses a dangerous strict equality:\n\t- require(bool)(block.number == 0) (tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#132)\n", + "markdown": "[TestSolidityKeyword.bad2()](tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#L131-L133) uses a dangerous strict equality:\n\t- [require(bool)(block.number == 0)](tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol#L132)\n", + "id": "9adfb849a88f90efbe4e42ae4daea709e51db6af3ae0a8bb2427d8053a832d04", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol b/tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol new file mode 100644 index 0000000000..3e9eb94bfd --- /dev/null +++ b/tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol @@ -0,0 +1,136 @@ +abstract contract ERC20Function{ + function balanceOf(address _owner) external virtual returns(uint); +} + +contract ERC20Variable{ + mapping(address => uint) public balanceOf; +} + + +contract ERC20TestBalance{ + + + function good0(ERC20Function erc) external{ + require(erc.balanceOf(msg.sender) > 0); + } + + function good1(ERC20Variable erc) external{ + require(erc.balanceOf(msg.sender) > 0); + } + + function bad0(ERC20Function erc) external{ + require(erc.balanceOf(address(this)) == 10); + } + + function bad1(ERC20Variable erc) external{ + require(erc.balanceOf(msg.sender) ==10); + } +} + +contract TestContractBalance { + + function bad0() external { + require(address(address(this)).balance == 10 ether); + msg.sender.transfer(0.1 ether); + } + + function bad1() external { + require(10 ether == address(address(this)).balance); + msg.sender.transfer(0.1 ether); + } + + function bad2() external { + require(address(this).balance == 10 ether); + msg.sender.transfer(0.1 ether); + } + + function bad3() external { + require(10 ether == address(this).balance); + msg.sender.transfer(0.1 ether); + } + + function bad4() external { + uint256 balance = address(this).balance; + if (balance == 10 ether) { + msg.sender.transfer(0.1 ether); + } + } + + function bad5() external { + uint256 balance = address(this).balance; + if (10 ether == balance) { + msg.sender.transfer(0.1 ether); + } + } + + function bad6() external { + uint256 balance = address(address(this)).balance; + if (balance == 10 ether) { + msg.sender.transfer(0.1 ether); + } + } + + function myfunc(uint256 balance) pure internal returns (uint256) { + return balance - balance; + } + + function good1() external { + require (address(address(this)).balance >= 10 ether); + msg.sender.transfer(0.1 ether); + } + + function good2() external { + require (10 <= address(address(this)).balance); + msg.sender.transfer(0.1 ether); + } + + function good3() external { + require (address(this).balance >= 10 ether); + msg.sender.transfer(0.1 ether); + } + + function good4() external { + require (10 <= address(this).balance); + msg.sender.transfer(0.1 ether); + } + +} + +contract TestSolidityKeyword{ + + function good0() external{ + require(now > 0); + } + + function good1() external{ + require(block.number > 0); + } + + function good2() external{ + require(block.timestamp > 0); + } + + function good3(uint param) public{ + // address(this) simulate a particular corner case + // where the SSA is better + // the naive data dependency without SSA + // will consider param and block.number to have a dep + if(param == 0){ + param = block.number; + } + } + + function bad0() external{ + require(now == 0); + } + + function bad1() external{ + require(block.number== 0); + } + + function bad2() external{ + require(block.number == 0); + } + +} + diff --git a/tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol.0.6.11.IncorrectStrictEquality.json b/tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol.0.6.11.IncorrectStrictEquality.json new file mode 100644 index 0000000000..2e8fb0267f --- /dev/null +++ b/tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol.0.6.11.IncorrectStrictEquality.json @@ -0,0 +1,2600 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 421, + "length": 101, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ERC20TestBalance", + "source_mapping": { + "start": 182, + "length": 445, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0(ERC20Function)" + } + }, + { + "type": "node", + "name": "require(bool)(erc.balanceOf(address(this)) == 10)", + "source_mapping": { + "start": 472, + "length": 43, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 22 + ], + "starting_column": 9, + "ending_column": 52 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 421, + "length": 101, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ERC20TestBalance", + "source_mapping": { + "start": 182, + "length": 445, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0(ERC20Function)" + } + } + } + } + ], + "description": "ERC20TestBalance.bad0(ERC20Function) (tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#21-23) uses a dangerous strict equality:\n\t- require(bool)(erc.balanceOf(address(this)) == 10) (tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#22)\n", + "markdown": "[ERC20TestBalance.bad0(ERC20Function)](tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#L21-L23) uses a dangerous strict equality:\n\t- [require(bool)(erc.balanceOf(address(this)) == 10)](tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#L22)\n", + "id": "df1ee72930fcaa7dc7a92d390be6007c57953a3392aef588a852373da388d850", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 528, + "length": 97, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 25, + 26, + 27 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ERC20TestBalance", + "source_mapping": { + "start": 182, + "length": 445, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(ERC20Variable)" + } + }, + { + "type": "node", + "name": "require(bool)(erc.balanceOf(msg.sender) == 10)", + "source_mapping": { + "start": 579, + "length": 39, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 26 + ], + "starting_column": 9, + "ending_column": 48 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 528, + "length": 97, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 25, + 26, + 27 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ERC20TestBalance", + "source_mapping": { + "start": 182, + "length": 445, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(ERC20Variable)" + } + } + } + } + ], + "description": "ERC20TestBalance.bad1(ERC20Variable) (tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#25-27) uses a dangerous strict equality:\n\t- require(bool)(erc.balanceOf(msg.sender) == 10) (tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#26)\n", + "markdown": "[ERC20TestBalance.bad1(ERC20Variable)](tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#L25-L27) uses a dangerous strict equality:\n\t- [require(bool)(erc.balanceOf(msg.sender) == 10)](tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#L26)\n", + "id": "4d1635766db4dc0687873af3c03047d746b770bcce326793c79210ac16a5c824", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 665, + "length": 133, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 32, + 33, + 34, + 35 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + }, + { + "type": "node", + "name": "require(bool)(address(address(this)).balance == 10000000000000000000)", + "source_mapping": { + "start": 700, + "length": 51, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 33 + ], + "starting_column": 9, + "ending_column": 60 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 665, + "length": 133, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 32, + 33, + 34, + 35 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + } + } + ], + "description": "TestContractBalance.bad0() (tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#32-35) uses a dangerous strict equality:\n\t- require(bool)(address(address(this)).balance == 10000000000000000000) (tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#33)\n", + "markdown": "[TestContractBalance.bad0()](tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#L32-L35) uses a dangerous strict equality:\n\t- [require(bool)(address(address(this)).balance == 10000000000000000000)](tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#L33)\n", + "id": "20756b1d1c5eb722a3edb44b8c7b2a62ca935e4e1a2491bce50856f7f4cf3f4c", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 804, + "length": 133, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 37, + 38, + 39, + 40 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1()" + } + }, + { + "type": "node", + "name": "require(bool)(10000000000000000000 == address(address(this)).balance)", + "source_mapping": { + "start": 839, + "length": 51, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 38 + ], + "starting_column": 9, + "ending_column": 60 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 804, + "length": 133, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 37, + 38, + 39, + 40 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1()" + } + } + } + } + ], + "description": "TestContractBalance.bad1() (tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#37-40) uses a dangerous strict equality:\n\t- require(bool)(10000000000000000000 == address(address(this)).balance) (tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#38)\n", + "markdown": "[TestContractBalance.bad1()](tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#L37-L40) uses a dangerous strict equality:\n\t- [require(bool)(10000000000000000000 == address(address(this)).balance)](tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#L38)\n", + "id": "9363dbd2bb3f41b42351b088f7a973902e04ccae0081e5c99354de90890fe6ab", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 943, + "length": 124, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 42, + 43, + 44, + 45 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + }, + { + "type": "node", + "name": "require(bool)(address(this).balance == 10000000000000000000)", + "source_mapping": { + "start": 978, + "length": 42, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 43 + ], + "starting_column": 9, + "ending_column": 51 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 943, + "length": 124, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 42, + 43, + 44, + 45 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + } + } + } + ], + "description": "TestContractBalance.bad2() (tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#42-45) uses a dangerous strict equality:\n\t- require(bool)(address(this).balance == 10000000000000000000) (tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#43)\n", + "markdown": "[TestContractBalance.bad2()](tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#L42-L45) uses a dangerous strict equality:\n\t- [require(bool)(address(this).balance == 10000000000000000000)](tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#L43)\n", + "id": "50ab6a747d027b81a24ae04b84e6362bd184a5f23080e2af1b6a859ee144f637", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad3", + "source_mapping": { + "start": 1073, + "length": 124, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 47, + 48, + 49, + 50 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad3()" + } + }, + { + "type": "node", + "name": "require(bool)(10000000000000000000 == address(this).balance)", + "source_mapping": { + "start": 1108, + "length": 42, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 48 + ], + "starting_column": 9, + "ending_column": 51 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad3", + "source_mapping": { + "start": 1073, + "length": 124, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 47, + 48, + 49, + 50 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad3()" + } + } + } + } + ], + "description": "TestContractBalance.bad3() (tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#47-50) uses a dangerous strict equality:\n\t- require(bool)(10000000000000000000 == address(this).balance) (tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#48)\n", + "markdown": "[TestContractBalance.bad3()](tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#L47-L50) uses a dangerous strict equality:\n\t- [require(bool)(10000000000000000000 == address(this).balance)](tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#L48)\n", + "id": "3cf7fef3822d0628cc1f441162960a6753d6cdcad5b8c56c84584dba741e806b", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad4", + "source_mapping": { + "start": 1203, + "length": 170, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 52, + 53, + 54, + 55, + 56, + 57 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad4()" + } + }, + { + "type": "node", + "name": "balance == 10000000000000000000", + "source_mapping": { + "start": 1291, + "length": 19, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 54 + ], + "starting_column": 13, + "ending_column": 32 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad4", + "source_mapping": { + "start": 1203, + "length": 170, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 52, + 53, + 54, + 55, + 56, + 57 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad4()" + } + } + } + } + ], + "description": "TestContractBalance.bad4() (tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#52-57) uses a dangerous strict equality:\n\t- balance == 10000000000000000000 (tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#54)\n", + "markdown": "[TestContractBalance.bad4()](tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#L52-L57) uses a dangerous strict equality:\n\t- [balance == 10000000000000000000](tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#L54)\n", + "id": "6c7dc22e356974c8446e07ee7f9d6ffe94f7cb1670066eecec7cbcac691cb8c8", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad5", + "source_mapping": { + "start": 1379, + "length": 170, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 59, + 60, + 61, + 62, + 63, + 64 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad5()" + } + }, + { + "type": "node", + "name": "10000000000000000000 == balance", + "source_mapping": { + "start": 1467, + "length": 19, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 61 + ], + "starting_column": 13, + "ending_column": 32 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad5", + "source_mapping": { + "start": 1379, + "length": 170, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 59, + 60, + 61, + 62, + 63, + 64 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad5()" + } + } + } + } + ], + "description": "TestContractBalance.bad5() (tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#59-64) uses a dangerous strict equality:\n\t- 10000000000000000000 == balance (tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#61)\n", + "markdown": "[TestContractBalance.bad5()](tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#L59-L64) uses a dangerous strict equality:\n\t- [10000000000000000000 == balance](tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#L61)\n", + "id": "3e416561dc117d230bbee97788f5a0ff851da92f1def8fb5d7b94461ee6bfbc0", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad6", + "source_mapping": { + "start": 1555, + "length": 179, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad6()" + } + }, + { + "type": "node", + "name": "balance == 10000000000000000000", + "source_mapping": { + "start": 1652, + "length": 19, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 68 + ], + "starting_column": 13, + "ending_column": 32 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad6", + "source_mapping": { + "start": 1555, + "length": 179, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad6()" + } + } + } + } + ], + "description": "TestContractBalance.bad6() (tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#66-71) uses a dangerous strict equality:\n\t- balance == 10000000000000000000 (tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#68)\n", + "markdown": "[TestContractBalance.bad6()](tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#L66-L71) uses a dangerous strict equality:\n\t- [balance == 10000000000000000000](tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#L68)\n", + "id": "9a6a2aee598cf4c282006337a3b8599c708487d1942e9ddfe3193581cbe1708e", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 2952, + "length": 59, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 123, + 124, + 125 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestSolidityKeyword", + "source_mapping": { + "start": 2385, + "length": 774, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + }, + { + "type": "node", + "name": "require(bool)(now == 0)", + "source_mapping": { + "start": 2986, + "length": 18, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 124 + ], + "starting_column": 9, + "ending_column": 27 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 2952, + "length": 59, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 123, + 124, + 125 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestSolidityKeyword", + "source_mapping": { + "start": 2385, + "length": 774, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + } + } + ], + "description": "TestSolidityKeyword.bad0() (tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#123-125) uses a dangerous strict equality:\n\t- require(bool)(now == 0) (tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#124)\n", + "markdown": "[TestSolidityKeyword.bad0()](tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#L123-L125) uses a dangerous strict equality:\n\t- [require(bool)(now == 0)](tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#L124)\n", + "id": "24de80ae388956295db544441f5ab9326af42bd4fcb34e232a23af952d7fe333", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 3017, + "length": 66, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 127, + 128, + 129 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestSolidityKeyword", + "source_mapping": { + "start": 2385, + "length": 774, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1()" + } + }, + { + "type": "node", + "name": "require(bool)(block.number == 0)", + "source_mapping": { + "start": 3051, + "length": 25, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 128 + ], + "starting_column": 9, + "ending_column": 34 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 3017, + "length": 66, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 127, + 128, + 129 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestSolidityKeyword", + "source_mapping": { + "start": 2385, + "length": 774, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1()" + } + } + } + } + ], + "description": "TestSolidityKeyword.bad1() (tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#127-129) uses a dangerous strict equality:\n\t- require(bool)(block.number == 0) (tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#128)\n", + "markdown": "[TestSolidityKeyword.bad1()](tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#L127-L129) uses a dangerous strict equality:\n\t- [require(bool)(block.number == 0)](tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#L128)\n", + "id": "60917b5197ecd42e5554643c32624ec6fc2a46bc8da2b3627eddcd68cf2ce9f5", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 3089, + "length": 67, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 131, + 132, + 133 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestSolidityKeyword", + "source_mapping": { + "start": 2385, + "length": 774, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + }, + { + "type": "node", + "name": "require(bool)(block.number == 0)", + "source_mapping": { + "start": 3123, + "length": 26, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 132 + ], + "starting_column": 9, + "ending_column": 35 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 3089, + "length": 67, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 131, + 132, + 133 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestSolidityKeyword", + "source_mapping": { + "start": 2385, + "length": 774, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + } + } + } + ], + "description": "TestSolidityKeyword.bad2() (tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#131-133) uses a dangerous strict equality:\n\t- require(bool)(block.number == 0) (tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#132)\n", + "markdown": "[TestSolidityKeyword.bad2()](tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#L131-L133) uses a dangerous strict equality:\n\t- [require(bool)(block.number == 0)](tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol#L132)\n", + "id": "9efb75e5f6647209e01d4053c1bf76e69bf07d6578864711e2302336f250d72e", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol b/tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol new file mode 100644 index 0000000000..b2e4c2f142 --- /dev/null +++ b/tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol @@ -0,0 +1,136 @@ +abstract contract ERC20Function{ + function balanceOf(address _owner) external virtual returns(uint); +} + +contract ERC20Variable{ + mapping(address => uint) public balanceOf; +} + + +contract ERC20TestBalance{ + + + function good0(ERC20Function erc) external{ + require(erc.balanceOf(msg.sender) > 0); + } + + function good1(ERC20Variable erc) external{ + require(erc.balanceOf(msg.sender) > 0); + } + + function bad0(ERC20Function erc) external{ + require(erc.balanceOf(address(this)) == 10); + } + + function bad1(ERC20Variable erc) external{ + require(erc.balanceOf(msg.sender) ==10); + } +} + +contract TestContractBalance { + + function bad0() external { + require(address(address(this)).balance == 10 ether); + msg.sender.transfer(0.1 ether); + } + + function bad1() external { + require(10 ether == address(address(this)).balance); + msg.sender.transfer(0.1 ether); + } + + function bad2() external { + require(address(this).balance == 10 ether); + msg.sender.transfer(0.1 ether); + } + + function bad3() external { + require(10 ether == address(this).balance); + msg.sender.transfer(0.1 ether); + } + + function bad4() external { + uint256 balance = address(this).balance; + if (balance == 10 ether) { + msg.sender.transfer(0.1 ether); + } + } + + function bad5() external { + uint256 balance = address(this).balance; + if (10 ether == balance) { + msg.sender.transfer(0.1 ether); + } + } + + function bad6() external { + uint256 balance = address(address(this)).balance; + if (balance == 10 ether) { + msg.sender.transfer(0.1 ether); + } + } + + function myfunc(uint256 balance) pure internal returns (uint256) { + return balance - balance; + } + + function good1() external { + require (address(address(this)).balance >= 10 ether); + msg.sender.transfer(0.1 ether); + } + + function good2() external { + require (10 <= address(address(this)).balance); + msg.sender.transfer(0.1 ether); + } + + function good3() external { + require (address(this).balance >= 10 ether); + msg.sender.transfer(0.1 ether); + } + + function good4() external { + require (10 <= address(this).balance); + msg.sender.transfer(0.1 ether); + } + +} + +contract TestSolidityKeyword{ + + function good0() external{ + require(block.timestamp > 0); + } + + function good1() external{ + require(block.number > 0); + } + + function good2() external{ + require(block.timestamp > 0); + } + + function good3(uint param) public{ + // address(this) simulate a particular corner case + // where the SSA is better + // the naive data dependency without SSA + // will consider param and block.number to have a dep + if(param == 0){ + param = block.number; + } + } + + function bad0() external{ + require(block.timestamp == 0); + } + + function bad1() external{ + require(block.number== 0); + } + + function bad2() external{ + require(block.number == 0); + } + +} + diff --git a/tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol.0.7.6.IncorrectStrictEquality.json b/tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol.0.7.6.IncorrectStrictEquality.json new file mode 100644 index 0000000000..ba1612ba04 --- /dev/null +++ b/tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol.0.7.6.IncorrectStrictEquality.json @@ -0,0 +1,2600 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 421, + "length": 101, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ERC20TestBalance", + "source_mapping": { + "start": 182, + "length": 445, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0(ERC20Function)" + } + }, + { + "type": "node", + "name": "require(bool)(erc.balanceOf(address(this)) == 10)", + "source_mapping": { + "start": 472, + "length": 43, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 22 + ], + "starting_column": 9, + "ending_column": 52 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 421, + "length": 101, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ERC20TestBalance", + "source_mapping": { + "start": 182, + "length": 445, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0(ERC20Function)" + } + } + } + } + ], + "description": "ERC20TestBalance.bad0(ERC20Function) (tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#21-23) uses a dangerous strict equality:\n\t- require(bool)(erc.balanceOf(address(this)) == 10) (tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#22)\n", + "markdown": "[ERC20TestBalance.bad0(ERC20Function)](tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#L21-L23) uses a dangerous strict equality:\n\t- [require(bool)(erc.balanceOf(address(this)) == 10)](tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#L22)\n", + "id": "867a3b92771da558ee2693d8c81dc2c154b0effac8153ca43ccb183b05245310", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 528, + "length": 97, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 25, + 26, + 27 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ERC20TestBalance", + "source_mapping": { + "start": 182, + "length": 445, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(ERC20Variable)" + } + }, + { + "type": "node", + "name": "require(bool)(erc.balanceOf(msg.sender) == 10)", + "source_mapping": { + "start": 579, + "length": 39, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 26 + ], + "starting_column": 9, + "ending_column": 48 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 528, + "length": 97, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 25, + 26, + 27 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ERC20TestBalance", + "source_mapping": { + "start": 182, + "length": 445, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(ERC20Variable)" + } + } + } + } + ], + "description": "ERC20TestBalance.bad1(ERC20Variable) (tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#25-27) uses a dangerous strict equality:\n\t- require(bool)(erc.balanceOf(msg.sender) == 10) (tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#26)\n", + "markdown": "[ERC20TestBalance.bad1(ERC20Variable)](tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#L25-L27) uses a dangerous strict equality:\n\t- [require(bool)(erc.balanceOf(msg.sender) == 10)](tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#L26)\n", + "id": "22a2bf7ecbe8d0217cce4d0304fc02a45968167dd408ad85ad4bfb0ed5012dd0", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 665, + "length": 133, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 32, + 33, + 34, + 35 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + }, + { + "type": "node", + "name": "require(bool)(address(address(this)).balance == 10000000000000000000)", + "source_mapping": { + "start": 700, + "length": 51, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 33 + ], + "starting_column": 9, + "ending_column": 60 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 665, + "length": 133, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 32, + 33, + 34, + 35 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + } + } + ], + "description": "TestContractBalance.bad0() (tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#32-35) uses a dangerous strict equality:\n\t- require(bool)(address(address(this)).balance == 10000000000000000000) (tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#33)\n", + "markdown": "[TestContractBalance.bad0()](tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#L32-L35) uses a dangerous strict equality:\n\t- [require(bool)(address(address(this)).balance == 10000000000000000000)](tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#L33)\n", + "id": "c64584a1db93863bfb52a62fae244e6c2f6bc0c1dd1a5662f50965428d978a15", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 804, + "length": 133, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 37, + 38, + 39, + 40 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1()" + } + }, + { + "type": "node", + "name": "require(bool)(10000000000000000000 == address(address(this)).balance)", + "source_mapping": { + "start": 839, + "length": 51, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 38 + ], + "starting_column": 9, + "ending_column": 60 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 804, + "length": 133, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 37, + 38, + 39, + 40 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1()" + } + } + } + } + ], + "description": "TestContractBalance.bad1() (tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#37-40) uses a dangerous strict equality:\n\t- require(bool)(10000000000000000000 == address(address(this)).balance) (tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#38)\n", + "markdown": "[TestContractBalance.bad1()](tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#L37-L40) uses a dangerous strict equality:\n\t- [require(bool)(10000000000000000000 == address(address(this)).balance)](tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#L38)\n", + "id": "00429822fd7d6870bca827c11ac6f1f552b243431b3db4a937da8c0c616aabb9", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 943, + "length": 124, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 42, + 43, + 44, + 45 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + }, + { + "type": "node", + "name": "require(bool)(address(this).balance == 10000000000000000000)", + "source_mapping": { + "start": 978, + "length": 42, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 43 + ], + "starting_column": 9, + "ending_column": 51 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 943, + "length": 124, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 42, + 43, + 44, + 45 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + } + } + } + ], + "description": "TestContractBalance.bad2() (tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#42-45) uses a dangerous strict equality:\n\t- require(bool)(address(this).balance == 10000000000000000000) (tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#43)\n", + "markdown": "[TestContractBalance.bad2()](tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#L42-L45) uses a dangerous strict equality:\n\t- [require(bool)(address(this).balance == 10000000000000000000)](tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#L43)\n", + "id": "d848b883cd27d256e7ea367c14afae2cc206b22bc62e0023eeff561e4bc9bee6", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad3", + "source_mapping": { + "start": 1073, + "length": 124, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 47, + 48, + 49, + 50 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad3()" + } + }, + { + "type": "node", + "name": "require(bool)(10000000000000000000 == address(this).balance)", + "source_mapping": { + "start": 1108, + "length": 42, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 48 + ], + "starting_column": 9, + "ending_column": 51 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad3", + "source_mapping": { + "start": 1073, + "length": 124, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 47, + 48, + 49, + 50 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad3()" + } + } + } + } + ], + "description": "TestContractBalance.bad3() (tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#47-50) uses a dangerous strict equality:\n\t- require(bool)(10000000000000000000 == address(this).balance) (tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#48)\n", + "markdown": "[TestContractBalance.bad3()](tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#L47-L50) uses a dangerous strict equality:\n\t- [require(bool)(10000000000000000000 == address(this).balance)](tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#L48)\n", + "id": "746e8e07ef37b33e1f1e49ae013311ea0873d62d00caacaf08988735eb939ddc", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad4", + "source_mapping": { + "start": 1203, + "length": 170, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 52, + 53, + 54, + 55, + 56, + 57 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad4()" + } + }, + { + "type": "node", + "name": "balance == 10000000000000000000", + "source_mapping": { + "start": 1291, + "length": 19, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 54 + ], + "starting_column": 13, + "ending_column": 32 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad4", + "source_mapping": { + "start": 1203, + "length": 170, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 52, + 53, + 54, + 55, + 56, + 57 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad4()" + } + } + } + } + ], + "description": "TestContractBalance.bad4() (tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#52-57) uses a dangerous strict equality:\n\t- balance == 10000000000000000000 (tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#54)\n", + "markdown": "[TestContractBalance.bad4()](tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#L52-L57) uses a dangerous strict equality:\n\t- [balance == 10000000000000000000](tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#L54)\n", + "id": "03481d21bd25c9db2606e6ac246fbf5a047d5fb094422fe19a5fabf7032e1818", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad5", + "source_mapping": { + "start": 1379, + "length": 170, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 59, + 60, + 61, + 62, + 63, + 64 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad5()" + } + }, + { + "type": "node", + "name": "10000000000000000000 == balance", + "source_mapping": { + "start": 1467, + "length": 19, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 61 + ], + "starting_column": 13, + "ending_column": 32 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad5", + "source_mapping": { + "start": 1379, + "length": 170, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 59, + 60, + 61, + 62, + 63, + 64 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad5()" + } + } + } + } + ], + "description": "TestContractBalance.bad5() (tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#59-64) uses a dangerous strict equality:\n\t- 10000000000000000000 == balance (tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#61)\n", + "markdown": "[TestContractBalance.bad5()](tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#L59-L64) uses a dangerous strict equality:\n\t- [10000000000000000000 == balance](tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#L61)\n", + "id": "4c491b63ac50b7636f4718de626a471d8172b614b1355e937d7a071aec148691", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad6", + "source_mapping": { + "start": 1555, + "length": 179, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad6()" + } + }, + { + "type": "node", + "name": "balance == 10000000000000000000", + "source_mapping": { + "start": 1652, + "length": 19, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 68 + ], + "starting_column": 13, + "ending_column": 32 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad6", + "source_mapping": { + "start": 1555, + "length": 179, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestContractBalance", + "source_mapping": { + "start": 629, + "length": 1754, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad6()" + } + } + } + } + ], + "description": "TestContractBalance.bad6() (tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#66-71) uses a dangerous strict equality:\n\t- balance == 10000000000000000000 (tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#68)\n", + "markdown": "[TestContractBalance.bad6()](tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#L66-L71) uses a dangerous strict equality:\n\t- [balance == 10000000000000000000](tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#L68)\n", + "id": "48fdf24089d0b55885acd69fec55d6860251775e0e1b0317182476ff9015bd8d", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 2964, + "length": 71, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 123, + 124, + 125 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestSolidityKeyword", + "source_mapping": { + "start": 2385, + "length": 798, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + }, + { + "type": "node", + "name": "require(bool)(block.timestamp == 0)", + "source_mapping": { + "start": 2998, + "length": 30, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 124 + ], + "starting_column": 9, + "ending_column": 39 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 2964, + "length": 71, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 123, + 124, + 125 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestSolidityKeyword", + "source_mapping": { + "start": 2385, + "length": 798, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + } + } + ], + "description": "TestSolidityKeyword.bad0() (tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#123-125) uses a dangerous strict equality:\n\t- require(bool)(block.timestamp == 0) (tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#124)\n", + "markdown": "[TestSolidityKeyword.bad0()](tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#L123-L125) uses a dangerous strict equality:\n\t- [require(bool)(block.timestamp == 0)](tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#L124)\n", + "id": "41fcdc7b875eec5595e7d7518953b246ab69a7baac064512fde30b157c0595f2", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 3041, + "length": 66, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 127, + 128, + 129 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestSolidityKeyword", + "source_mapping": { + "start": 2385, + "length": 798, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1()" + } + }, + { + "type": "node", + "name": "require(bool)(block.number == 0)", + "source_mapping": { + "start": 3075, + "length": 25, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 128 + ], + "starting_column": 9, + "ending_column": 34 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 3041, + "length": 66, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 127, + 128, + 129 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestSolidityKeyword", + "source_mapping": { + "start": 2385, + "length": 798, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1()" + } + } + } + } + ], + "description": "TestSolidityKeyword.bad1() (tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#127-129) uses a dangerous strict equality:\n\t- require(bool)(block.number == 0) (tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#128)\n", + "markdown": "[TestSolidityKeyword.bad1()](tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#L127-L129) uses a dangerous strict equality:\n\t- [require(bool)(block.number == 0)](tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#L128)\n", + "id": "b60d82f030e9230cf782621e9d04910c2dbe77a0adc6dcb435e642eb567ef330", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 3113, + "length": 67, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 131, + 132, + 133 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestSolidityKeyword", + "source_mapping": { + "start": 2385, + "length": 798, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + }, + { + "type": "node", + "name": "require(bool)(block.number == 0)", + "source_mapping": { + "start": 3147, + "length": 26, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 132 + ], + "starting_column": 9, + "ending_column": 35 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 3113, + "length": 67, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 131, + 132, + 133 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TestSolidityKeyword", + "source_mapping": { + "start": 2385, + "length": 798, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "is_dependency": false, + "lines": [ + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + } + } + } + ], + "description": "TestSolidityKeyword.bad2() (tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#131-133) uses a dangerous strict equality:\n\t- require(bool)(block.number == 0) (tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#132)\n", + "markdown": "[TestSolidityKeyword.bad2()](tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#L131-L133) uses a dangerous strict equality:\n\t- [require(bool)(block.number == 0)](tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol#L132)\n", + "id": "78aad151c32e2fa0c7cb17095afae17fad81d613a486d78dabb016b26396ed12", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/incorrect-modifier/modifier_default.sol b/tests/detectors/incorrect-modifier/0.4.25/modifier_default.sol similarity index 100% rename from tests/detectors/incorrect-modifier/modifier_default.sol rename to tests/detectors/incorrect-modifier/0.4.25/modifier_default.sol diff --git a/tests/detectors/incorrect-modifier/modifier_default.sol.0.4.25.ModifierDefaultDetection.json b/tests/detectors/incorrect-modifier/0.4.25/modifier_default.sol.0.4.25.ModifierDefaultDetection.json similarity index 91% rename from tests/detectors/incorrect-modifier/modifier_default.sol.0.4.25.ModifierDefaultDetection.json rename to tests/detectors/incorrect-modifier/0.4.25/modifier_default.sol.0.4.25.ModifierDefaultDetection.json index 5047bd9a96..bf6511b981 100644 --- a/tests/detectors/incorrect-modifier/modifier_default.sol.0.4.25.ModifierDefaultDetection.json +++ b/tests/detectors/incorrect-modifier/0.4.25/modifier_default.sol.0.4.25.ModifierDefaultDetection.json @@ -9,9 +9,9 @@ "start": 20, "length": 103, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-modifier/modifier_default.sol", + "filename_relative": "tests/detectors/incorrect-modifier/0.4.25/modifier_default.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-modifier/modifier_default.sol", + "filename_short": "tests/detectors/incorrect-modifier/0.4.25/modifier_default.sol", "is_dependency": false, "lines": [ 2, @@ -31,9 +31,9 @@ "start": 0, "length": 901, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-modifier/modifier_default.sol", + "filename_relative": "tests/detectors/incorrect-modifier/0.4.25/modifier_default.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-modifier/modifier_default.sol", + "filename_short": "tests/detectors/incorrect-modifier/0.4.25/modifier_default.sol", "is_dependency": false, "lines": [ 1, @@ -97,8 +97,8 @@ } } ], - "description": "Modifier Test.noResult() (tests/detectors/incorrect-modifier/modifier_default.sol#2-6) does not always execute _; or revert", - "markdown": "Modifier [Test.noResult()](tests/detectors/incorrect-modifier/modifier_default.sol#L2-L6) does not always execute _; or revert", + "description": "Modifier Test.noResult() (tests/detectors/incorrect-modifier/0.4.25/modifier_default.sol#2-6) does not always execute _; or revert", + "markdown": "Modifier [Test.noResult()](tests/detectors/incorrect-modifier/0.4.25/modifier_default.sol#L2-L6) does not always execute _; or revert", "id": "e83e0a544940d3ddd9ea8fe0ae0277bec4660926110809cfd28153817969c3a3", "check": "incorrect-modifier", "impact": "Low", @@ -113,9 +113,9 @@ "start": 277, "length": 111, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-modifier/modifier_default.sol", + "filename_relative": "tests/detectors/incorrect-modifier/0.4.25/modifier_default.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-modifier/modifier_default.sol", + "filename_short": "tests/detectors/incorrect-modifier/0.4.25/modifier_default.sol", "is_dependency": false, "lines": [ 18, @@ -135,9 +135,9 @@ "start": 0, "length": 901, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-modifier/modifier_default.sol", + "filename_relative": "tests/detectors/incorrect-modifier/0.4.25/modifier_default.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-modifier/modifier_default.sol", + "filename_short": "tests/detectors/incorrect-modifier/0.4.25/modifier_default.sol", "is_dependency": false, "lines": [ 1, @@ -201,8 +201,8 @@ } } ], - "description": "Modifier Test.requireAssertNoResult() (tests/detectors/incorrect-modifier/modifier_default.sol#18-22) does not always execute _; or revert", - "markdown": "Modifier [Test.requireAssertNoResult()](tests/detectors/incorrect-modifier/modifier_default.sol#L18-L22) does not always execute _; or revert", + "description": "Modifier Test.requireAssertNoResult() (tests/detectors/incorrect-modifier/0.4.25/modifier_default.sol#18-22) does not always execute _; or revert", + "markdown": "Modifier [Test.requireAssertNoResult()](tests/detectors/incorrect-modifier/0.4.25/modifier_default.sol#L18-L22) does not always execute _; or revert", "id": "35d07e11ee69abb8fb0e63dddefc1ab059bf450c71c992f70c5f96e484fbcbcc", "check": "incorrect-modifier", "impact": "Low", @@ -217,9 +217,9 @@ "start": 496, "length": 251, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-modifier/modifier_default.sol", + "filename_relative": "tests/detectors/incorrect-modifier/0.4.25/modifier_default.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-modifier/modifier_default.sol", + "filename_short": "tests/detectors/incorrect-modifier/0.4.25/modifier_default.sol", "is_dependency": false, "lines": [ 30, @@ -246,9 +246,9 @@ "start": 0, "length": 901, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-modifier/modifier_default.sol", + "filename_relative": "tests/detectors/incorrect-modifier/0.4.25/modifier_default.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-modifier/modifier_default.sol", + "filename_short": "tests/detectors/incorrect-modifier/0.4.25/modifier_default.sol", "is_dependency": false, "lines": [ 1, @@ -312,8 +312,8 @@ } } ], - "description": "Modifier Test.loopsNoResult() (tests/detectors/incorrect-modifier/modifier_default.sol#30-41) does not always execute _; or revert", - "markdown": "Modifier [Test.loopsNoResult()](tests/detectors/incorrect-modifier/modifier_default.sol#L30-L41) does not always execute _; or revert", + "description": "Modifier Test.loopsNoResult() (tests/detectors/incorrect-modifier/0.4.25/modifier_default.sol#30-41) does not always execute _; or revert", + "markdown": "Modifier [Test.loopsNoResult()](tests/detectors/incorrect-modifier/0.4.25/modifier_default.sol#L30-L41) does not always execute _; or revert", "id": "0ba95ef5faf2a00c06d4f83c5159220d1cd06bc346a1287a6634334b7a0c433f", "check": "incorrect-modifier", "impact": "Low", diff --git a/tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol b/tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol new file mode 100644 index 0000000000..96f614880b --- /dev/null +++ b/tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol @@ -0,0 +1,52 @@ +contract Test { + modifier noResult() { + if (false) {_;} + else if (false) {revert();} + else {} + } + + modifier goodRevert() { + if (false) _; + revert(); + } + + modifier goodCode() { + if (false) revert(); + _; + } + + modifier requireAssertNoResult() { + require(1 == 1); + assert(1 == 1); + if (false) _; + } + + modifier requireAssertGood() { + require(1 == 1); + assert(1 == 1); + _; + } + + modifier loopsNoResult() { + uint8 i = 0; + + // Treated like any other conditional + for(i = 0; i<10; i++) {_;} + while(i < 20) {i++; _;} + + // Body is checked + do { + i++; + } while (i < 30); + } + + modifier loopGood() { + uint8 i = 0; + + // Body is checked + do { + i++; + _; + } while (i < 1); + } +} diff --git a/tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol.0.5.16.ModifierDefaultDetection.json b/tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol.0.5.16.ModifierDefaultDetection.json new file mode 100644 index 0000000000..5b79859596 --- /dev/null +++ b/tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol.0.5.16.ModifierDefaultDetection.json @@ -0,0 +1,323 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "noResult", + "source_mapping": { + "start": 20, + "length": 103, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol", + "is_dependency": false, + "lines": [ + 2, + 3, + 4, + 5, + 6 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 0, + "length": 901, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "noResult()" + } + } + ], + "description": "Modifier Test.noResult() (tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol#2-6) does not always execute _; or revert", + "markdown": "Modifier [Test.noResult()](tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol#L2-L6) does not always execute _; or revert", + "id": "e83e0a544940d3ddd9ea8fe0ae0277bec4660926110809cfd28153817969c3a3", + "check": "incorrect-modifier", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "requireAssertNoResult", + "source_mapping": { + "start": 277, + "length": 111, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol", + "is_dependency": false, + "lines": [ + 18, + 19, + 20, + 21, + 22 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 0, + "length": 901, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "requireAssertNoResult()" + } + } + ], + "description": "Modifier Test.requireAssertNoResult() (tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol#18-22) does not always execute _; or revert", + "markdown": "Modifier [Test.requireAssertNoResult()](tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol#L18-L22) does not always execute _; or revert", + "id": "35d07e11ee69abb8fb0e63dddefc1ab059bf450c71c992f70c5f96e484fbcbcc", + "check": "incorrect-modifier", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "loopsNoResult", + "source_mapping": { + "start": 496, + "length": 251, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 0, + "length": 901, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "loopsNoResult()" + } + } + ], + "description": "Modifier Test.loopsNoResult() (tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol#30-41) does not always execute _; or revert", + "markdown": "Modifier [Test.loopsNoResult()](tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol#L30-L41) does not always execute _; or revert", + "id": "0ba95ef5faf2a00c06d4f83c5159220d1cd06bc346a1287a6634334b7a0c433f", + "check": "incorrect-modifier", + "impact": "Low", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol b/tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol new file mode 100644 index 0000000000..96f614880b --- /dev/null +++ b/tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol @@ -0,0 +1,52 @@ +contract Test { + modifier noResult() { + if (false) {_;} + else if (false) {revert();} + else {} + } + + modifier goodRevert() { + if (false) _; + revert(); + } + + modifier goodCode() { + if (false) revert(); + _; + } + + modifier requireAssertNoResult() { + require(1 == 1); + assert(1 == 1); + if (false) _; + } + + modifier requireAssertGood() { + require(1 == 1); + assert(1 == 1); + _; + } + + modifier loopsNoResult() { + uint8 i = 0; + + // Treated like any other conditional + for(i = 0; i<10; i++) {_;} + while(i < 20) {i++; _;} + + // Body is checked + do { + i++; + } while (i < 30); + } + + modifier loopGood() { + uint8 i = 0; + + // Body is checked + do { + i++; + _; + } while (i < 1); + } +} diff --git a/tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol.0.6.11.ModifierDefaultDetection.json b/tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol.0.6.11.ModifierDefaultDetection.json new file mode 100644 index 0000000000..6f6d5f46d8 --- /dev/null +++ b/tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol.0.6.11.ModifierDefaultDetection.json @@ -0,0 +1,323 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "noResult", + "source_mapping": { + "start": 20, + "length": 103, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol", + "is_dependency": false, + "lines": [ + 2, + 3, + 4, + 5, + 6 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 0, + "length": 901, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "noResult()" + } + } + ], + "description": "Modifier Test.noResult() (tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol#2-6) does not always execute _; or revert", + "markdown": "Modifier [Test.noResult()](tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol#L2-L6) does not always execute _; or revert", + "id": "e83e0a544940d3ddd9ea8fe0ae0277bec4660926110809cfd28153817969c3a3", + "check": "incorrect-modifier", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "requireAssertNoResult", + "source_mapping": { + "start": 277, + "length": 111, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol", + "is_dependency": false, + "lines": [ + 18, + 19, + 20, + 21, + 22 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 0, + "length": 901, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "requireAssertNoResult()" + } + } + ], + "description": "Modifier Test.requireAssertNoResult() (tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol#18-22) does not always execute _; or revert", + "markdown": "Modifier [Test.requireAssertNoResult()](tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol#L18-L22) does not always execute _; or revert", + "id": "35d07e11ee69abb8fb0e63dddefc1ab059bf450c71c992f70c5f96e484fbcbcc", + "check": "incorrect-modifier", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "loopsNoResult", + "source_mapping": { + "start": 496, + "length": 251, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 0, + "length": 901, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "loopsNoResult()" + } + } + ], + "description": "Modifier Test.loopsNoResult() (tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol#30-41) does not always execute _; or revert", + "markdown": "Modifier [Test.loopsNoResult()](tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol#L30-L41) does not always execute _; or revert", + "id": "0ba95ef5faf2a00c06d4f83c5159220d1cd06bc346a1287a6634334b7a0c433f", + "check": "incorrect-modifier", + "impact": "Low", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol b/tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol new file mode 100644 index 0000000000..96f614880b --- /dev/null +++ b/tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol @@ -0,0 +1,52 @@ +contract Test { + modifier noResult() { + if (false) {_;} + else if (false) {revert();} + else {} + } + + modifier goodRevert() { + if (false) _; + revert(); + } + + modifier goodCode() { + if (false) revert(); + _; + } + + modifier requireAssertNoResult() { + require(1 == 1); + assert(1 == 1); + if (false) _; + } + + modifier requireAssertGood() { + require(1 == 1); + assert(1 == 1); + _; + } + + modifier loopsNoResult() { + uint8 i = 0; + + // Treated like any other conditional + for(i = 0; i<10; i++) {_;} + while(i < 20) {i++; _;} + + // Body is checked + do { + i++; + } while (i < 30); + } + + modifier loopGood() { + uint8 i = 0; + + // Body is checked + do { + i++; + _; + } while (i < 1); + } +} diff --git a/tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol.0.7.6.ModifierDefaultDetection.json b/tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol.0.7.6.ModifierDefaultDetection.json new file mode 100644 index 0000000000..47c566cccf --- /dev/null +++ b/tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol.0.7.6.ModifierDefaultDetection.json @@ -0,0 +1,323 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "noResult", + "source_mapping": { + "start": 20, + "length": 103, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol", + "is_dependency": false, + "lines": [ + 2, + 3, + 4, + 5, + 6 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 0, + "length": 901, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "noResult()" + } + } + ], + "description": "Modifier Test.noResult() (tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol#2-6) does not always execute _; or revert", + "markdown": "Modifier [Test.noResult()](tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol#L2-L6) does not always execute _; or revert", + "id": "e83e0a544940d3ddd9ea8fe0ae0277bec4660926110809cfd28153817969c3a3", + "check": "incorrect-modifier", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "requireAssertNoResult", + "source_mapping": { + "start": 277, + "length": 111, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol", + "is_dependency": false, + "lines": [ + 18, + 19, + 20, + 21, + 22 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 0, + "length": 901, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "requireAssertNoResult()" + } + } + ], + "description": "Modifier Test.requireAssertNoResult() (tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol#18-22) does not always execute _; or revert", + "markdown": "Modifier [Test.requireAssertNoResult()](tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol#L18-L22) does not always execute _; or revert", + "id": "35d07e11ee69abb8fb0e63dddefc1ab059bf450c71c992f70c5f96e484fbcbcc", + "check": "incorrect-modifier", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "loopsNoResult", + "source_mapping": { + "start": 496, + "length": 251, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 0, + "length": 901, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "loopsNoResult()" + } + } + ], + "description": "Modifier Test.loopsNoResult() (tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol#30-41) does not always execute _; or revert", + "markdown": "Modifier [Test.loopsNoResult()](tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol#L30-L41) does not always execute _; or revert", + "id": "0ba95ef5faf2a00c06d4f83c5159220d1cd06bc346a1287a6634334b7a0c433f", + "check": "incorrect-modifier", + "impact": "Low", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/incorrect-unary/invalid_unary_expression.sol b/tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol similarity index 100% rename from tests/detectors/incorrect-unary/invalid_unary_expression.sol rename to tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol diff --git a/tests/detectors/incorrect-unary/invalid_unary_expression.sol.0.4.25.IncorrectUnaryExpressionDetection.json b/tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol.0.4.25.IncorrectUnaryExpressionDetection.json similarity index 86% rename from tests/detectors/incorrect-unary/invalid_unary_expression.sol.0.4.25.IncorrectUnaryExpressionDetection.json rename to tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol.0.4.25.IncorrectUnaryExpressionDetection.json index 066ae397b1..1970abe315 100644 --- a/tests/detectors/incorrect-unary/invalid_unary_expression.sol.0.4.25.IncorrectUnaryExpressionDetection.json +++ b/tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol.0.4.25.IncorrectUnaryExpressionDetection.json @@ -9,9 +9,9 @@ "start": 42, "length": 13, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_relative": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_short": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "is_dependency": false, "lines": [ 4 @@ -27,9 +27,9 @@ "start": 0, "length": 204, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_relative": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_short": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "is_dependency": false, "lines": [ 1, @@ -55,8 +55,8 @@ } } ], - "description": "C.c (tests/detectors/incorrect-unary/invalid_unary_expression.sol#4) uses an dangerous unary operator: (b = + 1)\n", - "markdown": "[C.c](tests/detectors/incorrect-unary/invalid_unary_expression.sol#L4) uses an dangerous unary operator: (b = + 1)\n", + "description": "C.c (tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol#4) uses an dangerous unary operator: (b = + 1)\n", + "markdown": "[C.c](tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol#L4) uses an dangerous unary operator: (b = + 1)\n", "id": "98d05a4acbe13ff0e6fa795af35dc2002541cc7607f3f4d7ffb356f9d33681bd", "check": "incorrect-unary", "impact": "Low", @@ -71,9 +71,9 @@ "start": 60, "length": 142, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_relative": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_short": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "is_dependency": false, "lines": [ 6, @@ -97,9 +97,9 @@ "start": 0, "length": 204, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_relative": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_short": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "is_dependency": false, "lines": [ 1, @@ -132,9 +132,9 @@ "start": 104, "length": 26, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_relative": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_short": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "is_dependency": false, "lines": [ 8 @@ -150,9 +150,9 @@ "start": 60, "length": 142, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_relative": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_short": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "is_dependency": false, "lines": [ 6, @@ -176,9 +176,9 @@ "start": 0, "length": 204, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_relative": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_short": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "is_dependency": false, "lines": [ 1, @@ -207,9 +207,9 @@ } } ], - "description": "C.f() (tests/detectors/incorrect-unary/invalid_unary_expression.sol#6-14) uses an dangerous unary operator: x = + 144444 (tests/detectors/incorrect-unary/invalid_unary_expression.sol#8)\n", - "markdown": "[C.f()](tests/detectors/incorrect-unary/invalid_unary_expression.sol#L6-L14) uses an dangerous unary operator: [x = + 144444](tests/detectors/incorrect-unary/invalid_unary_expression.sol#L8)\n", - "id": "7595a3dac85785e5438d50c6b51b74329ce67fb73e71db0557eddd7fe0b20a75", + "description": "C.f() (tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol#6-14) uses an dangerous unary operator: x = + 144444 (tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol#8)\n", + "markdown": "[C.f()](tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol#L6-L14) uses an dangerous unary operator: [x = + 144444](tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol#L8)\n", + "id": "1c34192b7e1340c90c351ae8dcdbf0ce55436d33da941fd80ca110fadc120471", "check": "incorrect-unary", "impact": "Low", "confidence": "Medium" @@ -223,9 +223,9 @@ "start": 60, "length": 142, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_relative": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_short": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "is_dependency": false, "lines": [ 6, @@ -249,9 +249,9 @@ "start": 0, "length": 204, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_relative": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_short": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "is_dependency": false, "lines": [ 1, @@ -284,9 +284,9 @@ "start": 136, "length": 10, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_relative": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_short": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "is_dependency": false, "lines": [ 9 @@ -302,9 +302,9 @@ "start": 60, "length": 142, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_relative": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_short": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "is_dependency": false, "lines": [ 6, @@ -328,9 +328,9 @@ "start": 0, "length": 204, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_relative": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_short": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "is_dependency": false, "lines": [ 1, @@ -359,9 +359,9 @@ } } ], - "description": "C.f() (tests/detectors/incorrect-unary/invalid_unary_expression.sol#6-14) uses an dangerous unary operator: x = (x = + 1) (tests/detectors/incorrect-unary/invalid_unary_expression.sol#9)\n", - "markdown": "[C.f()](tests/detectors/incorrect-unary/invalid_unary_expression.sol#L6-L14) uses an dangerous unary operator: [x = (x = + 1)](tests/detectors/incorrect-unary/invalid_unary_expression.sol#L9)\n", - "id": "2a34e309de20d52cb8b386d6f5f166ae6847f1abfe840f0fe50f5801799f2425", + "description": "C.f() (tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol#6-14) uses an dangerous unary operator: x = (x = + 1) (tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol#9)\n", + "markdown": "[C.f()](tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol#L6-L14) uses an dangerous unary operator: [x = (x = + 1)](tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol#L9)\n", + "id": "67f0d53f0f21e8f7ef05bc38503626b2382c6bd6863d70c857c2c6ad58ea0c96", "check": "incorrect-unary", "impact": "Low", "confidence": "Medium" @@ -375,9 +375,9 @@ "start": 0, "length": 204, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_relative": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_short": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "is_dependency": false, "lines": [ 1, @@ -407,9 +407,9 @@ "start": 0, "length": 204, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_relative": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_short": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "is_dependency": false, "lines": [ 1, @@ -442,9 +442,9 @@ "start": 42, "length": 13, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_relative": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_short": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "is_dependency": false, "lines": [ 4 @@ -460,9 +460,9 @@ "start": 0, "length": 204, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_relative": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_short": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "is_dependency": false, "lines": [ 1, @@ -492,9 +492,9 @@ "start": 0, "length": 204, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_relative": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "filename_short": "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", "is_dependency": false, "lines": [ 1, @@ -523,9 +523,9 @@ } } ], - "description": "C.slitherConstructorVariables() (tests/detectors/incorrect-unary/invalid_unary_expression.sol#1-15) uses an dangerous unary operator: c = (b = + 1) (tests/detectors/incorrect-unary/invalid_unary_expression.sol#4)\n", - "markdown": "[C.slitherConstructorVariables()](tests/detectors/incorrect-unary/invalid_unary_expression.sol#L1-L15) uses an dangerous unary operator: [c = (b = + 1)](tests/detectors/incorrect-unary/invalid_unary_expression.sol#L4)\n", - "id": "44f9cc4f47d5a925b4aceeff067e3d849153ee6577a1f41fb25b329156050b80", + "description": "C.slitherConstructorVariables() (tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol#1-15) uses an dangerous unary operator: c = (b = + 1) (tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol#4)\n", + "markdown": "[C.slitherConstructorVariables()](tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol#L1-L15) uses an dangerous unary operator: [c = (b = + 1)](tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol#L4)\n", + "id": "985ddf90b5ace46a66272275a4c46e1a8964ba0adbb8223a6c19506145ed2f8c", "check": "incorrect-unary", "impact": "Low", "confidence": "Medium" diff --git a/tests/detectors/locked-ether/locked_ether.sol b/tests/detectors/locked-ether/0.4.25/locked_ether.sol similarity index 100% rename from tests/detectors/locked-ether/locked_ether.sol rename to tests/detectors/locked-ether/0.4.25/locked_ether.sol diff --git a/tests/detectors/locked-ether/locked_ether.sol.0.4.25.LockedEther.json b/tests/detectors/locked-ether/0.4.25/locked_ether.sol.0.4.25.LockedEther.json similarity index 83% rename from tests/detectors/locked-ether/locked_ether.sol.0.4.25.LockedEther.json rename to tests/detectors/locked-ether/0.4.25/locked_ether.sol.0.4.25.LockedEther.json index 9a081738d2..b2709eb621 100644 --- a/tests/detectors/locked-ether/locked_ether.sol.0.4.25.LockedEther.json +++ b/tests/detectors/locked-ether/0.4.25/locked_ether.sol.0.4.25.LockedEther.json @@ -9,9 +9,9 @@ "start": 368, "length": 32, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/locked-ether/locked_ether.sol", + "filename_relative": "tests/detectors/locked-ether/0.4.25/locked_ether.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/locked-ether/locked_ether.sol", + "filename_short": "tests/detectors/locked-ether/0.4.25/locked_ether.sol", "is_dependency": false, "lines": [ 26 @@ -27,9 +27,9 @@ "start": 47, "length": 72, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/locked-ether/locked_ether.sol", + "filename_relative": "tests/detectors/locked-ether/0.4.25/locked_ether.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/locked-ether/locked_ether.sol", + "filename_short": "tests/detectors/locked-ether/0.4.25/locked_ether.sol", "is_dependency": false, "lines": [ 4, @@ -47,9 +47,9 @@ "start": 25, "length": 97, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/locked-ether/locked_ether.sol", + "filename_relative": "tests/detectors/locked-ether/0.4.25/locked_ether.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/locked-ether/locked_ether.sol", + "filename_short": "tests/detectors/locked-ether/0.4.25/locked_ether.sol", "is_dependency": false, "lines": [ 2, @@ -68,8 +68,8 @@ } } ], - "description": "Contract locking ether found in :\n\tContract OnlyLocked (tests/detectors/locked-ether/locked_ether.sol#26) has payable functions:\n\t - Locked.receive() (tests/detectors/locked-ether/locked_ether.sol#4-6)\n\tBut does not have a function to withdraw the ether\n", - "markdown": "Contract locking ether found in :\n\tContract [OnlyLocked](tests/detectors/locked-ether/locked_ether.sol#L26) has payable functions:\n\t - [Locked.receive()](tests/detectors/locked-ether/locked_ether.sol#L4-L6)\n\tBut does not have a function to withdraw the ether\n", + "description": "Contract locking ether found in :\n\tContract OnlyLocked (tests/detectors/locked-ether/0.4.25/locked_ether.sol#26) has payable functions:\n\t - Locked.receive() (tests/detectors/locked-ether/0.4.25/locked_ether.sol#4-6)\n\tBut does not have a function to withdraw the ether\n", + "markdown": "Contract locking ether found in :\n\tContract [OnlyLocked](tests/detectors/locked-ether/0.4.25/locked_ether.sol#L26) has payable functions:\n\t - [Locked.receive()](tests/detectors/locked-ether/0.4.25/locked_ether.sol#L4-L6)\n\tBut does not have a function to withdraw the ether\n", "id": "38b2d47301e59ffa598ec48a8e874e6a7070d6cf4e4ab2909f33a8b72fc28a4b", "check": "locked-ether", "impact": "Medium", diff --git a/tests/detectors/locked-ether/locked_ether-0.5.1.sol b/tests/detectors/locked-ether/0.5.16/locked_ether.sol similarity index 100% rename from tests/detectors/locked-ether/locked_ether-0.5.1.sol rename to tests/detectors/locked-ether/0.5.16/locked_ether.sol diff --git a/tests/detectors/locked-ether/locked_ether-0.5.1.sol.0.5.1.LockedEther.json b/tests/detectors/locked-ether/0.5.16/locked_ether.sol.0.5.16.LockedEther.json similarity index 82% rename from tests/detectors/locked-ether/locked_ether-0.5.1.sol.0.5.1.LockedEther.json rename to tests/detectors/locked-ether/0.5.16/locked_ether.sol.0.5.16.LockedEther.json index 50ace190c0..789f6692c1 100644 --- a/tests/detectors/locked-ether/locked_ether-0.5.1.sol.0.5.1.LockedEther.json +++ b/tests/detectors/locked-ether/0.5.16/locked_ether.sol.0.5.16.LockedEther.json @@ -9,9 +9,9 @@ "start": 375, "length": 32, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/locked-ether/locked_ether-0.5.1.sol", + "filename_relative": "tests/detectors/locked-ether/0.5.16/locked_ether.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/locked-ether/locked_ether-0.5.1.sol", + "filename_short": "tests/detectors/locked-ether/0.5.16/locked_ether.sol", "is_dependency": false, "lines": [ 26 @@ -27,9 +27,9 @@ "start": 46, "length": 72, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/locked-ether/locked_ether-0.5.1.sol", + "filename_relative": "tests/detectors/locked-ether/0.5.16/locked_ether.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/locked-ether/locked_ether-0.5.1.sol", + "filename_short": "tests/detectors/locked-ether/0.5.16/locked_ether.sol", "is_dependency": false, "lines": [ 4, @@ -47,9 +47,9 @@ "start": 24, "length": 97, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/locked-ether/locked_ether-0.5.1.sol", + "filename_relative": "tests/detectors/locked-ether/0.5.16/locked_ether.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/locked-ether/locked_ether-0.5.1.sol", + "filename_short": "tests/detectors/locked-ether/0.5.16/locked_ether.sol", "is_dependency": false, "lines": [ 2, @@ -68,8 +68,8 @@ } } ], - "description": "Contract locking ether found in :\n\tContract OnlyLocked (tests/detectors/locked-ether/locked_ether-0.5.1.sol#26) has payable functions:\n\t - Locked.receive() (tests/detectors/locked-ether/locked_ether-0.5.1.sol#4-6)\n\tBut does not have a function to withdraw the ether\n", - "markdown": "Contract locking ether found in :\n\tContract [OnlyLocked](tests/detectors/locked-ether/locked_ether-0.5.1.sol#L26) has payable functions:\n\t - [Locked.receive()](tests/detectors/locked-ether/locked_ether-0.5.1.sol#L4-L6)\n\tBut does not have a function to withdraw the ether\n", + "description": "Contract locking ether found in :\n\tContract OnlyLocked (tests/detectors/locked-ether/0.5.16/locked_ether.sol#26) has payable functions:\n\t - Locked.receive() (tests/detectors/locked-ether/0.5.16/locked_ether.sol#4-6)\n\tBut does not have a function to withdraw the ether\n", + "markdown": "Contract locking ether found in :\n\tContract [OnlyLocked](tests/detectors/locked-ether/0.5.16/locked_ether.sol#L26) has payable functions:\n\t - [Locked.receive()](tests/detectors/locked-ether/0.5.16/locked_ether.sol#L4-L6)\n\tBut does not have a function to withdraw the ether\n", "id": "38b2d47301e59ffa598ec48a8e874e6a7070d6cf4e4ab2909f33a8b72fc28a4b", "check": "locked-ether", "impact": "Medium", diff --git a/tests/detectors/locked-ether/0.6.11/locked_ether.sol b/tests/detectors/locked-ether/0.6.11/locked_ether.sol new file mode 100644 index 0000000000..7f02028e7c --- /dev/null +++ b/tests/detectors/locked-ether/0.6.11/locked_ether.sol @@ -0,0 +1,26 @@ +// pragma solidity ^0.5.0; +contract Locked{ + + function receive_eth() payable public{ + require(msg.value > 0); + } + +} + +contract Send{ + address payable owner = msg.sender; + + function withdraw() public virtual { + owner.transfer(address(this).balance); + } +} + +contract Unlocked is Locked, Send{ + + function withdraw() public override { + super.withdraw(); + } + +} + +contract OnlyLocked is Locked{ } diff --git a/tests/detectors/locked-ether/0.6.11/locked_ether.sol.0.6.11.LockedEther.json b/tests/detectors/locked-ether/0.6.11/locked_ether.sol.0.6.11.LockedEther.json new file mode 100644 index 0000000000..c19f1915d5 --- /dev/null +++ b/tests/detectors/locked-ether/0.6.11/locked_ether.sol.0.6.11.LockedEther.json @@ -0,0 +1,79 @@ +[ + [ + { + "elements": [ + { + "type": "contract", + "name": "OnlyLocked", + "source_mapping": { + "start": 401, + "length": 32, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/locked-ether/0.6.11/locked_ether.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/locked-ether/0.6.11/locked_ether.sol", + "is_dependency": false, + "lines": [ + 26 + ], + "starting_column": 1, + "ending_column": 33 + } + }, + { + "type": "function", + "name": "receive_eth", + "source_mapping": { + "start": 49, + "length": 76, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/locked-ether/0.6.11/locked_ether.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/locked-ether/0.6.11/locked_ether.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Locked", + "source_mapping": { + "start": 27, + "length": 101, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/locked-ether/0.6.11/locked_ether.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/locked-ether/0.6.11/locked_ether.sol", + "is_dependency": false, + "lines": [ + 2, + 3, + 4, + 5, + 6, + 7, + 8 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "receive_eth()" + } + } + ], + "description": "Contract locking ether found in :\n\tContract OnlyLocked (tests/detectors/locked-ether/0.6.11/locked_ether.sol#26) has payable functions:\n\t - Locked.receive_eth() (tests/detectors/locked-ether/0.6.11/locked_ether.sol#4-6)\n\tBut does not have a function to withdraw the ether\n", + "markdown": "Contract locking ether found in :\n\tContract [OnlyLocked](tests/detectors/locked-ether/0.6.11/locked_ether.sol#L26) has payable functions:\n\t - [Locked.receive_eth()](tests/detectors/locked-ether/0.6.11/locked_ether.sol#L4-L6)\n\tBut does not have a function to withdraw the ether\n", + "id": "1eb31cab3df894265d213a6a2e85c7fe840a4021a598ab09f1052a86c897d886", + "check": "locked-ether", + "impact": "Medium", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/locked-ether/0.7.6/locked_ether.sol b/tests/detectors/locked-ether/0.7.6/locked_ether.sol new file mode 100644 index 0000000000..7f02028e7c --- /dev/null +++ b/tests/detectors/locked-ether/0.7.6/locked_ether.sol @@ -0,0 +1,26 @@ +// pragma solidity ^0.5.0; +contract Locked{ + + function receive_eth() payable public{ + require(msg.value > 0); + } + +} + +contract Send{ + address payable owner = msg.sender; + + function withdraw() public virtual { + owner.transfer(address(this).balance); + } +} + +contract Unlocked is Locked, Send{ + + function withdraw() public override { + super.withdraw(); + } + +} + +contract OnlyLocked is Locked{ } diff --git a/tests/detectors/locked-ether/0.7.6/locked_ether.sol.0.7.6.LockedEther.json b/tests/detectors/locked-ether/0.7.6/locked_ether.sol.0.7.6.LockedEther.json new file mode 100644 index 0000000000..42a44422c9 --- /dev/null +++ b/tests/detectors/locked-ether/0.7.6/locked_ether.sol.0.7.6.LockedEther.json @@ -0,0 +1,79 @@ +[ + [ + { + "elements": [ + { + "type": "contract", + "name": "OnlyLocked", + "source_mapping": { + "start": 401, + "length": 32, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/locked-ether/0.7.6/locked_ether.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/locked-ether/0.7.6/locked_ether.sol", + "is_dependency": false, + "lines": [ + 26 + ], + "starting_column": 1, + "ending_column": 33 + } + }, + { + "type": "function", + "name": "receive_eth", + "source_mapping": { + "start": 49, + "length": 76, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/locked-ether/0.7.6/locked_ether.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/locked-ether/0.7.6/locked_ether.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Locked", + "source_mapping": { + "start": 27, + "length": 101, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/locked-ether/0.7.6/locked_ether.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/locked-ether/0.7.6/locked_ether.sol", + "is_dependency": false, + "lines": [ + 2, + 3, + 4, + 5, + 6, + 7, + 8 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "receive_eth()" + } + } + ], + "description": "Contract locking ether found in :\n\tContract OnlyLocked (tests/detectors/locked-ether/0.7.6/locked_ether.sol#26) has payable functions:\n\t - Locked.receive_eth() (tests/detectors/locked-ether/0.7.6/locked_ether.sol#4-6)\n\tBut does not have a function to withdraw the ether\n", + "markdown": "Contract locking ether found in :\n\tContract [OnlyLocked](tests/detectors/locked-ether/0.7.6/locked_ether.sol#L26) has payable functions:\n\t - [Locked.receive_eth()](tests/detectors/locked-ether/0.7.6/locked_ether.sol#L4-L6)\n\tBut does not have a function to withdraw the ether\n", + "id": "1eb31cab3df894265d213a6a2e85c7fe840a4021a598ab09f1052a86c897d886", + "check": "locked-ether", + "impact": "Medium", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/low-level-calls/low_level_calls.sol b/tests/detectors/low-level-calls/0.4.25/low_level_calls.sol similarity index 100% rename from tests/detectors/low-level-calls/low_level_calls.sol rename to tests/detectors/low-level-calls/0.4.25/low_level_calls.sol diff --git a/tests/detectors/low-level-calls/low_level_calls.sol.0.4.25.LowLevelCalls.json b/tests/detectors/low-level-calls/0.4.25/low_level_calls.sol.0.4.25.LowLevelCalls.json similarity index 85% rename from tests/detectors/low-level-calls/low_level_calls.sol.0.4.25.LowLevelCalls.json rename to tests/detectors/low-level-calls/0.4.25/low_level_calls.sol.0.4.25.LowLevelCalls.json index 77c4d1c13d..f8ae80ec74 100644 --- a/tests/detectors/low-level-calls/low_level_calls.sol.0.4.25.LowLevelCalls.json +++ b/tests/detectors/low-level-calls/0.4.25/low_level_calls.sol.0.4.25.LowLevelCalls.json @@ -9,9 +9,9 @@ "start": 51, "length": 112, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/low-level-calls/low_level_calls.sol", + "filename_relative": "tests/detectors/low-level-calls/0.4.25/low_level_calls.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/low-level-calls/low_level_calls.sol", + "filename_short": "tests/detectors/low-level-calls/0.4.25/low_level_calls.sol", "is_dependency": false, "lines": [ 5, @@ -29,9 +29,9 @@ "start": 29, "length": 136, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/low-level-calls/low_level_calls.sol", + "filename_relative": "tests/detectors/low-level-calls/0.4.25/low_level_calls.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/low-level-calls/low_level_calls.sol", + "filename_short": "tests/detectors/low-level-calls/0.4.25/low_level_calls.sol", "is_dependency": false, "lines": [ 4, @@ -54,9 +54,9 @@ "start": 111, "length": 45, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/low-level-calls/low_level_calls.sol", + "filename_relative": "tests/detectors/low-level-calls/0.4.25/low_level_calls.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/low-level-calls/low_level_calls.sol", + "filename_short": "tests/detectors/low-level-calls/0.4.25/low_level_calls.sol", "is_dependency": false, "lines": [ 6 @@ -72,9 +72,9 @@ "start": 51, "length": 112, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/low-level-calls/low_level_calls.sol", + "filename_relative": "tests/detectors/low-level-calls/0.4.25/low_level_calls.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/low-level-calls/low_level_calls.sol", + "filename_short": "tests/detectors/low-level-calls/0.4.25/low_level_calls.sol", "is_dependency": false, "lines": [ 5, @@ -92,9 +92,9 @@ "start": 29, "length": 136, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/low-level-calls/low_level_calls.sol", + "filename_relative": "tests/detectors/low-level-calls/0.4.25/low_level_calls.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/low-level-calls/low_level_calls.sol", + "filename_short": "tests/detectors/low-level-calls/0.4.25/low_level_calls.sol", "is_dependency": false, "lines": [ 4, @@ -113,9 +113,9 @@ } } ], - "description": "Low level call in Sender.send(address) (tests/detectors/low-level-calls/low_level_calls.sol#5-7):\n\t- _receiver.call.value(msg.value).gas(7777)() (tests/detectors/low-level-calls/low_level_calls.sol#6)\n", - "markdown": "Low level call in [Sender.send(address)](tests/detectors/low-level-calls/low_level_calls.sol#L5-L7):\n\t- [_receiver.call.value(msg.value).gas(7777)()](tests/detectors/low-level-calls/low_level_calls.sol#L6)\n", - "id": "d017cb7447192393962f70f0ae2db6a8add9289b5cf4d4afbab9f41dec07f613", + "description": "Low level call in Sender.send(address) (tests/detectors/low-level-calls/0.4.25/low_level_calls.sol#5-7):\n\t- _receiver.call.value(msg.value).gas(7777)() (tests/detectors/low-level-calls/0.4.25/low_level_calls.sol#6)\n", + "markdown": "Low level call in [Sender.send(address)](tests/detectors/low-level-calls/0.4.25/low_level_calls.sol#L5-L7):\n\t- [_receiver.call.value(msg.value).gas(7777)()](tests/detectors/low-level-calls/0.4.25/low_level_calls.sol#L6)\n", + "id": "77c8d8f4e884ababeb6c197067a580529b5bbec638ebc1ac2761719de99c5ed1", "check": "low-level-calls", "impact": "Informational", "confidence": "High" diff --git a/tests/detectors/low-level-calls/0.5.16/low_level_calls.sol b/tests/detectors/low-level-calls/0.5.16/low_level_calls.sol new file mode 100644 index 0000000000..45d732a54e --- /dev/null +++ b/tests/detectors/low-level-calls/0.5.16/low_level_calls.sol @@ -0,0 +1,17 @@ +//pragma solidity ^0.4.24; + + +contract Sender { + function send(address _receiver) payable external { + _receiver.call.value(msg.value).gas(7777)(""); + } +} + + +contract Receiver { + uint public balance = 0; + + function () payable external{ + balance += msg.value; + } +} diff --git a/tests/detectors/low-level-calls/low_level_calls.sol.0.5.1.LowLevelCalls.json b/tests/detectors/low-level-calls/0.5.16/low_level_calls.sol.0.5.16.LowLevelCalls.json similarity index 85% rename from tests/detectors/low-level-calls/low_level_calls.sol.0.5.1.LowLevelCalls.json rename to tests/detectors/low-level-calls/0.5.16/low_level_calls.sol.0.5.16.LowLevelCalls.json index 77c4d1c13d..eaa46631c8 100644 --- a/tests/detectors/low-level-calls/low_level_calls.sol.0.5.1.LowLevelCalls.json +++ b/tests/detectors/low-level-calls/0.5.16/low_level_calls.sol.0.5.16.LowLevelCalls.json @@ -9,9 +9,9 @@ "start": 51, "length": 112, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/low-level-calls/low_level_calls.sol", + "filename_relative": "tests/detectors/low-level-calls/0.5.16/low_level_calls.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/low-level-calls/low_level_calls.sol", + "filename_short": "tests/detectors/low-level-calls/0.5.16/low_level_calls.sol", "is_dependency": false, "lines": [ 5, @@ -29,9 +29,9 @@ "start": 29, "length": 136, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/low-level-calls/low_level_calls.sol", + "filename_relative": "tests/detectors/low-level-calls/0.5.16/low_level_calls.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/low-level-calls/low_level_calls.sol", + "filename_short": "tests/detectors/low-level-calls/0.5.16/low_level_calls.sol", "is_dependency": false, "lines": [ 4, @@ -54,9 +54,9 @@ "start": 111, "length": 45, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/low-level-calls/low_level_calls.sol", + "filename_relative": "tests/detectors/low-level-calls/0.5.16/low_level_calls.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/low-level-calls/low_level_calls.sol", + "filename_short": "tests/detectors/low-level-calls/0.5.16/low_level_calls.sol", "is_dependency": false, "lines": [ 6 @@ -72,9 +72,9 @@ "start": 51, "length": 112, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/low-level-calls/low_level_calls.sol", + "filename_relative": "tests/detectors/low-level-calls/0.5.16/low_level_calls.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/low-level-calls/low_level_calls.sol", + "filename_short": "tests/detectors/low-level-calls/0.5.16/low_level_calls.sol", "is_dependency": false, "lines": [ 5, @@ -92,9 +92,9 @@ "start": 29, "length": 136, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/low-level-calls/low_level_calls.sol", + "filename_relative": "tests/detectors/low-level-calls/0.5.16/low_level_calls.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/low-level-calls/low_level_calls.sol", + "filename_short": "tests/detectors/low-level-calls/0.5.16/low_level_calls.sol", "is_dependency": false, "lines": [ 4, @@ -113,9 +113,9 @@ } } ], - "description": "Low level call in Sender.send(address) (tests/detectors/low-level-calls/low_level_calls.sol#5-7):\n\t- _receiver.call.value(msg.value).gas(7777)() (tests/detectors/low-level-calls/low_level_calls.sol#6)\n", - "markdown": "Low level call in [Sender.send(address)](tests/detectors/low-level-calls/low_level_calls.sol#L5-L7):\n\t- [_receiver.call.value(msg.value).gas(7777)()](tests/detectors/low-level-calls/low_level_calls.sol#L6)\n", - "id": "d017cb7447192393962f70f0ae2db6a8add9289b5cf4d4afbab9f41dec07f613", + "description": "Low level call in Sender.send(address) (tests/detectors/low-level-calls/0.5.16/low_level_calls.sol#5-7):\n\t- _receiver.call.value(msg.value).gas(7777)() (tests/detectors/low-level-calls/0.5.16/low_level_calls.sol#6)\n", + "markdown": "Low level call in [Sender.send(address)](tests/detectors/low-level-calls/0.5.16/low_level_calls.sol#L5-L7):\n\t- [_receiver.call.value(msg.value).gas(7777)()](tests/detectors/low-level-calls/0.5.16/low_level_calls.sol#L6)\n", + "id": "63c001820deebca3c0e65f71e6d2c6ada9534d4aefd1a317e2332af26533f42e", "check": "low-level-calls", "impact": "Informational", "confidence": "High" diff --git a/tests/detectors/low-level-calls/0.6.11/low_level_calls.sol b/tests/detectors/low-level-calls/0.6.11/low_level_calls.sol new file mode 100644 index 0000000000..902350b1ca --- /dev/null +++ b/tests/detectors/low-level-calls/0.6.11/low_level_calls.sol @@ -0,0 +1,17 @@ +//pragma solidity ^0.4.24; + + +contract Sender { + function send(address _receiver) payable external { + _receiver.call.value(msg.value).gas(7777)(""); + } +} + + +contract Receiver { + uint public balance = 0; + + receive () payable external{ + balance += msg.value; + } +} diff --git a/tests/detectors/low-level-calls/0.6.11/low_level_calls.sol.0.6.11.LowLevelCalls.json b/tests/detectors/low-level-calls/0.6.11/low_level_calls.sol.0.6.11.LowLevelCalls.json new file mode 100644 index 0000000000..506b70efa9 --- /dev/null +++ b/tests/detectors/low-level-calls/0.6.11/low_level_calls.sol.0.6.11.LowLevelCalls.json @@ -0,0 +1,124 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "send", + "source_mapping": { + "start": 51, + "length": 112, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/low-level-calls/0.6.11/low_level_calls.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/low-level-calls/0.6.11/low_level_calls.sol", + "is_dependency": false, + "lines": [ + 5, + 6, + 7 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Sender", + "source_mapping": { + "start": 29, + "length": 136, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/low-level-calls/0.6.11/low_level_calls.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/low-level-calls/0.6.11/low_level_calls.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6, + 7, + 8 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "send(address)" + } + }, + { + "type": "node", + "name": "_receiver.call.value(msg.value).gas(7777)()", + "source_mapping": { + "start": 111, + "length": 45, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/low-level-calls/0.6.11/low_level_calls.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/low-level-calls/0.6.11/low_level_calls.sol", + "is_dependency": false, + "lines": [ + 6 + ], + "starting_column": 9, + "ending_column": 54 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "send", + "source_mapping": { + "start": 51, + "length": 112, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/low-level-calls/0.6.11/low_level_calls.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/low-level-calls/0.6.11/low_level_calls.sol", + "is_dependency": false, + "lines": [ + 5, + 6, + 7 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Sender", + "source_mapping": { + "start": 29, + "length": 136, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/low-level-calls/0.6.11/low_level_calls.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/low-level-calls/0.6.11/low_level_calls.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6, + 7, + 8 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "send(address)" + } + } + } + } + ], + "description": "Low level call in Sender.send(address) (tests/detectors/low-level-calls/0.6.11/low_level_calls.sol#5-7):\n\t- _receiver.call.value(msg.value).gas(7777)() (tests/detectors/low-level-calls/0.6.11/low_level_calls.sol#6)\n", + "markdown": "Low level call in [Sender.send(address)](tests/detectors/low-level-calls/0.6.11/low_level_calls.sol#L5-L7):\n\t- [_receiver.call.value(msg.value).gas(7777)()](tests/detectors/low-level-calls/0.6.11/low_level_calls.sol#L6)\n", + "id": "af64e4f5c7127bf9646b2f1810f9977d0de6d8c27683a42915067fc0efa11f75", + "check": "low-level-calls", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/low-level-calls/0.7.6/low_level_calls.sol b/tests/detectors/low-level-calls/0.7.6/low_level_calls.sol new file mode 100644 index 0000000000..e315bb4b76 --- /dev/null +++ b/tests/detectors/low-level-calls/0.7.6/low_level_calls.sol @@ -0,0 +1,17 @@ +//pragma solidity ^0.4.24; + + +contract Sender { + function send(address _receiver) payable external { + _receiver.call{value:msg.value, gas:7777}(""); + } +} + + +contract Receiver { + uint public balance = 0; + + receive () payable external{ + balance += msg.value; + } +} diff --git a/tests/detectors/low-level-calls/0.7.6/low_level_calls.sol.0.7.6.LowLevelCalls.json b/tests/detectors/low-level-calls/0.7.6/low_level_calls.sol.0.7.6.LowLevelCalls.json new file mode 100644 index 0000000000..acb8f93814 --- /dev/null +++ b/tests/detectors/low-level-calls/0.7.6/low_level_calls.sol.0.7.6.LowLevelCalls.json @@ -0,0 +1,124 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "send", + "source_mapping": { + "start": 51, + "length": 112, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/low-level-calls/0.7.6/low_level_calls.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/low-level-calls/0.7.6/low_level_calls.sol", + "is_dependency": false, + "lines": [ + 5, + 6, + 7 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Sender", + "source_mapping": { + "start": 29, + "length": 136, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/low-level-calls/0.7.6/low_level_calls.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/low-level-calls/0.7.6/low_level_calls.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6, + 7, + 8 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "send(address)" + } + }, + { + "type": "node", + "name": "_receiver.call{gas: 7777,value: msg.value}()", + "source_mapping": { + "start": 111, + "length": 45, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/low-level-calls/0.7.6/low_level_calls.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/low-level-calls/0.7.6/low_level_calls.sol", + "is_dependency": false, + "lines": [ + 6 + ], + "starting_column": 9, + "ending_column": 54 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "send", + "source_mapping": { + "start": 51, + "length": 112, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/low-level-calls/0.7.6/low_level_calls.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/low-level-calls/0.7.6/low_level_calls.sol", + "is_dependency": false, + "lines": [ + 5, + 6, + 7 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Sender", + "source_mapping": { + "start": 29, + "length": 136, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/low-level-calls/0.7.6/low_level_calls.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/low-level-calls/0.7.6/low_level_calls.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6, + 7, + 8 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "send(address)" + } + } + } + } + ], + "description": "Low level call in Sender.send(address) (tests/detectors/low-level-calls/0.7.6/low_level_calls.sol#5-7):\n\t- _receiver.call{gas: 7777,value: msg.value}() (tests/detectors/low-level-calls/0.7.6/low_level_calls.sol#6)\n", + "markdown": "Low level call in [Sender.send(address)](tests/detectors/low-level-calls/0.7.6/low_level_calls.sol#L5-L7):\n\t- [_receiver.call{gas: 7777,value: msg.value}()](tests/detectors/low-level-calls/0.7.6/low_level_calls.sol#L6)\n", + "id": "ec014cc9f1ed1d83294a16253fc735b22f22eebba3953cdae61f6547550fd64d", + "check": "low-level-calls", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/mapping-deletion/MappingDeletion.sol b/tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol similarity index 97% rename from tests/detectors/mapping-deletion/MappingDeletion.sol rename to tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol index 48a9137dbb..bedbb64a8f 100644 --- a/tests/detectors/mapping-deletion/MappingDeletion.sol +++ b/tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +// pragma solidity ^0.4.24; library Lib{ diff --git a/tests/detectors/mapping-deletion/MappingDeletion.sol.0.4.25.MappingDeletionDetection.json b/tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol.0.4.25.MappingDeletionDetection.json similarity index 84% rename from tests/detectors/mapping-deletion/MappingDeletion.sol.0.4.25.MappingDeletionDetection.json rename to tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol.0.4.25.MappingDeletionDetection.json index fc6c7243bf..164b006141 100644 --- a/tests/detectors/mapping-deletion/MappingDeletion.sol.0.4.25.MappingDeletionDetection.json +++ b/tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol.0.4.25.MappingDeletionDetection.json @@ -6,12 +6,12 @@ "type": "function", "name": "deleteSt", "source_mapping": { - "start": 111, + "start": 114, "length": 70, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_relative": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_short": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "is_dependency": false, "lines": [ 9, @@ -26,12 +26,12 @@ "type": "contract", "name": "Lib", "source_mapping": { - "start": 26, + "start": 29, "length": 158, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_relative": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_short": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "is_dependency": false, "lines": [ 3, @@ -57,12 +57,12 @@ "type": "struct", "name": "MyStruct", "source_mapping": { - "start": 44, + "start": 47, "length": 61, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_relative": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_short": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "is_dependency": false, "lines": [ 5, @@ -77,12 +77,12 @@ "type": "contract", "name": "Lib", "source_mapping": { - "start": 26, + "start": 29, "length": 158, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_relative": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_short": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "is_dependency": false, "lines": [ 3, @@ -107,12 +107,12 @@ "type": "node", "name": "delete st[0]", "source_mapping": { - "start": 162, + "start": 165, "length": 12, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_relative": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_short": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "is_dependency": false, "lines": [ 10 @@ -125,12 +125,12 @@ "type": "function", "name": "deleteSt", "source_mapping": { - "start": 111, + "start": 114, "length": 70, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_relative": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_short": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "is_dependency": false, "lines": [ 9, @@ -145,12 +145,12 @@ "type": "contract", "name": "Lib", "source_mapping": { - "start": 26, + "start": 29, "length": 158, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_relative": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_short": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "is_dependency": false, "lines": [ 3, @@ -175,9 +175,9 @@ } } ], - "description": "Lib.deleteSt(Lib.MyStruct[1]) (tests/detectors/mapping-deletion/MappingDeletion.sol#9-11) deletes Lib.MyStruct (tests/detectors/mapping-deletion/MappingDeletion.sol#5-7) which contains a mapping:\n\t-delete st[0] (tests/detectors/mapping-deletion/MappingDeletion.sol#10)\n", - "markdown": "[Lib.deleteSt(Lib.MyStruct[1])](tests/detectors/mapping-deletion/MappingDeletion.sol#L9-L11) deletes [Lib.MyStruct](tests/detectors/mapping-deletion/MappingDeletion.sol#L5-L7) which contains a mapping:\n\t-[delete st[0]](tests/detectors/mapping-deletion/MappingDeletion.sol#L10)\n", - "id": "d618551637c257938461c33070c5339207b75de2bb11ff88d92bd9679252f307", + "description": "Lib.deleteSt(Lib.MyStruct[1]) (tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol#9-11) deletes Lib.MyStruct (tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol#5-7) which contains a mapping:\n\t-delete st[0] (tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol#10)\n", + "markdown": "[Lib.deleteSt(Lib.MyStruct[1])](tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol#L9-L11) deletes [Lib.MyStruct](tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol#L5-L7) which contains a mapping:\n\t-[delete st[0]](tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol#L10)\n", + "id": "8c8313f12eb11c77c9acf1f683fe6d44a79ca1445e0d92cffd79c04a3462d3e9", "check": "mapping-deletion", "impact": "Medium", "confidence": "High" @@ -188,12 +188,12 @@ "type": "function", "name": "deleteBalance", "source_mapping": { - "start": 541, + "start": 544, "length": 137, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_relative": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_short": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "is_dependency": false, "lines": [ 28, @@ -209,12 +209,12 @@ "type": "contract", "name": "Balances", "source_mapping": { - "start": 186, + "start": 189, "length": 825, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_relative": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_short": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "is_dependency": false, "lines": [ 15, @@ -258,12 +258,12 @@ "type": "struct", "name": "BalancesStruct", "source_mapping": { - "start": 215, + "start": 218, "length": 94, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_relative": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_short": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "is_dependency": false, "lines": [ 17, @@ -279,12 +279,12 @@ "type": "contract", "name": "Balances", "source_mapping": { - "start": 186, + "start": 189, "length": 825, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_relative": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_short": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "is_dependency": false, "lines": [ 15, @@ -327,12 +327,12 @@ "type": "node", "name": "delete stackBalance[idx]", "source_mapping": { - "start": 647, + "start": 650, "length": 24, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_relative": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_short": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "is_dependency": false, "lines": [ 30 @@ -345,12 +345,12 @@ "type": "function", "name": "deleteBalance", "source_mapping": { - "start": 541, + "start": 544, "length": 137, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_relative": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_short": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "is_dependency": false, "lines": [ 28, @@ -366,12 +366,12 @@ "type": "contract", "name": "Balances", "source_mapping": { - "start": 186, + "start": 189, "length": 825, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_relative": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/mapping-deletion/MappingDeletion.sol", + "filename_short": "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "is_dependency": false, "lines": [ 15, @@ -414,9 +414,9 @@ } } ], - "description": "Balances.deleteBalance(uint256) (tests/detectors/mapping-deletion/MappingDeletion.sol#28-31) deletes Balances.BalancesStruct (tests/detectors/mapping-deletion/MappingDeletion.sol#17-20) which contains a mapping:\n\t-delete stackBalance[idx] (tests/detectors/mapping-deletion/MappingDeletion.sol#30)\n", - "markdown": "[Balances.deleteBalance(uint256)](tests/detectors/mapping-deletion/MappingDeletion.sol#L28-L31) deletes [Balances.BalancesStruct](tests/detectors/mapping-deletion/MappingDeletion.sol#L17-L20) which contains a mapping:\n\t-[delete stackBalance[idx]](tests/detectors/mapping-deletion/MappingDeletion.sol#L30)\n", - "id": "a1e8bc34ec8ef7969409701b3c851749c4ba00dcbbef2cabcdf7e3f49724034e", + "description": "Balances.deleteBalance(uint256) (tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol#28-31) deletes Balances.BalancesStruct (tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol#17-20) which contains a mapping:\n\t-delete stackBalance[idx] (tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol#30)\n", + "markdown": "[Balances.deleteBalance(uint256)](tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol#L28-L31) deletes [Balances.BalancesStruct](tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol#L17-L20) which contains a mapping:\n\t-[delete stackBalance[idx]](tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol#L30)\n", + "id": "6c8848cdccd246661513f2c5d83d03b4a1cb4f07e198a671ce0f6d27fda257ad", "check": "mapping-deletion", "impact": "Medium", "confidence": "High" diff --git a/tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol b/tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol new file mode 100644 index 0000000000..e1b608a463 --- /dev/null +++ b/tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol @@ -0,0 +1,44 @@ +// pragma solidity ^0.4.24; + +library Lib{ + + struct MyStruct{ + mapping(address => uint) maps; + } + + function deleteSt(MyStruct[1] storage st) internal { + delete st[0]; + } + +} + +contract Balances { + + struct BalancesStruct{ + address owner; + mapping(address => uint) balances; + } + + mapping(uint => BalancesStruct) public stackBalance; + function createBalance(uint idx) public { + require(stackBalance[idx].owner == address(0)); + BalancesStruct storage str = stackBalance[idx]; + str.owner = msg.sender; + } + + function deleteBalance(uint idx) public { + require(stackBalance[idx].owner == msg.sender); + delete stackBalance[idx]; + } + + function setBalance(uint idx, address addr, uint val) public { + require(stackBalance[idx].owner == msg.sender); + + stackBalance[idx].balances[addr] = val; + } + + function getBalance(uint idx, address addr) public view returns(uint){ + return stackBalance[idx].balances[addr]; + } + +} diff --git a/tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol.0.5.16.MappingDeletionDetection.json b/tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol.0.5.16.MappingDeletionDetection.json new file mode 100644 index 0000000000..c447dd328a --- /dev/null +++ b/tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol.0.5.16.MappingDeletionDetection.json @@ -0,0 +1,428 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "deleteSt", + "source_mapping": { + "start": 114, + "length": 80, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Lib", + "source_mapping": { + "start": 29, + "length": 168, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "deleteSt(Lib.MyStruct[1])" + } + }, + { + "type": "struct", + "name": "MyStruct", + "source_mapping": { + "start": 47, + "length": 61, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 5, + 6, + 7 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Lib", + "source_mapping": { + "start": 29, + "length": 168, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "node", + "name": "delete st[0]", + "source_mapping": { + "start": 175, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 9, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "deleteSt", + "source_mapping": { + "start": 114, + "length": 80, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Lib", + "source_mapping": { + "start": 29, + "length": 168, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "deleteSt(Lib.MyStruct[1])" + } + } + } + } + ], + "description": "Lib.deleteSt(Lib.MyStruct[1]) (tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol#9-11) deletes Lib.MyStruct (tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol#5-7) which contains a mapping:\n\t-delete st[0] (tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol#10)\n", + "markdown": "[Lib.deleteSt(Lib.MyStruct[1])](tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol#L9-L11) deletes [Lib.MyStruct](tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol#L5-L7) which contains a mapping:\n\t-[delete st[0]](tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol#L10)\n", + "id": "4c08076815986fec8b813cb66a7f7fe7002a5e87179bbd46e59279da2f46e992", + "check": "mapping-deletion", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "deleteBalance", + "source_mapping": { + "start": 595, + "length": 137, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 29, + 30, + 31, + 32 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Balances", + "source_mapping": { + "start": 199, + "length": 866, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "deleteBalance(uint256)" + } + }, + { + "type": "struct", + "name": "BalancesStruct", + "source_mapping": { + "start": 228, + "length": 94, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 17, + 18, + 19, + 20 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Balances", + "source_mapping": { + "start": 199, + "length": 866, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "node", + "name": "delete stackBalance[idx]", + "source_mapping": { + "start": 701, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 31 + ], + "starting_column": 9, + "ending_column": 33 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "deleteBalance", + "source_mapping": { + "start": 595, + "length": 137, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 29, + 30, + 31, + 32 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Balances", + "source_mapping": { + "start": 199, + "length": 866, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "deleteBalance(uint256)" + } + } + } + } + ], + "description": "Balances.deleteBalance(uint256) (tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol#29-32) deletes Balances.BalancesStruct (tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol#17-20) which contains a mapping:\n\t-delete stackBalance[idx] (tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol#31)\n", + "markdown": "[Balances.deleteBalance(uint256)](tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol#L29-L32) deletes [Balances.BalancesStruct](tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol#L17-L20) which contains a mapping:\n\t-[delete stackBalance[idx]](tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol#L31)\n", + "id": "22a793185576322b937d4887f31b8cb0b7c1cef90dde52abceb5ce57918267ec", + "check": "mapping-deletion", + "impact": "Medium", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol b/tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol new file mode 100644 index 0000000000..e1b608a463 --- /dev/null +++ b/tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol @@ -0,0 +1,44 @@ +// pragma solidity ^0.4.24; + +library Lib{ + + struct MyStruct{ + mapping(address => uint) maps; + } + + function deleteSt(MyStruct[1] storage st) internal { + delete st[0]; + } + +} + +contract Balances { + + struct BalancesStruct{ + address owner; + mapping(address => uint) balances; + } + + mapping(uint => BalancesStruct) public stackBalance; + function createBalance(uint idx) public { + require(stackBalance[idx].owner == address(0)); + BalancesStruct storage str = stackBalance[idx]; + str.owner = msg.sender; + } + + function deleteBalance(uint idx) public { + require(stackBalance[idx].owner == msg.sender); + delete stackBalance[idx]; + } + + function setBalance(uint idx, address addr, uint val) public { + require(stackBalance[idx].owner == msg.sender); + + stackBalance[idx].balances[addr] = val; + } + + function getBalance(uint idx, address addr) public view returns(uint){ + return stackBalance[idx].balances[addr]; + } + +} diff --git a/tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol.0.6.11.MappingDeletionDetection.json b/tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol.0.6.11.MappingDeletionDetection.json new file mode 100644 index 0000000000..7e4191c28f --- /dev/null +++ b/tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol.0.6.11.MappingDeletionDetection.json @@ -0,0 +1,428 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "deleteSt", + "source_mapping": { + "start": 114, + "length": 80, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Lib", + "source_mapping": { + "start": 29, + "length": 168, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "deleteSt(Lib.MyStruct[1])" + } + }, + { + "type": "struct", + "name": "MyStruct", + "source_mapping": { + "start": 47, + "length": 61, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 5, + 6, + 7 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Lib", + "source_mapping": { + "start": 29, + "length": 168, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "node", + "name": "delete st[0]", + "source_mapping": { + "start": 175, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 9, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "deleteSt", + "source_mapping": { + "start": 114, + "length": 80, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Lib", + "source_mapping": { + "start": 29, + "length": 168, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "deleteSt(Lib.MyStruct[1])" + } + } + } + } + ], + "description": "Lib.deleteSt(Lib.MyStruct[1]) (tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol#9-11) deletes Lib.MyStruct (tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol#5-7) which contains a mapping:\n\t-delete st[0] (tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol#10)\n", + "markdown": "[Lib.deleteSt(Lib.MyStruct[1])](tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol#L9-L11) deletes [Lib.MyStruct](tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol#L5-L7) which contains a mapping:\n\t-[delete st[0]](tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol#L10)\n", + "id": "08c9067f48ad8538ab7e311aacd07ac4cc0ffbfe6ce2ccfd9ba9cd2a9e799eda", + "check": "mapping-deletion", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "deleteBalance", + "source_mapping": { + "start": 595, + "length": 137, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 29, + 30, + 31, + 32 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Balances", + "source_mapping": { + "start": 199, + "length": 866, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "deleteBalance(uint256)" + } + }, + { + "type": "struct", + "name": "BalancesStruct", + "source_mapping": { + "start": 228, + "length": 94, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 17, + 18, + 19, + 20 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Balances", + "source_mapping": { + "start": 199, + "length": 866, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "node", + "name": "delete stackBalance[idx]", + "source_mapping": { + "start": 701, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 31 + ], + "starting_column": 9, + "ending_column": 33 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "deleteBalance", + "source_mapping": { + "start": 595, + "length": 137, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 29, + 30, + 31, + 32 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Balances", + "source_mapping": { + "start": 199, + "length": 866, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "deleteBalance(uint256)" + } + } + } + } + ], + "description": "Balances.deleteBalance(uint256) (tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol#29-32) deletes Balances.BalancesStruct (tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol#17-20) which contains a mapping:\n\t-delete stackBalance[idx] (tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol#31)\n", + "markdown": "[Balances.deleteBalance(uint256)](tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol#L29-L32) deletes [Balances.BalancesStruct](tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol#L17-L20) which contains a mapping:\n\t-[delete stackBalance[idx]](tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol#L31)\n", + "id": "6b7def5c6f4b5683fbf00d5b66df0f54110a6af8fbd0781b352dd72df5baccbc", + "check": "mapping-deletion", + "impact": "Medium", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol b/tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol new file mode 100644 index 0000000000..e1b608a463 --- /dev/null +++ b/tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol @@ -0,0 +1,44 @@ +// pragma solidity ^0.4.24; + +library Lib{ + + struct MyStruct{ + mapping(address => uint) maps; + } + + function deleteSt(MyStruct[1] storage st) internal { + delete st[0]; + } + +} + +contract Balances { + + struct BalancesStruct{ + address owner; + mapping(address => uint) balances; + } + + mapping(uint => BalancesStruct) public stackBalance; + function createBalance(uint idx) public { + require(stackBalance[idx].owner == address(0)); + BalancesStruct storage str = stackBalance[idx]; + str.owner = msg.sender; + } + + function deleteBalance(uint idx) public { + require(stackBalance[idx].owner == msg.sender); + delete stackBalance[idx]; + } + + function setBalance(uint idx, address addr, uint val) public { + require(stackBalance[idx].owner == msg.sender); + + stackBalance[idx].balances[addr] = val; + } + + function getBalance(uint idx, address addr) public view returns(uint){ + return stackBalance[idx].balances[addr]; + } + +} diff --git a/tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol.0.7.6.MappingDeletionDetection.json b/tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol.0.7.6.MappingDeletionDetection.json new file mode 100644 index 0000000000..774d72ce70 --- /dev/null +++ b/tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol.0.7.6.MappingDeletionDetection.json @@ -0,0 +1,428 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "deleteSt", + "source_mapping": { + "start": 114, + "length": 80, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Lib", + "source_mapping": { + "start": 29, + "length": 168, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "deleteSt(Lib.MyStruct[1])" + } + }, + { + "type": "struct", + "name": "MyStruct", + "source_mapping": { + "start": 47, + "length": 61, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 5, + 6, + 7 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Lib", + "source_mapping": { + "start": 29, + "length": 168, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "node", + "name": "delete st[0]", + "source_mapping": { + "start": 175, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 9, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "deleteSt", + "source_mapping": { + "start": 114, + "length": 80, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Lib", + "source_mapping": { + "start": 29, + "length": 168, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "deleteSt(Lib.MyStruct[1])" + } + } + } + } + ], + "description": "Lib.deleteSt(Lib.MyStruct[1]) (tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol#9-11) deletes Lib.MyStruct (tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol#5-7) which contains a mapping:\n\t-delete st[0] (tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol#10)\n", + "markdown": "[Lib.deleteSt(Lib.MyStruct[1])](tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol#L9-L11) deletes [Lib.MyStruct](tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol#L5-L7) which contains a mapping:\n\t-[delete st[0]](tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol#L10)\n", + "id": "a6c44f7353505e72d74433eef65af07e90cc95c3797d5b395766255f0ecb91e1", + "check": "mapping-deletion", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "deleteBalance", + "source_mapping": { + "start": 595, + "length": 137, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 29, + 30, + 31, + 32 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Balances", + "source_mapping": { + "start": 199, + "length": 866, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "deleteBalance(uint256)" + } + }, + { + "type": "struct", + "name": "BalancesStruct", + "source_mapping": { + "start": 228, + "length": 94, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 17, + 18, + 19, + 20 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Balances", + "source_mapping": { + "start": 199, + "length": 866, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "node", + "name": "delete stackBalance[idx]", + "source_mapping": { + "start": 701, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 31 + ], + "starting_column": 9, + "ending_column": 33 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "deleteBalance", + "source_mapping": { + "start": 595, + "length": 137, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 29, + 30, + 31, + 32 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Balances", + "source_mapping": { + "start": 199, + "length": 866, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "deleteBalance(uint256)" + } + } + } + } + ], + "description": "Balances.deleteBalance(uint256) (tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol#29-32) deletes Balances.BalancesStruct (tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol#17-20) which contains a mapping:\n\t-delete stackBalance[idx] (tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol#31)\n", + "markdown": "[Balances.deleteBalance(uint256)](tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol#L29-L32) deletes [Balances.BalancesStruct](tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol#L17-L20) which contains a mapping:\n\t-[delete stackBalance[idx]](tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol#L31)\n", + "id": "8b8d404f4b41f38833ede30ad76bd30b8ad035a2efc18a292426e554599b549b", + "check": "mapping-deletion", + "impact": "Medium", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/missing-inheritance/unimplemented_interfaces.sol b/tests/detectors/missing-inheritance/0.5.16/unimplemented_interfaces.sol similarity index 100% rename from tests/detectors/missing-inheritance/unimplemented_interfaces.sol rename to tests/detectors/missing-inheritance/0.5.16/unimplemented_interfaces.sol diff --git a/tests/detectors/missing-inheritance/0.5.16/unimplemented_interfaces.sol.0.5.16.UnimplementedFunctionDetection.json b/tests/detectors/missing-inheritance/0.5.16/unimplemented_interfaces.sol.0.5.16.UnimplementedFunctionDetection.json new file mode 100644 index 0000000000..5825bcacc6 --- /dev/null +++ b/tests/detectors/missing-inheritance/0.5.16/unimplemented_interfaces.sol.0.5.16.UnimplementedFunctionDetection.json @@ -0,0 +1,3 @@ +[ + [] +] \ No newline at end of file diff --git a/tests/detectors/missing-inheritance/0.6.11/unimplemented_interfaces.sol b/tests/detectors/missing-inheritance/0.6.11/unimplemented_interfaces.sol new file mode 100644 index 0000000000..4e44552912 --- /dev/null +++ b/tests/detectors/missing-inheritance/0.6.11/unimplemented_interfaces.sol @@ -0,0 +1,72 @@ +/* Interfaces */ +interface ISomething0 { + function sth1(uint256) external; +} + +interface ISomething1 { + function sth1(uint256) external; + function sth2(bytes calldata) external; +} + +interface ISomething2 { + function sth(uint256) external; +} + +interface ISomething3 { + function sth1(uint256) external; + function sth2(bool) external; +} + +interface ISomething4 { + function sth1(uint256) external; + function sth2(bool) external; + function sth3(bytes calldata) external; +} + +interface ISomething5 { + function sth(uint256) external; + function sth1(uint256) external; +} + + + +/* Contracts */ + +contract bad0 { // forgets to say it is ISomething1 + function sth1(uint256 x) external {} + function sth2(bytes calldata y) external {} +} + +contract bad1 { // forgets to say it is ISomething4 + function sth1(uint256 x) external {} + function sth2(bool b) external {} + function sth3(bytes calldata y) external {} +} + +contract bad2 is ISomething3 { // forgets to say it is ISomething4 which is a superset of ISomething3 + function sth1(uint256 x) external override {} + function sth2(bool b) external override {} + function sth3(bytes calldata y) external {} +} + +contract good0 is ISomething2 { + function sth(uint256 x) external override {} +} + +/* Implements ISomething5 which is a superset of ISomething0 and ISomething2 */ +contract good1 is ISomething5 { + function sth(uint256 x) external override {} + function sth1(uint256 x) external override {} +} + +/* good2_i is not an Interface because sth5 is not external */ +abstract contract bad3_i { + function sth4(uint256 x) external virtual; + function sth5(uint256 x) public virtual; +} + +contract bad3 { + function sth4(uint256 x) external {} + function sth5(uint256 x) public {} +} + diff --git a/tests/detectors/missing-inheritance/0.6.11/unimplemented_interfaces.sol.0.6.11.UnimplementedFunctionDetection.json b/tests/detectors/missing-inheritance/0.6.11/unimplemented_interfaces.sol.0.6.11.UnimplementedFunctionDetection.json new file mode 100644 index 0000000000..5825bcacc6 --- /dev/null +++ b/tests/detectors/missing-inheritance/0.6.11/unimplemented_interfaces.sol.0.6.11.UnimplementedFunctionDetection.json @@ -0,0 +1,3 @@ +[ + [] +] \ No newline at end of file diff --git a/tests/detectors/missing-inheritance/0.7.6/unimplemented_interfaces.sol b/tests/detectors/missing-inheritance/0.7.6/unimplemented_interfaces.sol new file mode 100644 index 0000000000..4e44552912 --- /dev/null +++ b/tests/detectors/missing-inheritance/0.7.6/unimplemented_interfaces.sol @@ -0,0 +1,72 @@ +/* Interfaces */ +interface ISomething0 { + function sth1(uint256) external; +} + +interface ISomething1 { + function sth1(uint256) external; + function sth2(bytes calldata) external; +} + +interface ISomething2 { + function sth(uint256) external; +} + +interface ISomething3 { + function sth1(uint256) external; + function sth2(bool) external; +} + +interface ISomething4 { + function sth1(uint256) external; + function sth2(bool) external; + function sth3(bytes calldata) external; +} + +interface ISomething5 { + function sth(uint256) external; + function sth1(uint256) external; +} + + + +/* Contracts */ + +contract bad0 { // forgets to say it is ISomething1 + function sth1(uint256 x) external {} + function sth2(bytes calldata y) external {} +} + +contract bad1 { // forgets to say it is ISomething4 + function sth1(uint256 x) external {} + function sth2(bool b) external {} + function sth3(bytes calldata y) external {} +} + +contract bad2 is ISomething3 { // forgets to say it is ISomething4 which is a superset of ISomething3 + function sth1(uint256 x) external override {} + function sth2(bool b) external override {} + function sth3(bytes calldata y) external {} +} + +contract good0 is ISomething2 { + function sth(uint256 x) external override {} +} + +/* Implements ISomething5 which is a superset of ISomething0 and ISomething2 */ +contract good1 is ISomething5 { + function sth(uint256 x) external override {} + function sth1(uint256 x) external override {} +} + +/* good2_i is not an Interface because sth5 is not external */ +abstract contract bad3_i { + function sth4(uint256 x) external virtual; + function sth5(uint256 x) public virtual; +} + +contract bad3 { + function sth4(uint256 x) external {} + function sth5(uint256 x) public {} +} + diff --git a/tests/detectors/missing-inheritance/0.7.6/unimplemented_interfaces.sol.0.7.6.UnimplementedFunctionDetection.json b/tests/detectors/missing-inheritance/0.7.6/unimplemented_interfaces.sol.0.7.6.UnimplementedFunctionDetection.json new file mode 100644 index 0000000000..5825bcacc6 --- /dev/null +++ b/tests/detectors/missing-inheritance/0.7.6/unimplemented_interfaces.sol.0.7.6.UnimplementedFunctionDetection.json @@ -0,0 +1,3 @@ +[ + [] +] \ No newline at end of file diff --git a/tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol b/tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol new file mode 100644 index 0000000000..f06a60d697 --- /dev/null +++ b/tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol @@ -0,0 +1,71 @@ +contract C { + address owner; + + modifier check_addr(address _addr) { + if (_addr != address(0)) { + _; + } + } + + function bad0_set_owner(address new_owner) payable public{ + owner = new_owner; // No check before use + } + + function bad1_send(address addr) payable public{ + addr.send(msg.value); // No check before send + addr.send(msg.value); + } + + function bad2_transfer(address addr) payable public{ + addr.transfer(msg.value); // No check before transfer + } + + function bad3_transfer(address addr) payable public{ + addr.transfer(msg.value); + require(addr != address(0)); // check after transfer just to verify detector heuristic implementation. + } + + function bad4_call(address addr) payable public{ + addr.call.value(msg.value)(""); // No check before call + } + + function good0_set_owner(address new_owner) payable public{ + if (new_owner != address(0)) { // Check + owner = new_owner; + } + } + + function good1_set_owner() payable public{ + owner = 0x0123456789012345678901234567890123456789; // No tainting + } + + function good2_send(address addr) payable public{ + if (addr != address(0)) { + addr.send(msg.value); // check before send + } + } + + function good3_transfer(address addr) payable public{ + if (addr != address(0)) { + addr.transfer(msg.value); // check before transfer + } + } + + function good4_transfer(address addr) payable public{ + require(addr != address(0)); + addr.transfer(msg.value); // check in above require before transfer + } + + function good5_transfer(address addr) payable public check_addr(addr) { + addr.transfer(msg.value); // checked in modifier before transfer + } + + function good6_msg_sender() payable public { + owner = msg.sender; // msg.sender does not need to be zero validated + } + + function good7_transfer_msg_sender() payable public { + address addr = msg.sender; + addr.transfer(msg.value); // msg.sender does not need to be zero validated + } +} diff --git a/tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol.0.4.25.MissingZeroAddressValidation.json b/tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol.0.4.25.MissingZeroAddressValidation.json new file mode 100644 index 0000000000..008e6007ae --- /dev/null +++ b/tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol.0.4.25.MissingZeroAddressValidation.json @@ -0,0 +1,1500 @@ +[ + [ + { + "elements": [ + { + "type": "variable", + "name": "new_owner", + "source_mapping": { + "start": 149, + "length": 17, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 27, + "ending_column": 44 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0_set_owner", + "source_mapping": { + "start": 125, + "length": 108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 1977, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0_set_owner(address)" + } + } + } + }, + { + "type": "node", + "name": "owner = new_owner", + "source_mapping": { + "start": 188, + "length": 17, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 11 + ], + "starting_column": 5, + "ending_column": 22 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0_set_owner", + "source_mapping": { + "start": 125, + "length": 108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 1977, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0_set_owner(address)" + } + } + } + } + ], + "description": "C.bad0_set_owner(address).new_owner (tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol#10) lacks a zero-check on :\n\t\t- owner = new_owner (tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol#11)\n", + "markdown": "[C.bad0_set_owner(address).new_owner](tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol#L10) lacks a zero-check on :\n\t\t- [owner = new_owner](tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol#L11)\n", + "id": "4215a731670a0150f45d8cd682dc81ed85ffd5268cbad6ac9fe8bd044e54f74d", + "check": "missing-zero-check", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "variable", + "name": "addr", + "source_mapping": { + "start": 256, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 14 + ], + "starting_column": 22, + "ending_column": 34 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1_send", + "source_mapping": { + "start": 237, + "length": 129, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 1977, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1_send(address)" + } + } + } + }, + { + "type": "node", + "name": "addr.send(msg.value)", + "source_mapping": { + "start": 290, + "length": 20, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 15 + ], + "starting_column": 5, + "ending_column": 25 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1_send", + "source_mapping": { + "start": 237, + "length": 129, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 1977, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1_send(address)" + } + } + } + }, + { + "type": "node", + "name": "addr.send(msg.value)", + "source_mapping": { + "start": 340, + "length": 20, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 16 + ], + "starting_column": 5, + "ending_column": 25 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1_send", + "source_mapping": { + "start": 237, + "length": 129, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 1977, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1_send(address)" + } + } + } + } + ], + "description": "C.bad1_send(address).addr (tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol#14) lacks a zero-check on :\n\t\t- addr.send(msg.value) (tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol#15)\n\t\t- addr.send(msg.value) (tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol#16)\n", + "markdown": "[C.bad1_send(address).addr](tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol#L14) lacks a zero-check on :\n\t\t- [addr.send(msg.value)](tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol#L15)\n\t\t- [addr.send(msg.value)](tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol#L16)\n", + "id": "dd2af335a7782a70944073bf1cf5dea69845ddcf6a45ea86a9fcf59793b151c8", + "check": "missing-zero-check", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "variable", + "name": "addr", + "source_mapping": { + "start": 393, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 19 + ], + "starting_column": 26, + "ending_column": 38 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2_transfer", + "source_mapping": { + "start": 370, + "length": 114, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 19, + 20, + 21 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 1977, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2_transfer(address)" + } + } + } + }, + { + "type": "node", + "name": "addr.transfer(msg.value)", + "source_mapping": { + "start": 427, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 20 + ], + "starting_column": 5, + "ending_column": 29 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2_transfer", + "source_mapping": { + "start": 370, + "length": 114, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 19, + 20, + 21 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 1977, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2_transfer(address)" + } + } + } + } + ], + "description": "C.bad2_transfer(address).addr (tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol#19) lacks a zero-check on :\n\t\t- addr.transfer(msg.value) (tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol#20)\n", + "markdown": "[C.bad2_transfer(address).addr](tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol#L19) lacks a zero-check on :\n\t\t- [addr.transfer(msg.value)](tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol#L20)\n", + "id": "16629b342aad1ee3e0d3f933781eea91f1cb34b1770f84cb38a5d911e15b3476", + "check": "missing-zero-check", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "variable", + "name": "addr", + "source_mapping": { + "start": 511, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 23 + ], + "starting_column": 26, + "ending_column": 38 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad3_transfer", + "source_mapping": { + "start": 488, + "length": 195, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 23, + 24, + 25, + 26 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 1977, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad3_transfer(address)" + } + } + } + }, + { + "type": "node", + "name": "addr.transfer(msg.value)", + "source_mapping": { + "start": 545, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 24 + ], + "starting_column": 5, + "ending_column": 29 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad3_transfer", + "source_mapping": { + "start": 488, + "length": 195, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 23, + 24, + 25, + 26 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 1977, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad3_transfer(address)" + } + } + } + } + ], + "description": "C.bad3_transfer(address).addr (tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol#23) lacks a zero-check on :\n\t\t- addr.transfer(msg.value) (tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol#24)\n", + "markdown": "[C.bad3_transfer(address).addr](tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol#L23) lacks a zero-check on :\n\t\t- [addr.transfer(msg.value)](tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol#L24)\n", + "id": "27318d51c369e1e169a889a6c2678a023a22e1e3a691ab41a429684e338d2d1e", + "check": "missing-zero-check", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "variable", + "name": "addr", + "source_mapping": { + "start": 706, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 28 + ], + "starting_column": 22, + "ending_column": 34 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad4_call", + "source_mapping": { + "start": 687, + "length": 112, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 28, + 29, + 30 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 1977, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad4_call(address)" + } + } + } + }, + { + "type": "node", + "name": "addr.call.value(msg.value)()", + "source_mapping": { + "start": 740, + "length": 30, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 29 + ], + "starting_column": 5, + "ending_column": 35 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad4_call", + "source_mapping": { + "start": 687, + "length": 112, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 28, + 29, + 30 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 1977, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad4_call(address)" + } + } + } + } + ], + "description": "C.bad4_call(address).addr (tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol#28) lacks a zero-check on :\n\t\t- addr.call.value(msg.value)() (tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol#29)\n", + "markdown": "[C.bad4_call(address).addr](tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol#L28) lacks a zero-check on :\n\t\t- [addr.call.value(msg.value)()](tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol#L29)\n", + "id": "34b73dbecfa159bc5631cb95ff2343c92792d80f448fc425b7d1bba399108073", + "check": "missing-zero-check", + "impact": "Low", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/missing-zero-check/missing_zero_address_validation.sol b/tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol similarity index 100% rename from tests/detectors/missing-zero-check/missing_zero_address_validation.sol rename to tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol diff --git a/tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol.0.5.16.MissingZeroAddressValidation.json b/tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol.0.5.16.MissingZeroAddressValidation.json new file mode 100644 index 0000000000..59df1fd265 --- /dev/null +++ b/tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol.0.5.16.MissingZeroAddressValidation.json @@ -0,0 +1,1500 @@ +[ + [ + { + "elements": [ + { + "type": "variable", + "name": "new_owner", + "source_mapping": { + "start": 149, + "length": 17, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 27, + "ending_column": 44 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0_set_owner", + "source_mapping": { + "start": 125, + "length": 108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 2049, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0_set_owner(address)" + } + } + } + }, + { + "type": "node", + "name": "owner = new_owner", + "source_mapping": { + "start": 188, + "length": 17, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 11 + ], + "starting_column": 5, + "ending_column": 22 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0_set_owner", + "source_mapping": { + "start": 125, + "length": 108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 2049, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0_set_owner(address)" + } + } + } + } + ], + "description": "C.bad0_set_owner(address).new_owner (tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol#10) lacks a zero-check on :\n\t\t- owner = new_owner (tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol#11)\n", + "markdown": "[C.bad0_set_owner(address).new_owner](tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol#L10) lacks a zero-check on :\n\t\t- [owner = new_owner](tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol#L11)\n", + "id": "ac59285350b35c2b885a6e9efe641474ae51b830fad5856f622fe264096e44cd", + "check": "missing-zero-check", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "variable", + "name": "addr", + "source_mapping": { + "start": 256, + "length": 20, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 14 + ], + "starting_column": 22, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1_send", + "source_mapping": { + "start": 237, + "length": 137, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 2049, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1_send(address)" + } + } + } + }, + { + "type": "node", + "name": "addr.send(msg.value)", + "source_mapping": { + "start": 298, + "length": 20, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 15 + ], + "starting_column": 5, + "ending_column": 25 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1_send", + "source_mapping": { + "start": 237, + "length": 137, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 2049, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1_send(address)" + } + } + } + }, + { + "type": "node", + "name": "addr.send(msg.value)", + "source_mapping": { + "start": 348, + "length": 20, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 16 + ], + "starting_column": 5, + "ending_column": 25 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1_send", + "source_mapping": { + "start": 237, + "length": 137, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 2049, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1_send(address)" + } + } + } + } + ], + "description": "C.bad1_send(address).addr (tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol#14) lacks a zero-check on :\n\t\t- addr.send(msg.value) (tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol#15)\n\t\t- addr.send(msg.value) (tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol#16)\n", + "markdown": "[C.bad1_send(address).addr](tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol#L14) lacks a zero-check on :\n\t\t- [addr.send(msg.value)](tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol#L15)\n\t\t- [addr.send(msg.value)](tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol#L16)\n", + "id": "3d9ba6630d8f1357ab26196f519d74d6410a8e52994ae341d26a17d466200308", + "check": "missing-zero-check", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "variable", + "name": "addr", + "source_mapping": { + "start": 401, + "length": 20, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 19 + ], + "starting_column": 26, + "ending_column": 46 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2_transfer", + "source_mapping": { + "start": 378, + "length": 122, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 19, + 20, + 21 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 2049, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2_transfer(address)" + } + } + } + }, + { + "type": "node", + "name": "addr.transfer(msg.value)", + "source_mapping": { + "start": 443, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 20 + ], + "starting_column": 5, + "ending_column": 29 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2_transfer", + "source_mapping": { + "start": 378, + "length": 122, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 19, + 20, + 21 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 2049, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2_transfer(address)" + } + } + } + } + ], + "description": "C.bad2_transfer(address).addr (tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol#19) lacks a zero-check on :\n\t\t- addr.transfer(msg.value) (tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol#20)\n", + "markdown": "[C.bad2_transfer(address).addr](tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol#L19) lacks a zero-check on :\n\t\t- [addr.transfer(msg.value)](tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol#L20)\n", + "id": "654c703c39420ad30e6624b6a98892faffc5e90820e7aabfd3cd66fe8870b7b8", + "check": "missing-zero-check", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "variable", + "name": "addr", + "source_mapping": { + "start": 527, + "length": 20, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 23 + ], + "starting_column": 26, + "ending_column": 46 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad3_transfer", + "source_mapping": { + "start": 504, + "length": 203, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 23, + 24, + 25, + 26 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 2049, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad3_transfer(address)" + } + } + } + }, + { + "type": "node", + "name": "addr.transfer(msg.value)", + "source_mapping": { + "start": 569, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 24 + ], + "starting_column": 5, + "ending_column": 29 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad3_transfer", + "source_mapping": { + "start": 504, + "length": 203, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 23, + 24, + 25, + 26 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 2049, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad3_transfer(address)" + } + } + } + } + ], + "description": "C.bad3_transfer(address).addr (tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol#23) lacks a zero-check on :\n\t\t- addr.transfer(msg.value) (tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol#24)\n", + "markdown": "[C.bad3_transfer(address).addr](tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol#L23) lacks a zero-check on :\n\t\t- [addr.transfer(msg.value)](tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol#L24)\n", + "id": "98f43dd716a11685725ad4c615b07dd773bcf0f1c7710357fa1a5606084dd999", + "check": "missing-zero-check", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "variable", + "name": "addr", + "source_mapping": { + "start": 730, + "length": 20, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 28 + ], + "starting_column": 22, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad4_call", + "source_mapping": { + "start": 711, + "length": 120, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 28, + 29, + 30 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 2049, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad4_call(address)" + } + } + } + }, + { + "type": "node", + "name": "addr.call.value(msg.value)()", + "source_mapping": { + "start": 772, + "length": 30, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 29 + ], + "starting_column": 5, + "ending_column": 35 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad4_call", + "source_mapping": { + "start": 711, + "length": 120, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 28, + 29, + 30 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 2049, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad4_call(address)" + } + } + } + } + ], + "description": "C.bad4_call(address).addr (tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol#28) lacks a zero-check on :\n\t\t- addr.call.value(msg.value)() (tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol#29)\n", + "markdown": "[C.bad4_call(address).addr](tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol#L28) lacks a zero-check on :\n\t\t- [addr.call.value(msg.value)()](tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol#L29)\n", + "id": "aa90b9a8002d093f5996492eae0d441bde928e8187fc6d2790f973f6383d6095", + "check": "missing-zero-check", + "impact": "Low", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol b/tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol new file mode 100644 index 0000000000..1757c44550 --- /dev/null +++ b/tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol @@ -0,0 +1,71 @@ +contract C { + address owner; + + modifier check_addr(address _addr) { + if (_addr != address(0)) { + _; + } + } + + function bad0_set_owner(address new_owner) payable public{ + owner = new_owner; // No check before use + } + + function bad1_send(address payable addr) payable public{ + addr.send(msg.value); // No check before send + addr.send(msg.value); + } + + function bad2_transfer(address payable addr) payable public{ + addr.transfer(msg.value); // No check before transfer + } + + function bad3_transfer(address payable addr) payable public{ + addr.transfer(msg.value); + require(addr != address(0)); // check after transfer just to verify detector heuristic implementation. + } + + function bad4_call(address payable addr) payable public{ + addr.call.value(msg.value)(""); // No check before call + } + + function good0_set_owner(address new_owner) payable public{ + if (new_owner != address(0)) { // Check + owner = new_owner; + } + } + + function good1_set_owner() payable public{ + owner = 0x0123456789012345678901234567890123456789; // No tainting + } + + function good2_send(address payable addr) payable public{ + if (addr != address(0)) { + addr.send(msg.value); // check before send + } + } + + function good3_transfer(address payable addr) payable public{ + if (addr != address(0)) { + addr.transfer(msg.value); // check before transfer + } + } + + function good4_transfer(address payable addr) payable public{ + require(addr != address(0)); + addr.transfer(msg.value); // check in above require before transfer + } + + function good5_transfer(address payable addr) payable public check_addr(addr) { + addr.transfer(msg.value); // checked in modifier before transfer + } + + function good6_msg_sender() payable public { + owner = msg.sender; // msg.sender does not need to be zero validated + } + + function good7_transfer_msg_sender() payable public { + address payable addr = msg.sender; + addr.transfer(msg.value); // msg.sender does not need to be zero validated + } +} diff --git a/tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol.0.6.11.MissingZeroAddressValidation.json b/tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol.0.6.11.MissingZeroAddressValidation.json new file mode 100644 index 0000000000..6907fda3f6 --- /dev/null +++ b/tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol.0.6.11.MissingZeroAddressValidation.json @@ -0,0 +1,1500 @@ +[ + [ + { + "elements": [ + { + "type": "variable", + "name": "new_owner", + "source_mapping": { + "start": 149, + "length": 17, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 27, + "ending_column": 44 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0_set_owner", + "source_mapping": { + "start": 125, + "length": 108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 2049, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0_set_owner(address)" + } + } + } + }, + { + "type": "node", + "name": "owner = new_owner", + "source_mapping": { + "start": 188, + "length": 17, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 11 + ], + "starting_column": 5, + "ending_column": 22 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0_set_owner", + "source_mapping": { + "start": 125, + "length": 108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 2049, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0_set_owner(address)" + } + } + } + } + ], + "description": "C.bad0_set_owner(address).new_owner (tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol#10) lacks a zero-check on :\n\t\t- owner = new_owner (tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol#11)\n", + "markdown": "[C.bad0_set_owner(address).new_owner](tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol#L10) lacks a zero-check on :\n\t\t- [owner = new_owner](tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol#L11)\n", + "id": "1d2f6294ee0cfc4aae290fe04610e1df21d508008e75000ef017463482d78f95", + "check": "missing-zero-check", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "variable", + "name": "addr", + "source_mapping": { + "start": 256, + "length": 20, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 14 + ], + "starting_column": 22, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1_send", + "source_mapping": { + "start": 237, + "length": 137, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 2049, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1_send(address)" + } + } + } + }, + { + "type": "node", + "name": "addr.send(msg.value)", + "source_mapping": { + "start": 298, + "length": 20, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 15 + ], + "starting_column": 5, + "ending_column": 25 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1_send", + "source_mapping": { + "start": 237, + "length": 137, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 2049, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1_send(address)" + } + } + } + }, + { + "type": "node", + "name": "addr.send(msg.value)", + "source_mapping": { + "start": 348, + "length": 20, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 16 + ], + "starting_column": 5, + "ending_column": 25 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1_send", + "source_mapping": { + "start": 237, + "length": 137, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 2049, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1_send(address)" + } + } + } + } + ], + "description": "C.bad1_send(address).addr (tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol#14) lacks a zero-check on :\n\t\t- addr.send(msg.value) (tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol#15)\n\t\t- addr.send(msg.value) (tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol#16)\n", + "markdown": "[C.bad1_send(address).addr](tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol#L14) lacks a zero-check on :\n\t\t- [addr.send(msg.value)](tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol#L15)\n\t\t- [addr.send(msg.value)](tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol#L16)\n", + "id": "21de216080f0f27154e9b3cd2fef7ead38dacc945160b619923c33344d636826", + "check": "missing-zero-check", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "variable", + "name": "addr", + "source_mapping": { + "start": 401, + "length": 20, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 19 + ], + "starting_column": 26, + "ending_column": 46 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2_transfer", + "source_mapping": { + "start": 378, + "length": 122, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 19, + 20, + 21 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 2049, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2_transfer(address)" + } + } + } + }, + { + "type": "node", + "name": "addr.transfer(msg.value)", + "source_mapping": { + "start": 443, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 20 + ], + "starting_column": 5, + "ending_column": 29 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2_transfer", + "source_mapping": { + "start": 378, + "length": 122, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 19, + 20, + 21 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 2049, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2_transfer(address)" + } + } + } + } + ], + "description": "C.bad2_transfer(address).addr (tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol#19) lacks a zero-check on :\n\t\t- addr.transfer(msg.value) (tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol#20)\n", + "markdown": "[C.bad2_transfer(address).addr](tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol#L19) lacks a zero-check on :\n\t\t- [addr.transfer(msg.value)](tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol#L20)\n", + "id": "3d8300f19d40cb2f76fcb587f94e3dfc751319b119bd83af4cd7f962b680feb8", + "check": "missing-zero-check", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "variable", + "name": "addr", + "source_mapping": { + "start": 527, + "length": 20, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 23 + ], + "starting_column": 26, + "ending_column": 46 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad3_transfer", + "source_mapping": { + "start": 504, + "length": 203, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 23, + 24, + 25, + 26 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 2049, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad3_transfer(address)" + } + } + } + }, + { + "type": "node", + "name": "addr.transfer(msg.value)", + "source_mapping": { + "start": 569, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 24 + ], + "starting_column": 5, + "ending_column": 29 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad3_transfer", + "source_mapping": { + "start": 504, + "length": 203, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 23, + 24, + 25, + 26 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 2049, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad3_transfer(address)" + } + } + } + } + ], + "description": "C.bad3_transfer(address).addr (tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol#23) lacks a zero-check on :\n\t\t- addr.transfer(msg.value) (tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol#24)\n", + "markdown": "[C.bad3_transfer(address).addr](tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol#L23) lacks a zero-check on :\n\t\t- [addr.transfer(msg.value)](tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol#L24)\n", + "id": "efee9ceff8491c62ed42aab7c70b0a8d9c7731af8ecb304e6deafcc64a20c6f4", + "check": "missing-zero-check", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "variable", + "name": "addr", + "source_mapping": { + "start": 730, + "length": 20, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 28 + ], + "starting_column": 22, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad4_call", + "source_mapping": { + "start": 711, + "length": 120, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 28, + 29, + 30 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 2049, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad4_call(address)" + } + } + } + }, + { + "type": "node", + "name": "addr.call.value(msg.value)()", + "source_mapping": { + "start": 772, + "length": 30, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 29 + ], + "starting_column": 5, + "ending_column": 35 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad4_call", + "source_mapping": { + "start": 711, + "length": 120, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 28, + 29, + 30 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 0, + "length": 2049, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad4_call(address)" + } + } + } + } + ], + "description": "C.bad4_call(address).addr (tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol#28) lacks a zero-check on :\n\t\t- addr.call.value(msg.value)() (tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol#29)\n", + "markdown": "[C.bad4_call(address).addr](tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol#L28) lacks a zero-check on :\n\t\t- [addr.call.value(msg.value)()](tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol#L29)\n", + "id": "174a4f81c4e872deda0a31c10f8136b52d60adc89ba9be1548b308a09e225763", + "check": "missing-zero-check", + "impact": "Low", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol b/tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol new file mode 100644 index 0000000000..1ea01467bf --- /dev/null +++ b/tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol @@ -0,0 +1,71 @@ +contract C { + address owner; + + modifier check_addr(address _addr) { + if (_addr != address(0)) { + _; + } + } + + function bad0_set_owner(address new_owner) payable public{ + owner = new_owner; // No check before use + } + + function bad1_send(address payable addr) payable public{ + addr.send(msg.value); // No check before send + addr.send(msg.value); + } + + function bad2_transfer(address payable addr) payable public{ + addr.transfer(msg.value); // No check before transfer + } + + function bad3_transfer(address payable addr) payable public{ + addr.transfer(msg.value); + require(addr != address(0)); // check after transfer just to verify detector heuristic implementation. + } + + function bad4_call(address payable addr) payable public{ + addr.call{value:msg.value}(""); // No check before call + } + + function good0_set_owner(address new_owner) payable public{ + if (new_owner != address(0)) { // Check + owner = new_owner; + } + } + + function good1_set_owner() payable public{ + owner = 0x0123456789012345678901234567890123456789; // No tainting + } + + function good2_send(address payable addr) payable public{ + if (addr != address(0)) { + addr.send(msg.value); // check before send + } + } + + function good3_transfer(address payable addr) payable public{ + if (addr != address(0)) { + addr.transfer(msg.value); // check before transfer + } + } + + function good4_transfer(address payable addr) payable public{ + require(addr != address(0)); + addr.transfer(msg.value); // check in above require before transfer + } + + function good5_transfer(address payable addr) payable public check_addr(addr) { + addr.transfer(msg.value); // checked in modifier before transfer + } + + function good6_msg_sender() payable public { + owner = msg.sender; // msg.sender does not need to be zero validated + } + + function good7_transfer_msg_sender() payable public { + address payable addr = msg.sender; + addr.transfer(msg.value); // msg.sender does not need to be zero validated + } +} diff --git a/tests/detectors/missing-zero-check/missing_zero_address_validation.sol.0.5.12.MissingZeroAddressValidation.json b/tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol.0.7.6.MissingZeroAddressValidation.json similarity index 90% rename from tests/detectors/missing-zero-check/missing_zero_address_validation.sol.0.5.12.MissingZeroAddressValidation.json rename to tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol.0.7.6.MissingZeroAddressValidation.json index c5086a7429..a6dfd04e83 100644 --- a/tests/detectors/missing-zero-check/missing_zero_address_validation.sol.0.5.12.MissingZeroAddressValidation.json +++ b/tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol.0.7.6.MissingZeroAddressValidation.json @@ -9,9 +9,9 @@ "start": 149, "length": 17, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 10 @@ -27,9 +27,9 @@ "start": 125, "length": 108, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 10, @@ -47,9 +47,9 @@ "start": 0, "length": 2049, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 1, @@ -140,9 +140,9 @@ "start": 188, "length": 17, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 11 @@ -158,9 +158,9 @@ "start": 125, "length": 108, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 10, @@ -178,9 +178,9 @@ "start": 0, "length": 2049, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 1, @@ -265,9 +265,9 @@ } } ], - "description": "C.bad0_set_owner(address).new_owner (tests/detectors/missing-zero-check/missing_zero_address_validation.sol#10) lacks a zero-check on :\n\t\t- owner = new_owner (tests/detectors/missing-zero-check/missing_zero_address_validation.sol#11)\n", - "markdown": "[C.bad0_set_owner(address).new_owner](tests/detectors/missing-zero-check/missing_zero_address_validation.sol#L10) lacks a zero-check on :\n\t\t- [owner = new_owner](tests/detectors/missing-zero-check/missing_zero_address_validation.sol#L11)\n", - "id": "168903dd25312ca9d856795d30f3a7d5ae7bf7fd19db47b70bc50aaef5769e67", + "description": "C.bad0_set_owner(address).new_owner (tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol#10) lacks a zero-check on :\n\t\t- owner = new_owner (tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol#11)\n", + "markdown": "[C.bad0_set_owner(address).new_owner](tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol#L10) lacks a zero-check on :\n\t\t- [owner = new_owner](tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol#L11)\n", + "id": "2c8db81e6ce5a16bd76db4dd9d27d931037b6b06bacd06afa427e35f4dd22aa6", "check": "missing-zero-check", "impact": "Low", "confidence": "Medium" @@ -281,9 +281,9 @@ "start": 256, "length": 20, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 14 @@ -299,9 +299,9 @@ "start": 237, "length": 137, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 14, @@ -320,9 +320,9 @@ "start": 0, "length": 2049, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 1, @@ -413,9 +413,9 @@ "start": 298, "length": 20, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 15 @@ -431,9 +431,9 @@ "start": 237, "length": 137, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 14, @@ -452,9 +452,9 @@ "start": 0, "length": 2049, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 1, @@ -545,9 +545,9 @@ "start": 348, "length": 20, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 16 @@ -563,9 +563,9 @@ "start": 237, "length": 137, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 14, @@ -584,9 +584,9 @@ "start": 0, "length": 2049, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 1, @@ -671,9 +671,9 @@ } } ], - "description": "C.bad1_send(address).addr (tests/detectors/missing-zero-check/missing_zero_address_validation.sol#14) lacks a zero-check on :\n\t\t- addr.send(msg.value) (tests/detectors/missing-zero-check/missing_zero_address_validation.sol#15)\n\t\t- addr.send(msg.value) (tests/detectors/missing-zero-check/missing_zero_address_validation.sol#16)\n", - "markdown": "[C.bad1_send(address).addr](tests/detectors/missing-zero-check/missing_zero_address_validation.sol#L14) lacks a zero-check on :\n\t\t- [addr.send(msg.value)](tests/detectors/missing-zero-check/missing_zero_address_validation.sol#L15)\n\t\t- [addr.send(msg.value)](tests/detectors/missing-zero-check/missing_zero_address_validation.sol#L16)\n", - "id": "1c75c9e23f21886747d738e7fb033b4faf60cbeec7e7bc10b30cad6e05150323", + "description": "C.bad1_send(address).addr (tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol#14) lacks a zero-check on :\n\t\t- addr.send(msg.value) (tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol#15)\n\t\t- addr.send(msg.value) (tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol#16)\n", + "markdown": "[C.bad1_send(address).addr](tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol#L14) lacks a zero-check on :\n\t\t- [addr.send(msg.value)](tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol#L15)\n\t\t- [addr.send(msg.value)](tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol#L16)\n", + "id": "1a145c4f40c60c9db09f5743139503a60b40be83dda9c57f8c47a400f1bc5b8a", "check": "missing-zero-check", "impact": "Low", "confidence": "Medium" @@ -687,9 +687,9 @@ "start": 401, "length": 20, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 19 @@ -705,9 +705,9 @@ "start": 378, "length": 122, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 19, @@ -725,9 +725,9 @@ "start": 0, "length": 2049, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 1, @@ -818,9 +818,9 @@ "start": 443, "length": 24, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 20 @@ -836,9 +836,9 @@ "start": 378, "length": 122, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 19, @@ -856,9 +856,9 @@ "start": 0, "length": 2049, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 1, @@ -943,9 +943,9 @@ } } ], - "description": "C.bad2_transfer(address).addr (tests/detectors/missing-zero-check/missing_zero_address_validation.sol#19) lacks a zero-check on :\n\t\t- addr.transfer(msg.value) (tests/detectors/missing-zero-check/missing_zero_address_validation.sol#20)\n", - "markdown": "[C.bad2_transfer(address).addr](tests/detectors/missing-zero-check/missing_zero_address_validation.sol#L19) lacks a zero-check on :\n\t\t- [addr.transfer(msg.value)](tests/detectors/missing-zero-check/missing_zero_address_validation.sol#L20)\n", - "id": "cf8492ece629b57e628dd585c402012a4f4ee997e3d1ffb1c7f9cf18490c9b8b", + "description": "C.bad2_transfer(address).addr (tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol#19) lacks a zero-check on :\n\t\t- addr.transfer(msg.value) (tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol#20)\n", + "markdown": "[C.bad2_transfer(address).addr](tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol#L19) lacks a zero-check on :\n\t\t- [addr.transfer(msg.value)](tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol#L20)\n", + "id": "f7028c02d7b7a78ef72a33c7b976bcb047206b9c82a9acc39cdf11a5e188208f", "check": "missing-zero-check", "impact": "Low", "confidence": "Medium" @@ -959,9 +959,9 @@ "start": 527, "length": 20, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 23 @@ -977,9 +977,9 @@ "start": 504, "length": 203, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 23, @@ -998,9 +998,9 @@ "start": 0, "length": 2049, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 1, @@ -1091,9 +1091,9 @@ "start": 569, "length": 24, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 24 @@ -1109,9 +1109,9 @@ "start": 504, "length": 203, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 23, @@ -1130,9 +1130,9 @@ "start": 0, "length": 2049, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 1, @@ -1217,9 +1217,9 @@ } } ], - "description": "C.bad3_transfer(address).addr (tests/detectors/missing-zero-check/missing_zero_address_validation.sol#23) lacks a zero-check on :\n\t\t- addr.transfer(msg.value) (tests/detectors/missing-zero-check/missing_zero_address_validation.sol#24)\n", - "markdown": "[C.bad3_transfer(address).addr](tests/detectors/missing-zero-check/missing_zero_address_validation.sol#L23) lacks a zero-check on :\n\t\t- [addr.transfer(msg.value)](tests/detectors/missing-zero-check/missing_zero_address_validation.sol#L24)\n", - "id": "f4a3088c9894fad3e98137cc3751ac06bbac74f5428ad0e20728d738044ce365", + "description": "C.bad3_transfer(address).addr (tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol#23) lacks a zero-check on :\n\t\t- addr.transfer(msg.value) (tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol#24)\n", + "markdown": "[C.bad3_transfer(address).addr](tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol#L23) lacks a zero-check on :\n\t\t- [addr.transfer(msg.value)](tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol#L24)\n", + "id": "1cc3cad32b73e31e6d6f214b9a99b19c5bd5633ddf3ab58267a5870051c22a02", "check": "missing-zero-check", "impact": "Low", "confidence": "Medium" @@ -1233,9 +1233,9 @@ "start": 730, "length": 20, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 28 @@ -1251,9 +1251,9 @@ "start": 711, "length": 120, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 28, @@ -1271,9 +1271,9 @@ "start": 0, "length": 2049, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 1, @@ -1359,14 +1359,14 @@ }, { "type": "node", - "name": "addr.call.value(msg.value)()", + "name": "addr.call{value: msg.value}()", "source_mapping": { "start": 772, "length": 30, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 29 @@ -1382,9 +1382,9 @@ "start": 711, "length": 120, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 28, @@ -1402,9 +1402,9 @@ "start": 0, "length": 2049, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_relative": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", + "filename_short": "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", "is_dependency": false, "lines": [ 1, @@ -1489,9 +1489,9 @@ } } ], - "description": "C.bad4_call(address).addr (tests/detectors/missing-zero-check/missing_zero_address_validation.sol#28) lacks a zero-check on :\n\t\t- addr.call.value(msg.value)() (tests/detectors/missing-zero-check/missing_zero_address_validation.sol#29)\n", - "markdown": "[C.bad4_call(address).addr](tests/detectors/missing-zero-check/missing_zero_address_validation.sol#L28) lacks a zero-check on :\n\t\t- [addr.call.value(msg.value)()](tests/detectors/missing-zero-check/missing_zero_address_validation.sol#L29)\n", - "id": "ff8eb251a6d4b6de4f1c4fa3602968a4c69b232892dbc1d9d6adac5cb744f081", + "description": "C.bad4_call(address).addr (tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol#28) lacks a zero-check on :\n\t\t- addr.call{value: msg.value}() (tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol#29)\n", + "markdown": "[C.bad4_call(address).addr](tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol#L28) lacks a zero-check on :\n\t\t- [addr.call{value: msg.value}()](tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol#L29)\n", + "id": "64e549d94c8869ed8c827ad3ee766cb23d4e8a64bc9b19e06d593fa8942363b4", "check": "missing-zero-check", "impact": "Low", "confidence": "Medium" diff --git a/tests/detectors/multiple-constructors/multiple-constructors.sol.compact.json b/tests/detectors/multiple-constructors/multiple-constructors.sol.compact.json deleted file mode 100644 index b7a7cea874..0000000000 --- a/tests/detectors/multiple-constructors/multiple-constructors.sol.compact.json +++ /dev/null @@ -1,785 +0,0 @@ -JSON AST (compact format): - - -======= multiple-constructors.sol ======= -{ - "absolutePath" : "multiple-constructors.sol", - "exportedSymbols" : - { - "A" : - [ - 54 - ] - }, - "id" : 55, - "nodeType" : "SourceUnit", - "nodes" : - [ - { - "id" : 1, - "literals" : - [ - "solidity", - "0.4", - ".22" - ], - "nodeType" : "PragmaDirective", - "src" : "0:23:0" - }, - { - "baseContracts" : [], - "contractDependencies" : [], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 54, - "linearizedBaseContracts" : - [ - 54 - ], - "name" : "A", - "nodeType" : "ContractDefinition", - "nodes" : - [ - { - "constant" : false, - "id" : 5, - "name" : "x", - "nodeType" : "VariableDeclaration", - "scope" : 54, - "src" : "41:9:0", - "stateVariable" : true, - "storageLocation" : "default", - "typeDescriptions" : - { - "typeIdentifier" : "t_array$_t_uint256_$2_storage", - "typeString" : "uint256[2]" - }, - "typeName" : - { - "baseType" : - { - "id" : 2, - "name" : "uint", - "nodeType" : "ElementaryTypeName", - "src" : "41:4:0", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - } - }, - "id" : 4, - "length" : - { - "argumentTypes" : null, - "hexValue" : "32", - "id" : 3, - "isConstant" : false, - "isLValue" : false, - "isPure" : false, - "kind" : "number", - "lValueRequested" : false, - "nodeType" : "Literal", - "src" : "46:1:0", - "subdenomination" : null, - "typeDescriptions" : - { - "typeIdentifier" : null, - "typeString" : null - }, - "value" : "2" - }, - "nodeType" : "ArrayTypeName", - "src" : "41:7:0", - "typeDescriptions" : - { - "typeIdentifier" : "t_array$_t_uint256_$2_storage_ptr", - "typeString" : "uint256[2]" - } - }, - "value" : null, - "visibility" : "internal" - }, - { - "body" : - { - "id" : 20, - "nodeType" : "Block", - "src" : "76:45:0", - "statements" : - [ - { - "expression" : - { - "argumentTypes" : null, - "id" : 12, - "isConstant" : false, - "isLValue" : false, - "isPure" : false, - "lValueRequested" : false, - "leftHandSide" : - { - "argumentTypes" : null, - "baseExpression" : - { - "argumentTypes" : null, - "id" : 8, - "name" : "x", - "nodeType" : "Identifier", - "overloadedDeclarations" : [], - "referencedDeclaration" : 5, - "src" : "86:1:0", - "typeDescriptions" : - { - "typeIdentifier" : "t_array$_t_uint256_$2_storage", - "typeString" : "uint256[2] storage ref" - } - }, - "id" : 10, - "indexExpression" : - { - "argumentTypes" : null, - "hexValue" : "30", - "id" : 9, - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "kind" : "number", - "lValueRequested" : false, - "nodeType" : "Literal", - "src" : "88:1:0", - "subdenomination" : null, - "typeDescriptions" : - { - "typeIdentifier" : "t_rational_0_by_1", - "typeString" : "int_const 0" - }, - "value" : "0" - }, - "isConstant" : false, - "isLValue" : true, - "isPure" : false, - "lValueRequested" : true, - "nodeType" : "IndexAccess", - "src" : "86:4:0", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - } - }, - "nodeType" : "Assignment", - "operator" : "=", - "rightHandSide" : - { - "argumentTypes" : null, - "hexValue" : "3838", - "id" : 11, - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "kind" : "number", - "lValueRequested" : false, - "nodeType" : "Literal", - "src" : "93:2:0", - "subdenomination" : null, - "typeDescriptions" : - { - "typeIdentifier" : "t_rational_88_by_1", - "typeString" : "int_const 88" - }, - "value" : "88" - }, - "src" : "86:9:0", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - } - }, - "id" : 13, - "nodeType" : "ExpressionStatement", - "src" : "86:9:0" - }, - { - "expression" : - { - "argumentTypes" : null, - "id" : 18, - "isConstant" : false, - "isLValue" : false, - "isPure" : false, - "lValueRequested" : false, - "leftHandSide" : - { - "argumentTypes" : null, - "baseExpression" : - { - "argumentTypes" : null, - "id" : 14, - "name" : "x", - "nodeType" : "Identifier", - "overloadedDeclarations" : [], - "referencedDeclaration" : 5, - "src" : "105:1:0", - "typeDescriptions" : - { - "typeIdentifier" : "t_array$_t_uint256_$2_storage", - "typeString" : "uint256[2] storage ref" - } - }, - "id" : 16, - "indexExpression" : - { - "argumentTypes" : null, - "hexValue" : "31", - "id" : 15, - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "kind" : "number", - "lValueRequested" : false, - "nodeType" : "Literal", - "src" : "107:1:0", - "subdenomination" : null, - "typeDescriptions" : - { - "typeIdentifier" : "t_rational_1_by_1", - "typeString" : "int_const 1" - }, - "value" : "1" - }, - "isConstant" : false, - "isLValue" : true, - "isPure" : false, - "lValueRequested" : true, - "nodeType" : "IndexAccess", - "src" : "105:4:0", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - } - }, - "nodeType" : "Assignment", - "operator" : "=", - "rightHandSide" : - { - "argumentTypes" : null, - "hexValue" : "3939", - "id" : 17, - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "kind" : "number", - "lValueRequested" : false, - "nodeType" : "Literal", - "src" : "112:2:0", - "subdenomination" : null, - "typeDescriptions" : - { - "typeIdentifier" : "t_rational_99_by_1", - "typeString" : "int_const 99" - }, - "value" : "99" - }, - "src" : "105:9:0", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - } - }, - "id" : 19, - "nodeType" : "ExpressionStatement", - "src" : "105:9:0" - } - ] - }, - "documentation" : null, - "id" : 21, - "implemented" : true, - "isConstructor" : true, - "isDeclaredConst" : false, - "modifiers" : [], - "name" : "A", - "nodeType" : "FunctionDefinition", - "parameters" : - { - "id" : 6, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "66:2:0" - }, - "payable" : false, - "returnParameters" : - { - "id" : 7, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "76:0:0" - }, - "scope" : 54, - "src" : "56:65:0", - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "public" - }, - { - "body" : - { - "id" : 36, - "nodeType" : "Block", - "src" : "147:45:0", - "statements" : - [ - { - "expression" : - { - "argumentTypes" : null, - "id" : 28, - "isConstant" : false, - "isLValue" : false, - "isPure" : false, - "lValueRequested" : false, - "leftHandSide" : - { - "argumentTypes" : null, - "baseExpression" : - { - "argumentTypes" : null, - "id" : 24, - "name" : "x", - "nodeType" : "Identifier", - "overloadedDeclarations" : [], - "referencedDeclaration" : 5, - "src" : "157:1:0", - "typeDescriptions" : - { - "typeIdentifier" : "t_array$_t_uint256_$2_storage", - "typeString" : "uint256[2] storage ref" - } - }, - "id" : 26, - "indexExpression" : - { - "argumentTypes" : null, - "hexValue" : "30", - "id" : 25, - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "kind" : "number", - "lValueRequested" : false, - "nodeType" : "Literal", - "src" : "159:1:0", - "subdenomination" : null, - "typeDescriptions" : - { - "typeIdentifier" : "t_rational_0_by_1", - "typeString" : "int_const 0" - }, - "value" : "0" - }, - "isConstant" : false, - "isLValue" : true, - "isPure" : false, - "lValueRequested" : true, - "nodeType" : "IndexAccess", - "src" : "157:4:0", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - } - }, - "nodeType" : "Assignment", - "operator" : "=", - "rightHandSide" : - { - "argumentTypes" : null, - "hexValue" : "3636", - "id" : 27, - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "kind" : "number", - "lValueRequested" : false, - "nodeType" : "Literal", - "src" : "164:2:0", - "subdenomination" : null, - "typeDescriptions" : - { - "typeIdentifier" : "t_rational_66_by_1", - "typeString" : "int_const 66" - }, - "value" : "66" - }, - "src" : "157:9:0", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - } - }, - "id" : 29, - "nodeType" : "ExpressionStatement", - "src" : "157:9:0" - }, - { - "expression" : - { - "argumentTypes" : null, - "id" : 34, - "isConstant" : false, - "isLValue" : false, - "isPure" : false, - "lValueRequested" : false, - "leftHandSide" : - { - "argumentTypes" : null, - "baseExpression" : - { - "argumentTypes" : null, - "id" : 30, - "name" : "x", - "nodeType" : "Identifier", - "overloadedDeclarations" : [], - "referencedDeclaration" : 5, - "src" : "176:1:0", - "typeDescriptions" : - { - "typeIdentifier" : "t_array$_t_uint256_$2_storage", - "typeString" : "uint256[2] storage ref" - } - }, - "id" : 32, - "indexExpression" : - { - "argumentTypes" : null, - "hexValue" : "31", - "id" : 31, - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "kind" : "number", - "lValueRequested" : false, - "nodeType" : "Literal", - "src" : "178:1:0", - "subdenomination" : null, - "typeDescriptions" : - { - "typeIdentifier" : "t_rational_1_by_1", - "typeString" : "int_const 1" - }, - "value" : "1" - }, - "isConstant" : false, - "isLValue" : true, - "isPure" : false, - "lValueRequested" : true, - "nodeType" : "IndexAccess", - "src" : "176:4:0", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - } - }, - "nodeType" : "Assignment", - "operator" : "=", - "rightHandSide" : - { - "argumentTypes" : null, - "hexValue" : "3737", - "id" : 33, - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "kind" : "number", - "lValueRequested" : false, - "nodeType" : "Literal", - "src" : "183:2:0", - "subdenomination" : null, - "typeDescriptions" : - { - "typeIdentifier" : "t_rational_77_by_1", - "typeString" : "int_const 77" - }, - "value" : "77" - }, - "src" : "176:9:0", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - } - }, - "id" : 35, - "nodeType" : "ExpressionStatement", - "src" : "176:9:0" - } - ] - }, - "documentation" : null, - "id" : 37, - "implemented" : true, - "isConstructor" : true, - "isDeclaredConst" : false, - "modifiers" : [], - "name" : "", - "nodeType" : "FunctionDefinition", - "parameters" : - { - "id" : 22, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "137:2:0" - }, - "payable" : false, - "returnParameters" : - { - "id" : 23, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "147:0:0" - }, - "scope" : 54, - "src" : "126:66:0", - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "public" - }, - { - "body" : - { - "id" : 52, - "nodeType" : "Block", - "src" : "241:36:0", - "statements" : - [ - { - "expression" : - { - "argumentTypes" : null, - "components" : - [ - { - "argumentTypes" : null, - "baseExpression" : - { - "argumentTypes" : null, - "id" : 44, - "name" : "x", - "nodeType" : "Identifier", - "overloadedDeclarations" : [], - "referencedDeclaration" : 5, - "src" : "259:1:0", - "typeDescriptions" : - { - "typeIdentifier" : "t_array$_t_uint256_$2_storage", - "typeString" : "uint256[2] storage ref" - } - }, - "id" : 46, - "indexExpression" : - { - "argumentTypes" : null, - "hexValue" : "30", - "id" : 45, - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "kind" : "number", - "lValueRequested" : false, - "nodeType" : "Literal", - "src" : "261:1:0", - "subdenomination" : null, - "typeDescriptions" : - { - "typeIdentifier" : "t_rational_0_by_1", - "typeString" : "int_const 0" - }, - "value" : "0" - }, - "isConstant" : false, - "isLValue" : true, - "isPure" : false, - "lValueRequested" : false, - "nodeType" : "IndexAccess", - "src" : "259:4:0", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - } - }, - { - "argumentTypes" : null, - "baseExpression" : - { - "argumentTypes" : null, - "id" : 47, - "name" : "x", - "nodeType" : "Identifier", - "overloadedDeclarations" : [], - "referencedDeclaration" : 5, - "src" : "265:1:0", - "typeDescriptions" : - { - "typeIdentifier" : "t_array$_t_uint256_$2_storage", - "typeString" : "uint256[2] storage ref" - } - }, - "id" : 49, - "indexExpression" : - { - "argumentTypes" : null, - "hexValue" : "31", - "id" : 48, - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "kind" : "number", - "lValueRequested" : false, - "nodeType" : "Literal", - "src" : "267:1:0", - "subdenomination" : null, - "typeDescriptions" : - { - "typeIdentifier" : "t_rational_1_by_1", - "typeString" : "int_const 1" - }, - "value" : "1" - }, - "isConstant" : false, - "isLValue" : true, - "isPure" : false, - "lValueRequested" : false, - "nodeType" : "IndexAccess", - "src" : "265:4:0", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - } - } - ], - "id" : 50, - "isConstant" : false, - "isInlineArray" : false, - "isLValue" : false, - "isPure" : false, - "lValueRequested" : false, - "nodeType" : "TupleExpression", - "src" : "258:12:0", - "typeDescriptions" : - { - "typeIdentifier" : "t_tuple$_t_uint256_$_t_uint256_$", - "typeString" : "tuple(uint256,uint256)" - } - }, - "functionReturnParameters" : 43, - "id" : 51, - "nodeType" : "Return", - "src" : "251:19:0" - } - ] - }, - "documentation" : null, - "id" : 53, - "implemented" : true, - "isConstructor" : false, - "isDeclaredConst" : false, - "modifiers" : [], - "name" : "test", - "nodeType" : "FunctionDefinition", - "parameters" : - { - "id" : 38, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "211:2:0" - }, - "payable" : false, - "returnParameters" : - { - "id" : 43, - "nodeType" : "ParameterList", - "parameters" : - [ - { - "constant" : false, - "id" : 40, - "name" : "", - "nodeType" : "VariableDeclaration", - "scope" : 53, - "src" : "229:4:0", - "stateVariable" : false, - "storageLocation" : "default", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - }, - "typeName" : - { - "id" : 39, - "name" : "uint", - "nodeType" : "ElementaryTypeName", - "src" : "229:4:0", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - } - }, - "value" : null, - "visibility" : "internal" - }, - { - "constant" : false, - "id" : 42, - "name" : "", - "nodeType" : "VariableDeclaration", - "scope" : 53, - "src" : "235:4:0", - "stateVariable" : false, - "storageLocation" : "default", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - }, - "typeName" : - { - "id" : 41, - "name" : "uint", - "nodeType" : "ElementaryTypeName", - "src" : "235:4:0", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - } - }, - "value" : null, - "visibility" : "internal" - } - ], - "src" : "228:12:0" - }, - "scope" : 54, - "src" : "198:79:0", - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "public" - } - ], - "scope" : 55, - "src" : "24:255:0" - } - ], - "src" : "0:280:0" -} \ No newline at end of file diff --git a/tests/detectors/naming-convention/naming_convention.sol b/tests/detectors/naming-convention/0.4.25/naming_convention.sol similarity index 100% rename from tests/detectors/naming-convention/naming_convention.sol rename to tests/detectors/naming-convention/0.4.25/naming_convention.sol diff --git a/tests/detectors/naming-convention/naming_convention.sol.0.4.25.NamingConvention.json b/tests/detectors/naming-convention/0.4.25/naming_convention.sol.0.4.25.NamingConvention.json similarity index 91% rename from tests/detectors/naming-convention/naming_convention.sol.0.4.25.NamingConvention.json rename to tests/detectors/naming-convention/0.4.25/naming_convention.sol.0.4.25.NamingConvention.json index b4c8e78d90..cad20587f0 100644 --- a/tests/detectors/naming-convention/naming_convention.sol.0.4.25.NamingConvention.json +++ b/tests/detectors/naming-convention/0.4.25/naming_convention.sol.0.4.25.NamingConvention.json @@ -9,9 +9,9 @@ "start": 28, "length": 642, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "is_dependency": false, "lines": [ 3, @@ -70,8 +70,8 @@ } } ], - "description": "Contract naming (tests/detectors/naming-convention/naming_convention.sol#3-48) is not in CapWords\n", - "markdown": "Contract [naming](tests/detectors/naming-convention/naming_convention.sol#L3-L48) is not in CapWords\n", + "description": "Contract naming (tests/detectors/naming-convention/0.4.25/naming_convention.sol#3-48) is not in CapWords\n", + "markdown": "Contract [naming](tests/detectors/naming-convention/0.4.25/naming_convention.sol#L3-L48) is not in CapWords\n", "id": "7247d550fb327e3aeb21c82714137e5b45a7e9eeaa6a1bc878102c8081033f85", "check": "naming-convention", "impact": "Informational", @@ -86,9 +86,9 @@ "start": 229, "length": 35, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "is_dependency": false, "lines": [ 14, @@ -106,9 +106,9 @@ "start": 28, "length": 642, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "is_dependency": false, "lines": [ 3, @@ -169,8 +169,8 @@ } } ], - "description": "Struct naming.test (tests/detectors/naming-convention/naming_convention.sol#14-16) is not in CapWords\n", - "markdown": "Struct [naming.test](tests/detectors/naming-convention/naming_convention.sol#L14-L16) is not in CapWords\n", + "description": "Struct naming.test (tests/detectors/naming-convention/0.4.25/naming_convention.sol#14-16) is not in CapWords\n", + "markdown": "Struct [naming.test](tests/detectors/naming-convention/0.4.25/naming_convention.sol#L14-L16) is not in CapWords\n", "id": "0ef3ea412cb30b1f0df5fa2af4a7a06e2bf0373fae0770fd9e301aed12c209cf", "check": "naming-convention", "impact": "Informational", @@ -185,9 +185,9 @@ "start": 335, "length": 19, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "is_dependency": false, "lines": [ 23 @@ -203,9 +203,9 @@ "start": 28, "length": 642, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "is_dependency": false, "lines": [ 3, @@ -267,8 +267,8 @@ } } ], - "description": "Event namingevent_(uint256) (tests/detectors/naming-convention/naming_convention.sol#23) is not in CapWords\n", - "markdown": "Event [namingevent_(uint256)](tests/detectors/naming-convention/naming_convention.sol#L23) is not in CapWords\n", + "description": "Event namingevent_(uint256) (tests/detectors/naming-convention/0.4.25/naming_convention.sol#23) is not in CapWords\n", + "markdown": "Event [namingevent_(uint256)](tests/detectors/naming-convention/0.4.25/naming_convention.sol#L23) is not in CapWords\n", "id": "978ecf4a2c8b96d947e60f6601cf60d0e25e07ebe80ebbc37a7e7f279afd1405", "check": "naming-convention", "impact": "Informational", @@ -283,9 +283,9 @@ "start": 440, "length": 75, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "is_dependency": false, "lines": [ 30, @@ -304,9 +304,9 @@ "start": 28, "length": 642, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "is_dependency": false, "lines": [ 3, @@ -368,8 +368,8 @@ } } ], - "description": "Function naming.GetOne() (tests/detectors/naming-convention/naming_convention.sol#30-33) is not in mixedCase\n", - "markdown": "Function [naming.GetOne()](tests/detectors/naming-convention/naming_convention.sol#L30-L33) is not in mixedCase\n", + "description": "Function naming.GetOne() (tests/detectors/naming-convention/0.4.25/naming_convention.sol#30-33) is not in mixedCase\n", + "markdown": "Function [naming.GetOne()](tests/detectors/naming-convention/0.4.25/naming_convention.sol#L30-L33) is not in mixedCase\n", "id": "bf6f97d6a82b84284efdade52d01bd6112007426e2e88d1568190d63c5c4a049", "check": "naming-convention", "impact": "Informational", @@ -384,9 +384,9 @@ "start": 551, "length": 12, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "is_dependency": false, "lines": [ 35 @@ -402,9 +402,9 @@ "start": 521, "length": 63, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "is_dependency": false, "lines": [ 35, @@ -423,9 +423,9 @@ "start": 28, "length": 642, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "is_dependency": false, "lines": [ 3, @@ -489,8 +489,8 @@ } } ], - "description": "Parameter naming.setInt(uint256,uint256).Number2 (tests/detectors/naming-convention/naming_convention.sol#35) is not in mixedCase\n", - "markdown": "Parameter [naming.setInt(uint256,uint256).Number2](tests/detectors/naming-convention/naming_convention.sol#L35) is not in mixedCase\n", + "description": "Parameter naming.setInt(uint256,uint256).Number2 (tests/detectors/naming-convention/0.4.25/naming_convention.sol#35) is not in mixedCase\n", + "markdown": "Parameter [naming.setInt(uint256,uint256).Number2](tests/detectors/naming-convention/0.4.25/naming_convention.sol#L35) is not in mixedCase\n", "id": "f03bff0b488524254e19ff7d688d34211cd2f29934e22417c9f1fa43fc4a08ad", "check": "naming-convention", "impact": "Informational", @@ -505,9 +505,9 @@ "start": 143, "length": 35, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "is_dependency": false, "lines": [ 9 @@ -523,9 +523,9 @@ "start": 28, "length": 642, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "is_dependency": false, "lines": [ 3, @@ -586,8 +586,8 @@ } } ], - "description": "Constant naming.MY_other_CONSTANT (tests/detectors/naming-convention/naming_convention.sol#9) is not in UPPER_CASE_WITH_UNDERSCORES\n", - "markdown": "Constant [naming.MY_other_CONSTANT](tests/detectors/naming-convention/naming_convention.sol#L9) is not in UPPER_CASE_WITH_UNDERSCORES\n", + "description": "Constant naming.MY_other_CONSTANT (tests/detectors/naming-convention/0.4.25/naming_convention.sol#9) is not in UPPER_CASE_WITH_UNDERSCORES\n", + "markdown": "Constant [naming.MY_other_CONSTANT](tests/detectors/naming-convention/0.4.25/naming_convention.sol#L9) is not in UPPER_CASE_WITH_UNDERSCORES\n", "id": "596c2e8064f8f2df55cd5c878eb59c0a74ac7f20719c420d8af307f2431a1a90", "check": "naming-convention", "impact": "Informational", @@ -602,9 +602,9 @@ "start": 185, "length": 16, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "is_dependency": false, "lines": [ 11 @@ -620,9 +620,9 @@ "start": 28, "length": 642, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "is_dependency": false, "lines": [ 3, @@ -683,8 +683,8 @@ } } ], - "description": "Variable naming.Var_One (tests/detectors/naming-convention/naming_convention.sol#11) is not in mixedCase\n", - "markdown": "Variable [naming.Var_One](tests/detectors/naming-convention/naming_convention.sol#L11) is not in mixedCase\n", + "description": "Variable naming.Var_One (tests/detectors/naming-convention/0.4.25/naming_convention.sol#11) is not in mixedCase\n", + "markdown": "Variable [naming.Var_One](tests/detectors/naming-convention/0.4.25/naming_convention.sol#L11) is not in mixedCase\n", "id": "34b7c817201b3f3086fc3541f140898d9e9aabe999b1c0a6ef8639ec04351f26", "check": "naming-convention", "impact": "Informational", @@ -699,9 +699,9 @@ "start": 79, "length": 23, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "is_dependency": false, "lines": [ 6 @@ -717,9 +717,9 @@ "start": 28, "length": 642, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "is_dependency": false, "lines": [ 3, @@ -780,8 +780,8 @@ } } ], - "description": "Enum naming.numbers (tests/detectors/naming-convention/naming_convention.sol#6) is not in CapWords\n", - "markdown": "Enum [naming.numbers](tests/detectors/naming-convention/naming_convention.sol#L6) is not in CapWords\n", + "description": "Enum naming.numbers (tests/detectors/naming-convention/0.4.25/naming_convention.sol#6) is not in CapWords\n", + "markdown": "Enum [naming.numbers](tests/detectors/naming-convention/0.4.25/naming_convention.sol#L6) is not in CapWords\n", "id": "7c87b076ea2865060182cf11d155caadb1dcea415ccce0ca8563a74a01611fc2", "check": "naming-convention", "impact": "Informational", @@ -796,9 +796,9 @@ "start": 591, "length": 36, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "is_dependency": false, "lines": [ 41, @@ -816,9 +816,9 @@ "start": 28, "length": 642, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "is_dependency": false, "lines": [ 3, @@ -880,8 +880,8 @@ } } ], - "description": "Modifier naming.CantDo() (tests/detectors/naming-convention/naming_convention.sol#41-43) is not in mixedCase\n", - "markdown": "Modifier [naming.CantDo()](tests/detectors/naming-convention/naming_convention.sol#L41-L43) is not in mixedCase\n", + "description": "Modifier naming.CantDo() (tests/detectors/naming-convention/0.4.25/naming_convention.sol#41-43) is not in mixedCase\n", + "markdown": "Modifier [naming.CantDo()](tests/detectors/naming-convention/0.4.25/naming_convention.sol#L41-L43) is not in mixedCase\n", "id": "b8a754a01bd47127f00032cdedd0ade3e27e6543631d8f5bc9e44365ab732895", "check": "naming-convention", "impact": "Informational", @@ -896,9 +896,9 @@ "start": 794, "length": 10, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "is_dependency": false, "lines": [ 59 @@ -914,9 +914,9 @@ "start": 766, "length": 84, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "is_dependency": false, "lines": [ 59, @@ -933,9 +933,9 @@ "start": 692, "length": 221, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "is_dependency": false, "lines": [ 54, @@ -968,8 +968,8 @@ } } ], - "description": "Parameter T.test(uint256,uint256)._used (tests/detectors/naming-convention/naming_convention.sol#59) is not in mixedCase\n", - "markdown": "Parameter [T.test(uint256,uint256)._used](tests/detectors/naming-convention/naming_convention.sol#L59) is not in mixedCase\n", + "description": "Parameter T.test(uint256,uint256)._used (tests/detectors/naming-convention/0.4.25/naming_convention.sol#59) is not in mixedCase\n", + "markdown": "Parameter [T.test(uint256,uint256)._used](tests/detectors/naming-convention/0.4.25/naming_convention.sol#L59) is not in mixedCase\n", "id": "818962ad9f50f13eb87b5c7deade22666431945fb60055f572b38246cfbf311e", "check": "naming-convention", "impact": "Informational", @@ -984,9 +984,9 @@ "start": 741, "length": 17, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "is_dependency": false, "lines": [ 56 @@ -1002,9 +1002,9 @@ "start": 692, "length": 221, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "is_dependency": false, "lines": [ 54, @@ -1034,8 +1034,8 @@ } } ], - "description": "Variable T._myPublicVar (tests/detectors/naming-convention/naming_convention.sol#56) is not in mixedCase\n", - "markdown": "Variable [T._myPublicVar](tests/detectors/naming-convention/naming_convention.sol#L56) is not in mixedCase\n", + "description": "Variable T._myPublicVar (tests/detectors/naming-convention/0.4.25/naming_convention.sol#56) is not in mixedCase\n", + "markdown": "Variable [T._myPublicVar](tests/detectors/naming-convention/0.4.25/naming_convention.sol#L56) is not in mixedCase\n", "id": "8acd53815786acad5b92b51366daf79182a67ab438daa41a6e1ec8a9601fa9a3", "check": "naming-convention", "impact": "Informational", @@ -1050,9 +1050,9 @@ "start": 900, "length": 10, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "is_dependency": false, "lines": [ 67 @@ -1068,9 +1068,9 @@ "start": 692, "length": 221, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "is_dependency": false, "lines": [ 54, @@ -1100,8 +1100,8 @@ } } ], - "description": "Variable T.l (tests/detectors/naming-convention/naming_convention.sol#67) used l, O, I, which should not be used\n", - "markdown": "Variable [T.l](tests/detectors/naming-convention/naming_convention.sol#L67) used l, O, I, which should not be used\n", + "description": "Variable T.l (tests/detectors/naming-convention/0.4.25/naming_convention.sol#67) used l, O, I, which should not be used\n", + "markdown": "Variable [T.l](tests/detectors/naming-convention/0.4.25/naming_convention.sol#L67) used l, O, I, which should not be used\n", "id": "b595f9e6d03b8b501b7c4a9bf8ff0ad9bf11448a25f53d63ab5031c95f8ae89c", "check": "naming-convention", "impact": "Informational", diff --git a/tests/detectors/naming-convention/naming_convention_ignore.sol b/tests/detectors/naming-convention/0.4.25/naming_convention_ignore.sol similarity index 100% rename from tests/detectors/naming-convention/naming_convention_ignore.sol rename to tests/detectors/naming-convention/0.4.25/naming_convention_ignore.sol diff --git a/tests/detectors/naming-convention/naming_convention_ignore.sol.0.4.25.NamingConvention.json b/tests/detectors/naming-convention/0.4.25/naming_convention_ignore.sol.0.4.25.NamingConvention.json similarity index 88% rename from tests/detectors/naming-convention/naming_convention_ignore.sol.0.4.25.NamingConvention.json rename to tests/detectors/naming-convention/0.4.25/naming_convention_ignore.sol.0.4.25.NamingConvention.json index 547e6aef80..9246c3f1ff 100644 --- a/tests/detectors/naming-convention/naming_convention_ignore.sol.0.4.25.NamingConvention.json +++ b/tests/detectors/naming-convention/0.4.25/naming_convention_ignore.sol.0.4.25.NamingConvention.json @@ -9,9 +9,9 @@ "start": 320, "length": 36, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention_ignore.sol", + "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention_ignore.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention_ignore.sol", + "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention_ignore.sol", "is_dependency": false, "lines": [ 18, @@ -29,9 +29,9 @@ "start": 61, "length": 299, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention_ignore.sol", + "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention_ignore.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention_ignore.sol", + "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention_ignore.sol", "is_dependency": false, "lines": [ 4, @@ -65,8 +65,8 @@ } } ], - "description": "Struct naming.test3 (tests/detectors/naming-convention/naming_convention_ignore.sol#18-20) is not in CapWords\n", - "markdown": "Struct [naming.test3](tests/detectors/naming-convention/naming_convention_ignore.sol#L18-L20) is not in CapWords\n", + "description": "Struct naming.test3 (tests/detectors/naming-convention/0.4.25/naming_convention_ignore.sol#18-20) is not in CapWords\n", + "markdown": "Struct [naming.test3](tests/detectors/naming-convention/0.4.25/naming_convention_ignore.sol#L18-L20) is not in CapWords\n", "id": "34b66b0b5acf6c00b066dd7f5bbcdbc6f3879ab5ece850f113d00e3318eac10f", "check": "naming-convention", "impact": "Informational", diff --git a/tests/detectors/naming-convention/0.5.16/naming_convention.sol b/tests/detectors/naming-convention/0.5.16/naming_convention.sol new file mode 100644 index 0000000000..6c4b2f936e --- /dev/null +++ b/tests/detectors/naming-convention/0.5.16/naming_convention.sol @@ -0,0 +1,75 @@ +//pragma solidity ^0.4.24; + +contract naming { + + enum Numbers {ONE, TWO} + enum numbers {ONE, TWO} + + uint constant MY_CONSTANT = 1; + uint constant MY_other_CONSTANT = 2; + + uint Var_One = 1; + uint varTwo = 2; + + struct test { + uint a; + } + + struct Test { + uint a; + } + + event Event_(uint); + event event_(uint); + + function getOne() view public returns(uint) + { + return 1; + } + + function GetOne() view public returns (uint) + { + return 1; + } + + function setInt(uint number1, uint Number2) public + { + + } + + + modifier CantDo() { + _; + } + + modifier canDo() { + _; + } +} + +contract Test { + +} + +contract T { + uint private _myPrivateVar; + uint _myPublicVar; + + + function test(uint _unused, uint _used) public returns(uint){ + return _used;} + + + uint k = 1; + + uint constant M = 1; + + uint l = 1; +} + +contract ParameterNameEmptyString { + + function foo (uint) public { + } + +} diff --git a/tests/detectors/naming-convention/0.5.16/naming_convention.sol.0.5.16.NamingConvention.json b/tests/detectors/naming-convention/0.5.16/naming_convention.sol.0.5.16.NamingConvention.json new file mode 100644 index 0000000000..ee2cf20c76 --- /dev/null +++ b/tests/detectors/naming-convention/0.5.16/naming_convention.sol.0.5.16.NamingConvention.json @@ -0,0 +1,1111 @@ +[ + [ + { + "elements": [ + { + "type": "contract", + "name": "naming", + "source_mapping": { + "start": 28, + "length": 642, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48 + ], + "starting_column": 1, + "ending_column": 2 + }, + "additional_fields": { + "target": "contract", + "convention": "CapWords" + } + } + ], + "description": "Contract naming (tests/detectors/naming-convention/0.5.16/naming_convention.sol#3-48) is not in CapWords\n", + "markdown": "Contract [naming](tests/detectors/naming-convention/0.5.16/naming_convention.sol#L3-L48) is not in CapWords\n", + "id": "7247d550fb327e3aeb21c82714137e5b45a7e9eeaa6a1bc878102c8081033f85", + "check": "naming-convention", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "struct", + "name": "test", + "source_mapping": { + "start": 229, + "length": 35, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "naming", + "source_mapping": { + "start": 28, + "length": 642, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48 + ], + "starting_column": 1, + "ending_column": 2 + } + } + }, + "additional_fields": { + "target": "structure", + "convention": "CapWords" + } + } + ], + "description": "Struct naming.test (tests/detectors/naming-convention/0.5.16/naming_convention.sol#14-16) is not in CapWords\n", + "markdown": "Struct [naming.test](tests/detectors/naming-convention/0.5.16/naming_convention.sol#L14-L16) is not in CapWords\n", + "id": "0ef3ea412cb30b1f0df5fa2af4a7a06e2bf0373fae0770fd9e301aed12c209cf", + "check": "naming-convention", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "event", + "name": "event_", + "source_mapping": { + "start": 335, + "length": 19, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "is_dependency": false, + "lines": [ + 23 + ], + "starting_column": 5, + "ending_column": 24 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "naming", + "source_mapping": { + "start": 28, + "length": 642, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "event_(uint256)" + }, + "additional_fields": { + "target": "event", + "convention": "CapWords" + } + } + ], + "description": "Event namingevent_(uint256) (tests/detectors/naming-convention/0.5.16/naming_convention.sol#23) is not in CapWords\n", + "markdown": "Event [namingevent_(uint256)](tests/detectors/naming-convention/0.5.16/naming_convention.sol#L23) is not in CapWords\n", + "id": "978ecf4a2c8b96d947e60f6601cf60d0e25e07ebe80ebbc37a7e7f279afd1405", + "check": "naming-convention", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "GetOne", + "source_mapping": { + "start": 440, + "length": 75, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "naming", + "source_mapping": { + "start": 28, + "length": 642, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "GetOne()" + }, + "additional_fields": { + "target": "function", + "convention": "mixedCase" + } + } + ], + "description": "Function naming.GetOne() (tests/detectors/naming-convention/0.5.16/naming_convention.sol#30-33) is not in mixedCase\n", + "markdown": "Function [naming.GetOne()](tests/detectors/naming-convention/0.5.16/naming_convention.sol#L30-L33) is not in mixedCase\n", + "id": "bf6f97d6a82b84284efdade52d01bd6112007426e2e88d1568190d63c5c4a049", + "check": "naming-convention", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "Number2", + "source_mapping": { + "start": 551, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "is_dependency": false, + "lines": [ + 35 + ], + "starting_column": 35, + "ending_column": 47 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "setInt", + "source_mapping": { + "start": 521, + "length": 63, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "is_dependency": false, + "lines": [ + 35, + 36, + 37, + 38 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "naming", + "source_mapping": { + "start": 28, + "length": 642, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "setInt(uint256,uint256)" + } + } + }, + "additional_fields": { + "target": "parameter", + "convention": "mixedCase" + } + } + ], + "description": "Parameter naming.setInt(uint256,uint256).Number2 (tests/detectors/naming-convention/0.5.16/naming_convention.sol#35) is not in mixedCase\n", + "markdown": "Parameter [naming.setInt(uint256,uint256).Number2](tests/detectors/naming-convention/0.5.16/naming_convention.sol#L35) is not in mixedCase\n", + "id": "f03bff0b488524254e19ff7d688d34211cd2f29934e22417c9f1fa43fc4a08ad", + "check": "naming-convention", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "MY_other_CONSTANT", + "source_mapping": { + "start": 143, + "length": 35, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "is_dependency": false, + "lines": [ + 9 + ], + "starting_column": 5, + "ending_column": 40 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "naming", + "source_mapping": { + "start": 28, + "length": 642, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48 + ], + "starting_column": 1, + "ending_column": 2 + } + } + }, + "additional_fields": { + "target": "variable_constant", + "convention": "UPPER_CASE_WITH_UNDERSCORES" + } + } + ], + "description": "Constant naming.MY_other_CONSTANT (tests/detectors/naming-convention/0.5.16/naming_convention.sol#9) is not in UPPER_CASE_WITH_UNDERSCORES\n", + "markdown": "Constant [naming.MY_other_CONSTANT](tests/detectors/naming-convention/0.5.16/naming_convention.sol#L9) is not in UPPER_CASE_WITH_UNDERSCORES\n", + "id": "596c2e8064f8f2df55cd5c878eb59c0a74ac7f20719c420d8af307f2431a1a90", + "check": "naming-convention", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "Var_One", + "source_mapping": { + "start": 185, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "is_dependency": false, + "lines": [ + 11 + ], + "starting_column": 5, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "naming", + "source_mapping": { + "start": 28, + "length": 642, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48 + ], + "starting_column": 1, + "ending_column": 2 + } + } + }, + "additional_fields": { + "target": "variable", + "convention": "mixedCase" + } + } + ], + "description": "Variable naming.Var_One (tests/detectors/naming-convention/0.5.16/naming_convention.sol#11) is not in mixedCase\n", + "markdown": "Variable [naming.Var_One](tests/detectors/naming-convention/0.5.16/naming_convention.sol#L11) is not in mixedCase\n", + "id": "34b7c817201b3f3086fc3541f140898d9e9aabe999b1c0a6ef8639ec04351f26", + "check": "naming-convention", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "enum", + "name": "numbers", + "source_mapping": { + "start": 79, + "length": 23, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "is_dependency": false, + "lines": [ + 6 + ], + "starting_column": 5, + "ending_column": 28 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "naming", + "source_mapping": { + "start": 28, + "length": 642, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48 + ], + "starting_column": 1, + "ending_column": 2 + } + } + }, + "additional_fields": { + "target": "enum", + "convention": "CapWords" + } + } + ], + "description": "Enum naming.numbers (tests/detectors/naming-convention/0.5.16/naming_convention.sol#6) is not in CapWords\n", + "markdown": "Enum [naming.numbers](tests/detectors/naming-convention/0.5.16/naming_convention.sol#L6) is not in CapWords\n", + "id": "7c87b076ea2865060182cf11d155caadb1dcea415ccce0ca8563a74a01611fc2", + "check": "naming-convention", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "CantDo", + "source_mapping": { + "start": 591, + "length": 36, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "is_dependency": false, + "lines": [ + 41, + 42, + 43 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "naming", + "source_mapping": { + "start": 28, + "length": 642, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "CantDo()" + }, + "additional_fields": { + "target": "modifier", + "convention": "mixedCase" + } + } + ], + "description": "Modifier naming.CantDo() (tests/detectors/naming-convention/0.5.16/naming_convention.sol#41-43) is not in mixedCase\n", + "markdown": "Modifier [naming.CantDo()](tests/detectors/naming-convention/0.5.16/naming_convention.sol#L41-L43) is not in mixedCase\n", + "id": "b8a754a01bd47127f00032cdedd0ade3e27e6543631d8f5bc9e44365ab732895", + "check": "naming-convention", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "_used", + "source_mapping": { + "start": 794, + "length": 10, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "is_dependency": false, + "lines": [ + 59 + ], + "starting_column": 33, + "ending_column": 43 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "test", + "source_mapping": { + "start": 766, + "length": 84, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "is_dependency": false, + "lines": [ + 59, + 60 + ], + "starting_column": 5, + "ending_column": 23 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "T", + "source_mapping": { + "start": 692, + "length": 221, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "is_dependency": false, + "lines": [ + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "test(uint256,uint256)" + } + } + }, + "additional_fields": { + "target": "parameter", + "convention": "mixedCase" + } + } + ], + "description": "Parameter T.test(uint256,uint256)._used (tests/detectors/naming-convention/0.5.16/naming_convention.sol#59) is not in mixedCase\n", + "markdown": "Parameter [T.test(uint256,uint256)._used](tests/detectors/naming-convention/0.5.16/naming_convention.sol#L59) is not in mixedCase\n", + "id": "818962ad9f50f13eb87b5c7deade22666431945fb60055f572b38246cfbf311e", + "check": "naming-convention", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "_myPublicVar", + "source_mapping": { + "start": 741, + "length": 17, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "is_dependency": false, + "lines": [ + 56 + ], + "starting_column": 5, + "ending_column": 22 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "T", + "source_mapping": { + "start": 692, + "length": 221, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "is_dependency": false, + "lines": [ + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68 + ], + "starting_column": 1, + "ending_column": 2 + } + } + }, + "additional_fields": { + "target": "variable", + "convention": "mixedCase" + } + } + ], + "description": "Variable T._myPublicVar (tests/detectors/naming-convention/0.5.16/naming_convention.sol#56) is not in mixedCase\n", + "markdown": "Variable [T._myPublicVar](tests/detectors/naming-convention/0.5.16/naming_convention.sol#L56) is not in mixedCase\n", + "id": "8acd53815786acad5b92b51366daf79182a67ab438daa41a6e1ec8a9601fa9a3", + "check": "naming-convention", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "l", + "source_mapping": { + "start": 900, + "length": 10, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "is_dependency": false, + "lines": [ + 67 + ], + "starting_column": 5, + "ending_column": 15 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "T", + "source_mapping": { + "start": 692, + "length": 221, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "is_dependency": false, + "lines": [ + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68 + ], + "starting_column": 1, + "ending_column": 2 + } + } + }, + "additional_fields": { + "target": "variable", + "convention": "l_O_I_should_not_be_used" + } + } + ], + "description": "Variable T.l (tests/detectors/naming-convention/0.5.16/naming_convention.sol#67) used l, O, I, which should not be used\n", + "markdown": "Variable [T.l](tests/detectors/naming-convention/0.5.16/naming_convention.sol#L67) used l, O, I, which should not be used\n", + "id": "b595f9e6d03b8b501b7c4a9bf8ff0ad9bf11448a25f53d63ab5031c95f8ae89c", + "check": "naming-convention", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/naming-convention/0.5.16/naming_convention_ignore.sol b/tests/detectors/naming-convention/0.5.16/naming_convention_ignore.sol new file mode 100644 index 0000000000..c650dc4cfe --- /dev/null +++ b/tests/detectors/naming-convention/0.5.16/naming_convention_ignore.sol @@ -0,0 +1,22 @@ +//pragma solidity ^0.4.24; + +// slither-disable-next-line all +contract naming { + + // slither-disable-next-line naming-convention + struct test { + uint a; + } + + + // slither-disable-next-line pragma,all + struct test2 { + uint a; + } + + // slither-disable-next-line wrong-naming-convention + struct test3 { + uint a; + } + +} diff --git a/tests/detectors/naming-convention/0.5.16/naming_convention_ignore.sol.0.5.16.NamingConvention.json b/tests/detectors/naming-convention/0.5.16/naming_convention_ignore.sol.0.5.16.NamingConvention.json new file mode 100644 index 0000000000..baeee9bf16 --- /dev/null +++ b/tests/detectors/naming-convention/0.5.16/naming_convention_ignore.sol.0.5.16.NamingConvention.json @@ -0,0 +1,76 @@ +[ + [ + { + "elements": [ + { + "type": "struct", + "name": "test3", + "source_mapping": { + "start": 320, + "length": 36, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention_ignore.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention_ignore.sol", + "is_dependency": false, + "lines": [ + 18, + 19, + 20 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "naming", + "source_mapping": { + "start": 61, + "length": 299, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention_ignore.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention_ignore.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22 + ], + "starting_column": 1, + "ending_column": 2 + } + } + }, + "additional_fields": { + "target": "structure", + "convention": "CapWords" + } + } + ], + "description": "Struct naming.test3 (tests/detectors/naming-convention/0.5.16/naming_convention_ignore.sol#18-20) is not in CapWords\n", + "markdown": "Struct [naming.test3](tests/detectors/naming-convention/0.5.16/naming_convention_ignore.sol#L18-L20) is not in CapWords\n", + "id": "34b66b0b5acf6c00b066dd7f5bbcdbc6f3879ab5ece850f113d00e3318eac10f", + "check": "naming-convention", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/naming-convention/0.6.11/naming_convention.sol b/tests/detectors/naming-convention/0.6.11/naming_convention.sol new file mode 100644 index 0000000000..6c4b2f936e --- /dev/null +++ b/tests/detectors/naming-convention/0.6.11/naming_convention.sol @@ -0,0 +1,75 @@ +//pragma solidity ^0.4.24; + +contract naming { + + enum Numbers {ONE, TWO} + enum numbers {ONE, TWO} + + uint constant MY_CONSTANT = 1; + uint constant MY_other_CONSTANT = 2; + + uint Var_One = 1; + uint varTwo = 2; + + struct test { + uint a; + } + + struct Test { + uint a; + } + + event Event_(uint); + event event_(uint); + + function getOne() view public returns(uint) + { + return 1; + } + + function GetOne() view public returns (uint) + { + return 1; + } + + function setInt(uint number1, uint Number2) public + { + + } + + + modifier CantDo() { + _; + } + + modifier canDo() { + _; + } +} + +contract Test { + +} + +contract T { + uint private _myPrivateVar; + uint _myPublicVar; + + + function test(uint _unused, uint _used) public returns(uint){ + return _used;} + + + uint k = 1; + + uint constant M = 1; + + uint l = 1; +} + +contract ParameterNameEmptyString { + + function foo (uint) public { + } + +} diff --git a/tests/detectors/naming-convention/0.6.11/naming_convention.sol.0.6.11.NamingConvention.json b/tests/detectors/naming-convention/0.6.11/naming_convention.sol.0.6.11.NamingConvention.json new file mode 100644 index 0000000000..5ca2528bd6 --- /dev/null +++ b/tests/detectors/naming-convention/0.6.11/naming_convention.sol.0.6.11.NamingConvention.json @@ -0,0 +1,1111 @@ +[ + [ + { + "elements": [ + { + "type": "contract", + "name": "naming", + "source_mapping": { + "start": 28, + "length": 642, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48 + ], + "starting_column": 1, + "ending_column": 2 + }, + "additional_fields": { + "target": "contract", + "convention": "CapWords" + } + } + ], + "description": "Contract naming (tests/detectors/naming-convention/0.6.11/naming_convention.sol#3-48) is not in CapWords\n", + "markdown": "Contract [naming](tests/detectors/naming-convention/0.6.11/naming_convention.sol#L3-L48) is not in CapWords\n", + "id": "7247d550fb327e3aeb21c82714137e5b45a7e9eeaa6a1bc878102c8081033f85", + "check": "naming-convention", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "struct", + "name": "test", + "source_mapping": { + "start": 229, + "length": 35, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "naming", + "source_mapping": { + "start": 28, + "length": 642, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48 + ], + "starting_column": 1, + "ending_column": 2 + } + } + }, + "additional_fields": { + "target": "structure", + "convention": "CapWords" + } + } + ], + "description": "Struct naming.test (tests/detectors/naming-convention/0.6.11/naming_convention.sol#14-16) is not in CapWords\n", + "markdown": "Struct [naming.test](tests/detectors/naming-convention/0.6.11/naming_convention.sol#L14-L16) is not in CapWords\n", + "id": "0ef3ea412cb30b1f0df5fa2af4a7a06e2bf0373fae0770fd9e301aed12c209cf", + "check": "naming-convention", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "event", + "name": "event_", + "source_mapping": { + "start": 335, + "length": 19, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "is_dependency": false, + "lines": [ + 23 + ], + "starting_column": 5, + "ending_column": 24 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "naming", + "source_mapping": { + "start": 28, + "length": 642, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "event_(uint256)" + }, + "additional_fields": { + "target": "event", + "convention": "CapWords" + } + } + ], + "description": "Event namingevent_(uint256) (tests/detectors/naming-convention/0.6.11/naming_convention.sol#23) is not in CapWords\n", + "markdown": "Event [namingevent_(uint256)](tests/detectors/naming-convention/0.6.11/naming_convention.sol#L23) is not in CapWords\n", + "id": "978ecf4a2c8b96d947e60f6601cf60d0e25e07ebe80ebbc37a7e7f279afd1405", + "check": "naming-convention", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "GetOne", + "source_mapping": { + "start": 440, + "length": 75, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "is_dependency": false, + "lines": [ + 30, + 31, + 32, + 33 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "naming", + "source_mapping": { + "start": 28, + "length": 642, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "GetOne()" + }, + "additional_fields": { + "target": "function", + "convention": "mixedCase" + } + } + ], + "description": "Function naming.GetOne() (tests/detectors/naming-convention/0.6.11/naming_convention.sol#30-33) is not in mixedCase\n", + "markdown": "Function [naming.GetOne()](tests/detectors/naming-convention/0.6.11/naming_convention.sol#L30-L33) is not in mixedCase\n", + "id": "bf6f97d6a82b84284efdade52d01bd6112007426e2e88d1568190d63c5c4a049", + "check": "naming-convention", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "Number2", + "source_mapping": { + "start": 551, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "is_dependency": false, + "lines": [ + 35 + ], + "starting_column": 35, + "ending_column": 47 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "setInt", + "source_mapping": { + "start": 521, + "length": 63, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "is_dependency": false, + "lines": [ + 35, + 36, + 37, + 38 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "naming", + "source_mapping": { + "start": 28, + "length": 642, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "setInt(uint256,uint256)" + } + } + }, + "additional_fields": { + "target": "parameter", + "convention": "mixedCase" + } + } + ], + "description": "Parameter naming.setInt(uint256,uint256).Number2 (tests/detectors/naming-convention/0.6.11/naming_convention.sol#35) is not in mixedCase\n", + "markdown": "Parameter [naming.setInt(uint256,uint256).Number2](tests/detectors/naming-convention/0.6.11/naming_convention.sol#L35) is not in mixedCase\n", + "id": "f03bff0b488524254e19ff7d688d34211cd2f29934e22417c9f1fa43fc4a08ad", + "check": "naming-convention", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "MY_other_CONSTANT", + "source_mapping": { + "start": 143, + "length": 35, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "is_dependency": false, + "lines": [ + 9 + ], + "starting_column": 5, + "ending_column": 40 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "naming", + "source_mapping": { + "start": 28, + "length": 642, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48 + ], + "starting_column": 1, + "ending_column": 2 + } + } + }, + "additional_fields": { + "target": "variable_constant", + "convention": "UPPER_CASE_WITH_UNDERSCORES" + } + } + ], + "description": "Constant naming.MY_other_CONSTANT (tests/detectors/naming-convention/0.6.11/naming_convention.sol#9) is not in UPPER_CASE_WITH_UNDERSCORES\n", + "markdown": "Constant [naming.MY_other_CONSTANT](tests/detectors/naming-convention/0.6.11/naming_convention.sol#L9) is not in UPPER_CASE_WITH_UNDERSCORES\n", + "id": "596c2e8064f8f2df55cd5c878eb59c0a74ac7f20719c420d8af307f2431a1a90", + "check": "naming-convention", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "Var_One", + "source_mapping": { + "start": 185, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "is_dependency": false, + "lines": [ + 11 + ], + "starting_column": 5, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "naming", + "source_mapping": { + "start": 28, + "length": 642, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48 + ], + "starting_column": 1, + "ending_column": 2 + } + } + }, + "additional_fields": { + "target": "variable", + "convention": "mixedCase" + } + } + ], + "description": "Variable naming.Var_One (tests/detectors/naming-convention/0.6.11/naming_convention.sol#11) is not in mixedCase\n", + "markdown": "Variable [naming.Var_One](tests/detectors/naming-convention/0.6.11/naming_convention.sol#L11) is not in mixedCase\n", + "id": "34b7c817201b3f3086fc3541f140898d9e9aabe999b1c0a6ef8639ec04351f26", + "check": "naming-convention", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "enum", + "name": "numbers", + "source_mapping": { + "start": 79, + "length": 23, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "is_dependency": false, + "lines": [ + 6 + ], + "starting_column": 5, + "ending_column": 28 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "naming", + "source_mapping": { + "start": 28, + "length": 642, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48 + ], + "starting_column": 1, + "ending_column": 2 + } + } + }, + "additional_fields": { + "target": "enum", + "convention": "CapWords" + } + } + ], + "description": "Enum naming.numbers (tests/detectors/naming-convention/0.6.11/naming_convention.sol#6) is not in CapWords\n", + "markdown": "Enum [naming.numbers](tests/detectors/naming-convention/0.6.11/naming_convention.sol#L6) is not in CapWords\n", + "id": "7c87b076ea2865060182cf11d155caadb1dcea415ccce0ca8563a74a01611fc2", + "check": "naming-convention", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "CantDo", + "source_mapping": { + "start": 591, + "length": 36, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "is_dependency": false, + "lines": [ + 41, + 42, + 43 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "naming", + "source_mapping": { + "start": 28, + "length": 642, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "CantDo()" + }, + "additional_fields": { + "target": "modifier", + "convention": "mixedCase" + } + } + ], + "description": "Modifier naming.CantDo() (tests/detectors/naming-convention/0.6.11/naming_convention.sol#41-43) is not in mixedCase\n", + "markdown": "Modifier [naming.CantDo()](tests/detectors/naming-convention/0.6.11/naming_convention.sol#L41-L43) is not in mixedCase\n", + "id": "b8a754a01bd47127f00032cdedd0ade3e27e6543631d8f5bc9e44365ab732895", + "check": "naming-convention", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "_used", + "source_mapping": { + "start": 794, + "length": 10, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "is_dependency": false, + "lines": [ + 59 + ], + "starting_column": 33, + "ending_column": 43 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "test", + "source_mapping": { + "start": 766, + "length": 84, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "is_dependency": false, + "lines": [ + 59, + 60 + ], + "starting_column": 5, + "ending_column": 23 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "T", + "source_mapping": { + "start": 692, + "length": 221, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "is_dependency": false, + "lines": [ + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "test(uint256,uint256)" + } + } + }, + "additional_fields": { + "target": "parameter", + "convention": "mixedCase" + } + } + ], + "description": "Parameter T.test(uint256,uint256)._used (tests/detectors/naming-convention/0.6.11/naming_convention.sol#59) is not in mixedCase\n", + "markdown": "Parameter [T.test(uint256,uint256)._used](tests/detectors/naming-convention/0.6.11/naming_convention.sol#L59) is not in mixedCase\n", + "id": "818962ad9f50f13eb87b5c7deade22666431945fb60055f572b38246cfbf311e", + "check": "naming-convention", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "_myPublicVar", + "source_mapping": { + "start": 741, + "length": 17, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "is_dependency": false, + "lines": [ + 56 + ], + "starting_column": 5, + "ending_column": 22 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "T", + "source_mapping": { + "start": 692, + "length": 221, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "is_dependency": false, + "lines": [ + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68 + ], + "starting_column": 1, + "ending_column": 2 + } + } + }, + "additional_fields": { + "target": "variable", + "convention": "mixedCase" + } + } + ], + "description": "Variable T._myPublicVar (tests/detectors/naming-convention/0.6.11/naming_convention.sol#56) is not in mixedCase\n", + "markdown": "Variable [T._myPublicVar](tests/detectors/naming-convention/0.6.11/naming_convention.sol#L56) is not in mixedCase\n", + "id": "8acd53815786acad5b92b51366daf79182a67ab438daa41a6e1ec8a9601fa9a3", + "check": "naming-convention", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "l", + "source_mapping": { + "start": 900, + "length": 10, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "is_dependency": false, + "lines": [ + 67 + ], + "starting_column": 5, + "ending_column": 15 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "T", + "source_mapping": { + "start": 692, + "length": 221, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "is_dependency": false, + "lines": [ + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68 + ], + "starting_column": 1, + "ending_column": 2 + } + } + }, + "additional_fields": { + "target": "variable", + "convention": "l_O_I_should_not_be_used" + } + } + ], + "description": "Variable T.l (tests/detectors/naming-convention/0.6.11/naming_convention.sol#67) used l, O, I, which should not be used\n", + "markdown": "Variable [T.l](tests/detectors/naming-convention/0.6.11/naming_convention.sol#L67) used l, O, I, which should not be used\n", + "id": "b595f9e6d03b8b501b7c4a9bf8ff0ad9bf11448a25f53d63ab5031c95f8ae89c", + "check": "naming-convention", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/naming-convention/0.6.11/naming_convention_ignore.sol b/tests/detectors/naming-convention/0.6.11/naming_convention_ignore.sol new file mode 100644 index 0000000000..c650dc4cfe --- /dev/null +++ b/tests/detectors/naming-convention/0.6.11/naming_convention_ignore.sol @@ -0,0 +1,22 @@ +//pragma solidity ^0.4.24; + +// slither-disable-next-line all +contract naming { + + // slither-disable-next-line naming-convention + struct test { + uint a; + } + + + // slither-disable-next-line pragma,all + struct test2 { + uint a; + } + + // slither-disable-next-line wrong-naming-convention + struct test3 { + uint a; + } + +} diff --git a/tests/detectors/naming-convention/0.6.11/naming_convention_ignore.sol.0.6.11.NamingConvention.json b/tests/detectors/naming-convention/0.6.11/naming_convention_ignore.sol.0.6.11.NamingConvention.json new file mode 100644 index 0000000000..6eac384faf --- /dev/null +++ b/tests/detectors/naming-convention/0.6.11/naming_convention_ignore.sol.0.6.11.NamingConvention.json @@ -0,0 +1,76 @@ +[ + [ + { + "elements": [ + { + "type": "struct", + "name": "test3", + "source_mapping": { + "start": 320, + "length": 36, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention_ignore.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention_ignore.sol", + "is_dependency": false, + "lines": [ + 18, + 19, + 20 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "naming", + "source_mapping": { + "start": 61, + "length": 299, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention_ignore.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention_ignore.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22 + ], + "starting_column": 1, + "ending_column": 2 + } + } + }, + "additional_fields": { + "target": "structure", + "convention": "CapWords" + } + } + ], + "description": "Struct naming.test3 (tests/detectors/naming-convention/0.6.11/naming_convention_ignore.sol#18-20) is not in CapWords\n", + "markdown": "Struct [naming.test3](tests/detectors/naming-convention/0.6.11/naming_convention_ignore.sol#L18-L20) is not in CapWords\n", + "id": "34b66b0b5acf6c00b066dd7f5bbcdbc6f3879ab5ece850f113d00e3318eac10f", + "check": "naming-convention", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/naming-convention/0.7.6/naming_convention.sol b/tests/detectors/naming-convention/0.7.6/naming_convention.sol new file mode 100644 index 0000000000..6c4b2f936e --- /dev/null +++ b/tests/detectors/naming-convention/0.7.6/naming_convention.sol @@ -0,0 +1,75 @@ +//pragma solidity ^0.4.24; + +contract naming { + + enum Numbers {ONE, TWO} + enum numbers {ONE, TWO} + + uint constant MY_CONSTANT = 1; + uint constant MY_other_CONSTANT = 2; + + uint Var_One = 1; + uint varTwo = 2; + + struct test { + uint a; + } + + struct Test { + uint a; + } + + event Event_(uint); + event event_(uint); + + function getOne() view public returns(uint) + { + return 1; + } + + function GetOne() view public returns (uint) + { + return 1; + } + + function setInt(uint number1, uint Number2) public + { + + } + + + modifier CantDo() { + _; + } + + modifier canDo() { + _; + } +} + +contract Test { + +} + +contract T { + uint private _myPrivateVar; + uint _myPublicVar; + + + function test(uint _unused, uint _used) public returns(uint){ + return _used;} + + + uint k = 1; + + uint constant M = 1; + + uint l = 1; +} + +contract ParameterNameEmptyString { + + function foo (uint) public { + } + +} diff --git a/tests/detectors/naming-convention/naming_convention.sol.0.5.1.NamingConvention.json b/tests/detectors/naming-convention/0.7.6/naming_convention.sol.0.7.6.NamingConvention.json similarity index 91% rename from tests/detectors/naming-convention/naming_convention.sol.0.5.1.NamingConvention.json rename to tests/detectors/naming-convention/0.7.6/naming_convention.sol.0.7.6.NamingConvention.json index b4c8e78d90..b0055d962b 100644 --- a/tests/detectors/naming-convention/naming_convention.sol.0.5.1.NamingConvention.json +++ b/tests/detectors/naming-convention/0.7.6/naming_convention.sol.0.7.6.NamingConvention.json @@ -9,9 +9,9 @@ "start": 28, "length": 642, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "is_dependency": false, "lines": [ 3, @@ -70,8 +70,8 @@ } } ], - "description": "Contract naming (tests/detectors/naming-convention/naming_convention.sol#3-48) is not in CapWords\n", - "markdown": "Contract [naming](tests/detectors/naming-convention/naming_convention.sol#L3-L48) is not in CapWords\n", + "description": "Contract naming (tests/detectors/naming-convention/0.7.6/naming_convention.sol#3-48) is not in CapWords\n", + "markdown": "Contract [naming](tests/detectors/naming-convention/0.7.6/naming_convention.sol#L3-L48) is not in CapWords\n", "id": "7247d550fb327e3aeb21c82714137e5b45a7e9eeaa6a1bc878102c8081033f85", "check": "naming-convention", "impact": "Informational", @@ -86,9 +86,9 @@ "start": 229, "length": 35, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "is_dependency": false, "lines": [ 14, @@ -106,9 +106,9 @@ "start": 28, "length": 642, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "is_dependency": false, "lines": [ 3, @@ -169,8 +169,8 @@ } } ], - "description": "Struct naming.test (tests/detectors/naming-convention/naming_convention.sol#14-16) is not in CapWords\n", - "markdown": "Struct [naming.test](tests/detectors/naming-convention/naming_convention.sol#L14-L16) is not in CapWords\n", + "description": "Struct naming.test (tests/detectors/naming-convention/0.7.6/naming_convention.sol#14-16) is not in CapWords\n", + "markdown": "Struct [naming.test](tests/detectors/naming-convention/0.7.6/naming_convention.sol#L14-L16) is not in CapWords\n", "id": "0ef3ea412cb30b1f0df5fa2af4a7a06e2bf0373fae0770fd9e301aed12c209cf", "check": "naming-convention", "impact": "Informational", @@ -185,9 +185,9 @@ "start": 335, "length": 19, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "is_dependency": false, "lines": [ 23 @@ -203,9 +203,9 @@ "start": 28, "length": 642, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "is_dependency": false, "lines": [ 3, @@ -267,8 +267,8 @@ } } ], - "description": "Event namingevent_(uint256) (tests/detectors/naming-convention/naming_convention.sol#23) is not in CapWords\n", - "markdown": "Event [namingevent_(uint256)](tests/detectors/naming-convention/naming_convention.sol#L23) is not in CapWords\n", + "description": "Event namingevent_(uint256) (tests/detectors/naming-convention/0.7.6/naming_convention.sol#23) is not in CapWords\n", + "markdown": "Event [namingevent_(uint256)](tests/detectors/naming-convention/0.7.6/naming_convention.sol#L23) is not in CapWords\n", "id": "978ecf4a2c8b96d947e60f6601cf60d0e25e07ebe80ebbc37a7e7f279afd1405", "check": "naming-convention", "impact": "Informational", @@ -283,9 +283,9 @@ "start": 440, "length": 75, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "is_dependency": false, "lines": [ 30, @@ -304,9 +304,9 @@ "start": 28, "length": 642, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "is_dependency": false, "lines": [ 3, @@ -368,8 +368,8 @@ } } ], - "description": "Function naming.GetOne() (tests/detectors/naming-convention/naming_convention.sol#30-33) is not in mixedCase\n", - "markdown": "Function [naming.GetOne()](tests/detectors/naming-convention/naming_convention.sol#L30-L33) is not in mixedCase\n", + "description": "Function naming.GetOne() (tests/detectors/naming-convention/0.7.6/naming_convention.sol#30-33) is not in mixedCase\n", + "markdown": "Function [naming.GetOne()](tests/detectors/naming-convention/0.7.6/naming_convention.sol#L30-L33) is not in mixedCase\n", "id": "bf6f97d6a82b84284efdade52d01bd6112007426e2e88d1568190d63c5c4a049", "check": "naming-convention", "impact": "Informational", @@ -384,9 +384,9 @@ "start": 551, "length": 12, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "is_dependency": false, "lines": [ 35 @@ -402,9 +402,9 @@ "start": 521, "length": 63, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "is_dependency": false, "lines": [ 35, @@ -423,9 +423,9 @@ "start": 28, "length": 642, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "is_dependency": false, "lines": [ 3, @@ -489,8 +489,8 @@ } } ], - "description": "Parameter naming.setInt(uint256,uint256).Number2 (tests/detectors/naming-convention/naming_convention.sol#35) is not in mixedCase\n", - "markdown": "Parameter [naming.setInt(uint256,uint256).Number2](tests/detectors/naming-convention/naming_convention.sol#L35) is not in mixedCase\n", + "description": "Parameter naming.setInt(uint256,uint256).Number2 (tests/detectors/naming-convention/0.7.6/naming_convention.sol#35) is not in mixedCase\n", + "markdown": "Parameter [naming.setInt(uint256,uint256).Number2](tests/detectors/naming-convention/0.7.6/naming_convention.sol#L35) is not in mixedCase\n", "id": "f03bff0b488524254e19ff7d688d34211cd2f29934e22417c9f1fa43fc4a08ad", "check": "naming-convention", "impact": "Informational", @@ -505,9 +505,9 @@ "start": 143, "length": 35, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "is_dependency": false, "lines": [ 9 @@ -523,9 +523,9 @@ "start": 28, "length": 642, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "is_dependency": false, "lines": [ 3, @@ -586,8 +586,8 @@ } } ], - "description": "Constant naming.MY_other_CONSTANT (tests/detectors/naming-convention/naming_convention.sol#9) is not in UPPER_CASE_WITH_UNDERSCORES\n", - "markdown": "Constant [naming.MY_other_CONSTANT](tests/detectors/naming-convention/naming_convention.sol#L9) is not in UPPER_CASE_WITH_UNDERSCORES\n", + "description": "Constant naming.MY_other_CONSTANT (tests/detectors/naming-convention/0.7.6/naming_convention.sol#9) is not in UPPER_CASE_WITH_UNDERSCORES\n", + "markdown": "Constant [naming.MY_other_CONSTANT](tests/detectors/naming-convention/0.7.6/naming_convention.sol#L9) is not in UPPER_CASE_WITH_UNDERSCORES\n", "id": "596c2e8064f8f2df55cd5c878eb59c0a74ac7f20719c420d8af307f2431a1a90", "check": "naming-convention", "impact": "Informational", @@ -602,9 +602,9 @@ "start": 185, "length": 16, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "is_dependency": false, "lines": [ 11 @@ -620,9 +620,9 @@ "start": 28, "length": 642, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "is_dependency": false, "lines": [ 3, @@ -683,8 +683,8 @@ } } ], - "description": "Variable naming.Var_One (tests/detectors/naming-convention/naming_convention.sol#11) is not in mixedCase\n", - "markdown": "Variable [naming.Var_One](tests/detectors/naming-convention/naming_convention.sol#L11) is not in mixedCase\n", + "description": "Variable naming.Var_One (tests/detectors/naming-convention/0.7.6/naming_convention.sol#11) is not in mixedCase\n", + "markdown": "Variable [naming.Var_One](tests/detectors/naming-convention/0.7.6/naming_convention.sol#L11) is not in mixedCase\n", "id": "34b7c817201b3f3086fc3541f140898d9e9aabe999b1c0a6ef8639ec04351f26", "check": "naming-convention", "impact": "Informational", @@ -699,9 +699,9 @@ "start": 79, "length": 23, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "is_dependency": false, "lines": [ 6 @@ -717,9 +717,9 @@ "start": 28, "length": 642, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "is_dependency": false, "lines": [ 3, @@ -780,8 +780,8 @@ } } ], - "description": "Enum naming.numbers (tests/detectors/naming-convention/naming_convention.sol#6) is not in CapWords\n", - "markdown": "Enum [naming.numbers](tests/detectors/naming-convention/naming_convention.sol#L6) is not in CapWords\n", + "description": "Enum naming.numbers (tests/detectors/naming-convention/0.7.6/naming_convention.sol#6) is not in CapWords\n", + "markdown": "Enum [naming.numbers](tests/detectors/naming-convention/0.7.6/naming_convention.sol#L6) is not in CapWords\n", "id": "7c87b076ea2865060182cf11d155caadb1dcea415ccce0ca8563a74a01611fc2", "check": "naming-convention", "impact": "Informational", @@ -796,9 +796,9 @@ "start": 591, "length": 36, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "is_dependency": false, "lines": [ 41, @@ -816,9 +816,9 @@ "start": 28, "length": 642, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "is_dependency": false, "lines": [ 3, @@ -880,8 +880,8 @@ } } ], - "description": "Modifier naming.CantDo() (tests/detectors/naming-convention/naming_convention.sol#41-43) is not in mixedCase\n", - "markdown": "Modifier [naming.CantDo()](tests/detectors/naming-convention/naming_convention.sol#L41-L43) is not in mixedCase\n", + "description": "Modifier naming.CantDo() (tests/detectors/naming-convention/0.7.6/naming_convention.sol#41-43) is not in mixedCase\n", + "markdown": "Modifier [naming.CantDo()](tests/detectors/naming-convention/0.7.6/naming_convention.sol#L41-L43) is not in mixedCase\n", "id": "b8a754a01bd47127f00032cdedd0ade3e27e6543631d8f5bc9e44365ab732895", "check": "naming-convention", "impact": "Informational", @@ -896,9 +896,9 @@ "start": 794, "length": 10, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "is_dependency": false, "lines": [ 59 @@ -914,9 +914,9 @@ "start": 766, "length": 84, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "is_dependency": false, "lines": [ 59, @@ -933,9 +933,9 @@ "start": 692, "length": 221, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "is_dependency": false, "lines": [ 54, @@ -968,8 +968,8 @@ } } ], - "description": "Parameter T.test(uint256,uint256)._used (tests/detectors/naming-convention/naming_convention.sol#59) is not in mixedCase\n", - "markdown": "Parameter [T.test(uint256,uint256)._used](tests/detectors/naming-convention/naming_convention.sol#L59) is not in mixedCase\n", + "description": "Parameter T.test(uint256,uint256)._used (tests/detectors/naming-convention/0.7.6/naming_convention.sol#59) is not in mixedCase\n", + "markdown": "Parameter [T.test(uint256,uint256)._used](tests/detectors/naming-convention/0.7.6/naming_convention.sol#L59) is not in mixedCase\n", "id": "818962ad9f50f13eb87b5c7deade22666431945fb60055f572b38246cfbf311e", "check": "naming-convention", "impact": "Informational", @@ -984,9 +984,9 @@ "start": 741, "length": 17, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "is_dependency": false, "lines": [ 56 @@ -1002,9 +1002,9 @@ "start": 692, "length": 221, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "is_dependency": false, "lines": [ 54, @@ -1034,8 +1034,8 @@ } } ], - "description": "Variable T._myPublicVar (tests/detectors/naming-convention/naming_convention.sol#56) is not in mixedCase\n", - "markdown": "Variable [T._myPublicVar](tests/detectors/naming-convention/naming_convention.sol#L56) is not in mixedCase\n", + "description": "Variable T._myPublicVar (tests/detectors/naming-convention/0.7.6/naming_convention.sol#56) is not in mixedCase\n", + "markdown": "Variable [T._myPublicVar](tests/detectors/naming-convention/0.7.6/naming_convention.sol#L56) is not in mixedCase\n", "id": "8acd53815786acad5b92b51366daf79182a67ab438daa41a6e1ec8a9601fa9a3", "check": "naming-convention", "impact": "Informational", @@ -1050,9 +1050,9 @@ "start": 900, "length": 10, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "is_dependency": false, "lines": [ 67 @@ -1068,9 +1068,9 @@ "start": 692, "length": 221, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/naming_convention.sol", + "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/naming_convention.sol", + "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention.sol", "is_dependency": false, "lines": [ 54, @@ -1100,8 +1100,8 @@ } } ], - "description": "Variable T.l (tests/detectors/naming-convention/naming_convention.sol#67) used l, O, I, which should not be used\n", - "markdown": "Variable [T.l](tests/detectors/naming-convention/naming_convention.sol#L67) used l, O, I, which should not be used\n", + "description": "Variable T.l (tests/detectors/naming-convention/0.7.6/naming_convention.sol#67) used l, O, I, which should not be used\n", + "markdown": "Variable [T.l](tests/detectors/naming-convention/0.7.6/naming_convention.sol#L67) used l, O, I, which should not be used\n", "id": "b595f9e6d03b8b501b7c4a9bf8ff0ad9bf11448a25f53d63ab5031c95f8ae89c", "check": "naming-convention", "impact": "Informational", diff --git a/tests/detectors/naming-convention/0.7.6/naming_convention_ignore.sol b/tests/detectors/naming-convention/0.7.6/naming_convention_ignore.sol new file mode 100644 index 0000000000..c650dc4cfe --- /dev/null +++ b/tests/detectors/naming-convention/0.7.6/naming_convention_ignore.sol @@ -0,0 +1,22 @@ +//pragma solidity ^0.4.24; + +// slither-disable-next-line all +contract naming { + + // slither-disable-next-line naming-convention + struct test { + uint a; + } + + + // slither-disable-next-line pragma,all + struct test2 { + uint a; + } + + // slither-disable-next-line wrong-naming-convention + struct test3 { + uint a; + } + +} diff --git a/tests/detectors/naming-convention/0.7.6/naming_convention_ignore.sol.0.7.6.NamingConvention.json b/tests/detectors/naming-convention/0.7.6/naming_convention_ignore.sol.0.7.6.NamingConvention.json new file mode 100644 index 0000000000..78101ada5b --- /dev/null +++ b/tests/detectors/naming-convention/0.7.6/naming_convention_ignore.sol.0.7.6.NamingConvention.json @@ -0,0 +1,76 @@ +[ + [ + { + "elements": [ + { + "type": "struct", + "name": "test3", + "source_mapping": { + "start": 320, + "length": 36, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention_ignore.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention_ignore.sol", + "is_dependency": false, + "lines": [ + 18, + 19, + 20 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "naming", + "source_mapping": { + "start": 61, + "length": 299, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention_ignore.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention_ignore.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22 + ], + "starting_column": 1, + "ending_column": 2 + } + } + }, + "additional_fields": { + "target": "structure", + "convention": "CapWords" + } + } + ], + "description": "Struct naming.test3 (tests/detectors/naming-convention/0.7.6/naming_convention_ignore.sol#18-20) is not in CapWords\n", + "markdown": "Struct [naming.test3](tests/detectors/naming-convention/0.7.6/naming_convention_ignore.sol#L18-L20) is not in CapWords\n", + "id": "34b66b0b5acf6c00b066dd7f5bbcdbc6f3879ab5ece850f113d00e3318eac10f", + "check": "naming-convention", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/pragma/0.4.25/pragma.0.4.24.sol b/tests/detectors/pragma/0.4.25/pragma.0.4.24.sol new file mode 100644 index 0000000000..6f42901086 --- /dev/null +++ b/tests/detectors/pragma/0.4.25/pragma.0.4.24.sol @@ -0,0 +1 @@ +pragma solidity ^0.4.24; diff --git a/tests/detectors/pragma/0.4.25/pragma.0.4.25.sol b/tests/detectors/pragma/0.4.25/pragma.0.4.25.sol new file mode 100644 index 0000000000..465f0a862d --- /dev/null +++ b/tests/detectors/pragma/0.4.25/pragma.0.4.25.sol @@ -0,0 +1,5 @@ +pragma solidity ^0.4.25; + +import "./pragma.0.4.24.sol"; + +contract Test{} diff --git a/tests/detectors/pragma/pragma.0.4.24.sol.0.4.25.ConstantPragma.json b/tests/detectors/pragma/0.4.25/pragma.0.4.25.sol.0.4.25.ConstantPragma.json similarity index 77% rename from tests/detectors/pragma/pragma.0.4.24.sol.0.4.25.ConstantPragma.json rename to tests/detectors/pragma/0.4.25/pragma.0.4.25.sol.0.4.25.ConstantPragma.json index f4126bd95e..cdef8c74bd 100644 --- a/tests/detectors/pragma/pragma.0.4.24.sol.0.4.25.ConstantPragma.json +++ b/tests/detectors/pragma/0.4.25/pragma.0.4.25.sol.0.4.25.ConstantPragma.json @@ -4,14 +4,14 @@ "elements": [ { "type": "pragma", - "name": "^0.4.23", + "name": "^0.4.24", "source_mapping": { "start": 0, "length": 24, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/pragma/pragma.0.4.23.sol", + "filename_relative": "tests/detectors/pragma/0.4.25/pragma.0.4.24.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/pragma/pragma.0.4.23.sol", + "filename_short": "tests/detectors/pragma/0.4.25/pragma.0.4.24.sol", "is_dependency": false, "lines": [ 1 @@ -24,20 +24,20 @@ "solidity", "^", "0.4", - ".23" + ".24" ] } }, { "type": "pragma", - "name": "^0.4.24", + "name": "^0.4.25", "source_mapping": { "start": 0, "length": 24, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/pragma/pragma.0.4.24.sol", + "filename_relative": "tests/detectors/pragma/0.4.25/pragma.0.4.25.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/pragma/pragma.0.4.24.sol", + "filename_short": "tests/detectors/pragma/0.4.25/pragma.0.4.25.sol", "is_dependency": false, "lines": [ 1 @@ -50,14 +50,14 @@ "solidity", "^", "0.4", - ".24" + ".25" ] } } ], - "description": "Different versions of Solidity is used in :\n\t- Version used: ['^0.4.23', '^0.4.24']\n\t- ^0.4.23 (tests/detectors/pragma/pragma.0.4.23.sol#1)\n\t- ^0.4.24 (tests/detectors/pragma/pragma.0.4.24.sol#1)\n", - "markdown": "Different versions of Solidity is used in :\n\t- Version used: ['^0.4.23', '^0.4.24']\n\t- [^0.4.23](tests/detectors/pragma/pragma.0.4.23.sol#L1)\n\t- [^0.4.24](tests/detectors/pragma/pragma.0.4.24.sol#L1)\n", - "id": "1379d7b43e8c8bc939547079131e06fc888bb82740880718f8ff3409a6d5173e", + "description": "Different versions of Solidity is used in :\n\t- Version used: ['^0.4.24', '^0.4.25']\n\t- ^0.4.24 (tests/detectors/pragma/0.4.25/pragma.0.4.24.sol#1)\n\t- ^0.4.25 (tests/detectors/pragma/0.4.25/pragma.0.4.25.sol#1)\n", + "markdown": "Different versions of Solidity is used in :\n\t- Version used: ['^0.4.24', '^0.4.25']\n\t- [^0.4.24](tests/detectors/pragma/0.4.25/pragma.0.4.24.sol#L1)\n\t- [^0.4.25](tests/detectors/pragma/0.4.25/pragma.0.4.25.sol#L1)\n", + "id": "54735fb882b1f9775c73514464a814ee233d22cfb9eb38621a7fd5a80b93deca", "check": "pragma", "impact": "Informational", "confidence": "High" diff --git a/tests/detectors/pragma/0.5.16/pragma.0.5.15.sol b/tests/detectors/pragma/0.5.16/pragma.0.5.15.sol new file mode 100644 index 0000000000..17fba2f2d1 --- /dev/null +++ b/tests/detectors/pragma/0.5.16/pragma.0.5.15.sol @@ -0,0 +1 @@ +pragma solidity ^0.5.15; diff --git a/tests/detectors/pragma/0.5.16/pragma.0.5.16.sol b/tests/detectors/pragma/0.5.16/pragma.0.5.16.sol new file mode 100644 index 0000000000..813684a764 --- /dev/null +++ b/tests/detectors/pragma/0.5.16/pragma.0.5.16.sol @@ -0,0 +1,5 @@ +pragma solidity ^0.5.16; + +import "./pragma.0.5.15.sol"; + +contract Test{} diff --git a/tests/detectors/pragma/0.5.16/pragma.0.5.16.sol.0.5.16.ConstantPragma.json b/tests/detectors/pragma/0.5.16/pragma.0.5.16.sol.0.5.16.ConstantPragma.json new file mode 100644 index 0000000000..95349f53fc --- /dev/null +++ b/tests/detectors/pragma/0.5.16/pragma.0.5.16.sol.0.5.16.ConstantPragma.json @@ -0,0 +1,66 @@ +[ + [ + { + "elements": [ + { + "type": "pragma", + "name": "^0.5.15", + "source_mapping": { + "start": 0, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/pragma/0.5.16/pragma.0.5.15.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/pragma/0.5.16/pragma.0.5.15.sol", + "is_dependency": false, + "lines": [ + 1 + ], + "starting_column": 1, + "ending_column": 25 + }, + "type_specific_fields": { + "directive": [ + "solidity", + "^", + "0.5", + ".15" + ] + } + }, + { + "type": "pragma", + "name": "^0.5.16", + "source_mapping": { + "start": 0, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/pragma/0.5.16/pragma.0.5.16.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/pragma/0.5.16/pragma.0.5.16.sol", + "is_dependency": false, + "lines": [ + 1 + ], + "starting_column": 1, + "ending_column": 25 + }, + "type_specific_fields": { + "directive": [ + "solidity", + "^", + "0.5", + ".16" + ] + } + } + ], + "description": "Different versions of Solidity is used in :\n\t- Version used: ['^0.5.15', '^0.5.16']\n\t- ^0.5.15 (tests/detectors/pragma/0.5.16/pragma.0.5.15.sol#1)\n\t- ^0.5.16 (tests/detectors/pragma/0.5.16/pragma.0.5.16.sol#1)\n", + "markdown": "Different versions of Solidity is used in :\n\t- Version used: ['^0.5.15', '^0.5.16']\n\t- [^0.5.15](tests/detectors/pragma/0.5.16/pragma.0.5.15.sol#L1)\n\t- [^0.5.16](tests/detectors/pragma/0.5.16/pragma.0.5.16.sol#L1)\n", + "id": "3bc166503cc88489de83ca39f0dab291649a655262cb6fa3bdef885c290667de", + "check": "pragma", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/pragma/0.6.11/pragma.0.6.10.sol b/tests/detectors/pragma/0.6.11/pragma.0.6.10.sol new file mode 100644 index 0000000000..9242c4f593 --- /dev/null +++ b/tests/detectors/pragma/0.6.11/pragma.0.6.10.sol @@ -0,0 +1 @@ +pragma solidity ^0.6.10; diff --git a/tests/detectors/pragma/0.6.11/pragma.0.6.11.sol b/tests/detectors/pragma/0.6.11/pragma.0.6.11.sol new file mode 100644 index 0000000000..5356f72157 --- /dev/null +++ b/tests/detectors/pragma/0.6.11/pragma.0.6.11.sol @@ -0,0 +1,5 @@ +pragma solidity ^0.6.11; + +import "./pragma.0.6.10.sol"; + +contract Test{} diff --git a/tests/detectors/pragma/0.6.11/pragma.0.6.11.sol.0.6.11.ConstantPragma.json b/tests/detectors/pragma/0.6.11/pragma.0.6.11.sol.0.6.11.ConstantPragma.json new file mode 100644 index 0000000000..7a429b7ffa --- /dev/null +++ b/tests/detectors/pragma/0.6.11/pragma.0.6.11.sol.0.6.11.ConstantPragma.json @@ -0,0 +1,66 @@ +[ + [ + { + "elements": [ + { + "type": "pragma", + "name": "^0.6.10", + "source_mapping": { + "start": 0, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/pragma/0.6.11/pragma.0.6.10.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/pragma/0.6.11/pragma.0.6.10.sol", + "is_dependency": false, + "lines": [ + 1 + ], + "starting_column": 1, + "ending_column": 25 + }, + "type_specific_fields": { + "directive": [ + "solidity", + "^", + "0.6", + ".10" + ] + } + }, + { + "type": "pragma", + "name": "^0.6.11", + "source_mapping": { + "start": 0, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/pragma/0.6.11/pragma.0.6.11.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/pragma/0.6.11/pragma.0.6.11.sol", + "is_dependency": false, + "lines": [ + 1 + ], + "starting_column": 1, + "ending_column": 25 + }, + "type_specific_fields": { + "directive": [ + "solidity", + "^", + "0.6", + ".11" + ] + } + } + ], + "description": "Different versions of Solidity is used in :\n\t- Version used: ['^0.6.10', '^0.6.11']\n\t- ^0.6.10 (tests/detectors/pragma/0.6.11/pragma.0.6.10.sol#1)\n\t- ^0.6.11 (tests/detectors/pragma/0.6.11/pragma.0.6.11.sol#1)\n", + "markdown": "Different versions of Solidity is used in :\n\t- Version used: ['^0.6.10', '^0.6.11']\n\t- [^0.6.10](tests/detectors/pragma/0.6.11/pragma.0.6.10.sol#L1)\n\t- [^0.6.11](tests/detectors/pragma/0.6.11/pragma.0.6.11.sol#L1)\n", + "id": "ac4d13e962f946f674a568e134a2d9db2449eaf7d49cc43cb39a8a4822963b27", + "check": "pragma", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/pragma/0.7.6/pragma.0.7.5.sol b/tests/detectors/pragma/0.7.6/pragma.0.7.5.sol new file mode 100644 index 0000000000..a95d8979b7 --- /dev/null +++ b/tests/detectors/pragma/0.7.6/pragma.0.7.5.sol @@ -0,0 +1 @@ +pragma solidity ^0.7.5; diff --git a/tests/detectors/pragma/0.7.6/pragma.0.7.6.sol b/tests/detectors/pragma/0.7.6/pragma.0.7.6.sol new file mode 100644 index 0000000000..5ff22c22e7 --- /dev/null +++ b/tests/detectors/pragma/0.7.6/pragma.0.7.6.sol @@ -0,0 +1,5 @@ +pragma solidity ^0.7.6; + +import "./pragma.0.7.5.sol"; + +contract Test{} diff --git a/tests/detectors/pragma/0.7.6/pragma.0.7.6.sol.0.7.6.ConstantPragma.json b/tests/detectors/pragma/0.7.6/pragma.0.7.6.sol.0.7.6.ConstantPragma.json new file mode 100644 index 0000000000..ba99ffd392 --- /dev/null +++ b/tests/detectors/pragma/0.7.6/pragma.0.7.6.sol.0.7.6.ConstantPragma.json @@ -0,0 +1,66 @@ +[ + [ + { + "elements": [ + { + "type": "pragma", + "name": "^0.7.5", + "source_mapping": { + "start": 0, + "length": 23, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/pragma/0.7.6/pragma.0.7.5.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/pragma/0.7.6/pragma.0.7.5.sol", + "is_dependency": false, + "lines": [ + 1 + ], + "starting_column": 1, + "ending_column": 24 + }, + "type_specific_fields": { + "directive": [ + "solidity", + "^", + "0.7", + ".5" + ] + } + }, + { + "type": "pragma", + "name": "^0.7.6", + "source_mapping": { + "start": 0, + "length": 23, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/pragma/0.7.6/pragma.0.7.6.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/pragma/0.7.6/pragma.0.7.6.sol", + "is_dependency": false, + "lines": [ + 1 + ], + "starting_column": 1, + "ending_column": 24 + }, + "type_specific_fields": { + "directive": [ + "solidity", + "^", + "0.7", + ".6" + ] + } + } + ], + "description": "Different versions of Solidity is used in :\n\t- Version used: ['^0.7.5', '^0.7.6']\n\t- ^0.7.5 (tests/detectors/pragma/0.7.6/pragma.0.7.5.sol#1)\n\t- ^0.7.6 (tests/detectors/pragma/0.7.6/pragma.0.7.6.sol#1)\n", + "markdown": "Different versions of Solidity is used in :\n\t- Version used: ['^0.7.5', '^0.7.6']\n\t- [^0.7.5](tests/detectors/pragma/0.7.6/pragma.0.7.5.sol#L1)\n\t- [^0.7.6](tests/detectors/pragma/0.7.6/pragma.0.7.6.sol#L1)\n", + "id": "597d3c331984072a9736ee79c2c673b49ad9e38fcf2086c845f48b6fe1521dae", + "check": "pragma", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/pragma/pragma.0.4.23.sol b/tests/detectors/pragma/pragma.0.4.23.sol deleted file mode 100644 index 6e6a5000f8..0000000000 --- a/tests/detectors/pragma/pragma.0.4.23.sol +++ /dev/null @@ -1 +0,0 @@ -pragma solidity ^0.4.23; diff --git a/tests/detectors/pragma/pragma.0.4.24.sol b/tests/detectors/pragma/pragma.0.4.24.sol deleted file mode 100644 index c10357dcc3..0000000000 --- a/tests/detectors/pragma/pragma.0.4.24.sol +++ /dev/null @@ -1,5 +0,0 @@ -pragma solidity ^0.4.24; - -import "./pragma.0.4.23.sol"; - -contract Test{} diff --git a/tests/detectors/public-mappings-nested/public_mappings_nested.sol b/tests/detectors/public-mappings-nested/0.4.25/public_mappings_nested.sol similarity index 100% rename from tests/detectors/public-mappings-nested/public_mappings_nested.sol rename to tests/detectors/public-mappings-nested/0.4.25/public_mappings_nested.sol diff --git a/tests/detectors/public-mappings-nested/public_mappings_nested.sol.0.4.25.PublicMappingNested.json b/tests/detectors/public-mappings-nested/0.4.25/public_mappings_nested.sol.0.4.25.PublicMappingNested.json similarity index 86% rename from tests/detectors/public-mappings-nested/public_mappings_nested.sol.0.4.25.PublicMappingNested.json rename to tests/detectors/public-mappings-nested/0.4.25/public_mappings_nested.sol.0.4.25.PublicMappingNested.json index d7e8d40ea6..6fc6c9d13a 100644 --- a/tests/detectors/public-mappings-nested/public_mappings_nested.sol.0.4.25.PublicMappingNested.json +++ b/tests/detectors/public-mappings-nested/0.4.25/public_mappings_nested.sol.0.4.25.PublicMappingNested.json @@ -9,9 +9,9 @@ "start": 265, "length": 47, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/public-mappings-nested/public_mappings_nested.sol", + "filename_relative": "tests/detectors/public-mappings-nested/0.4.25/public_mappings_nested.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/public-mappings-nested/public_mappings_nested.sol", + "filename_short": "tests/detectors/public-mappings-nested/0.4.25/public_mappings_nested.sol", "is_dependency": false, "lines": [ 14 @@ -27,9 +27,9 @@ "start": 138, "length": 345, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/public-mappings-nested/public_mappings_nested.sol", + "filename_relative": "tests/detectors/public-mappings-nested/0.4.25/public_mappings_nested.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/public-mappings-nested/public_mappings_nested.sol", + "filename_short": "tests/detectors/public-mappings-nested/0.4.25/public_mappings_nested.sol", "is_dependency": false, "lines": [ 4, @@ -58,8 +58,8 @@ } } ], - "description": "Bug.testMapping (tests/detectors/public-mappings-nested/public_mappings_nested.sol#14) is a public mapping with nested variables\n", - "markdown": "[Bug.testMapping](tests/detectors/public-mappings-nested/public_mappings_nested.sol#L14) is a public mapping with nested variables\n", + "description": "Bug.testMapping (tests/detectors/public-mappings-nested/0.4.25/public_mappings_nested.sol#14) is a public mapping with nested variables\n", + "markdown": "[Bug.testMapping](tests/detectors/public-mappings-nested/0.4.25/public_mappings_nested.sol#L14) is a public mapping with nested variables\n", "id": "100978112524def620b003331f34b2b51eb78cae6f7eb2793d9671b4b7bb858a", "check": "public-mappings-nested", "impact": "High", diff --git a/tests/detectors/redundant-statements/redundant_statements.sol b/tests/detectors/redundant-statements/0.4.25/redundant_statements.sol similarity index 100% rename from tests/detectors/redundant-statements/redundant_statements.sol rename to tests/detectors/redundant-statements/0.4.25/redundant_statements.sol diff --git a/tests/detectors/redundant-statements/redundant_statements.sol.0.4.25.RedundantStatements.json b/tests/detectors/redundant-statements/0.4.25/redundant_statements.sol.0.4.25.RedundantStatements.json similarity index 85% rename from tests/detectors/redundant-statements/redundant_statements.sol.0.4.25.RedundantStatements.json rename to tests/detectors/redundant-statements/0.4.25/redundant_statements.sol.0.4.25.RedundantStatements.json index ce0198f8ce..6828f46d0a 100644 --- a/tests/detectors/redundant-statements/redundant_statements.sol.0.4.25.RedundantStatements.json +++ b/tests/detectors/redundant-statements/0.4.25/redundant_statements.sol.0.4.25.RedundantStatements.json @@ -9,9 +9,9 @@ "start": 141, "length": 4, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_relative": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_short": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "is_dependency": false, "lines": [ 6 @@ -27,9 +27,9 @@ "start": 110, "length": 93, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_relative": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_short": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "is_dependency": false, "lines": [ 5, @@ -49,9 +49,9 @@ "start": 66, "length": 254, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_relative": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_short": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "is_dependency": false, "lines": [ 3, @@ -87,9 +87,9 @@ "start": 66, "length": 254, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_relative": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_short": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "is_dependency": false, "lines": [ 3, @@ -114,9 +114,9 @@ } } ], - "description": "Redundant expression \"uint256 (tests/detectors/redundant-statements/redundant_statements.sol#6)\" inRedundantStatementsContract (tests/detectors/redundant-statements/redundant_statements.sol#3-18)\n", - "markdown": "Redundant expression \"[uint256](tests/detectors/redundant-statements/redundant_statements.sol#L6)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/redundant_statements.sol#L3-L18)\n", - "id": "cff54481eae76053f9cae0d4f77a2e5092461dc3fcb9e4e2f8605afb6aa832aa", + "description": "Redundant expression \"uint256 (tests/detectors/redundant-statements/0.4.25/redundant_statements.sol#6)\" inRedundantStatementsContract (tests/detectors/redundant-statements/0.4.25/redundant_statements.sol#3-18)\n", + "markdown": "Redundant expression \"[uint256](tests/detectors/redundant-statements/0.4.25/redundant_statements.sol#L6)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/0.4.25/redundant_statements.sol#L3-L18)\n", + "id": "5e6cc88b3d8b0ef5d6247751e3b9cf045557e07c6f0de8d9f1270db008fca82a", "check": "redundant-statements", "impact": "Informational", "confidence": "High" @@ -130,9 +130,9 @@ "start": 155, "length": 4, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_relative": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_short": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "is_dependency": false, "lines": [ 7 @@ -148,9 +148,9 @@ "start": 110, "length": 93, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_relative": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_short": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "is_dependency": false, "lines": [ 5, @@ -170,9 +170,9 @@ "start": 66, "length": 254, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_relative": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_short": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "is_dependency": false, "lines": [ 3, @@ -208,9 +208,9 @@ "start": 66, "length": 254, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_relative": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_short": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "is_dependency": false, "lines": [ 3, @@ -235,9 +235,9 @@ } } ], - "description": "Redundant expression \"bool (tests/detectors/redundant-statements/redundant_statements.sol#7)\" inRedundantStatementsContract (tests/detectors/redundant-statements/redundant_statements.sol#3-18)\n", - "markdown": "Redundant expression \"[bool](tests/detectors/redundant-statements/redundant_statements.sol#L7)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/redundant_statements.sol#L3-L18)\n", - "id": "bd643774adde96fa093cf2ec70d9a80fc2999dba8b61b60d0df19366003d74d5", + "description": "Redundant expression \"bool (tests/detectors/redundant-statements/0.4.25/redundant_statements.sol#7)\" inRedundantStatementsContract (tests/detectors/redundant-statements/0.4.25/redundant_statements.sol#3-18)\n", + "markdown": "Redundant expression \"[bool](tests/detectors/redundant-statements/0.4.25/redundant_statements.sol#L7)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/0.4.25/redundant_statements.sol#L3-L18)\n", + "id": "da776628bba71bca43caf77bb06a7055fe3c0f4f18a30274c5cb508bcb3a27b4", "check": "redundant-statements", "impact": "Informational", "confidence": "High" @@ -251,9 +251,9 @@ "start": 169, "length": 27, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_relative": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_short": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "is_dependency": false, "lines": [ 8 @@ -269,9 +269,9 @@ "start": 110, "length": 93, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_relative": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_short": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "is_dependency": false, "lines": [ 5, @@ -291,9 +291,9 @@ "start": 66, "length": 254, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_relative": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_short": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "is_dependency": false, "lines": [ 3, @@ -329,9 +329,9 @@ "start": 66, "length": 254, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_relative": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_short": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "is_dependency": false, "lines": [ 3, @@ -356,9 +356,9 @@ } } ], - "description": "Redundant expression \"RedundantStatementsContract (tests/detectors/redundant-statements/redundant_statements.sol#8)\" inRedundantStatementsContract (tests/detectors/redundant-statements/redundant_statements.sol#3-18)\n", - "markdown": "Redundant expression \"[RedundantStatementsContract](tests/detectors/redundant-statements/redundant_statements.sol#L8)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/redundant_statements.sol#L3-L18)\n", - "id": "d93991180e8fe3accc3157f286d3a6781ed5c03398d68c0b9fde918a01d65ede", + "description": "Redundant expression \"RedundantStatementsContract (tests/detectors/redundant-statements/0.4.25/redundant_statements.sol#8)\" inRedundantStatementsContract (tests/detectors/redundant-statements/0.4.25/redundant_statements.sol#3-18)\n", + "markdown": "Redundant expression \"[RedundantStatementsContract](tests/detectors/redundant-statements/0.4.25/redundant_statements.sol#L8)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/0.4.25/redundant_statements.sol#L3-L18)\n", + "id": "cb9ace5d0188d80bdc530d3760b41a1dcf1a4c10151b720e468550bb22be0e74", "check": "redundant-statements", "impact": "Informational", "confidence": "High" @@ -372,9 +372,9 @@ "start": 257, "length": 4, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_relative": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_short": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "is_dependency": false, "lines": [ 12 @@ -390,9 +390,9 @@ "start": 209, "length": 109, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_relative": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_short": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "is_dependency": false, "lines": [ 11, @@ -413,9 +413,9 @@ "start": 66, "length": 254, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_relative": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_short": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "is_dependency": false, "lines": [ 3, @@ -451,9 +451,9 @@ "start": 66, "length": 254, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_relative": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_short": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "is_dependency": false, "lines": [ 3, @@ -478,9 +478,9 @@ } } ], - "description": "Redundant expression \"uint256 (tests/detectors/redundant-statements/redundant_statements.sol#12)\" inRedundantStatementsContract (tests/detectors/redundant-statements/redundant_statements.sol#3-18)\n", - "markdown": "Redundant expression \"[uint256](tests/detectors/redundant-statements/redundant_statements.sol#L12)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/redundant_statements.sol#L3-L18)\n", - "id": "262267538723f822ebe065e5976738ef3f564c791aaddb26867d202602de1eea", + "description": "Redundant expression \"uint256 (tests/detectors/redundant-statements/0.4.25/redundant_statements.sol#12)\" inRedundantStatementsContract (tests/detectors/redundant-statements/0.4.25/redundant_statements.sol#3-18)\n", + "markdown": "Redundant expression \"[uint256](tests/detectors/redundant-statements/0.4.25/redundant_statements.sol#L12)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/0.4.25/redundant_statements.sol#L3-L18)\n", + "id": "7423f2beb0d066fc4e193c27dd50b172186e9539b778ab72bf950dbe872df720", "check": "redundant-statements", "impact": "Informational", "confidence": "High" @@ -494,9 +494,9 @@ "start": 271, "length": 6, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_relative": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_short": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "is_dependency": false, "lines": [ 13 @@ -512,9 +512,9 @@ "start": 209, "length": 109, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_relative": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_short": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "is_dependency": false, "lines": [ 11, @@ -535,9 +535,9 @@ "start": 66, "length": 254, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_relative": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_short": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "is_dependency": false, "lines": [ 3, @@ -573,9 +573,9 @@ "start": 66, "length": 254, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_relative": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_short": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "is_dependency": false, "lines": [ 3, @@ -600,9 +600,9 @@ } } ], - "description": "Redundant expression \"assert(bool) (tests/detectors/redundant-statements/redundant_statements.sol#13)\" inRedundantStatementsContract (tests/detectors/redundant-statements/redundant_statements.sol#3-18)\n", - "markdown": "Redundant expression \"[assert(bool)](tests/detectors/redundant-statements/redundant_statements.sol#L13)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/redundant_statements.sol#L3-L18)\n", - "id": "00295b0d55ceb6d73eec5a4905d137edf751e11c951252b54cd42c43ace68ffd", + "description": "Redundant expression \"assert(bool) (tests/detectors/redundant-statements/0.4.25/redundant_statements.sol#13)\" inRedundantStatementsContract (tests/detectors/redundant-statements/0.4.25/redundant_statements.sol#3-18)\n", + "markdown": "Redundant expression \"[assert(bool)](tests/detectors/redundant-statements/0.4.25/redundant_statements.sol#L13)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/0.4.25/redundant_statements.sol#L3-L18)\n", + "id": "e0137cf6a61eb49d07e1a67a7cdfd0cb82cac0402cded9f1cfb85ae1e6e8d3fe", "check": "redundant-statements", "impact": "Informational", "confidence": "High" @@ -616,9 +616,9 @@ "start": 287, "length": 4, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_relative": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_short": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "is_dependency": false, "lines": [ 14 @@ -634,9 +634,9 @@ "start": 209, "length": 109, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_relative": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_short": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "is_dependency": false, "lines": [ 11, @@ -657,9 +657,9 @@ "start": 66, "length": 254, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_relative": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_short": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "is_dependency": false, "lines": [ 3, @@ -695,9 +695,9 @@ "start": 66, "length": 254, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_relative": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/redundant-statements/redundant_statements.sol", + "filename_short": "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "is_dependency": false, "lines": [ 3, @@ -722,9 +722,9 @@ } } ], - "description": "Redundant expression \"test (tests/detectors/redundant-statements/redundant_statements.sol#14)\" inRedundantStatementsContract (tests/detectors/redundant-statements/redundant_statements.sol#3-18)\n", - "markdown": "Redundant expression \"[test](tests/detectors/redundant-statements/redundant_statements.sol#L14)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/redundant_statements.sol#L3-L18)\n", - "id": "ac50e063af6ebd33a702aa136415f7babc5fef3dc5212730b054d8a089b04e23", + "description": "Redundant expression \"test (tests/detectors/redundant-statements/0.4.25/redundant_statements.sol#14)\" inRedundantStatementsContract (tests/detectors/redundant-statements/0.4.25/redundant_statements.sol#3-18)\n", + "markdown": "Redundant expression \"[test](tests/detectors/redundant-statements/0.4.25/redundant_statements.sol#L14)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/0.4.25/redundant_statements.sol#L3-L18)\n", + "id": "c3c9961e4467e57974929ecfaeb34a0923fc257422a7705c9d1b14257cfe0c3a", "check": "redundant-statements", "impact": "Informational", "confidence": "High" diff --git a/tests/detectors/redundant-statements/0.5.16/redundant_statements.sol b/tests/detectors/redundant-statements/0.5.16/redundant_statements.sol new file mode 100644 index 0000000000..0ed927a9ff --- /dev/null +++ b/tests/detectors/redundant-statements/0.5.16/redundant_statements.sol @@ -0,0 +1,17 @@ +// This tests for redundant top-level expressions in statements. + +contract RedundantStatementsContract { + + constructor() public { + uint; + bool; + RedundantStatementsContract; + } + + function test() public returns (uint) { + uint; + assert; + test; + return 777; + } +} \ No newline at end of file diff --git a/tests/detectors/redundant-statements/0.5.16/redundant_statements.sol.0.5.16.RedundantStatements.json b/tests/detectors/redundant-statements/0.5.16/redundant_statements.sol.0.5.16.RedundantStatements.json new file mode 100644 index 0000000000..a687c5eca2 --- /dev/null +++ b/tests/detectors/redundant-statements/0.5.16/redundant_statements.sol.0.5.16.RedundantStatements.json @@ -0,0 +1,733 @@ +[ + [ + { + "elements": [ + { + "type": "node", + "name": "uint256", + "source_mapping": { + "start": 141, + "length": 4, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 6 + ], + "starting_column": 9, + "ending_column": 13 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "constructor", + "source_mapping": { + "start": 110, + "length": 93, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 5, + 6, + 7, + 8, + 9 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "constructor()" + } + } + } + }, + { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + } + ], + "description": "Redundant expression \"uint256 (tests/detectors/redundant-statements/0.5.16/redundant_statements.sol#6)\" inRedundantStatementsContract (tests/detectors/redundant-statements/0.5.16/redundant_statements.sol#3-18)\n", + "markdown": "Redundant expression \"[uint256](tests/detectors/redundant-statements/0.5.16/redundant_statements.sol#L6)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/0.5.16/redundant_statements.sol#L3-L18)\n", + "id": "58d73cb2126e8c76752e57c69feeed96ee7db0cc50cf33c0f92679525acc26e9", + "check": "redundant-statements", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "node", + "name": "bool", + "source_mapping": { + "start": 155, + "length": 4, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 7 + ], + "starting_column": 9, + "ending_column": 13 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "constructor", + "source_mapping": { + "start": 110, + "length": 93, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 5, + 6, + 7, + 8, + 9 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "constructor()" + } + } + } + }, + { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + } + ], + "description": "Redundant expression \"bool (tests/detectors/redundant-statements/0.5.16/redundant_statements.sol#7)\" inRedundantStatementsContract (tests/detectors/redundant-statements/0.5.16/redundant_statements.sol#3-18)\n", + "markdown": "Redundant expression \"[bool](tests/detectors/redundant-statements/0.5.16/redundant_statements.sol#L7)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/0.5.16/redundant_statements.sol#L3-L18)\n", + "id": "f57f949deb97e88dedd17864427a4941d1395be24db436d3a45945a45c53b919", + "check": "redundant-statements", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "node", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 169, + "length": 27, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 8 + ], + "starting_column": 9, + "ending_column": 36 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "constructor", + "source_mapping": { + "start": 110, + "length": 93, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 5, + 6, + 7, + 8, + 9 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "constructor()" + } + } + } + }, + { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + } + ], + "description": "Redundant expression \"RedundantStatementsContract (tests/detectors/redundant-statements/0.5.16/redundant_statements.sol#8)\" inRedundantStatementsContract (tests/detectors/redundant-statements/0.5.16/redundant_statements.sol#3-18)\n", + "markdown": "Redundant expression \"[RedundantStatementsContract](tests/detectors/redundant-statements/0.5.16/redundant_statements.sol#L8)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/0.5.16/redundant_statements.sol#L3-L18)\n", + "id": "faaa2cdb764d49e4d06709c566d903cc4b222634a27b31bbbb0217a13b84aa62", + "check": "redundant-statements", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "node", + "name": "uint256", + "source_mapping": { + "start": 257, + "length": 4, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 9, + "ending_column": 13 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "test", + "source_mapping": { + "start": 209, + "length": 109, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "test()" + } + } + } + }, + { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + } + ], + "description": "Redundant expression \"uint256 (tests/detectors/redundant-statements/0.5.16/redundant_statements.sol#12)\" inRedundantStatementsContract (tests/detectors/redundant-statements/0.5.16/redundant_statements.sol#3-18)\n", + "markdown": "Redundant expression \"[uint256](tests/detectors/redundant-statements/0.5.16/redundant_statements.sol#L12)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/0.5.16/redundant_statements.sol#L3-L18)\n", + "id": "f21c726ae13fb80091dca415c8d15bf8999c0197b56a65bcbabc4cb86963efe7", + "check": "redundant-statements", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "node", + "name": "assert(bool)", + "source_mapping": { + "start": 271, + "length": 6, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 13 + ], + "starting_column": 9, + "ending_column": 15 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "test", + "source_mapping": { + "start": 209, + "length": 109, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "test()" + } + } + } + }, + { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + } + ], + "description": "Redundant expression \"assert(bool) (tests/detectors/redundant-statements/0.5.16/redundant_statements.sol#13)\" inRedundantStatementsContract (tests/detectors/redundant-statements/0.5.16/redundant_statements.sol#3-18)\n", + "markdown": "Redundant expression \"[assert(bool)](tests/detectors/redundant-statements/0.5.16/redundant_statements.sol#L13)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/0.5.16/redundant_statements.sol#L3-L18)\n", + "id": "342d8ac4c8c6e96ca7ca18f4bb9abed731c08b4c19a4461151ea48fc503be342", + "check": "redundant-statements", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "node", + "name": "test", + "source_mapping": { + "start": 287, + "length": 4, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 14 + ], + "starting_column": 9, + "ending_column": 13 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "test", + "source_mapping": { + "start": 209, + "length": 109, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "test()" + } + } + } + }, + { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + } + ], + "description": "Redundant expression \"test (tests/detectors/redundant-statements/0.5.16/redundant_statements.sol#14)\" inRedundantStatementsContract (tests/detectors/redundant-statements/0.5.16/redundant_statements.sol#3-18)\n", + "markdown": "Redundant expression \"[test](tests/detectors/redundant-statements/0.5.16/redundant_statements.sol#L14)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/0.5.16/redundant_statements.sol#L3-L18)\n", + "id": "b36c497f678f32a5479ead924c310a0c86b398e465f69b0e7365f06befaef172", + "check": "redundant-statements", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/redundant-statements/0.6.11/redundant_statements.sol b/tests/detectors/redundant-statements/0.6.11/redundant_statements.sol new file mode 100644 index 0000000000..0ed927a9ff --- /dev/null +++ b/tests/detectors/redundant-statements/0.6.11/redundant_statements.sol @@ -0,0 +1,17 @@ +// This tests for redundant top-level expressions in statements. + +contract RedundantStatementsContract { + + constructor() public { + uint; + bool; + RedundantStatementsContract; + } + + function test() public returns (uint) { + uint; + assert; + test; + return 777; + } +} \ No newline at end of file diff --git a/tests/detectors/redundant-statements/0.6.11/redundant_statements.sol.0.6.11.RedundantStatements.json b/tests/detectors/redundant-statements/0.6.11/redundant_statements.sol.0.6.11.RedundantStatements.json new file mode 100644 index 0000000000..e69c3fbd9f --- /dev/null +++ b/tests/detectors/redundant-statements/0.6.11/redundant_statements.sol.0.6.11.RedundantStatements.json @@ -0,0 +1,733 @@ +[ + [ + { + "elements": [ + { + "type": "node", + "name": "uint256", + "source_mapping": { + "start": 141, + "length": 4, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 6 + ], + "starting_column": 9, + "ending_column": 13 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "constructor", + "source_mapping": { + "start": 110, + "length": 93, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 5, + 6, + 7, + 8, + 9 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "constructor()" + } + } + } + }, + { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + } + ], + "description": "Redundant expression \"uint256 (tests/detectors/redundant-statements/0.6.11/redundant_statements.sol#6)\" inRedundantStatementsContract (tests/detectors/redundant-statements/0.6.11/redundant_statements.sol#3-18)\n", + "markdown": "Redundant expression \"[uint256](tests/detectors/redundant-statements/0.6.11/redundant_statements.sol#L6)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/0.6.11/redundant_statements.sol#L3-L18)\n", + "id": "c58083eaf5653fc9616833c617157456ad9088c4638009d9cdfebdc1445671bd", + "check": "redundant-statements", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "node", + "name": "bool", + "source_mapping": { + "start": 155, + "length": 4, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 7 + ], + "starting_column": 9, + "ending_column": 13 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "constructor", + "source_mapping": { + "start": 110, + "length": 93, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 5, + 6, + 7, + 8, + 9 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "constructor()" + } + } + } + }, + { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + } + ], + "description": "Redundant expression \"bool (tests/detectors/redundant-statements/0.6.11/redundant_statements.sol#7)\" inRedundantStatementsContract (tests/detectors/redundant-statements/0.6.11/redundant_statements.sol#3-18)\n", + "markdown": "Redundant expression \"[bool](tests/detectors/redundant-statements/0.6.11/redundant_statements.sol#L7)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/0.6.11/redundant_statements.sol#L3-L18)\n", + "id": "f0fef441fabe415b9cbc63bfc5a2a5c69f6248ce22d1bd94f73979f928cb7dba", + "check": "redundant-statements", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "node", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 169, + "length": 27, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 8 + ], + "starting_column": 9, + "ending_column": 36 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "constructor", + "source_mapping": { + "start": 110, + "length": 93, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 5, + 6, + 7, + 8, + 9 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "constructor()" + } + } + } + }, + { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + } + ], + "description": "Redundant expression \"RedundantStatementsContract (tests/detectors/redundant-statements/0.6.11/redundant_statements.sol#8)\" inRedundantStatementsContract (tests/detectors/redundant-statements/0.6.11/redundant_statements.sol#3-18)\n", + "markdown": "Redundant expression \"[RedundantStatementsContract](tests/detectors/redundant-statements/0.6.11/redundant_statements.sol#L8)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/0.6.11/redundant_statements.sol#L3-L18)\n", + "id": "1ffcec7a83522ce311c8410e5523283b97944a0c27356e3141b26a7f32a022d3", + "check": "redundant-statements", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "node", + "name": "uint256", + "source_mapping": { + "start": 257, + "length": 4, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 9, + "ending_column": 13 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "test", + "source_mapping": { + "start": 209, + "length": 109, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "test()" + } + } + } + }, + { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + } + ], + "description": "Redundant expression \"uint256 (tests/detectors/redundant-statements/0.6.11/redundant_statements.sol#12)\" inRedundantStatementsContract (tests/detectors/redundant-statements/0.6.11/redundant_statements.sol#3-18)\n", + "markdown": "Redundant expression \"[uint256](tests/detectors/redundant-statements/0.6.11/redundant_statements.sol#L12)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/0.6.11/redundant_statements.sol#L3-L18)\n", + "id": "53f741bfdd4465fbdb8799391ca2fa50ac657b72ac9b822c87e2e4ae79d831d8", + "check": "redundant-statements", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "node", + "name": "assert(bool)", + "source_mapping": { + "start": 271, + "length": 6, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 13 + ], + "starting_column": 9, + "ending_column": 15 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "test", + "source_mapping": { + "start": 209, + "length": 109, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "test()" + } + } + } + }, + { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + } + ], + "description": "Redundant expression \"assert(bool) (tests/detectors/redundant-statements/0.6.11/redundant_statements.sol#13)\" inRedundantStatementsContract (tests/detectors/redundant-statements/0.6.11/redundant_statements.sol#3-18)\n", + "markdown": "Redundant expression \"[assert(bool)](tests/detectors/redundant-statements/0.6.11/redundant_statements.sol#L13)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/0.6.11/redundant_statements.sol#L3-L18)\n", + "id": "f902982db50d530e22b29f35ab1a740f1af29683b0ebb9edd53240721b4f95b9", + "check": "redundant-statements", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "node", + "name": "test", + "source_mapping": { + "start": 287, + "length": 4, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 14 + ], + "starting_column": 9, + "ending_column": 13 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "test", + "source_mapping": { + "start": 209, + "length": 109, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "test()" + } + } + } + }, + { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + } + ], + "description": "Redundant expression \"test (tests/detectors/redundant-statements/0.6.11/redundant_statements.sol#14)\" inRedundantStatementsContract (tests/detectors/redundant-statements/0.6.11/redundant_statements.sol#3-18)\n", + "markdown": "Redundant expression \"[test](tests/detectors/redundant-statements/0.6.11/redundant_statements.sol#L14)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/0.6.11/redundant_statements.sol#L3-L18)\n", + "id": "5223d6cc441a1f923616873898ea34e0ff11a758c38d6b5244b9e9ea6be9bec8", + "check": "redundant-statements", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/redundant-statements/0.7.6/redundant_statements.sol b/tests/detectors/redundant-statements/0.7.6/redundant_statements.sol new file mode 100644 index 0000000000..0ed927a9ff --- /dev/null +++ b/tests/detectors/redundant-statements/0.7.6/redundant_statements.sol @@ -0,0 +1,17 @@ +// This tests for redundant top-level expressions in statements. + +contract RedundantStatementsContract { + + constructor() public { + uint; + bool; + RedundantStatementsContract; + } + + function test() public returns (uint) { + uint; + assert; + test; + return 777; + } +} \ No newline at end of file diff --git a/tests/detectors/redundant-statements/0.7.6/redundant_statements.sol.0.7.6.RedundantStatements.json b/tests/detectors/redundant-statements/0.7.6/redundant_statements.sol.0.7.6.RedundantStatements.json new file mode 100644 index 0000000000..397a2ae4d0 --- /dev/null +++ b/tests/detectors/redundant-statements/0.7.6/redundant_statements.sol.0.7.6.RedundantStatements.json @@ -0,0 +1,733 @@ +[ + [ + { + "elements": [ + { + "type": "node", + "name": "uint256", + "source_mapping": { + "start": 141, + "length": 4, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 6 + ], + "starting_column": 9, + "ending_column": 13 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "constructor", + "source_mapping": { + "start": 110, + "length": 93, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 5, + 6, + 7, + 8, + 9 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "constructor()" + } + } + } + }, + { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + } + ], + "description": "Redundant expression \"uint256 (tests/detectors/redundant-statements/0.7.6/redundant_statements.sol#6)\" inRedundantStatementsContract (tests/detectors/redundant-statements/0.7.6/redundant_statements.sol#3-18)\n", + "markdown": "Redundant expression \"[uint256](tests/detectors/redundant-statements/0.7.6/redundant_statements.sol#L6)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/0.7.6/redundant_statements.sol#L3-L18)\n", + "id": "d16c698a23693dc64165fc886c68f6900a7a2699998f0f3713d875cf49a2af87", + "check": "redundant-statements", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "node", + "name": "bool", + "source_mapping": { + "start": 155, + "length": 4, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 7 + ], + "starting_column": 9, + "ending_column": 13 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "constructor", + "source_mapping": { + "start": 110, + "length": 93, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 5, + 6, + 7, + 8, + 9 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "constructor()" + } + } + } + }, + { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + } + ], + "description": "Redundant expression \"bool (tests/detectors/redundant-statements/0.7.6/redundant_statements.sol#7)\" inRedundantStatementsContract (tests/detectors/redundant-statements/0.7.6/redundant_statements.sol#3-18)\n", + "markdown": "Redundant expression \"[bool](tests/detectors/redundant-statements/0.7.6/redundant_statements.sol#L7)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/0.7.6/redundant_statements.sol#L3-L18)\n", + "id": "73207d71a134f0726a839874ee88cdf509766ac7e23c2bce3d0b86c121b2fd4c", + "check": "redundant-statements", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "node", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 169, + "length": 27, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 8 + ], + "starting_column": 9, + "ending_column": 36 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "constructor", + "source_mapping": { + "start": 110, + "length": 93, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 5, + 6, + 7, + 8, + 9 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "constructor()" + } + } + } + }, + { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + } + ], + "description": "Redundant expression \"RedundantStatementsContract (tests/detectors/redundant-statements/0.7.6/redundant_statements.sol#8)\" inRedundantStatementsContract (tests/detectors/redundant-statements/0.7.6/redundant_statements.sol#3-18)\n", + "markdown": "Redundant expression \"[RedundantStatementsContract](tests/detectors/redundant-statements/0.7.6/redundant_statements.sol#L8)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/0.7.6/redundant_statements.sol#L3-L18)\n", + "id": "caf262c2d237789c12de0cf27ef88625491b29a1bc3209ced3a12d2890fc799e", + "check": "redundant-statements", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "node", + "name": "uint256", + "source_mapping": { + "start": 257, + "length": 4, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 9, + "ending_column": 13 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "test", + "source_mapping": { + "start": 209, + "length": 109, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "test()" + } + } + } + }, + { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + } + ], + "description": "Redundant expression \"uint256 (tests/detectors/redundant-statements/0.7.6/redundant_statements.sol#12)\" inRedundantStatementsContract (tests/detectors/redundant-statements/0.7.6/redundant_statements.sol#3-18)\n", + "markdown": "Redundant expression \"[uint256](tests/detectors/redundant-statements/0.7.6/redundant_statements.sol#L12)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/0.7.6/redundant_statements.sol#L3-L18)\n", + "id": "ffe6709dbcfc3342d28833aad5375135da8cc7369bf0649ab1796ff4eae14ca1", + "check": "redundant-statements", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "node", + "name": "assert(bool)", + "source_mapping": { + "start": 271, + "length": 6, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 13 + ], + "starting_column": 9, + "ending_column": 15 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "test", + "source_mapping": { + "start": 209, + "length": 109, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "test()" + } + } + } + }, + { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + } + ], + "description": "Redundant expression \"assert(bool) (tests/detectors/redundant-statements/0.7.6/redundant_statements.sol#13)\" inRedundantStatementsContract (tests/detectors/redundant-statements/0.7.6/redundant_statements.sol#3-18)\n", + "markdown": "Redundant expression \"[assert(bool)](tests/detectors/redundant-statements/0.7.6/redundant_statements.sol#L13)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/0.7.6/redundant_statements.sol#L3-L18)\n", + "id": "774a4440b59af9fa94c7552ba0ce21a7835511012dc6257afc3fd4d80a023b28", + "check": "redundant-statements", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "node", + "name": "test", + "source_mapping": { + "start": 287, + "length": 4, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 14 + ], + "starting_column": 9, + "ending_column": 13 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "test", + "source_mapping": { + "start": 209, + "length": 109, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "test()" + } + } + } + }, + { + "type": "contract", + "name": "RedundantStatementsContract", + "source_mapping": { + "start": 66, + "length": 254, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 0 + } + } + ], + "description": "Redundant expression \"test (tests/detectors/redundant-statements/0.7.6/redundant_statements.sol#14)\" inRedundantStatementsContract (tests/detectors/redundant-statements/0.7.6/redundant_statements.sol#3-18)\n", + "markdown": "Redundant expression \"[test](tests/detectors/redundant-statements/0.7.6/redundant_statements.sol#L14)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/0.7.6/redundant_statements.sol#L3-L18)\n", + "id": "45bb5d6a69015db0e07e6d13107db089e1095da3cf0918f624db12181fac28a1", + "check": "redundant-statements", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/reentrancy-before-write/reentrancy-write.sol b/tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol similarity index 95% rename from tests/detectors/reentrancy-before-write/reentrancy-write.sol rename to tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol index 2f53565a78..49be754bb0 100644 --- a/tests/detectors/reentrancy-before-write/reentrancy-write.sol +++ b/tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol @@ -1,4 +1,4 @@ -pragma solidity 0.4.26; +// pragma solidity 0.4.26; contract ReentrancyWrite { bool notCalled = true; diff --git a/tests/detectors/reentrancy-before-write/reentrancy-write.sol.0.4.26.ReentrancyReadBeforeWritten.json b/tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol.0.4.25.ReentrancyReadBeforeWritten.json similarity index 85% rename from tests/detectors/reentrancy-before-write/reentrancy-write.sol.0.4.26.ReentrancyReadBeforeWritten.json rename to tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol.0.4.25.ReentrancyReadBeforeWritten.json index 7c944fc9eb..39c3d85095 100644 --- a/tests/detectors/reentrancy-before-write/reentrancy-write.sol.0.4.26.ReentrancyReadBeforeWritten.json +++ b/tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol.0.4.25.ReentrancyReadBeforeWritten.json @@ -6,12 +6,12 @@ "type": "function", "name": "bad0", "source_mapping": { - "start": 84, + "start": 87, "length": 153, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 6, @@ -30,12 +30,12 @@ "type": "contract", "name": "ReentrancyWrite", "source_mapping": { - "start": 25, + "start": 28, "length": 537, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -77,12 +77,12 @@ "type": "node", "name": "! (msg.sender.call())", "source_mapping": { - "start": 149, + "start": 152, "length": 20, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 8 @@ -95,12 +95,12 @@ "type": "function", "name": "bad0", "source_mapping": { - "start": 84, + "start": 87, "length": 153, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 6, @@ -119,12 +119,12 @@ "type": "contract", "name": "ReentrancyWrite", "source_mapping": { - "start": 25, + "start": 28, "length": 537, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -171,12 +171,12 @@ "type": "node", "name": "notCalled = false", "source_mapping": { - "start": 213, + "start": 216, "length": 17, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 11 @@ -189,12 +189,12 @@ "type": "function", "name": "bad0", "source_mapping": { - "start": 84, + "start": 87, "length": 153, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 6, @@ -213,12 +213,12 @@ "type": "contract", "name": "ReentrancyWrite", "source_mapping": { - "start": 25, + "start": 28, "length": 537, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -263,9 +263,9 @@ } } ], - "description": "Reentrancy in ReentrancyWrite.bad0() (tests/detectors/reentrancy-before-write/reentrancy-write.sol#6-12):\n\tExternal calls:\n\t- ! (msg.sender.call()) (tests/detectors/reentrancy-before-write/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- notCalled = false (tests/detectors/reentrancy-before-write/reentrancy-write.sol#11)\n", - "markdown": "Reentrancy in [ReentrancyWrite.bad0()](tests/detectors/reentrancy-before-write/reentrancy-write.sol#L6-L12):\n\tExternal calls:\n\t- [! (msg.sender.call())](tests/detectors/reentrancy-before-write/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [notCalled = false](tests/detectors/reentrancy-before-write/reentrancy-write.sol#L11)\n", - "id": "e078084eca02a4723da5dcb8a78af564de225e53ecc5cb8d98262c19296f7233", + "description": "Reentrancy in ReentrancyWrite.bad0() (tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#6-12):\n\tExternal calls:\n\t- ! (msg.sender.call()) (tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- notCalled = false (tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#11)\n", + "markdown": "Reentrancy in [ReentrancyWrite.bad0()](tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#L6-L12):\n\tExternal calls:\n\t- [! (msg.sender.call())](tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [notCalled = false](tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#L11)\n", + "id": "b6460b2a0b12df1225dcc8a10e0301fe4b474cccf05822d2a7c157470b689402", "check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium" @@ -276,12 +276,12 @@ "type": "function", "name": "bad1", "source_mapping": { - "start": 243, + "start": 246, "length": 158, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 14, @@ -299,12 +299,12 @@ "type": "contract", "name": "ReentrancyWrite", "source_mapping": { - "start": 25, + "start": 28, "length": 537, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -346,12 +346,12 @@ "type": "node", "name": "success = msg.sender.call()", "source_mapping": { - "start": 318, + "start": 321, "length": 34, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 16 @@ -364,12 +364,12 @@ "type": "function", "name": "bad1", "source_mapping": { - "start": 243, + "start": 246, "length": 158, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 14, @@ -387,12 +387,12 @@ "type": "contract", "name": "ReentrancyWrite", "source_mapping": { - "start": 25, + "start": 28, "length": 537, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -439,12 +439,12 @@ "type": "node", "name": "bad0()", "source_mapping": { - "start": 388, + "start": 391, "length": 6, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 18 @@ -457,12 +457,12 @@ "type": "function", "name": "bad1", "source_mapping": { - "start": 243, + "start": 246, "length": 158, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 14, @@ -480,12 +480,12 @@ "type": "contract", "name": "ReentrancyWrite", "source_mapping": { - "start": 25, + "start": 28, "length": 537, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -532,12 +532,12 @@ "type": "node", "name": "! (msg.sender.call())", "source_mapping": { - "start": 149, + "start": 152, "length": 20, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 8 @@ -550,12 +550,12 @@ "type": "function", "name": "bad0", "source_mapping": { - "start": 84, + "start": 87, "length": 153, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 6, @@ -574,12 +574,12 @@ "type": "contract", "name": "ReentrancyWrite", "source_mapping": { - "start": 25, + "start": 28, "length": 537, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -626,12 +626,12 @@ "type": "node", "name": "bad0()", "source_mapping": { - "start": 388, + "start": 391, "length": 6, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 18 @@ -644,12 +644,12 @@ "type": "function", "name": "bad1", "source_mapping": { - "start": 243, + "start": 246, "length": 158, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 14, @@ -667,12 +667,12 @@ "type": "contract", "name": "ReentrancyWrite", "source_mapping": { - "start": 25, + "start": 28, "length": 537, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -720,12 +720,12 @@ "type": "node", "name": "notCalled = false", "source_mapping": { - "start": 213, + "start": 216, "length": 17, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 11 @@ -738,12 +738,12 @@ "type": "function", "name": "bad0", "source_mapping": { - "start": 84, + "start": 87, "length": 153, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 6, @@ -762,12 +762,12 @@ "type": "contract", "name": "ReentrancyWrite", "source_mapping": { - "start": 25, + "start": 28, "length": 537, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -812,9 +812,9 @@ } } ], - "description": "Reentrancy in ReentrancyWrite.bad1(address) (tests/detectors/reentrancy-before-write/reentrancy-write.sol#14-19):\n\tExternal calls:\n\t- success = msg.sender.call() (tests/detectors/reentrancy-before-write/reentrancy-write.sol#16)\n\t- bad0() (tests/detectors/reentrancy-before-write/reentrancy-write.sol#18)\n\t\t- ! (msg.sender.call()) (tests/detectors/reentrancy-before-write/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- bad0() (tests/detectors/reentrancy-before-write/reentrancy-write.sol#18)\n\t\t- notCalled = false (tests/detectors/reentrancy-before-write/reentrancy-write.sol#11)\n", - "markdown": "Reentrancy in [ReentrancyWrite.bad1(address)](tests/detectors/reentrancy-before-write/reentrancy-write.sol#L14-L19):\n\tExternal calls:\n\t- [success = msg.sender.call()](tests/detectors/reentrancy-before-write/reentrancy-write.sol#L16)\n\t- [bad0()](tests/detectors/reentrancy-before-write/reentrancy-write.sol#L18)\n\t\t- [! (msg.sender.call())](tests/detectors/reentrancy-before-write/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [bad0()](tests/detectors/reentrancy-before-write/reentrancy-write.sol#L18)\n\t\t- [notCalled = false](tests/detectors/reentrancy-before-write/reentrancy-write.sol#L11)\n", - "id": "2ee9fea9a2fa34c6702dcb539c392ab810468f83a66fb21a2df33a1f3d4747cf", + "description": "Reentrancy in ReentrancyWrite.bad1(address) (tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#14-19):\n\tExternal calls:\n\t- success = msg.sender.call() (tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#16)\n\t- bad0() (tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#18)\n\t\t- ! (msg.sender.call()) (tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- bad0() (tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#18)\n\t\t- notCalled = false (tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#11)\n", + "markdown": "Reentrancy in [ReentrancyWrite.bad1(address)](tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#L14-L19):\n\tExternal calls:\n\t- [success = msg.sender.call()](tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#L16)\n\t- [bad0()](tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#L18)\n\t\t- [! (msg.sender.call())](tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [bad0()](tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#L18)\n\t\t- [notCalled = false](tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#L11)\n", + "id": "49aa9488337b9cce5fa0d5b961bae4d1fff7d79001371769dea3abbc4a1a059b", "check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium" diff --git a/tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol b/tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol new file mode 100644 index 0000000000..11d551b5ce --- /dev/null +++ b/tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol @@ -0,0 +1,31 @@ +// pragma solidity 0.4.26; + +contract ReentrancyWrite { + bool notCalled = true; + + function bad0() public { + require(notCalled); + (bool success,) = msg.sender.call(""); + if (!success) { + revert(); + } + notCalled = false; + } + + function bad1(address target) public { + require(notCalled); + (bool success,) = msg.sender.call(""); + require(success); + bad0(); + } + + function good() public { + require(notCalled); + notCalled = true; + (bool success,) = msg.sender.call(""); + if (!success) { + revert(); + } + } + +} diff --git a/tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol.0.5.16.ReentrancyReadBeforeWritten.json b/tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol.0.5.16.ReentrancyReadBeforeWritten.json new file mode 100644 index 0000000000..5f7696f983 --- /dev/null +++ b/tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol.0.5.16.ReentrancyReadBeforeWritten.json @@ -0,0 +1,846 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 87, + "length": 188, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyWrite", + "source_mapping": { + "start": 28, + "length": 610, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + }, + { + "type": "node", + "name": "(success) = msg.sender.call()", + "source_mapping": { + "start": 148, + "length": 37, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 8 + ], + "starting_column": 9, + "ending_column": 46 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 87, + "length": 188, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyWrite", + "source_mapping": { + "start": 28, + "length": 610, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "notCalled = false", + "source_mapping": { + "start": 251, + "length": 17, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 9, + "ending_column": 26 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 87, + "length": 188, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyWrite", + "source_mapping": { + "start": 28, + "length": 610, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "notCalled" + } + } + ], + "description": "Reentrancy in ReentrancyWrite.bad0() (tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#6-13):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- notCalled = false (tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#12)\n", + "markdown": "Reentrancy in [ReentrancyWrite.bad0()](tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#L6-L13):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [notCalled = false](tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#L12)\n", + "id": "2d6670618c55850a7db95d384607492b69a837ccae5c496cfcf716b5f492d95f", + "check": "reentrancy-no-eth", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 281, + "length": 161, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyWrite", + "source_mapping": { + "start": 28, + "length": 610, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(address)" + } + }, + { + "type": "node", + "name": "(success) = msg.sender.call()", + "source_mapping": { + "start": 356, + "length": 37, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 17 + ], + "starting_column": 9, + "ending_column": 46 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 281, + "length": 161, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyWrite", + "source_mapping": { + "start": 28, + "length": 610, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "bad0()", + "source_mapping": { + "start": 429, + "length": 6, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 19 + ], + "starting_column": 9, + "ending_column": 15 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 281, + "length": 161, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyWrite", + "source_mapping": { + "start": 28, + "length": 610, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "(success) = msg.sender.call()", + "source_mapping": { + "start": 148, + "length": 37, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 8 + ], + "starting_column": 9, + "ending_column": 46 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 87, + "length": 188, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyWrite", + "source_mapping": { + "start": 28, + "length": 610, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "bad0()", + "source_mapping": { + "start": 429, + "length": 6, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 19 + ], + "starting_column": 9, + "ending_column": 15 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 281, + "length": 161, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyWrite", + "source_mapping": { + "start": 28, + "length": 610, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "notCalled" + } + }, + { + "type": "node", + "name": "notCalled = false", + "source_mapping": { + "start": 251, + "length": 17, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 9, + "ending_column": 26 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 87, + "length": 188, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyWrite", + "source_mapping": { + "start": 28, + "length": 610, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "notCalled" + } + } + ], + "description": "Reentrancy in ReentrancyWrite.bad1(address) (tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#15-20):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#17)\n\t- bad0() (tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#19)\n\t\t- (success) = msg.sender.call() (tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- bad0() (tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#19)\n\t\t- notCalled = false (tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#12)\n", + "markdown": "Reentrancy in [ReentrancyWrite.bad1(address)](tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#L15-L20):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#L17)\n\t- [bad0()](tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#L19)\n\t\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [bad0()](tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#L19)\n\t\t- [notCalled = false](tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#L12)\n", + "id": "18e7eee4cf4c349dbaad3f54387eb6b3b174e868b94a3ebb991f7403b276b0d9", + "check": "reentrancy-no-eth", + "impact": "Medium", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol b/tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol new file mode 100644 index 0000000000..11d551b5ce --- /dev/null +++ b/tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol @@ -0,0 +1,31 @@ +// pragma solidity 0.4.26; + +contract ReentrancyWrite { + bool notCalled = true; + + function bad0() public { + require(notCalled); + (bool success,) = msg.sender.call(""); + if (!success) { + revert(); + } + notCalled = false; + } + + function bad1(address target) public { + require(notCalled); + (bool success,) = msg.sender.call(""); + require(success); + bad0(); + } + + function good() public { + require(notCalled); + notCalled = true; + (bool success,) = msg.sender.call(""); + if (!success) { + revert(); + } + } + +} diff --git a/tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol.0.6.11.ReentrancyReadBeforeWritten.json b/tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol.0.6.11.ReentrancyReadBeforeWritten.json new file mode 100644 index 0000000000..e7dcf3b7e9 --- /dev/null +++ b/tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol.0.6.11.ReentrancyReadBeforeWritten.json @@ -0,0 +1,846 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 87, + "length": 188, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyWrite", + "source_mapping": { + "start": 28, + "length": 610, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + }, + { + "type": "node", + "name": "(success) = msg.sender.call()", + "source_mapping": { + "start": 148, + "length": 37, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 8 + ], + "starting_column": 9, + "ending_column": 46 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 87, + "length": 188, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyWrite", + "source_mapping": { + "start": 28, + "length": 610, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "notCalled = false", + "source_mapping": { + "start": 251, + "length": 17, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 9, + "ending_column": 26 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 87, + "length": 188, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyWrite", + "source_mapping": { + "start": 28, + "length": 610, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "notCalled" + } + } + ], + "description": "Reentrancy in ReentrancyWrite.bad0() (tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#6-13):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- notCalled = false (tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#12)\n", + "markdown": "Reentrancy in [ReentrancyWrite.bad0()](tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#L6-L13):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [notCalled = false](tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#L12)\n", + "id": "0bfc3b0d021a94a74467bb46a134e5fbcefeed8f7351fc4de972d81737eb6964", + "check": "reentrancy-no-eth", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 281, + "length": 161, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyWrite", + "source_mapping": { + "start": 28, + "length": 610, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(address)" + } + }, + { + "type": "node", + "name": "(success) = msg.sender.call()", + "source_mapping": { + "start": 356, + "length": 37, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 17 + ], + "starting_column": 9, + "ending_column": 46 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 281, + "length": 161, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyWrite", + "source_mapping": { + "start": 28, + "length": 610, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "bad0()", + "source_mapping": { + "start": 429, + "length": 6, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 19 + ], + "starting_column": 9, + "ending_column": 15 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 281, + "length": 161, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyWrite", + "source_mapping": { + "start": 28, + "length": 610, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "(success) = msg.sender.call()", + "source_mapping": { + "start": 148, + "length": 37, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 8 + ], + "starting_column": 9, + "ending_column": 46 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 87, + "length": 188, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyWrite", + "source_mapping": { + "start": 28, + "length": 610, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "bad0()", + "source_mapping": { + "start": 429, + "length": 6, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 19 + ], + "starting_column": 9, + "ending_column": 15 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 281, + "length": 161, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyWrite", + "source_mapping": { + "start": 28, + "length": 610, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "notCalled" + } + }, + { + "type": "node", + "name": "notCalled = false", + "source_mapping": { + "start": 251, + "length": 17, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 9, + "ending_column": 26 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 87, + "length": 188, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyWrite", + "source_mapping": { + "start": 28, + "length": 610, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "notCalled" + } + } + ], + "description": "Reentrancy in ReentrancyWrite.bad1(address) (tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#15-20):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#17)\n\t- bad0() (tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#19)\n\t\t- (success) = msg.sender.call() (tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- bad0() (tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#19)\n\t\t- notCalled = false (tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#12)\n", + "markdown": "Reentrancy in [ReentrancyWrite.bad1(address)](tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#L15-L20):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#L17)\n\t- [bad0()](tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#L19)\n\t\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [bad0()](tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#L19)\n\t\t- [notCalled = false](tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#L12)\n", + "id": "273aa0b14294c7230099633c801857a2cb116cc8cc5f8c3c20ced1cf67cc1c31", + "check": "reentrancy-no-eth", + "impact": "Medium", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol b/tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol new file mode 100644 index 0000000000..11d551b5ce --- /dev/null +++ b/tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol @@ -0,0 +1,31 @@ +// pragma solidity 0.4.26; + +contract ReentrancyWrite { + bool notCalled = true; + + function bad0() public { + require(notCalled); + (bool success,) = msg.sender.call(""); + if (!success) { + revert(); + } + notCalled = false; + } + + function bad1(address target) public { + require(notCalled); + (bool success,) = msg.sender.call(""); + require(success); + bad0(); + } + + function good() public { + require(notCalled); + notCalled = true; + (bool success,) = msg.sender.call(""); + if (!success) { + revert(); + } + } + +} diff --git a/tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol.0.7.6.ReentrancyReadBeforeWritten.json b/tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol.0.7.6.ReentrancyReadBeforeWritten.json new file mode 100644 index 0000000000..eee4e183f3 --- /dev/null +++ b/tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol.0.7.6.ReentrancyReadBeforeWritten.json @@ -0,0 +1,846 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 87, + "length": 188, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyWrite", + "source_mapping": { + "start": 28, + "length": 610, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + }, + { + "type": "node", + "name": "(success) = msg.sender.call()", + "source_mapping": { + "start": 148, + "length": 37, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 8 + ], + "starting_column": 9, + "ending_column": 46 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 87, + "length": 188, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyWrite", + "source_mapping": { + "start": 28, + "length": 610, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "notCalled = false", + "source_mapping": { + "start": 251, + "length": 17, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 9, + "ending_column": 26 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 87, + "length": 188, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyWrite", + "source_mapping": { + "start": 28, + "length": 610, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "notCalled" + } + } + ], + "description": "Reentrancy in ReentrancyWrite.bad0() (tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#6-13):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- notCalled = false (tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#12)\n", + "markdown": "Reentrancy in [ReentrancyWrite.bad0()](tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#L6-L13):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [notCalled = false](tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#L12)\n", + "id": "f3e3f74c6502fba4ea12147b4301547c7b46172cb358f54c8a3d05f0fc127698", + "check": "reentrancy-no-eth", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 281, + "length": 161, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyWrite", + "source_mapping": { + "start": 28, + "length": 610, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(address)" + } + }, + { + "type": "node", + "name": "(success) = msg.sender.call()", + "source_mapping": { + "start": 356, + "length": 37, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 17 + ], + "starting_column": 9, + "ending_column": 46 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 281, + "length": 161, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyWrite", + "source_mapping": { + "start": 28, + "length": 610, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "bad0()", + "source_mapping": { + "start": 429, + "length": 6, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 19 + ], + "starting_column": 9, + "ending_column": 15 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 281, + "length": 161, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyWrite", + "source_mapping": { + "start": 28, + "length": 610, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "(success) = msg.sender.call()", + "source_mapping": { + "start": 148, + "length": 37, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 8 + ], + "starting_column": 9, + "ending_column": 46 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 87, + "length": 188, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyWrite", + "source_mapping": { + "start": 28, + "length": 610, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "bad0()", + "source_mapping": { + "start": 429, + "length": 6, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 19 + ], + "starting_column": 9, + "ending_column": 15 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 281, + "length": 161, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyWrite", + "source_mapping": { + "start": 28, + "length": 610, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1(address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "notCalled" + } + }, + { + "type": "node", + "name": "notCalled = false", + "source_mapping": { + "start": 251, + "length": 17, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 9, + "ending_column": 26 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 87, + "length": 188, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyWrite", + "source_mapping": { + "start": 28, + "length": 610, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "notCalled" + } + } + ], + "description": "Reentrancy in ReentrancyWrite.bad1(address) (tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#15-20):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#17)\n\t- bad0() (tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#19)\n\t\t- (success) = msg.sender.call() (tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- bad0() (tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#19)\n\t\t- notCalled = false (tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#12)\n", + "markdown": "Reentrancy in [ReentrancyWrite.bad1(address)](tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#L15-L20):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#L17)\n\t- [bad0()](tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#L19)\n\t\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [bad0()](tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#L19)\n\t\t- [notCalled = false](tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#L12)\n", + "id": "139c24158771526e3497a6bc730b32d173e3e67728f1833073694eb9df339b69", + "check": "reentrancy-no-eth", + "impact": "Medium", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/reentrancy-benign/reentrancy-benign.sol b/tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol similarity index 100% rename from tests/detectors/reentrancy-benign/reentrancy-benign.sol rename to tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol diff --git a/tests/detectors/reentrancy-benign/reentrancy-benign.sol.0.4.26.ReentrancyBenign.json b/tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol.0.4.25.ReentrancyBenign.json similarity index 92% rename from tests/detectors/reentrancy-benign/reentrancy-benign.sol.0.4.26.ReentrancyBenign.json rename to tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol.0.4.25.ReentrancyBenign.json index 46c1bb4f3a..3f72badb35 100644 --- a/tests/detectors/reentrancy-benign/reentrancy-benign.sol.0.4.26.ReentrancyBenign.json +++ b/tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol.0.4.25.ReentrancyBenign.json @@ -9,9 +9,9 @@ "start": 116, "length": 120, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 7, @@ -32,9 +32,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -112,9 +112,9 @@ "start": 153, "length": 20, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 8 @@ -130,9 +130,9 @@ "start": 116, "length": 120, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 7, @@ -153,9 +153,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -238,9 +238,9 @@ "start": 153, "length": 20, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 8 @@ -256,9 +256,9 @@ "start": 116, "length": 120, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 7, @@ -279,9 +279,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -364,9 +364,9 @@ "start": 217, "length": 12, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 11 @@ -382,9 +382,9 @@ "start": 116, "length": 120, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 7, @@ -405,9 +405,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -485,9 +485,9 @@ } } ], - "description": "Reentrancy in ReentrancyBenign.bad0() (tests/detectors/reentrancy-benign/reentrancy-benign.sol#7-12):\n\tExternal calls:\n\t- ! (msg.sender.call()) (tests/detectors/reentrancy-benign/reentrancy-benign.sol#8)\n\tState variables written after the call(s):\n\t- counter += 1 (tests/detectors/reentrancy-benign/reentrancy-benign.sol#11)\n", - "markdown": "Reentrancy in [ReentrancyBenign.bad0()](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L7-L12):\n\tExternal calls:\n\t- [! (msg.sender.call())](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L8)\n\tState variables written after the call(s):\n\t- [counter += 1](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L11)\n", - "id": "23f4fbdccaa9fd4c46c12759d22b8f19d92b6652303c84f8a9e59012a83cbf9c", + "description": "Reentrancy in ReentrancyBenign.bad0() (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#7-12):\n\tExternal calls:\n\t- ! (msg.sender.call()) (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#8)\n\tState variables written after the call(s):\n\t- counter += 1 (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#11)\n", + "markdown": "Reentrancy in [ReentrancyBenign.bad0()](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L7-L12):\n\tExternal calls:\n\t- [! (msg.sender.call())](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L8)\n\tState variables written after the call(s):\n\t- [counter += 1](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L11)\n", + "id": "63a6117be188fedd63d46e13119e967dc70adbd140f7ad2f9d3343e5139ccffb", "check": "reentrancy-benign", "impact": "Low", "confidence": "Medium" @@ -501,9 +501,9 @@ "start": 242, "length": 132, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 14, @@ -523,9 +523,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -603,9 +603,9 @@ "start": 289, "length": 30, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 15 @@ -621,9 +621,9 @@ "start": 242, "length": 132, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 14, @@ -643,9 +643,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -728,9 +728,9 @@ "start": 289, "length": 30, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 15 @@ -746,9 +746,9 @@ "start": 242, "length": 132, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 14, @@ -768,9 +768,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -853,9 +853,9 @@ "start": 355, "length": 12, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 17 @@ -871,9 +871,9 @@ "start": 242, "length": 132, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 14, @@ -893,9 +893,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -973,9 +973,9 @@ } } ], - "description": "Reentrancy in ReentrancyBenign.bad1(address) (tests/detectors/reentrancy-benign/reentrancy-benign.sol#14-18):\n\tExternal calls:\n\t- success = target.call() (tests/detectors/reentrancy-benign/reentrancy-benign.sol#15)\n\tState variables written after the call(s):\n\t- counter += 1 (tests/detectors/reentrancy-benign/reentrancy-benign.sol#17)\n", - "markdown": "Reentrancy in [ReentrancyBenign.bad1(address)](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L14-L18):\n\tExternal calls:\n\t- [success = target.call()](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L15)\n\tState variables written after the call(s):\n\t- [counter += 1](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L17)\n", - "id": "404eb3881e9d5765548d023eeacff9a2147786601b5d7eaa204c3838b7d665d9", + "description": "Reentrancy in ReentrancyBenign.bad1(address) (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#14-18):\n\tExternal calls:\n\t- success = target.call() (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#15)\n\tState variables written after the call(s):\n\t- counter += 1 (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#17)\n", + "markdown": "Reentrancy in [ReentrancyBenign.bad1(address)](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L14-L18):\n\tExternal calls:\n\t- [success = target.call()](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L15)\n\tState variables written after the call(s):\n\t- [counter += 1](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L17)\n", + "id": "8dc236b9193d1240d219303bae9f115b1c69ee45b7d5528a1915891463b62d15", "check": "reentrancy-benign", "impact": "Low", "confidence": "Medium" @@ -989,9 +989,9 @@ "start": 380, "length": 238, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 20, @@ -1016,9 +1016,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -1096,9 +1096,9 @@ "start": 427, "length": 30, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 21 @@ -1114,9 +1114,9 @@ "start": 380, "length": 238, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 20, @@ -1141,9 +1141,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -1226,9 +1226,9 @@ "start": 494, "length": 34, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 23 @@ -1244,9 +1244,9 @@ "start": 380, "length": 238, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 20, @@ -1271,9 +1271,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -1356,9 +1356,9 @@ "start": 427, "length": 30, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 21 @@ -1374,9 +1374,9 @@ "start": 380, "length": 238, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 20, @@ -1401,9 +1401,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -1486,9 +1486,9 @@ "start": 494, "length": 34, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 23 @@ -1504,9 +1504,9 @@ "start": 380, "length": 238, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 20, @@ -1531,9 +1531,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -1616,9 +1616,9 @@ "start": 542, "length": 12, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 24 @@ -1634,9 +1634,9 @@ "start": 380, "length": 238, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 20, @@ -1661,9 +1661,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -1741,9 +1741,9 @@ } } ], - "description": "Reentrancy in ReentrancyBenign.bad2(address) (tests/detectors/reentrancy-benign/reentrancy-benign.sol#20-29):\n\tExternal calls:\n\t- success = target.call() (tests/detectors/reentrancy-benign/reentrancy-benign.sol#21)\n\t- address(target).call.value(1000)() (tests/detectors/reentrancy-benign/reentrancy-benign.sol#23)\n\tExternal calls sending eth:\n\t- address(target).call.value(1000)() (tests/detectors/reentrancy-benign/reentrancy-benign.sol#23)\n\tState variables written after the call(s):\n\t- counter += 1 (tests/detectors/reentrancy-benign/reentrancy-benign.sol#24)\n", - "markdown": "Reentrancy in [ReentrancyBenign.bad2(address)](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L20-L29):\n\tExternal calls:\n\t- [success = target.call()](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L21)\n\t- [address(target).call.value(1000)()](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L23)\n\tExternal calls sending eth:\n\t- [address(target).call.value(1000)()](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L23)\n\tState variables written after the call(s):\n\t- [counter += 1](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L24)\n", - "id": "cf749257747679a6caaf9ae293360de238a17a22a13320f189e438e4e226276f", + "description": "Reentrancy in ReentrancyBenign.bad2(address) (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#20-29):\n\tExternal calls:\n\t- success = target.call() (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#21)\n\t- address(target).call.value(1000)() (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#23)\n\tExternal calls sending eth:\n\t- address(target).call.value(1000)() (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#23)\n\tState variables written after the call(s):\n\t- counter += 1 (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#24)\n", + "markdown": "Reentrancy in [ReentrancyBenign.bad2(address)](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L20-L29):\n\tExternal calls:\n\t- [success = target.call()](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L21)\n\t- [address(target).call.value(1000)()](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L23)\n\tExternal calls sending eth:\n\t- [address(target).call.value(1000)()](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L23)\n\tState variables written after the call(s):\n\t- [counter += 1](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L24)\n", + "id": "d0cd48646930b460d018a96dca75d8781c9707be1d4a451d83f1fec56f560c43", "check": "reentrancy-benign", "impact": "Low", "confidence": "Medium" @@ -1757,9 +1757,9 @@ "start": 624, "length": 125, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 31, @@ -1779,9 +1779,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -1859,9 +1859,9 @@ "start": 671, "length": 22, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 32 @@ -1877,9 +1877,9 @@ "start": 624, "length": 125, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 31, @@ -1899,9 +1899,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -1984,9 +1984,9 @@ "start": 1123, "length": 22, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 51 @@ -2002,9 +2002,9 @@ "start": 1065, "length": 87, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 50, @@ -2022,9 +2022,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -2107,9 +2107,9 @@ "start": 671, "length": 22, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 32 @@ -2125,9 +2125,9 @@ "start": 624, "length": 125, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 31, @@ -2147,9 +2147,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -2232,9 +2232,9 @@ "start": 1123, "length": 22, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 51 @@ -2250,9 +2250,9 @@ "start": 1065, "length": 87, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 50, @@ -2270,9 +2270,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -2355,9 +2355,9 @@ "start": 703, "length": 12, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 33 @@ -2373,9 +2373,9 @@ "start": 624, "length": 125, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 31, @@ -2395,9 +2395,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -2481,9 +2481,9 @@ "start": 1295, "length": 25, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 59 @@ -2499,9 +2499,9 @@ "start": 1255, "length": 72, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 58, @@ -2519,9 +2519,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -2599,9 +2599,9 @@ } } ], - "description": "Reentrancy in ReentrancyBenign.bad3(address) (tests/detectors/reentrancy-benign/reentrancy-benign.sol#31-35):\n\tExternal calls:\n\t- externalCaller(target) (tests/detectors/reentrancy-benign/reentrancy-benign.sol#32)\n\t\t- address(target).call() (tests/detectors/reentrancy-benign/reentrancy-benign.sol#51)\n\tState variables written after the call(s):\n\t- varChanger() (tests/detectors/reentrancy-benign/reentrancy-benign.sol#33)\n\t\t- anotherVariableToChange ++ (tests/detectors/reentrancy-benign/reentrancy-benign.sol#59)\n", - "markdown": "Reentrancy in [ReentrancyBenign.bad3(address)](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L31-L35):\n\tExternal calls:\n\t- [externalCaller(target)](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L32)\n\t\t- [address(target).call()](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L51)\n\tState variables written after the call(s):\n\t- [varChanger()](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L33)\n\t\t- [anotherVariableToChange ++](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L59)\n", - "id": "5419993a97881c5ada3458672ea5955e9eefae288ac2d4fd84854499ff1569b5", + "description": "Reentrancy in ReentrancyBenign.bad3(address) (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#31-35):\n\tExternal calls:\n\t- externalCaller(target) (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#32)\n\t\t- address(target).call() (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#51)\n\tState variables written after the call(s):\n\t- varChanger() (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#33)\n\t\t- anotherVariableToChange ++ (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#59)\n", + "markdown": "Reentrancy in [ReentrancyBenign.bad3(address)](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L31-L35):\n\tExternal calls:\n\t- [externalCaller(target)](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L32)\n\t\t- [address(target).call()](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L51)\n\tState variables written after the call(s):\n\t- [varChanger()](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L33)\n\t\t- [anotherVariableToChange ++](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L59)\n", + "id": "b5e5f8e97fa06883b3ba5da0b071d115f3181ded338efbbd6dbadaef4033ca17", "check": "reentrancy-benign", "impact": "Low", "confidence": "Medium" @@ -2615,9 +2615,9 @@ "start": 755, "length": 170, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 37, @@ -2638,9 +2638,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -2718,9 +2718,9 @@ "start": 802, "length": 22, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 38 @@ -2736,9 +2736,9 @@ "start": 755, "length": 170, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 37, @@ -2759,9 +2759,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -2844,9 +2844,9 @@ "start": 1123, "length": 22, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 51 @@ -2862,9 +2862,9 @@ "start": 1065, "length": 87, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 50, @@ -2882,9 +2882,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -2967,9 +2967,9 @@ "start": 834, "length": 21, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 39 @@ -2985,9 +2985,9 @@ "start": 755, "length": 170, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 37, @@ -3008,9 +3008,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -3093,9 +3093,9 @@ "start": 1211, "length": 31, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 55 @@ -3111,9 +3111,9 @@ "start": 1158, "length": 91, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 54, @@ -3131,9 +3131,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -3216,9 +3216,9 @@ "start": 802, "length": 22, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 38 @@ -3234,9 +3234,9 @@ "start": 755, "length": 170, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 37, @@ -3257,9 +3257,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -3342,9 +3342,9 @@ "start": 1123, "length": 22, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 51 @@ -3360,9 +3360,9 @@ "start": 1065, "length": 87, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 50, @@ -3380,9 +3380,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -3465,9 +3465,9 @@ "start": 834, "length": 21, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 39 @@ -3483,9 +3483,9 @@ "start": 755, "length": 170, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 37, @@ -3506,9 +3506,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -3591,9 +3591,9 @@ "start": 1211, "length": 31, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 55 @@ -3609,9 +3609,9 @@ "start": 1158, "length": 91, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 54, @@ -3629,9 +3629,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -3714,9 +3714,9 @@ "start": 865, "length": 12, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 40 @@ -3732,9 +3732,9 @@ "start": 755, "length": 170, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 37, @@ -3755,9 +3755,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -3841,9 +3841,9 @@ "start": 1295, "length": 25, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 59 @@ -3859,9 +3859,9 @@ "start": 1255, "length": 72, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 58, @@ -3879,9 +3879,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -3959,9 +3959,9 @@ } } ], - "description": "Reentrancy in ReentrancyBenign.bad4(address) (tests/detectors/reentrancy-benign/reentrancy-benign.sol#37-42):\n\tExternal calls:\n\t- externalCaller(target) (tests/detectors/reentrancy-benign/reentrancy-benign.sol#38)\n\t\t- address(target).call() (tests/detectors/reentrancy-benign/reentrancy-benign.sol#51)\n\t- ethSender(address(0)) (tests/detectors/reentrancy-benign/reentrancy-benign.sol#39)\n\t\t- address(target).call.value(1)() (tests/detectors/reentrancy-benign/reentrancy-benign.sol#55)\n\tExternal calls sending eth:\n\t- ethSender(address(0)) (tests/detectors/reentrancy-benign/reentrancy-benign.sol#39)\n\t\t- address(target).call.value(1)() (tests/detectors/reentrancy-benign/reentrancy-benign.sol#55)\n\tState variables written after the call(s):\n\t- varChanger() (tests/detectors/reentrancy-benign/reentrancy-benign.sol#40)\n\t\t- anotherVariableToChange ++ (tests/detectors/reentrancy-benign/reentrancy-benign.sol#59)\n", - "markdown": "Reentrancy in [ReentrancyBenign.bad4(address)](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L37-L42):\n\tExternal calls:\n\t- [externalCaller(target)](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L38)\n\t\t- [address(target).call()](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L51)\n\t- [ethSender(address(0))](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L39)\n\t\t- [address(target).call.value(1)()](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L55)\n\tExternal calls sending eth:\n\t- [ethSender(address(0))](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L39)\n\t\t- [address(target).call.value(1)()](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L55)\n\tState variables written after the call(s):\n\t- [varChanger()](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L40)\n\t\t- [anotherVariableToChange ++](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L59)\n", - "id": "fa81e2a2e03ed4653b8e905384a02bfa7fedc6f9dbbcfed919c9c7e7d39958eb", + "description": "Reentrancy in ReentrancyBenign.bad4(address) (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#37-42):\n\tExternal calls:\n\t- externalCaller(target) (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#38)\n\t\t- address(target).call() (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#51)\n\t- ethSender(address(0)) (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#39)\n\t\t- address(target).call.value(1)() (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#55)\n\tExternal calls sending eth:\n\t- ethSender(address(0)) (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#39)\n\t\t- address(target).call.value(1)() (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#55)\n\tState variables written after the call(s):\n\t- varChanger() (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#40)\n\t\t- anotherVariableToChange ++ (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#59)\n", + "markdown": "Reentrancy in [ReentrancyBenign.bad4(address)](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L37-L42):\n\tExternal calls:\n\t- [externalCaller(target)](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L38)\n\t\t- [address(target).call()](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L51)\n\t- [ethSender(address(0))](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L39)\n\t\t- [address(target).call.value(1)()](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L55)\n\tExternal calls sending eth:\n\t- [ethSender(address(0))](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L39)\n\t\t- [address(target).call.value(1)()](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L55)\n\tState variables written after the call(s):\n\t- [varChanger()](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L40)\n\t\t- [anotherVariableToChange ++](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L59)\n", + "id": "f8ae59addfdbac8f20e5440f9a184916be6ddefc82424d7c3f29a226c4f2795f", "check": "reentrancy-benign", "impact": "Low", "confidence": "Medium" @@ -3975,9 +3975,9 @@ "start": 931, "length": 128, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 44, @@ -3997,9 +3997,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -4077,9 +4077,9 @@ "start": 978, "length": 21, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 45 @@ -4095,9 +4095,9 @@ "start": 931, "length": 128, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 44, @@ -4117,9 +4117,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -4202,9 +4202,9 @@ "start": 1211, "length": 31, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 55 @@ -4220,9 +4220,9 @@ "start": 1158, "length": 91, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 54, @@ -4240,9 +4240,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -4325,9 +4325,9 @@ "start": 1009, "length": 12, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 46 @@ -4343,9 +4343,9 @@ "start": 931, "length": 128, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 44, @@ -4365,9 +4365,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -4451,9 +4451,9 @@ "start": 1295, "length": 25, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 59 @@ -4469,9 +4469,9 @@ "start": 1255, "length": 72, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 58, @@ -4489,9 +4489,9 @@ "start": 25, "length": 1304, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_relative": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-benign/reentrancy-benign.sol", + "filename_short": "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", "is_dependency": false, "lines": [ 3, @@ -4569,9 +4569,9 @@ } } ], - "description": "Reentrancy in ReentrancyBenign.bad5(address) (tests/detectors/reentrancy-benign/reentrancy-benign.sol#44-48):\n\tExternal calls:\n\t- ethSender(address(0)) (tests/detectors/reentrancy-benign/reentrancy-benign.sol#45)\n\t\t- address(target).call.value(1)() (tests/detectors/reentrancy-benign/reentrancy-benign.sol#55)\n\tState variables written after the call(s):\n\t- varChanger() (tests/detectors/reentrancy-benign/reentrancy-benign.sol#46)\n\t\t- anotherVariableToChange ++ (tests/detectors/reentrancy-benign/reentrancy-benign.sol#59)\n", - "markdown": "Reentrancy in [ReentrancyBenign.bad5(address)](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L44-L48):\n\tExternal calls:\n\t- [ethSender(address(0))](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L45)\n\t\t- [address(target).call.value(1)()](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L55)\n\tState variables written after the call(s):\n\t- [varChanger()](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L46)\n\t\t- [anotherVariableToChange ++](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L59)\n", - "id": "ef84aa3ab4543f3983d06b6aa80c190924de70eb4e679a9a4330efa67f406ae6", + "description": "Reentrancy in ReentrancyBenign.bad5(address) (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#44-48):\n\tExternal calls:\n\t- ethSender(address(0)) (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#45)\n\t\t- address(target).call.value(1)() (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#55)\n\tState variables written after the call(s):\n\t- varChanger() (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#46)\n\t\t- anotherVariableToChange ++ (tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#59)\n", + "markdown": "Reentrancy in [ReentrancyBenign.bad5(address)](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L44-L48):\n\tExternal calls:\n\t- [ethSender(address(0))](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L45)\n\t\t- [address(target).call.value(1)()](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L55)\n\tState variables written after the call(s):\n\t- [varChanger()](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L46)\n\t\t- [anotherVariableToChange ++](tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol#L59)\n", + "id": "944f4ca691fcae3a55ccd543406d1eb8e969ab1b5d716cc975d4656f998f08f9", "check": "reentrancy-benign", "impact": "Low", "confidence": "Medium" diff --git a/tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol b/tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol new file mode 100644 index 0000000000..c1b08e29af --- /dev/null +++ b/tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol @@ -0,0 +1,62 @@ +// pragma solidity ^0.4.0; + +contract ReentrancyBenign { + uint8 anotherVariableToChange; + uint8 counter = 0; + + function bad0() public { + (bool success,) = msg.sender.call(""); + if (!success) { + revert(); + } + counter += 1; + } + + function bad1(address target) public { + (bool success,) = target.call(""); + require(success); + counter += 1; + } + + function bad2(address target) public { + (bool success,) = target.call(""); + if (success) { + address(target).call.value(1000)(""); + counter += 1; + } + else { + revert(); + } + } + + function bad3(address target) public { + externalCaller(target); + varChanger(); + ethSender(target); + } + + function bad4(address target) public { + externalCaller(target); + ethSender(address(0)); + varChanger(); + address(target).call.value(2)(""); + } + + function bad5(address target) public { + ethSender(address(0)); + varChanger(); + ethSender(address(0)); + } + + function externalCaller(address target) private { + address(target).call(""); + } + + function ethSender(address target) private { + address(target).call.value(1)(""); + } + + function varChanger() private { + anotherVariableToChange++; + } +} \ No newline at end of file diff --git a/tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol.0.5.16.ReentrancyBenign.json b/tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol.0.5.16.ReentrancyBenign.json new file mode 100644 index 0000000000..b2921913eb --- /dev/null +++ b/tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol.0.5.16.ReentrancyBenign.json @@ -0,0 +1,4621 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 119, + "length": 155, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad0()" + } + }, + { + "type": "node", + "name": "(success) = msg.sender.call()", + "source_mapping": { + "start": 152, + "length": 37, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 8 + ], + "starting_column": 9, + "ending_column": 46 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 119, + "length": 155, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad0()" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "(success) = msg.sender.call()", + "source_mapping": { + "start": 152, + "length": 37, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 8 + ], + "starting_column": 9, + "ending_column": 46 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 119, + "length": 155, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad0()" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "counter += 1", + "source_mapping": { + "start": 255, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 9, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 119, + "length": 155, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad0()" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "counter" + } + } + ], + "description": "Reentrancy in ReentrancyBenign.bad0() (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#7-13):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#8)\n\tState variables written after the call(s):\n\t- counter += 1 (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#12)\n", + "markdown": "Reentrancy in [ReentrancyBenign.bad0()](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L7-L13):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L8)\n\tState variables written after the call(s):\n\t- [counter += 1](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L12)\n", + "id": "06215fa32247bcf7f91d727b63e2ab6b76b307c4521206d7afe6eaa591bc3183", + "check": "reentrancy-benign", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 280, + "length": 135, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad1(address)" + } + }, + { + "type": "node", + "name": "(success) = target.call()", + "source_mapping": { + "start": 327, + "length": 33, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 16 + ], + "starting_column": 9, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 280, + "length": 135, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad1(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "(success) = target.call()", + "source_mapping": { + "start": 327, + "length": 33, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 16 + ], + "starting_column": 9, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 280, + "length": 135, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad1(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "counter += 1", + "source_mapping": { + "start": 396, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 18 + ], + "starting_column": 9, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 280, + "length": 135, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad1(address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "counter" + } + } + ], + "description": "Reentrancy in ReentrancyBenign.bad1(address) (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#15-19):\n\tExternal calls:\n\t- (success) = target.call() (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#16)\n\tState variables written after the call(s):\n\t- counter += 1 (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#18)\n", + "markdown": "Reentrancy in [ReentrancyBenign.bad1(address)](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L15-L19):\n\tExternal calls:\n\t- [(success) = target.call()](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L16)\n\tState variables written after the call(s):\n\t- [counter += 1](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L18)\n", + "id": "ae6f8d6b98538fe324c8bbbcb19a0729901bc42fc166a1b1f0927b0f3f0d185f", + "check": "reentrancy-benign", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 421, + "length": 243, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad2(address)" + } + }, + { + "type": "node", + "name": "(success) = target.call()", + "source_mapping": { + "start": 468, + "length": 33, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 22 + ], + "starting_column": 9, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 421, + "length": 243, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad2(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "address(target).call.value(1000)()", + "source_mapping": { + "start": 538, + "length": 36, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 24 + ], + "starting_column": 13, + "ending_column": 49 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 421, + "length": 243, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad2(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "(success) = target.call()", + "source_mapping": { + "start": 468, + "length": 33, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 22 + ], + "starting_column": 9, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 421, + "length": 243, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad2(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "address(target).call.value(1000)()", + "source_mapping": { + "start": 538, + "length": 36, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 24 + ], + "starting_column": 13, + "ending_column": 49 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 421, + "length": 243, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad2(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "counter += 1", + "source_mapping": { + "start": 588, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 13, + "ending_column": 25 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 421, + "length": 243, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad2(address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "counter" + } + } + ], + "description": "Reentrancy in ReentrancyBenign.bad2(address) (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#21-30):\n\tExternal calls:\n\t- (success) = target.call() (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#22)\n\t- address(target).call.value(1000)() (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#24)\n\tExternal calls sending eth:\n\t- address(target).call.value(1000)() (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#24)\n\tState variables written after the call(s):\n\t- counter += 1 (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#25)\n", + "markdown": "Reentrancy in [ReentrancyBenign.bad2(address)](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L21-L30):\n\tExternal calls:\n\t- [(success) = target.call()](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L22)\n\t- [address(target).call.value(1000)()](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L24)\n\tExternal calls sending eth:\n\t- [address(target).call.value(1000)()](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L24)\n\tState variables written after the call(s):\n\t- [counter += 1](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L25)\n", + "id": "a479507a21775d1c9b2a90e6f8d5698b6cb4a4e54454dd67571ff5850f71486a", + "check": "reentrancy-benign", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad3", + "source_mapping": { + "start": 670, + "length": 125, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 32, + 33, + 34, + 35, + 36 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad3(address)" + } + }, + { + "type": "node", + "name": "externalCaller(target)", + "source_mapping": { + "start": 717, + "length": 22, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 33 + ], + "starting_column": 9, + "ending_column": 31 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad3", + "source_mapping": { + "start": 670, + "length": 125, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 32, + 33, + 34, + 35, + 36 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad3(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "address(target).call()", + "source_mapping": { + "start": 1171, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 52 + ], + "starting_column": 9, + "ending_column": 33 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "externalCaller", + "source_mapping": { + "start": 1113, + "length": 89, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 51, + 52, + 53 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "externalCaller(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "externalCaller(target)", + "source_mapping": { + "start": 717, + "length": 22, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 33 + ], + "starting_column": 9, + "ending_column": 31 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad3", + "source_mapping": { + "start": 670, + "length": 125, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 32, + 33, + 34, + 35, + 36 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad3(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "address(target).call()", + "source_mapping": { + "start": 1171, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 52 + ], + "starting_column": 9, + "ending_column": 33 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "externalCaller", + "source_mapping": { + "start": 1113, + "length": 89, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 51, + 52, + 53 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "externalCaller(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "varChanger()", + "source_mapping": { + "start": 749, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 34 + ], + "starting_column": 9, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad3", + "source_mapping": { + "start": 670, + "length": 125, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 32, + 33, + 34, + 35, + 36 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad3(address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "anotherVariableToChange" + } + }, + { + "type": "node", + "name": "anotherVariableToChange ++", + "source_mapping": { + "start": 1347, + "length": 25, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 60 + ], + "starting_column": 9, + "ending_column": 34 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "varChanger", + "source_mapping": { + "start": 1307, + "length": 72, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 59, + 60, + 61 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "varChanger()" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "anotherVariableToChange" + } + } + ], + "description": "Reentrancy in ReentrancyBenign.bad3(address) (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#32-36):\n\tExternal calls:\n\t- externalCaller(target) (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#33)\n\t\t- address(target).call() (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#52)\n\tState variables written after the call(s):\n\t- varChanger() (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#34)\n\t\t- anotherVariableToChange ++ (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#60)\n", + "markdown": "Reentrancy in [ReentrancyBenign.bad3(address)](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L32-L36):\n\tExternal calls:\n\t- [externalCaller(target)](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L33)\n\t\t- [address(target).call()](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L52)\n\tState variables written after the call(s):\n\t- [varChanger()](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L34)\n\t\t- [anotherVariableToChange ++](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L60)\n", + "id": "a8f0c602502e3d97630ba10da72929525b99d36c0bfedbb813fb4d39aa736638", + "check": "reentrancy-benign", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad4", + "source_mapping": { + "start": 801, + "length": 172, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 38, + 39, + 40, + 41, + 42, + 43 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad4(address)" + } + }, + { + "type": "node", + "name": "externalCaller(target)", + "source_mapping": { + "start": 848, + "length": 22, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 39 + ], + "starting_column": 9, + "ending_column": 31 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad4", + "source_mapping": { + "start": 801, + "length": 172, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 38, + 39, + 40, + 41, + 42, + 43 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad4(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "address(target).call()", + "source_mapping": { + "start": 1171, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 52 + ], + "starting_column": 9, + "ending_column": 33 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "externalCaller", + "source_mapping": { + "start": 1113, + "length": 89, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 51, + 52, + 53 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "externalCaller(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "ethSender(address(0))", + "source_mapping": { + "start": 880, + "length": 21, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 40 + ], + "starting_column": 9, + "ending_column": 30 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad4", + "source_mapping": { + "start": 801, + "length": 172, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 38, + 39, + 40, + 41, + 42, + 43 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad4(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "address(target).call.value(1)()", + "source_mapping": { + "start": 1261, + "length": 33, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 56 + ], + "starting_column": 9, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "ethSender", + "source_mapping": { + "start": 1208, + "length": 93, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 55, + 56, + 57 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "ethSender(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "externalCaller(target)", + "source_mapping": { + "start": 848, + "length": 22, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 39 + ], + "starting_column": 9, + "ending_column": 31 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad4", + "source_mapping": { + "start": 801, + "length": 172, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 38, + 39, + 40, + 41, + 42, + 43 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad4(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "address(target).call()", + "source_mapping": { + "start": 1171, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 52 + ], + "starting_column": 9, + "ending_column": 33 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "externalCaller", + "source_mapping": { + "start": 1113, + "length": 89, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 51, + 52, + 53 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "externalCaller(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "ethSender(address(0))", + "source_mapping": { + "start": 880, + "length": 21, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 40 + ], + "starting_column": 9, + "ending_column": 30 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad4", + "source_mapping": { + "start": 801, + "length": 172, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 38, + 39, + 40, + 41, + 42, + 43 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad4(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "address(target).call.value(1)()", + "source_mapping": { + "start": 1261, + "length": 33, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 56 + ], + "starting_column": 9, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "ethSender", + "source_mapping": { + "start": 1208, + "length": 93, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 55, + 56, + 57 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "ethSender(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "varChanger()", + "source_mapping": { + "start": 911, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 41 + ], + "starting_column": 9, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad4", + "source_mapping": { + "start": 801, + "length": 172, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 38, + 39, + 40, + 41, + 42, + 43 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad4(address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "anotherVariableToChange" + } + }, + { + "type": "node", + "name": "anotherVariableToChange ++", + "source_mapping": { + "start": 1347, + "length": 25, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 60 + ], + "starting_column": 9, + "ending_column": 34 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "varChanger", + "source_mapping": { + "start": 1307, + "length": 72, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 59, + 60, + 61 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "varChanger()" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "anotherVariableToChange" + } + } + ], + "description": "Reentrancy in ReentrancyBenign.bad4(address) (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#38-43):\n\tExternal calls:\n\t- externalCaller(target) (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#39)\n\t\t- address(target).call() (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#52)\n\t- ethSender(address(0)) (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#40)\n\t\t- address(target).call.value(1)() (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#56)\n\tExternal calls sending eth:\n\t- ethSender(address(0)) (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#40)\n\t\t- address(target).call.value(1)() (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#56)\n\tState variables written after the call(s):\n\t- varChanger() (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#41)\n\t\t- anotherVariableToChange ++ (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#60)\n", + "markdown": "Reentrancy in [ReentrancyBenign.bad4(address)](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L38-L43):\n\tExternal calls:\n\t- [externalCaller(target)](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L39)\n\t\t- [address(target).call()](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L52)\n\t- [ethSender(address(0))](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L40)\n\t\t- [address(target).call.value(1)()](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L56)\n\tExternal calls sending eth:\n\t- [ethSender(address(0))](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L40)\n\t\t- [address(target).call.value(1)()](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L56)\n\tState variables written after the call(s):\n\t- [varChanger()](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L41)\n\t\t- [anotherVariableToChange ++](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L60)\n", + "id": "ed01a6eca7c4b485a34d6d66adb1e0d47e622663622a208c823c920e6d377aca", + "check": "reentrancy-benign", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad5", + "source_mapping": { + "start": 979, + "length": 128, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 45, + 46, + 47, + 48, + 49 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad5(address)" + } + }, + { + "type": "node", + "name": "ethSender(address(0))", + "source_mapping": { + "start": 1026, + "length": 21, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 46 + ], + "starting_column": 9, + "ending_column": 30 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad5", + "source_mapping": { + "start": 979, + "length": 128, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 45, + 46, + 47, + 48, + 49 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad5(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "address(target).call.value(1)()", + "source_mapping": { + "start": 1261, + "length": 33, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 56 + ], + "starting_column": 9, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "ethSender", + "source_mapping": { + "start": 1208, + "length": 93, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 55, + 56, + 57 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "ethSender(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "varChanger()", + "source_mapping": { + "start": 1057, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 47 + ], + "starting_column": 9, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad5", + "source_mapping": { + "start": 979, + "length": 128, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 45, + 46, + 47, + 48, + 49 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad5(address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "anotherVariableToChange" + } + }, + { + "type": "node", + "name": "anotherVariableToChange ++", + "source_mapping": { + "start": 1347, + "length": 25, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 60 + ], + "starting_column": 9, + "ending_column": 34 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "varChanger", + "source_mapping": { + "start": 1307, + "length": 72, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 59, + 60, + 61 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "varChanger()" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "anotherVariableToChange" + } + } + ], + "description": "Reentrancy in ReentrancyBenign.bad5(address) (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#45-49):\n\tExternal calls:\n\t- ethSender(address(0)) (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#46)\n\t\t- address(target).call.value(1)() (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#56)\n\tState variables written after the call(s):\n\t- varChanger() (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#47)\n\t\t- anotherVariableToChange ++ (tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#60)\n", + "markdown": "Reentrancy in [ReentrancyBenign.bad5(address)](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L45-L49):\n\tExternal calls:\n\t- [ethSender(address(0))](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L46)\n\t\t- [address(target).call.value(1)()](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L56)\n\tState variables written after the call(s):\n\t- [varChanger()](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L47)\n\t\t- [anotherVariableToChange ++](tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol#L60)\n", + "id": "3b1a0f56972cc373bb64019a51f2424653de8fab99fb3941328f1c98f358e766", + "check": "reentrancy-benign", + "impact": "Low", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol b/tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol new file mode 100644 index 0000000000..c1b08e29af --- /dev/null +++ b/tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol @@ -0,0 +1,62 @@ +// pragma solidity ^0.4.0; + +contract ReentrancyBenign { + uint8 anotherVariableToChange; + uint8 counter = 0; + + function bad0() public { + (bool success,) = msg.sender.call(""); + if (!success) { + revert(); + } + counter += 1; + } + + function bad1(address target) public { + (bool success,) = target.call(""); + require(success); + counter += 1; + } + + function bad2(address target) public { + (bool success,) = target.call(""); + if (success) { + address(target).call.value(1000)(""); + counter += 1; + } + else { + revert(); + } + } + + function bad3(address target) public { + externalCaller(target); + varChanger(); + ethSender(target); + } + + function bad4(address target) public { + externalCaller(target); + ethSender(address(0)); + varChanger(); + address(target).call.value(2)(""); + } + + function bad5(address target) public { + ethSender(address(0)); + varChanger(); + ethSender(address(0)); + } + + function externalCaller(address target) private { + address(target).call(""); + } + + function ethSender(address target) private { + address(target).call.value(1)(""); + } + + function varChanger() private { + anotherVariableToChange++; + } +} \ No newline at end of file diff --git a/tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol.0.6.11.ReentrancyBenign.json b/tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol.0.6.11.ReentrancyBenign.json new file mode 100644 index 0000000000..511358bc91 --- /dev/null +++ b/tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol.0.6.11.ReentrancyBenign.json @@ -0,0 +1,4621 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 119, + "length": 155, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad0()" + } + }, + { + "type": "node", + "name": "(success) = msg.sender.call()", + "source_mapping": { + "start": 152, + "length": 37, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 8 + ], + "starting_column": 9, + "ending_column": 46 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 119, + "length": 155, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad0()" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "(success) = msg.sender.call()", + "source_mapping": { + "start": 152, + "length": 37, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 8 + ], + "starting_column": 9, + "ending_column": 46 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 119, + "length": 155, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad0()" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "counter += 1", + "source_mapping": { + "start": 255, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 9, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 119, + "length": 155, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad0()" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "counter" + } + } + ], + "description": "Reentrancy in ReentrancyBenign.bad0() (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#7-13):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#8)\n\tState variables written after the call(s):\n\t- counter += 1 (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#12)\n", + "markdown": "Reentrancy in [ReentrancyBenign.bad0()](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L7-L13):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L8)\n\tState variables written after the call(s):\n\t- [counter += 1](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L12)\n", + "id": "e35d0f014a7459e09ea372373807f325e4c901c8412f473d46c93b949e8b4908", + "check": "reentrancy-benign", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 280, + "length": 135, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad1(address)" + } + }, + { + "type": "node", + "name": "(success) = target.call()", + "source_mapping": { + "start": 327, + "length": 33, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 16 + ], + "starting_column": 9, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 280, + "length": 135, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad1(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "(success) = target.call()", + "source_mapping": { + "start": 327, + "length": 33, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 16 + ], + "starting_column": 9, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 280, + "length": 135, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad1(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "counter += 1", + "source_mapping": { + "start": 396, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 18 + ], + "starting_column": 9, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 280, + "length": 135, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad1(address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "counter" + } + } + ], + "description": "Reentrancy in ReentrancyBenign.bad1(address) (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#15-19):\n\tExternal calls:\n\t- (success) = target.call() (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#16)\n\tState variables written after the call(s):\n\t- counter += 1 (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#18)\n", + "markdown": "Reentrancy in [ReentrancyBenign.bad1(address)](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L15-L19):\n\tExternal calls:\n\t- [(success) = target.call()](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L16)\n\tState variables written after the call(s):\n\t- [counter += 1](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L18)\n", + "id": "ad393dc7d573b714cb2f23bd3edcc782fe4e087293db87efb6fcf2ca78c13002", + "check": "reentrancy-benign", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 421, + "length": 243, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad2(address)" + } + }, + { + "type": "node", + "name": "(success) = target.call()", + "source_mapping": { + "start": 468, + "length": 33, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 22 + ], + "starting_column": 9, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 421, + "length": 243, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad2(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "address(target).call.value(1000)()", + "source_mapping": { + "start": 538, + "length": 36, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 24 + ], + "starting_column": 13, + "ending_column": 49 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 421, + "length": 243, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad2(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "(success) = target.call()", + "source_mapping": { + "start": 468, + "length": 33, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 22 + ], + "starting_column": 9, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 421, + "length": 243, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad2(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "address(target).call.value(1000)()", + "source_mapping": { + "start": 538, + "length": 36, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 24 + ], + "starting_column": 13, + "ending_column": 49 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 421, + "length": 243, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad2(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "counter += 1", + "source_mapping": { + "start": 588, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 13, + "ending_column": 25 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 421, + "length": 243, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad2(address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "counter" + } + } + ], + "description": "Reentrancy in ReentrancyBenign.bad2(address) (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#21-30):\n\tExternal calls:\n\t- (success) = target.call() (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#22)\n\t- address(target).call.value(1000)() (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#24)\n\tExternal calls sending eth:\n\t- address(target).call.value(1000)() (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#24)\n\tState variables written after the call(s):\n\t- counter += 1 (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#25)\n", + "markdown": "Reentrancy in [ReentrancyBenign.bad2(address)](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L21-L30):\n\tExternal calls:\n\t- [(success) = target.call()](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L22)\n\t- [address(target).call.value(1000)()](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L24)\n\tExternal calls sending eth:\n\t- [address(target).call.value(1000)()](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L24)\n\tState variables written after the call(s):\n\t- [counter += 1](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L25)\n", + "id": "416fe229b7f234a232cd7727df5925368d4abd38be42a4a774f4d3b7d93c0707", + "check": "reentrancy-benign", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad3", + "source_mapping": { + "start": 670, + "length": 125, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 32, + 33, + 34, + 35, + 36 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad3(address)" + } + }, + { + "type": "node", + "name": "externalCaller(target)", + "source_mapping": { + "start": 717, + "length": 22, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 33 + ], + "starting_column": 9, + "ending_column": 31 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad3", + "source_mapping": { + "start": 670, + "length": 125, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 32, + 33, + 34, + 35, + 36 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad3(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "address(target).call()", + "source_mapping": { + "start": 1171, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 52 + ], + "starting_column": 9, + "ending_column": 33 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "externalCaller", + "source_mapping": { + "start": 1113, + "length": 89, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 51, + 52, + 53 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "externalCaller(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "externalCaller(target)", + "source_mapping": { + "start": 717, + "length": 22, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 33 + ], + "starting_column": 9, + "ending_column": 31 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad3", + "source_mapping": { + "start": 670, + "length": 125, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 32, + 33, + 34, + 35, + 36 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad3(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "address(target).call()", + "source_mapping": { + "start": 1171, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 52 + ], + "starting_column": 9, + "ending_column": 33 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "externalCaller", + "source_mapping": { + "start": 1113, + "length": 89, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 51, + 52, + 53 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "externalCaller(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "varChanger()", + "source_mapping": { + "start": 749, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 34 + ], + "starting_column": 9, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad3", + "source_mapping": { + "start": 670, + "length": 125, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 32, + 33, + 34, + 35, + 36 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad3(address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "anotherVariableToChange" + } + }, + { + "type": "node", + "name": "anotherVariableToChange ++", + "source_mapping": { + "start": 1347, + "length": 25, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 60 + ], + "starting_column": 9, + "ending_column": 34 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "varChanger", + "source_mapping": { + "start": 1307, + "length": 72, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 59, + 60, + 61 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "varChanger()" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "anotherVariableToChange" + } + } + ], + "description": "Reentrancy in ReentrancyBenign.bad3(address) (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#32-36):\n\tExternal calls:\n\t- externalCaller(target) (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#33)\n\t\t- address(target).call() (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#52)\n\tState variables written after the call(s):\n\t- varChanger() (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#34)\n\t\t- anotherVariableToChange ++ (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#60)\n", + "markdown": "Reentrancy in [ReentrancyBenign.bad3(address)](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L32-L36):\n\tExternal calls:\n\t- [externalCaller(target)](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L33)\n\t\t- [address(target).call()](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L52)\n\tState variables written after the call(s):\n\t- [varChanger()](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L34)\n\t\t- [anotherVariableToChange ++](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L60)\n", + "id": "e1fae91060d6fa1e5a3655e7bd39bf087c5c66ddc73630646dff0ba23c65dfd5", + "check": "reentrancy-benign", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad4", + "source_mapping": { + "start": 801, + "length": 172, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 38, + 39, + 40, + 41, + 42, + 43 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad4(address)" + } + }, + { + "type": "node", + "name": "externalCaller(target)", + "source_mapping": { + "start": 848, + "length": 22, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 39 + ], + "starting_column": 9, + "ending_column": 31 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad4", + "source_mapping": { + "start": 801, + "length": 172, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 38, + 39, + 40, + 41, + 42, + 43 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad4(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "address(target).call()", + "source_mapping": { + "start": 1171, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 52 + ], + "starting_column": 9, + "ending_column": 33 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "externalCaller", + "source_mapping": { + "start": 1113, + "length": 89, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 51, + 52, + 53 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "externalCaller(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "ethSender(address(0))", + "source_mapping": { + "start": 880, + "length": 21, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 40 + ], + "starting_column": 9, + "ending_column": 30 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad4", + "source_mapping": { + "start": 801, + "length": 172, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 38, + 39, + 40, + 41, + 42, + 43 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad4(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "address(target).call.value(1)()", + "source_mapping": { + "start": 1261, + "length": 33, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 56 + ], + "starting_column": 9, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "ethSender", + "source_mapping": { + "start": 1208, + "length": 93, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 55, + 56, + 57 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "ethSender(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "externalCaller(target)", + "source_mapping": { + "start": 848, + "length": 22, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 39 + ], + "starting_column": 9, + "ending_column": 31 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad4", + "source_mapping": { + "start": 801, + "length": 172, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 38, + 39, + 40, + 41, + 42, + 43 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad4(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "address(target).call()", + "source_mapping": { + "start": 1171, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 52 + ], + "starting_column": 9, + "ending_column": 33 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "externalCaller", + "source_mapping": { + "start": 1113, + "length": 89, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 51, + 52, + 53 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "externalCaller(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "ethSender(address(0))", + "source_mapping": { + "start": 880, + "length": 21, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 40 + ], + "starting_column": 9, + "ending_column": 30 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad4", + "source_mapping": { + "start": 801, + "length": 172, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 38, + 39, + 40, + 41, + 42, + 43 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad4(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "address(target).call.value(1)()", + "source_mapping": { + "start": 1261, + "length": 33, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 56 + ], + "starting_column": 9, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "ethSender", + "source_mapping": { + "start": 1208, + "length": 93, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 55, + 56, + 57 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "ethSender(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "varChanger()", + "source_mapping": { + "start": 911, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 41 + ], + "starting_column": 9, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad4", + "source_mapping": { + "start": 801, + "length": 172, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 38, + 39, + 40, + 41, + 42, + 43 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad4(address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "anotherVariableToChange" + } + }, + { + "type": "node", + "name": "anotherVariableToChange ++", + "source_mapping": { + "start": 1347, + "length": 25, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 60 + ], + "starting_column": 9, + "ending_column": 34 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "varChanger", + "source_mapping": { + "start": 1307, + "length": 72, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 59, + 60, + 61 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "varChanger()" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "anotherVariableToChange" + } + } + ], + "description": "Reentrancy in ReentrancyBenign.bad4(address) (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#38-43):\n\tExternal calls:\n\t- externalCaller(target) (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#39)\n\t\t- address(target).call() (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#52)\n\t- ethSender(address(0)) (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#40)\n\t\t- address(target).call.value(1)() (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#56)\n\tExternal calls sending eth:\n\t- ethSender(address(0)) (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#40)\n\t\t- address(target).call.value(1)() (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#56)\n\tState variables written after the call(s):\n\t- varChanger() (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#41)\n\t\t- anotherVariableToChange ++ (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#60)\n", + "markdown": "Reentrancy in [ReentrancyBenign.bad4(address)](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L38-L43):\n\tExternal calls:\n\t- [externalCaller(target)](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L39)\n\t\t- [address(target).call()](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L52)\n\t- [ethSender(address(0))](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L40)\n\t\t- [address(target).call.value(1)()](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L56)\n\tExternal calls sending eth:\n\t- [ethSender(address(0))](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L40)\n\t\t- [address(target).call.value(1)()](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L56)\n\tState variables written after the call(s):\n\t- [varChanger()](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L41)\n\t\t- [anotherVariableToChange ++](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L60)\n", + "id": "d049c8562c4857b9d8bc23ceca965bd5fc572520db59bc43c0010f03c1d08936", + "check": "reentrancy-benign", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad5", + "source_mapping": { + "start": 979, + "length": 128, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 45, + 46, + 47, + 48, + 49 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad5(address)" + } + }, + { + "type": "node", + "name": "ethSender(address(0))", + "source_mapping": { + "start": 1026, + "length": 21, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 46 + ], + "starting_column": 9, + "ending_column": 30 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad5", + "source_mapping": { + "start": 979, + "length": 128, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 45, + 46, + 47, + 48, + 49 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad5(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "address(target).call.value(1)()", + "source_mapping": { + "start": 1261, + "length": 33, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 56 + ], + "starting_column": 9, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "ethSender", + "source_mapping": { + "start": 1208, + "length": 93, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 55, + 56, + 57 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "ethSender(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "varChanger()", + "source_mapping": { + "start": 1057, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 47 + ], + "starting_column": 9, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad5", + "source_mapping": { + "start": 979, + "length": 128, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 45, + 46, + 47, + 48, + 49 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad5(address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "anotherVariableToChange" + } + }, + { + "type": "node", + "name": "anotherVariableToChange ++", + "source_mapping": { + "start": 1347, + "length": 25, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 60 + ], + "starting_column": 9, + "ending_column": 34 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "varChanger", + "source_mapping": { + "start": 1307, + "length": 72, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 59, + 60, + 61 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "varChanger()" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "anotherVariableToChange" + } + } + ], + "description": "Reentrancy in ReentrancyBenign.bad5(address) (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#45-49):\n\tExternal calls:\n\t- ethSender(address(0)) (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#46)\n\t\t- address(target).call.value(1)() (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#56)\n\tState variables written after the call(s):\n\t- varChanger() (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#47)\n\t\t- anotherVariableToChange ++ (tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#60)\n", + "markdown": "Reentrancy in [ReentrancyBenign.bad5(address)](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L45-L49):\n\tExternal calls:\n\t- [ethSender(address(0))](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L46)\n\t\t- [address(target).call.value(1)()](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L56)\n\tState variables written after the call(s):\n\t- [varChanger()](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L47)\n\t\t- [anotherVariableToChange ++](tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol#L60)\n", + "id": "8fc09eeb31a7d9cdd78f1271f6dc486187ef7e75d35bf205c1e8a4cf70bd5ab9", + "check": "reentrancy-benign", + "impact": "Low", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol b/tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol new file mode 100644 index 0000000000..91ae68cd09 --- /dev/null +++ b/tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol @@ -0,0 +1,62 @@ +// pragma solidity ^0.4.0; + +contract ReentrancyBenign { + uint8 anotherVariableToChange; + uint8 counter = 0; + + function bad0() public { + (bool success,) = msg.sender.call(""); + if (!success) { + revert(); + } + counter += 1; + } + + function bad1(address target) public { + (bool success,) = target.call(""); + require(success); + counter += 1; + } + + function bad2(address target) public { + (bool success,) = target.call(""); + if (success) { + address(target).call{value:1000}(""); + counter += 1; + } + else { + revert(); + } + } + + function bad3(address target) public { + externalCaller(target); + varChanger(); + ethSender(target); + } + + function bad4(address target) public { + externalCaller(target); + ethSender(address(0)); + varChanger(); + address(target).call{value:2}(""); + } + + function bad5(address target) public { + ethSender(address(0)); + varChanger(); + ethSender(address(0)); + } + + function externalCaller(address target) private { + address(target).call(""); + } + + function ethSender(address target) private { + address(target).call{value:1}(""); + } + + function varChanger() private { + anotherVariableToChange++; + } +} \ No newline at end of file diff --git a/tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol.0.7.6.ReentrancyBenign.json b/tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol.0.7.6.ReentrancyBenign.json new file mode 100644 index 0000000000..2f8ad81f1e --- /dev/null +++ b/tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol.0.7.6.ReentrancyBenign.json @@ -0,0 +1,4621 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 119, + "length": 155, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad0()" + } + }, + { + "type": "node", + "name": "(success) = msg.sender.call()", + "source_mapping": { + "start": 152, + "length": 37, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 8 + ], + "starting_column": 9, + "ending_column": 46 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 119, + "length": 155, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad0()" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "(success) = msg.sender.call()", + "source_mapping": { + "start": 152, + "length": 37, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 8 + ], + "starting_column": 9, + "ending_column": 46 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 119, + "length": 155, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad0()" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "counter += 1", + "source_mapping": { + "start": 255, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 9, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 119, + "length": 155, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad0()" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "counter" + } + } + ], + "description": "Reentrancy in ReentrancyBenign.bad0() (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#7-13):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#8)\n\tState variables written after the call(s):\n\t- counter += 1 (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#12)\n", + "markdown": "Reentrancy in [ReentrancyBenign.bad0()](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L7-L13):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L8)\n\tState variables written after the call(s):\n\t- [counter += 1](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L12)\n", + "id": "b162165ec474792dc887b42c40e2d6ba28de0bde22bebdc2b5f63381bde85086", + "check": "reentrancy-benign", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 280, + "length": 135, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad1(address)" + } + }, + { + "type": "node", + "name": "(success) = target.call()", + "source_mapping": { + "start": 327, + "length": 33, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 16 + ], + "starting_column": 9, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 280, + "length": 135, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad1(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "(success) = target.call()", + "source_mapping": { + "start": 327, + "length": 33, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 16 + ], + "starting_column": 9, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 280, + "length": 135, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad1(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "counter += 1", + "source_mapping": { + "start": 396, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 18 + ], + "starting_column": 9, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 280, + "length": 135, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17, + 18, + 19 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad1(address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "counter" + } + } + ], + "description": "Reentrancy in ReentrancyBenign.bad1(address) (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#15-19):\n\tExternal calls:\n\t- (success) = target.call() (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#16)\n\tState variables written after the call(s):\n\t- counter += 1 (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#18)\n", + "markdown": "Reentrancy in [ReentrancyBenign.bad1(address)](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L15-L19):\n\tExternal calls:\n\t- [(success) = target.call()](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L16)\n\tState variables written after the call(s):\n\t- [counter += 1](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L18)\n", + "id": "bc777bbc032af8fcb23146285a47012df0d4a7825596c3fc57a27e8758500dd2", + "check": "reentrancy-benign", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 421, + "length": 243, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad2(address)" + } + }, + { + "type": "node", + "name": "(success) = target.call()", + "source_mapping": { + "start": 468, + "length": 33, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 22 + ], + "starting_column": 9, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 421, + "length": 243, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad2(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "address(target).call{value: 1000}()", + "source_mapping": { + "start": 538, + "length": 36, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 24 + ], + "starting_column": 13, + "ending_column": 49 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 421, + "length": 243, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad2(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "(success) = target.call()", + "source_mapping": { + "start": 468, + "length": 33, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 22 + ], + "starting_column": 9, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 421, + "length": 243, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad2(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "address(target).call{value: 1000}()", + "source_mapping": { + "start": 538, + "length": 36, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 24 + ], + "starting_column": 13, + "ending_column": 49 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 421, + "length": 243, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad2(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "counter += 1", + "source_mapping": { + "start": 588, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 13, + "ending_column": 25 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 421, + "length": 243, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad2(address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "counter" + } + } + ], + "description": "Reentrancy in ReentrancyBenign.bad2(address) (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#21-30):\n\tExternal calls:\n\t- (success) = target.call() (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#22)\n\t- address(target).call{value: 1000}() (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#24)\n\tExternal calls sending eth:\n\t- address(target).call{value: 1000}() (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#24)\n\tState variables written after the call(s):\n\t- counter += 1 (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#25)\n", + "markdown": "Reentrancy in [ReentrancyBenign.bad2(address)](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L21-L30):\n\tExternal calls:\n\t- [(success) = target.call()](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L22)\n\t- [address(target).call{value: 1000}()](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L24)\n\tExternal calls sending eth:\n\t- [address(target).call{value: 1000}()](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L24)\n\tState variables written after the call(s):\n\t- [counter += 1](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L25)\n", + "id": "79c88ecb3f548fa798f9c5cbb0e3658e78510fbd1cbae4455df47ba39a6fa505", + "check": "reentrancy-benign", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad3", + "source_mapping": { + "start": 670, + "length": 125, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 32, + 33, + 34, + 35, + 36 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad3(address)" + } + }, + { + "type": "node", + "name": "externalCaller(target)", + "source_mapping": { + "start": 717, + "length": 22, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 33 + ], + "starting_column": 9, + "ending_column": 31 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad3", + "source_mapping": { + "start": 670, + "length": 125, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 32, + 33, + 34, + 35, + 36 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad3(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "address(target).call()", + "source_mapping": { + "start": 1171, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 52 + ], + "starting_column": 9, + "ending_column": 33 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "externalCaller", + "source_mapping": { + "start": 1113, + "length": 89, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 51, + 52, + 53 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "externalCaller(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "externalCaller(target)", + "source_mapping": { + "start": 717, + "length": 22, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 33 + ], + "starting_column": 9, + "ending_column": 31 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad3", + "source_mapping": { + "start": 670, + "length": 125, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 32, + 33, + 34, + 35, + 36 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad3(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "address(target).call()", + "source_mapping": { + "start": 1171, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 52 + ], + "starting_column": 9, + "ending_column": 33 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "externalCaller", + "source_mapping": { + "start": 1113, + "length": 89, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 51, + 52, + 53 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "externalCaller(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "varChanger()", + "source_mapping": { + "start": 749, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 34 + ], + "starting_column": 9, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad3", + "source_mapping": { + "start": 670, + "length": 125, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 32, + 33, + 34, + 35, + 36 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad3(address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "anotherVariableToChange" + } + }, + { + "type": "node", + "name": "anotherVariableToChange ++", + "source_mapping": { + "start": 1347, + "length": 25, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 60 + ], + "starting_column": 9, + "ending_column": 34 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "varChanger", + "source_mapping": { + "start": 1307, + "length": 72, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 59, + 60, + 61 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "varChanger()" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "anotherVariableToChange" + } + } + ], + "description": "Reentrancy in ReentrancyBenign.bad3(address) (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#32-36):\n\tExternal calls:\n\t- externalCaller(target) (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#33)\n\t\t- address(target).call() (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#52)\n\tState variables written after the call(s):\n\t- varChanger() (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#34)\n\t\t- anotherVariableToChange ++ (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#60)\n", + "markdown": "Reentrancy in [ReentrancyBenign.bad3(address)](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L32-L36):\n\tExternal calls:\n\t- [externalCaller(target)](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L33)\n\t\t- [address(target).call()](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L52)\n\tState variables written after the call(s):\n\t- [varChanger()](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L34)\n\t\t- [anotherVariableToChange ++](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L60)\n", + "id": "d8315c27e619d086ab8ec4206250374daad8449de43d0eb685dc2cb38376e6e3", + "check": "reentrancy-benign", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad4", + "source_mapping": { + "start": 801, + "length": 172, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 38, + 39, + 40, + 41, + 42, + 43 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad4(address)" + } + }, + { + "type": "node", + "name": "externalCaller(target)", + "source_mapping": { + "start": 848, + "length": 22, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 39 + ], + "starting_column": 9, + "ending_column": 31 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad4", + "source_mapping": { + "start": 801, + "length": 172, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 38, + 39, + 40, + 41, + 42, + 43 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad4(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "address(target).call()", + "source_mapping": { + "start": 1171, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 52 + ], + "starting_column": 9, + "ending_column": 33 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "externalCaller", + "source_mapping": { + "start": 1113, + "length": 89, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 51, + 52, + 53 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "externalCaller(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "ethSender(address(0))", + "source_mapping": { + "start": 880, + "length": 21, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 40 + ], + "starting_column": 9, + "ending_column": 30 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad4", + "source_mapping": { + "start": 801, + "length": 172, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 38, + 39, + 40, + 41, + 42, + 43 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad4(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "address(target).call{value: 1}()", + "source_mapping": { + "start": 1261, + "length": 33, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 56 + ], + "starting_column": 9, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "ethSender", + "source_mapping": { + "start": 1208, + "length": 93, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 55, + 56, + 57 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "ethSender(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "externalCaller(target)", + "source_mapping": { + "start": 848, + "length": 22, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 39 + ], + "starting_column": 9, + "ending_column": 31 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad4", + "source_mapping": { + "start": 801, + "length": 172, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 38, + 39, + 40, + 41, + 42, + 43 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad4(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "address(target).call()", + "source_mapping": { + "start": 1171, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 52 + ], + "starting_column": 9, + "ending_column": 33 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "externalCaller", + "source_mapping": { + "start": 1113, + "length": 89, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 51, + 52, + 53 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "externalCaller(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "ethSender(address(0))", + "source_mapping": { + "start": 880, + "length": 21, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 40 + ], + "starting_column": 9, + "ending_column": 30 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad4", + "source_mapping": { + "start": 801, + "length": 172, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 38, + 39, + 40, + 41, + 42, + 43 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad4(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "address(target).call{value: 1}()", + "source_mapping": { + "start": 1261, + "length": 33, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 56 + ], + "starting_column": 9, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "ethSender", + "source_mapping": { + "start": 1208, + "length": 93, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 55, + 56, + 57 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "ethSender(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "varChanger()", + "source_mapping": { + "start": 911, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 41 + ], + "starting_column": 9, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad4", + "source_mapping": { + "start": 801, + "length": 172, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 38, + 39, + 40, + 41, + 42, + 43 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad4(address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "anotherVariableToChange" + } + }, + { + "type": "node", + "name": "anotherVariableToChange ++", + "source_mapping": { + "start": 1347, + "length": 25, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 60 + ], + "starting_column": 9, + "ending_column": 34 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "varChanger", + "source_mapping": { + "start": 1307, + "length": 72, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 59, + 60, + 61 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "varChanger()" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "anotherVariableToChange" + } + } + ], + "description": "Reentrancy in ReentrancyBenign.bad4(address) (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#38-43):\n\tExternal calls:\n\t- externalCaller(target) (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#39)\n\t\t- address(target).call() (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#52)\n\t- ethSender(address(0)) (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#40)\n\t\t- address(target).call{value: 1}() (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#56)\n\tExternal calls sending eth:\n\t- ethSender(address(0)) (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#40)\n\t\t- address(target).call{value: 1}() (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#56)\n\tState variables written after the call(s):\n\t- varChanger() (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#41)\n\t\t- anotherVariableToChange ++ (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#60)\n", + "markdown": "Reentrancy in [ReentrancyBenign.bad4(address)](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L38-L43):\n\tExternal calls:\n\t- [externalCaller(target)](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L39)\n\t\t- [address(target).call()](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L52)\n\t- [ethSender(address(0))](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L40)\n\t\t- [address(target).call{value: 1}()](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L56)\n\tExternal calls sending eth:\n\t- [ethSender(address(0))](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L40)\n\t\t- [address(target).call{value: 1}()](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L56)\n\tState variables written after the call(s):\n\t- [varChanger()](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L41)\n\t\t- [anotherVariableToChange ++](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L60)\n", + "id": "693e60a81db5856504cce9c31c639630515a7bf4431ba129d2f1dfbef4caa0e6", + "check": "reentrancy-benign", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad5", + "source_mapping": { + "start": 979, + "length": 128, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 45, + 46, + 47, + 48, + 49 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad5(address)" + } + }, + { + "type": "node", + "name": "ethSender(address(0))", + "source_mapping": { + "start": 1026, + "length": 21, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 46 + ], + "starting_column": 9, + "ending_column": 30 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad5", + "source_mapping": { + "start": 979, + "length": 128, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 45, + 46, + 47, + 48, + 49 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad5(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "address(target).call{value: 1}()", + "source_mapping": { + "start": 1261, + "length": 33, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 56 + ], + "starting_column": 9, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "ethSender", + "source_mapping": { + "start": 1208, + "length": 93, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 55, + 56, + 57 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "ethSender(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "varChanger()", + "source_mapping": { + "start": 1057, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 47 + ], + "starting_column": 9, + "ending_column": 21 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad5", + "source_mapping": { + "start": 979, + "length": 128, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 45, + 46, + 47, + 48, + 49 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad5(address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "anotherVariableToChange" + } + }, + { + "type": "node", + "name": "anotherVariableToChange ++", + "source_mapping": { + "start": 1347, + "length": 25, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 60 + ], + "starting_column": 9, + "ending_column": 34 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "varChanger", + "source_mapping": { + "start": 1307, + "length": 72, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 59, + 60, + 61 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ReentrancyBenign", + "source_mapping": { + "start": 28, + "length": 1353, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "varChanger()" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "anotherVariableToChange" + } + } + ], + "description": "Reentrancy in ReentrancyBenign.bad5(address) (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#45-49):\n\tExternal calls:\n\t- ethSender(address(0)) (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#46)\n\t\t- address(target).call{value: 1}() (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#56)\n\tState variables written after the call(s):\n\t- varChanger() (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#47)\n\t\t- anotherVariableToChange ++ (tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#60)\n", + "markdown": "Reentrancy in [ReentrancyBenign.bad5(address)](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L45-L49):\n\tExternal calls:\n\t- [ethSender(address(0))](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L46)\n\t\t- [address(target).call{value: 1}()](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L56)\n\tState variables written after the call(s):\n\t- [varChanger()](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L47)\n\t\t- [anotherVariableToChange ++](tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol#L60)\n", + "id": "068323f92a1eaa2d419e19d35185150639a2b3f992b9b382972f13d546cd414d", + "check": "reentrancy-benign", + "impact": "Low", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/reentrancy-eth/reentrancy.sol b/tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol similarity index 100% rename from tests/detectors/reentrancy-eth/reentrancy.sol rename to tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol diff --git a/tests/detectors/reentrancy-eth/reentrancy.sol.0.4.25.ReentrancyEth.json b/tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol.0.4.25.ReentrancyEth.json similarity index 92% rename from tests/detectors/reentrancy-eth/reentrancy.sol.0.4.25.ReentrancyEth.json rename to tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol.0.4.25.ReentrancyEth.json index 82bee42710..4484dec367 100644 --- a/tests/detectors/reentrancy-eth/reentrancy.sol.0.4.25.ReentrancyEth.json +++ b/tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol.0.4.25.ReentrancyEth.json @@ -9,9 +9,9 @@ "start": 299, "length": 314, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "is_dependency": false, "lines": [ 14, @@ -34,9 +34,9 @@ "start": 26, "length": 2334, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "is_dependency": false, "lines": [ 3, @@ -124,9 +124,9 @@ "start": 482, "length": 53, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "is_dependency": false, "lines": [ 17 @@ -142,9 +142,9 @@ "start": 299, "length": 314, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "is_dependency": false, "lines": [ 14, @@ -167,9 +167,9 @@ "start": 26, "length": 2334, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "is_dependency": false, "lines": [ 3, @@ -262,9 +262,9 @@ "start": 579, "length": 27, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "is_dependency": false, "lines": [ 20 @@ -280,9 +280,9 @@ "start": 299, "length": 314, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "is_dependency": false, "lines": [ 14, @@ -305,9 +305,9 @@ "start": 26, "length": 2334, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "is_dependency": false, "lines": [ 3, @@ -395,9 +395,9 @@ } } ], - "description": "Reentrancy in Reentrancy.withdrawBalance() (tests/detectors/reentrancy-eth/reentrancy.sol#14-21):\n\tExternal calls:\n\t- ! (msg.sender.call.value(userBalance[msg.sender])()) (tests/detectors/reentrancy-eth/reentrancy.sol#17)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = 0 (tests/detectors/reentrancy-eth/reentrancy.sol#20)\n", - "markdown": "Reentrancy in [Reentrancy.withdrawBalance()](tests/detectors/reentrancy-eth/reentrancy.sol#L14-L21):\n\tExternal calls:\n\t- [! (msg.sender.call.value(userBalance[msg.sender])())](tests/detectors/reentrancy-eth/reentrancy.sol#L17)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = 0](tests/detectors/reentrancy-eth/reentrancy.sol#L20)\n", - "id": "6269e8974e176ba8871cdc851f735af4651f431dead223d867e770705c3d3306", + "description": "Reentrancy in Reentrancy.withdrawBalance() (tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#14-21):\n\tExternal calls:\n\t- ! (msg.sender.call.value(userBalance[msg.sender])()) (tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#17)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = 0 (tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#20)\n", + "markdown": "Reentrancy in [Reentrancy.withdrawBalance()](tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#L14-L21):\n\tExternal calls:\n\t- [! (msg.sender.call.value(userBalance[msg.sender])())](tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#L17)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = 0](tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#L20)\n", + "id": "957f3b0e921130284eee0bc87196da62a404d42f5be7eb797f1c3ffb0d4de355", "check": "reentrancy-eth", "impact": "High", "confidence": "Medium" @@ -411,9 +411,9 @@ "start": 2108, "length": 246, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "is_dependency": false, "lines": [ 64, @@ -435,9 +435,9 @@ "start": 26, "length": 2334, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "is_dependency": false, "lines": [ 3, @@ -525,9 +525,9 @@ "start": 2263, "length": 33, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "is_dependency": false, "lines": [ 67 @@ -543,9 +543,9 @@ "start": 2108, "length": 246, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "is_dependency": false, "lines": [ 64, @@ -567,9 +567,9 @@ "start": 26, "length": 2334, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "is_dependency": false, "lines": [ 3, @@ -662,9 +662,9 @@ "start": 2310, "length": 27, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "is_dependency": false, "lines": [ 68 @@ -680,9 +680,9 @@ "start": 2108, "length": 246, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "is_dependency": false, "lines": [ 64, @@ -704,9 +704,9 @@ "start": 26, "length": 2334, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "is_dependency": false, "lines": [ 3, @@ -794,9 +794,9 @@ } } ], - "description": "Reentrancy in Reentrancy.withdrawBalance_nested() (tests/detectors/reentrancy-eth/reentrancy.sol#64-70):\n\tExternal calls:\n\t- msg.sender.call.value(amount / 2)() (tests/detectors/reentrancy-eth/reentrancy.sol#67)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = 0 (tests/detectors/reentrancy-eth/reentrancy.sol#68)\n", - "markdown": "Reentrancy in [Reentrancy.withdrawBalance_nested()](tests/detectors/reentrancy-eth/reentrancy.sol#L64-L70):\n\tExternal calls:\n\t- [msg.sender.call.value(amount / 2)()](tests/detectors/reentrancy-eth/reentrancy.sol#L67)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = 0](tests/detectors/reentrancy-eth/reentrancy.sol#L68)\n", - "id": "2fb2fe1e62bcd0c2921b856a9d4f2da8575a311b140d47dd3eb1a34ed1c5f69c", + "description": "Reentrancy in Reentrancy.withdrawBalance_nested() (tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#64-70):\n\tExternal calls:\n\t- msg.sender.call.value(amount / 2)() (tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#67)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = 0 (tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#68)\n", + "markdown": "Reentrancy in [Reentrancy.withdrawBalance_nested()](tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#L64-L70):\n\tExternal calls:\n\t- [msg.sender.call.value(amount / 2)()](tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#L67)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = 0](tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol#L68)\n", + "id": "bc5fd7842eb653b31fae72521123190b37b3dfe9d70a201bfcd70c8a7b5f43ba", "check": "reentrancy-eth", "impact": "High", "confidence": "Medium" diff --git a/tests/detectors/reentrancy-eth/reentrancy_indirect.sol b/tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol similarity index 100% rename from tests/detectors/reentrancy-eth/reentrancy_indirect.sol rename to tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol diff --git a/tests/detectors/reentrancy-eth/reentrancy_indirect.sol.0.4.25.ReentrancyEth.json b/tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol.0.4.25.ReentrancyEth.json similarity index 87% rename from tests/detectors/reentrancy-eth/reentrancy_indirect.sol.0.4.25.ReentrancyEth.json rename to tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol.0.4.25.ReentrancyEth.json index e9929d1a8c..851a694a35 100644 --- a/tests/detectors/reentrancy-eth/reentrancy_indirect.sol.0.4.25.ReentrancyEth.json +++ b/tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol.0.4.25.ReentrancyEth.json @@ -9,9 +9,9 @@ "start": 639, "length": 278, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 22, @@ -34,9 +34,9 @@ "start": 185, "length": 735, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 8, @@ -78,9 +78,9 @@ "start": 742, "length": 76, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 24 @@ -96,9 +96,9 @@ "start": 639, "length": 278, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 22, @@ -121,9 +121,9 @@ "start": 185, "length": 735, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 8, @@ -170,9 +170,9 @@ "start": 681, "length": 51, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 23 @@ -188,9 +188,9 @@ "start": 639, "length": 278, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 22, @@ -213,9 +213,9 @@ "start": 185, "length": 735, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 8, @@ -262,9 +262,9 @@ "start": 829, "length": 34, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 26 @@ -280,9 +280,9 @@ "start": 639, "length": 278, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 22, @@ -305,9 +305,9 @@ "start": 185, "length": 735, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 8, @@ -355,9 +355,9 @@ "start": 873, "length": 36, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 27 @@ -373,9 +373,9 @@ "start": 639, "length": 278, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 22, @@ -398,9 +398,9 @@ "start": 185, "length": 735, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 8, @@ -442,9 +442,9 @@ } } ], - "description": "Reentrancy in Reentrancy.withdraw(address) (tests/detectors/reentrancy-eth/reentrancy_indirect.sol#22-29):\n\tExternal calls:\n\t- require(bool)(Token(token).transfer(msg.sender,token_deposed[token][msg.sender])) (tests/detectors/reentrancy-eth/reentrancy_indirect.sol#24)\n\tExternal calls sending eth:\n\t- msg.sender.transfer(eth_deposed[token][msg.sender]) (tests/detectors/reentrancy-eth/reentrancy_indirect.sol#23)\n\tState variables written after the call(s):\n\t- eth_deposed[token][msg.sender] = 0 (tests/detectors/reentrancy-eth/reentrancy_indirect.sol#26)\n\t- token_deposed[token][msg.sender] = 0 (tests/detectors/reentrancy-eth/reentrancy_indirect.sol#27)\n", - "markdown": "Reentrancy in [Reentrancy.withdraw(address)](tests/detectors/reentrancy-eth/reentrancy_indirect.sol#L22-L29):\n\tExternal calls:\n\t- [require(bool)(Token(token).transfer(msg.sender,token_deposed[token][msg.sender]))](tests/detectors/reentrancy-eth/reentrancy_indirect.sol#L24)\n\tExternal calls sending eth:\n\t- [msg.sender.transfer(eth_deposed[token][msg.sender])](tests/detectors/reentrancy-eth/reentrancy_indirect.sol#L23)\n\tState variables written after the call(s):\n\t- [eth_deposed[token][msg.sender] = 0](tests/detectors/reentrancy-eth/reentrancy_indirect.sol#L26)\n\t- [token_deposed[token][msg.sender] = 0](tests/detectors/reentrancy-eth/reentrancy_indirect.sol#L27)\n", - "id": "6e23805ff4c3ce23f8f3ae167941b4a67257de1c0708934494dd826c2e62a5b3", + "description": "Reentrancy in Reentrancy.withdraw(address) (tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol#22-29):\n\tExternal calls:\n\t- require(bool)(Token(token).transfer(msg.sender,token_deposed[token][msg.sender])) (tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol#24)\n\tExternal calls sending eth:\n\t- msg.sender.transfer(eth_deposed[token][msg.sender]) (tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol#23)\n\tState variables written after the call(s):\n\t- eth_deposed[token][msg.sender] = 0 (tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol#26)\n\t- token_deposed[token][msg.sender] = 0 (tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol#27)\n", + "markdown": "Reentrancy in [Reentrancy.withdraw(address)](tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol#L22-L29):\n\tExternal calls:\n\t- [require(bool)(Token(token).transfer(msg.sender,token_deposed[token][msg.sender]))](tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol#L24)\n\tExternal calls sending eth:\n\t- [msg.sender.transfer(eth_deposed[token][msg.sender])](tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol#L23)\n\tState variables written after the call(s):\n\t- [eth_deposed[token][msg.sender] = 0](tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol#L26)\n\t- [token_deposed[token][msg.sender] = 0](tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol#L27)\n", + "id": "8a2174b6a3476b6e52f3cdac7e85b44337e3b7d7df2b2504c5a75b8e2a00ea7f", "check": "reentrancy-eth", "impact": "High", "confidence": "Medium" diff --git a/tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol b/tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol similarity index 98% rename from tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol rename to tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol index a2151ed905..935f450eef 100644 --- a/tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol +++ b/tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +// pragma solidity ^0.5.0; contract Reentrancy { mapping (address => uint) userBalance; diff --git a/tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol.0.5.1.ReentrancyEth.json b/tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol.0.5.16.ReentrancyEth.json similarity index 89% rename from tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol.0.5.1.ReentrancyEth.json rename to tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol.0.5.16.ReentrancyEth.json index e34e42b899..6dd7c60aed 100644 --- a/tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol.0.5.1.ReentrancyEth.json +++ b/tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol.0.5.16.ReentrancyEth.json @@ -6,12 +6,12 @@ "type": "function", "name": "withdrawBalance", "source_mapping": { - "start": 298, + "start": 301, "length": 357, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "is_dependency": false, "lines": [ 14, @@ -32,12 +32,12 @@ "type": "contract", "name": "Reentrancy", "source_mapping": { - "start": 25, + "start": 28, "length": 1807, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "is_dependency": false, "lines": [ 3, @@ -104,12 +104,12 @@ "type": "node", "name": "(ret,mem) = msg.sender.call.value(userBalance[msg.sender])()", "source_mapping": { - "start": 477, + "start": 480, "length": 81, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "is_dependency": false, "lines": [ 17 @@ -122,12 +122,12 @@ "type": "function", "name": "withdrawBalance", "source_mapping": { - "start": 298, + "start": 301, "length": 357, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "is_dependency": false, "lines": [ 14, @@ -148,12 +148,12 @@ "type": "contract", "name": "Reentrancy", "source_mapping": { - "start": 25, + "start": 28, "length": 1807, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "is_dependency": false, "lines": [ 3, @@ -225,12 +225,12 @@ "type": "node", "name": "userBalance[msg.sender] = 0", "source_mapping": { - "start": 621, + "start": 624, "length": 27, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "is_dependency": false, "lines": [ 21 @@ -243,12 +243,12 @@ "type": "function", "name": "withdrawBalance", "source_mapping": { - "start": 298, + "start": 301, "length": 357, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "is_dependency": false, "lines": [ 14, @@ -269,12 +269,12 @@ "type": "contract", "name": "Reentrancy", "source_mapping": { - "start": 25, + "start": 28, "length": 1807, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "is_dependency": false, "lines": [ 3, @@ -344,9 +344,9 @@ } } ], - "description": "Reentrancy in Reentrancy.withdrawBalance() (tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol#14-22):\n\tExternal calls:\n\t- (ret,mem) = msg.sender.call.value(userBalance[msg.sender])() (tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol#17)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = 0 (tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol#21)\n", - "markdown": "Reentrancy in [Reentrancy.withdrawBalance()](tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol#L14-L22):\n\tExternal calls:\n\t- [(ret,mem) = msg.sender.call.value(userBalance[msg.sender])()](tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol#L17)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = 0](tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol#L21)\n", - "id": "66c3cae6d50c9acab59408e70acfdedb029bd341d87629b67032dc07fb75e97d", + "description": "Reentrancy in Reentrancy.withdrawBalance() (tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#14-22):\n\tExternal calls:\n\t- (ret,mem) = msg.sender.call.value(userBalance[msg.sender])() (tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#17)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = 0 (tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#21)\n", + "markdown": "Reentrancy in [Reentrancy.withdrawBalance()](tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#L14-L22):\n\tExternal calls:\n\t- [(ret,mem) = msg.sender.call.value(userBalance[msg.sender])()](tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#L17)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = 0](tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#L21)\n", + "id": "63e2edc090dbced31786ef360979f0516f51ed13f9cdc1df4722a486e6aee0b1", "check": "reentrancy-eth", "impact": "High", "confidence": "Medium" @@ -357,12 +357,12 @@ "type": "function", "name": "withdrawBalance_fixed_3", "source_mapping": { - "start": 1434, + "start": 1437, "length": 393, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "is_dependency": false, "lines": [ 44, @@ -384,12 +384,12 @@ "type": "contract", "name": "Reentrancy", "source_mapping": { - "start": 25, + "start": 28, "length": 1807, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "is_dependency": false, "lines": [ 3, @@ -456,12 +456,12 @@ "type": "node", "name": "(ret,mem) = msg.sender.call.value(amount)()", "source_mapping": { - "start": 1679, + "start": 1682, "length": 64, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "is_dependency": false, "lines": [ 49 @@ -474,12 +474,12 @@ "type": "function", "name": "withdrawBalance_fixed_3", "source_mapping": { - "start": 1434, + "start": 1437, "length": 393, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "is_dependency": false, "lines": [ 44, @@ -501,12 +501,12 @@ "type": "contract", "name": "Reentrancy", "source_mapping": { - "start": 25, + "start": 28, "length": 1807, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "is_dependency": false, "lines": [ 3, @@ -578,12 +578,12 @@ "type": "node", "name": "userBalance[msg.sender] = amount", "source_mapping": { - "start": 1778, + "start": 1781, "length": 32, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "is_dependency": false, "lines": [ 51 @@ -596,12 +596,12 @@ "type": "function", "name": "withdrawBalance_fixed_3", "source_mapping": { - "start": 1434, + "start": 1437, "length": 393, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "is_dependency": false, "lines": [ 44, @@ -623,12 +623,12 @@ "type": "contract", "name": "Reentrancy", "source_mapping": { - "start": 25, + "start": 28, "length": 1807, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", "is_dependency": false, "lines": [ 3, @@ -698,9 +698,9 @@ } } ], - "description": "Reentrancy in Reentrancy.withdrawBalance_fixed_3() (tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol#44-53):\n\tExternal calls:\n\t- (ret,mem) = msg.sender.call.value(amount)() (tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol#49)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = amount (tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol#51)\n", - "markdown": "Reentrancy in [Reentrancy.withdrawBalance_fixed_3()](tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol#L44-L53):\n\tExternal calls:\n\t- [(ret,mem) = msg.sender.call.value(amount)()](tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol#L49)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = amount](tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol#L51)\n", - "id": "25b8576f6e42ebf79ffdbcd1ed96283f587bc88f3d0712bac71d5b786a14bbb9", + "description": "Reentrancy in Reentrancy.withdrawBalance_fixed_3() (tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#44-53):\n\tExternal calls:\n\t- (ret,mem) = msg.sender.call.value(amount)() (tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#49)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = amount (tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#51)\n", + "markdown": "Reentrancy in [Reentrancy.withdrawBalance_fixed_3()](tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#L44-L53):\n\tExternal calls:\n\t- [(ret,mem) = msg.sender.call.value(amount)()](tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#L49)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = amount](tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol#L51)\n", + "id": "edbf6fc902d003daf83854bd9eb110406d5bd8c3b8facfcf0601b3e5f739b37d", "check": "reentrancy-eth", "impact": "High", "confidence": "Medium" diff --git a/tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol b/tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol new file mode 100644 index 0000000000..b2f9ec884a --- /dev/null +++ b/tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol @@ -0,0 +1,31 @@ +// pragma solidity ^0.4.24; + +contract Token{ + function transfer(address to, uint value) public returns(bool); + function transferFrom(address from, address to, uint value) public returns(bool); +} + +contract Reentrancy { + + mapping(address => mapping(address => uint)) eth_deposed; + mapping(address => mapping(address => uint)) token_deposed; + + function deposit_eth(address token) public payable{ + eth_deposed[token][msg.sender] += msg.value; + } + + function deposit_token(address token, uint value) public { + token_deposed[token][msg.sender] += value; + require(Token(token).transferFrom(msg.sender, address(this), value)); + } + + function withdraw(address token) public { + msg.sender.transfer(eth_deposed[token][msg.sender]); + require(Token(token).transfer(msg.sender, token_deposed[token][msg.sender])); + + eth_deposed[token][msg.sender] = 0; + token_deposed[token][msg.sender] = 0; + + } + +} diff --git a/tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol.0.5.16.ReentrancyEth.json b/tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol.0.5.16.ReentrancyEth.json new file mode 100644 index 0000000000..e5fadfd053 --- /dev/null +++ b/tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol.0.5.16.ReentrancyEth.json @@ -0,0 +1,453 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "withdraw", + "source_mapping": { + "start": 671, + "length": 286, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Reentrancy", + "source_mapping": { + "start": 202, + "length": 758, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdraw(address)" + } + }, + { + "type": "node", + "name": "require(bool)(Token(token).transfer(msg.sender,token_deposed[token][msg.sender]))", + "source_mapping": { + "start": 782, + "length": 76, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 24 + ], + "starting_column": 9, + "ending_column": 85 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdraw", + "source_mapping": { + "start": 671, + "length": 286, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Reentrancy", + "source_mapping": { + "start": 202, + "length": 758, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdraw(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "msg.sender.transfer(eth_deposed[token][msg.sender])", + "source_mapping": { + "start": 721, + "length": 51, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 23 + ], + "starting_column": 9, + "ending_column": 60 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdraw", + "source_mapping": { + "start": 671, + "length": 286, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Reentrancy", + "source_mapping": { + "start": 202, + "length": 758, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdraw(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "eth_deposed[token][msg.sender] = 0", + "source_mapping": { + "start": 869, + "length": 34, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 26 + ], + "starting_column": 9, + "ending_column": 43 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdraw", + "source_mapping": { + "start": 671, + "length": 286, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Reentrancy", + "source_mapping": { + "start": 202, + "length": 758, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdraw(address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "eth_deposed" + } + }, + { + "type": "node", + "name": "token_deposed[token][msg.sender] = 0", + "source_mapping": { + "start": 913, + "length": 36, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 27 + ], + "starting_column": 9, + "ending_column": 45 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdraw", + "source_mapping": { + "start": 671, + "length": 286, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Reentrancy", + "source_mapping": { + "start": 202, + "length": 758, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdraw(address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "token_deposed" + } + } + ], + "description": "Reentrancy in Reentrancy.withdraw(address) (tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#22-29):\n\tExternal calls:\n\t- require(bool)(Token(token).transfer(msg.sender,token_deposed[token][msg.sender])) (tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#24)\n\tExternal calls sending eth:\n\t- msg.sender.transfer(eth_deposed[token][msg.sender]) (tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#23)\n\tState variables written after the call(s):\n\t- eth_deposed[token][msg.sender] = 0 (tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#26)\n\t- token_deposed[token][msg.sender] = 0 (tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#27)\n", + "markdown": "Reentrancy in [Reentrancy.withdraw(address)](tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#L22-L29):\n\tExternal calls:\n\t- [require(bool)(Token(token).transfer(msg.sender,token_deposed[token][msg.sender]))](tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#L24)\n\tExternal calls sending eth:\n\t- [msg.sender.transfer(eth_deposed[token][msg.sender])](tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#L23)\n\tState variables written after the call(s):\n\t- [eth_deposed[token][msg.sender] = 0](tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#L26)\n\t- [token_deposed[token][msg.sender] = 0](tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#L27)\n", + "id": "b409436e604deed3ecb1b621a908db6ddbd69754315b41a9806919d8348391d9", + "check": "reentrancy-eth", + "impact": "High", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol b/tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol new file mode 100644 index 0000000000..935f450eef --- /dev/null +++ b/tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol @@ -0,0 +1,54 @@ +// pragma solidity ^0.5.0; + +contract Reentrancy { + mapping (address => uint) userBalance; + + function getBalance(address u) view public returns(uint){ + return userBalance[u]; + } + + function addToBalance() payable public{ + userBalance[msg.sender] += msg.value; + } + + function withdrawBalance() public{ + // send userBalance[msg.sender] ethers to msg.sender + // if mgs.sender is a contract, it will call its fallback function + (bool ret, bytes memory mem) = msg.sender.call.value(userBalance[msg.sender])(""); + if( ! ret ){ + revert(); + } + userBalance[msg.sender] = 0; + } + + function withdrawBalance_fixed() public{ + // To protect against re-entrancy, the state variable + // has to be change before the call + uint amount = userBalance[msg.sender]; + userBalance[msg.sender] = 0; + (bool ret, bytes memory mem) = msg.sender.call.value(amount)(""); + if( ! ret ){ + revert(); + } + } + + function withdrawBalance_fixed_2() public{ + // send() and transfer() are safe against reentrancy + // they do not transfer the remaining gas + // and they give just enough gas to execute few instructions + // in the fallback function (no further call possible) + msg.sender.transfer(userBalance[msg.sender]); + userBalance[msg.sender] = 0; + } + + function withdrawBalance_fixed_3() public{ + // The state can be changed + // But it is fine, as it can only occur if the transaction fails + uint amount = userBalance[msg.sender]; + userBalance[msg.sender] = 0; + (bool ret, bytes memory mem) = msg.sender.call.value(amount)(""); + if( ! ret ){ + userBalance[msg.sender] = amount; + } + } +} diff --git a/tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol.0.6.11.ReentrancyEth.json b/tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol.0.6.11.ReentrancyEth.json new file mode 100644 index 0000000000..5f5a46de62 --- /dev/null +++ b/tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol.0.6.11.ReentrancyEth.json @@ -0,0 +1,709 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "withdrawBalance", + "source_mapping": { + "start": 301, + "length": 357, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Reentrancy", + "source_mapping": { + "start": 28, + "length": 1807, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdrawBalance()" + } + }, + { + "type": "node", + "name": "(ret,mem) = msg.sender.call.value(userBalance[msg.sender])()", + "source_mapping": { + "start": 480, + "length": 81, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "is_dependency": false, + "lines": [ + 17 + ], + "starting_column": 9, + "ending_column": 90 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdrawBalance", + "source_mapping": { + "start": 301, + "length": 357, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Reentrancy", + "source_mapping": { + "start": 28, + "length": 1807, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdrawBalance()" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "userBalance[msg.sender] = 0", + "source_mapping": { + "start": 624, + "length": 27, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "is_dependency": false, + "lines": [ + 21 + ], + "starting_column": 9, + "ending_column": 36 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdrawBalance", + "source_mapping": { + "start": 301, + "length": 357, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Reentrancy", + "source_mapping": { + "start": 28, + "length": 1807, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdrawBalance()" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "userBalance" + } + } + ], + "description": "Reentrancy in Reentrancy.withdrawBalance() (tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#14-22):\n\tExternal calls:\n\t- (ret,mem) = msg.sender.call.value(userBalance[msg.sender])() (tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#17)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = 0 (tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#21)\n", + "markdown": "Reentrancy in [Reentrancy.withdrawBalance()](tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#L14-L22):\n\tExternal calls:\n\t- [(ret,mem) = msg.sender.call.value(userBalance[msg.sender])()](tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#L17)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = 0](tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#L21)\n", + "id": "703bb72dceaefd2a51f7f2f7c83443d37cebcc0b8ce4b5f6bd54e803d4c58d0d", + "check": "reentrancy-eth", + "impact": "High", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "withdrawBalance_fixed_3", + "source_mapping": { + "start": 1437, + "length": 393, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "is_dependency": false, + "lines": [ + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Reentrancy", + "source_mapping": { + "start": 28, + "length": 1807, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdrawBalance_fixed_3()" + } + }, + { + "type": "node", + "name": "(ret,mem) = msg.sender.call.value(amount)()", + "source_mapping": { + "start": 1682, + "length": 64, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "is_dependency": false, + "lines": [ + 49 + ], + "starting_column": 9, + "ending_column": 73 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdrawBalance_fixed_3", + "source_mapping": { + "start": 1437, + "length": 393, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "is_dependency": false, + "lines": [ + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Reentrancy", + "source_mapping": { + "start": 28, + "length": 1807, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdrawBalance_fixed_3()" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "userBalance[msg.sender] = amount", + "source_mapping": { + "start": 1781, + "length": 32, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "is_dependency": false, + "lines": [ + 51 + ], + "starting_column": 13, + "ending_column": 45 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdrawBalance_fixed_3", + "source_mapping": { + "start": 1437, + "length": 393, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "is_dependency": false, + "lines": [ + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Reentrancy", + "source_mapping": { + "start": 28, + "length": 1807, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdrawBalance_fixed_3()" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "userBalance" + } + } + ], + "description": "Reentrancy in Reentrancy.withdrawBalance_fixed_3() (tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#44-53):\n\tExternal calls:\n\t- (ret,mem) = msg.sender.call.value(amount)() (tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#49)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = amount (tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#51)\n", + "markdown": "Reentrancy in [Reentrancy.withdrawBalance_fixed_3()](tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#L44-L53):\n\tExternal calls:\n\t- [(ret,mem) = msg.sender.call.value(amount)()](tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#L49)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = amount](tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol#L51)\n", + "id": "9d69f38d42306f0c57969c0e57d606c4bbd636e4deae55b630b247299f7afa49", + "check": "reentrancy-eth", + "impact": "High", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol b/tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol new file mode 100644 index 0000000000..d1067e362f --- /dev/null +++ b/tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol @@ -0,0 +1,31 @@ +// pragma solidity ^0.4.24; + +abstract contract Token{ + function transfer(address to, uint value) public virtual returns(bool); + function transferFrom(address from, address to, uint value) public virtual returns(bool); +} + +contract Reentrancy { + + mapping(address => mapping(address => uint)) eth_deposed; + mapping(address => mapping(address => uint)) token_deposed; + + function deposit_eth(address token) public payable{ + eth_deposed[token][msg.sender] += msg.value; + } + + function deposit_token(address token, uint value) public { + token_deposed[token][msg.sender] += value; + require(Token(token).transferFrom(msg.sender, address(this), value)); + } + + function withdraw(address token) public { + msg.sender.transfer(eth_deposed[token][msg.sender]); + require(Token(token).transfer(msg.sender, token_deposed[token][msg.sender])); + + eth_deposed[token][msg.sender] = 0; + token_deposed[token][msg.sender] = 0; + + } + +} diff --git a/tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol.0.6.11.ReentrancyEth.json b/tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol.0.6.11.ReentrancyEth.json new file mode 100644 index 0000000000..fb6b38b4ad --- /dev/null +++ b/tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol.0.6.11.ReentrancyEth.json @@ -0,0 +1,453 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "withdraw", + "source_mapping": { + "start": 696, + "length": 286, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Reentrancy", + "source_mapping": { + "start": 227, + "length": 758, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdraw(address)" + } + }, + { + "type": "node", + "name": "require(bool)(Token(token).transfer(msg.sender,token_deposed[token][msg.sender]))", + "source_mapping": { + "start": 807, + "length": 76, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 24 + ], + "starting_column": 9, + "ending_column": 85 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdraw", + "source_mapping": { + "start": 696, + "length": 286, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Reentrancy", + "source_mapping": { + "start": 227, + "length": 758, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdraw(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "msg.sender.transfer(eth_deposed[token][msg.sender])", + "source_mapping": { + "start": 746, + "length": 51, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 23 + ], + "starting_column": 9, + "ending_column": 60 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdraw", + "source_mapping": { + "start": 696, + "length": 286, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Reentrancy", + "source_mapping": { + "start": 227, + "length": 758, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdraw(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "eth_deposed[token][msg.sender] = 0", + "source_mapping": { + "start": 894, + "length": 34, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 26 + ], + "starting_column": 9, + "ending_column": 43 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdraw", + "source_mapping": { + "start": 696, + "length": 286, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Reentrancy", + "source_mapping": { + "start": 227, + "length": 758, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdraw(address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "eth_deposed" + } + }, + { + "type": "node", + "name": "token_deposed[token][msg.sender] = 0", + "source_mapping": { + "start": 938, + "length": 36, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 27 + ], + "starting_column": 9, + "ending_column": 45 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdraw", + "source_mapping": { + "start": 696, + "length": 286, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Reentrancy", + "source_mapping": { + "start": 227, + "length": 758, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdraw(address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "token_deposed" + } + } + ], + "description": "Reentrancy in Reentrancy.withdraw(address) (tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol#22-29):\n\tExternal calls:\n\t- require(bool)(Token(token).transfer(msg.sender,token_deposed[token][msg.sender])) (tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol#24)\n\tExternal calls sending eth:\n\t- msg.sender.transfer(eth_deposed[token][msg.sender]) (tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol#23)\n\tState variables written after the call(s):\n\t- eth_deposed[token][msg.sender] = 0 (tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol#26)\n\t- token_deposed[token][msg.sender] = 0 (tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol#27)\n", + "markdown": "Reentrancy in [Reentrancy.withdraw(address)](tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol#L22-L29):\n\tExternal calls:\n\t- [require(bool)(Token(token).transfer(msg.sender,token_deposed[token][msg.sender]))](tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol#L24)\n\tExternal calls sending eth:\n\t- [msg.sender.transfer(eth_deposed[token][msg.sender])](tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol#L23)\n\tState variables written after the call(s):\n\t- [eth_deposed[token][msg.sender] = 0](tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol#L26)\n\t- [token_deposed[token][msg.sender] = 0](tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol#L27)\n", + "id": "592ad3a6f86cbf4b9e9e1c21c6345d8616f0e6e8a85c7e9ab283b5b0a1271c71", + "check": "reentrancy-eth", + "impact": "High", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol b/tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol new file mode 100644 index 0000000000..5e86bf9bef --- /dev/null +++ b/tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol @@ -0,0 +1,54 @@ +// pragma solidity ^0.5.0; + +contract Reentrancy { + mapping (address => uint) userBalance; + + function getBalance(address u) view public returns(uint){ + return userBalance[u]; + } + + function addToBalance() payable public{ + userBalance[msg.sender] += msg.value; + } + + function withdrawBalance() public{ + // send userBalance[msg.sender] ethers to msg.sender + // if mgs.sender is a contract, it will call its fallback function + (bool ret, bytes memory mem) = msg.sender.call{value:userBalance[msg.sender]}(""); + if( ! ret ){ + revert(); + } + userBalance[msg.sender] = 0; + } + + function withdrawBalance_fixed() public{ + // To protect against re-entrancy, the state variable + // has to be change before the call + uint amount = userBalance[msg.sender]; + userBalance[msg.sender] = 0; + (bool ret, bytes memory mem) = msg.sender.call{value:amount}(""); + if( ! ret ){ + revert(); + } + } + + function withdrawBalance_fixed_2() public{ + // send() and transfer() are safe against reentrancy + // they do not transfer the remaining gas + // and they give just enough gas to execute few instructions + // in the fallback function (no further call possible) + msg.sender.transfer(userBalance[msg.sender]); + userBalance[msg.sender] = 0; + } + + function withdrawBalance_fixed_3() public{ + // The state can be changed + // But it is fine, as it can only occur if the transaction fails + uint amount = userBalance[msg.sender]; + userBalance[msg.sender] = 0; + (bool ret, bytes memory mem) = msg.sender.call{value:amount}(""); + if( ! ret ){ + userBalance[msg.sender] = amount; + } + } +} diff --git a/tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol.0.7.6.ReentrancyEth.json b/tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol.0.7.6.ReentrancyEth.json new file mode 100644 index 0000000000..c129cc8f8f --- /dev/null +++ b/tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol.0.7.6.ReentrancyEth.json @@ -0,0 +1,709 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "withdrawBalance", + "source_mapping": { + "start": 301, + "length": 357, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Reentrancy", + "source_mapping": { + "start": 28, + "length": 1807, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdrawBalance()" + } + }, + { + "type": "node", + "name": "(ret,mem) = msg.sender.call{value: userBalance[msg.sender]}()", + "source_mapping": { + "start": 480, + "length": 81, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "is_dependency": false, + "lines": [ + 17 + ], + "starting_column": 9, + "ending_column": 90 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdrawBalance", + "source_mapping": { + "start": 301, + "length": 357, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Reentrancy", + "source_mapping": { + "start": 28, + "length": 1807, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdrawBalance()" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "userBalance[msg.sender] = 0", + "source_mapping": { + "start": 624, + "length": 27, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "is_dependency": false, + "lines": [ + 21 + ], + "starting_column": 9, + "ending_column": 36 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdrawBalance", + "source_mapping": { + "start": 301, + "length": 357, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Reentrancy", + "source_mapping": { + "start": 28, + "length": 1807, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdrawBalance()" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "userBalance" + } + } + ], + "description": "Reentrancy in Reentrancy.withdrawBalance() (tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#14-22):\n\tExternal calls:\n\t- (ret,mem) = msg.sender.call{value: userBalance[msg.sender]}() (tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#17)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = 0 (tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#21)\n", + "markdown": "Reentrancy in [Reentrancy.withdrawBalance()](tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#L14-L22):\n\tExternal calls:\n\t- [(ret,mem) = msg.sender.call{value: userBalance[msg.sender]}()](tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#L17)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = 0](tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#L21)\n", + "id": "4080e36d35513345b756c6f8d09f2b1238c4553d4b38793d44fe99895e546709", + "check": "reentrancy-eth", + "impact": "High", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "withdrawBalance_fixed_3", + "source_mapping": { + "start": 1437, + "length": 393, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "is_dependency": false, + "lines": [ + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Reentrancy", + "source_mapping": { + "start": 28, + "length": 1807, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdrawBalance_fixed_3()" + } + }, + { + "type": "node", + "name": "(ret,mem) = msg.sender.call{value: amount}()", + "source_mapping": { + "start": 1682, + "length": 64, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "is_dependency": false, + "lines": [ + 49 + ], + "starting_column": 9, + "ending_column": 73 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdrawBalance_fixed_3", + "source_mapping": { + "start": 1437, + "length": 393, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "is_dependency": false, + "lines": [ + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Reentrancy", + "source_mapping": { + "start": 28, + "length": 1807, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdrawBalance_fixed_3()" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "userBalance[msg.sender] = amount", + "source_mapping": { + "start": 1781, + "length": 32, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "is_dependency": false, + "lines": [ + 51 + ], + "starting_column": 13, + "ending_column": 45 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdrawBalance_fixed_3", + "source_mapping": { + "start": 1437, + "length": 393, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "is_dependency": false, + "lines": [ + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Reentrancy", + "source_mapping": { + "start": 28, + "length": 1807, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdrawBalance_fixed_3()" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "userBalance" + } + } + ], + "description": "Reentrancy in Reentrancy.withdrawBalance_fixed_3() (tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#44-53):\n\tExternal calls:\n\t- (ret,mem) = msg.sender.call{value: amount}() (tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#49)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = amount (tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#51)\n", + "markdown": "Reentrancy in [Reentrancy.withdrawBalance_fixed_3()](tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#L44-L53):\n\tExternal calls:\n\t- [(ret,mem) = msg.sender.call{value: amount}()](tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#L49)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = amount](tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol#L51)\n", + "id": "748ed9bcfb9b4a29525eb6514dfff59da6436c7d70a9706d335f71a15ab31620", + "check": "reentrancy-eth", + "impact": "High", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol b/tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol new file mode 100644 index 0000000000..d1067e362f --- /dev/null +++ b/tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol @@ -0,0 +1,31 @@ +// pragma solidity ^0.4.24; + +abstract contract Token{ + function transfer(address to, uint value) public virtual returns(bool); + function transferFrom(address from, address to, uint value) public virtual returns(bool); +} + +contract Reentrancy { + + mapping(address => mapping(address => uint)) eth_deposed; + mapping(address => mapping(address => uint)) token_deposed; + + function deposit_eth(address token) public payable{ + eth_deposed[token][msg.sender] += msg.value; + } + + function deposit_token(address token, uint value) public { + token_deposed[token][msg.sender] += value; + require(Token(token).transferFrom(msg.sender, address(this), value)); + } + + function withdraw(address token) public { + msg.sender.transfer(eth_deposed[token][msg.sender]); + require(Token(token).transfer(msg.sender, token_deposed[token][msg.sender])); + + eth_deposed[token][msg.sender] = 0; + token_deposed[token][msg.sender] = 0; + + } + +} diff --git a/tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol.0.7.6.ReentrancyEth.json b/tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol.0.7.6.ReentrancyEth.json new file mode 100644 index 0000000000..a6cc29bf1f --- /dev/null +++ b/tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol.0.7.6.ReentrancyEth.json @@ -0,0 +1,453 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "withdraw", + "source_mapping": { + "start": 696, + "length": 286, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Reentrancy", + "source_mapping": { + "start": 227, + "length": 758, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdraw(address)" + } + }, + { + "type": "node", + "name": "require(bool)(Token(token).transfer(msg.sender,token_deposed[token][msg.sender]))", + "source_mapping": { + "start": 807, + "length": 76, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 24 + ], + "starting_column": 9, + "ending_column": 85 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdraw", + "source_mapping": { + "start": 696, + "length": 286, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Reentrancy", + "source_mapping": { + "start": 227, + "length": 758, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdraw(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "msg.sender.transfer(eth_deposed[token][msg.sender])", + "source_mapping": { + "start": 746, + "length": 51, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 23 + ], + "starting_column": 9, + "ending_column": 60 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdraw", + "source_mapping": { + "start": 696, + "length": 286, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Reentrancy", + "source_mapping": { + "start": 227, + "length": 758, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdraw(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "eth_deposed[token][msg.sender] = 0", + "source_mapping": { + "start": 894, + "length": 34, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 26 + ], + "starting_column": 9, + "ending_column": 43 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdraw", + "source_mapping": { + "start": 696, + "length": 286, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Reentrancy", + "source_mapping": { + "start": 227, + "length": 758, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdraw(address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "eth_deposed" + } + }, + { + "type": "node", + "name": "token_deposed[token][msg.sender] = 0", + "source_mapping": { + "start": 938, + "length": 36, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 27 + ], + "starting_column": 9, + "ending_column": 45 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdraw", + "source_mapping": { + "start": 696, + "length": 286, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Reentrancy", + "source_mapping": { + "start": 227, + "length": 758, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdraw(address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "token_deposed" + } + } + ], + "description": "Reentrancy in Reentrancy.withdraw(address) (tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol#22-29):\n\tExternal calls:\n\t- require(bool)(Token(token).transfer(msg.sender,token_deposed[token][msg.sender])) (tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol#24)\n\tExternal calls sending eth:\n\t- msg.sender.transfer(eth_deposed[token][msg.sender]) (tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol#23)\n\tState variables written after the call(s):\n\t- eth_deposed[token][msg.sender] = 0 (tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol#26)\n\t- token_deposed[token][msg.sender] = 0 (tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol#27)\n", + "markdown": "Reentrancy in [Reentrancy.withdraw(address)](tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol#L22-L29):\n\tExternal calls:\n\t- [require(bool)(Token(token).transfer(msg.sender,token_deposed[token][msg.sender]))](tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol#L24)\n\tExternal calls sending eth:\n\t- [msg.sender.transfer(eth_deposed[token][msg.sender])](tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol#L23)\n\tState variables written after the call(s):\n\t- [eth_deposed[token][msg.sender] = 0](tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol#L26)\n\t- [token_deposed[token][msg.sender] = 0](tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol#L27)\n", + "id": "24fc47678720105e363d9594b5bcec35f854903103c3c4a4ca82d9b4fb5348c3", + "check": "reentrancy-eth", + "impact": "High", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol b/tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol similarity index 100% rename from tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol rename to tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol diff --git a/tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol.0.5.16.ReentrancyEvent.json b/tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol.0.5.16.ReentrancyEvent.json new file mode 100644 index 0000000000..1fec87de0c --- /dev/null +++ b/tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol.0.5.16.ReentrancyEvent.json @@ -0,0 +1,225 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bug", + "source_mapping": { + "start": 86, + "length": 68, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 51, + "length": 193, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bug(C)" + } + }, + { + "type": "node", + "name": "c.f()", + "source_mapping": { + "start": 120, + "length": 5, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol", + "is_dependency": false, + "lines": [ + 15 + ], + "starting_column": 9, + "ending_column": 14 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bug", + "source_mapping": { + "start": 86, + "length": 68, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 51, + "length": 193, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bug(C)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "E()", + "source_mapping": { + "start": 135, + "length": 8, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol", + "is_dependency": false, + "lines": [ + 16 + ], + "starting_column": 9, + "ending_column": 17 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bug", + "source_mapping": { + "start": 86, + "length": 68, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 51, + "length": 193, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bug(C)" + } + } + }, + "additional_fields": { + "underlying_type": "event" + } + } + ], + "description": "Reentrancy in Test.bug(C) (tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol#14-17):\n\tExternal calls:\n\t- c.f() (tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol#15)\n\tEvent emitted after the call(s):\n\t- E() (tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol#16)\n", + "markdown": "Reentrancy in [Test.bug(C)](tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol#L14-L17):\n\tExternal calls:\n\t- [c.f()](tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol#L15)\n\tEvent emitted after the call(s):\n\t- [E()](tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol#L16)\n", + "id": "314eb87452ecb57911a225bbbd538d33f9204518026249a12410e19413554727", + "check": "reentrancy-events", + "impact": "Low", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol b/tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol new file mode 100644 index 0000000000..f67409d457 --- /dev/null +++ b/tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol @@ -0,0 +1,24 @@ +contract C{ + + + function f() public{ + + } + +} + + +contract Test{ + event E(); + + function bug(C c) public{ + c.f(); + emit E(); + } + + function ok(C c) public{ + emit E(); + c.f(); + c.f(); + } +} diff --git a/tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol.0.6.11.ReentrancyEvent.json b/tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol.0.6.11.ReentrancyEvent.json new file mode 100644 index 0000000000..77cec19d01 --- /dev/null +++ b/tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol.0.6.11.ReentrancyEvent.json @@ -0,0 +1,225 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bug", + "source_mapping": { + "start": 86, + "length": 68, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 51, + "length": 193, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bug(C)" + } + }, + { + "type": "node", + "name": "c.f()", + "source_mapping": { + "start": 120, + "length": 5, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol", + "is_dependency": false, + "lines": [ + 15 + ], + "starting_column": 9, + "ending_column": 14 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bug", + "source_mapping": { + "start": 86, + "length": 68, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 51, + "length": 193, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bug(C)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "E()", + "source_mapping": { + "start": 135, + "length": 8, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol", + "is_dependency": false, + "lines": [ + 16 + ], + "starting_column": 9, + "ending_column": 17 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bug", + "source_mapping": { + "start": 86, + "length": 68, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 51, + "length": 193, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bug(C)" + } + } + }, + "additional_fields": { + "underlying_type": "event" + } + } + ], + "description": "Reentrancy in Test.bug(C) (tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol#14-17):\n\tExternal calls:\n\t- c.f() (tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol#15)\n\tEvent emitted after the call(s):\n\t- E() (tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol#16)\n", + "markdown": "Reentrancy in [Test.bug(C)](tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol#L14-L17):\n\tExternal calls:\n\t- [c.f()](tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol#L15)\n\tEvent emitted after the call(s):\n\t- [E()](tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol#L16)\n", + "id": "1f754abe7a9cadfa9e0ea549a49219ba95c55bb5eaf79698de27f0fa460eb0f2", + "check": "reentrancy-events", + "impact": "Low", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol b/tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol new file mode 100644 index 0000000000..f67409d457 --- /dev/null +++ b/tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol @@ -0,0 +1,24 @@ +contract C{ + + + function f() public{ + + } + +} + + +contract Test{ + event E(); + + function bug(C c) public{ + c.f(); + emit E(); + } + + function ok(C c) public{ + emit E(); + c.f(); + c.f(); + } +} diff --git a/tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol.0.5.1.ReentrancyEvent.json b/tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol.0.7.6.ReentrancyEvent.json similarity index 87% rename from tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol.0.5.1.ReentrancyEvent.json rename to tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol.0.7.6.ReentrancyEvent.json index 0d9a917678..b13b488d8d 100644 --- a/tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol.0.5.1.ReentrancyEvent.json +++ b/tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol.0.7.6.ReentrancyEvent.json @@ -9,9 +9,9 @@ "start": 86, "length": 68, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol", + "filename_relative": "tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol", + "filename_short": "tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol", "is_dependency": false, "lines": [ 14, @@ -30,9 +30,9 @@ "start": 51, "length": 193, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol", + "filename_relative": "tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol", + "filename_short": "tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol", "is_dependency": false, "lines": [ 11, @@ -64,9 +64,9 @@ "start": 120, "length": 5, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol", + "filename_relative": "tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol", + "filename_short": "tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol", "is_dependency": false, "lines": [ 15 @@ -82,9 +82,9 @@ "start": 86, "length": 68, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol", + "filename_relative": "tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol", + "filename_short": "tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol", "is_dependency": false, "lines": [ 14, @@ -103,9 +103,9 @@ "start": 51, "length": 193, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol", + "filename_relative": "tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol", + "filename_short": "tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol", "is_dependency": false, "lines": [ 11, @@ -142,9 +142,9 @@ "start": 135, "length": 8, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol", + "filename_relative": "tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol", + "filename_short": "tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol", "is_dependency": false, "lines": [ 16 @@ -160,9 +160,9 @@ "start": 86, "length": 68, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol", + "filename_relative": "tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol", + "filename_short": "tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol", "is_dependency": false, "lines": [ 14, @@ -181,9 +181,9 @@ "start": 51, "length": 193, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol", + "filename_relative": "tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol", + "filename_short": "tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol", "is_dependency": false, "lines": [ 11, @@ -214,9 +214,9 @@ } } ], - "description": "Reentrancy in Test.bug(C) (tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol#14-17):\n\tExternal calls:\n\t- c.f() (tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol#15)\n\tEvent emitted after the call(s):\n\t- E() (tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol#16)\n", - "markdown": "Reentrancy in [Test.bug(C)](tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol#L14-L17):\n\tExternal calls:\n\t- [c.f()](tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol#L15)\n\tEvent emitted after the call(s):\n\t- [E()](tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol#L16)\n", - "id": "8b509fb9b9264baf213e2f3959b4d88d285f4591752f1cfbf0eb3c2da13e0e3e", + "description": "Reentrancy in Test.bug(C) (tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol#14-17):\n\tExternal calls:\n\t- c.f() (tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol#15)\n\tEvent emitted after the call(s):\n\t- E() (tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol#16)\n", + "markdown": "Reentrancy in [Test.bug(C)](tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol#L14-L17):\n\tExternal calls:\n\t- [c.f()](tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol#L15)\n\tEvent emitted after the call(s):\n\t- [E()](tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol#L16)\n", + "id": "959396e18ec2c541dcb7c9e9f318504e794922dd6f48ffd9885d11289b5f83ba", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" diff --git a/tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol b/tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol new file mode 100644 index 0000000000..e38d4f9ac0 --- /dev/null +++ b/tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol @@ -0,0 +1,37 @@ +contract A{ + uint num = 5; + function A(uint x) public{ + num += x; + } +} + +contract B is A{ + function B(uint y) A(y * 3) public{ + + } +} + +contract C is B{ + function C(uint y) A(y * 2) public{ + + } +} + +contract D is B(1), C(1) { + function D() B(3) C(2) public { + + } +} + +contract E is B(1), C, D() { + function E() B(1) C(2) D() public { + + } +} + + +contract F is B { + function F() A(1) public { + + } +} \ No newline at end of file diff --git a/tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol.0.4.21.ReusedBaseConstructor.json b/tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol.0.4.21.ReusedBaseConstructor.json new file mode 100644 index 0000000000..07cca3f028 --- /dev/null +++ b/tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol.0.4.21.ReusedBaseConstructor.json @@ -0,0 +1,736 @@ +[ + [ + { + "elements": [ + { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 155, + "length": 65, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "A", + "source_mapping": { + "start": 34, + "length": 50, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 0, + "length": 86, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "A(uint256)" + } + }, + { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 155, + "length": 65, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "contract", + "name": "B", + "source_mapping": { + "start": 88, + "length": 65, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12 + ], + "starting_column": 1, + "ending_column": 2 + } + } + ], + "description": "C (tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#14-18) gives base constructor A.A(uint256) (tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#3-5) arguments more than once in inheritance hierarchy:\n\t- From C (tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#14-18) constructor definition\n\t- From B (tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#8-12) constructor definition\n", + "markdown": "[C](tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#L14-L18) gives base constructor [A.A(uint256)](tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#L3-L5) arguments more than once in inheritance hierarchy:\n\t- From [C](tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#L14-L18) constructor definition\n\t- From [B](tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#L8-L12) constructor definition\n", + "id": "d2847fcb309e0ee45dfb303bf749123bbebee692a080ae6a718a76ef785ae8d2", + "check": "reused-constructor", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "contract", + "name": "D", + "source_mapping": { + "start": 222, + "length": 71, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 20, + 21, + 22, + 23, + 24 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "A", + "source_mapping": { + "start": 34, + "length": 50, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 0, + "length": 86, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "A(uint256)" + } + }, + { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 155, + "length": 65, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "contract", + "name": "B", + "source_mapping": { + "start": 88, + "length": 65, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12 + ], + "starting_column": 1, + "ending_column": 2 + } + } + ], + "description": "D (tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#20-24) gives base constructor A.A(uint256) (tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#3-5) arguments more than once in inheritance hierarchy:\n\t- From C (tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#14-18) constructor definition\n\t- From B (tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#8-12) constructor definition\n", + "markdown": "[D](tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#L20-L24) gives base constructor [A.A(uint256)](tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#L3-L5) arguments more than once in inheritance hierarchy:\n\t- From [C](tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#L14-L18) constructor definition\n\t- From [B](tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#L8-L12) constructor definition\n", + "id": "7436d3215ee6260f9a4b2f4697fa242225ad3f10e30bfbd162679a5e3fa48f10", + "check": "reused-constructor", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "contract", + "name": "E", + "source_mapping": { + "start": 295, + "length": 77, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "B", + "source_mapping": { + "start": 109, + "length": 42, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "B", + "source_mapping": { + "start": 88, + "length": 65, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "B(uint256)" + } + }, + { + "type": "contract", + "name": "E", + "source_mapping": { + "start": 295, + "length": 77, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "contract", + "name": "D", + "source_mapping": { + "start": 222, + "length": 71, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 20, + 21, + 22, + 23, + 24 + ], + "starting_column": 1, + "ending_column": 2 + } + } + ], + "description": "E (tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#26-30) gives base constructor B.B(uint256) (tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#9-11) arguments more than once in inheritance hierarchy:\n\t- From E (tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#26-30) constructor definition\n\t- From D (tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#20-24) constructor definition\n", + "markdown": "[E](tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#L26-L30) gives base constructor [B.B(uint256)](tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#L9-L11) arguments more than once in inheritance hierarchy:\n\t- From [E](tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#L26-L30) constructor definition\n\t- From [D](tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#L20-L24) constructor definition\n", + "id": "e79d62c434ba85788dd5087e4994bb136be6b9e8a55e8057b0e30c9b0436abdc", + "check": "reused-constructor", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "contract", + "name": "E", + "source_mapping": { + "start": 295, + "length": 77, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "C", + "source_mapping": { + "start": 176, + "length": 42, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 15, + 16, + 17 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 155, + "length": 65, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "C(uint256)" + } + }, + { + "type": "contract", + "name": "E", + "source_mapping": { + "start": 295, + "length": 77, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "contract", + "name": "D", + "source_mapping": { + "start": 222, + "length": 71, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 20, + 21, + 22, + 23, + 24 + ], + "starting_column": 1, + "ending_column": 2 + } + } + ], + "description": "E (tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#26-30) gives base constructor C.C(uint256) (tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#15-17) arguments more than once in inheritance hierarchy:\n\t- From E (tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#26-30) constructor definition\n\t- From D (tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#20-24) constructor definition\n", + "markdown": "[E](tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#L26-L30) gives base constructor [C.C(uint256)](tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#L15-L17) arguments more than once in inheritance hierarchy:\n\t- From [E](tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#L26-L30) constructor definition\n\t- From [D](tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#L20-L24) constructor definition\n", + "id": "085dceba8f0b37580e72952eafe1368bf0d09f10c2f44c0b6ff53ad7e72f92b1", + "check": "reused-constructor", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "contract", + "name": "E", + "source_mapping": { + "start": 295, + "length": 77, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "A", + "source_mapping": { + "start": 34, + "length": 50, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 0, + "length": 86, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "A(uint256)" + } + }, + { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 155, + "length": 65, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "contract", + "name": "B", + "source_mapping": { + "start": 88, + "length": 65, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12 + ], + "starting_column": 1, + "ending_column": 2 + } + } + ], + "description": "E (tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#26-30) gives base constructor A.A(uint256) (tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#3-5) arguments more than once in inheritance hierarchy:\n\t- From C (tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#14-18) constructor definition\n\t- From B (tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#8-12) constructor definition\n", + "markdown": "[E](tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#L26-L30) gives base constructor [A.A(uint256)](tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#L3-L5) arguments more than once in inheritance hierarchy:\n\t- From [C](tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#L14-L18) constructor definition\n\t- From [B](tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#L8-L12) constructor definition\n", + "id": "14d6bffb3f1849cfebb7156cb797315fd01ac83911a1261650f702792f4db830", + "check": "reused-constructor", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "contract", + "name": "F", + "source_mapping": { + "start": 375, + "length": 57, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 33, + 34, + 35, + 36, + 37, + 38 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + { + "type": "function", + "name": "A", + "source_mapping": { + "start": 34, + "length": 50, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 0, + "length": 86, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "A(uint256)" + } + }, + { + "type": "contract", + "name": "F", + "source_mapping": { + "start": 375, + "length": 57, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 33, + 34, + 35, + 36, + 37, + 38 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + { + "type": "contract", + "name": "B", + "source_mapping": { + "start": 88, + "length": 65, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12 + ], + "starting_column": 1, + "ending_column": 2 + } + } + ], + "description": "F (tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#33-38) gives base constructor A.A(uint256) (tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#3-5) arguments more than once in inheritance hierarchy:\n\t- From F (tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#33-38) constructor definition\n\t- From B (tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#8-12) constructor definition\n", + "markdown": "[F](tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#L33-L38) gives base constructor [A.A(uint256)](tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#L3-L5) arguments more than once in inheritance hierarchy:\n\t- From [F](tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#L33-L38) constructor definition\n\t- From [B](tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol#L8-L12) constructor definition\n", + "id": "71e08d0e5c44bbc2671e014018a6333bd92db7380a85732bf2d17aa5500f6434", + "check": "reused-constructor", + "impact": "Medium", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/reused-constructor/reused_base_constructor.sol b/tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol similarity index 100% rename from tests/detectors/reused-constructor/reused_base_constructor.sol rename to tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol diff --git a/tests/detectors/reused-constructor/reused_base_constructor.sol.0.4.25.ReusedBaseConstructor.json b/tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol.0.4.25.ReusedBaseConstructor.json similarity index 77% rename from tests/detectors/reused-constructor/reused_base_constructor.sol.0.4.25.ReusedBaseConstructor.json rename to tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol.0.4.25.ReusedBaseConstructor.json index 078cbc3b5b..8426a26469 100644 --- a/tests/detectors/reused-constructor/reused_base_constructor.sol.0.4.25.ReusedBaseConstructor.json +++ b/tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol.0.4.25.ReusedBaseConstructor.json @@ -9,9 +9,9 @@ "start": 157, "length": 66, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 14, @@ -31,9 +31,9 @@ "start": 34, "length": 51, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 3, @@ -51,9 +51,9 @@ "start": 0, "length": 87, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 1, @@ -77,9 +77,9 @@ "start": 157, "length": 66, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 14, @@ -99,9 +99,9 @@ "start": 89, "length": 66, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 8, @@ -115,8 +115,8 @@ } } ], - "description": "C (tests/detectors/reused-constructor/reused_base_constructor.sol#14-18) gives base constructor A.constructor(uint256) (tests/detectors/reused-constructor/reused_base_constructor.sol#3-5) arguments more than once in inheritance hierarchy:\n\t- From C (tests/detectors/reused-constructor/reused_base_constructor.sol#14-18) constructor definition\n\t- From B (tests/detectors/reused-constructor/reused_base_constructor.sol#8-12) constructor definition\n", - "markdown": "[C](tests/detectors/reused-constructor/reused_base_constructor.sol#L14-L18) gives base constructor [A.constructor(uint256)](tests/detectors/reused-constructor/reused_base_constructor.sol#L3-L5) arguments more than once in inheritance hierarchy:\n\t- From [C](tests/detectors/reused-constructor/reused_base_constructor.sol#L14-L18) constructor definition\n\t- From [B](tests/detectors/reused-constructor/reused_base_constructor.sol#L8-L12) constructor definition\n", + "description": "C (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#14-18) gives base constructor A.constructor(uint256) (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#3-5) arguments more than once in inheritance hierarchy:\n\t- From C (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#14-18) constructor definition\n\t- From B (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#8-12) constructor definition\n", + "markdown": "[C](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L14-L18) gives base constructor [A.constructor(uint256)](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L3-L5) arguments more than once in inheritance hierarchy:\n\t- From [C](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L14-L18) constructor definition\n\t- From [B](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L8-L12) constructor definition\n", "id": "2d9d2b1b6d2540f86fd909f9766e128da573e659f40a50835cc9adef3c4dbee8", "check": "reused-constructor", "impact": "Medium", @@ -131,9 +131,9 @@ "start": 225, "length": 72, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 20, @@ -153,9 +153,9 @@ "start": 110, "length": 43, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 9, @@ -173,9 +173,9 @@ "start": 89, "length": 66, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 8, @@ -198,9 +198,9 @@ "start": 225, "length": 72, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 20, @@ -220,9 +220,9 @@ "start": 225, "length": 72, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 20, @@ -236,8 +236,8 @@ } } ], - "description": "D (tests/detectors/reused-constructor/reused_base_constructor.sol#20-24) gives base constructor B.constructor(uint256) (tests/detectors/reused-constructor/reused_base_constructor.sol#9-11) arguments more than once in inheritance hierarchy:\n\t- From D (tests/detectors/reused-constructor/reused_base_constructor.sol#20-24) contract definition\n\t- From D (tests/detectors/reused-constructor/reused_base_constructor.sol#20-24) constructor definition\n", - "markdown": "[D](tests/detectors/reused-constructor/reused_base_constructor.sol#L20-L24) gives base constructor [B.constructor(uint256)](tests/detectors/reused-constructor/reused_base_constructor.sol#L9-L11) arguments more than once in inheritance hierarchy:\n\t- From [D](tests/detectors/reused-constructor/reused_base_constructor.sol#L20-L24) contract definition\n\t- From [D](tests/detectors/reused-constructor/reused_base_constructor.sol#L20-L24) constructor definition\n", + "description": "D (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#20-24) gives base constructor B.constructor(uint256) (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#9-11) arguments more than once in inheritance hierarchy:\n\t- From D (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#20-24) contract definition\n\t- From D (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#20-24) constructor definition\n", + "markdown": "[D](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L20-L24) gives base constructor [B.constructor(uint256)](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L9-L11) arguments more than once in inheritance hierarchy:\n\t- From [D](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L20-L24) contract definition\n\t- From [D](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L20-L24) constructor definition\n", "id": "5f3b188e7d6c737684f829c3fde96f739cd502b4aba8f3f6e3ceab7decffa618", "check": "reused-constructor", "impact": "Medium", @@ -252,9 +252,9 @@ "start": 225, "length": 72, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 20, @@ -274,9 +274,9 @@ "start": 178, "length": 43, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 15, @@ -294,9 +294,9 @@ "start": 157, "length": 66, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 14, @@ -319,9 +319,9 @@ "start": 225, "length": 72, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 20, @@ -341,9 +341,9 @@ "start": 225, "length": 72, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 20, @@ -357,8 +357,8 @@ } } ], - "description": "D (tests/detectors/reused-constructor/reused_base_constructor.sol#20-24) gives base constructor C.constructor(uint256) (tests/detectors/reused-constructor/reused_base_constructor.sol#15-17) arguments more than once in inheritance hierarchy:\n\t- From D (tests/detectors/reused-constructor/reused_base_constructor.sol#20-24) contract definition\n\t- From D (tests/detectors/reused-constructor/reused_base_constructor.sol#20-24) constructor definition\n", - "markdown": "[D](tests/detectors/reused-constructor/reused_base_constructor.sol#L20-L24) gives base constructor [C.constructor(uint256)](tests/detectors/reused-constructor/reused_base_constructor.sol#L15-L17) arguments more than once in inheritance hierarchy:\n\t- From [D](tests/detectors/reused-constructor/reused_base_constructor.sol#L20-L24) contract definition\n\t- From [D](tests/detectors/reused-constructor/reused_base_constructor.sol#L20-L24) constructor definition\n", + "description": "D (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#20-24) gives base constructor C.constructor(uint256) (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#15-17) arguments more than once in inheritance hierarchy:\n\t- From D (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#20-24) contract definition\n\t- From D (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#20-24) constructor definition\n", + "markdown": "[D](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L20-L24) gives base constructor [C.constructor(uint256)](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L15-L17) arguments more than once in inheritance hierarchy:\n\t- From [D](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L20-L24) contract definition\n\t- From [D](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L20-L24) constructor definition\n", "id": "b579da8996b6a1a35169bcae74ad8126c68fb0a1819d3977cea3e0e295ff2d5c", "check": "reused-constructor", "impact": "Medium", @@ -373,9 +373,9 @@ "start": 225, "length": 72, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 20, @@ -395,9 +395,9 @@ "start": 34, "length": 51, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 3, @@ -415,9 +415,9 @@ "start": 0, "length": 87, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 1, @@ -441,9 +441,9 @@ "start": 157, "length": 66, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 14, @@ -463,9 +463,9 @@ "start": 89, "length": 66, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 8, @@ -479,8 +479,8 @@ } } ], - "description": "D (tests/detectors/reused-constructor/reused_base_constructor.sol#20-24) gives base constructor A.constructor(uint256) (tests/detectors/reused-constructor/reused_base_constructor.sol#3-5) arguments more than once in inheritance hierarchy:\n\t- From C (tests/detectors/reused-constructor/reused_base_constructor.sol#14-18) constructor definition\n\t- From B (tests/detectors/reused-constructor/reused_base_constructor.sol#8-12) constructor definition\n", - "markdown": "[D](tests/detectors/reused-constructor/reused_base_constructor.sol#L20-L24) gives base constructor [A.constructor(uint256)](tests/detectors/reused-constructor/reused_base_constructor.sol#L3-L5) arguments more than once in inheritance hierarchy:\n\t- From [C](tests/detectors/reused-constructor/reused_base_constructor.sol#L14-L18) constructor definition\n\t- From [B](tests/detectors/reused-constructor/reused_base_constructor.sol#L8-L12) constructor definition\n", + "description": "D (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#20-24) gives base constructor A.constructor(uint256) (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#3-5) arguments more than once in inheritance hierarchy:\n\t- From C (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#14-18) constructor definition\n\t- From B (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#8-12) constructor definition\n", + "markdown": "[D](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L20-L24) gives base constructor [A.constructor(uint256)](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L3-L5) arguments more than once in inheritance hierarchy:\n\t- From [C](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L14-L18) constructor definition\n\t- From [B](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L8-L12) constructor definition\n", "id": "1f85bf19873eaee39a8f703b0c783aa86e34c91fad5556ee831eb7c6adcfdb77", "check": "reused-constructor", "impact": "Medium", @@ -495,9 +495,9 @@ "start": 299, "length": 78, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 26, @@ -517,9 +517,9 @@ "start": 110, "length": 43, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 9, @@ -537,9 +537,9 @@ "start": 89, "length": 66, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 8, @@ -562,9 +562,9 @@ "start": 299, "length": 78, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 26, @@ -584,9 +584,9 @@ "start": 299, "length": 78, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 26, @@ -606,9 +606,9 @@ "start": 225, "length": 72, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 20, @@ -628,9 +628,9 @@ "start": 225, "length": 72, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 20, @@ -644,8 +644,8 @@ } } ], - "description": "E (tests/detectors/reused-constructor/reused_base_constructor.sol#26-30) gives base constructor B.constructor(uint256) (tests/detectors/reused-constructor/reused_base_constructor.sol#9-11) arguments more than once in inheritance hierarchy:\n\t- From E (tests/detectors/reused-constructor/reused_base_constructor.sol#26-30) contract definition\n\t- From E (tests/detectors/reused-constructor/reused_base_constructor.sol#26-30) constructor definition\n\t- From D (tests/detectors/reused-constructor/reused_base_constructor.sol#20-24) contract definition\n\t- From D (tests/detectors/reused-constructor/reused_base_constructor.sol#20-24) constructor definition\n", - "markdown": "[E](tests/detectors/reused-constructor/reused_base_constructor.sol#L26-L30) gives base constructor [B.constructor(uint256)](tests/detectors/reused-constructor/reused_base_constructor.sol#L9-L11) arguments more than once in inheritance hierarchy:\n\t- From [E](tests/detectors/reused-constructor/reused_base_constructor.sol#L26-L30) contract definition\n\t- From [E](tests/detectors/reused-constructor/reused_base_constructor.sol#L26-L30) constructor definition\n\t- From [D](tests/detectors/reused-constructor/reused_base_constructor.sol#L20-L24) contract definition\n\t- From [D](tests/detectors/reused-constructor/reused_base_constructor.sol#L20-L24) constructor definition\n", + "description": "E (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#26-30) gives base constructor B.constructor(uint256) (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#9-11) arguments more than once in inheritance hierarchy:\n\t- From E (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#26-30) contract definition\n\t- From E (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#26-30) constructor definition\n\t- From D (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#20-24) contract definition\n\t- From D (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#20-24) constructor definition\n", + "markdown": "[E](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L26-L30) gives base constructor [B.constructor(uint256)](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L9-L11) arguments more than once in inheritance hierarchy:\n\t- From [E](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L26-L30) contract definition\n\t- From [E](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L26-L30) constructor definition\n\t- From [D](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L20-L24) contract definition\n\t- From [D](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L20-L24) constructor definition\n", "id": "ee7d44329ffb81dc06e2a2f1b3a166a5115287a1175b32cf828b57479afbc4ae", "check": "reused-constructor", "impact": "Medium", @@ -660,9 +660,9 @@ "start": 299, "length": 78, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 26, @@ -682,9 +682,9 @@ "start": 178, "length": 43, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 15, @@ -702,9 +702,9 @@ "start": 157, "length": 66, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 14, @@ -727,9 +727,9 @@ "start": 299, "length": 78, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 26, @@ -749,9 +749,9 @@ "start": 225, "length": 72, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 20, @@ -771,9 +771,9 @@ "start": 225, "length": 72, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 20, @@ -787,8 +787,8 @@ } } ], - "description": "E (tests/detectors/reused-constructor/reused_base_constructor.sol#26-30) gives base constructor C.constructor(uint256) (tests/detectors/reused-constructor/reused_base_constructor.sol#15-17) arguments more than once in inheritance hierarchy:\n\t- From E (tests/detectors/reused-constructor/reused_base_constructor.sol#26-30) constructor definition\n\t- From D (tests/detectors/reused-constructor/reused_base_constructor.sol#20-24) contract definition\n\t- From D (tests/detectors/reused-constructor/reused_base_constructor.sol#20-24) constructor definition\n", - "markdown": "[E](tests/detectors/reused-constructor/reused_base_constructor.sol#L26-L30) gives base constructor [C.constructor(uint256)](tests/detectors/reused-constructor/reused_base_constructor.sol#L15-L17) arguments more than once in inheritance hierarchy:\n\t- From [E](tests/detectors/reused-constructor/reused_base_constructor.sol#L26-L30) constructor definition\n\t- From [D](tests/detectors/reused-constructor/reused_base_constructor.sol#L20-L24) contract definition\n\t- From [D](tests/detectors/reused-constructor/reused_base_constructor.sol#L20-L24) constructor definition\n", + "description": "E (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#26-30) gives base constructor C.constructor(uint256) (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#15-17) arguments more than once in inheritance hierarchy:\n\t- From E (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#26-30) constructor definition\n\t- From D (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#20-24) contract definition\n\t- From D (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#20-24) constructor definition\n", + "markdown": "[E](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L26-L30) gives base constructor [C.constructor(uint256)](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L15-L17) arguments more than once in inheritance hierarchy:\n\t- From [E](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L26-L30) constructor definition\n\t- From [D](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L20-L24) contract definition\n\t- From [D](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L20-L24) constructor definition\n", "id": "33b16377cf3026b60d644e79d92682e6e626d7ad6598387440c9b20fd8aa44fe", "check": "reused-constructor", "impact": "Medium", @@ -803,9 +803,9 @@ "start": 299, "length": 78, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 26, @@ -825,9 +825,9 @@ "start": 34, "length": 51, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 3, @@ -845,9 +845,9 @@ "start": 0, "length": 87, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 1, @@ -871,9 +871,9 @@ "start": 157, "length": 66, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 14, @@ -893,9 +893,9 @@ "start": 89, "length": 66, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 8, @@ -909,8 +909,8 @@ } } ], - "description": "E (tests/detectors/reused-constructor/reused_base_constructor.sol#26-30) gives base constructor A.constructor(uint256) (tests/detectors/reused-constructor/reused_base_constructor.sol#3-5) arguments more than once in inheritance hierarchy:\n\t- From C (tests/detectors/reused-constructor/reused_base_constructor.sol#14-18) constructor definition\n\t- From B (tests/detectors/reused-constructor/reused_base_constructor.sol#8-12) constructor definition\n", - "markdown": "[E](tests/detectors/reused-constructor/reused_base_constructor.sol#L26-L30) gives base constructor [A.constructor(uint256)](tests/detectors/reused-constructor/reused_base_constructor.sol#L3-L5) arguments more than once in inheritance hierarchy:\n\t- From [C](tests/detectors/reused-constructor/reused_base_constructor.sol#L14-L18) constructor definition\n\t- From [B](tests/detectors/reused-constructor/reused_base_constructor.sol#L8-L12) constructor definition\n", + "description": "E (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#26-30) gives base constructor A.constructor(uint256) (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#3-5) arguments more than once in inheritance hierarchy:\n\t- From C (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#14-18) constructor definition\n\t- From B (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#8-12) constructor definition\n", + "markdown": "[E](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L26-L30) gives base constructor [A.constructor(uint256)](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L3-L5) arguments more than once in inheritance hierarchy:\n\t- From [C](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L14-L18) constructor definition\n\t- From [B](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L8-L12) constructor definition\n", "id": "f5c86955c15d44fe9471680d12d37843a15ba934cbb124786cadab0919ea68d1", "check": "reused-constructor", "impact": "Medium", @@ -925,9 +925,9 @@ "start": 380, "length": 58, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 33, @@ -948,9 +948,9 @@ "start": 34, "length": 51, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 3, @@ -968,9 +968,9 @@ "start": 0, "length": 87, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 1, @@ -994,9 +994,9 @@ "start": 380, "length": 58, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 33, @@ -1017,9 +1017,9 @@ "start": 89, "length": 66, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_relative": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reused-constructor/reused_base_constructor.sol", + "filename_short": "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "is_dependency": false, "lines": [ 8, @@ -1033,8 +1033,8 @@ } } ], - "description": "F (tests/detectors/reused-constructor/reused_base_constructor.sol#33-38) gives base constructor A.constructor(uint256) (tests/detectors/reused-constructor/reused_base_constructor.sol#3-5) arguments more than once in inheritance hierarchy:\n\t- From F (tests/detectors/reused-constructor/reused_base_constructor.sol#33-38) constructor definition\n\t- From B (tests/detectors/reused-constructor/reused_base_constructor.sol#8-12) constructor definition\n", - "markdown": "[F](tests/detectors/reused-constructor/reused_base_constructor.sol#L33-L38) gives base constructor [A.constructor(uint256)](tests/detectors/reused-constructor/reused_base_constructor.sol#L3-L5) arguments more than once in inheritance hierarchy:\n\t- From [F](tests/detectors/reused-constructor/reused_base_constructor.sol#L33-L38) constructor definition\n\t- From [B](tests/detectors/reused-constructor/reused_base_constructor.sol#L8-L12) constructor definition\n", + "description": "F (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#33-38) gives base constructor A.constructor(uint256) (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#3-5) arguments more than once in inheritance hierarchy:\n\t- From F (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#33-38) constructor definition\n\t- From B (tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#8-12) constructor definition\n", + "markdown": "[F](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L33-L38) gives base constructor [A.constructor(uint256)](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L3-L5) arguments more than once in inheritance hierarchy:\n\t- From [F](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L33-L38) constructor definition\n\t- From [B](tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol#L8-L12) constructor definition\n", "id": "b74eb2b11af7a004b623d28b035228963f09aed588c95efed636021f426c5cdc", "check": "reused-constructor", "impact": "Medium", diff --git a/tests/detectors/rtlo/right_to_left_override.sol b/tests/detectors/rtlo/0.4.25/right_to_left_override.sol similarity index 100% rename from tests/detectors/rtlo/right_to_left_override.sol rename to tests/detectors/rtlo/0.4.25/right_to_left_override.sol diff --git a/tests/detectors/rtlo/right_to_left_override.sol.0.4.25.RightToLeftOverride.json b/tests/detectors/rtlo/0.4.25/right_to_left_override.sol.0.4.25.RightToLeftOverride.json similarity index 59% rename from tests/detectors/rtlo/right_to_left_override.sol.0.4.25.RightToLeftOverride.json rename to tests/detectors/rtlo/0.4.25/right_to_left_override.sol.0.4.25.RightToLeftOverride.json index 54f3dc14a2..a6c48f1057 100644 --- a/tests/detectors/rtlo/right_to_left_override.sol.0.4.25.RightToLeftOverride.json +++ b/tests/detectors/rtlo/0.4.25/right_to_left_override.sol.0.4.25.RightToLeftOverride.json @@ -9,9 +9,9 @@ "start": 96, "length": 3, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/rtlo/right_to_left_override.sol", + "filename_relative": "tests/detectors/rtlo/0.4.25/right_to_left_override.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/rtlo/right_to_left_override.sol", + "filename_short": "tests/detectors/rtlo/0.4.25/right_to_left_override.sol", "is_dependency": false, "lines": [ 7 @@ -21,9 +21,9 @@ } } ], - "description": "tests/detectors/rtlo/right_to_left_override.sol contains a unicode right-to-left-override character at byte offset 96:\n\t- b' test1(/*A\\xe2\\x80\\xae/*B*/2 , 1/*\\xe2\\x80\\xad'\n", - "markdown": "tests/detectors/rtlo/right_to_left_override.sol contains a unicode right-to-left-override character at byte offset 96:\n\t- b' test1(/*A\\xe2\\x80\\xae/*B*/2 , 1/*\\xe2\\x80\\xad'\n", - "id": "37c4d2e4e10885656018f0bfd41fd410efa58869ae79a3937bfa6c2f41ac4027", + "description": "tests/detectors/rtlo/0.4.25/right_to_left_override.sol contains a unicode right-to-left-override character at byte offset 96:\n\t- b' test1(/*A\\xe2\\x80\\xae/*B*/2 , 1/*\\xe2\\x80\\xad'\n", + "markdown": "tests/detectors/rtlo/0.4.25/right_to_left_override.sol contains a unicode right-to-left-override character at byte offset 96:\n\t- b' test1(/*A\\xe2\\x80\\xae/*B*/2 , 1/*\\xe2\\x80\\xad'\n", + "id": "02545af9e98ed496f7c9e2b2de0f66bcf8e8e31c25a2a2626b5bad92619b1f85", "check": "rtlo", "impact": "High", "confidence": "High" diff --git a/tests/detectors/rtlo/0.5.16/right_to_left_override.sol b/tests/detectors/rtlo/0.5.16/right_to_left_override.sol new file mode 100644 index 0000000000..ce5216b55f --- /dev/null +++ b/tests/detectors/rtlo/0.5.16/right_to_left_override.sol @@ -0,0 +1,15 @@ +//pragma solidity ^0.4.24; + +contract A +{ + function test() public pure + { + test1(/*A‮/*B*/2 , 1/*‭ + /*C */,3); + } + + function test1(uint a, uint b, uint c) internal pure + { + a = b + c; + } +} diff --git a/tests/detectors/rtlo/0.5.16/right_to_left_override.sol.0.5.16.RightToLeftOverride.json b/tests/detectors/rtlo/0.5.16/right_to_left_override.sol.0.5.16.RightToLeftOverride.json new file mode 100644 index 0000000000..404290c8e1 --- /dev/null +++ b/tests/detectors/rtlo/0.5.16/right_to_left_override.sol.0.5.16.RightToLeftOverride.json @@ -0,0 +1,32 @@ +[ + [ + { + "elements": [ + { + "type": "other", + "name": "rtlo-character", + "source_mapping": { + "start": 96, + "length": 3, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/rtlo/0.5.16/right_to_left_override.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/rtlo/0.5.16/right_to_left_override.sol", + "is_dependency": false, + "lines": [ + 7 + ], + "starting_column": 18, + "ending_column": 21 + } + } + ], + "description": "tests/detectors/rtlo/0.5.16/right_to_left_override.sol contains a unicode right-to-left-override character at byte offset 96:\n\t- b' test1(/*A\\xe2\\x80\\xae/*B*/2 , 1/*\\xe2\\x80\\xad'\n", + "markdown": "tests/detectors/rtlo/0.5.16/right_to_left_override.sol contains a unicode right-to-left-override character at byte offset 96:\n\t- b' test1(/*A\\xe2\\x80\\xae/*B*/2 , 1/*\\xe2\\x80\\xad'\n", + "id": "d347f1cb6d791b00f8a6ad65c201eeaa527636f2bf2c5529102441c56e994b33", + "check": "rtlo", + "impact": "High", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/rtlo/0.6.11/right_to_left_override.sol b/tests/detectors/rtlo/0.6.11/right_to_left_override.sol new file mode 100644 index 0000000000..ce5216b55f --- /dev/null +++ b/tests/detectors/rtlo/0.6.11/right_to_left_override.sol @@ -0,0 +1,15 @@ +//pragma solidity ^0.4.24; + +contract A +{ + function test() public pure + { + test1(/*A‮/*B*/2 , 1/*‭ + /*C */,3); + } + + function test1(uint a, uint b, uint c) internal pure + { + a = b + c; + } +} diff --git a/tests/detectors/rtlo/0.6.11/right_to_left_override.sol.0.6.11.RightToLeftOverride.json b/tests/detectors/rtlo/0.6.11/right_to_left_override.sol.0.6.11.RightToLeftOverride.json new file mode 100644 index 0000000000..361df1a0aa --- /dev/null +++ b/tests/detectors/rtlo/0.6.11/right_to_left_override.sol.0.6.11.RightToLeftOverride.json @@ -0,0 +1,32 @@ +[ + [ + { + "elements": [ + { + "type": "other", + "name": "rtlo-character", + "source_mapping": { + "start": 96, + "length": 3, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/rtlo/0.6.11/right_to_left_override.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/rtlo/0.6.11/right_to_left_override.sol", + "is_dependency": false, + "lines": [ + 7 + ], + "starting_column": 18, + "ending_column": 21 + } + } + ], + "description": "tests/detectors/rtlo/0.6.11/right_to_left_override.sol contains a unicode right-to-left-override character at byte offset 96:\n\t- b' test1(/*A\\xe2\\x80\\xae/*B*/2 , 1/*\\xe2\\x80\\xad'\n", + "markdown": "tests/detectors/rtlo/0.6.11/right_to_left_override.sol contains a unicode right-to-left-override character at byte offset 96:\n\t- b' test1(/*A\\xe2\\x80\\xae/*B*/2 , 1/*\\xe2\\x80\\xad'\n", + "id": "2cc2fa8e55fae035ed2ebc4798c488d64e92c7c9875fe6699e39103c0b95c264", + "check": "rtlo", + "impact": "High", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/shadowing-abstract/shadowing_abstract.sol b/tests/detectors/shadowing-abstract/0.4.25/shadowing_abstract.sol similarity index 100% rename from tests/detectors/shadowing-abstract/shadowing_abstract.sol rename to tests/detectors/shadowing-abstract/0.4.25/shadowing_abstract.sol diff --git a/tests/detectors/shadowing-abstract/shadowing_abstract.sol.0.4.25.ShadowingAbstractDetection.json b/tests/detectors/shadowing-abstract/0.4.25/shadowing_abstract.sol.0.4.25.ShadowingAbstractDetection.json similarity index 84% rename from tests/detectors/shadowing-abstract/shadowing_abstract.sol.0.4.25.ShadowingAbstractDetection.json rename to tests/detectors/shadowing-abstract/0.4.25/shadowing_abstract.sol.0.4.25.ShadowingAbstractDetection.json index 2e0952218b..0defb7ceda 100644 --- a/tests/detectors/shadowing-abstract/shadowing_abstract.sol.0.4.25.ShadowingAbstractDetection.json +++ b/tests/detectors/shadowing-abstract/0.4.25/shadowing_abstract.sol.0.4.25.ShadowingAbstractDetection.json @@ -9,9 +9,9 @@ "start": 92, "length": 13, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-abstract/shadowing_abstract.sol", + "filename_relative": "tests/detectors/shadowing-abstract/0.4.25/shadowing_abstract.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-abstract/shadowing_abstract.sol", + "filename_short": "tests/detectors/shadowing-abstract/0.4.25/shadowing_abstract.sol", "is_dependency": false, "lines": [ 7 @@ -27,9 +27,9 @@ "start": 46, "length": 63, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-abstract/shadowing_abstract.sol", + "filename_relative": "tests/detectors/shadowing-abstract/0.4.25/shadowing_abstract.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-abstract/shadowing_abstract.sol", + "filename_short": "tests/detectors/shadowing-abstract/0.4.25/shadowing_abstract.sol", "is_dependency": false, "lines": [ 6, @@ -50,9 +50,9 @@ "start": 27, "length": 13, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-abstract/shadowing_abstract.sol", + "filename_relative": "tests/detectors/shadowing-abstract/0.4.25/shadowing_abstract.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-abstract/shadowing_abstract.sol", + "filename_short": "tests/detectors/shadowing-abstract/0.4.25/shadowing_abstract.sol", "is_dependency": false, "lines": [ 2 @@ -68,9 +68,9 @@ "start": 0, "length": 44, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-abstract/shadowing_abstract.sol", + "filename_relative": "tests/detectors/shadowing-abstract/0.4.25/shadowing_abstract.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-abstract/shadowing_abstract.sol", + "filename_short": "tests/detectors/shadowing-abstract/0.4.25/shadowing_abstract.sol", "is_dependency": false, "lines": [ 1, @@ -85,8 +85,8 @@ } } ], - "description": "DerivedContract.owner (tests/detectors/shadowing-abstract/shadowing_abstract.sol#7) shadows:\n\t- BaseContract.owner (tests/detectors/shadowing-abstract/shadowing_abstract.sol#2)\n", - "markdown": "[DerivedContract.owner](tests/detectors/shadowing-abstract/shadowing_abstract.sol#L7) shadows:\n\t- [BaseContract.owner](tests/detectors/shadowing-abstract/shadowing_abstract.sol#L2)\n", + "description": "DerivedContract.owner (tests/detectors/shadowing-abstract/0.4.25/shadowing_abstract.sol#7) shadows:\n\t- BaseContract.owner (tests/detectors/shadowing-abstract/0.4.25/shadowing_abstract.sol#2)\n", + "markdown": "[DerivedContract.owner](tests/detectors/shadowing-abstract/0.4.25/shadowing_abstract.sol#L7) shadows:\n\t- [BaseContract.owner](tests/detectors/shadowing-abstract/0.4.25/shadowing_abstract.sol#L2)\n", "id": "9c5c3fc5091b9ecd6ec271fdbb3036d9d3426cdf9a09d6cc293fd7de9240e4ab", "check": "shadowing-abstract", "impact": "Medium", diff --git a/tests/detectors/shadowing-abstract/0.5.16/shadowing_abstract.sol b/tests/detectors/shadowing-abstract/0.5.16/shadowing_abstract.sol new file mode 100644 index 0000000000..3534772dc3 --- /dev/null +++ b/tests/detectors/shadowing-abstract/0.5.16/shadowing_abstract.sol @@ -0,0 +1,9 @@ +contract BaseContract{ + address owner; + +} + +contract DerivedContract is BaseContract{ + address owner; + +} diff --git a/tests/detectors/shadowing-abstract/0.5.16/shadowing_abstract.sol.0.5.16.ShadowingAbstractDetection.json b/tests/detectors/shadowing-abstract/0.5.16/shadowing_abstract.sol.0.5.16.ShadowingAbstractDetection.json new file mode 100644 index 0000000000..ed45e6135e --- /dev/null +++ b/tests/detectors/shadowing-abstract/0.5.16/shadowing_abstract.sol.0.5.16.ShadowingAbstractDetection.json @@ -0,0 +1,96 @@ +[ + [ + { + "elements": [ + { + "type": "variable", + "name": "owner", + "source_mapping": { + "start": 92, + "length": 13, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-abstract/0.5.16/shadowing_abstract.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-abstract/0.5.16/shadowing_abstract.sol", + "is_dependency": false, + "lines": [ + 7 + ], + "starting_column": 5, + "ending_column": 18 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DerivedContract", + "source_mapping": { + "start": 46, + "length": 63, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-abstract/0.5.16/shadowing_abstract.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-abstract/0.5.16/shadowing_abstract.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "variable", + "name": "owner", + "source_mapping": { + "start": 27, + "length": 13, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-abstract/0.5.16/shadowing_abstract.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-abstract/0.5.16/shadowing_abstract.sol", + "is_dependency": false, + "lines": [ + 2 + ], + "starting_column": 5, + "ending_column": 18 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BaseContract", + "source_mapping": { + "start": 0, + "length": 44, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-abstract/0.5.16/shadowing_abstract.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-abstract/0.5.16/shadowing_abstract.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + } + ], + "description": "DerivedContract.owner (tests/detectors/shadowing-abstract/0.5.16/shadowing_abstract.sol#7) shadows:\n\t- BaseContract.owner (tests/detectors/shadowing-abstract/0.5.16/shadowing_abstract.sol#2)\n", + "markdown": "[DerivedContract.owner](tests/detectors/shadowing-abstract/0.5.16/shadowing_abstract.sol#L7) shadows:\n\t- [BaseContract.owner](tests/detectors/shadowing-abstract/0.5.16/shadowing_abstract.sol#L2)\n", + "id": "9c5c3fc5091b9ecd6ec271fdbb3036d9d3426cdf9a09d6cc293fd7de9240e4ab", + "check": "shadowing-abstract", + "impact": "Medium", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol b/tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol similarity index 100% rename from tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol rename to tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol diff --git a/tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol.0.4.25.BuiltinSymbolShadowing.json b/tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol.0.4.25.BuiltinSymbolShadowing.json similarity index 85% rename from tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol.0.4.25.BuiltinSymbolShadowing.json rename to tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol.0.4.25.BuiltinSymbolShadowing.json index d526e730b4..d695c3ad35 100644 --- a/tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol.0.4.25.BuiltinSymbolShadowing.json +++ b/tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol.0.4.25.BuiltinSymbolShadowing.json @@ -9,9 +9,9 @@ "start": 54, "length": 14, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 4 @@ -27,9 +27,9 @@ "start": 26, "length": 94, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 3, @@ -46,8 +46,8 @@ } } ], - "description": "BaseContract.blockhash (tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#4) (state variable) shadows built-in symbol\"\n", - "markdown": "[BaseContract.blockhash](tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L4) (state variable) shadows built-in symbol\"\n", + "description": "BaseContract.blockhash (tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol#4) (state variable) shadows built-in symbol\"\n", + "markdown": "[BaseContract.blockhash](tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol#L4) (state variable) shadows built-in symbol\"\n", "id": "61d1c1452e694c321d00576decdf35c62efbe8860f664273955fadce5e063cc8", "check": "shadowing-builtin", "impact": "Low", @@ -62,9 +62,9 @@ "start": 74, "length": 8, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 5 @@ -80,9 +80,9 @@ "start": 26, "length": 94, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 3, @@ -99,8 +99,8 @@ } } ], - "description": "BaseContract.now (tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#5) (state variable) shadows built-in symbol\"\n", - "markdown": "[BaseContract.now](tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L5) (state variable) shadows built-in symbol\"\n", + "description": "BaseContract.now (tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol#5) (state variable) shadows built-in symbol\"\n", + "markdown": "[BaseContract.now](tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol#L5) (state variable) shadows built-in symbol\"\n", "id": "942ad0405af0bc533374dded6e2474c53892747c98d2df14d59cbb6840fa18b3", "check": "shadowing-builtin", "impact": "Low", @@ -115,9 +115,9 @@ "start": 89, "length": 29, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 7 @@ -133,9 +133,9 @@ "start": 26, "length": 94, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 3, @@ -153,8 +153,8 @@ } } ], - "description": "BaseContractrevert(bool) (tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#7) (event) shadows built-in symbol\"\n", - "markdown": "[BaseContractrevert(bool)](tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L7) (event) shadows built-in symbol\"\n", + "description": "BaseContractrevert(bool) (tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol#7) (event) shadows built-in symbol\"\n", + "markdown": "[BaseContractrevert(bool)](tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol#L7) (event) shadows built-in symbol\"\n", "id": "9c428e61cb4832d899b2bb711c8d428154425dbadf5dfc2e2d857254824d8f72", "check": "shadowing-builtin", "impact": "Low", @@ -169,9 +169,9 @@ "start": 195, "length": 64, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 13, @@ -189,9 +189,9 @@ "start": 122, "length": 139, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 10, @@ -210,8 +210,8 @@ } } ], - "description": "ExtendedContract.assert(bool) (tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#13-15) (function) shadows built-in symbol\"\n", - "markdown": "[ExtendedContract.assert(bool)](tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L13-L15) (function) shadows built-in symbol\"\n", + "description": "ExtendedContract.assert(bool) (tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol#13-15) (function) shadows built-in symbol\"\n", + "markdown": "[ExtendedContract.assert(bool)](tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol#L13-L15) (function) shadows built-in symbol\"\n", "id": "b3a1b23c1daed52b1a2ff5fb76d4fcdf2bc0b2126524303321cf8e7835116d6f", "check": "shadowing-builtin", "impact": "Low", @@ -226,9 +226,9 @@ "start": 244, "length": 8, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 14 @@ -244,9 +244,9 @@ "start": 195, "length": 64, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 13, @@ -264,9 +264,9 @@ "start": 122, "length": 139, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 10, @@ -287,8 +287,8 @@ } } ], - "description": "ExtendedContract.assert(bool).msg (tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#14) (local variable) shadows built-in symbol\"\n", - "markdown": "[ExtendedContract.assert(bool).msg](tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L14) (local variable) shadows built-in symbol\"\n", + "description": "ExtendedContract.assert(bool).msg (tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol#14) (local variable) shadows built-in symbol\"\n", + "markdown": "[ExtendedContract.assert(bool).msg](tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol#L14) (local variable) shadows built-in symbol\"\n", "id": "a2a7e1e27320d38e52b51c9b1ec67cca0a403673ff6fdd59652f9cd8425d011f", "check": "shadowing-builtin", "impact": "Low", @@ -303,9 +303,9 @@ "start": 170, "length": 18, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 11 @@ -321,9 +321,9 @@ "start": 122, "length": 139, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 10, @@ -341,8 +341,8 @@ } } ], - "description": "ExtendedContract.ecrecover (tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#11) (state variable) shadows built-in symbol\"\n", - "markdown": "[ExtendedContract.ecrecover](tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L11) (state variable) shadows built-in symbol\"\n", + "description": "ExtendedContract.ecrecover (tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol#11) (state variable) shadows built-in symbol\"\n", + "markdown": "[ExtendedContract.ecrecover](tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol#L11) (state variable) shadows built-in symbol\"\n", "id": "39737925cf3bd4ebf9a1c7bbe39da8b80ba28e5a3d93a938d1a4cca78a6a436d", "check": "shadowing-builtin", "impact": "Low", @@ -357,9 +357,9 @@ "start": 380, "length": 120, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 23, @@ -380,9 +380,9 @@ "start": 263, "length": 239, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 18, @@ -406,8 +406,8 @@ } } ], - "description": "FurtherExtendedContract.require() (tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#23-28) (modifier) shadows built-in symbol\"\n", - "markdown": "[FurtherExtendedContract.require()](tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L23-L28) (modifier) shadows built-in symbol\"\n", + "description": "FurtherExtendedContract.require() (tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol#23-28) (modifier) shadows built-in symbol\"\n", + "markdown": "[FurtherExtendedContract.require()](tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol#L23-L28) (modifier) shadows built-in symbol\"\n", "id": "db6c26c9a7c319c1a34c486e6e625c0906a2b118f8cd72f38a38c167832aab4f", "check": "shadowing-builtin", "impact": "Low", @@ -422,9 +422,9 @@ "start": 449, "length": 14, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 25 @@ -440,9 +440,9 @@ "start": 380, "length": 120, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 23, @@ -463,9 +463,9 @@ "start": 263, "length": 239, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 18, @@ -491,8 +491,8 @@ } } ], - "description": "FurtherExtendedContract.require().keccak256 (tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#25) (local variable) shadows built-in symbol\"\n", - "markdown": "[FurtherExtendedContract.require().keccak256](tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L25) (local variable) shadows built-in symbol\"\n", + "description": "FurtherExtendedContract.require().keccak256 (tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol#25) (local variable) shadows built-in symbol\"\n", + "markdown": "[FurtherExtendedContract.require().keccak256](tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol#L25) (local variable) shadows built-in symbol\"\n", "id": "40f0453d27abf2d9ed76fe60853b6e2e0cd9a443d639e9da457460ea02b2bdc7", "check": "shadowing-builtin", "impact": "Low", @@ -507,9 +507,9 @@ "start": 473, "length": 9, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 26 @@ -525,9 +525,9 @@ "start": 380, "length": 120, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 23, @@ -548,9 +548,9 @@ "start": 263, "length": 239, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 18, @@ -576,8 +576,8 @@ } } ], - "description": "FurtherExtendedContract.require().sha3 (tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#26) (local variable) shadows built-in symbol\"\n", - "markdown": "[FurtherExtendedContract.require().sha3](tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L26) (local variable) shadows built-in symbol\"\n", + "description": "FurtherExtendedContract.require().sha3 (tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol#26) (local variable) shadows built-in symbol\"\n", + "markdown": "[FurtherExtendedContract.require().sha3](tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol#L26) (local variable) shadows built-in symbol\"\n", "id": "c481dbbf77c99cb337740a656ebabae1c89bf13b9d7b7d315dcf54feeab1cd63", "check": "shadowing-builtin", "impact": "Low", @@ -592,9 +592,9 @@ "start": 322, "length": 18, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 19 @@ -610,9 +610,9 @@ "start": 263, "length": 239, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 18, @@ -635,8 +635,8 @@ } } ], - "description": "FurtherExtendedContract.blockhash (tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#19) (state variable) shadows built-in symbol\"\n", - "markdown": "[FurtherExtendedContract.blockhash](tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L19) (state variable) shadows built-in symbol\"\n", + "description": "FurtherExtendedContract.blockhash (tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol#19) (state variable) shadows built-in symbol\"\n", + "markdown": "[FurtherExtendedContract.blockhash](tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol#L19) (state variable) shadows built-in symbol\"\n", "id": "d405ccbec679f921252d475591a890a89a023b375dc4994119967693692f8da9", "check": "shadowing-builtin", "impact": "Low", @@ -651,9 +651,9 @@ "start": 346, "length": 13, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 20 @@ -669,9 +669,9 @@ "start": 263, "length": 239, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 18, @@ -694,8 +694,8 @@ } } ], - "description": "FurtherExtendedContract.this (tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#20) (state variable) shadows built-in symbol\"\n", - "markdown": "[FurtherExtendedContract.this](tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L20) (state variable) shadows built-in symbol\"\n", + "description": "FurtherExtendedContract.this (tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol#20) (state variable) shadows built-in symbol\"\n", + "markdown": "[FurtherExtendedContract.this](tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol#L20) (state variable) shadows built-in symbol\"\n", "id": "87e1cc0cb95181dd120d3e6e55d89fdc7b5cd01da2f89cd7a3d105738f57c10b", "check": "shadowing-builtin", "impact": "Low", @@ -710,9 +710,9 @@ "start": 365, "length": 8, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 21 @@ -728,9 +728,9 @@ "start": 263, "length": 239, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 18, @@ -753,8 +753,8 @@ } } ], - "description": "FurtherExtendedContract.abi (tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#21) (state variable) shadows built-in symbol\"\n", - "markdown": "[FurtherExtendedContract.abi](tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L21) (state variable) shadows built-in symbol\"\n", + "description": "FurtherExtendedContract.abi (tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol#21) (state variable) shadows built-in symbol\"\n", + "markdown": "[FurtherExtendedContract.abi](tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol#L21) (state variable) shadows built-in symbol\"\n", "id": "4665243a2df090e3543ab26447528fa3401916f4669fe1264145891846d4bc40", "check": "shadowing-builtin", "impact": "Low", @@ -769,9 +769,9 @@ "start": 527, "length": 15, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 32 @@ -787,9 +787,9 @@ "start": 504, "length": 42, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_relative": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "filename_short": "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "is_dependency": false, "lines": [ 31, @@ -804,8 +804,8 @@ } } ], - "description": "Reserved.mutable (tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#32) (state variable) shadows built-in symbol\"\n", - "markdown": "[Reserved.mutable](tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L32) (state variable) shadows built-in symbol\"\n", + "description": "Reserved.mutable (tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol#32) (state variable) shadows built-in symbol\"\n", + "markdown": "[Reserved.mutable](tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol#L32) (state variable) shadows built-in symbol\"\n", "id": "11840553a9e11623596d7a07275814e65a5b1d90277ae0e2954cd8ce74d6a6d2", "check": "shadowing-builtin", "impact": "Low", diff --git a/tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol b/tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol new file mode 100644 index 0000000000..a1753c1991 --- /dev/null +++ b/tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol @@ -0,0 +1,35 @@ +// pragma solidity ^0.4.25; + +contract BaseContract { + uint blockhash; + uint now; + + event revert(bool condition); +} + +contract ExtendedContract is BaseContract { + uint ecrecover = 7; + + function assert(bool condition) public { + uint msg; + } +} + +contract FurtherExtendedContract is ExtendedContract { + uint blockhash = 7; + uint this = 5; + uint abi; + + modifier require { + assert(msg.sender != address(0)); + uint keccak256; + uint sha3; + _; + } +} + +// solc reports: Expected identifier but got reserved keyword 'mutable' +// contract Reserved{ +// address mutable; + +// } diff --git a/tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol.0.5.16.BuiltinSymbolShadowing.json b/tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol.0.5.16.BuiltinSymbolShadowing.json new file mode 100644 index 0000000000..34077d92af --- /dev/null +++ b/tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol.0.5.16.BuiltinSymbolShadowing.json @@ -0,0 +1,764 @@ +[ + [ + { + "elements": [ + { + "type": "variable", + "name": "blockhash", + "source_mapping": { + "start": 57, + "length": 14, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "is_dependency": false, + "lines": [ + 4 + ], + "starting_column": 5, + "ending_column": 19 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BaseContract", + "source_mapping": { + "start": 29, + "length": 94, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + } + ], + "description": "BaseContract.blockhash (tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol#4) (state variable) shadows built-in symbol\"\n", + "markdown": "[BaseContract.blockhash](tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol#L4) (state variable) shadows built-in symbol\"\n", + "id": "61d1c1452e694c321d00576decdf35c62efbe8860f664273955fadce5e063cc8", + "check": "shadowing-builtin", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "now", + "source_mapping": { + "start": 77, + "length": 8, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "is_dependency": false, + "lines": [ + 5 + ], + "starting_column": 5, + "ending_column": 13 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BaseContract", + "source_mapping": { + "start": 29, + "length": 94, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + } + ], + "description": "BaseContract.now (tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol#5) (state variable) shadows built-in symbol\"\n", + "markdown": "[BaseContract.now](tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol#L5) (state variable) shadows built-in symbol\"\n", + "id": "942ad0405af0bc533374dded6e2474c53892747c98d2df14d59cbb6840fa18b3", + "check": "shadowing-builtin", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "event", + "name": "revert", + "source_mapping": { + "start": 92, + "length": 29, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "is_dependency": false, + "lines": [ + 7 + ], + "starting_column": 5, + "ending_column": 34 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BaseContract", + "source_mapping": { + "start": 29, + "length": 94, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "revert(bool)" + } + } + ], + "description": "BaseContractrevert(bool) (tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol#7) (event) shadows built-in symbol\"\n", + "markdown": "[BaseContractrevert(bool)](tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol#L7) (event) shadows built-in symbol\"\n", + "id": "9c428e61cb4832d899b2bb711c8d428154425dbadf5dfc2e2d857254824d8f72", + "check": "shadowing-builtin", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "assert", + "source_mapping": { + "start": 198, + "length": 64, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "is_dependency": false, + "lines": [ + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ExtendedContract", + "source_mapping": { + "start": 125, + "length": 139, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "assert(bool)" + } + } + ], + "description": "ExtendedContract.assert(bool) (tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol#13-15) (function) shadows built-in symbol\"\n", + "markdown": "[ExtendedContract.assert(bool)](tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol#L13-L15) (function) shadows built-in symbol\"\n", + "id": "b3a1b23c1daed52b1a2ff5fb76d4fcdf2bc0b2126524303321cf8e7835116d6f", + "check": "shadowing-builtin", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "msg", + "source_mapping": { + "start": 247, + "length": 8, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "is_dependency": false, + "lines": [ + 14 + ], + "starting_column": 9, + "ending_column": 17 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "assert", + "source_mapping": { + "start": 198, + "length": 64, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "is_dependency": false, + "lines": [ + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ExtendedContract", + "source_mapping": { + "start": 125, + "length": 139, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "assert(bool)" + } + } + } + } + ], + "description": "ExtendedContract.assert(bool).msg (tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol#14) (local variable) shadows built-in symbol\"\n", + "markdown": "[ExtendedContract.assert(bool).msg](tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol#L14) (local variable) shadows built-in symbol\"\n", + "id": "a2a7e1e27320d38e52b51c9b1ec67cca0a403673ff6fdd59652f9cd8425d011f", + "check": "shadowing-builtin", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "ecrecover", + "source_mapping": { + "start": 173, + "length": 18, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "is_dependency": false, + "lines": [ + 11 + ], + "starting_column": 5, + "ending_column": 23 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ExtendedContract", + "source_mapping": { + "start": 125, + "length": 139, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + } + ], + "description": "ExtendedContract.ecrecover (tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol#11) (state variable) shadows built-in symbol\"\n", + "markdown": "[ExtendedContract.ecrecover](tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol#L11) (state variable) shadows built-in symbol\"\n", + "id": "39737925cf3bd4ebf9a1c7bbe39da8b80ba28e5a3d93a938d1a4cca78a6a436d", + "check": "shadowing-builtin", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "require", + "source_mapping": { + "start": 383, + "length": 120, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "is_dependency": false, + "lines": [ + 23, + 24, + 25, + 26, + 27, + 28 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FurtherExtendedContract", + "source_mapping": { + "start": 266, + "length": 239, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "is_dependency": false, + "lines": [ + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "require()" + } + } + ], + "description": "FurtherExtendedContract.require() (tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol#23-28) (modifier) shadows built-in symbol\"\n", + "markdown": "[FurtherExtendedContract.require()](tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol#L23-L28) (modifier) shadows built-in symbol\"\n", + "id": "db6c26c9a7c319c1a34c486e6e625c0906a2b118f8cd72f38a38c167832aab4f", + "check": "shadowing-builtin", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "keccak256", + "source_mapping": { + "start": 452, + "length": 14, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 9, + "ending_column": 23 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "require", + "source_mapping": { + "start": 383, + "length": 120, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "is_dependency": false, + "lines": [ + 23, + 24, + 25, + 26, + 27, + 28 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FurtherExtendedContract", + "source_mapping": { + "start": 266, + "length": 239, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "is_dependency": false, + "lines": [ + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "require()" + } + } + } + } + ], + "description": "FurtherExtendedContract.require().keccak256 (tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol#25) (local variable) shadows built-in symbol\"\n", + "markdown": "[FurtherExtendedContract.require().keccak256](tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol#L25) (local variable) shadows built-in symbol\"\n", + "id": "40f0453d27abf2d9ed76fe60853b6e2e0cd9a443d639e9da457460ea02b2bdc7", + "check": "shadowing-builtin", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "sha3", + "source_mapping": { + "start": 476, + "length": 9, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "is_dependency": false, + "lines": [ + 26 + ], + "starting_column": 9, + "ending_column": 18 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "require", + "source_mapping": { + "start": 383, + "length": 120, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "is_dependency": false, + "lines": [ + 23, + 24, + 25, + 26, + 27, + 28 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FurtherExtendedContract", + "source_mapping": { + "start": 266, + "length": 239, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "is_dependency": false, + "lines": [ + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "require()" + } + } + } + } + ], + "description": "FurtherExtendedContract.require().sha3 (tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol#26) (local variable) shadows built-in symbol\"\n", + "markdown": "[FurtherExtendedContract.require().sha3](tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol#L26) (local variable) shadows built-in symbol\"\n", + "id": "c481dbbf77c99cb337740a656ebabae1c89bf13b9d7b7d315dcf54feeab1cd63", + "check": "shadowing-builtin", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "blockhash", + "source_mapping": { + "start": 325, + "length": 18, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "is_dependency": false, + "lines": [ + 19 + ], + "starting_column": 5, + "ending_column": 23 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FurtherExtendedContract", + "source_mapping": { + "start": 266, + "length": 239, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "is_dependency": false, + "lines": [ + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + } + ], + "description": "FurtherExtendedContract.blockhash (tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol#19) (state variable) shadows built-in symbol\"\n", + "markdown": "[FurtherExtendedContract.blockhash](tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol#L19) (state variable) shadows built-in symbol\"\n", + "id": "d405ccbec679f921252d475591a890a89a023b375dc4994119967693692f8da9", + "check": "shadowing-builtin", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "this", + "source_mapping": { + "start": 349, + "length": 13, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "is_dependency": false, + "lines": [ + 20 + ], + "starting_column": 5, + "ending_column": 18 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FurtherExtendedContract", + "source_mapping": { + "start": 266, + "length": 239, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "is_dependency": false, + "lines": [ + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + } + ], + "description": "FurtherExtendedContract.this (tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol#20) (state variable) shadows built-in symbol\"\n", + "markdown": "[FurtherExtendedContract.this](tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol#L20) (state variable) shadows built-in symbol\"\n", + "id": "87e1cc0cb95181dd120d3e6e55d89fdc7b5cd01da2f89cd7a3d105738f57c10b", + "check": "shadowing-builtin", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "abi", + "source_mapping": { + "start": 368, + "length": 8, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "is_dependency": false, + "lines": [ + 21 + ], + "starting_column": 5, + "ending_column": 13 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FurtherExtendedContract", + "source_mapping": { + "start": 266, + "length": 239, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "is_dependency": false, + "lines": [ + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + } + ], + "description": "FurtherExtendedContract.abi (tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol#21) (state variable) shadows built-in symbol\"\n", + "markdown": "[FurtherExtendedContract.abi](tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol#L21) (state variable) shadows built-in symbol\"\n", + "id": "4665243a2df090e3543ab26447528fa3401916f4669fe1264145891846d4bc40", + "check": "shadowing-builtin", + "impact": "Low", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/shadowing-local/shadowing_local_variable.sol b/tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol similarity index 100% rename from tests/detectors/shadowing-local/shadowing_local_variable.sol rename to tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol diff --git a/tests/detectors/shadowing-local/shadowing_local_variable.sol.0.4.25.LocalShadowing.json b/tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol.0.4.25.LocalShadowing.json similarity index 84% rename from tests/detectors/shadowing-local/shadowing_local_variable.sol.0.4.25.LocalShadowing.json rename to tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol.0.4.25.LocalShadowing.json index a91c08f6a9..63878327c9 100644 --- a/tests/detectors/shadowing-local/shadowing_local_variable.sol.0.4.25.LocalShadowing.json +++ b/tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol.0.4.25.LocalShadowing.json @@ -9,9 +9,9 @@ "start": 376, "length": 6, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 25 @@ -27,9 +27,9 @@ "start": 351, "length": 79, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 25 @@ -45,9 +45,9 @@ "start": 197, "length": 235, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 16, @@ -78,9 +78,9 @@ "start": 256, "length": 10, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 17 @@ -96,9 +96,9 @@ "start": 197, "length": 235, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 16, @@ -126,9 +126,9 @@ "start": 133, "length": 10, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 9 @@ -144,9 +144,9 @@ "start": 85, "length": 110, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 8, @@ -170,9 +170,9 @@ "start": 54, "length": 10, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 4 @@ -188,9 +188,9 @@ "start": 26, "length": 57, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 3, @@ -205,8 +205,8 @@ } } ], - "description": "FurtherExtendedContract.shadowingParent(uint256).x (tests/detectors/shadowing-local/shadowing_local_variable.sol#25) shadows:\n\t- FurtherExtendedContract.x (tests/detectors/shadowing-local/shadowing_local_variable.sol#17) (state variable)\n\t- ExtendedContract.x (tests/detectors/shadowing-local/shadowing_local_variable.sol#9) (state variable)\n\t- BaseContract.x (tests/detectors/shadowing-local/shadowing_local_variable.sol#4) (state variable)\n", - "markdown": "[FurtherExtendedContract.shadowingParent(uint256).x](tests/detectors/shadowing-local/shadowing_local_variable.sol#L25) shadows:\n\t- [FurtherExtendedContract.x](tests/detectors/shadowing-local/shadowing_local_variable.sol#L17) (state variable)\n\t- [ExtendedContract.x](tests/detectors/shadowing-local/shadowing_local_variable.sol#L9) (state variable)\n\t- [BaseContract.x](tests/detectors/shadowing-local/shadowing_local_variable.sol#L4) (state variable)\n", + "description": "FurtherExtendedContract.shadowingParent(uint256).x (tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol#25) shadows:\n\t- FurtherExtendedContract.x (tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol#17) (state variable)\n\t- ExtendedContract.x (tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol#9) (state variable)\n\t- BaseContract.x (tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol#4) (state variable)\n", + "markdown": "[FurtherExtendedContract.shadowingParent(uint256).x](tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol#L25) shadows:\n\t- [FurtherExtendedContract.x](tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol#L17) (state variable)\n\t- [ExtendedContract.x](tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol#L9) (state variable)\n\t- [BaseContract.x](tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol#L4) (state variable)\n", "id": "0991435c12aa2d6f15e8da2a00a18e9c58ef65dcf31137cdb561655317353247", "check": "shadowing-local", "impact": "Low", @@ -221,9 +221,9 @@ "start": 398, "length": 5, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 25 @@ -239,9 +239,9 @@ "start": 351, "length": 79, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 25 @@ -257,9 +257,9 @@ "start": 197, "length": 235, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 16, @@ -290,9 +290,9 @@ "start": 70, "length": 10, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 5 @@ -308,9 +308,9 @@ "start": 26, "length": 57, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 3, @@ -325,8 +325,8 @@ } } ], - "description": "FurtherExtendedContract.shadowingParent(uint256).y (tests/detectors/shadowing-local/shadowing_local_variable.sol#25) shadows:\n\t- BaseContract.y (tests/detectors/shadowing-local/shadowing_local_variable.sol#5) (state variable)\n", - "markdown": "[FurtherExtendedContract.shadowingParent(uint256).y](tests/detectors/shadowing-local/shadowing_local_variable.sol#L25) shadows:\n\t- [BaseContract.y](tests/detectors/shadowing-local/shadowing_local_variable.sol#L5) (state variable)\n", + "description": "FurtherExtendedContract.shadowingParent(uint256).y (tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol#25) shadows:\n\t- BaseContract.y (tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol#5) (state variable)\n", + "markdown": "[FurtherExtendedContract.shadowingParent(uint256).y](tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol#L25) shadows:\n\t- [BaseContract.y](tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol#L5) (state variable)\n", "id": "465bd81cbb09a3d2cc84ea6102fb059296f1970e85e2d86a171f8219f1a34508", "check": "shadowing-local", "impact": "Low", @@ -341,9 +341,9 @@ "start": 405, "length": 6, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 25 @@ -359,9 +359,9 @@ "start": 351, "length": 79, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 25 @@ -377,9 +377,9 @@ "start": 197, "length": 235, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 16, @@ -410,9 +410,9 @@ "start": 150, "length": 27, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 11 @@ -428,9 +428,9 @@ "start": 85, "length": 110, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 8, @@ -449,8 +449,8 @@ } } ], - "description": "FurtherExtendedContract.shadowingParent(uint256).z (tests/detectors/shadowing-local/shadowing_local_variable.sol#25) shadows:\n\t- ExtendedContract.z() (tests/detectors/shadowing-local/shadowing_local_variable.sol#11) (function)\n", - "markdown": "[FurtherExtendedContract.shadowingParent(uint256).z](tests/detectors/shadowing-local/shadowing_local_variable.sol#L25) shadows:\n\t- [ExtendedContract.z()](tests/detectors/shadowing-local/shadowing_local_variable.sol#L11) (function)\n", + "description": "FurtherExtendedContract.shadowingParent(uint256).z (tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol#25) shadows:\n\t- ExtendedContract.z() (tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol#11) (function)\n", + "markdown": "[FurtherExtendedContract.shadowingParent(uint256).z](tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol#L25) shadows:\n\t- [ExtendedContract.z()](tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol#L11) (function)\n", "id": "e3d2948e9c1252fe84e0d7e58f6682af7af84ef209f6e71f039faccabf07b0bd", "check": "shadowing-local", "impact": "Low", @@ -465,9 +465,9 @@ "start": 413, "length": 6, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 25 @@ -483,9 +483,9 @@ "start": 351, "length": 79, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 25 @@ -501,9 +501,9 @@ "start": 197, "length": 235, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 16, @@ -534,9 +534,9 @@ "start": 274, "length": 71, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 20, @@ -555,9 +555,9 @@ "start": 197, "length": 235, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 16, @@ -580,8 +580,8 @@ } } ], - "description": "FurtherExtendedContract.shadowingParent(uint256).w (tests/detectors/shadowing-local/shadowing_local_variable.sol#25) shadows:\n\t- FurtherExtendedContract.w() (tests/detectors/shadowing-local/shadowing_local_variable.sol#20-23) (modifier)\n", - "markdown": "[FurtherExtendedContract.shadowingParent(uint256).w](tests/detectors/shadowing-local/shadowing_local_variable.sol#L25) shadows:\n\t- [FurtherExtendedContract.w()](tests/detectors/shadowing-local/shadowing_local_variable.sol#L20-L23) (modifier)\n", + "description": "FurtherExtendedContract.shadowingParent(uint256).w (tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol#25) shadows:\n\t- FurtherExtendedContract.w() (tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol#20-23) (modifier)\n", + "markdown": "[FurtherExtendedContract.shadowingParent(uint256).w](tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol#L25) shadows:\n\t- [FurtherExtendedContract.w()](tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol#L20-L23) (modifier)\n", "id": "a94a2b9331482c75582868e6d3cc5c9b01487e7505f219abcf36a20d76e0b089", "check": "shadowing-local", "impact": "Low", @@ -596,9 +596,9 @@ "start": 421, "length": 6, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 25 @@ -614,9 +614,9 @@ "start": 351, "length": 79, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 25 @@ -632,9 +632,9 @@ "start": 197, "length": 235, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 16, @@ -665,9 +665,9 @@ "start": 183, "length": 10, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 13 @@ -683,9 +683,9 @@ "start": 85, "length": 110, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_relative": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "filename_short": "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "is_dependency": false, "lines": [ 8, @@ -704,8 +704,8 @@ } } ], - "description": "FurtherExtendedContract.shadowingParent(uint256).v (tests/detectors/shadowing-local/shadowing_local_variable.sol#25) shadows:\n\t- ExtendedContractv() (tests/detectors/shadowing-local/shadowing_local_variable.sol#13) (event)\n", - "markdown": "[FurtherExtendedContract.shadowingParent(uint256).v](tests/detectors/shadowing-local/shadowing_local_variable.sol#L25) shadows:\n\t- [ExtendedContractv()](tests/detectors/shadowing-local/shadowing_local_variable.sol#L13) (event)\n", + "description": "FurtherExtendedContract.shadowingParent(uint256).v (tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol#25) shadows:\n\t- ExtendedContractv() (tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol#13) (event)\n", + "markdown": "[FurtherExtendedContract.shadowingParent(uint256).v](tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol#L25) shadows:\n\t- [ExtendedContractv()](tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol#L13) (event)\n", "id": "973e31cc30dc7a3e1f089dfa5848234075f237f78fa492c772b1083e12c79054", "check": "shadowing-local", "impact": "Low", diff --git a/tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol b/tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol new file mode 100644 index 0000000000..ec17297e62 --- /dev/null +++ b/tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol @@ -0,0 +1,26 @@ +// pragma solidity ^0.4.24; + +contract BaseContract { + uint x = 5; + uint y = 5; +} + +contract ExtendedContract is BaseContract { + uint x = 7; + + function z() public pure {} + + event v(); +} + +contract FurtherExtendedContract is ExtendedContract { + uint x = 7; + + + modifier w { + assert(msg.sender != address(0)); + _; + } + + function shadowingParent(uint x) public pure { int y; uint z; uint w; uint v; } +} diff --git a/tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol.0.5.16.LocalShadowing.json b/tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol.0.5.16.LocalShadowing.json new file mode 100644 index 0000000000..1f34925dd0 --- /dev/null +++ b/tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol.0.5.16.LocalShadowing.json @@ -0,0 +1,715 @@ +[ + [ + { + "elements": [ + { + "type": "variable", + "name": "x", + "source_mapping": { + "start": 379, + "length": 6, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 30, + "ending_column": 36 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "shadowingParent", + "source_mapping": { + "start": 354, + "length": 79, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 5, + "ending_column": 84 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FurtherExtendedContract", + "source_mapping": { + "start": 200, + "length": 235, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "shadowingParent(uint256)" + } + } + } + }, + { + "type": "variable", + "name": "x", + "source_mapping": { + "start": 259, + "length": 10, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 17 + ], + "starting_column": 5, + "ending_column": 15 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FurtherExtendedContract", + "source_mapping": { + "start": 200, + "length": 235, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "variable", + "name": "x", + "source_mapping": { + "start": 136, + "length": 10, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 9 + ], + "starting_column": 5, + "ending_column": 15 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ExtendedContract", + "source_mapping": { + "start": 88, + "length": 110, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "variable", + "name": "x", + "source_mapping": { + "start": 57, + "length": 10, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 4 + ], + "starting_column": 5, + "ending_column": 15 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BaseContract", + "source_mapping": { + "start": 29, + "length": 57, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + } + ], + "description": "FurtherExtendedContract.shadowingParent(uint256).x (tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol#25) shadows:\n\t- FurtherExtendedContract.x (tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol#17) (state variable)\n\t- ExtendedContract.x (tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol#9) (state variable)\n\t- BaseContract.x (tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol#4) (state variable)\n", + "markdown": "[FurtherExtendedContract.shadowingParent(uint256).x](tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol#L25) shadows:\n\t- [FurtherExtendedContract.x](tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol#L17) (state variable)\n\t- [ExtendedContract.x](tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol#L9) (state variable)\n\t- [BaseContract.x](tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol#L4) (state variable)\n", + "id": "0991435c12aa2d6f15e8da2a00a18e9c58ef65dcf31137cdb561655317353247", + "check": "shadowing-local", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "y", + "source_mapping": { + "start": 401, + "length": 5, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 52, + "ending_column": 57 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "shadowingParent", + "source_mapping": { + "start": 354, + "length": 79, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 5, + "ending_column": 84 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FurtherExtendedContract", + "source_mapping": { + "start": 200, + "length": 235, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "shadowingParent(uint256)" + } + } + } + }, + { + "type": "variable", + "name": "y", + "source_mapping": { + "start": 73, + "length": 10, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 5 + ], + "starting_column": 5, + "ending_column": 15 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BaseContract", + "source_mapping": { + "start": 29, + "length": 57, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + } + ], + "description": "FurtherExtendedContract.shadowingParent(uint256).y (tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol#25) shadows:\n\t- BaseContract.y (tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol#5) (state variable)\n", + "markdown": "[FurtherExtendedContract.shadowingParent(uint256).y](tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol#L25) shadows:\n\t- [BaseContract.y](tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol#L5) (state variable)\n", + "id": "465bd81cbb09a3d2cc84ea6102fb059296f1970e85e2d86a171f8219f1a34508", + "check": "shadowing-local", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "z", + "source_mapping": { + "start": 408, + "length": 6, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 59, + "ending_column": 65 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "shadowingParent", + "source_mapping": { + "start": 354, + "length": 79, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 5, + "ending_column": 84 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FurtherExtendedContract", + "source_mapping": { + "start": 200, + "length": 235, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "shadowingParent(uint256)" + } + } + } + }, + { + "type": "function", + "name": "z", + "source_mapping": { + "start": 153, + "length": 27, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 11 + ], + "starting_column": 5, + "ending_column": 32 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ExtendedContract", + "source_mapping": { + "start": 88, + "length": 110, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "z()" + } + } + ], + "description": "FurtherExtendedContract.shadowingParent(uint256).z (tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol#25) shadows:\n\t- ExtendedContract.z() (tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol#11) (function)\n", + "markdown": "[FurtherExtendedContract.shadowingParent(uint256).z](tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol#L25) shadows:\n\t- [ExtendedContract.z()](tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol#L11) (function)\n", + "id": "e3d2948e9c1252fe84e0d7e58f6682af7af84ef209f6e71f039faccabf07b0bd", + "check": "shadowing-local", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "w", + "source_mapping": { + "start": 416, + "length": 6, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 67, + "ending_column": 73 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "shadowingParent", + "source_mapping": { + "start": 354, + "length": 79, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 5, + "ending_column": 84 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FurtherExtendedContract", + "source_mapping": { + "start": 200, + "length": 235, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "shadowingParent(uint256)" + } + } + } + }, + { + "type": "function", + "name": "w", + "source_mapping": { + "start": 277, + "length": 71, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 20, + 21, + 22, + 23 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FurtherExtendedContract", + "source_mapping": { + "start": 200, + "length": 235, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "w()" + } + } + ], + "description": "FurtherExtendedContract.shadowingParent(uint256).w (tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol#25) shadows:\n\t- FurtherExtendedContract.w() (tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol#20-23) (modifier)\n", + "markdown": "[FurtherExtendedContract.shadowingParent(uint256).w](tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol#L25) shadows:\n\t- [FurtherExtendedContract.w()](tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol#L20-L23) (modifier)\n", + "id": "a94a2b9331482c75582868e6d3cc5c9b01487e7505f219abcf36a20d76e0b089", + "check": "shadowing-local", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "v", + "source_mapping": { + "start": 424, + "length": 6, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 75, + "ending_column": 81 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "shadowingParent", + "source_mapping": { + "start": 354, + "length": 79, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 5, + "ending_column": 84 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FurtherExtendedContract", + "source_mapping": { + "start": 200, + "length": 235, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "shadowingParent(uint256)" + } + } + } + }, + { + "type": "event", + "name": "v", + "source_mapping": { + "start": 186, + "length": 10, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 13 + ], + "starting_column": 5, + "ending_column": 15 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ExtendedContract", + "source_mapping": { + "start": 88, + "length": 110, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "v()" + } + } + ], + "description": "FurtherExtendedContract.shadowingParent(uint256).v (tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol#25) shadows:\n\t- ExtendedContractv() (tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol#13) (event)\n", + "markdown": "[FurtherExtendedContract.shadowingParent(uint256).v](tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol#L25) shadows:\n\t- [ExtendedContractv()](tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol#L13) (event)\n", + "id": "973e31cc30dc7a3e1f089dfa5848234075f237f78fa492c772b1083e12c79054", + "check": "shadowing-local", + "impact": "Low", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol b/tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol new file mode 100644 index 0000000000..450dc851be --- /dev/null +++ b/tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol @@ -0,0 +1,26 @@ +// pragma solidity ^0.4.24; + +contract BaseContract { + uint x = 5; + uint y = 5; +} + +contract ExtendedContract is BaseContract { + uint _x = 7; + + function z() public pure {} + + event v(); +} + +contract FurtherExtendedContract is ExtendedContract { + uint __x = 7; + + + modifier w { + assert(msg.sender != address(0)); + _; + } + + function shadowingParent(uint __x) public pure { int y; uint z; uint w; uint v; } +} diff --git a/tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol.0.6.11.LocalShadowing.json b/tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol.0.6.11.LocalShadowing.json new file mode 100644 index 0000000000..0fdb100702 --- /dev/null +++ b/tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol.0.6.11.LocalShadowing.json @@ -0,0 +1,630 @@ +[ + [ + { + "elements": [ + { + "type": "variable", + "name": "__x", + "source_mapping": { + "start": 382, + "length": 8, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 30, + "ending_column": 38 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "shadowingParent", + "source_mapping": { + "start": 357, + "length": 81, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 5, + "ending_column": 86 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FurtherExtendedContract", + "source_mapping": { + "start": 201, + "length": 239, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "shadowingParent(uint256)" + } + } + } + }, + { + "type": "variable", + "name": "__x", + "source_mapping": { + "start": 260, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 17 + ], + "starting_column": 5, + "ending_column": 17 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FurtherExtendedContract", + "source_mapping": { + "start": 201, + "length": 239, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + } + ], + "description": "FurtherExtendedContract.shadowingParent(uint256).__x (tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol#25) shadows:\n\t- FurtherExtendedContract.__x (tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol#17) (state variable)\n", + "markdown": "[FurtherExtendedContract.shadowingParent(uint256).__x](tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol#L25) shadows:\n\t- [FurtherExtendedContract.__x](tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol#L17) (state variable)\n", + "id": "cd61765f88a1447471f5c75c7a488af44534d81be3998f5d01a6b5fa8f693327", + "check": "shadowing-local", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "y", + "source_mapping": { + "start": 406, + "length": 5, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 54, + "ending_column": 59 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "shadowingParent", + "source_mapping": { + "start": 357, + "length": 81, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 5, + "ending_column": 86 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FurtherExtendedContract", + "source_mapping": { + "start": 201, + "length": 239, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "shadowingParent(uint256)" + } + } + } + }, + { + "type": "variable", + "name": "y", + "source_mapping": { + "start": 73, + "length": 10, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 5 + ], + "starting_column": 5, + "ending_column": 15 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BaseContract", + "source_mapping": { + "start": 29, + "length": 57, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + } + ], + "description": "FurtherExtendedContract.shadowingParent(uint256).y (tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol#25) shadows:\n\t- BaseContract.y (tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol#5) (state variable)\n", + "markdown": "[FurtherExtendedContract.shadowingParent(uint256).y](tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol#L25) shadows:\n\t- [BaseContract.y](tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol#L5) (state variable)\n", + "id": "465bd81cbb09a3d2cc84ea6102fb059296f1970e85e2d86a171f8219f1a34508", + "check": "shadowing-local", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "z", + "source_mapping": { + "start": 413, + "length": 6, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 61, + "ending_column": 67 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "shadowingParent", + "source_mapping": { + "start": 357, + "length": 81, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 5, + "ending_column": 86 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FurtherExtendedContract", + "source_mapping": { + "start": 201, + "length": 239, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "shadowingParent(uint256)" + } + } + } + }, + { + "type": "function", + "name": "z", + "source_mapping": { + "start": 154, + "length": 27, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 11 + ], + "starting_column": 5, + "ending_column": 32 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ExtendedContract", + "source_mapping": { + "start": 88, + "length": 111, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "z()" + } + } + ], + "description": "FurtherExtendedContract.shadowingParent(uint256).z (tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol#25) shadows:\n\t- ExtendedContract.z() (tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol#11) (function)\n", + "markdown": "[FurtherExtendedContract.shadowingParent(uint256).z](tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol#L25) shadows:\n\t- [ExtendedContract.z()](tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol#L11) (function)\n", + "id": "e3d2948e9c1252fe84e0d7e58f6682af7af84ef209f6e71f039faccabf07b0bd", + "check": "shadowing-local", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "w", + "source_mapping": { + "start": 421, + "length": 6, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 69, + "ending_column": 75 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "shadowingParent", + "source_mapping": { + "start": 357, + "length": 81, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 5, + "ending_column": 86 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FurtherExtendedContract", + "source_mapping": { + "start": 201, + "length": 239, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "shadowingParent(uint256)" + } + } + } + }, + { + "type": "function", + "name": "w", + "source_mapping": { + "start": 280, + "length": 71, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 20, + 21, + 22, + 23 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FurtherExtendedContract", + "source_mapping": { + "start": 201, + "length": 239, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "w()" + } + } + ], + "description": "FurtherExtendedContract.shadowingParent(uint256).w (tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol#25) shadows:\n\t- FurtherExtendedContract.w() (tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol#20-23) (modifier)\n", + "markdown": "[FurtherExtendedContract.shadowingParent(uint256).w](tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol#L25) shadows:\n\t- [FurtherExtendedContract.w()](tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol#L20-L23) (modifier)\n", + "id": "a94a2b9331482c75582868e6d3cc5c9b01487e7505f219abcf36a20d76e0b089", + "check": "shadowing-local", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "v", + "source_mapping": { + "start": 429, + "length": 6, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 77, + "ending_column": 83 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "shadowingParent", + "source_mapping": { + "start": 357, + "length": 81, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 5, + "ending_column": 86 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FurtherExtendedContract", + "source_mapping": { + "start": 201, + "length": 239, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "shadowingParent(uint256)" + } + } + } + }, + { + "type": "event", + "name": "v", + "source_mapping": { + "start": 187, + "length": 10, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 13 + ], + "starting_column": 5, + "ending_column": 15 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ExtendedContract", + "source_mapping": { + "start": 88, + "length": 111, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "v()" + } + } + ], + "description": "FurtherExtendedContract.shadowingParent(uint256).v (tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol#25) shadows:\n\t- ExtendedContractv() (tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol#13) (event)\n", + "markdown": "[FurtherExtendedContract.shadowingParent(uint256).v](tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol#L25) shadows:\n\t- [ExtendedContractv()](tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol#L13) (event)\n", + "id": "973e31cc30dc7a3e1f089dfa5848234075f237f78fa492c772b1083e12c79054", + "check": "shadowing-local", + "impact": "Low", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol b/tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol new file mode 100644 index 0000000000..450dc851be --- /dev/null +++ b/tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol @@ -0,0 +1,26 @@ +// pragma solidity ^0.4.24; + +contract BaseContract { + uint x = 5; + uint y = 5; +} + +contract ExtendedContract is BaseContract { + uint _x = 7; + + function z() public pure {} + + event v(); +} + +contract FurtherExtendedContract is ExtendedContract { + uint __x = 7; + + + modifier w { + assert(msg.sender != address(0)); + _; + } + + function shadowingParent(uint __x) public pure { int y; uint z; uint w; uint v; } +} diff --git a/tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol.0.7.6.LocalShadowing.json b/tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol.0.7.6.LocalShadowing.json new file mode 100644 index 0000000000..a5e57d72df --- /dev/null +++ b/tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol.0.7.6.LocalShadowing.json @@ -0,0 +1,630 @@ +[ + [ + { + "elements": [ + { + "type": "variable", + "name": "__x", + "source_mapping": { + "start": 382, + "length": 8, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 30, + "ending_column": 38 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "shadowingParent", + "source_mapping": { + "start": 357, + "length": 81, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 5, + "ending_column": 86 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FurtherExtendedContract", + "source_mapping": { + "start": 201, + "length": 239, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "shadowingParent(uint256)" + } + } + } + }, + { + "type": "variable", + "name": "__x", + "source_mapping": { + "start": 260, + "length": 12, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 17 + ], + "starting_column": 5, + "ending_column": 17 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FurtherExtendedContract", + "source_mapping": { + "start": 201, + "length": 239, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + } + ], + "description": "FurtherExtendedContract.shadowingParent(uint256).__x (tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol#25) shadows:\n\t- FurtherExtendedContract.__x (tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol#17) (state variable)\n", + "markdown": "[FurtherExtendedContract.shadowingParent(uint256).__x](tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol#L25) shadows:\n\t- [FurtherExtendedContract.__x](tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol#L17) (state variable)\n", + "id": "cd61765f88a1447471f5c75c7a488af44534d81be3998f5d01a6b5fa8f693327", + "check": "shadowing-local", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "y", + "source_mapping": { + "start": 406, + "length": 5, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 54, + "ending_column": 59 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "shadowingParent", + "source_mapping": { + "start": 357, + "length": 81, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 5, + "ending_column": 86 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FurtherExtendedContract", + "source_mapping": { + "start": 201, + "length": 239, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "shadowingParent(uint256)" + } + } + } + }, + { + "type": "variable", + "name": "y", + "source_mapping": { + "start": 73, + "length": 10, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 5 + ], + "starting_column": 5, + "ending_column": 15 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BaseContract", + "source_mapping": { + "start": 29, + "length": 57, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + } + ], + "description": "FurtherExtendedContract.shadowingParent(uint256).y (tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol#25) shadows:\n\t- BaseContract.y (tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol#5) (state variable)\n", + "markdown": "[FurtherExtendedContract.shadowingParent(uint256).y](tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol#L25) shadows:\n\t- [BaseContract.y](tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol#L5) (state variable)\n", + "id": "465bd81cbb09a3d2cc84ea6102fb059296f1970e85e2d86a171f8219f1a34508", + "check": "shadowing-local", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "z", + "source_mapping": { + "start": 413, + "length": 6, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 61, + "ending_column": 67 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "shadowingParent", + "source_mapping": { + "start": 357, + "length": 81, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 5, + "ending_column": 86 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FurtherExtendedContract", + "source_mapping": { + "start": 201, + "length": 239, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "shadowingParent(uint256)" + } + } + } + }, + { + "type": "function", + "name": "z", + "source_mapping": { + "start": 154, + "length": 27, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 11 + ], + "starting_column": 5, + "ending_column": 32 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ExtendedContract", + "source_mapping": { + "start": 88, + "length": 111, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "z()" + } + } + ], + "description": "FurtherExtendedContract.shadowingParent(uint256).z (tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol#25) shadows:\n\t- ExtendedContract.z() (tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol#11) (function)\n", + "markdown": "[FurtherExtendedContract.shadowingParent(uint256).z](tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol#L25) shadows:\n\t- [ExtendedContract.z()](tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol#L11) (function)\n", + "id": "e3d2948e9c1252fe84e0d7e58f6682af7af84ef209f6e71f039faccabf07b0bd", + "check": "shadowing-local", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "w", + "source_mapping": { + "start": 421, + "length": 6, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 69, + "ending_column": 75 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "shadowingParent", + "source_mapping": { + "start": 357, + "length": 81, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 5, + "ending_column": 86 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FurtherExtendedContract", + "source_mapping": { + "start": 201, + "length": 239, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "shadowingParent(uint256)" + } + } + } + }, + { + "type": "function", + "name": "w", + "source_mapping": { + "start": 280, + "length": 71, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 20, + 21, + 22, + 23 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FurtherExtendedContract", + "source_mapping": { + "start": 201, + "length": 239, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "w()" + } + } + ], + "description": "FurtherExtendedContract.shadowingParent(uint256).w (tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol#25) shadows:\n\t- FurtherExtendedContract.w() (tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol#20-23) (modifier)\n", + "markdown": "[FurtherExtendedContract.shadowingParent(uint256).w](tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol#L25) shadows:\n\t- [FurtherExtendedContract.w()](tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol#L20-L23) (modifier)\n", + "id": "a94a2b9331482c75582868e6d3cc5c9b01487e7505f219abcf36a20d76e0b089", + "check": "shadowing-local", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "v", + "source_mapping": { + "start": 429, + "length": 6, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 77, + "ending_column": 83 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "shadowingParent", + "source_mapping": { + "start": 357, + "length": 81, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 25 + ], + "starting_column": 5, + "ending_column": 86 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "FurtherExtendedContract", + "source_mapping": { + "start": 201, + "length": 239, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "shadowingParent(uint256)" + } + } + } + }, + { + "type": "event", + "name": "v", + "source_mapping": { + "start": 187, + "length": 10, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 13 + ], + "starting_column": 5, + "ending_column": 15 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ExtendedContract", + "source_mapping": { + "start": 88, + "length": 111, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "v()" + } + } + ], + "description": "FurtherExtendedContract.shadowingParent(uint256).v (tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol#25) shadows:\n\t- ExtendedContractv() (tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol#13) (event)\n", + "markdown": "[FurtherExtendedContract.shadowingParent(uint256).v](tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol#L25) shadows:\n\t- [ExtendedContractv()](tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol#L13) (event)\n", + "id": "973e31cc30dc7a3e1f089dfa5848234075f237f78fa492c772b1083e12c79054", + "check": "shadowing-local", + "impact": "Low", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/shadowing-state/shadowing_state_variable.sol b/tests/detectors/shadowing-state/0.4.25/shadowing_state_variable.sol similarity index 100% rename from tests/detectors/shadowing-state/shadowing_state_variable.sol rename to tests/detectors/shadowing-state/0.4.25/shadowing_state_variable.sol diff --git a/tests/detectors/shadowing-state/shadowing_state_variable.sol.0.4.25.StateShadowing.json b/tests/detectors/shadowing-state/0.4.25/shadowing_state_variable.sol.0.4.25.StateShadowing.json similarity index 85% rename from tests/detectors/shadowing-state/shadowing_state_variable.sol.0.4.25.StateShadowing.json rename to tests/detectors/shadowing-state/0.4.25/shadowing_state_variable.sol.0.4.25.StateShadowing.json index 80bdc98c65..8e8a8e56be 100644 --- a/tests/detectors/shadowing-state/shadowing_state_variable.sol.0.4.25.StateShadowing.json +++ b/tests/detectors/shadowing-state/0.4.25/shadowing_state_variable.sol.0.4.25.StateShadowing.json @@ -9,9 +9,9 @@ "start": 172, "length": 13, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-state/shadowing_state_variable.sol", + "filename_relative": "tests/detectors/shadowing-state/0.4.25/shadowing_state_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-state/shadowing_state_variable.sol", + "filename_short": "tests/detectors/shadowing-state/0.4.25/shadowing_state_variable.sol", "is_dependency": false, "lines": [ 12 @@ -27,9 +27,9 @@ "start": 126, "length": 210, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-state/shadowing_state_variable.sol", + "filename_relative": "tests/detectors/shadowing-state/0.4.25/shadowing_state_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-state/shadowing_state_variable.sol", + "filename_short": "tests/detectors/shadowing-state/0.4.25/shadowing_state_variable.sol", "is_dependency": false, "lines": [ 11, @@ -57,9 +57,9 @@ "start": 27, "length": 13, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-state/shadowing_state_variable.sol", + "filename_relative": "tests/detectors/shadowing-state/0.4.25/shadowing_state_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-state/shadowing_state_variable.sol", + "filename_short": "tests/detectors/shadowing-state/0.4.25/shadowing_state_variable.sol", "is_dependency": false, "lines": [ 2 @@ -75,9 +75,9 @@ "start": 0, "length": 124, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/shadowing-state/shadowing_state_variable.sol", + "filename_relative": "tests/detectors/shadowing-state/0.4.25/shadowing_state_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/shadowing-state/shadowing_state_variable.sol", + "filename_short": "tests/detectors/shadowing-state/0.4.25/shadowing_state_variable.sol", "is_dependency": false, "lines": [ 1, @@ -97,8 +97,8 @@ } } ], - "description": "DerivedContract.owner (tests/detectors/shadowing-state/shadowing_state_variable.sol#12) shadows:\n\t- BaseContract.owner (tests/detectors/shadowing-state/shadowing_state_variable.sol#2)\n", - "markdown": "[DerivedContract.owner](tests/detectors/shadowing-state/shadowing_state_variable.sol#L12) shadows:\n\t- [BaseContract.owner](tests/detectors/shadowing-state/shadowing_state_variable.sol#L2)\n", + "description": "DerivedContract.owner (tests/detectors/shadowing-state/0.4.25/shadowing_state_variable.sol#12) shadows:\n\t- BaseContract.owner (tests/detectors/shadowing-state/0.4.25/shadowing_state_variable.sol#2)\n", + "markdown": "[DerivedContract.owner](tests/detectors/shadowing-state/0.4.25/shadowing_state_variable.sol#L12) shadows:\n\t- [BaseContract.owner](tests/detectors/shadowing-state/0.4.25/shadowing_state_variable.sol#L2)\n", "id": "9c5c3fc5091b9ecd6ec271fdbb3036d9d3426cdf9a09d6cc293fd7de9240e4ab", "check": "shadowing-state", "impact": "High", diff --git a/tests/detectors/shadowing-state/0.5.16/shadowing_state_variable.sol b/tests/detectors/shadowing-state/0.5.16/shadowing_state_variable.sol new file mode 100644 index 0000000000..f85a127f72 --- /dev/null +++ b/tests/detectors/shadowing-state/0.5.16/shadowing_state_variable.sol @@ -0,0 +1,21 @@ +contract BaseContract{ + address owner; + + modifier isOwner(){ + require(owner == msg.sender); + _; + } + +} + +contract DerivedContract is BaseContract{ + address owner; + + constructor() public { + owner = msg.sender; + } + + function withdraw() isOwner() external{ + msg.sender.transfer(address(this).balance); + } +} diff --git a/tests/detectors/shadowing-state/0.5.16/shadowing_state_variable.sol.0.5.16.StateShadowing.json b/tests/detectors/shadowing-state/0.5.16/shadowing_state_variable.sol.0.5.16.StateShadowing.json new file mode 100644 index 0000000000..3a830f0904 --- /dev/null +++ b/tests/detectors/shadowing-state/0.5.16/shadowing_state_variable.sol.0.5.16.StateShadowing.json @@ -0,0 +1,108 @@ +[ + [ + { + "elements": [ + { + "type": "variable", + "name": "owner", + "source_mapping": { + "start": 172, + "length": 13, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-state/0.5.16/shadowing_state_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-state/0.5.16/shadowing_state_variable.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 5, + "ending_column": 18 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DerivedContract", + "source_mapping": { + "start": 126, + "length": 227, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-state/0.5.16/shadowing_state_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-state/0.5.16/shadowing_state_variable.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "variable", + "name": "owner", + "source_mapping": { + "start": 27, + "length": 13, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-state/0.5.16/shadowing_state_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-state/0.5.16/shadowing_state_variable.sol", + "is_dependency": false, + "lines": [ + 2 + ], + "starting_column": 5, + "ending_column": 18 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BaseContract", + "source_mapping": { + "start": 0, + "length": 124, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/shadowing-state/0.5.16/shadowing_state_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/shadowing-state/0.5.16/shadowing_state_variable.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + } + ], + "description": "DerivedContract.owner (tests/detectors/shadowing-state/0.5.16/shadowing_state_variable.sol#12) shadows:\n\t- BaseContract.owner (tests/detectors/shadowing-state/0.5.16/shadowing_state_variable.sol#2)\n", + "markdown": "[DerivedContract.owner](tests/detectors/shadowing-state/0.5.16/shadowing_state_variable.sol#L12) shadows:\n\t- [BaseContract.owner](tests/detectors/shadowing-state/0.5.16/shadowing_state_variable.sol#L2)\n", + "id": "9c5c3fc5091b9ecd6ec271fdbb3036d9d3426cdf9a09d6cc293fd7de9240e4ab", + "check": "shadowing-state", + "impact": "High", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/shadowing-state/0.6.11/shadowing_state_variable.sol b/tests/detectors/shadowing-state/0.6.11/shadowing_state_variable.sol new file mode 100644 index 0000000000..bed441c6d7 --- /dev/null +++ b/tests/detectors/shadowing-state/0.6.11/shadowing_state_variable.sol @@ -0,0 +1,21 @@ +contract BaseContract{ + address owner; + + modifier isOwner(){ + require(owner == msg.sender); + _; + } + +} + +contract DerivedContract is BaseContract{ + address _owner; + + constructor() public { + _owner = msg.sender; + } + + function withdraw() isOwner() external{ + msg.sender.transfer(address(this).balance); + } +} diff --git a/tests/detectors/shadowing-state/0.6.11/shadowing_state_variable.sol.0.6.11.StateShadowing.json b/tests/detectors/shadowing-state/0.6.11/shadowing_state_variable.sol.0.6.11.StateShadowing.json new file mode 100644 index 0000000000..5825bcacc6 --- /dev/null +++ b/tests/detectors/shadowing-state/0.6.11/shadowing_state_variable.sol.0.6.11.StateShadowing.json @@ -0,0 +1,3 @@ +[ + [] +] \ No newline at end of file diff --git a/tests/detectors/shadowing-state/0.7.6/shadowing_state_variable.sol b/tests/detectors/shadowing-state/0.7.6/shadowing_state_variable.sol new file mode 100644 index 0000000000..bed441c6d7 --- /dev/null +++ b/tests/detectors/shadowing-state/0.7.6/shadowing_state_variable.sol @@ -0,0 +1,21 @@ +contract BaseContract{ + address owner; + + modifier isOwner(){ + require(owner == msg.sender); + _; + } + +} + +contract DerivedContract is BaseContract{ + address _owner; + + constructor() public { + _owner = msg.sender; + } + + function withdraw() isOwner() external{ + msg.sender.transfer(address(this).balance); + } +} diff --git a/tests/detectors/shadowing-state/0.7.6/shadowing_state_variable.sol.0.7.6.StateShadowing.json b/tests/detectors/shadowing-state/0.7.6/shadowing_state_variable.sol.0.7.6.StateShadowing.json new file mode 100644 index 0000000000..5825bcacc6 --- /dev/null +++ b/tests/detectors/shadowing-state/0.7.6/shadowing_state_variable.sol.0.7.6.StateShadowing.json @@ -0,0 +1,3 @@ +[ + [] +] \ No newline at end of file diff --git a/tests/detectors/solc-version/0.4.25/static.sol b/tests/detectors/solc-version/0.4.25/static.sol new file mode 100644 index 0000000000..3d7e8fcd5f --- /dev/null +++ b/tests/detectors/solc-version/0.4.25/static.sol @@ -0,0 +1,5 @@ +pragma solidity 0.4.25; + +contract C{ + +} diff --git a/tests/detectors/solc-version/old_solc.sol.0.4.21.IncorrectSolc.json b/tests/detectors/solc-version/0.4.25/static.sol.0.4.25.IncorrectSolc.json similarity index 65% rename from tests/detectors/solc-version/old_solc.sol.0.4.21.IncorrectSolc.json rename to tests/detectors/solc-version/0.4.25/static.sol.0.4.25.IncorrectSolc.json index fd534aa0b1..f55b258af0 100644 --- a/tests/detectors/solc-version/old_solc.sol.0.4.21.IncorrectSolc.json +++ b/tests/detectors/solc-version/0.4.25/static.sol.0.4.25.IncorrectSolc.json @@ -4,14 +4,14 @@ "elements": [ { "type": "pragma", - "name": "0.4.21", + "name": "0.4.25", "source_mapping": { "start": 0, "length": 23, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/solc-version/old_solc.sol", + "filename_relative": "tests/detectors/solc-version/0.4.25/static.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/solc-version/old_solc.sol", + "filename_short": "tests/detectors/solc-version/0.4.25/static.sol", "is_dependency": false, "lines": [ 1 @@ -23,23 +23,23 @@ "directive": [ "solidity", "0.4", - ".21" + ".25" ] } } ], - "description": "Pragma version0.4.21 (tests/detectors/solc-version/old_solc.sol#1) allows old versions\n", - "markdown": "Pragma version[0.4.21](tests/detectors/solc-version/old_solc.sol#L1) allows old versions\n", - "id": "5ee25540b8c3544f4c954ad10f5f76ad54f790ee070d9d9c7d203df01a40d859", + "description": "Pragma version0.4.25 (tests/detectors/solc-version/0.4.25/static.sol#1) allows old versions\n", + "markdown": "Pragma version[0.4.25](tests/detectors/solc-version/0.4.25/static.sol#L1) allows old versions\n", + "id": "029e1373a8867a45707d0ef3f6d0895191b9a4c60e71980c2ac58b5589c6256c", "check": "solc-version", "impact": "Informational", "confidence": "High" }, { "elements": [], - "description": "solc-0.4.21 is not recommended for deployment\n", - "markdown": "solc-0.4.21 is not recommended for deployment\n", - "id": "11c23ced8dbc94c44bd7809b5adfe4054fff8cd744f85723555d37f0b714b15f", + "description": "solc-0.4.25 is not recommended for deployment\n", + "markdown": "solc-0.4.25 is not recommended for deployment\n", + "id": "4d64003d70a62b1c6963f871e841b6cbd633d07d95554e1a50e0f25d9b71ebb3", "check": "solc-version", "impact": "Informational", "confidence": "High" diff --git a/tests/detectors/solc-version/0.5.14/static.sol b/tests/detectors/solc-version/0.5.14/static.sol new file mode 100644 index 0000000000..a2099661fb --- /dev/null +++ b/tests/detectors/solc-version/0.5.14/static.sol @@ -0,0 +1,5 @@ +pragma solidity 0.5.14; + +contract C{ + +} diff --git a/tests/detectors/solc-version/0.5.14/static.sol.0.5.14.IncorrectSolc.json b/tests/detectors/solc-version/0.5.14/static.sol.0.5.14.IncorrectSolc.json new file mode 100644 index 0000000000..5eb74a98c8 --- /dev/null +++ b/tests/detectors/solc-version/0.5.14/static.sol.0.5.14.IncorrectSolc.json @@ -0,0 +1,48 @@ +[ + [ + { + "elements": [ + { + "type": "pragma", + "name": "0.5.14", + "source_mapping": { + "start": 0, + "length": 23, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/solc-version/0.5.14/static.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/solc-version/0.5.14/static.sol", + "is_dependency": false, + "lines": [ + 1 + ], + "starting_column": 1, + "ending_column": 24 + }, + "type_specific_fields": { + "directive": [ + "solidity", + "0.5", + ".14" + ] + } + } + ], + "description": "Pragma version0.5.14 (tests/detectors/solc-version/0.5.14/static.sol#1) is known to contain severe issues (https://solidity.readthedocs.io/en/latest/bugs.html)\n", + "markdown": "Pragma version[0.5.14](tests/detectors/solc-version/0.5.14/static.sol#L1) is known to contain severe issues (https://solidity.readthedocs.io/en/latest/bugs.html)\n", + "id": "cf9412fdac7f959dea885dbcebb2f9cfb0f3b0ca55f8fc84ebdc51e09eaf6957", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [], + "description": "solc-0.5.14 is not recommended for deployment\n", + "markdown": "solc-0.5.14 is not recommended for deployment\n", + "id": "839b9aa9c05b3f4bfeb7aefa9b7a69d82a322bf527f21bbf7080a7855f003803", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/solc-version/0.5.16/dynamic_1.sol b/tests/detectors/solc-version/0.5.16/dynamic_1.sol new file mode 100644 index 0000000000..ac28fb176f --- /dev/null +++ b/tests/detectors/solc-version/0.5.16/dynamic_1.sol @@ -0,0 +1,5 @@ +pragma solidity ^0.5.15; + +contract Contract{ + +} diff --git a/tests/detectors/solc-version/0.5.16/dynamic_1.sol.0.5.16.IncorrectSolc.json b/tests/detectors/solc-version/0.5.16/dynamic_1.sol.0.5.16.IncorrectSolc.json new file mode 100644 index 0000000000..39362aed44 --- /dev/null +++ b/tests/detectors/solc-version/0.5.16/dynamic_1.sol.0.5.16.IncorrectSolc.json @@ -0,0 +1,40 @@ +[ + [ + { + "elements": [ + { + "type": "pragma", + "name": "^0.5.15", + "source_mapping": { + "start": 0, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/solc-version/0.5.16/dynamic_1.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/solc-version/0.5.16/dynamic_1.sol", + "is_dependency": false, + "lines": [ + 1 + ], + "starting_column": 1, + "ending_column": 25 + }, + "type_specific_fields": { + "directive": [ + "solidity", + "^", + "0.5", + ".15" + ] + } + } + ], + "description": "Pragma version^0.5.15 (tests/detectors/solc-version/0.5.16/dynamic_1.sol#1) allows old versions\n", + "markdown": "Pragma version[^0.5.15](tests/detectors/solc-version/0.5.16/dynamic_1.sol#L1) allows old versions\n", + "id": "b837ad353716586dca5845e185efa85b1ed38c36ff731820ea9a42fc72171527", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/solc-version/0.5.16/dynamic_2.sol b/tests/detectors/solc-version/0.5.16/dynamic_2.sol new file mode 100644 index 0000000000..adf1450ecf --- /dev/null +++ b/tests/detectors/solc-version/0.5.16/dynamic_2.sol @@ -0,0 +1,5 @@ +pragma solidity >=0.5.0 <0.6.0; + +contract Contract{ + +} diff --git a/tests/detectors/solc-version/0.5.16/dynamic_2.sol.0.5.16.IncorrectSolc.json b/tests/detectors/solc-version/0.5.16/dynamic_2.sol.0.5.16.IncorrectSolc.json new file mode 100644 index 0000000000..265b831f93 --- /dev/null +++ b/tests/detectors/solc-version/0.5.16/dynamic_2.sol.0.5.16.IncorrectSolc.json @@ -0,0 +1,43 @@ +[ + [ + { + "elements": [ + { + "type": "pragma", + "name": ">=0.5.0<0.6.0", + "source_mapping": { + "start": 0, + "length": 31, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/solc-version/0.5.16/dynamic_2.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/solc-version/0.5.16/dynamic_2.sol", + "is_dependency": false, + "lines": [ + 1 + ], + "starting_column": 1, + "ending_column": 32 + }, + "type_specific_fields": { + "directive": [ + "solidity", + ">=", + "0.5", + ".0", + "<", + "0.6", + ".0" + ] + } + } + ], + "description": "Pragma version>=0.5.0<0.6.0 (tests/detectors/solc-version/0.5.16/dynamic_2.sol#1) allows old versions\n", + "markdown": "Pragma version[>=0.5.0<0.6.0](tests/detectors/solc-version/0.5.16/dynamic_2.sol#L1) allows old versions\n", + "id": "0f9930eec9fe7848abc3ded6a5fc053e0208ffa1510b01518fb1348e0f0b01b1", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/solc-version/0.5.16/static.sol b/tests/detectors/solc-version/0.5.16/static.sol new file mode 100644 index 0000000000..90ed7a6f88 --- /dev/null +++ b/tests/detectors/solc-version/0.5.16/static.sol @@ -0,0 +1,5 @@ +pragma solidity 0.5.16; + +contract C{ + +} diff --git a/tests/detectors/solc-version/0.5.16/static.sol.0.5.16.IncorrectSolc.json b/tests/detectors/solc-version/0.5.16/static.sol.0.5.16.IncorrectSolc.json new file mode 100644 index 0000000000..5825bcacc6 --- /dev/null +++ b/tests/detectors/solc-version/0.5.16/static.sol.0.5.16.IncorrectSolc.json @@ -0,0 +1,3 @@ +[ + [] +] \ No newline at end of file diff --git a/tests/detectors/solc-version/0.6.10/static.sol b/tests/detectors/solc-version/0.6.10/static.sol new file mode 100644 index 0000000000..c16a31cc97 --- /dev/null +++ b/tests/detectors/solc-version/0.6.10/static.sol @@ -0,0 +1,5 @@ +pragma solidity 0.6.10; + +contract C{ + +} diff --git a/tests/detectors/solc-version/0.6.10/static.sol.0.6.10.IncorrectSolc.json b/tests/detectors/solc-version/0.6.10/static.sol.0.6.10.IncorrectSolc.json new file mode 100644 index 0000000000..df30b41543 --- /dev/null +++ b/tests/detectors/solc-version/0.6.10/static.sol.0.6.10.IncorrectSolc.json @@ -0,0 +1,48 @@ +[ + [ + { + "elements": [ + { + "type": "pragma", + "name": "0.6.10", + "source_mapping": { + "start": 0, + "length": 23, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/solc-version/0.6.10/static.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/solc-version/0.6.10/static.sol", + "is_dependency": false, + "lines": [ + 1 + ], + "starting_column": 1, + "ending_column": 24 + }, + "type_specific_fields": { + "directive": [ + "solidity", + "0.6", + ".10" + ] + } + } + ], + "description": "Pragma version0.6.10 (tests/detectors/solc-version/0.6.10/static.sol#1) allows old versions\n", + "markdown": "Pragma version[0.6.10](tests/detectors/solc-version/0.6.10/static.sol#L1) allows old versions\n", + "id": "f8fa962b3064cc35b3504cfbd7bd2067f90239895c1c23a55ce6666803131780", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [], + "description": "solc-0.6.10 is not recommended for deployment\n", + "markdown": "solc-0.6.10 is not recommended for deployment\n", + "id": "b2c2f26d29a163098673e6dcb2342e00d94996a84040bac62f7dbb2f20fa8f28", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/solc-version/0.6.11/dynamic_1.sol b/tests/detectors/solc-version/0.6.11/dynamic_1.sol new file mode 100644 index 0000000000..51f20870f5 --- /dev/null +++ b/tests/detectors/solc-version/0.6.11/dynamic_1.sol @@ -0,0 +1,5 @@ +pragma solidity ^0.6.10; + +contract Contract{ + +} diff --git a/tests/detectors/solc-version/0.6.11/dynamic_1.sol.0.6.11.IncorrectSolc.json b/tests/detectors/solc-version/0.6.11/dynamic_1.sol.0.6.11.IncorrectSolc.json new file mode 100644 index 0000000000..59d2011a9b --- /dev/null +++ b/tests/detectors/solc-version/0.6.11/dynamic_1.sol.0.6.11.IncorrectSolc.json @@ -0,0 +1,40 @@ +[ + [ + { + "elements": [ + { + "type": "pragma", + "name": "^0.6.10", + "source_mapping": { + "start": 0, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/solc-version/0.6.11/dynamic_1.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/solc-version/0.6.11/dynamic_1.sol", + "is_dependency": false, + "lines": [ + 1 + ], + "starting_column": 1, + "ending_column": 25 + }, + "type_specific_fields": { + "directive": [ + "solidity", + "^", + "0.6", + ".10" + ] + } + } + ], + "description": "Pragma version^0.6.10 (tests/detectors/solc-version/0.6.11/dynamic_1.sol#1) allows old versions\n", + "markdown": "Pragma version[^0.6.10](tests/detectors/solc-version/0.6.11/dynamic_1.sol#L1) allows old versions\n", + "id": "ba2de3955a664b3846697e1ad89d5eb477b9992d67d86bf5ac36b904a8ccca4b", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/solc-version/0.6.11/dynamic_2.sol b/tests/detectors/solc-version/0.6.11/dynamic_2.sol new file mode 100644 index 0000000000..859e419499 --- /dev/null +++ b/tests/detectors/solc-version/0.6.11/dynamic_2.sol @@ -0,0 +1,5 @@ +pragma solidity >=0.6.0 <0.7.0; + +contract Contract{ + +} diff --git a/tests/detectors/solc-version/0.6.11/dynamic_2.sol.0.6.11.IncorrectSolc.json b/tests/detectors/solc-version/0.6.11/dynamic_2.sol.0.6.11.IncorrectSolc.json new file mode 100644 index 0000000000..6071a2aff4 --- /dev/null +++ b/tests/detectors/solc-version/0.6.11/dynamic_2.sol.0.6.11.IncorrectSolc.json @@ -0,0 +1,43 @@ +[ + [ + { + "elements": [ + { + "type": "pragma", + "name": ">=0.6.0<0.7.0", + "source_mapping": { + "start": 0, + "length": 31, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/solc-version/0.6.11/dynamic_2.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/solc-version/0.6.11/dynamic_2.sol", + "is_dependency": false, + "lines": [ + 1 + ], + "starting_column": 1, + "ending_column": 32 + }, + "type_specific_fields": { + "directive": [ + "solidity", + ">=", + "0.6", + ".0", + "<", + "0.7", + ".0" + ] + } + } + ], + "description": "Pragma version>=0.6.0<0.7.0 (tests/detectors/solc-version/0.6.11/dynamic_2.sol#1) allows old versions\n", + "markdown": "Pragma version[>=0.6.0<0.7.0](tests/detectors/solc-version/0.6.11/dynamic_2.sol#L1) allows old versions\n", + "id": "8c08bc3809d977ad0253b208683307501206a69d53c84f78e68fad3ae144117c", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/solc-version/0.6.11/static.sol b/tests/detectors/solc-version/0.6.11/static.sol new file mode 100644 index 0000000000..4dfbfc36c8 --- /dev/null +++ b/tests/detectors/solc-version/0.6.11/static.sol @@ -0,0 +1,5 @@ +pragma solidity 0.6.11; + +contract C{ + +} diff --git a/tests/detectors/solc-version/0.6.11/static.sol.0.6.11.IncorrectSolc.json b/tests/detectors/solc-version/0.6.11/static.sol.0.6.11.IncorrectSolc.json new file mode 100644 index 0000000000..5825bcacc6 --- /dev/null +++ b/tests/detectors/solc-version/0.6.11/static.sol.0.6.11.IncorrectSolc.json @@ -0,0 +1,3 @@ +[ + [] +] \ No newline at end of file diff --git a/tests/detectors/solc-version/0.7.4/static.sol b/tests/detectors/solc-version/0.7.4/static.sol new file mode 100644 index 0000000000..df91654943 --- /dev/null +++ b/tests/detectors/solc-version/0.7.4/static.sol @@ -0,0 +1,5 @@ +pragma solidity 0.7.4; + +contract C{ + +} diff --git a/tests/detectors/solc-version/0.7.4/static.sol.0.7.4.IncorrectSolc.json b/tests/detectors/solc-version/0.7.4/static.sol.0.7.4.IncorrectSolc.json new file mode 100644 index 0000000000..d531ba088a --- /dev/null +++ b/tests/detectors/solc-version/0.7.4/static.sol.0.7.4.IncorrectSolc.json @@ -0,0 +1,48 @@ +[ + [ + { + "elements": [ + { + "type": "pragma", + "name": "0.7.4", + "source_mapping": { + "start": 0, + "length": 22, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/solc-version/0.7.4/static.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/solc-version/0.7.4/static.sol", + "is_dependency": false, + "lines": [ + 1 + ], + "starting_column": 1, + "ending_column": 23 + }, + "type_specific_fields": { + "directive": [ + "solidity", + "0.7", + ".4" + ] + } + } + ], + "description": "Pragma version0.7.4 (tests/detectors/solc-version/0.7.4/static.sol#1) allows old versions\n", + "markdown": "Pragma version[0.7.4](tests/detectors/solc-version/0.7.4/static.sol#L1) allows old versions\n", + "id": "770bd3666c605dc3b8e7422296714d365b70b9bf6b75b35ef42c2068568dd6f2", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [], + "description": "solc-0.7.4 is not recommended for deployment\n", + "markdown": "solc-0.7.4 is not recommended for deployment\n", + "id": "27e54a3813c974274b355c03bd742d4f2b8cd63fa57143b4fb741cbecd022dd2", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/solc-version/0.7.6/dynamic_1.sol b/tests/detectors/solc-version/0.7.6/dynamic_1.sol new file mode 100644 index 0000000000..75610eaa89 --- /dev/null +++ b/tests/detectors/solc-version/0.7.6/dynamic_1.sol @@ -0,0 +1,5 @@ +pragma solidity ^0.7.4; + +contract Contract{ + +} diff --git a/tests/detectors/solc-version/0.7.6/dynamic_1.sol.0.7.6.IncorrectSolc.json b/tests/detectors/solc-version/0.7.6/dynamic_1.sol.0.7.6.IncorrectSolc.json new file mode 100644 index 0000000000..82ee712799 --- /dev/null +++ b/tests/detectors/solc-version/0.7.6/dynamic_1.sol.0.7.6.IncorrectSolc.json @@ -0,0 +1,40 @@ +[ + [ + { + "elements": [ + { + "type": "pragma", + "name": "^0.7.4", + "source_mapping": { + "start": 0, + "length": 23, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/solc-version/0.7.6/dynamic_1.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/solc-version/0.7.6/dynamic_1.sol", + "is_dependency": false, + "lines": [ + 1 + ], + "starting_column": 1, + "ending_column": 24 + }, + "type_specific_fields": { + "directive": [ + "solidity", + "^", + "0.7", + ".4" + ] + } + } + ], + "description": "Pragma version^0.7.4 (tests/detectors/solc-version/0.7.6/dynamic_1.sol#1) allows old versions\n", + "markdown": "Pragma version[^0.7.4](tests/detectors/solc-version/0.7.6/dynamic_1.sol#L1) allows old versions\n", + "id": "e46d6be1a19a445ff20b2e96a37cb7355cf88d3c93d72bfc963db2a86f303d11", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/solc-version/0.7.6/dynamic_2.sol b/tests/detectors/solc-version/0.7.6/dynamic_2.sol new file mode 100644 index 0000000000..a069eaf28c --- /dev/null +++ b/tests/detectors/solc-version/0.7.6/dynamic_2.sol @@ -0,0 +1,5 @@ +pragma solidity >=0.7.0 <=0.7.6; + +contract Contract{ + +} diff --git a/tests/detectors/solc-version/0.7.6/dynamic_2.sol.0.7.6.IncorrectSolc.json b/tests/detectors/solc-version/0.7.6/dynamic_2.sol.0.7.6.IncorrectSolc.json new file mode 100644 index 0000000000..a16b2f3d75 --- /dev/null +++ b/tests/detectors/solc-version/0.7.6/dynamic_2.sol.0.7.6.IncorrectSolc.json @@ -0,0 +1,43 @@ +[ + [ + { + "elements": [ + { + "type": "pragma", + "name": ">=0.7.0<=0.7.6", + "source_mapping": { + "start": 0, + "length": 32, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/solc-version/0.7.6/dynamic_2.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/solc-version/0.7.6/dynamic_2.sol", + "is_dependency": false, + "lines": [ + 1 + ], + "starting_column": 1, + "ending_column": 33 + }, + "type_specific_fields": { + "directive": [ + "solidity", + ">=", + "0.7", + ".0", + "<=", + "0.7", + ".6" + ] + } + } + ], + "description": "Pragma version>=0.7.0<=0.7.6 (tests/detectors/solc-version/0.7.6/dynamic_2.sol#1) is too complex\n", + "markdown": "Pragma version[>=0.7.0<=0.7.6](tests/detectors/solc-version/0.7.6/dynamic_2.sol#L1) is too complex\n", + "id": "d63860d6851dda74b9cb989aa5ef5bbb9bcc22c1b6f217b9356c0fc843b78386", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/solc-version/0.7.6/static.sol b/tests/detectors/solc-version/0.7.6/static.sol new file mode 100644 index 0000000000..e6a05ab264 --- /dev/null +++ b/tests/detectors/solc-version/0.7.6/static.sol @@ -0,0 +1,5 @@ +pragma solidity 0.7.6; + +contract C{ + +} diff --git a/tests/detectors/solc-version/0.7.6/static.sol.0.7.6.IncorrectSolc.json b/tests/detectors/solc-version/0.7.6/static.sol.0.7.6.IncorrectSolc.json new file mode 100644 index 0000000000..5825bcacc6 --- /dev/null +++ b/tests/detectors/solc-version/0.7.6/static.sol.0.7.6.IncorrectSolc.json @@ -0,0 +1,3 @@ +[ + [] +] \ No newline at end of file diff --git a/tests/detectors/solc-version/old_solc.sol b/tests/detectors/solc-version/old_solc.sol deleted file mode 100644 index bc1cd1ee66..0000000000 --- a/tests/detectors/solc-version/old_solc.sol +++ /dev/null @@ -1,5 +0,0 @@ -pragma solidity 0.4.21; - -contract C{ - -} diff --git a/tests/detectors/solc-version/solc_version_incorrect.sol b/tests/detectors/solc-version/solc_version_incorrect.sol deleted file mode 100644 index 49b5f3d1b6..0000000000 --- a/tests/detectors/solc-version/solc_version_incorrect.sol +++ /dev/null @@ -1,6 +0,0 @@ -// The version pragma below should get flagged by the detector -pragma solidity ^0.4.23; -pragma solidity >=0.4.0 <0.6.0; -contract Contract{ - -} diff --git a/tests/detectors/solc-version/solc_version_incorrect.sol.0.4.25.IncorrectSolc.json b/tests/detectors/solc-version/solc_version_incorrect.sol.0.4.25.IncorrectSolc.json deleted file mode 100644 index 0bb35a99e8..0000000000 --- a/tests/detectors/solc-version/solc_version_incorrect.sol.0.4.25.IncorrectSolc.json +++ /dev/null @@ -1,88 +0,0 @@ -[ - [ - { - "elements": [ - { - "type": "pragma", - "name": "^0.4.23", - "source_mapping": { - "start": 63, - "length": 24, - "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/solc-version/solc_version_incorrect.sol", - "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/solc-version/solc_version_incorrect.sol", - "is_dependency": false, - "lines": [ - 2 - ], - "starting_column": 1, - "ending_column": 25 - }, - "type_specific_fields": { - "directive": [ - "solidity", - "^", - "0.4", - ".23" - ] - } - } - ], - "description": "Pragma version^0.4.23 (tests/detectors/solc-version/solc_version_incorrect.sol#2) allows old versions\n", - "markdown": "Pragma version[^0.4.23](tests/detectors/solc-version/solc_version_incorrect.sol#L2) allows old versions\n", - "id": "9e8a7bb5987ce0fe4737630abd296ce35c96b7f0a7ad285234713e22354e5fa8", - "check": "solc-version", - "impact": "Informational", - "confidence": "High" - }, - { - "elements": [ - { - "type": "pragma", - "name": ">=0.4.0<0.6.0", - "source_mapping": { - "start": 89, - "length": 31, - "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/solc-version/solc_version_incorrect.sol", - "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/solc-version/solc_version_incorrect.sol", - "is_dependency": false, - "lines": [ - 3 - ], - "starting_column": 1, - "ending_column": 32 - }, - "type_specific_fields": { - "directive": [ - "solidity", - ">=", - "0.4", - ".0", - "<", - "0.6", - ".0" - ] - } - } - ], - "description": "Pragma version>=0.4.0<0.6.0 (tests/detectors/solc-version/solc_version_incorrect.sol#3) allows old versions\n", - "markdown": "Pragma version[>=0.4.0<0.6.0](tests/detectors/solc-version/solc_version_incorrect.sol#L3) allows old versions\n", - "id": "70f700a75d3fbd63be6d884dc523f5722dcc2289ad87207e9f69e0cbb218df6b", - "check": "solc-version", - "impact": "Informational", - "confidence": "High" - }, - { - "elements": [], - "description": "solc-0.4.25 is not recommended for deployment\n", - "markdown": "solc-0.4.25 is not recommended for deployment\n", - "id": "4d64003d70a62b1c6963f871e841b6cbd633d07d95554e1a50e0f25d9b71ebb3", - "check": "solc-version", - "impact": "Informational", - "confidence": "High" - } - ] -] \ No newline at end of file diff --git a/tests/detectors/solc-version/solc_version_incorrect_05.sol b/tests/detectors/solc-version/solc_version_incorrect_05.sol deleted file mode 100644 index 19858f1121..0000000000 --- a/tests/detectors/solc-version/solc_version_incorrect_05.sol +++ /dev/null @@ -1,7 +0,0 @@ -// The version pragma below should get flagged by the detector -pragma solidity ^0.5.5; -pragma solidity 0.5.7; - -contract Contract{ - -} diff --git a/tests/detectors/solc-version/solc_version_incorrect_05.sol.0.5.7.IncorrectSolc.json b/tests/detectors/solc-version/solc_version_incorrect_05.sol.0.5.7.IncorrectSolc.json deleted file mode 100644 index 68c11d0b9e..0000000000 --- a/tests/detectors/solc-version/solc_version_incorrect_05.sol.0.5.7.IncorrectSolc.json +++ /dev/null @@ -1,84 +0,0 @@ -[ - [ - { - "elements": [ - { - "type": "pragma", - "name": "^0.5.5", - "source_mapping": { - "start": 63, - "length": 23, - "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/solc-version/solc_version_incorrect_05.sol", - "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/solc-version/solc_version_incorrect_05.sol", - "is_dependency": false, - "lines": [ - 2 - ], - "starting_column": 1, - "ending_column": 24 - }, - "type_specific_fields": { - "directive": [ - "solidity", - "^", - "0.5", - ".5" - ] - } - } - ], - "description": "Pragma version^0.5.5 (tests/detectors/solc-version/solc_version_incorrect_05.sol#2) is known to contain severe issues (https://solidity.readthedocs.io/en/latest/bugs.html)\n", - "markdown": "Pragma version[^0.5.5](tests/detectors/solc-version/solc_version_incorrect_05.sol#L2) is known to contain severe issues (https://solidity.readthedocs.io/en/latest/bugs.html)\n", - "id": "bdfe04d54ea5e3c3450dfcc88d663e870410def39c0eff26e9ca106855268e40", - "check": "solc-version", - "impact": "Informational", - "confidence": "High" - }, - { - "elements": [ - { - "type": "pragma", - "name": "0.5.7", - "source_mapping": { - "start": 87, - "length": 22, - "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/solc-version/solc_version_incorrect_05.sol", - "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/solc-version/solc_version_incorrect_05.sol", - "is_dependency": false, - "lines": [ - 3 - ], - "starting_column": 1, - "ending_column": 23 - }, - "type_specific_fields": { - "directive": [ - "solidity", - "0.5", - ".7" - ] - } - } - ], - "description": "Pragma version0.5.7 (tests/detectors/solc-version/solc_version_incorrect_05.sol#3) allows old versions\n", - "markdown": "Pragma version[0.5.7](tests/detectors/solc-version/solc_version_incorrect_05.sol#L3) allows old versions\n", - "id": "bf922f94b9333a8f10fca8ea8bed93e8ee8ed5b398b0e730a361f9bc42570a92", - "check": "solc-version", - "impact": "Informational", - "confidence": "High" - }, - { - "elements": [], - "description": "solc-0.5.7 is not recommended for deployment\n", - "markdown": "solc-0.5.7 is not recommended for deployment\n", - "id": "198d7f1df469662424720d03245311877e3b860e9b1ef666447ec8b3c03d557b", - "check": "solc-version", - "impact": "Informational", - "confidence": "High" - } - ] -] \ No newline at end of file diff --git a/tests/detectors/storage-array/storage_signed_integer_array.sol b/tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol similarity index 100% rename from tests/detectors/storage-array/storage_signed_integer_array.sol rename to tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol diff --git a/tests/detectors/storage-array/storage_signed_integer_array.sol.0.5.8.StorageSignedIntegerArray.json b/tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol.0.5.10.StorageSignedIntegerArray.json similarity index 88% rename from tests/detectors/storage-array/storage_signed_integer_array.sol.0.5.8.StorageSignedIntegerArray.json rename to tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol.0.5.10.StorageSignedIntegerArray.json index d5a591b75f..df1e4c8315 100644 --- a/tests/detectors/storage-array/storage_signed_integer_array.sol.0.5.8.StorageSignedIntegerArray.json +++ b/tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol.0.5.10.StorageSignedIntegerArray.json @@ -9,9 +9,9 @@ "start": 25, "length": 2256, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/storage-array/storage_signed_integer_array.sol", + "filename_relative": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/storage-array/storage_signed_integer_array.sol", + "filename_short": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol", "is_dependency": false, "lines": [ 3, @@ -64,19 +64,19 @@ }, { "type": "function", - "name": "bad0", + "name": "bad1", "source_mapping": { - "start": 355, - "length": 132, + "start": 601, + "length": 170, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/storage-array/storage_signed_integer_array.sol", + "filename_relative": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/storage-array/storage_signed_integer_array.sol", + "filename_short": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol", "is_dependency": false, "lines": [ - 10, - 11, - 12 + 15, + 16, + 17 ], "starting_column": 3, "ending_column": 4 @@ -89,9 +89,9 @@ "start": 25, "length": 2256, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/storage-array/storage_signed_integer_array.sol", + "filename_relative": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/storage-array/storage_signed_integer_array.sol", + "filename_short": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol", "is_dependency": false, "lines": [ 3, @@ -142,42 +142,42 @@ "ending_column": 2 } }, - "signature": "bad0()" + "signature": "bad1(int128[3])" } }, { "type": "node", - "name": "intArray = (- 1,- 2,- 3)", + "name": "intArray = userArray", "source_mapping": { - "start": 384, - "length": 23, + "start": 746, + "length": 20, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/storage-array/storage_signed_integer_array.sol", + "filename_relative": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/storage-array/storage_signed_integer_array.sol", + "filename_short": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol", "is_dependency": false, "lines": [ - 11 + 16 ], "starting_column": 5, - "ending_column": 28 + "ending_column": 25 }, "type_specific_fields": { "parent": { "type": "function", - "name": "bad0", + "name": "bad1", "source_mapping": { - "start": 355, - "length": 132, + "start": 601, + "length": 170, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/storage-array/storage_signed_integer_array.sol", + "filename_relative": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/storage-array/storage_signed_integer_array.sol", + "filename_short": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol", "is_dependency": false, "lines": [ - 10, - 11, - 12 + 15, + 16, + 17 ], "starting_column": 3, "ending_column": 4 @@ -190,9 +190,9 @@ "start": 25, "length": 2256, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/storage-array/storage_signed_integer_array.sol", + "filename_relative": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/storage-array/storage_signed_integer_array.sol", + "filename_short": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol", "is_dependency": false, "lines": [ 3, @@ -243,15 +243,15 @@ "ending_column": 2 } }, - "signature": "bad0()" + "signature": "bad1(int128[3])" } } } } ], - "description": "Contract A (tests/detectors/storage-array/storage_signed_integer_array.sol#3-45) \n\t- Function A.bad0() (tests/detectors/storage-array/storage_signed_integer_array.sol#10-12)\n\t\t- intArray = (- 1,- 2,- 3) (tests/detectors/storage-array/storage_signed_integer_array.sol#11) has a storage signed integer array assignment\n", - "markdown": "Contract [A](tests/detectors/storage-array/storage_signed_integer_array.sol#L3-L45) \n\t- Function [A.bad0()](tests/detectors/storage-array/storage_signed_integer_array.sol#L10-L12)\n\t\t- [intArray = (- 1,- 2,- 3)](tests/detectors/storage-array/storage_signed_integer_array.sol#L11) has a storage signed integer array assignment\n", - "id": "9301f6205d07f9bc40477e940ab7093092a8616caab1c78a2b84412ff6dd2eb1", + "description": "Contract A (tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#3-45) \n\t- Function A.bad1(int128[3]) (tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#15-17)\n\t\t- intArray = userArray (tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#16) has a storage signed integer array assignment\n", + "markdown": "Contract [A](tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#L3-L45) \n\t- Function [A.bad1(int128[3])](tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#L15-L17)\n\t\t- [intArray = userArray](tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#L16) has a storage signed integer array assignment\n", + "id": "7ba5efbfb61ba63a7ac01d376a0cede2fda18c2a2d8604c4a82cccec92ae2bdb", "check": "storage-array", "impact": "High", "confidence": "Medium" @@ -265,9 +265,9 @@ "start": 25, "length": 2256, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/storage-array/storage_signed_integer_array.sol", + "filename_relative": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/storage-array/storage_signed_integer_array.sol", + "filename_short": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol", "is_dependency": false, "lines": [ 3, @@ -320,19 +320,19 @@ }, { "type": "function", - "name": "bad1", + "name": "bad0", "source_mapping": { - "start": 601, - "length": 170, + "start": 355, + "length": 132, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/storage-array/storage_signed_integer_array.sol", + "filename_relative": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/storage-array/storage_signed_integer_array.sol", + "filename_short": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol", "is_dependency": false, "lines": [ - 15, - 16, - 17 + 10, + 11, + 12 ], "starting_column": 3, "ending_column": 4 @@ -345,9 +345,9 @@ "start": 25, "length": 2256, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/storage-array/storage_signed_integer_array.sol", + "filename_relative": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/storage-array/storage_signed_integer_array.sol", + "filename_short": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol", "is_dependency": false, "lines": [ 3, @@ -398,42 +398,42 @@ "ending_column": 2 } }, - "signature": "bad1(int128[3])" + "signature": "bad0()" } }, { "type": "node", - "name": "intArray = userArray", + "name": "intArray = (- 1,- 2,- 3)", "source_mapping": { - "start": 746, - "length": 20, + "start": 384, + "length": 23, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/storage-array/storage_signed_integer_array.sol", + "filename_relative": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/storage-array/storage_signed_integer_array.sol", + "filename_short": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol", "is_dependency": false, "lines": [ - 16 + 11 ], "starting_column": 5, - "ending_column": 25 + "ending_column": 28 }, "type_specific_fields": { "parent": { "type": "function", - "name": "bad1", + "name": "bad0", "source_mapping": { - "start": 601, - "length": 170, + "start": 355, + "length": 132, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/storage-array/storage_signed_integer_array.sol", + "filename_relative": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/storage-array/storage_signed_integer_array.sol", + "filename_short": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol", "is_dependency": false, "lines": [ - 15, - 16, - 17 + 10, + 11, + 12 ], "starting_column": 3, "ending_column": 4 @@ -446,9 +446,9 @@ "start": 25, "length": 2256, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/storage-array/storage_signed_integer_array.sol", + "filename_relative": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/storage-array/storage_signed_integer_array.sol", + "filename_short": "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol", "is_dependency": false, "lines": [ 3, @@ -499,15 +499,15 @@ "ending_column": 2 } }, - "signature": "bad1(int128[3])" + "signature": "bad0()" } } } } ], - "description": "Contract A (tests/detectors/storage-array/storage_signed_integer_array.sol#3-45) \n\t- Function A.bad1(int128[3]) (tests/detectors/storage-array/storage_signed_integer_array.sol#15-17)\n\t\t- intArray = userArray (tests/detectors/storage-array/storage_signed_integer_array.sol#16) has a storage signed integer array assignment\n", - "markdown": "Contract [A](tests/detectors/storage-array/storage_signed_integer_array.sol#L3-L45) \n\t- Function [A.bad1(int128[3])](tests/detectors/storage-array/storage_signed_integer_array.sol#L15-L17)\n\t\t- [intArray = userArray](tests/detectors/storage-array/storage_signed_integer_array.sol#L16) has a storage signed integer array assignment\n", - "id": "e91a19803d53092184a9c091054f1ef371c8e5f9db15c5be6979bc4d06b70362", + "description": "Contract A (tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#3-45) \n\t- Function A.bad0() (tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#10-12)\n\t\t- intArray = (- 1,- 2,- 3) (tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#11) has a storage signed integer array assignment\n", + "markdown": "Contract [A](tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#L3-L45) \n\t- Function [A.bad0()](tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#L10-L12)\n\t\t- [intArray = (- 1,- 2,- 3)](tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol#L11) has a storage signed integer array assignment\n", + "id": "da870be9a396bc52d2f6f8caeb00e6b8809ad1b6fb4c24a019568257b3404a2f", "check": "storage-array", "impact": "High", "confidence": "Medium" diff --git a/tests/detectors/storage-array/0.5.16/storage_signed_integer_array.sol b/tests/detectors/storage-array/0.5.16/storage_signed_integer_array.sol new file mode 100644 index 0000000000..c85e14ec35 --- /dev/null +++ b/tests/detectors/storage-array/0.5.16/storage_signed_integer_array.sol @@ -0,0 +1,45 @@ +pragma solidity ^0.5.8; + +contract A { + + int[3] intArray; // storage signed integer array + uint[3] uintArray; // storage unsigned integer array + + + /* Signed integer array initializations with literal arrays are vulnerable */ + function bad0() public { + intArray = [-1, -2, -3]; + } + + /* Signed integer array assignments are vulnerable if the base types are different e.g. int256 vs int128 */ + function bad1(int128[3] memory userArray) public { + intArray = userArray; + } + + /* Unsigned Int array initializations are not vulnerable */ + function good0() public { + uintArray = [0, 1, 2]; + } + + /* Unsigned Int array assignments are not vulnerable */ + function good1(uint[3] memory userArray) public { + uintArray = userArray; + } + + /* Assigning individual array elements are not vulnerable */ + function good2() public { + intArray[1] = -1; + } + + /* Assignment between two signed integer arrays of same base type int256 are not vulnerable */ + function good3(int[3] memory userArray) public { + intArray = userArray; + } + + /* Array literal initialization of in-memory signed integer arrays are not vulnerable */ + function good4() public { + int8[3] memory memIntArray; + memIntArray = [-1, -2, -3]; + } + +} diff --git a/tests/detectors/storage-array/0.5.16/storage_signed_integer_array.sol.0.5.16.StorageSignedIntegerArray.json b/tests/detectors/storage-array/0.5.16/storage_signed_integer_array.sol.0.5.16.StorageSignedIntegerArray.json new file mode 100644 index 0000000000..5825bcacc6 --- /dev/null +++ b/tests/detectors/storage-array/0.5.16/storage_signed_integer_array.sol.0.5.16.StorageSignedIntegerArray.json @@ -0,0 +1,3 @@ +[ + [] +] \ No newline at end of file diff --git a/tests/detectors/suicidal/0.4.25/suicidal.sol b/tests/detectors/suicidal/0.4.25/suicidal.sol new file mode 100644 index 0000000000..428c794d4d --- /dev/null +++ b/tests/detectors/suicidal/0.4.25/suicidal.sol @@ -0,0 +1,8 @@ + +contract C{ + + function i_am_a_backdoor() public{ + selfdestruct(msg.sender); + } + +} diff --git a/tests/detectors/backdoor/backdoor.sol.0.5.1.Suicidal.json b/tests/detectors/suicidal/0.4.25/suicidal.sol.0.4.25.Suicidal.json similarity index 82% rename from tests/detectors/backdoor/backdoor.sol.0.5.1.Suicidal.json rename to tests/detectors/suicidal/0.4.25/suicidal.sol.0.4.25.Suicidal.json index a2d2e8d702..090d98efcf 100644 --- a/tests/detectors/backdoor/backdoor.sol.0.5.1.Suicidal.json +++ b/tests/detectors/suicidal/0.4.25/suicidal.sol.0.4.25.Suicidal.json @@ -9,9 +9,9 @@ "start": 18, "length": 74, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/backdoor/backdoor.sol", + "filename_relative": "tests/detectors/suicidal/0.4.25/suicidal.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/backdoor/backdoor.sol", + "filename_short": "tests/detectors/suicidal/0.4.25/suicidal.sol", "is_dependency": false, "lines": [ 4, @@ -29,9 +29,9 @@ "start": 1, "length": 94, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/backdoor/backdoor.sol", + "filename_relative": "tests/detectors/suicidal/0.4.25/suicidal.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/backdoor/backdoor.sol", + "filename_short": "tests/detectors/suicidal/0.4.25/suicidal.sol", "is_dependency": false, "lines": [ 2, @@ -50,8 +50,8 @@ } } ], - "description": "C.i_am_a_backdoor() (tests/detectors/backdoor/backdoor.sol#4-6) allows anyone to destruct the contract\n", - "markdown": "[C.i_am_a_backdoor()](tests/detectors/backdoor/backdoor.sol#L4-L6) allows anyone to destruct the contract\n", + "description": "C.i_am_a_backdoor() (tests/detectors/suicidal/0.4.25/suicidal.sol#4-6) allows anyone to destruct the contract\n", + "markdown": "[C.i_am_a_backdoor()](tests/detectors/suicidal/0.4.25/suicidal.sol#L4-L6) allows anyone to destruct the contract\n", "id": "bb1e4596537b6e2c29f4221e733692fd6dac8555095181718e440ca525016eb7", "check": "suicidal", "impact": "High", diff --git a/tests/detectors/suicidal/0.5.16/suicidal.sol b/tests/detectors/suicidal/0.5.16/suicidal.sol new file mode 100644 index 0000000000..428c794d4d --- /dev/null +++ b/tests/detectors/suicidal/0.5.16/suicidal.sol @@ -0,0 +1,8 @@ + +contract C{ + + function i_am_a_backdoor() public{ + selfdestruct(msg.sender); + } + +} diff --git a/tests/detectors/suicidal/0.5.16/suicidal.sol.0.5.16.Suicidal.json b/tests/detectors/suicidal/0.5.16/suicidal.sol.0.5.16.Suicidal.json new file mode 100644 index 0000000000..761450ce7d --- /dev/null +++ b/tests/detectors/suicidal/0.5.16/suicidal.sol.0.5.16.Suicidal.json @@ -0,0 +1,61 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "i_am_a_backdoor", + "source_mapping": { + "start": 18, + "length": 74, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/suicidal/0.5.16/suicidal.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/suicidal/0.5.16/suicidal.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 1, + "length": 94, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/suicidal/0.5.16/suicidal.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/suicidal/0.5.16/suicidal.sol", + "is_dependency": false, + "lines": [ + 2, + 3, + 4, + 5, + 6, + 7, + 8 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "i_am_a_backdoor()" + } + } + ], + "description": "C.i_am_a_backdoor() (tests/detectors/suicidal/0.5.16/suicidal.sol#4-6) allows anyone to destruct the contract\n", + "markdown": "[C.i_am_a_backdoor()](tests/detectors/suicidal/0.5.16/suicidal.sol#L4-L6) allows anyone to destruct the contract\n", + "id": "bb1e4596537b6e2c29f4221e733692fd6dac8555095181718e440ca525016eb7", + "check": "suicidal", + "impact": "High", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/suicidal/0.6.11/suicidal.sol b/tests/detectors/suicidal/0.6.11/suicidal.sol new file mode 100644 index 0000000000..428c794d4d --- /dev/null +++ b/tests/detectors/suicidal/0.6.11/suicidal.sol @@ -0,0 +1,8 @@ + +contract C{ + + function i_am_a_backdoor() public{ + selfdestruct(msg.sender); + } + +} diff --git a/tests/detectors/suicidal/0.6.11/suicidal.sol.0.6.11.Suicidal.json b/tests/detectors/suicidal/0.6.11/suicidal.sol.0.6.11.Suicidal.json new file mode 100644 index 0000000000..28accbb792 --- /dev/null +++ b/tests/detectors/suicidal/0.6.11/suicidal.sol.0.6.11.Suicidal.json @@ -0,0 +1,61 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "i_am_a_backdoor", + "source_mapping": { + "start": 18, + "length": 74, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/suicidal/0.6.11/suicidal.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/suicidal/0.6.11/suicidal.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 1, + "length": 94, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/suicidal/0.6.11/suicidal.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/suicidal/0.6.11/suicidal.sol", + "is_dependency": false, + "lines": [ + 2, + 3, + 4, + 5, + 6, + 7, + 8 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "i_am_a_backdoor()" + } + } + ], + "description": "C.i_am_a_backdoor() (tests/detectors/suicidal/0.6.11/suicidal.sol#4-6) allows anyone to destruct the contract\n", + "markdown": "[C.i_am_a_backdoor()](tests/detectors/suicidal/0.6.11/suicidal.sol#L4-L6) allows anyone to destruct the contract\n", + "id": "bb1e4596537b6e2c29f4221e733692fd6dac8555095181718e440ca525016eb7", + "check": "suicidal", + "impact": "High", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/suicidal/0.7.6/suicidal.sol b/tests/detectors/suicidal/0.7.6/suicidal.sol new file mode 100644 index 0000000000..428c794d4d --- /dev/null +++ b/tests/detectors/suicidal/0.7.6/suicidal.sol @@ -0,0 +1,8 @@ + +contract C{ + + function i_am_a_backdoor() public{ + selfdestruct(msg.sender); + } + +} diff --git a/tests/detectors/backdoor/backdoor.sol.0.4.25.Suicidal.json b/tests/detectors/suicidal/0.7.6/suicidal.sol.0.7.6.Suicidal.json similarity index 82% rename from tests/detectors/backdoor/backdoor.sol.0.4.25.Suicidal.json rename to tests/detectors/suicidal/0.7.6/suicidal.sol.0.7.6.Suicidal.json index a2d2e8d702..31a3ac157a 100644 --- a/tests/detectors/backdoor/backdoor.sol.0.4.25.Suicidal.json +++ b/tests/detectors/suicidal/0.7.6/suicidal.sol.0.7.6.Suicidal.json @@ -9,9 +9,9 @@ "start": 18, "length": 74, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/backdoor/backdoor.sol", + "filename_relative": "tests/detectors/suicidal/0.7.6/suicidal.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/backdoor/backdoor.sol", + "filename_short": "tests/detectors/suicidal/0.7.6/suicidal.sol", "is_dependency": false, "lines": [ 4, @@ -29,9 +29,9 @@ "start": 1, "length": 94, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/backdoor/backdoor.sol", + "filename_relative": "tests/detectors/suicidal/0.7.6/suicidal.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/backdoor/backdoor.sol", + "filename_short": "tests/detectors/suicidal/0.7.6/suicidal.sol", "is_dependency": false, "lines": [ 2, @@ -50,8 +50,8 @@ } } ], - "description": "C.i_am_a_backdoor() (tests/detectors/backdoor/backdoor.sol#4-6) allows anyone to destruct the contract\n", - "markdown": "[C.i_am_a_backdoor()](tests/detectors/backdoor/backdoor.sol#L4-L6) allows anyone to destruct the contract\n", + "description": "C.i_am_a_backdoor() (tests/detectors/suicidal/0.7.6/suicidal.sol#4-6) allows anyone to destruct the contract\n", + "markdown": "[C.i_am_a_backdoor()](tests/detectors/suicidal/0.7.6/suicidal.sol#L4-L6) allows anyone to destruct the contract\n", "id": "bb1e4596537b6e2c29f4221e733692fd6dac8555095181718e440ca525016eb7", "check": "suicidal", "impact": "High", diff --git a/tests/detectors/timestamp/timestamp.sol b/tests/detectors/timestamp/0.4.25/timestamp.sol similarity index 100% rename from tests/detectors/timestamp/timestamp.sol rename to tests/detectors/timestamp/0.4.25/timestamp.sol diff --git a/tests/detectors/timestamp/timestamp.sol.0.4.25.Timestamp.json b/tests/detectors/timestamp/0.4.25/timestamp.sol.0.4.25.Timestamp.json similarity index 89% rename from tests/detectors/timestamp/timestamp.sol.0.4.25.Timestamp.json rename to tests/detectors/timestamp/0.4.25/timestamp.sol.0.4.25.Timestamp.json index 2086e0864f..408a071e84 100644 --- a/tests/detectors/timestamp/timestamp.sol.0.4.25.Timestamp.json +++ b/tests/detectors/timestamp/0.4.25/timestamp.sol.0.4.25.Timestamp.json @@ -9,9 +9,9 @@ "start": 47, "length": 70, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.4.25/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.4.25/timestamp.sol", "is_dependency": false, "lines": [ 4, @@ -29,9 +29,9 @@ "start": 0, "length": 402, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.4.25/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.4.25/timestamp.sol", "is_dependency": false, "lines": [ 1, @@ -69,9 +69,9 @@ "start": 81, "length": 29, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.4.25/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.4.25/timestamp.sol", "is_dependency": false, "lines": [ 5 @@ -87,9 +87,9 @@ "start": 47, "length": 70, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.4.25/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.4.25/timestamp.sol", "is_dependency": false, "lines": [ 4, @@ -107,9 +107,9 @@ "start": 0, "length": 402, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.4.25/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.4.25/timestamp.sol", "is_dependency": false, "lines": [ 1, @@ -143,9 +143,9 @@ } } ], - "description": "Timestamp.bad0() (tests/detectors/timestamp/timestamp.sol#4-6) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- require(bool)(block.timestamp == 0) (tests/detectors/timestamp/timestamp.sol#5)\n", - "markdown": "[Timestamp.bad0()](tests/detectors/timestamp/timestamp.sol#L4-L6) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [require(bool)(block.timestamp == 0)](tests/detectors/timestamp/timestamp.sol#L5)\n", - "id": "46e99f9c2bab1735f57c130340547f097ca1a8513c2dd374d3cd756da65d2cdf", + "description": "Timestamp.bad0() (tests/detectors/timestamp/0.4.25/timestamp.sol#4-6) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- require(bool)(block.timestamp == 0) (tests/detectors/timestamp/0.4.25/timestamp.sol#5)\n", + "markdown": "[Timestamp.bad0()](tests/detectors/timestamp/0.4.25/timestamp.sol#L4-L6) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [require(bool)(block.timestamp == 0)](tests/detectors/timestamp/0.4.25/timestamp.sol#L5)\n", + "id": "9d7c44d1a332d53aacc312d316891fc85c62db8b5a5a638a64cdb718c9f20029", "check": "timestamp", "impact": "Low", "confidence": "Medium" @@ -159,9 +159,9 @@ "start": 126, "length": 96, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.4.25/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.4.25/timestamp.sol", "is_dependency": false, "lines": [ 8, @@ -180,9 +180,9 @@ "start": 0, "length": 402, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.4.25/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.4.25/timestamp.sol", "is_dependency": false, "lines": [ 1, @@ -220,9 +220,9 @@ "start": 197, "length": 18, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.4.25/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.4.25/timestamp.sol", "is_dependency": false, "lines": [ 10 @@ -238,9 +238,9 @@ "start": 126, "length": 96, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.4.25/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.4.25/timestamp.sol", "is_dependency": false, "lines": [ 8, @@ -259,9 +259,9 @@ "start": 0, "length": 402, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.4.25/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.4.25/timestamp.sol", "is_dependency": false, "lines": [ 1, @@ -295,9 +295,9 @@ } } ], - "description": "Timestamp.bad1() (tests/detectors/timestamp/timestamp.sol#8-11) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- require(bool)(time == 0) (tests/detectors/timestamp/timestamp.sol#10)\n", - "markdown": "[Timestamp.bad1()](tests/detectors/timestamp/timestamp.sol#L8-L11) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [require(bool)(time == 0)](tests/detectors/timestamp/timestamp.sol#L10)\n", - "id": "b05a8b6947761eb595359596ba4ab88c750a4936836c8a5fed948fe92b2577f0", + "description": "Timestamp.bad1() (tests/detectors/timestamp/0.4.25/timestamp.sol#8-11) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- require(bool)(time == 0) (tests/detectors/timestamp/0.4.25/timestamp.sol#10)\n", + "markdown": "[Timestamp.bad1()](tests/detectors/timestamp/0.4.25/timestamp.sol#L8-L11) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [require(bool)(time == 0)](tests/detectors/timestamp/0.4.25/timestamp.sol#L10)\n", + "id": "d2f6167c2351e267210692e16350d8426db102519fe3eaeeadb6d17d2445dbbd", "check": "timestamp", "impact": "Low", "confidence": "Medium" @@ -311,9 +311,9 @@ "start": 231, "length": 79, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.4.25/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.4.25/timestamp.sol", "is_dependency": false, "lines": [ 13, @@ -331,9 +331,9 @@ "start": 0, "length": 402, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.4.25/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.4.25/timestamp.sol", "is_dependency": false, "lines": [ 1, @@ -371,9 +371,9 @@ "start": 279, "length": 24, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.4.25/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.4.25/timestamp.sol", "is_dependency": false, "lines": [ 14 @@ -389,9 +389,9 @@ "start": 231, "length": 79, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.4.25/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.4.25/timestamp.sol", "is_dependency": false, "lines": [ 13, @@ -409,9 +409,9 @@ "start": 0, "length": 402, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.4.25/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.4.25/timestamp.sol", "is_dependency": false, "lines": [ 1, @@ -445,9 +445,9 @@ } } ], - "description": "Timestamp.bad2() (tests/detectors/timestamp/timestamp.sol#13-15) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- block.timestamp > 0 (tests/detectors/timestamp/timestamp.sol#14)\n", - "markdown": "[Timestamp.bad2()](tests/detectors/timestamp/timestamp.sol#L13-L15) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [block.timestamp > 0](tests/detectors/timestamp/timestamp.sol#L14)\n", - "id": "81e4ce4ef359ffa86d6c5dec7f465b84cc71668139ce31ee5c41ecd2fb327179", + "description": "Timestamp.bad2() (tests/detectors/timestamp/0.4.25/timestamp.sol#13-15) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- block.timestamp > 0 (tests/detectors/timestamp/0.4.25/timestamp.sol#14)\n", + "markdown": "[Timestamp.bad2()](tests/detectors/timestamp/0.4.25/timestamp.sol#L13-L15) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [block.timestamp > 0](tests/detectors/timestamp/0.4.25/timestamp.sol#L14)\n", + "id": "2182d79d032d47fdf8137bc06dd7d4c1796356e19fab558e282f5d596391ec58", "check": "timestamp", "impact": "Low", "confidence": "Medium" diff --git a/tests/detectors/timestamp/0.5.16/timestamp.sol b/tests/detectors/timestamp/0.5.16/timestamp.sol new file mode 100644 index 0000000000..8de2a31b41 --- /dev/null +++ b/tests/detectors/timestamp/0.5.16/timestamp.sol @@ -0,0 +1,21 @@ +contract Timestamp{ + event Time(uint); + + function bad0() external{ + require(block.timestamp == 0); + } + + function bad1() external{ + uint time = block.timestamp; + require(time == 0); + } + + function bad2() external returns(bool){ + return block.timestamp>0; + } + + function good() external returns(uint){ + emit Time(block.timestamp); + } +} + diff --git a/tests/detectors/timestamp/0.5.16/timestamp.sol.0.5.16.Timestamp.json b/tests/detectors/timestamp/0.5.16/timestamp.sol.0.5.16.Timestamp.json new file mode 100644 index 0000000000..64e70b0ddc --- /dev/null +++ b/tests/detectors/timestamp/0.5.16/timestamp.sol.0.5.16.Timestamp.json @@ -0,0 +1,456 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 47, + "length": 70, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Timestamp", + "source_mapping": { + "start": 0, + "length": 402, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + }, + { + "type": "node", + "name": "require(bool)(block.timestamp == 0)", + "source_mapping": { + "start": 81, + "length": 29, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "is_dependency": false, + "lines": [ + 5 + ], + "starting_column": 9, + "ending_column": 38 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 47, + "length": 70, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Timestamp", + "source_mapping": { + "start": 0, + "length": 402, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + } + } + ], + "description": "Timestamp.bad0() (tests/detectors/timestamp/0.5.16/timestamp.sol#4-6) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- require(bool)(block.timestamp == 0) (tests/detectors/timestamp/0.5.16/timestamp.sol#5)\n", + "markdown": "[Timestamp.bad0()](tests/detectors/timestamp/0.5.16/timestamp.sol#L4-L6) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [require(bool)(block.timestamp == 0)](tests/detectors/timestamp/0.5.16/timestamp.sol#L5)\n", + "id": "ae9cf69893e0e1a3487dc6ce8a8ae0f5ea9628607d77d32b3dfcb0202617d6e3", + "check": "timestamp", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 126, + "length": 96, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Timestamp", + "source_mapping": { + "start": 0, + "length": 402, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1()" + } + }, + { + "type": "node", + "name": "require(bool)(time == 0)", + "source_mapping": { + "start": 197, + "length": 18, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 9, + "ending_column": 27 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 126, + "length": 96, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Timestamp", + "source_mapping": { + "start": 0, + "length": 402, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1()" + } + } + } + } + ], + "description": "Timestamp.bad1() (tests/detectors/timestamp/0.5.16/timestamp.sol#8-11) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- require(bool)(time == 0) (tests/detectors/timestamp/0.5.16/timestamp.sol#10)\n", + "markdown": "[Timestamp.bad1()](tests/detectors/timestamp/0.5.16/timestamp.sol#L8-L11) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [require(bool)(time == 0)](tests/detectors/timestamp/0.5.16/timestamp.sol#L10)\n", + "id": "95b42362b948094ddfa2507b20840e67789d4c5d92e8e3ddac30f5b6577dc1cb", + "check": "timestamp", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 231, + "length": 79, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "is_dependency": false, + "lines": [ + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Timestamp", + "source_mapping": { + "start": 0, + "length": 402, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + }, + { + "type": "node", + "name": "block.timestamp > 0", + "source_mapping": { + "start": 279, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "is_dependency": false, + "lines": [ + 14 + ], + "starting_column": 9, + "ending_column": 33 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 231, + "length": 79, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "is_dependency": false, + "lines": [ + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Timestamp", + "source_mapping": { + "start": 0, + "length": 402, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.5.16/timestamp.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + } + } + } + ], + "description": "Timestamp.bad2() (tests/detectors/timestamp/0.5.16/timestamp.sol#13-15) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- block.timestamp > 0 (tests/detectors/timestamp/0.5.16/timestamp.sol#14)\n", + "markdown": "[Timestamp.bad2()](tests/detectors/timestamp/0.5.16/timestamp.sol#L13-L15) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [block.timestamp > 0](tests/detectors/timestamp/0.5.16/timestamp.sol#L14)\n", + "id": "d4fe55a5e15b7b87f60c4156128807b333a4a630b25b18eb3a495b3613f764db", + "check": "timestamp", + "impact": "Low", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/timestamp/0.6.11/timestamp.sol b/tests/detectors/timestamp/0.6.11/timestamp.sol new file mode 100644 index 0000000000..8de2a31b41 --- /dev/null +++ b/tests/detectors/timestamp/0.6.11/timestamp.sol @@ -0,0 +1,21 @@ +contract Timestamp{ + event Time(uint); + + function bad0() external{ + require(block.timestamp == 0); + } + + function bad1() external{ + uint time = block.timestamp; + require(time == 0); + } + + function bad2() external returns(bool){ + return block.timestamp>0; + } + + function good() external returns(uint){ + emit Time(block.timestamp); + } +} + diff --git a/tests/detectors/timestamp/0.6.11/timestamp.sol.0.6.11.Timestamp.json b/tests/detectors/timestamp/0.6.11/timestamp.sol.0.6.11.Timestamp.json new file mode 100644 index 0000000000..74feacec4d --- /dev/null +++ b/tests/detectors/timestamp/0.6.11/timestamp.sol.0.6.11.Timestamp.json @@ -0,0 +1,456 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 47, + "length": 70, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Timestamp", + "source_mapping": { + "start": 0, + "length": 402, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + }, + { + "type": "node", + "name": "require(bool)(block.timestamp == 0)", + "source_mapping": { + "start": 81, + "length": 29, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "is_dependency": false, + "lines": [ + 5 + ], + "starting_column": 9, + "ending_column": 38 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 47, + "length": 70, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Timestamp", + "source_mapping": { + "start": 0, + "length": 402, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + } + } + ], + "description": "Timestamp.bad0() (tests/detectors/timestamp/0.6.11/timestamp.sol#4-6) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- require(bool)(block.timestamp == 0) (tests/detectors/timestamp/0.6.11/timestamp.sol#5)\n", + "markdown": "[Timestamp.bad0()](tests/detectors/timestamp/0.6.11/timestamp.sol#L4-L6) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [require(bool)(block.timestamp == 0)](tests/detectors/timestamp/0.6.11/timestamp.sol#L5)\n", + "id": "e4e3a8ade3a3bd11b4788b70785548f81395e776a86f2940834731e8f5e05bdc", + "check": "timestamp", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 126, + "length": 96, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Timestamp", + "source_mapping": { + "start": 0, + "length": 402, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1()" + } + }, + { + "type": "node", + "name": "require(bool)(time == 0)", + "source_mapping": { + "start": 197, + "length": 18, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 9, + "ending_column": 27 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 126, + "length": 96, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Timestamp", + "source_mapping": { + "start": 0, + "length": 402, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1()" + } + } + } + } + ], + "description": "Timestamp.bad1() (tests/detectors/timestamp/0.6.11/timestamp.sol#8-11) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- require(bool)(time == 0) (tests/detectors/timestamp/0.6.11/timestamp.sol#10)\n", + "markdown": "[Timestamp.bad1()](tests/detectors/timestamp/0.6.11/timestamp.sol#L8-L11) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [require(bool)(time == 0)](tests/detectors/timestamp/0.6.11/timestamp.sol#L10)\n", + "id": "5d42d80cf0c66675f78bbf7717e2c532f05e8b0641d100c436ef8e1d6dc02f61", + "check": "timestamp", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 231, + "length": 79, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "is_dependency": false, + "lines": [ + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Timestamp", + "source_mapping": { + "start": 0, + "length": 402, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + }, + { + "type": "node", + "name": "block.timestamp > 0", + "source_mapping": { + "start": 279, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "is_dependency": false, + "lines": [ + 14 + ], + "starting_column": 9, + "ending_column": 33 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 231, + "length": 79, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "is_dependency": false, + "lines": [ + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Timestamp", + "source_mapping": { + "start": 0, + "length": 402, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/timestamp/0.6.11/timestamp.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + } + } + } + ], + "description": "Timestamp.bad2() (tests/detectors/timestamp/0.6.11/timestamp.sol#13-15) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- block.timestamp > 0 (tests/detectors/timestamp/0.6.11/timestamp.sol#14)\n", + "markdown": "[Timestamp.bad2()](tests/detectors/timestamp/0.6.11/timestamp.sol#L13-L15) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [block.timestamp > 0](tests/detectors/timestamp/0.6.11/timestamp.sol#L14)\n", + "id": "c2c1fc5eaaf8498a2f03135fb61180314cbd104df5ab6b2447620b8ac3978cac", + "check": "timestamp", + "impact": "Low", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/timestamp/0.7.6/timestamp.sol b/tests/detectors/timestamp/0.7.6/timestamp.sol new file mode 100644 index 0000000000..8de2a31b41 --- /dev/null +++ b/tests/detectors/timestamp/0.7.6/timestamp.sol @@ -0,0 +1,21 @@ +contract Timestamp{ + event Time(uint); + + function bad0() external{ + require(block.timestamp == 0); + } + + function bad1() external{ + uint time = block.timestamp; + require(time == 0); + } + + function bad2() external returns(bool){ + return block.timestamp>0; + } + + function good() external returns(uint){ + emit Time(block.timestamp); + } +} + diff --git a/tests/detectors/timestamp/timestamp.sol.0.5.1.Timestamp.json b/tests/detectors/timestamp/0.7.6/timestamp.sol.0.7.6.Timestamp.json similarity index 89% rename from tests/detectors/timestamp/timestamp.sol.0.5.1.Timestamp.json rename to tests/detectors/timestamp/0.7.6/timestamp.sol.0.7.6.Timestamp.json index 2086e0864f..3aa1f7d816 100644 --- a/tests/detectors/timestamp/timestamp.sol.0.5.1.Timestamp.json +++ b/tests/detectors/timestamp/0.7.6/timestamp.sol.0.7.6.Timestamp.json @@ -9,9 +9,9 @@ "start": 47, "length": 70, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.7.6/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.7.6/timestamp.sol", "is_dependency": false, "lines": [ 4, @@ -29,9 +29,9 @@ "start": 0, "length": 402, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.7.6/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.7.6/timestamp.sol", "is_dependency": false, "lines": [ 1, @@ -69,9 +69,9 @@ "start": 81, "length": 29, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.7.6/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.7.6/timestamp.sol", "is_dependency": false, "lines": [ 5 @@ -87,9 +87,9 @@ "start": 47, "length": 70, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.7.6/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.7.6/timestamp.sol", "is_dependency": false, "lines": [ 4, @@ -107,9 +107,9 @@ "start": 0, "length": 402, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.7.6/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.7.6/timestamp.sol", "is_dependency": false, "lines": [ 1, @@ -143,9 +143,9 @@ } } ], - "description": "Timestamp.bad0() (tests/detectors/timestamp/timestamp.sol#4-6) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- require(bool)(block.timestamp == 0) (tests/detectors/timestamp/timestamp.sol#5)\n", - "markdown": "[Timestamp.bad0()](tests/detectors/timestamp/timestamp.sol#L4-L6) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [require(bool)(block.timestamp == 0)](tests/detectors/timestamp/timestamp.sol#L5)\n", - "id": "46e99f9c2bab1735f57c130340547f097ca1a8513c2dd374d3cd756da65d2cdf", + "description": "Timestamp.bad0() (tests/detectors/timestamp/0.7.6/timestamp.sol#4-6) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- require(bool)(block.timestamp == 0) (tests/detectors/timestamp/0.7.6/timestamp.sol#5)\n", + "markdown": "[Timestamp.bad0()](tests/detectors/timestamp/0.7.6/timestamp.sol#L4-L6) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [require(bool)(block.timestamp == 0)](tests/detectors/timestamp/0.7.6/timestamp.sol#L5)\n", + "id": "e776b1a35c5ff7cecd1cf6eba25c7017c852dfab68d0aaa8b2c8ecaf97b69a6b", "check": "timestamp", "impact": "Low", "confidence": "Medium" @@ -159,9 +159,9 @@ "start": 126, "length": 96, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.7.6/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.7.6/timestamp.sol", "is_dependency": false, "lines": [ 8, @@ -180,9 +180,9 @@ "start": 0, "length": 402, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.7.6/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.7.6/timestamp.sol", "is_dependency": false, "lines": [ 1, @@ -220,9 +220,9 @@ "start": 197, "length": 18, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.7.6/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.7.6/timestamp.sol", "is_dependency": false, "lines": [ 10 @@ -238,9 +238,9 @@ "start": 126, "length": 96, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.7.6/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.7.6/timestamp.sol", "is_dependency": false, "lines": [ 8, @@ -259,9 +259,9 @@ "start": 0, "length": 402, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.7.6/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.7.6/timestamp.sol", "is_dependency": false, "lines": [ 1, @@ -295,9 +295,9 @@ } } ], - "description": "Timestamp.bad1() (tests/detectors/timestamp/timestamp.sol#8-11) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- require(bool)(time == 0) (tests/detectors/timestamp/timestamp.sol#10)\n", - "markdown": "[Timestamp.bad1()](tests/detectors/timestamp/timestamp.sol#L8-L11) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [require(bool)(time == 0)](tests/detectors/timestamp/timestamp.sol#L10)\n", - "id": "b05a8b6947761eb595359596ba4ab88c750a4936836c8a5fed948fe92b2577f0", + "description": "Timestamp.bad1() (tests/detectors/timestamp/0.7.6/timestamp.sol#8-11) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- require(bool)(time == 0) (tests/detectors/timestamp/0.7.6/timestamp.sol#10)\n", + "markdown": "[Timestamp.bad1()](tests/detectors/timestamp/0.7.6/timestamp.sol#L8-L11) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [require(bool)(time == 0)](tests/detectors/timestamp/0.7.6/timestamp.sol#L10)\n", + "id": "fc05e44a41cc99fb6e68c9d8bfc8cbc97377f3327ed7a3c75ba170c9e75394d1", "check": "timestamp", "impact": "Low", "confidence": "Medium" @@ -311,9 +311,9 @@ "start": 231, "length": 79, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.7.6/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.7.6/timestamp.sol", "is_dependency": false, "lines": [ 13, @@ -331,9 +331,9 @@ "start": 0, "length": 402, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.7.6/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.7.6/timestamp.sol", "is_dependency": false, "lines": [ 1, @@ -371,9 +371,9 @@ "start": 279, "length": 24, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.7.6/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.7.6/timestamp.sol", "is_dependency": false, "lines": [ 14 @@ -389,9 +389,9 @@ "start": 231, "length": 79, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.7.6/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.7.6/timestamp.sol", "is_dependency": false, "lines": [ 13, @@ -409,9 +409,9 @@ "start": 0, "length": 402, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/timestamp/timestamp.sol", + "filename_relative": "tests/detectors/timestamp/0.7.6/timestamp.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/timestamp/timestamp.sol", + "filename_short": "tests/detectors/timestamp/0.7.6/timestamp.sol", "is_dependency": false, "lines": [ 1, @@ -445,9 +445,9 @@ } } ], - "description": "Timestamp.bad2() (tests/detectors/timestamp/timestamp.sol#13-15) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- block.timestamp > 0 (tests/detectors/timestamp/timestamp.sol#14)\n", - "markdown": "[Timestamp.bad2()](tests/detectors/timestamp/timestamp.sol#L13-L15) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [block.timestamp > 0](tests/detectors/timestamp/timestamp.sol#L14)\n", - "id": "81e4ce4ef359ffa86d6c5dec7f465b84cc71668139ce31ee5c41ecd2fb327179", + "description": "Timestamp.bad2() (tests/detectors/timestamp/0.7.6/timestamp.sol#13-15) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- block.timestamp > 0 (tests/detectors/timestamp/0.7.6/timestamp.sol#14)\n", + "markdown": "[Timestamp.bad2()](tests/detectors/timestamp/0.7.6/timestamp.sol#L13-L15) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [block.timestamp > 0](tests/detectors/timestamp/0.7.6/timestamp.sol#L14)\n", + "id": "11b3472709ff3f3a4b3ec47abaa5a62f8dbfcd3b0b6bea0972f5b3d790049130", "check": "timestamp", "impact": "Low", "confidence": "Medium" diff --git a/tests/detectors/too-many-digits/too_many_digits.sol b/tests/detectors/too-many-digits/0.4.25/too_many_digits.sol similarity index 97% rename from tests/detectors/too-many-digits/too_many_digits.sol rename to tests/detectors/too-many-digits/0.4.25/too_many_digits.sol index 6156d0da5c..cd35366a9e 100644 --- a/tests/detectors/too-many-digits/too_many_digits.sol +++ b/tests/detectors/too-many-digits/0.4.25/too_many_digits.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.1; +// pragma solidity ^0.5.1; contract C { uint balance; diff --git a/tests/detectors/too-many-digits/too_many_digits.sol.0.5.1.TooManyDigits.json b/tests/detectors/too-many-digits/0.4.25/too_many_digits.sol.0.4.25.TooManyDigits.json similarity index 88% rename from tests/detectors/too-many-digits/too_many_digits.sol.0.5.1.TooManyDigits.json rename to tests/detectors/too-many-digits/0.4.25/too_many_digits.sol.0.4.25.TooManyDigits.json index 011afd6079..59ff32fbeb 100644 --- a/tests/detectors/too-many-digits/too_many_digits.sol.0.5.1.TooManyDigits.json +++ b/tests/detectors/too-many-digits/0.4.25/too_many_digits.sol.0.4.25.TooManyDigits.json @@ -6,12 +6,12 @@ "type": "function", "name": "f", "source_mapping": { - "start": 174, + "start": 177, "length": 195, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_relative": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_short": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "is_dependency": false, "lines": [ 9, @@ -30,12 +30,12 @@ "type": "contract", "name": "C", "source_mapping": { - "start": 25, + "start": 28, "length": 897, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_relative": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_short": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "is_dependency": false, "lines": [ 3, @@ -88,12 +88,12 @@ "type": "node", "name": "x1 = 0x000001", "source_mapping": { - "start": 206, + "start": 209, "length": 18, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_relative": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_short": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "is_dependency": false, "lines": [ 10 @@ -106,12 +106,12 @@ "type": "function", "name": "f", "source_mapping": { - "start": 174, + "start": 177, "length": 195, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_relative": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_short": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "is_dependency": false, "lines": [ 9, @@ -130,12 +130,12 @@ "type": "contract", "name": "C", "source_mapping": { - "start": 25, + "start": 28, "length": 897, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_relative": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_short": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "is_dependency": false, "lines": [ 3, @@ -187,9 +187,9 @@ } } ], - "description": "C.f() (tests/detectors/too-many-digits/too_many_digits.sol#9-15) uses literals with too many digits:\n\t- x1 = 0x000001 (tests/detectors/too-many-digits/too_many_digits.sol#10)\n", - "markdown": "[C.f()](tests/detectors/too-many-digits/too_many_digits.sol#L9-L15) uses literals with too many digits:\n\t- [x1 = 0x000001](tests/detectors/too-many-digits/too_many_digits.sol#L10)\n", - "id": "143f9fb2446f58c0fc141b8c4900a65f67afd5c4921b9fe0632d0b42993c632e", + "description": "C.f() (tests/detectors/too-many-digits/0.4.25/too_many_digits.sol#9-15) uses literals with too many digits:\n\t- x1 = 0x000001 (tests/detectors/too-many-digits/0.4.25/too_many_digits.sol#10)\n", + "markdown": "[C.f()](tests/detectors/too-many-digits/0.4.25/too_many_digits.sol#L9-L15) uses literals with too many digits:\n\t- [x1 = 0x000001](tests/detectors/too-many-digits/0.4.25/too_many_digits.sol#L10)\n", + "id": "33591d733ce2e17a001b912024d5bbe2fd89b63811968c715cf1feed5e302ef1", "check": "too-many-digits", "impact": "Informational", "confidence": "Medium" @@ -200,12 +200,12 @@ "type": "function", "name": "f", "source_mapping": { - "start": 174, + "start": 177, "length": 195, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_relative": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_short": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "is_dependency": false, "lines": [ 9, @@ -224,12 +224,12 @@ "type": "contract", "name": "C", "source_mapping": { - "start": 25, + "start": 28, "length": 897, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_relative": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_short": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "is_dependency": false, "lines": [ 3, @@ -282,12 +282,12 @@ "type": "node", "name": "x2 = 0x0000000000001", "source_mapping": { - "start": 234, + "start": 237, "length": 25, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_relative": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_short": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "is_dependency": false, "lines": [ 11 @@ -300,12 +300,12 @@ "type": "function", "name": "f", "source_mapping": { - "start": 174, + "start": 177, "length": 195, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_relative": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_short": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "is_dependency": false, "lines": [ 9, @@ -324,12 +324,12 @@ "type": "contract", "name": "C", "source_mapping": { - "start": 25, + "start": 28, "length": 897, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_relative": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_short": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "is_dependency": false, "lines": [ 3, @@ -381,9 +381,9 @@ } } ], - "description": "C.f() (tests/detectors/too-many-digits/too_many_digits.sol#9-15) uses literals with too many digits:\n\t- x2 = 0x0000000000001 (tests/detectors/too-many-digits/too_many_digits.sol#11)\n", - "markdown": "[C.f()](tests/detectors/too-many-digits/too_many_digits.sol#L9-L15) uses literals with too many digits:\n\t- [x2 = 0x0000000000001](tests/detectors/too-many-digits/too_many_digits.sol#L11)\n", - "id": "7c264e2e13d1ba736400d6aba40570901b6b3209a66f8beb768fe56eb59c0501", + "description": "C.f() (tests/detectors/too-many-digits/0.4.25/too_many_digits.sol#9-15) uses literals with too many digits:\n\t- x2 = 0x0000000000001 (tests/detectors/too-many-digits/0.4.25/too_many_digits.sol#11)\n", + "markdown": "[C.f()](tests/detectors/too-many-digits/0.4.25/too_many_digits.sol#L9-L15) uses literals with too many digits:\n\t- [x2 = 0x0000000000001](tests/detectors/too-many-digits/0.4.25/too_many_digits.sol#L11)\n", + "id": "3e08ab6e8312a9489e23b50c6252a0ae7db88a7fc2c9d83c34d6d8aceb634d08", "check": "too-many-digits", "impact": "Informational", "confidence": "Medium" @@ -394,12 +394,12 @@ "type": "function", "name": "f", "source_mapping": { - "start": 174, + "start": 177, "length": 195, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_relative": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_short": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "is_dependency": false, "lines": [ 9, @@ -418,12 +418,12 @@ "type": "contract", "name": "C", "source_mapping": { - "start": 25, + "start": 28, "length": 897, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_relative": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_short": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "is_dependency": false, "lines": [ 3, @@ -476,12 +476,12 @@ "type": "node", "name": "x3 = 1000000000000000000", "source_mapping": { - "start": 269, + "start": 272, "length": 29, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_relative": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_short": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "is_dependency": false, "lines": [ 12 @@ -494,12 +494,12 @@ "type": "function", "name": "f", "source_mapping": { - "start": 174, + "start": 177, "length": 195, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_relative": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_short": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "is_dependency": false, "lines": [ 9, @@ -518,12 +518,12 @@ "type": "contract", "name": "C", "source_mapping": { - "start": 25, + "start": 28, "length": 897, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_relative": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_short": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "is_dependency": false, "lines": [ 3, @@ -575,9 +575,9 @@ } } ], - "description": "C.f() (tests/detectors/too-many-digits/too_many_digits.sol#9-15) uses literals with too many digits:\n\t- x3 = 1000000000000000000 (tests/detectors/too-many-digits/too_many_digits.sol#12)\n", - "markdown": "[C.f()](tests/detectors/too-many-digits/too_many_digits.sol#L9-L15) uses literals with too many digits:\n\t- [x3 = 1000000000000000000](tests/detectors/too-many-digits/too_many_digits.sol#L12)\n", - "id": "b2fbfafaa08d4f8e156369f0f00d386623e9d2af78356ed8f7f60c5274bb964d", + "description": "C.f() (tests/detectors/too-many-digits/0.4.25/too_many_digits.sol#9-15) uses literals with too many digits:\n\t- x3 = 1000000000000000000 (tests/detectors/too-many-digits/0.4.25/too_many_digits.sol#12)\n", + "markdown": "[C.f()](tests/detectors/too-many-digits/0.4.25/too_many_digits.sol#L9-L15) uses literals with too many digits:\n\t- [x3 = 1000000000000000000](tests/detectors/too-many-digits/0.4.25/too_many_digits.sol#L12)\n", + "id": "07b9feef94432fdda97b5b5f32b4b6acfa23801e48f9fbd9997c5c3142c56474", "check": "too-many-digits", "impact": "Informational", "confidence": "Medium" @@ -588,12 +588,12 @@ "type": "function", "name": "f", "source_mapping": { - "start": 174, + "start": 177, "length": 195, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_relative": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_short": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "is_dependency": false, "lines": [ 9, @@ -612,12 +612,12 @@ "type": "contract", "name": "C", "source_mapping": { - "start": 25, + "start": 28, "length": 897, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_relative": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_short": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "is_dependency": false, "lines": [ 3, @@ -670,12 +670,12 @@ "type": "node", "name": "x4 = 100000", "source_mapping": { - "start": 308, + "start": 311, "length": 16, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_relative": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_short": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "is_dependency": false, "lines": [ 13 @@ -688,12 +688,12 @@ "type": "function", "name": "f", "source_mapping": { - "start": 174, + "start": 177, "length": 195, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_relative": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_short": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "is_dependency": false, "lines": [ 9, @@ -712,12 +712,12 @@ "type": "contract", "name": "C", "source_mapping": { - "start": 25, + "start": 28, "length": 897, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_relative": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_short": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "is_dependency": false, "lines": [ 3, @@ -769,9 +769,9 @@ } } ], - "description": "C.f() (tests/detectors/too-many-digits/too_many_digits.sol#9-15) uses literals with too many digits:\n\t- x4 = 100000 (tests/detectors/too-many-digits/too_many_digits.sol#13)\n", - "markdown": "[C.f()](tests/detectors/too-many-digits/too_many_digits.sol#L9-L15) uses literals with too many digits:\n\t- [x4 = 100000](tests/detectors/too-many-digits/too_many_digits.sol#L13)\n", - "id": "7194744ba0e788c1ded916dead1010c888619e3a7044c1aca5637c5a4b5d7e9e", + "description": "C.f() (tests/detectors/too-many-digits/0.4.25/too_many_digits.sol#9-15) uses literals with too many digits:\n\t- x4 = 100000 (tests/detectors/too-many-digits/0.4.25/too_many_digits.sol#13)\n", + "markdown": "[C.f()](tests/detectors/too-many-digits/0.4.25/too_many_digits.sol#L9-L15) uses literals with too many digits:\n\t- [x4 = 100000](tests/detectors/too-many-digits/0.4.25/too_many_digits.sol#L13)\n", + "id": "809a1adef5afed04cc3371628a1595dd47bb1b1003a9e0cc6be72987c4034345", "check": "too-many-digits", "impact": "Informational", "confidence": "Medium" @@ -782,12 +782,12 @@ "type": "function", "name": "h", "source_mapping": { - "start": 453, + "start": 456, "length": 113, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_relative": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_short": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "is_dependency": false, "lines": [ 20, @@ -804,12 +804,12 @@ "type": "contract", "name": "C", "source_mapping": { - "start": 25, + "start": 28, "length": 897, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_relative": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_short": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "is_dependency": false, "lines": [ 3, @@ -862,12 +862,12 @@ "type": "node", "name": "x2 = 100000", "source_mapping": { - "start": 509, + "start": 512, "length": 16, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_relative": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_short": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "is_dependency": false, "lines": [ 22 @@ -880,12 +880,12 @@ "type": "function", "name": "h", "source_mapping": { - "start": 453, + "start": 456, "length": 113, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_relative": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_short": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "is_dependency": false, "lines": [ 20, @@ -902,12 +902,12 @@ "type": "contract", "name": "C", "source_mapping": { - "start": 25, + "start": 28, "length": 897, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_relative": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/too-many-digits/too_many_digits.sol", + "filename_short": "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", "is_dependency": false, "lines": [ 3, @@ -959,9 +959,9 @@ } } ], - "description": "C.h() (tests/detectors/too-many-digits/too_many_digits.sol#20-24) uses literals with too many digits:\n\t- x2 = 100000 (tests/detectors/too-many-digits/too_many_digits.sol#22)\n", - "markdown": "[C.h()](tests/detectors/too-many-digits/too_many_digits.sol#L20-L24) uses literals with too many digits:\n\t- [x2 = 100000](tests/detectors/too-many-digits/too_many_digits.sol#L22)\n", - "id": "0c73f2851303eef65586504c4f6a9c78c6bb8aa48f44e775c6f5a8520227a757", + "description": "C.h() (tests/detectors/too-many-digits/0.4.25/too_many_digits.sol#20-24) uses literals with too many digits:\n\t- x2 = 100000 (tests/detectors/too-many-digits/0.4.25/too_many_digits.sol#22)\n", + "markdown": "[C.h()](tests/detectors/too-many-digits/0.4.25/too_many_digits.sol#L20-L24) uses literals with too many digits:\n\t- [x2 = 100000](tests/detectors/too-many-digits/0.4.25/too_many_digits.sol#L22)\n", + "id": "2ae61bfeb6a9bad69fe9cb1990583dae50614da8a86cc9a720493218e11e0aa5", "check": "too-many-digits", "impact": "Informational", "confidence": "Medium" diff --git a/tests/detectors/too-many-digits/0.5.16/too_many_digits.sol b/tests/detectors/too-many-digits/0.5.16/too_many_digits.sol new file mode 100644 index 0000000000..cd35366a9e --- /dev/null +++ b/tests/detectors/too-many-digits/0.5.16/too_many_digits.sol @@ -0,0 +1,40 @@ +// pragma solidity ^0.5.1; + +contract C { + uint balance; + + /** + * @dev Variables are not Ok - using too many digits in place of the Ether denomination. + */ + function f() external { + uint x1 = 0x000001; + uint x2 = 0x0000000000001; + uint x3 = 1000000000000000000; + uint x4 = 100000; + balance += x1 + x2 + x3 + x4; + } + + /** + * @dev Variables are Ok - not using too many digits. + */ + function h() external { + uint x1 = 1000; + uint x2 = 100000; + balance += x1 + x2 + 100; + } + + /** + * @dev Variables are Ok - Using Ether denominations. + */ + function i() external { + uint x1 = 1 wei + 10 wei + 100 wei + 1000 wei + 10000 wei; + uint x2 = 1 szabo + 10 szabo + 100 szabo + 1000 szabo + 10000 szabo; + balance += x1 + x2; + } + + function good() external{ + + uint x = 1 ether; + } + +} diff --git a/tests/detectors/too-many-digits/0.5.16/too_many_digits.sol.0.5.16.TooManyDigits.json b/tests/detectors/too-many-digits/0.5.16/too_many_digits.sol.0.5.16.TooManyDigits.json new file mode 100644 index 0000000000..538a0945b1 --- /dev/null +++ b/tests/detectors/too-many-digits/0.5.16/too_many_digits.sol.0.5.16.TooManyDigits.json @@ -0,0 +1,970 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "f", + "source_mapping": { + "start": 177, + "length": 195, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 897, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + }, + { + "type": "node", + "name": "x1 = 0x000001", + "source_mapping": { + "start": 209, + "length": 18, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 9, + "ending_column": 27 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "f", + "source_mapping": { + "start": 177, + "length": 195, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 897, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + } + } + } + ], + "description": "C.f() (tests/detectors/too-many-digits/0.5.16/too_many_digits.sol#9-15) uses literals with too many digits:\n\t- x1 = 0x000001 (tests/detectors/too-many-digits/0.5.16/too_many_digits.sol#10)\n", + "markdown": "[C.f()](tests/detectors/too-many-digits/0.5.16/too_many_digits.sol#L9-L15) uses literals with too many digits:\n\t- [x1 = 0x000001](tests/detectors/too-many-digits/0.5.16/too_many_digits.sol#L10)\n", + "id": "1ad454f157e4c16e1b79b5905e83eff1b82192d65933847f4b39548bc170b7ea", + "check": "too-many-digits", + "impact": "Informational", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "f", + "source_mapping": { + "start": 177, + "length": 195, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 897, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + }, + { + "type": "node", + "name": "x2 = 0x0000000000001", + "source_mapping": { + "start": 237, + "length": 25, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 11 + ], + "starting_column": 9, + "ending_column": 34 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "f", + "source_mapping": { + "start": 177, + "length": 195, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 897, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + } + } + } + ], + "description": "C.f() (tests/detectors/too-many-digits/0.5.16/too_many_digits.sol#9-15) uses literals with too many digits:\n\t- x2 = 0x0000000000001 (tests/detectors/too-many-digits/0.5.16/too_many_digits.sol#11)\n", + "markdown": "[C.f()](tests/detectors/too-many-digits/0.5.16/too_many_digits.sol#L9-L15) uses literals with too many digits:\n\t- [x2 = 0x0000000000001](tests/detectors/too-many-digits/0.5.16/too_many_digits.sol#L11)\n", + "id": "ae48ab82ba202c409ec056e498d7255162ef5ab54ddb9ced3b46feb51f4c5021", + "check": "too-many-digits", + "impact": "Informational", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "f", + "source_mapping": { + "start": 177, + "length": 195, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 897, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + }, + { + "type": "node", + "name": "x3 = 1000000000000000000", + "source_mapping": { + "start": 272, + "length": 29, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 9, + "ending_column": 38 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "f", + "source_mapping": { + "start": 177, + "length": 195, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 897, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + } + } + } + ], + "description": "C.f() (tests/detectors/too-many-digits/0.5.16/too_many_digits.sol#9-15) uses literals with too many digits:\n\t- x3 = 1000000000000000000 (tests/detectors/too-many-digits/0.5.16/too_many_digits.sol#12)\n", + "markdown": "[C.f()](tests/detectors/too-many-digits/0.5.16/too_many_digits.sol#L9-L15) uses literals with too many digits:\n\t- [x3 = 1000000000000000000](tests/detectors/too-many-digits/0.5.16/too_many_digits.sol#L12)\n", + "id": "c295b48b8aece38cfd41bceca05ef1953bf5bf0018073076809087a4580ff086", + "check": "too-many-digits", + "impact": "Informational", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "f", + "source_mapping": { + "start": 177, + "length": 195, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 897, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + }, + { + "type": "node", + "name": "x4 = 100000", + "source_mapping": { + "start": 311, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 13 + ], + "starting_column": 9, + "ending_column": 25 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "f", + "source_mapping": { + "start": 177, + "length": 195, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 897, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + } + } + } + ], + "description": "C.f() (tests/detectors/too-many-digits/0.5.16/too_many_digits.sol#9-15) uses literals with too many digits:\n\t- x4 = 100000 (tests/detectors/too-many-digits/0.5.16/too_many_digits.sol#13)\n", + "markdown": "[C.f()](tests/detectors/too-many-digits/0.5.16/too_many_digits.sol#L9-L15) uses literals with too many digits:\n\t- [x4 = 100000](tests/detectors/too-many-digits/0.5.16/too_many_digits.sol#L13)\n", + "id": "7e07e946fcdb14de3e3d3bc796f8f6aff17f22002129db4937e0d12767260d3d", + "check": "too-many-digits", + "impact": "Informational", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "h", + "source_mapping": { + "start": 456, + "length": 113, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 20, + 21, + 22, + 23, + 24 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 897, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "h()" + } + }, + { + "type": "node", + "name": "x2 = 100000", + "source_mapping": { + "start": 512, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 22 + ], + "starting_column": 9, + "ending_column": 25 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "h", + "source_mapping": { + "start": 456, + "length": 113, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 20, + 21, + 22, + 23, + 24 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 897, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "h()" + } + } + } + } + ], + "description": "C.h() (tests/detectors/too-many-digits/0.5.16/too_many_digits.sol#20-24) uses literals with too many digits:\n\t- x2 = 100000 (tests/detectors/too-many-digits/0.5.16/too_many_digits.sol#22)\n", + "markdown": "[C.h()](tests/detectors/too-many-digits/0.5.16/too_many_digits.sol#L20-L24) uses literals with too many digits:\n\t- [x2 = 100000](tests/detectors/too-many-digits/0.5.16/too_many_digits.sol#L22)\n", + "id": "2ca6b97b24a0e595f484c9a0090c3b17b654c167be300e04d9c2cc9a44406d10", + "check": "too-many-digits", + "impact": "Informational", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/too-many-digits/0.6.11/too_many_digits.sol b/tests/detectors/too-many-digits/0.6.11/too_many_digits.sol new file mode 100644 index 0000000000..cd35366a9e --- /dev/null +++ b/tests/detectors/too-many-digits/0.6.11/too_many_digits.sol @@ -0,0 +1,40 @@ +// pragma solidity ^0.5.1; + +contract C { + uint balance; + + /** + * @dev Variables are not Ok - using too many digits in place of the Ether denomination. + */ + function f() external { + uint x1 = 0x000001; + uint x2 = 0x0000000000001; + uint x3 = 1000000000000000000; + uint x4 = 100000; + balance += x1 + x2 + x3 + x4; + } + + /** + * @dev Variables are Ok - not using too many digits. + */ + function h() external { + uint x1 = 1000; + uint x2 = 100000; + balance += x1 + x2 + 100; + } + + /** + * @dev Variables are Ok - Using Ether denominations. + */ + function i() external { + uint x1 = 1 wei + 10 wei + 100 wei + 1000 wei + 10000 wei; + uint x2 = 1 szabo + 10 szabo + 100 szabo + 1000 szabo + 10000 szabo; + balance += x1 + x2; + } + + function good() external{ + + uint x = 1 ether; + } + +} diff --git a/tests/detectors/too-many-digits/0.6.11/too_many_digits.sol.0.6.11.TooManyDigits.json b/tests/detectors/too-many-digits/0.6.11/too_many_digits.sol.0.6.11.TooManyDigits.json new file mode 100644 index 0000000000..93dd13c80e --- /dev/null +++ b/tests/detectors/too-many-digits/0.6.11/too_many_digits.sol.0.6.11.TooManyDigits.json @@ -0,0 +1,970 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "f", + "source_mapping": { + "start": 177, + "length": 195, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 897, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + }, + { + "type": "node", + "name": "x1 = 0x000001", + "source_mapping": { + "start": 209, + "length": 18, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 9, + "ending_column": 27 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "f", + "source_mapping": { + "start": 177, + "length": 195, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 897, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + } + } + } + ], + "description": "C.f() (tests/detectors/too-many-digits/0.6.11/too_many_digits.sol#9-15) uses literals with too many digits:\n\t- x1 = 0x000001 (tests/detectors/too-many-digits/0.6.11/too_many_digits.sol#10)\n", + "markdown": "[C.f()](tests/detectors/too-many-digits/0.6.11/too_many_digits.sol#L9-L15) uses literals with too many digits:\n\t- [x1 = 0x000001](tests/detectors/too-many-digits/0.6.11/too_many_digits.sol#L10)\n", + "id": "d467d1c664634fc17c861de567ef53f0ce8964e9b337127308dad5d3cb0bc343", + "check": "too-many-digits", + "impact": "Informational", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "f", + "source_mapping": { + "start": 177, + "length": 195, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 897, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + }, + { + "type": "node", + "name": "x2 = 0x0000000000001", + "source_mapping": { + "start": 237, + "length": 25, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 11 + ], + "starting_column": 9, + "ending_column": 34 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "f", + "source_mapping": { + "start": 177, + "length": 195, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 897, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + } + } + } + ], + "description": "C.f() (tests/detectors/too-many-digits/0.6.11/too_many_digits.sol#9-15) uses literals with too many digits:\n\t- x2 = 0x0000000000001 (tests/detectors/too-many-digits/0.6.11/too_many_digits.sol#11)\n", + "markdown": "[C.f()](tests/detectors/too-many-digits/0.6.11/too_many_digits.sol#L9-L15) uses literals with too many digits:\n\t- [x2 = 0x0000000000001](tests/detectors/too-many-digits/0.6.11/too_many_digits.sol#L11)\n", + "id": "302b9a771b1009999d212d50adb2b938ccf41f2c26880fe17060a8922ea4836a", + "check": "too-many-digits", + "impact": "Informational", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "f", + "source_mapping": { + "start": 177, + "length": 195, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 897, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + }, + { + "type": "node", + "name": "x3 = 1000000000000000000", + "source_mapping": { + "start": 272, + "length": 29, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 9, + "ending_column": 38 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "f", + "source_mapping": { + "start": 177, + "length": 195, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 897, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + } + } + } + ], + "description": "C.f() (tests/detectors/too-many-digits/0.6.11/too_many_digits.sol#9-15) uses literals with too many digits:\n\t- x3 = 1000000000000000000 (tests/detectors/too-many-digits/0.6.11/too_many_digits.sol#12)\n", + "markdown": "[C.f()](tests/detectors/too-many-digits/0.6.11/too_many_digits.sol#L9-L15) uses literals with too many digits:\n\t- [x3 = 1000000000000000000](tests/detectors/too-many-digits/0.6.11/too_many_digits.sol#L12)\n", + "id": "ed4cd26212cad644e275c3784912d9fe2d0789a9cb731a1a20bfdb30554f6f3a", + "check": "too-many-digits", + "impact": "Informational", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "f", + "source_mapping": { + "start": 177, + "length": 195, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 897, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + }, + { + "type": "node", + "name": "x4 = 100000", + "source_mapping": { + "start": 311, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 13 + ], + "starting_column": 9, + "ending_column": 25 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "f", + "source_mapping": { + "start": 177, + "length": 195, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 897, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + } + } + } + ], + "description": "C.f() (tests/detectors/too-many-digits/0.6.11/too_many_digits.sol#9-15) uses literals with too many digits:\n\t- x4 = 100000 (tests/detectors/too-many-digits/0.6.11/too_many_digits.sol#13)\n", + "markdown": "[C.f()](tests/detectors/too-many-digits/0.6.11/too_many_digits.sol#L9-L15) uses literals with too many digits:\n\t- [x4 = 100000](tests/detectors/too-many-digits/0.6.11/too_many_digits.sol#L13)\n", + "id": "b8986c1b09fc9896372df90e6b43a08dfb3e3a920bd002ab5ee9eb4a29f92d95", + "check": "too-many-digits", + "impact": "Informational", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "h", + "source_mapping": { + "start": 456, + "length": 113, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 20, + 21, + 22, + 23, + 24 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 897, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "h()" + } + }, + { + "type": "node", + "name": "x2 = 100000", + "source_mapping": { + "start": 512, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 22 + ], + "starting_column": 9, + "ending_column": 25 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "h", + "source_mapping": { + "start": 456, + "length": 113, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 20, + 21, + 22, + 23, + 24 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 897, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "h()" + } + } + } + } + ], + "description": "C.h() (tests/detectors/too-many-digits/0.6.11/too_many_digits.sol#20-24) uses literals with too many digits:\n\t- x2 = 100000 (tests/detectors/too-many-digits/0.6.11/too_many_digits.sol#22)\n", + "markdown": "[C.h()](tests/detectors/too-many-digits/0.6.11/too_many_digits.sol#L20-L24) uses literals with too many digits:\n\t- [x2 = 100000](tests/detectors/too-many-digits/0.6.11/too_many_digits.sol#L22)\n", + "id": "7cd1e51c89ae28bc9bf2c7e406b39f97a648cde765fc2a05c14697648ad27e92", + "check": "too-many-digits", + "impact": "Informational", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/too-many-digits/0.7.6/too_many_digits.sol b/tests/detectors/too-many-digits/0.7.6/too_many_digits.sol new file mode 100644 index 0000000000..48cbfdb55a --- /dev/null +++ b/tests/detectors/too-many-digits/0.7.6/too_many_digits.sol @@ -0,0 +1,39 @@ +// pragma solidity ^0.5.1; + +contract C { + uint balance; + + /** + * @dev Variables are not Ok - using too many digits in place of the Ether denomination. + */ + function f() external { + uint x1 = 0x000001; + uint x2 = 0x0000000000001; + uint x3 = 1000000000000000000; + uint x4 = 100000; + balance += x1 + x2 + x3 + x4; + } + + /** + * @dev Variables are Ok - not using too many digits. + */ + function h() external { + uint x1 = 1000; + uint x2 = 100000; + balance += x1 + x2 + 100; + } + + /** + * @dev Variables are Ok - Using Ether denominations. + */ + function i() external { + uint x1 = 1 wei + 10 wei + 100 wei + 1000 wei + 10000 wei; + balance += x1; + } + + function good() external{ + + uint x = 1 ether; + } + +} diff --git a/tests/detectors/too-many-digits/0.7.6/too_many_digits.sol.0.7.6.TooManyDigits.json b/tests/detectors/too-many-digits/0.7.6/too_many_digits.sol.0.7.6.TooManyDigits.json new file mode 100644 index 0000000000..4405e56144 --- /dev/null +++ b/tests/detectors/too-many-digits/0.7.6/too_many_digits.sol.0.7.6.TooManyDigits.json @@ -0,0 +1,960 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "f", + "source_mapping": { + "start": 177, + "length": 195, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 815, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + }, + { + "type": "node", + "name": "x1 = 0x000001", + "source_mapping": { + "start": 209, + "length": 18, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 9, + "ending_column": 27 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "f", + "source_mapping": { + "start": 177, + "length": 195, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 815, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + } + } + } + ], + "description": "C.f() (tests/detectors/too-many-digits/0.7.6/too_many_digits.sol#9-15) uses literals with too many digits:\n\t- x1 = 0x000001 (tests/detectors/too-many-digits/0.7.6/too_many_digits.sol#10)\n", + "markdown": "[C.f()](tests/detectors/too-many-digits/0.7.6/too_many_digits.sol#L9-L15) uses literals with too many digits:\n\t- [x1 = 0x000001](tests/detectors/too-many-digits/0.7.6/too_many_digits.sol#L10)\n", + "id": "a053c2f439e1e4ac84469e1aab54f4403d4ab14bf81bae6e7a3d2e489b3514bd", + "check": "too-many-digits", + "impact": "Informational", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "f", + "source_mapping": { + "start": 177, + "length": 195, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 815, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + }, + { + "type": "node", + "name": "x2 = 0x0000000000001", + "source_mapping": { + "start": 237, + "length": 25, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 11 + ], + "starting_column": 9, + "ending_column": 34 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "f", + "source_mapping": { + "start": 177, + "length": 195, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 815, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + } + } + } + ], + "description": "C.f() (tests/detectors/too-many-digits/0.7.6/too_many_digits.sol#9-15) uses literals with too many digits:\n\t- x2 = 0x0000000000001 (tests/detectors/too-many-digits/0.7.6/too_many_digits.sol#11)\n", + "markdown": "[C.f()](tests/detectors/too-many-digits/0.7.6/too_many_digits.sol#L9-L15) uses literals with too many digits:\n\t- [x2 = 0x0000000000001](tests/detectors/too-many-digits/0.7.6/too_many_digits.sol#L11)\n", + "id": "41a60e2fb1f3a88adafd67ca77db4633849be26e1b8b9973b8bf9e8ea5a9d024", + "check": "too-many-digits", + "impact": "Informational", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "f", + "source_mapping": { + "start": 177, + "length": 195, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 815, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + }, + { + "type": "node", + "name": "x3 = 1000000000000000000", + "source_mapping": { + "start": 272, + "length": 29, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 12 + ], + "starting_column": 9, + "ending_column": 38 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "f", + "source_mapping": { + "start": 177, + "length": 195, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 815, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + } + } + } + ], + "description": "C.f() (tests/detectors/too-many-digits/0.7.6/too_many_digits.sol#9-15) uses literals with too many digits:\n\t- x3 = 1000000000000000000 (tests/detectors/too-many-digits/0.7.6/too_many_digits.sol#12)\n", + "markdown": "[C.f()](tests/detectors/too-many-digits/0.7.6/too_many_digits.sol#L9-L15) uses literals with too many digits:\n\t- [x3 = 1000000000000000000](tests/detectors/too-many-digits/0.7.6/too_many_digits.sol#L12)\n", + "id": "4876b33b2a9fb13f6def960f7f9060cbf858f117079526017b1b35a928771680", + "check": "too-many-digits", + "impact": "Informational", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "f", + "source_mapping": { + "start": 177, + "length": 195, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 815, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + }, + { + "type": "node", + "name": "x4 = 100000", + "source_mapping": { + "start": 311, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 13 + ], + "starting_column": 9, + "ending_column": 25 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "f", + "source_mapping": { + "start": 177, + "length": 195, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 815, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f()" + } + } + } + } + ], + "description": "C.f() (tests/detectors/too-many-digits/0.7.6/too_many_digits.sol#9-15) uses literals with too many digits:\n\t- x4 = 100000 (tests/detectors/too-many-digits/0.7.6/too_many_digits.sol#13)\n", + "markdown": "[C.f()](tests/detectors/too-many-digits/0.7.6/too_many_digits.sol#L9-L15) uses literals with too many digits:\n\t- [x4 = 100000](tests/detectors/too-many-digits/0.7.6/too_many_digits.sol#L13)\n", + "id": "cb3b2fdb9be68cc3ddd7d4eb949471b64b62cf93ba43c377682cbdca2f81321e", + "check": "too-many-digits", + "impact": "Informational", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "h", + "source_mapping": { + "start": 456, + "length": 113, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 20, + 21, + 22, + 23, + 24 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 815, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "h()" + } + }, + { + "type": "node", + "name": "x2 = 100000", + "source_mapping": { + "start": 512, + "length": 16, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 22 + ], + "starting_column": 9, + "ending_column": 25 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "h", + "source_mapping": { + "start": 456, + "length": 113, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 20, + 21, + 22, + 23, + 24 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 28, + "length": 815, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "h()" + } + } + } + } + ], + "description": "C.h() (tests/detectors/too-many-digits/0.7.6/too_many_digits.sol#20-24) uses literals with too many digits:\n\t- x2 = 100000 (tests/detectors/too-many-digits/0.7.6/too_many_digits.sol#22)\n", + "markdown": "[C.h()](tests/detectors/too-many-digits/0.7.6/too_many_digits.sol#L20-L24) uses literals with too many digits:\n\t- [x2 = 100000](tests/detectors/too-many-digits/0.7.6/too_many_digits.sol#L22)\n", + "id": "dc1ea18f753ecea6946e89eb6676abb3813a16bc6a407e6a54ce87beeee261af", + "check": "too-many-digits", + "impact": "Informational", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/tx-origin/tx_origin.sol b/tests/detectors/tx-origin/0.4.25/tx_origin.sol similarity index 100% rename from tests/detectors/tx-origin/tx_origin.sol rename to tests/detectors/tx-origin/0.4.25/tx_origin.sol diff --git a/tests/detectors/tx-origin/tx_origin.sol.0.4.25.TxOrigin.json b/tests/detectors/tx-origin/0.4.25/tx_origin.sol.0.4.25.TxOrigin.json similarity index 90% rename from tests/detectors/tx-origin/tx_origin.sol.0.4.25.TxOrigin.json rename to tests/detectors/tx-origin/0.4.25/tx_origin.sol.0.4.25.TxOrigin.json index 82e8278ec9..50f7e3653f 100644 --- a/tests/detectors/tx-origin/tx_origin.sol.0.4.25.TxOrigin.json +++ b/tests/detectors/tx-origin/0.4.25/tx_origin.sol.0.4.25.TxOrigin.json @@ -9,9 +9,9 @@ "start": 116, "length": 60, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/tx-origin/tx_origin.sol", + "filename_relative": "tests/detectors/tx-origin/0.4.25/tx_origin.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/tx-origin/tx_origin.sol", + "filename_short": "tests/detectors/tx-origin/0.4.25/tx_origin.sol", "is_dependency": false, "lines": [ 9, @@ -29,9 +29,9 @@ "start": 28, "length": 393, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/tx-origin/tx_origin.sol", + "filename_relative": "tests/detectors/tx-origin/0.4.25/tx_origin.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/tx-origin/tx_origin.sol", + "filename_short": "tests/detectors/tx-origin/0.4.25/tx_origin.sol", "is_dependency": false, "lines": [ 3, @@ -73,9 +73,9 @@ "start": 142, "length": 27, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/tx-origin/tx_origin.sol", + "filename_relative": "tests/detectors/tx-origin/0.4.25/tx_origin.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/tx-origin/tx_origin.sol", + "filename_short": "tests/detectors/tx-origin/0.4.25/tx_origin.sol", "is_dependency": false, "lines": [ 10 @@ -91,9 +91,9 @@ "start": 116, "length": 60, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/tx-origin/tx_origin.sol", + "filename_relative": "tests/detectors/tx-origin/0.4.25/tx_origin.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/tx-origin/tx_origin.sol", + "filename_short": "tests/detectors/tx-origin/0.4.25/tx_origin.sol", "is_dependency": false, "lines": [ 9, @@ -111,9 +111,9 @@ "start": 28, "length": 393, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/tx-origin/tx_origin.sol", + "filename_relative": "tests/detectors/tx-origin/0.4.25/tx_origin.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/tx-origin/tx_origin.sol", + "filename_short": "tests/detectors/tx-origin/0.4.25/tx_origin.sol", "is_dependency": false, "lines": [ 3, @@ -151,9 +151,9 @@ } } ], - "description": "TxOrigin.bug0() (tests/detectors/tx-origin/tx_origin.sol#9-11) uses tx.origin for authorization: require(bool)(tx.origin == owner) (tests/detectors/tx-origin/tx_origin.sol#10)\n", - "markdown": "[TxOrigin.bug0()](tests/detectors/tx-origin/tx_origin.sol#L9-L11) uses tx.origin for authorization: [require(bool)(tx.origin == owner)](tests/detectors/tx-origin/tx_origin.sol#L10)\n", - "id": "15f4bed606e91476b860841a00a8e55b0badb541c03728c869daf4cad3b504a3", + "description": "TxOrigin.bug0() (tests/detectors/tx-origin/0.4.25/tx_origin.sol#9-11) uses tx.origin for authorization: require(bool)(tx.origin == owner) (tests/detectors/tx-origin/0.4.25/tx_origin.sol#10)\n", + "markdown": "[TxOrigin.bug0()](tests/detectors/tx-origin/0.4.25/tx_origin.sol#L9-L11) uses tx.origin for authorization: [require(bool)(tx.origin == owner)](tests/detectors/tx-origin/0.4.25/tx_origin.sol#L10)\n", + "id": "b8173796b90a23f4587ed67d7100dfd3c890bf9f96910e177630bb8a6f1703fe", "check": "tx-origin", "impact": "Medium", "confidence": "Medium" @@ -167,9 +167,9 @@ "start": 182, "length": 89, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/tx-origin/tx_origin.sol", + "filename_relative": "tests/detectors/tx-origin/0.4.25/tx_origin.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/tx-origin/tx_origin.sol", + "filename_short": "tests/detectors/tx-origin/0.4.25/tx_origin.sol", "is_dependency": false, "lines": [ 13, @@ -189,9 +189,9 @@ "start": 28, "length": 393, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/tx-origin/tx_origin.sol", + "filename_relative": "tests/detectors/tx-origin/0.4.25/tx_origin.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/tx-origin/tx_origin.sol", + "filename_short": "tests/detectors/tx-origin/0.4.25/tx_origin.sol", "is_dependency": false, "lines": [ 3, @@ -233,9 +233,9 @@ "start": 212, "length": 18, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/tx-origin/tx_origin.sol", + "filename_relative": "tests/detectors/tx-origin/0.4.25/tx_origin.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/tx-origin/tx_origin.sol", + "filename_short": "tests/detectors/tx-origin/0.4.25/tx_origin.sol", "is_dependency": false, "lines": [ 14 @@ -251,9 +251,9 @@ "start": 182, "length": 89, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/tx-origin/tx_origin.sol", + "filename_relative": "tests/detectors/tx-origin/0.4.25/tx_origin.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/tx-origin/tx_origin.sol", + "filename_short": "tests/detectors/tx-origin/0.4.25/tx_origin.sol", "is_dependency": false, "lines": [ 13, @@ -273,9 +273,9 @@ "start": 28, "length": 393, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/tx-origin/tx_origin.sol", + "filename_relative": "tests/detectors/tx-origin/0.4.25/tx_origin.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/tx-origin/tx_origin.sol", + "filename_short": "tests/detectors/tx-origin/0.4.25/tx_origin.sol", "is_dependency": false, "lines": [ 3, @@ -313,9 +313,9 @@ } } ], - "description": "TxOrigin.bug2() (tests/detectors/tx-origin/tx_origin.sol#13-17) uses tx.origin for authorization: tx.origin != owner (tests/detectors/tx-origin/tx_origin.sol#14)\n", - "markdown": "[TxOrigin.bug2()](tests/detectors/tx-origin/tx_origin.sol#L13-L17) uses tx.origin for authorization: [tx.origin != owner](tests/detectors/tx-origin/tx_origin.sol#L14)\n", - "id": "e1cc314e4bb02ab50d7d084278ab9305addf818716e02d5e46fffbc341718a63", + "description": "TxOrigin.bug2() (tests/detectors/tx-origin/0.4.25/tx_origin.sol#13-17) uses tx.origin for authorization: tx.origin != owner (tests/detectors/tx-origin/0.4.25/tx_origin.sol#14)\n", + "markdown": "[TxOrigin.bug2()](tests/detectors/tx-origin/0.4.25/tx_origin.sol#L13-L17) uses tx.origin for authorization: [tx.origin != owner](tests/detectors/tx-origin/0.4.25/tx_origin.sol#L14)\n", + "id": "7abecda0c73eb43dadcd93458222d0848b1dee58af66887f81b9381c90e656f6", "check": "tx-origin", "impact": "Medium", "confidence": "Medium" diff --git a/tests/detectors/tx-origin/tx_origin-0.5.1.sol b/tests/detectors/tx-origin/0.5.16/tx_origin.sol similarity index 100% rename from tests/detectors/tx-origin/tx_origin-0.5.1.sol rename to tests/detectors/tx-origin/0.5.16/tx_origin.sol diff --git a/tests/detectors/tx-origin/tx_origin-0.5.1.sol.0.5.1.TxOrigin.json b/tests/detectors/tx-origin/0.5.16/tx_origin.sol.0.5.16.TxOrigin.json similarity index 90% rename from tests/detectors/tx-origin/tx_origin-0.5.1.sol.0.5.1.TxOrigin.json rename to tests/detectors/tx-origin/0.5.16/tx_origin.sol.0.5.16.TxOrigin.json index cebf24f41a..269fefeeba 100644 --- a/tests/detectors/tx-origin/tx_origin-0.5.1.sol.0.5.1.TxOrigin.json +++ b/tests/detectors/tx-origin/0.5.16/tx_origin.sol.0.5.16.TxOrigin.json @@ -9,9 +9,9 @@ "start": 127, "length": 66, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/tx-origin/tx_origin-0.5.1.sol", + "filename_relative": "tests/detectors/tx-origin/0.5.16/tx_origin.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/tx-origin/tx_origin-0.5.1.sol", + "filename_short": "tests/detectors/tx-origin/0.5.16/tx_origin.sol", "is_dependency": false, "lines": [ 9, @@ -29,9 +29,9 @@ "start": 25, "length": 442, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/tx-origin/tx_origin-0.5.1.sol", + "filename_relative": "tests/detectors/tx-origin/0.5.16/tx_origin.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/tx-origin/tx_origin-0.5.1.sol", + "filename_short": "tests/detectors/tx-origin/0.5.16/tx_origin.sol", "is_dependency": false, "lines": [ 3, @@ -73,9 +73,9 @@ "start": 159, "length": 27, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/tx-origin/tx_origin-0.5.1.sol", + "filename_relative": "tests/detectors/tx-origin/0.5.16/tx_origin.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/tx-origin/tx_origin-0.5.1.sol", + "filename_short": "tests/detectors/tx-origin/0.5.16/tx_origin.sol", "is_dependency": false, "lines": [ 10 @@ -91,9 +91,9 @@ "start": 127, "length": 66, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/tx-origin/tx_origin-0.5.1.sol", + "filename_relative": "tests/detectors/tx-origin/0.5.16/tx_origin.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/tx-origin/tx_origin-0.5.1.sol", + "filename_short": "tests/detectors/tx-origin/0.5.16/tx_origin.sol", "is_dependency": false, "lines": [ 9, @@ -111,9 +111,9 @@ "start": 25, "length": 442, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/tx-origin/tx_origin-0.5.1.sol", + "filename_relative": "tests/detectors/tx-origin/0.5.16/tx_origin.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/tx-origin/tx_origin-0.5.1.sol", + "filename_short": "tests/detectors/tx-origin/0.5.16/tx_origin.sol", "is_dependency": false, "lines": [ 3, @@ -151,9 +151,9 @@ } } ], - "description": "TxOrigin.bug0() (tests/detectors/tx-origin/tx_origin-0.5.1.sol#9-11) uses tx.origin for authorization: require(bool)(tx.origin == owner) (tests/detectors/tx-origin/tx_origin-0.5.1.sol#10)\n", - "markdown": "[TxOrigin.bug0()](tests/detectors/tx-origin/tx_origin-0.5.1.sol#L9-L11) uses tx.origin for authorization: [require(bool)(tx.origin == owner)](tests/detectors/tx-origin/tx_origin-0.5.1.sol#L10)\n", - "id": "c69888e2e14c1a2f3eb49efce81b6561fd48ff4ca0dfe6b21db2ddd3e962b59f", + "description": "TxOrigin.bug0() (tests/detectors/tx-origin/0.5.16/tx_origin.sol#9-11) uses tx.origin for authorization: require(bool)(tx.origin == owner) (tests/detectors/tx-origin/0.5.16/tx_origin.sol#10)\n", + "markdown": "[TxOrigin.bug0()](tests/detectors/tx-origin/0.5.16/tx_origin.sol#L9-L11) uses tx.origin for authorization: [require(bool)(tx.origin == owner)](tests/detectors/tx-origin/0.5.16/tx_origin.sol#L10)\n", + "id": "17b0e5d0ce8741c95b5fd54f143d62588a291db7741897da6704c30d9e3abccd", "check": "tx-origin", "impact": "Medium", "confidence": "Medium" @@ -167,9 +167,9 @@ "start": 199, "length": 95, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/tx-origin/tx_origin-0.5.1.sol", + "filename_relative": "tests/detectors/tx-origin/0.5.16/tx_origin.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/tx-origin/tx_origin-0.5.1.sol", + "filename_short": "tests/detectors/tx-origin/0.5.16/tx_origin.sol", "is_dependency": false, "lines": [ 13, @@ -189,9 +189,9 @@ "start": 25, "length": 442, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/tx-origin/tx_origin-0.5.1.sol", + "filename_relative": "tests/detectors/tx-origin/0.5.16/tx_origin.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/tx-origin/tx_origin-0.5.1.sol", + "filename_short": "tests/detectors/tx-origin/0.5.16/tx_origin.sol", "is_dependency": false, "lines": [ 3, @@ -233,9 +233,9 @@ "start": 235, "length": 18, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/tx-origin/tx_origin-0.5.1.sol", + "filename_relative": "tests/detectors/tx-origin/0.5.16/tx_origin.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/tx-origin/tx_origin-0.5.1.sol", + "filename_short": "tests/detectors/tx-origin/0.5.16/tx_origin.sol", "is_dependency": false, "lines": [ 14 @@ -251,9 +251,9 @@ "start": 199, "length": 95, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/tx-origin/tx_origin-0.5.1.sol", + "filename_relative": "tests/detectors/tx-origin/0.5.16/tx_origin.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/tx-origin/tx_origin-0.5.1.sol", + "filename_short": "tests/detectors/tx-origin/0.5.16/tx_origin.sol", "is_dependency": false, "lines": [ 13, @@ -273,9 +273,9 @@ "start": 25, "length": 442, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/tx-origin/tx_origin-0.5.1.sol", + "filename_relative": "tests/detectors/tx-origin/0.5.16/tx_origin.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/tx-origin/tx_origin-0.5.1.sol", + "filename_short": "tests/detectors/tx-origin/0.5.16/tx_origin.sol", "is_dependency": false, "lines": [ 3, @@ -313,9 +313,9 @@ } } ], - "description": "TxOrigin.bug2() (tests/detectors/tx-origin/tx_origin-0.5.1.sol#13-17) uses tx.origin for authorization: tx.origin != owner (tests/detectors/tx-origin/tx_origin-0.5.1.sol#14)\n", - "markdown": "[TxOrigin.bug2()](tests/detectors/tx-origin/tx_origin-0.5.1.sol#L13-L17) uses tx.origin for authorization: [tx.origin != owner](tests/detectors/tx-origin/tx_origin-0.5.1.sol#L14)\n", - "id": "e54f32cd947c1bad4e54940df6613f466962e03d5a7b6f5c98ea8bc14b0518a6", + "description": "TxOrigin.bug2() (tests/detectors/tx-origin/0.5.16/tx_origin.sol#13-17) uses tx.origin for authorization: tx.origin != owner (tests/detectors/tx-origin/0.5.16/tx_origin.sol#14)\n", + "markdown": "[TxOrigin.bug2()](tests/detectors/tx-origin/0.5.16/tx_origin.sol#L13-L17) uses tx.origin for authorization: [tx.origin != owner](tests/detectors/tx-origin/0.5.16/tx_origin.sol#L14)\n", + "id": "f3508f86e8e1e9edd815558ff94afc9428e8c0e2363a447efb86ceeefbc70ee3", "check": "tx-origin", "impact": "Medium", "confidence": "Medium" diff --git a/tests/detectors/tx-origin/0.6.11/tx_origin.sol b/tests/detectors/tx-origin/0.6.11/tx_origin.sol new file mode 100644 index 0000000000..d4df7f529e --- /dev/null +++ b/tests/detectors/tx-origin/0.6.11/tx_origin.sol @@ -0,0 +1,26 @@ +// pragma solidity ^0.5.0; + +contract TxOrigin { + + address payable owner; + + constructor() public{ owner = msg.sender; } + + function bug0() public{ + require(tx.origin == owner); + } + + function bug2() public{ + if (tx.origin != owner) { + revert(); + } + } + + function legit0() public{ + require(tx.origin == msg.sender); + } + + function legit1() public{ + tx.origin.transfer(address(this).balance); + } +} diff --git a/tests/detectors/tx-origin/0.6.11/tx_origin.sol.0.6.11.TxOrigin.json b/tests/detectors/tx-origin/0.6.11/tx_origin.sol.0.6.11.TxOrigin.json new file mode 100644 index 0000000000..d5e1700f38 --- /dev/null +++ b/tests/detectors/tx-origin/0.6.11/tx_origin.sol.0.6.11.TxOrigin.json @@ -0,0 +1,324 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bug0", + "source_mapping": { + "start": 130, + "length": 66, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/tx-origin/0.6.11/tx_origin.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/tx-origin/0.6.11/tx_origin.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TxOrigin", + "source_mapping": { + "start": 28, + "length": 442, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/tx-origin/0.6.11/tx_origin.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/tx-origin/0.6.11/tx_origin.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bug0()" + } + }, + { + "type": "node", + "name": "require(bool)(tx.origin == owner)", + "source_mapping": { + "start": 162, + "length": 27, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/tx-origin/0.6.11/tx_origin.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/tx-origin/0.6.11/tx_origin.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 9, + "ending_column": 36 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bug0", + "source_mapping": { + "start": 130, + "length": 66, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/tx-origin/0.6.11/tx_origin.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/tx-origin/0.6.11/tx_origin.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TxOrigin", + "source_mapping": { + "start": 28, + "length": 442, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/tx-origin/0.6.11/tx_origin.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/tx-origin/0.6.11/tx_origin.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bug0()" + } + } + } + } + ], + "description": "TxOrigin.bug0() (tests/detectors/tx-origin/0.6.11/tx_origin.sol#9-11) uses tx.origin for authorization: require(bool)(tx.origin == owner) (tests/detectors/tx-origin/0.6.11/tx_origin.sol#10)\n", + "markdown": "[TxOrigin.bug0()](tests/detectors/tx-origin/0.6.11/tx_origin.sol#L9-L11) uses tx.origin for authorization: [require(bool)(tx.origin == owner)](tests/detectors/tx-origin/0.6.11/tx_origin.sol#L10)\n", + "id": "5eb57935f1e4650e5340de788d03401c5f010c2bf5f0240254d2235bbe1b970b", + "check": "tx-origin", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bug2", + "source_mapping": { + "start": 202, + "length": 95, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/tx-origin/0.6.11/tx_origin.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/tx-origin/0.6.11/tx_origin.sol", + "is_dependency": false, + "lines": [ + 13, + 14, + 15, + 16, + 17 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TxOrigin", + "source_mapping": { + "start": 28, + "length": 442, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/tx-origin/0.6.11/tx_origin.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/tx-origin/0.6.11/tx_origin.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bug2()" + } + }, + { + "type": "node", + "name": "tx.origin != owner", + "source_mapping": { + "start": 238, + "length": 18, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/tx-origin/0.6.11/tx_origin.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/tx-origin/0.6.11/tx_origin.sol", + "is_dependency": false, + "lines": [ + 14 + ], + "starting_column": 13, + "ending_column": 31 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bug2", + "source_mapping": { + "start": 202, + "length": 95, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/tx-origin/0.6.11/tx_origin.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/tx-origin/0.6.11/tx_origin.sol", + "is_dependency": false, + "lines": [ + 13, + 14, + 15, + 16, + 17 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TxOrigin", + "source_mapping": { + "start": 28, + "length": 442, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/tx-origin/0.6.11/tx_origin.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/tx-origin/0.6.11/tx_origin.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bug2()" + } + } + } + } + ], + "description": "TxOrigin.bug2() (tests/detectors/tx-origin/0.6.11/tx_origin.sol#13-17) uses tx.origin for authorization: tx.origin != owner (tests/detectors/tx-origin/0.6.11/tx_origin.sol#14)\n", + "markdown": "[TxOrigin.bug2()](tests/detectors/tx-origin/0.6.11/tx_origin.sol#L13-L17) uses tx.origin for authorization: [tx.origin != owner](tests/detectors/tx-origin/0.6.11/tx_origin.sol#L14)\n", + "id": "817a27177f073d8ab4a011817ea1e6ebb8b7cba8691c8dea621ee65a77871ee0", + "check": "tx-origin", + "impact": "Medium", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/tx-origin/0.7.6/tx_origin.sol b/tests/detectors/tx-origin/0.7.6/tx_origin.sol new file mode 100644 index 0000000000..d4df7f529e --- /dev/null +++ b/tests/detectors/tx-origin/0.7.6/tx_origin.sol @@ -0,0 +1,26 @@ +// pragma solidity ^0.5.0; + +contract TxOrigin { + + address payable owner; + + constructor() public{ owner = msg.sender; } + + function bug0() public{ + require(tx.origin == owner); + } + + function bug2() public{ + if (tx.origin != owner) { + revert(); + } + } + + function legit0() public{ + require(tx.origin == msg.sender); + } + + function legit1() public{ + tx.origin.transfer(address(this).balance); + } +} diff --git a/tests/detectors/tx-origin/0.7.6/tx_origin.sol.0.7.6.TxOrigin.json b/tests/detectors/tx-origin/0.7.6/tx_origin.sol.0.7.6.TxOrigin.json new file mode 100644 index 0000000000..489fe228cd --- /dev/null +++ b/tests/detectors/tx-origin/0.7.6/tx_origin.sol.0.7.6.TxOrigin.json @@ -0,0 +1,324 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bug0", + "source_mapping": { + "start": 130, + "length": 66, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/tx-origin/0.7.6/tx_origin.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/tx-origin/0.7.6/tx_origin.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TxOrigin", + "source_mapping": { + "start": 28, + "length": 442, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/tx-origin/0.7.6/tx_origin.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/tx-origin/0.7.6/tx_origin.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bug0()" + } + }, + { + "type": "node", + "name": "require(bool)(tx.origin == owner)", + "source_mapping": { + "start": 162, + "length": 27, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/tx-origin/0.7.6/tx_origin.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/tx-origin/0.7.6/tx_origin.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 9, + "ending_column": 36 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bug0", + "source_mapping": { + "start": 130, + "length": 66, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/tx-origin/0.7.6/tx_origin.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/tx-origin/0.7.6/tx_origin.sol", + "is_dependency": false, + "lines": [ + 9, + 10, + 11 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TxOrigin", + "source_mapping": { + "start": 28, + "length": 442, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/tx-origin/0.7.6/tx_origin.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/tx-origin/0.7.6/tx_origin.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bug0()" + } + } + } + } + ], + "description": "TxOrigin.bug0() (tests/detectors/tx-origin/0.7.6/tx_origin.sol#9-11) uses tx.origin for authorization: require(bool)(tx.origin == owner) (tests/detectors/tx-origin/0.7.6/tx_origin.sol#10)\n", + "markdown": "[TxOrigin.bug0()](tests/detectors/tx-origin/0.7.6/tx_origin.sol#L9-L11) uses tx.origin for authorization: [require(bool)(tx.origin == owner)](tests/detectors/tx-origin/0.7.6/tx_origin.sol#L10)\n", + "id": "d3d9d4cb2307781870af54ebca528052197b021adcabf4d0c3a897e96affece3", + "check": "tx-origin", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bug2", + "source_mapping": { + "start": 202, + "length": 95, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/tx-origin/0.7.6/tx_origin.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/tx-origin/0.7.6/tx_origin.sol", + "is_dependency": false, + "lines": [ + 13, + 14, + 15, + 16, + 17 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TxOrigin", + "source_mapping": { + "start": 28, + "length": 442, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/tx-origin/0.7.6/tx_origin.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/tx-origin/0.7.6/tx_origin.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bug2()" + } + }, + { + "type": "node", + "name": "tx.origin != owner", + "source_mapping": { + "start": 238, + "length": 18, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/tx-origin/0.7.6/tx_origin.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/tx-origin/0.7.6/tx_origin.sol", + "is_dependency": false, + "lines": [ + 14 + ], + "starting_column": 13, + "ending_column": 31 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bug2", + "source_mapping": { + "start": 202, + "length": 95, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/tx-origin/0.7.6/tx_origin.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/tx-origin/0.7.6/tx_origin.sol", + "is_dependency": false, + "lines": [ + 13, + 14, + 15, + 16, + 17 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TxOrigin", + "source_mapping": { + "start": 28, + "length": 442, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/tx-origin/0.7.6/tx_origin.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/tx-origin/0.7.6/tx_origin.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bug2()" + } + } + } + } + ], + "description": "TxOrigin.bug2() (tests/detectors/tx-origin/0.7.6/tx_origin.sol#13-17) uses tx.origin for authorization: tx.origin != owner (tests/detectors/tx-origin/0.7.6/tx_origin.sol#14)\n", + "markdown": "[TxOrigin.bug2()](tests/detectors/tx-origin/0.7.6/tx_origin.sol#L13-L17) uses tx.origin for authorization: [tx.origin != owner](tests/detectors/tx-origin/0.7.6/tx_origin.sol#L14)\n", + "id": "1c195c6a3ea5b7e77c12b7580544ef2320699359862c22961726f112ab27b3a5", + "check": "tx-origin", + "impact": "Medium", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol b/tests/detectors/unchecked-lowlevel/0.4.25/unchecked_lowlevel.sol similarity index 100% rename from tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol rename to tests/detectors/unchecked-lowlevel/0.4.25/unchecked_lowlevel.sol diff --git a/tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol.0.4.25.UncheckedLowLevel.json b/tests/detectors/unchecked-lowlevel/0.4.25/unchecked_lowlevel.sol.0.4.25.UncheckedLowLevel.json similarity index 85% rename from tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol.0.4.25.UncheckedLowLevel.json rename to tests/detectors/unchecked-lowlevel/0.4.25/unchecked_lowlevel.sol.0.4.25.UncheckedLowLevel.json index 873defd437..8d06bc9b70 100644 --- a/tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol.0.4.25.UncheckedLowLevel.json +++ b/tests/detectors/unchecked-lowlevel/0.4.25/unchecked_lowlevel.sol.0.4.25.UncheckedLowLevel.json @@ -9,9 +9,9 @@ "start": 21, "length": 88, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol", + "filename_relative": "tests/detectors/unchecked-lowlevel/0.4.25/unchecked_lowlevel.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol", + "filename_short": "tests/detectors/unchecked-lowlevel/0.4.25/unchecked_lowlevel.sol", "is_dependency": false, "lines": [ 2, @@ -29,9 +29,9 @@ "start": 0, "length": 214, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol", + "filename_relative": "tests/detectors/unchecked-lowlevel/0.4.25/unchecked_lowlevel.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol", + "filename_short": "tests/detectors/unchecked-lowlevel/0.4.25/unchecked_lowlevel.sol", "is_dependency": false, "lines": [ 1, @@ -59,9 +59,9 @@ "start": 73, "length": 29, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol", + "filename_relative": "tests/detectors/unchecked-lowlevel/0.4.25/unchecked_lowlevel.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol", + "filename_short": "tests/detectors/unchecked-lowlevel/0.4.25/unchecked_lowlevel.sol", "is_dependency": false, "lines": [ 3 @@ -77,9 +77,9 @@ "start": 21, "length": 88, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol", + "filename_relative": "tests/detectors/unchecked-lowlevel/0.4.25/unchecked_lowlevel.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol", + "filename_short": "tests/detectors/unchecked-lowlevel/0.4.25/unchecked_lowlevel.sol", "is_dependency": false, "lines": [ 2, @@ -97,9 +97,9 @@ "start": 0, "length": 214, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol", + "filename_relative": "tests/detectors/unchecked-lowlevel/0.4.25/unchecked_lowlevel.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol", + "filename_short": "tests/detectors/unchecked-lowlevel/0.4.25/unchecked_lowlevel.sol", "is_dependency": false, "lines": [ 1, @@ -123,9 +123,9 @@ } } ], - "description": "MyConc.bad(address) (tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol#2-4) ignores return value by dst.call.value(msg.value)() (tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol#3)\n", - "markdown": "[MyConc.bad(address)](tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol#L2-L4) ignores return value by [dst.call.value(msg.value)()](tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol#L3)\n", - "id": "ce0c8a102a77c82a76e5ecbaf55d375a20069186c8235243fbc1ffbcf02ccf5b", + "description": "MyConc.bad(address) (tests/detectors/unchecked-lowlevel/0.4.25/unchecked_lowlevel.sol#2-4) ignores return value by dst.call.value(msg.value)() (tests/detectors/unchecked-lowlevel/0.4.25/unchecked_lowlevel.sol#3)\n", + "markdown": "[MyConc.bad(address)](tests/detectors/unchecked-lowlevel/0.4.25/unchecked_lowlevel.sol#L2-L4) ignores return value by [dst.call.value(msg.value)()](tests/detectors/unchecked-lowlevel/0.4.25/unchecked_lowlevel.sol#L3)\n", + "id": "5e99856e75f5f5937a5b9f8f90fc9ce01eabfcf97c0d3e2b59f5cd057add9c19", "check": "unchecked-lowlevel", "impact": "Medium", "confidence": "Medium" diff --git a/tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol b/tests/detectors/unchecked-lowlevel/0.5.16/unchecked_lowlevel.sol similarity index 100% rename from tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol rename to tests/detectors/unchecked-lowlevel/0.5.16/unchecked_lowlevel.sol diff --git a/tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol.0.5.1.UncheckedLowLevel.json b/tests/detectors/unchecked-lowlevel/0.5.16/unchecked_lowlevel.sol.0.5.16.UncheckedLowLevel.json similarity index 85% rename from tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol.0.5.1.UncheckedLowLevel.json rename to tests/detectors/unchecked-lowlevel/0.5.16/unchecked_lowlevel.sol.0.5.16.UncheckedLowLevel.json index b610e6934d..87f21da0f3 100644 --- a/tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol.0.5.1.UncheckedLowLevel.json +++ b/tests/detectors/unchecked-lowlevel/0.5.16/unchecked_lowlevel.sol.0.5.16.UncheckedLowLevel.json @@ -9,9 +9,9 @@ "start": 21, "length": 96, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol", + "filename_relative": "tests/detectors/unchecked-lowlevel/0.5.16/unchecked_lowlevel.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol", + "filename_short": "tests/detectors/unchecked-lowlevel/0.5.16/unchecked_lowlevel.sol", "is_dependency": false, "lines": [ 2, @@ -29,9 +29,9 @@ "start": 0, "length": 274, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol", + "filename_relative": "tests/detectors/unchecked-lowlevel/0.5.16/unchecked_lowlevel.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol", + "filename_short": "tests/detectors/unchecked-lowlevel/0.5.16/unchecked_lowlevel.sol", "is_dependency": false, "lines": [ 1, @@ -60,9 +60,9 @@ "start": 81, "length": 29, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol", + "filename_relative": "tests/detectors/unchecked-lowlevel/0.5.16/unchecked_lowlevel.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol", + "filename_short": "tests/detectors/unchecked-lowlevel/0.5.16/unchecked_lowlevel.sol", "is_dependency": false, "lines": [ 3 @@ -78,9 +78,9 @@ "start": 21, "length": 96, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol", + "filename_relative": "tests/detectors/unchecked-lowlevel/0.5.16/unchecked_lowlevel.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol", + "filename_short": "tests/detectors/unchecked-lowlevel/0.5.16/unchecked_lowlevel.sol", "is_dependency": false, "lines": [ 2, @@ -98,9 +98,9 @@ "start": 0, "length": 274, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol", + "filename_relative": "tests/detectors/unchecked-lowlevel/0.5.16/unchecked_lowlevel.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol", + "filename_short": "tests/detectors/unchecked-lowlevel/0.5.16/unchecked_lowlevel.sol", "is_dependency": false, "lines": [ 1, @@ -125,9 +125,9 @@ } } ], - "description": "MyConc.bad(address) (tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol#2-4) ignores return value by dst.call.value(msg.value)() (tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol#3)\n", - "markdown": "[MyConc.bad(address)](tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol#L2-L4) ignores return value by [dst.call.value(msg.value)()](tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol#L3)\n", - "id": "718dbfef93c02e3e663e9300449dc30b53bb9dc132882f1e63e2a84b2f7cdf2e", + "description": "MyConc.bad(address) (tests/detectors/unchecked-lowlevel/0.5.16/unchecked_lowlevel.sol#2-4) ignores return value by dst.call.value(msg.value)() (tests/detectors/unchecked-lowlevel/0.5.16/unchecked_lowlevel.sol#3)\n", + "markdown": "[MyConc.bad(address)](tests/detectors/unchecked-lowlevel/0.5.16/unchecked_lowlevel.sol#L2-L4) ignores return value by [dst.call.value(msg.value)()](tests/detectors/unchecked-lowlevel/0.5.16/unchecked_lowlevel.sol#L3)\n", + "id": "f03d14053bc8c0d4a6cacad0f9915b9d1be3a711767d92e994ae01f690e2b9ca", "check": "unchecked-lowlevel", "impact": "Medium", "confidence": "Medium" diff --git a/tests/detectors/unchecked-lowlevel/0.6.11/unchecked_lowlevel.sol b/tests/detectors/unchecked-lowlevel/0.6.11/unchecked_lowlevel.sol new file mode 100644 index 0000000000..99bd1f822c --- /dev/null +++ b/tests/detectors/unchecked-lowlevel/0.6.11/unchecked_lowlevel.sol @@ -0,0 +1,11 @@ +contract MyConc{ + function bad(address payable dst) external payable{ + dst.call.value(msg.value)(""); + } + + function good(address payable dst) external payable{ + (bool ret, bytes memory _) = dst.call.value(msg.value)(""); + require(ret); + } + +} diff --git a/tests/detectors/unchecked-lowlevel/0.6.11/unchecked_lowlevel.sol.0.6.11.UncheckedLowLevel.json b/tests/detectors/unchecked-lowlevel/0.6.11/unchecked_lowlevel.sol.0.6.11.UncheckedLowLevel.json new file mode 100644 index 0000000000..a3eb314848 --- /dev/null +++ b/tests/detectors/unchecked-lowlevel/0.6.11/unchecked_lowlevel.sol.0.6.11.UncheckedLowLevel.json @@ -0,0 +1,136 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad", + "source_mapping": { + "start": 21, + "length": 96, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unchecked-lowlevel/0.6.11/unchecked_lowlevel.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unchecked-lowlevel/0.6.11/unchecked_lowlevel.sol", + "is_dependency": false, + "lines": [ + 2, + 3, + 4 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "MyConc", + "source_mapping": { + "start": 0, + "length": 274, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unchecked-lowlevel/0.6.11/unchecked_lowlevel.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unchecked-lowlevel/0.6.11/unchecked_lowlevel.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad(address)" + } + }, + { + "type": "node", + "name": "dst.call.value(msg.value)()", + "source_mapping": { + "start": 81, + "length": 29, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unchecked-lowlevel/0.6.11/unchecked_lowlevel.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unchecked-lowlevel/0.6.11/unchecked_lowlevel.sol", + "is_dependency": false, + "lines": [ + 3 + ], + "starting_column": 9, + "ending_column": 38 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad", + "source_mapping": { + "start": 21, + "length": 96, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unchecked-lowlevel/0.6.11/unchecked_lowlevel.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unchecked-lowlevel/0.6.11/unchecked_lowlevel.sol", + "is_dependency": false, + "lines": [ + 2, + 3, + 4 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "MyConc", + "source_mapping": { + "start": 0, + "length": 274, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unchecked-lowlevel/0.6.11/unchecked_lowlevel.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unchecked-lowlevel/0.6.11/unchecked_lowlevel.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad(address)" + } + } + } + } + ], + "description": "MyConc.bad(address) (tests/detectors/unchecked-lowlevel/0.6.11/unchecked_lowlevel.sol#2-4) ignores return value by dst.call.value(msg.value)() (tests/detectors/unchecked-lowlevel/0.6.11/unchecked_lowlevel.sol#3)\n", + "markdown": "[MyConc.bad(address)](tests/detectors/unchecked-lowlevel/0.6.11/unchecked_lowlevel.sol#L2-L4) ignores return value by [dst.call.value(msg.value)()](tests/detectors/unchecked-lowlevel/0.6.11/unchecked_lowlevel.sol#L3)\n", + "id": "9b10d50510f386ab6f8cbfed4486317d581fcb6795ccc773bb0e7922b4e2512f", + "check": "unchecked-lowlevel", + "impact": "Medium", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/unchecked-lowlevel/0.7.6/unchecked_lowlevel.sol b/tests/detectors/unchecked-lowlevel/0.7.6/unchecked_lowlevel.sol new file mode 100644 index 0000000000..96712b0779 --- /dev/null +++ b/tests/detectors/unchecked-lowlevel/0.7.6/unchecked_lowlevel.sol @@ -0,0 +1,11 @@ +contract MyConc{ + function bad(address payable dst) external payable{ + dst.call{value:msg.value}(""); + } + + function good(address payable dst) external payable{ + (bool ret, bytes memory _) = dst.call{value:msg.value}(""); + require(ret); + } + +} diff --git a/tests/detectors/unchecked-lowlevel/0.7.6/unchecked_lowlevel.sol.0.7.6.UncheckedLowLevel.json b/tests/detectors/unchecked-lowlevel/0.7.6/unchecked_lowlevel.sol.0.7.6.UncheckedLowLevel.json new file mode 100644 index 0000000000..b7e64639c8 --- /dev/null +++ b/tests/detectors/unchecked-lowlevel/0.7.6/unchecked_lowlevel.sol.0.7.6.UncheckedLowLevel.json @@ -0,0 +1,136 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad", + "source_mapping": { + "start": 21, + "length": 96, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unchecked-lowlevel/0.7.6/unchecked_lowlevel.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unchecked-lowlevel/0.7.6/unchecked_lowlevel.sol", + "is_dependency": false, + "lines": [ + 2, + 3, + 4 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "MyConc", + "source_mapping": { + "start": 0, + "length": 274, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unchecked-lowlevel/0.7.6/unchecked_lowlevel.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unchecked-lowlevel/0.7.6/unchecked_lowlevel.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad(address)" + } + }, + { + "type": "node", + "name": "dst.call{value: msg.value}()", + "source_mapping": { + "start": 81, + "length": 29, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unchecked-lowlevel/0.7.6/unchecked_lowlevel.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unchecked-lowlevel/0.7.6/unchecked_lowlevel.sol", + "is_dependency": false, + "lines": [ + 3 + ], + "starting_column": 9, + "ending_column": 38 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad", + "source_mapping": { + "start": 21, + "length": 96, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unchecked-lowlevel/0.7.6/unchecked_lowlevel.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unchecked-lowlevel/0.7.6/unchecked_lowlevel.sol", + "is_dependency": false, + "lines": [ + 2, + 3, + 4 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "MyConc", + "source_mapping": { + "start": 0, + "length": 274, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unchecked-lowlevel/0.7.6/unchecked_lowlevel.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unchecked-lowlevel/0.7.6/unchecked_lowlevel.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad(address)" + } + } + } + } + ], + "description": "MyConc.bad(address) (tests/detectors/unchecked-lowlevel/0.7.6/unchecked_lowlevel.sol#2-4) ignores return value by dst.call{value: msg.value}() (tests/detectors/unchecked-lowlevel/0.7.6/unchecked_lowlevel.sol#3)\n", + "markdown": "[MyConc.bad(address)](tests/detectors/unchecked-lowlevel/0.7.6/unchecked_lowlevel.sol#L2-L4) ignores return value by [dst.call{value: msg.value}()](tests/detectors/unchecked-lowlevel/0.7.6/unchecked_lowlevel.sol#L3)\n", + "id": "55182dfa175ac27adc4625cf672f25b6b759d8f4645fed76e35bbeace0733169", + "check": "unchecked-lowlevel", + "impact": "Medium", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/unchecked-send/0.4.25/unchecked_send.sol b/tests/detectors/unchecked-send/0.4.25/unchecked_send.sol new file mode 100644 index 0000000000..52fe16fac0 --- /dev/null +++ b/tests/detectors/unchecked-send/0.4.25/unchecked_send.sol @@ -0,0 +1,18 @@ +contract MyConc{ + function bad(address dst) external payable{ + dst.send(msg.value); + } + + function good(address dst) external payable{ + require(dst.send(msg.value)); + } + + function good2(address dst) external payable{ + bool res = dst.send(msg.value); + if(!res){ + emit Failed(dst, msg.value); + } + } + + event Failed(address, uint); +} diff --git a/tests/detectors/unchecked-send/0.4.25/unchecked_send.sol.0.4.25.UncheckedSend.json b/tests/detectors/unchecked-send/0.4.25/unchecked_send.sol.0.4.25.UncheckedSend.json new file mode 100644 index 0000000000..947a30ed00 --- /dev/null +++ b/tests/detectors/unchecked-send/0.4.25/unchecked_send.sol.0.4.25.UncheckedSend.json @@ -0,0 +1,150 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad", + "source_mapping": { + "start": 21, + "length": 78, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unchecked-send/0.4.25/unchecked_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unchecked-send/0.4.25/unchecked_send.sol", + "is_dependency": false, + "lines": [ + 2, + 3, + 4 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "MyConc", + "source_mapping": { + "start": 0, + "length": 395, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unchecked-send/0.4.25/unchecked_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unchecked-send/0.4.25/unchecked_send.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad(address)" + } + }, + { + "type": "node", + "name": "dst.send(msg.value)", + "source_mapping": { + "start": 73, + "length": 19, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unchecked-send/0.4.25/unchecked_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unchecked-send/0.4.25/unchecked_send.sol", + "is_dependency": false, + "lines": [ + 3 + ], + "starting_column": 9, + "ending_column": 28 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad", + "source_mapping": { + "start": 21, + "length": 78, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unchecked-send/0.4.25/unchecked_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unchecked-send/0.4.25/unchecked_send.sol", + "is_dependency": false, + "lines": [ + 2, + 3, + 4 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "MyConc", + "source_mapping": { + "start": 0, + "length": 395, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unchecked-send/0.4.25/unchecked_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unchecked-send/0.4.25/unchecked_send.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad(address)" + } + } + } + } + ], + "description": "MyConc.bad(address) (tests/detectors/unchecked-send/0.4.25/unchecked_send.sol#2-4) ignores return value by dst.send(msg.value) (tests/detectors/unchecked-send/0.4.25/unchecked_send.sol#3)\n", + "markdown": "[MyConc.bad(address)](tests/detectors/unchecked-send/0.4.25/unchecked_send.sol#L2-L4) ignores return value by [dst.send(msg.value)](tests/detectors/unchecked-send/0.4.25/unchecked_send.sol#L3)\n", + "id": "b94e1c9425182d05c61d316caea5bc02b4b68478b0640db50f80f3a8af690cf8", + "check": "unchecked-send", + "impact": "Medium", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/unchecked-send/unchecked_send-0.5.1.sol b/tests/detectors/unchecked-send/0.5.16/unchecked_send.sol similarity index 100% rename from tests/detectors/unchecked-send/unchecked_send-0.5.1.sol rename to tests/detectors/unchecked-send/0.5.16/unchecked_send.sol diff --git a/tests/detectors/unchecked-send/0.5.16/unchecked_send.sol.0.5.16.UncheckedSend.json b/tests/detectors/unchecked-send/0.5.16/unchecked_send.sol.0.5.16.UncheckedSend.json new file mode 100644 index 0000000000..bd9449ba83 --- /dev/null +++ b/tests/detectors/unchecked-send/0.5.16/unchecked_send.sol.0.5.16.UncheckedSend.json @@ -0,0 +1,150 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad", + "source_mapping": { + "start": 21, + "length": 86, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unchecked-send/0.5.16/unchecked_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unchecked-send/0.5.16/unchecked_send.sol", + "is_dependency": false, + "lines": [ + 2, + 3, + 4 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "MyConc", + "source_mapping": { + "start": 0, + "length": 419, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unchecked-send/0.5.16/unchecked_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unchecked-send/0.5.16/unchecked_send.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad(address)" + } + }, + { + "type": "node", + "name": "dst.send(msg.value)", + "source_mapping": { + "start": 81, + "length": 19, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unchecked-send/0.5.16/unchecked_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unchecked-send/0.5.16/unchecked_send.sol", + "is_dependency": false, + "lines": [ + 3 + ], + "starting_column": 9, + "ending_column": 28 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad", + "source_mapping": { + "start": 21, + "length": 86, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unchecked-send/0.5.16/unchecked_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unchecked-send/0.5.16/unchecked_send.sol", + "is_dependency": false, + "lines": [ + 2, + 3, + 4 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "MyConc", + "source_mapping": { + "start": 0, + "length": 419, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unchecked-send/0.5.16/unchecked_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unchecked-send/0.5.16/unchecked_send.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad(address)" + } + } + } + } + ], + "description": "MyConc.bad(address) (tests/detectors/unchecked-send/0.5.16/unchecked_send.sol#2-4) ignores return value by dst.send(msg.value) (tests/detectors/unchecked-send/0.5.16/unchecked_send.sol#3)\n", + "markdown": "[MyConc.bad(address)](tests/detectors/unchecked-send/0.5.16/unchecked_send.sol#L2-L4) ignores return value by [dst.send(msg.value)](tests/detectors/unchecked-send/0.5.16/unchecked_send.sol#L3)\n", + "id": "0a6498f517f4ce099f69fa38244cd23d58ea065fced5890d0cbbc1e5d3cc2c67", + "check": "unchecked-send", + "impact": "Medium", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/unchecked-send/0.6.11/unchecked_send.sol b/tests/detectors/unchecked-send/0.6.11/unchecked_send.sol new file mode 100644 index 0000000000..8e27089382 --- /dev/null +++ b/tests/detectors/unchecked-send/0.6.11/unchecked_send.sol @@ -0,0 +1,18 @@ +contract MyConc{ + function bad(address payable dst) external payable{ + dst.send(msg.value); + } + + function good(address payable dst) external payable{ + require(dst.send(msg.value)); + } + + function good2(address payable dst) external payable{ + bool res = dst.send(msg.value); + if(!res){ + emit Failed(dst, msg.value); + } + } + + event Failed(address, uint); +} diff --git a/tests/detectors/unchecked-send/0.6.11/unchecked_send.sol.0.6.11.UncheckedSend.json b/tests/detectors/unchecked-send/0.6.11/unchecked_send.sol.0.6.11.UncheckedSend.json new file mode 100644 index 0000000000..a6b89cf5c6 --- /dev/null +++ b/tests/detectors/unchecked-send/0.6.11/unchecked_send.sol.0.6.11.UncheckedSend.json @@ -0,0 +1,150 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad", + "source_mapping": { + "start": 21, + "length": 86, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unchecked-send/0.6.11/unchecked_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unchecked-send/0.6.11/unchecked_send.sol", + "is_dependency": false, + "lines": [ + 2, + 3, + 4 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "MyConc", + "source_mapping": { + "start": 0, + "length": 419, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unchecked-send/0.6.11/unchecked_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unchecked-send/0.6.11/unchecked_send.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad(address)" + } + }, + { + "type": "node", + "name": "dst.send(msg.value)", + "source_mapping": { + "start": 81, + "length": 19, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unchecked-send/0.6.11/unchecked_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unchecked-send/0.6.11/unchecked_send.sol", + "is_dependency": false, + "lines": [ + 3 + ], + "starting_column": 9, + "ending_column": 28 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad", + "source_mapping": { + "start": 21, + "length": 86, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unchecked-send/0.6.11/unchecked_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unchecked-send/0.6.11/unchecked_send.sol", + "is_dependency": false, + "lines": [ + 2, + 3, + 4 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "MyConc", + "source_mapping": { + "start": 0, + "length": 419, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unchecked-send/0.6.11/unchecked_send.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unchecked-send/0.6.11/unchecked_send.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad(address)" + } + } + } + } + ], + "description": "MyConc.bad(address) (tests/detectors/unchecked-send/0.6.11/unchecked_send.sol#2-4) ignores return value by dst.send(msg.value) (tests/detectors/unchecked-send/0.6.11/unchecked_send.sol#3)\n", + "markdown": "[MyConc.bad(address)](tests/detectors/unchecked-send/0.6.11/unchecked_send.sol#L2-L4) ignores return value by [dst.send(msg.value)](tests/detectors/unchecked-send/0.6.11/unchecked_send.sol#L3)\n", + "id": "9050ea44b0aae908f94739cc228af9e1964fe0b0305fd90797259305f9344b5e", + "check": "unchecked-send", + "impact": "Medium", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/unchecked-send/0.7.6/unchecked_send.sol b/tests/detectors/unchecked-send/0.7.6/unchecked_send.sol new file mode 100644 index 0000000000..8e27089382 --- /dev/null +++ b/tests/detectors/unchecked-send/0.7.6/unchecked_send.sol @@ -0,0 +1,18 @@ +contract MyConc{ + function bad(address payable dst) external payable{ + dst.send(msg.value); + } + + function good(address payable dst) external payable{ + require(dst.send(msg.value)); + } + + function good2(address payable dst) external payable{ + bool res = dst.send(msg.value); + if(!res){ + emit Failed(dst, msg.value); + } + } + + event Failed(address, uint); +} diff --git a/tests/detectors/unchecked-send/unchecked_send-0.5.1.sol.0.5.1.UncheckedSend.json b/tests/detectors/unchecked-send/0.7.6/unchecked_send.sol.0.7.6.UncheckedSend.json similarity index 88% rename from tests/detectors/unchecked-send/unchecked_send-0.5.1.sol.0.5.1.UncheckedSend.json rename to tests/detectors/unchecked-send/0.7.6/unchecked_send.sol.0.7.6.UncheckedSend.json index f5b7e2c4e2..601007430c 100644 --- a/tests/detectors/unchecked-send/unchecked_send-0.5.1.sol.0.5.1.UncheckedSend.json +++ b/tests/detectors/unchecked-send/0.7.6/unchecked_send.sol.0.7.6.UncheckedSend.json @@ -9,9 +9,9 @@ "start": 21, "length": 86, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unchecked-send/unchecked_send-0.5.1.sol", + "filename_relative": "tests/detectors/unchecked-send/0.7.6/unchecked_send.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unchecked-send/unchecked_send-0.5.1.sol", + "filename_short": "tests/detectors/unchecked-send/0.7.6/unchecked_send.sol", "is_dependency": false, "lines": [ 2, @@ -29,9 +29,9 @@ "start": 0, "length": 419, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unchecked-send/unchecked_send-0.5.1.sol", + "filename_relative": "tests/detectors/unchecked-send/0.7.6/unchecked_send.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unchecked-send/unchecked_send-0.5.1.sol", + "filename_short": "tests/detectors/unchecked-send/0.7.6/unchecked_send.sol", "is_dependency": false, "lines": [ 1, @@ -67,9 +67,9 @@ "start": 81, "length": 19, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unchecked-send/unchecked_send-0.5.1.sol", + "filename_relative": "tests/detectors/unchecked-send/0.7.6/unchecked_send.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unchecked-send/unchecked_send-0.5.1.sol", + "filename_short": "tests/detectors/unchecked-send/0.7.6/unchecked_send.sol", "is_dependency": false, "lines": [ 3 @@ -85,9 +85,9 @@ "start": 21, "length": 86, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unchecked-send/unchecked_send-0.5.1.sol", + "filename_relative": "tests/detectors/unchecked-send/0.7.6/unchecked_send.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unchecked-send/unchecked_send-0.5.1.sol", + "filename_short": "tests/detectors/unchecked-send/0.7.6/unchecked_send.sol", "is_dependency": false, "lines": [ 2, @@ -105,9 +105,9 @@ "start": 0, "length": 419, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unchecked-send/unchecked_send-0.5.1.sol", + "filename_relative": "tests/detectors/unchecked-send/0.7.6/unchecked_send.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unchecked-send/unchecked_send-0.5.1.sol", + "filename_short": "tests/detectors/unchecked-send/0.7.6/unchecked_send.sol", "is_dependency": false, "lines": [ 1, @@ -139,9 +139,9 @@ } } ], - "description": "MyConc.bad(address) (tests/detectors/unchecked-send/unchecked_send-0.5.1.sol#2-4) ignores return value by dst.send(msg.value) (tests/detectors/unchecked-send/unchecked_send-0.5.1.sol#3)\n", - "markdown": "[MyConc.bad(address)](tests/detectors/unchecked-send/unchecked_send-0.5.1.sol#L2-L4) ignores return value by [dst.send(msg.value)](tests/detectors/unchecked-send/unchecked_send-0.5.1.sol#L3)\n", - "id": "4617ab04affaca041c4a88c42658dca7d1d2dc11090973b8d551381c9e634a30", + "description": "MyConc.bad(address) (tests/detectors/unchecked-send/0.7.6/unchecked_send.sol#2-4) ignores return value by dst.send(msg.value) (tests/detectors/unchecked-send/0.7.6/unchecked_send.sol#3)\n", + "markdown": "[MyConc.bad(address)](tests/detectors/unchecked-send/0.7.6/unchecked_send.sol#L2-L4) ignores return value by [dst.send(msg.value)](tests/detectors/unchecked-send/0.7.6/unchecked_send.sol#L3)\n", + "id": "74d3637eb50def7c93e85041859377832449a73e2546ab915ac91aef6d9a30e8", "check": "unchecked-send", "impact": "Medium", "confidence": "Medium" diff --git a/tests/detectors/unimplemented-functions/unimplemented.sol b/tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol similarity index 100% rename from tests/detectors/unimplemented-functions/unimplemented.sol rename to tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol diff --git a/tests/detectors/unimplemented-functions/unimplemented.sol.0.4.25.UnimplementedFunctionDetection.json b/tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol.0.4.25.UnimplementedFunctionDetection.json similarity index 82% rename from tests/detectors/unimplemented-functions/unimplemented.sol.0.4.25.UnimplementedFunctionDetection.json rename to tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol.0.4.25.UnimplementedFunctionDetection.json index d01ba77bf6..0d62d9d1bc 100644 --- a/tests/detectors/unimplemented-functions/unimplemented.sol.0.4.25.UnimplementedFunctionDetection.json +++ b/tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol.0.4.25.UnimplementedFunctionDetection.json @@ -9,9 +9,9 @@ "start": 185, "length": 133, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_relative": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_short": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "is_dependency": false, "lines": [ 10, @@ -31,9 +31,9 @@ "start": 72, "length": 37, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_relative": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_short": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "is_dependency": false, "lines": [ 3 @@ -49,9 +49,9 @@ "start": 0, "length": 111, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_relative": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_short": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "is_dependency": false, "lines": [ 1, @@ -73,9 +73,9 @@ "start": 144, "length": 37, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_relative": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_short": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "is_dependency": false, "lines": [ 7 @@ -91,9 +91,9 @@ "start": 113, "length": 70, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_relative": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_short": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "is_dependency": false, "lines": [ 6, @@ -108,8 +108,8 @@ } } ], - "description": "DerivedContract_bad0 (tests/detectors/unimplemented-functions/unimplemented.sol#10-14) does not implement functions:\n\t- BaseInterface.f2() (tests/detectors/unimplemented-functions/unimplemented.sol#3)\n\t- BaseInterface2.f3() (tests/detectors/unimplemented-functions/unimplemented.sol#7)\n", - "markdown": "[DerivedContract_bad0](tests/detectors/unimplemented-functions/unimplemented.sol#L10-L14) does not implement functions:\n\t- [BaseInterface.f2()](tests/detectors/unimplemented-functions/unimplemented.sol#L3)\n\t- [BaseInterface2.f3()](tests/detectors/unimplemented-functions/unimplemented.sol#L7)\n", + "description": "DerivedContract_bad0 (tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol#10-14) does not implement functions:\n\t- BaseInterface.f2() (tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol#3)\n\t- BaseInterface2.f3() (tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol#7)\n", + "markdown": "[DerivedContract_bad0](tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol#L10-L14) does not implement functions:\n\t- [BaseInterface.f2()](tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol#L3)\n\t- [BaseInterface2.f3()](tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol#L7)\n", "id": "8614d351f7aac0c05e8df6ef7c89c6b46a2b8acf6295c9d5a886ff6489c74a41", "check": "unimplemented-functions", "impact": "Informational", @@ -124,9 +124,9 @@ "start": 320, "length": 143, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_relative": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_short": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "is_dependency": false, "lines": [ 16, @@ -147,9 +147,9 @@ "start": 357, "length": 37, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_relative": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_short": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "is_dependency": false, "lines": [ 17 @@ -165,9 +165,9 @@ "start": 320, "length": 143, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_relative": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_short": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "is_dependency": false, "lines": [ 16, @@ -185,8 +185,8 @@ } } ], - "description": "AbstractContract_bad1 (tests/detectors/unimplemented-functions/unimplemented.sol#16-21) does not implement functions:\n\t- AbstractContract_bad1.f1() (tests/detectors/unimplemented-functions/unimplemented.sol#17)\n", - "markdown": "[AbstractContract_bad1](tests/detectors/unimplemented-functions/unimplemented.sol#L16-L21) does not implement functions:\n\t- [AbstractContract_bad1.f1()](tests/detectors/unimplemented-functions/unimplemented.sol#L17)\n", + "description": "AbstractContract_bad1 (tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol#16-21) does not implement functions:\n\t- AbstractContract_bad1.f1() (tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol#17)\n", + "markdown": "[AbstractContract_bad1](tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol#L16-L21) does not implement functions:\n\t- [AbstractContract_bad1.f1()](tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol#L17)\n", "id": "adc202df4717efc4e19b549c0e623a79fac759a36bffb5d5e4aac401e33375d7", "check": "unimplemented-functions", "impact": "Informational", @@ -201,9 +201,9 @@ "start": 541, "length": 232, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_relative": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_short": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "is_dependency": false, "lines": [ 27, @@ -225,9 +225,9 @@ "start": 495, "length": 42, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_relative": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_short": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "is_dependency": false, "lines": [ 24 @@ -243,9 +243,9 @@ "start": 465, "length": 74, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_relative": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_short": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "is_dependency": false, "lines": [ 23, @@ -260,8 +260,8 @@ } } ], - "description": "DerivedContract_bad2 (tests/detectors/unimplemented-functions/unimplemented.sol#27-33) does not implement functions:\n\t- BaseInterface3.get(uint256) (tests/detectors/unimplemented-functions/unimplemented.sol#24)\n", - "markdown": "[DerivedContract_bad2](tests/detectors/unimplemented-functions/unimplemented.sol#L27-L33) does not implement functions:\n\t- [BaseInterface3.get(uint256)](tests/detectors/unimplemented-functions/unimplemented.sol#L24)\n", + "description": "DerivedContract_bad2 (tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol#27-33) does not implement functions:\n\t- BaseInterface3.get(uint256) (tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol#24)\n", + "markdown": "[DerivedContract_bad2](tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol#L27-L33) does not implement functions:\n\t- [BaseInterface3.get(uint256)](tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol#L24)\n", "id": "31915d2f480e24ddd054de973440a02abdac0ccd6332c47cd4eb8d836d3fddda", "check": "unimplemented-functions", "impact": "Informational", @@ -276,9 +276,9 @@ "start": 775, "length": 243, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_relative": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_short": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "is_dependency": false, "lines": [ 35, @@ -300,9 +300,9 @@ "start": 495, "length": 42, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_relative": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_short": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "is_dependency": false, "lines": [ 24 @@ -318,9 +318,9 @@ "start": 465, "length": 74, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_relative": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unimplemented-functions/unimplemented.sol", + "filename_short": "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "is_dependency": false, "lines": [ 23, @@ -335,8 +335,8 @@ } } ], - "description": "DerivedContract_good (tests/detectors/unimplemented-functions/unimplemented.sol#35-41) does not implement functions:\n\t- BaseInterface3.get(uint256) (tests/detectors/unimplemented-functions/unimplemented.sol#24)\n", - "markdown": "[DerivedContract_good](tests/detectors/unimplemented-functions/unimplemented.sol#L35-L41) does not implement functions:\n\t- [BaseInterface3.get(uint256)](tests/detectors/unimplemented-functions/unimplemented.sol#L24)\n", + "description": "DerivedContract_good (tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol#35-41) does not implement functions:\n\t- BaseInterface3.get(uint256) (tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol#24)\n", + "markdown": "[DerivedContract_good](tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol#L35-L41) does not implement functions:\n\t- [BaseInterface3.get(uint256)](tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol#L24)\n", "id": "08d3e8a72b5da6d189acb46ecd36f00787a87812727526a0cae248a2bac348fc", "check": "unimplemented-functions", "impact": "Informational", diff --git a/tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol b/tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol new file mode 100644 index 0000000000..92b1c8937e --- /dev/null +++ b/tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol @@ -0,0 +1,41 @@ +interface BaseInterface { + function f1() external returns(uint); + function f2() external returns(uint); +} + +interface BaseInterface2 { + function f3() external returns(uint); +} + +contract DerivedContract_bad0 is BaseInterface, BaseInterface2 { + function f1() external returns(uint){ + return 42; + } +} + +contract AbstractContract_bad1 { + function f1() external returns(uint); + function f2() external returns(uint){ + return 42; + } +} + +contract BaseInterface3 { + function get(uint) external returns(uint); +} + +contract DerivedContract_bad2 is BaseInterface3 { + // the mapping type get(uint => bool) does NOT match the function get(uint) => uint + mapping(uint => bool) public get; + function f1() external returns(uint){ + return 42; + } +} + +contract DerivedContract_good is BaseInterface3 { + // In solc >= 0.5.1, the mapping type get(uint => uint) matches the function get(uint) => uint + mapping(uint => uint) public get; + function f1() external returns(uint){ + return 42; + } +} diff --git a/tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol.0.5.16.UnimplementedFunctionDetection.json b/tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol.0.5.16.UnimplementedFunctionDetection.json new file mode 100644 index 0000000000..3d242cab8f --- /dev/null +++ b/tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol.0.5.16.UnimplementedFunctionDetection.json @@ -0,0 +1,196 @@ +[ + [ + { + "elements": [ + { + "type": "contract", + "name": "DerivedContract_bad0", + "source_mapping": { + "start": 185, + "length": 133, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "f2", + "source_mapping": { + "start": 72, + "length": 37, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol", + "is_dependency": false, + "lines": [ + 3 + ], + "starting_column": 5, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BaseInterface", + "source_mapping": { + "start": 0, + "length": 111, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f2()" + } + }, + { + "type": "function", + "name": "f3", + "source_mapping": { + "start": 144, + "length": 37, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol", + "is_dependency": false, + "lines": [ + 7 + ], + "starting_column": 5, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BaseInterface2", + "source_mapping": { + "start": 113, + "length": 70, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f3()" + } + } + ], + "description": "DerivedContract_bad0 (tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol#10-14) does not implement functions:\n\t- BaseInterface.f2() (tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol#3)\n\t- BaseInterface2.f3() (tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol#7)\n", + "markdown": "[DerivedContract_bad0](tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol#L10-L14) does not implement functions:\n\t- [BaseInterface.f2()](tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol#L3)\n\t- [BaseInterface2.f3()](tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol#L7)\n", + "id": "8614d351f7aac0c05e8df6ef7c89c6b46a2b8acf6295c9d5a886ff6489c74a41", + "check": "unimplemented-functions", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "AbstractContract_bad1", + "source_mapping": { + "start": 320, + "length": 143, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18, + 19, + 20, + 21 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "f1", + "source_mapping": { + "start": 357, + "length": 37, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol", + "is_dependency": false, + "lines": [ + 17 + ], + "starting_column": 5, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "AbstractContract_bad1", + "source_mapping": { + "start": 320, + "length": 143, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18, + 19, + 20, + 21 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f1()" + } + } + ], + "description": "AbstractContract_bad1 (tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol#16-21) does not implement functions:\n\t- AbstractContract_bad1.f1() (tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol#17)\n", + "markdown": "[AbstractContract_bad1](tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol#L16-L21) does not implement functions:\n\t- [AbstractContract_bad1.f1()](tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol#L17)\n", + "id": "adc202df4717efc4e19b549c0e623a79fac759a36bffb5d5e4aac401e33375d7", + "check": "unimplemented-functions", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol b/tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol new file mode 100644 index 0000000000..5cc10ef5ce --- /dev/null +++ b/tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol @@ -0,0 +1,41 @@ +interface BaseInterface { + function f1() external returns(uint); + function f2() external returns(uint); +} + +interface BaseInterface2 { + function f3() external returns(uint); +} + +abstract contract DerivedContract_bad0 is BaseInterface, BaseInterface2 { + function f1() external override returns(uint){ + return 42; + } +} + +abstract contract AbstractContract_bad1 { + function f1() external virtual returns(uint); + function f2() external returns(uint){ + return 42; + } +} + +abstract contract BaseInterface3 { + function get(uint) external virtual returns(uint); +} + +abstract contract DerivedContract_bad2 is BaseInterface3 { + // the mapping type get(uint => bool) does NOT match the function get(uint) => uint + // mapping(uint => bool) public override get; <-- disallowed by solidity compiler: Overriding public state variable return types differ. + function f1() external returns(uint){ + return 42; + } +} + +contract DerivedContract_good is BaseInterface3 { + // In solc >= 0.5.1, the mapping type get(uint => uint) matches the function get(uint) => uint + mapping(uint => uint) public override get; + function f1() external returns(uint){ + return 42; + } +} diff --git a/tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol.0.6.11.UnimplementedFunctionDetection.json b/tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol.0.6.11.UnimplementedFunctionDetection.json new file mode 100644 index 0000000000..8b388b46ad --- /dev/null +++ b/tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol.0.6.11.UnimplementedFunctionDetection.json @@ -0,0 +1,271 @@ +[ + [ + { + "elements": [ + { + "type": "contract", + "name": "DerivedContract_bad0", + "source_mapping": { + "start": 185, + "length": 151, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "f2", + "source_mapping": { + "start": 72, + "length": 37, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol", + "is_dependency": false, + "lines": [ + 3 + ], + "starting_column": 5, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BaseInterface", + "source_mapping": { + "start": 0, + "length": 111, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f2()" + } + }, + { + "type": "function", + "name": "f3", + "source_mapping": { + "start": 144, + "length": 37, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol", + "is_dependency": false, + "lines": [ + 7 + ], + "starting_column": 5, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BaseInterface2", + "source_mapping": { + "start": 113, + "length": 70, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f3()" + } + } + ], + "description": "DerivedContract_bad0 (tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol#10-14) does not implement functions:\n\t- BaseInterface.f2() (tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol#3)\n\t- BaseInterface2.f3() (tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol#7)\n", + "markdown": "[DerivedContract_bad0](tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol#L10-L14) does not implement functions:\n\t- [BaseInterface.f2()](tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol#L3)\n\t- [BaseInterface2.f3()](tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol#L7)\n", + "id": "8614d351f7aac0c05e8df6ef7c89c6b46a2b8acf6295c9d5a886ff6489c74a41", + "check": "unimplemented-functions", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "AbstractContract_bad1", + "source_mapping": { + "start": 338, + "length": 160, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18, + 19, + 20, + 21 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "f1", + "source_mapping": { + "start": 384, + "length": 45, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol", + "is_dependency": false, + "lines": [ + 17 + ], + "starting_column": 5, + "ending_column": 50 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "AbstractContract_bad1", + "source_mapping": { + "start": 338, + "length": 160, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18, + 19, + 20, + 21 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f1()" + } + } + ], + "description": "AbstractContract_bad1 (tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol#16-21) does not implement functions:\n\t- AbstractContract_bad1.f1() (tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol#17)\n", + "markdown": "[AbstractContract_bad1](tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol#L16-L21) does not implement functions:\n\t- [AbstractContract_bad1.f1()](tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol#L17)\n", + "id": "adc202df4717efc4e19b549c0e623a79fac759a36bffb5d5e4aac401e33375d7", + "check": "unimplemented-functions", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "DerivedContract_bad2", + "source_mapping": { + "start": 593, + "length": 344, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol", + "is_dependency": false, + "lines": [ + 27, + 28, + 29, + 30, + 31, + 32, + 33 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "get", + "source_mapping": { + "start": 539, + "length": 50, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol", + "is_dependency": false, + "lines": [ + 24 + ], + "starting_column": 5, + "ending_column": 55 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BaseInterface3", + "source_mapping": { + "start": 500, + "length": 91, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol", + "is_dependency": false, + "lines": [ + 23, + 24, + 25 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "get(uint256)" + } + } + ], + "description": "DerivedContract_bad2 (tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol#27-33) does not implement functions:\n\t- BaseInterface3.get(uint256) (tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol#24)\n", + "markdown": "[DerivedContract_bad2](tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol#L27-L33) does not implement functions:\n\t- [BaseInterface3.get(uint256)](tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol#L24)\n", + "id": "31915d2f480e24ddd054de973440a02abdac0ccd6332c47cd4eb8d836d3fddda", + "check": "unimplemented-functions", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol b/tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol new file mode 100644 index 0000000000..5cc10ef5ce --- /dev/null +++ b/tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol @@ -0,0 +1,41 @@ +interface BaseInterface { + function f1() external returns(uint); + function f2() external returns(uint); +} + +interface BaseInterface2 { + function f3() external returns(uint); +} + +abstract contract DerivedContract_bad0 is BaseInterface, BaseInterface2 { + function f1() external override returns(uint){ + return 42; + } +} + +abstract contract AbstractContract_bad1 { + function f1() external virtual returns(uint); + function f2() external returns(uint){ + return 42; + } +} + +abstract contract BaseInterface3 { + function get(uint) external virtual returns(uint); +} + +abstract contract DerivedContract_bad2 is BaseInterface3 { + // the mapping type get(uint => bool) does NOT match the function get(uint) => uint + // mapping(uint => bool) public override get; <-- disallowed by solidity compiler: Overriding public state variable return types differ. + function f1() external returns(uint){ + return 42; + } +} + +contract DerivedContract_good is BaseInterface3 { + // In solc >= 0.5.1, the mapping type get(uint => uint) matches the function get(uint) => uint + mapping(uint => uint) public override get; + function f1() external returns(uint){ + return 42; + } +} diff --git a/tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol.0.7.6.UnimplementedFunctionDetection.json b/tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol.0.7.6.UnimplementedFunctionDetection.json new file mode 100644 index 0000000000..0dba2a1955 --- /dev/null +++ b/tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol.0.7.6.UnimplementedFunctionDetection.json @@ -0,0 +1,271 @@ +[ + [ + { + "elements": [ + { + "type": "contract", + "name": "DerivedContract_bad0", + "source_mapping": { + "start": 185, + "length": 151, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13, + 14 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "f2", + "source_mapping": { + "start": 72, + "length": 37, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol", + "is_dependency": false, + "lines": [ + 3 + ], + "starting_column": 5, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BaseInterface", + "source_mapping": { + "start": 0, + "length": 111, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f2()" + } + }, + { + "type": "function", + "name": "f3", + "source_mapping": { + "start": 144, + "length": 37, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol", + "is_dependency": false, + "lines": [ + 7 + ], + "starting_column": 5, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BaseInterface2", + "source_mapping": { + "start": 113, + "length": 70, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f3()" + } + } + ], + "description": "DerivedContract_bad0 (tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol#10-14) does not implement functions:\n\t- BaseInterface.f2() (tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol#3)\n\t- BaseInterface2.f3() (tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol#7)\n", + "markdown": "[DerivedContract_bad0](tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol#L10-L14) does not implement functions:\n\t- [BaseInterface.f2()](tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol#L3)\n\t- [BaseInterface2.f3()](tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol#L7)\n", + "id": "8614d351f7aac0c05e8df6ef7c89c6b46a2b8acf6295c9d5a886ff6489c74a41", + "check": "unimplemented-functions", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "AbstractContract_bad1", + "source_mapping": { + "start": 338, + "length": 160, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18, + 19, + 20, + 21 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "f1", + "source_mapping": { + "start": 384, + "length": 45, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol", + "is_dependency": false, + "lines": [ + 17 + ], + "starting_column": 5, + "ending_column": 50 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "AbstractContract_bad1", + "source_mapping": { + "start": 338, + "length": 160, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol", + "is_dependency": false, + "lines": [ + 16, + 17, + 18, + 19, + 20, + 21 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "f1()" + } + } + ], + "description": "AbstractContract_bad1 (tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol#16-21) does not implement functions:\n\t- AbstractContract_bad1.f1() (tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol#17)\n", + "markdown": "[AbstractContract_bad1](tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol#L16-L21) does not implement functions:\n\t- [AbstractContract_bad1.f1()](tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol#L17)\n", + "id": "adc202df4717efc4e19b549c0e623a79fac759a36bffb5d5e4aac401e33375d7", + "check": "unimplemented-functions", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "DerivedContract_bad2", + "source_mapping": { + "start": 593, + "length": 344, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol", + "is_dependency": false, + "lines": [ + 27, + 28, + 29, + 30, + 31, + 32, + 33 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "get", + "source_mapping": { + "start": 539, + "length": 50, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol", + "is_dependency": false, + "lines": [ + 24 + ], + "starting_column": 5, + "ending_column": 55 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BaseInterface3", + "source_mapping": { + "start": 500, + "length": 91, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol", + "is_dependency": false, + "lines": [ + 23, + 24, + 25 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "get(uint256)" + } + } + ], + "description": "DerivedContract_bad2 (tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol#27-33) does not implement functions:\n\t- BaseInterface3.get(uint256) (tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol#24)\n", + "markdown": "[DerivedContract_bad2](tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol#L27-L33) does not implement functions:\n\t- [BaseInterface3.get(uint256)](tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol#L24)\n", + "id": "31915d2f480e24ddd054de973440a02abdac0ccd6332c47cd4eb8d836d3fddda", + "check": "unimplemented-functions", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol b/tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol similarity index 99% rename from tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol rename to tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol index 67167cb67c..495f752d1c 100644 --- a/tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol +++ b/tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol @@ -1,4 +1,4 @@ -pragma solidity 0.5.8; +// pragma solidity 0.5.8; contract bad0 { constructor() public { diff --git a/tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol.0.4.25.UninitializedFunctionPtrsConstructor.json b/tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol.0.4.25.UninitializedFunctionPtrsConstructor.json new file mode 100644 index 0000000000..1cfe398dc7 --- /dev/null +++ b/tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol.0.4.25.UninitializedFunctionPtrsConstructor.json @@ -0,0 +1,433 @@ +[ + [ + { + "elements": [ + { + "type": "contract", + "name": "bad0", + "source_mapping": { + "start": 27, + "length": 149, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "node", + "name": "a(10)", + "source_mapping": { + "start": 164, + "length": 5, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "is_dependency": false, + "lines": [ + 7 + ], + "starting_column": 5, + "ending_column": 10 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "constructor", + "source_mapping": { + "start": 45, + "length": 129, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6, + 7, + 8 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "bad0", + "source_mapping": { + "start": 27, + "length": 149, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "constructor()" + } + } + } + } + ], + "description": "Contract bad0 (tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol#3-9) \n\t a(10) (tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol#7) is an unintialized function pointer call in a constructor\n", + "markdown": "Contract [bad0](tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol#L3-L9) \n\t [a(10)](tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol#L7) is an unintialized function pointer call in a constructor\n", + "id": "38a85244054f0e06f1d3b476742113d0cf1cbe82b6c2a16f6abfa8cb7611aa2d", + "check": "uninitialized-fptr-cst", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "bad1", + "source_mapping": { + "start": 178, + "length": 306, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "node", + "name": "b(10)", + "source_mapping": { + "start": 472, + "length": 5, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "is_dependency": false, + "lines": [ + 16 + ], + "starting_column": 5, + "ending_column": 10 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "constructor", + "source_mapping": { + "start": 196, + "length": 286, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "is_dependency": false, + "lines": [ + 12, + 13, + 14, + 15, + 16, + 17 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "bad1", + "source_mapping": { + "start": 178, + "length": 306, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "constructor()" + } + } + } + } + ], + "description": "Contract bad1 (tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol#11-18) \n\t b(10) (tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol#16) is an unintialized function pointer call in a constructor\n", + "markdown": "Contract [bad1](tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol#L11-L18) \n\t [b(10)](tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol#L16) is an unintialized function pointer call in a constructor\n", + "id": "eca46630e741d928b03312539f0e9ddfb182cb16b0425b5ff881a7800a50511e", + "check": "uninitialized-fptr-cst", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "bad2", + "source_mapping": { + "start": 486, + "length": 199, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "is_dependency": false, + "lines": [ + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "node", + "name": "s.a(10)", + "source_mapping": { + "start": 671, + "length": 7, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "is_dependency": false, + "lines": [ + 27 + ], + "starting_column": 5, + "ending_column": 12 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "constructor", + "source_mapping": { + "start": 628, + "length": 55, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "is_dependency": false, + "lines": [ + 25, + 26, + 27, + 28 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "bad2", + "source_mapping": { + "start": 486, + "length": 199, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "is_dependency": false, + "lines": [ + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "constructor()" + } + } + } + } + ], + "description": "Contract bad2 (tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol#20-29) \n\t s.a(10) (tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol#27) is an unintialized function pointer call in a constructor\n", + "markdown": "Contract [bad2](tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol#L20-L29) \n\t [s.a(10)](tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol#L27) is an unintialized function pointer call in a constructor\n", + "id": "1b01aa44445395d800ebe53b807c6884d1c5fc96d38f255bc402e1b339a8a6f2", + "check": "uninitialized-fptr-cst", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "bad3", + "source_mapping": { + "start": 687, + "length": 269, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "is_dependency": false, + "lines": [ + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "node", + "name": "a(10)", + "source_mapping": { + "start": 858, + "length": 5, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "is_dependency": false, + "lines": [ + 36 + ], + "starting_column": 5, + "ending_column": 10 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "constructor", + "source_mapping": { + "start": 831, + "length": 50, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "is_dependency": false, + "lines": [ + 35, + 36, + 37, + 38 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "bad3", + "source_mapping": { + "start": 687, + "length": 269, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "is_dependency": false, + "lines": [ + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "constructor()" + } + } + } + } + ], + "description": "Contract bad3 (tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol#31-42) \n\t a(10) (tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol#36) is an unintialized function pointer call in a constructor\n", + "markdown": "Contract [bad3](tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol#L31-L42) \n\t [a(10)](tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol#L36) is an unintialized function pointer call in a constructor\n", + "id": "4bfb037a7504ad1a677e70cdba68b2b4d47f485e4c0d039ac0a6364465b4e56e", + "check": "uninitialized-fptr-cst", + "impact": "Low", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/uninitialized-fptr-cst/0.5.16/uninitialized_function_ptr_constructor.sol b/tests/detectors/uninitialized-fptr-cst/0.5.16/uninitialized_function_ptr_constructor.sol new file mode 100644 index 0000000000..495f752d1c --- /dev/null +++ b/tests/detectors/uninitialized-fptr-cst/0.5.16/uninitialized_function_ptr_constructor.sol @@ -0,0 +1,136 @@ +// pragma solidity 0.5.8; + +contract bad0 { + constructor() public { + /* Uninitialized function pointer */ + function(uint256) internal returns(uint256) a; + a(10); + } +} + +contract bad1 { + constructor() public { + /* Uninitialized function pointer but external visibility */ + /* Although the Solidity bug report does not specify external visibility, we believe both internal/external may be vulnerable */ + function(uint256) external returns(uint256) b; + b(10); + } +} + +contract bad2 { + struct S { + /* Uninitialized function pointer within a struct*/ + function(uint256) internal returns(uint256) a; + } + constructor() public { + S memory s; + s.a(10); + } +} + +contract bad3 { + /* Uninitialized state variable function pointer written-to after call */ + function(uint256) internal returns(uint256) a; + + constructor() public { + a(10); + a = foo; + } + function foo(uint256 i) internal returns(uint256) { + return(i); + } +} + +contract good0 { + constructor() public { + /* Uninitialized function pointer but not called */ + function(uint256) internal returns(uint256) a; + } +} + +contract good1 { + constructor() public { + /* Initialized function pointer */ + function(uint256) internal returns(uint256) a = foo; + a(10); + } + function foo(uint256 i) internal returns(uint256) { + return(i); + } +} + +contract good2 { + constructor() public { + } + function foo(uint256 i) internal returns(uint256) { + /* Uninitialized function pointer but not in constructor */ + function(uint256) internal returns(uint256) a; + a(10); + return(i); + } +} + +contract good3 { + constructor() public { + /* Normal function call */ + foo(10); + } + function foo(uint256 i) internal returns(uint256) { + return(i); + } +} + +contract good4 { + struct S { + uint S_i; + } + constructor() public { + /* Uninitialized variables of other types but not function pointer */ + uint i; + address addr; + uint[] memory arr; + S memory s; + } +} + +contract good5 { + constructor() public { + /* Uninitialized local function pointer written to later */ + function(uint256) internal returns(uint256) a; + a = foo; + a(10); + } + function foo(uint256 i) internal returns(uint256) { + return(i); + } +} + +contract good6 { + /* Uninitialized state variable function pointer written to later */ + function(uint256) internal returns(uint256) a; + + constructor() public { + a = foo; + a(10); + } + function foo(uint256 i) internal returns(uint256) { + return(i); + } +} + +contract good7 { + struct S { + /* Uninitialized function pointer within a struct*/ + function(uint256) internal returns(uint256) a; + } + + constructor() public { + S memory s; + s.a = foo; + s.a(10); + } + + function foo(uint256 i) internal returns(uint256) { + return(i); + } +} diff --git a/tests/detectors/uninitialized-fptr-cst/0.5.16/uninitialized_function_ptr_constructor.sol.0.5.16.UninitializedFunctionPtrsConstructor.json b/tests/detectors/uninitialized-fptr-cst/0.5.16/uninitialized_function_ptr_constructor.sol.0.5.16.UninitializedFunctionPtrsConstructor.json new file mode 100644 index 0000000000..5825bcacc6 --- /dev/null +++ b/tests/detectors/uninitialized-fptr-cst/0.5.16/uninitialized_function_ptr_constructor.sol.0.5.16.UninitializedFunctionPtrsConstructor.json @@ -0,0 +1,3 @@ +[ + [] +] \ No newline at end of file diff --git a/tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol b/tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol new file mode 100644 index 0000000000..495f752d1c --- /dev/null +++ b/tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol @@ -0,0 +1,136 @@ +// pragma solidity 0.5.8; + +contract bad0 { + constructor() public { + /* Uninitialized function pointer */ + function(uint256) internal returns(uint256) a; + a(10); + } +} + +contract bad1 { + constructor() public { + /* Uninitialized function pointer but external visibility */ + /* Although the Solidity bug report does not specify external visibility, we believe both internal/external may be vulnerable */ + function(uint256) external returns(uint256) b; + b(10); + } +} + +contract bad2 { + struct S { + /* Uninitialized function pointer within a struct*/ + function(uint256) internal returns(uint256) a; + } + constructor() public { + S memory s; + s.a(10); + } +} + +contract bad3 { + /* Uninitialized state variable function pointer written-to after call */ + function(uint256) internal returns(uint256) a; + + constructor() public { + a(10); + a = foo; + } + function foo(uint256 i) internal returns(uint256) { + return(i); + } +} + +contract good0 { + constructor() public { + /* Uninitialized function pointer but not called */ + function(uint256) internal returns(uint256) a; + } +} + +contract good1 { + constructor() public { + /* Initialized function pointer */ + function(uint256) internal returns(uint256) a = foo; + a(10); + } + function foo(uint256 i) internal returns(uint256) { + return(i); + } +} + +contract good2 { + constructor() public { + } + function foo(uint256 i) internal returns(uint256) { + /* Uninitialized function pointer but not in constructor */ + function(uint256) internal returns(uint256) a; + a(10); + return(i); + } +} + +contract good3 { + constructor() public { + /* Normal function call */ + foo(10); + } + function foo(uint256 i) internal returns(uint256) { + return(i); + } +} + +contract good4 { + struct S { + uint S_i; + } + constructor() public { + /* Uninitialized variables of other types but not function pointer */ + uint i; + address addr; + uint[] memory arr; + S memory s; + } +} + +contract good5 { + constructor() public { + /* Uninitialized local function pointer written to later */ + function(uint256) internal returns(uint256) a; + a = foo; + a(10); + } + function foo(uint256 i) internal returns(uint256) { + return(i); + } +} + +contract good6 { + /* Uninitialized state variable function pointer written to later */ + function(uint256) internal returns(uint256) a; + + constructor() public { + a = foo; + a(10); + } + function foo(uint256 i) internal returns(uint256) { + return(i); + } +} + +contract good7 { + struct S { + /* Uninitialized function pointer within a struct*/ + function(uint256) internal returns(uint256) a; + } + + constructor() public { + S memory s; + s.a = foo; + s.a(10); + } + + function foo(uint256 i) internal returns(uint256) { + return(i); + } +} diff --git a/tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol.0.5.8.UninitializedFunctionPtrsConstructor.json b/tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol.0.5.8.UninitializedFunctionPtrsConstructor.json similarity index 76% rename from tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol.0.5.8.UninitializedFunctionPtrsConstructor.json rename to tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol.0.5.8.UninitializedFunctionPtrsConstructor.json index fc2e75d93e..bff41fa3c5 100644 --- a/tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol.0.5.8.UninitializedFunctionPtrsConstructor.json +++ b/tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol.0.5.8.UninitializedFunctionPtrsConstructor.json @@ -6,12 +6,12 @@ "type": "contract", "name": "bad0", "source_mapping": { - "start": 24, + "start": 27, "length": 149, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol", "is_dependency": false, "lines": [ 3, @@ -30,12 +30,12 @@ "type": "node", "name": "a(10)", "source_mapping": { - "start": 161, + "start": 164, "length": 5, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol", "is_dependency": false, "lines": [ 7 @@ -48,12 +48,12 @@ "type": "function", "name": "constructor", "source_mapping": { - "start": 42, + "start": 45, "length": 129, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol", "is_dependency": false, "lines": [ 4, @@ -70,12 +70,12 @@ "type": "contract", "name": "bad0", "source_mapping": { - "start": 24, + "start": 27, "length": 149, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol", "is_dependency": false, "lines": [ 3, @@ -96,9 +96,9 @@ } } ], - "description": "Contract bad0 (tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#3-9) \n\t a(10) (tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#7) is an unintialized function pointer call in a constructor\n", - "markdown": "Contract [bad0](tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#L3-L9) \n\t [a(10)](tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#L7) is an unintialized function pointer call in a constructor\n", - "id": "6e9480c70e9d054243bb478398b26663f05444b4b9b858109d67f9c63dbbc3e2", + "description": "Contract bad0 (tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol#3-9) \n\t a(10) (tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol#7) is an unintialized function pointer call in a constructor\n", + "markdown": "Contract [bad0](tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol#L3-L9) \n\t [a(10)](tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol#L7) is an unintialized function pointer call in a constructor\n", + "id": "e1e469fcf69ffbf93884287be133945396a1a363e77db02f241c90027f19bf48", "check": "uninitialized-fptr-cst", "impact": "Low", "confidence": "High" @@ -109,12 +109,12 @@ "type": "contract", "name": "bad1", "source_mapping": { - "start": 175, + "start": 178, "length": 306, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol", "is_dependency": false, "lines": [ 11, @@ -134,12 +134,12 @@ "type": "node", "name": "b(10)", "source_mapping": { - "start": 469, + "start": 472, "length": 5, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol", "is_dependency": false, "lines": [ 16 @@ -152,12 +152,12 @@ "type": "function", "name": "constructor", "source_mapping": { - "start": 193, + "start": 196, "length": 286, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol", "is_dependency": false, "lines": [ 12, @@ -175,12 +175,12 @@ "type": "contract", "name": "bad1", "source_mapping": { - "start": 175, + "start": 178, "length": 306, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol", "is_dependency": false, "lines": [ 11, @@ -202,9 +202,9 @@ } } ], - "description": "Contract bad1 (tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#11-18) \n\t b(10) (tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#16) is an unintialized function pointer call in a constructor\n", - "markdown": "Contract [bad1](tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#L11-L18) \n\t [b(10)](tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#L16) is an unintialized function pointer call in a constructor\n", - "id": "b0a15c051d9962762902c5565802334898e572e98018b42b85a89b45208c50d2", + "description": "Contract bad1 (tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol#11-18) \n\t b(10) (tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol#16) is an unintialized function pointer call in a constructor\n", + "markdown": "Contract [bad1](tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol#L11-L18) \n\t [b(10)](tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol#L16) is an unintialized function pointer call in a constructor\n", + "id": "0a6083d96a9a819c3ddc6d0dc1440fb8e8ec096abe5a7b6bf8951a2dacc11c56", "check": "uninitialized-fptr-cst", "impact": "Low", "confidence": "High" @@ -215,12 +215,12 @@ "type": "contract", "name": "bad3", "source_mapping": { - "start": 684, + "start": 687, "length": 269, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol", "is_dependency": false, "lines": [ 31, @@ -244,12 +244,12 @@ "type": "node", "name": "a(10)", "source_mapping": { - "start": 855, + "start": 858, "length": 5, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol", "is_dependency": false, "lines": [ 36 @@ -262,12 +262,12 @@ "type": "function", "name": "constructor", "source_mapping": { - "start": 828, + "start": 831, "length": 50, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol", "is_dependency": false, "lines": [ 35, @@ -283,12 +283,12 @@ "type": "contract", "name": "bad3", "source_mapping": { - "start": 684, + "start": 687, "length": 269, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_short": "tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol", "is_dependency": false, "lines": [ 31, @@ -314,9 +314,9 @@ } } ], - "description": "Contract bad3 (tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#31-42) \n\t a(10) (tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#36) is an unintialized function pointer call in a constructor\n", - "markdown": "Contract [bad3](tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#L31-L42) \n\t [a(10)](tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#L36) is an unintialized function pointer call in a constructor\n", - "id": "1f12cc039e869f6f13be8a85e2d98a53212dc95e859908a9188dd6b152fb804f", + "description": "Contract bad3 (tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol#31-42) \n\t a(10) (tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol#36) is an unintialized function pointer call in a constructor\n", + "markdown": "Contract [bad3](tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol#L31-L42) \n\t [a(10)](tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol#L36) is an unintialized function pointer call in a constructor\n", + "id": "fcca4434be6b4f21d40d12aa57d4fb266d2a7ecc4ca4888cc3e6bf7509c9e8e7", "check": "uninitialized-fptr-cst", "impact": "Low", "confidence": "High" diff --git a/tests/detectors/uninitialized-local/uninitialized_local_variable.sol b/tests/detectors/uninitialized-local/0.4.25/uninitialized_local_variable.sol similarity index 100% rename from tests/detectors/uninitialized-local/uninitialized_local_variable.sol rename to tests/detectors/uninitialized-local/0.4.25/uninitialized_local_variable.sol diff --git a/tests/detectors/uninitialized-local/uninitialized_local_variable.sol.0.4.25.UninitializedLocalVars.json b/tests/detectors/uninitialized-local/0.4.25/uninitialized_local_variable.sol.0.4.25.UninitializedLocalVars.json similarity index 85% rename from tests/detectors/uninitialized-local/uninitialized_local_variable.sol.0.4.25.UninitializedLocalVars.json rename to tests/detectors/uninitialized-local/0.4.25/uninitialized_local_variable.sol.0.4.25.UninitializedLocalVars.json index 5d522a136b..2c7ed9e83f 100644 --- a/tests/detectors/uninitialized-local/uninitialized_local_variable.sol.0.4.25.UninitializedLocalVars.json +++ b/tests/detectors/uninitialized-local/0.4.25/uninitialized_local_variable.sol.0.4.25.UninitializedLocalVars.json @@ -9,9 +9,9 @@ "start": 77, "length": 18, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-local/uninitialized_local_variable.sol", + "filename_relative": "tests/detectors/uninitialized-local/0.4.25/uninitialized_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-local/uninitialized_local_variable.sol", + "filename_short": "tests/detectors/uninitialized-local/0.4.25/uninitialized_local_variable.sol", "is_dependency": false, "lines": [ 4 @@ -27,9 +27,9 @@ "start": 29, "length": 143, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-local/uninitialized_local_variable.sol", + "filename_relative": "tests/detectors/uninitialized-local/0.4.25/uninitialized_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-local/uninitialized_local_variable.sol", + "filename_short": "tests/detectors/uninitialized-local/0.4.25/uninitialized_local_variable.sol", "is_dependency": false, "lines": [ 3, @@ -49,9 +49,9 @@ "start": 0, "length": 179, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-local/uninitialized_local_variable.sol", + "filename_relative": "tests/detectors/uninitialized-local/0.4.25/uninitialized_local_variable.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-local/uninitialized_local_variable.sol", + "filename_short": "tests/detectors/uninitialized-local/0.4.25/uninitialized_local_variable.sol", "is_dependency": false, "lines": [ 1, @@ -74,8 +74,8 @@ } } ], - "description": "Uninitialized.func().uint_not_init (tests/detectors/uninitialized-local/uninitialized_local_variable.sol#4) is a local variable never initialized\n", - "markdown": "[Uninitialized.func().uint_not_init](tests/detectors/uninitialized-local/uninitialized_local_variable.sol#L4) is a local variable never initialized\n", + "description": "Uninitialized.func().uint_not_init (tests/detectors/uninitialized-local/0.4.25/uninitialized_local_variable.sol#4) is a local variable never initialized\n", + "markdown": "[Uninitialized.func().uint_not_init](tests/detectors/uninitialized-local/0.4.25/uninitialized_local_variable.sol#L4) is a local variable never initialized\n", "id": "6ef627d0a3f7234c0d3dd339ae4cf3c1adf898f03384e08c3c8d846c67e0d476", "check": "uninitialized-local", "impact": "Medium", diff --git a/tests/detectors/uninitialized-local/0.5.16/uninitialized_local_variable.sol b/tests/detectors/uninitialized-local/0.5.16/uninitialized_local_variable.sol new file mode 100644 index 0000000000..d28eef9578 --- /dev/null +++ b/tests/detectors/uninitialized-local/0.5.16/uninitialized_local_variable.sol @@ -0,0 +1,9 @@ +contract Uninitialized{ + + function func() external returns(uint){ + uint uint_not_init; + uint uint_init = 1; + return uint_not_init + uint_init; + } + +} diff --git a/tests/detectors/uninitialized-local/0.5.16/uninitialized_local_variable.sol.0.5.16.UninitializedLocalVars.json b/tests/detectors/uninitialized-local/0.5.16/uninitialized_local_variable.sol.0.5.16.UninitializedLocalVars.json new file mode 100644 index 0000000000..4bab46edf8 --- /dev/null +++ b/tests/detectors/uninitialized-local/0.5.16/uninitialized_local_variable.sol.0.5.16.UninitializedLocalVars.json @@ -0,0 +1,85 @@ +[ + [ + { + "elements": [ + { + "type": "variable", + "name": "uint_not_init", + "source_mapping": { + "start": 77, + "length": 18, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-local/0.5.16/uninitialized_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-local/0.5.16/uninitialized_local_variable.sol", + "is_dependency": false, + "lines": [ + 4 + ], + "starting_column": 9, + "ending_column": 27 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "func", + "source_mapping": { + "start": 29, + "length": 143, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-local/0.5.16/uninitialized_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-local/0.5.16/uninitialized_local_variable.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Uninitialized", + "source_mapping": { + "start": 0, + "length": 179, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-local/0.5.16/uninitialized_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-local/0.5.16/uninitialized_local_variable.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "func()" + } + } + } + } + ], + "description": "Uninitialized.func().uint_not_init (tests/detectors/uninitialized-local/0.5.16/uninitialized_local_variable.sol#4) is a local variable never initialized\n", + "markdown": "[Uninitialized.func().uint_not_init](tests/detectors/uninitialized-local/0.5.16/uninitialized_local_variable.sol#L4) is a local variable never initialized\n", + "id": "6ef627d0a3f7234c0d3dd339ae4cf3c1adf898f03384e08c3c8d846c67e0d476", + "check": "uninitialized-local", + "impact": "Medium", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/uninitialized-local/0.6.11/uninitialized_local_variable.sol b/tests/detectors/uninitialized-local/0.6.11/uninitialized_local_variable.sol new file mode 100644 index 0000000000..d28eef9578 --- /dev/null +++ b/tests/detectors/uninitialized-local/0.6.11/uninitialized_local_variable.sol @@ -0,0 +1,9 @@ +contract Uninitialized{ + + function func() external returns(uint){ + uint uint_not_init; + uint uint_init = 1; + return uint_not_init + uint_init; + } + +} diff --git a/tests/detectors/uninitialized-local/0.6.11/uninitialized_local_variable.sol.0.6.11.UninitializedLocalVars.json b/tests/detectors/uninitialized-local/0.6.11/uninitialized_local_variable.sol.0.6.11.UninitializedLocalVars.json new file mode 100644 index 0000000000..d7dbfa819a --- /dev/null +++ b/tests/detectors/uninitialized-local/0.6.11/uninitialized_local_variable.sol.0.6.11.UninitializedLocalVars.json @@ -0,0 +1,85 @@ +[ + [ + { + "elements": [ + { + "type": "variable", + "name": "uint_not_init", + "source_mapping": { + "start": 77, + "length": 18, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-local/0.6.11/uninitialized_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-local/0.6.11/uninitialized_local_variable.sol", + "is_dependency": false, + "lines": [ + 4 + ], + "starting_column": 9, + "ending_column": 27 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "func", + "source_mapping": { + "start": 29, + "length": 143, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-local/0.6.11/uninitialized_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-local/0.6.11/uninitialized_local_variable.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Uninitialized", + "source_mapping": { + "start": 0, + "length": 179, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-local/0.6.11/uninitialized_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-local/0.6.11/uninitialized_local_variable.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "func()" + } + } + } + } + ], + "description": "Uninitialized.func().uint_not_init (tests/detectors/uninitialized-local/0.6.11/uninitialized_local_variable.sol#4) is a local variable never initialized\n", + "markdown": "[Uninitialized.func().uint_not_init](tests/detectors/uninitialized-local/0.6.11/uninitialized_local_variable.sol#L4) is a local variable never initialized\n", + "id": "6ef627d0a3f7234c0d3dd339ae4cf3c1adf898f03384e08c3c8d846c67e0d476", + "check": "uninitialized-local", + "impact": "Medium", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/uninitialized-local/0.7.6/uninitialized_local_variable.sol b/tests/detectors/uninitialized-local/0.7.6/uninitialized_local_variable.sol new file mode 100644 index 0000000000..d28eef9578 --- /dev/null +++ b/tests/detectors/uninitialized-local/0.7.6/uninitialized_local_variable.sol @@ -0,0 +1,9 @@ +contract Uninitialized{ + + function func() external returns(uint){ + uint uint_not_init; + uint uint_init = 1; + return uint_not_init + uint_init; + } + +} diff --git a/tests/detectors/uninitialized-local/0.7.6/uninitialized_local_variable.sol.0.7.6.UninitializedLocalVars.json b/tests/detectors/uninitialized-local/0.7.6/uninitialized_local_variable.sol.0.7.6.UninitializedLocalVars.json new file mode 100644 index 0000000000..9e58a8385b --- /dev/null +++ b/tests/detectors/uninitialized-local/0.7.6/uninitialized_local_variable.sol.0.7.6.UninitializedLocalVars.json @@ -0,0 +1,85 @@ +[ + [ + { + "elements": [ + { + "type": "variable", + "name": "uint_not_init", + "source_mapping": { + "start": 77, + "length": 18, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-local/0.7.6/uninitialized_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-local/0.7.6/uninitialized_local_variable.sol", + "is_dependency": false, + "lines": [ + 4 + ], + "starting_column": 9, + "ending_column": 27 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "func", + "source_mapping": { + "start": 29, + "length": 143, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-local/0.7.6/uninitialized_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-local/0.7.6/uninitialized_local_variable.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Uninitialized", + "source_mapping": { + "start": 0, + "length": 179, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-local/0.7.6/uninitialized_local_variable.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-local/0.7.6/uninitialized_local_variable.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "func()" + } + } + } + } + ], + "description": "Uninitialized.func().uint_not_init (tests/detectors/uninitialized-local/0.7.6/uninitialized_local_variable.sol#4) is a local variable never initialized\n", + "markdown": "[Uninitialized.func().uint_not_init](tests/detectors/uninitialized-local/0.7.6/uninitialized_local_variable.sol#L4) is a local variable never initialized\n", + "id": "6ef627d0a3f7234c0d3dd339ae4cf3c1adf898f03384e08c3c8d846c67e0d476", + "check": "uninitialized-local", + "impact": "Medium", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/uninitialized-state/uninitialized.sol b/tests/detectors/uninitialized-state/0.4.25/uninitialized.sol similarity index 97% rename from tests/detectors/uninitialized-state/uninitialized.sol rename to tests/detectors/uninitialized-state/0.4.25/uninitialized.sol index 2305483e6a..26b4c91101 100644 --- a/tests/detectors/uninitialized-state/uninitialized.sol +++ b/tests/detectors/uninitialized-state/0.4.25/uninitialized.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +// pragma solidity ^0.4.24; contract Uninitialized{ diff --git a/tests/detectors/uninitialized-state/uninitialized.sol.0.4.25.UninitializedStateVarsDetection.json b/tests/detectors/uninitialized-state/0.4.25/uninitialized.sol.0.4.25.UninitializedStateVarsDetection.json similarity index 84% rename from tests/detectors/uninitialized-state/uninitialized.sol.0.4.25.UninitializedStateVarsDetection.json rename to tests/detectors/uninitialized-state/0.4.25/uninitialized.sol.0.4.25.UninitializedStateVarsDetection.json index 26aa9ced91..9b949a3b31 100644 --- a/tests/detectors/uninitialized-state/uninitialized.sol.0.4.25.UninitializedStateVarsDetection.json +++ b/tests/detectors/uninitialized-state/0.4.25/uninitialized.sol.0.4.25.UninitializedStateVarsDetection.json @@ -6,12 +6,12 @@ "type": "variable", "name": "destination", "source_mapping": { - "start": 55, + "start": 58, "length": 19, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_short": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "is_dependency": false, "lines": [ 5 @@ -24,12 +24,12 @@ "type": "contract", "name": "Uninitialized", "source_mapping": { - "start": 26, + "start": 29, "length": 140, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_short": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "is_dependency": false, "lines": [ 3, @@ -52,12 +52,12 @@ "type": "function", "name": "transfer", "source_mapping": { - "start": 81, + "start": 84, "length": 82, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_short": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "is_dependency": false, "lines": [ 7, @@ -72,12 +72,12 @@ "type": "contract", "name": "Uninitialized", "source_mapping": { - "start": 26, + "start": 29, "length": 140, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_short": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "is_dependency": false, "lines": [ 3, @@ -98,8 +98,8 @@ } } ], - "description": "Uninitialized.destination (tests/detectors/uninitialized-state/uninitialized.sol#5) is never initialized. It is used in:\n\t- Uninitialized.transfer() (tests/detectors/uninitialized-state/uninitialized.sol#7-9)\n", - "markdown": "[Uninitialized.destination](tests/detectors/uninitialized-state/uninitialized.sol#L5) is never initialized. It is used in:\n\t- [Uninitialized.transfer()](tests/detectors/uninitialized-state/uninitialized.sol#L7-L9)\n", + "description": "Uninitialized.destination (tests/detectors/uninitialized-state/0.4.25/uninitialized.sol#5) is never initialized. It is used in:\n\t- Uninitialized.transfer() (tests/detectors/uninitialized-state/0.4.25/uninitialized.sol#7-9)\n", + "markdown": "[Uninitialized.destination](tests/detectors/uninitialized-state/0.4.25/uninitialized.sol#L5) is never initialized. It is used in:\n\t- [Uninitialized.transfer()](tests/detectors/uninitialized-state/0.4.25/uninitialized.sol#L7-L9)\n", "id": "e4711aebbd53922a9fe1e728917bf8e98eac065305e20d766b6b552debe79e44", "check": "uninitialized-state", "impact": "High", @@ -111,12 +111,12 @@ "type": "variable", "name": "balances", "source_mapping": { - "start": 189, + "start": 192, "length": 34, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_short": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "is_dependency": false, "lines": [ 15 @@ -129,12 +129,12 @@ "type": "contract", "name": "Test", "source_mapping": { - "start": 169, + "start": 172, "length": 332, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_short": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "is_dependency": false, "lines": [ 14, @@ -162,12 +162,12 @@ "type": "function", "name": "use", "source_mapping": { - "start": 356, + "start": 359, "length": 143, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_short": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "is_dependency": false, "lines": [ 23, @@ -183,12 +183,12 @@ "type": "contract", "name": "Test", "source_mapping": { - "start": 169, + "start": 172, "length": 332, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_short": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "is_dependency": false, "lines": [ 14, @@ -214,8 +214,8 @@ } } ], - "description": "Test.balances (tests/detectors/uninitialized-state/uninitialized.sol#15) is never initialized. It is used in:\n\t- Test.use() (tests/detectors/uninitialized-state/uninitialized.sol#23-26)\n", - "markdown": "[Test.balances](tests/detectors/uninitialized-state/uninitialized.sol#L15) is never initialized. It is used in:\n\t- [Test.use()](tests/detectors/uninitialized-state/uninitialized.sol#L23-L26)\n", + "description": "Test.balances (tests/detectors/uninitialized-state/0.4.25/uninitialized.sol#15) is never initialized. It is used in:\n\t- Test.use() (tests/detectors/uninitialized-state/0.4.25/uninitialized.sol#23-26)\n", + "markdown": "[Test.balances](tests/detectors/uninitialized-state/0.4.25/uninitialized.sol#L15) is never initialized. It is used in:\n\t- [Test.use()](tests/detectors/uninitialized-state/0.4.25/uninitialized.sol#L23-L26)\n", "id": "a2750d175b02d51aeb47a4576f74725ba991d3c8cf828a33ee78ccc34cf9e7d7", "check": "uninitialized-state", "impact": "High", @@ -227,12 +227,12 @@ "type": "variable", "name": "st", "source_mapping": { - "start": 695, + "start": 698, "length": 15, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_short": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "is_dependency": false, "lines": [ 45 @@ -245,12 +245,12 @@ "type": "contract", "name": "Test2", "source_mapping": { - "start": 641, + "start": 644, "length": 354, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_short": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "is_dependency": false, "lines": [ 42, @@ -281,12 +281,12 @@ "type": "function", "name": "use", "source_mapping": { - "start": 875, + "start": 878, "length": 117, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_short": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "is_dependency": false, "lines": [ 53, @@ -302,12 +302,12 @@ "type": "contract", "name": "Test2", "source_mapping": { - "start": 641, + "start": 644, "length": 354, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_short": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "is_dependency": false, "lines": [ 42, @@ -336,8 +336,8 @@ } } ], - "description": "Test2.st (tests/detectors/uninitialized-state/uninitialized.sol#45) is never initialized. It is used in:\n\t- Test2.use() (tests/detectors/uninitialized-state/uninitialized.sol#53-56)\n", - "markdown": "[Test2.st](tests/detectors/uninitialized-state/uninitialized.sol#L45) is never initialized. It is used in:\n\t- [Test2.use()](tests/detectors/uninitialized-state/uninitialized.sol#L53-L56)\n", + "description": "Test2.st (tests/detectors/uninitialized-state/0.4.25/uninitialized.sol#45) is never initialized. It is used in:\n\t- Test2.use() (tests/detectors/uninitialized-state/0.4.25/uninitialized.sol#53-56)\n", + "markdown": "[Test2.st](tests/detectors/uninitialized-state/0.4.25/uninitialized.sol#L45) is never initialized. It is used in:\n\t- [Test2.use()](tests/detectors/uninitialized-state/0.4.25/uninitialized.sol#L53-L56)\n", "id": "427f100397f455d8000eff7b1d2463763ca8e452d5d98f7b7de693fd5e625a32", "check": "uninitialized-state", "impact": "High", @@ -349,12 +349,12 @@ "type": "variable", "name": "v", "source_mapping": { - "start": 748, + "start": 751, "length": 6, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_short": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "is_dependency": false, "lines": [ 47 @@ -367,12 +367,12 @@ "type": "contract", "name": "Test2", "source_mapping": { - "start": 641, + "start": 644, "length": 354, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_short": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "is_dependency": false, "lines": [ 42, @@ -403,12 +403,12 @@ "type": "function", "name": "init", "source_mapping": { - "start": 817, + "start": 820, "length": 52, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_short": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "is_dependency": false, "lines": [ 49, @@ -423,12 +423,12 @@ "type": "contract", "name": "Test2", "source_mapping": { - "start": 641, + "start": 644, "length": 354, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized.sol", + "filename_short": "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "is_dependency": false, "lines": [ 42, @@ -457,8 +457,8 @@ } } ], - "description": "Test2.v (tests/detectors/uninitialized-state/uninitialized.sol#47) is never initialized. It is used in:\n\t- Test2.init() (tests/detectors/uninitialized-state/uninitialized.sol#49-51)\n", - "markdown": "[Test2.v](tests/detectors/uninitialized-state/uninitialized.sol#L47) is never initialized. It is used in:\n\t- [Test2.init()](tests/detectors/uninitialized-state/uninitialized.sol#L49-L51)\n", + "description": "Test2.v (tests/detectors/uninitialized-state/0.4.25/uninitialized.sol#47) is never initialized. It is used in:\n\t- Test2.init() (tests/detectors/uninitialized-state/0.4.25/uninitialized.sol#49-51)\n", + "markdown": "[Test2.v](tests/detectors/uninitialized-state/0.4.25/uninitialized.sol#L47) is never initialized. It is used in:\n\t- [Test2.init()](tests/detectors/uninitialized-state/0.4.25/uninitialized.sol#L49-L51)\n", "id": "bf96eee949943a12926cf1407a2df2b07e99b30a6fc2e78aebf088cdefcf77a7", "check": "uninitialized-state", "impact": "High", diff --git a/tests/detectors/uninitialized-state/uninitialized-0.5.1.sol b/tests/detectors/uninitialized-state/0.5.16/uninitialized.sol similarity index 97% rename from tests/detectors/uninitialized-state/uninitialized-0.5.1.sol rename to tests/detectors/uninitialized-state/0.5.16/uninitialized.sol index b12e44e770..7b5fbb5d9b 100644 --- a/tests/detectors/uninitialized-state/uninitialized-0.5.1.sol +++ b/tests/detectors/uninitialized-state/0.5.16/uninitialized.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +// pragma solidity ^0.5.0; contract Uninitialized{ diff --git a/tests/detectors/uninitialized-state/0.5.16/uninitialized.sol.0.5.16.UninitializedStateVarsDetection.json b/tests/detectors/uninitialized-state/0.5.16/uninitialized.sol.0.5.16.UninitializedStateVarsDetection.json new file mode 100644 index 0000000000..fbf23d670a --- /dev/null +++ b/tests/detectors/uninitialized-state/0.5.16/uninitialized.sol.0.5.16.UninitializedStateVarsDetection.json @@ -0,0 +1,468 @@ +[ + [ + { + "elements": [ + { + "type": "variable", + "name": "destination", + "source_mapping": { + "start": 57, + "length": 27, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "is_dependency": false, + "lines": [ + 5 + ], + "starting_column": 5, + "ending_column": 32 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Uninitialized", + "source_mapping": { + "start": 28, + "length": 148, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "function", + "name": "transfer", + "source_mapping": { + "start": 91, + "length": 82, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "is_dependency": false, + "lines": [ + 7, + 8, + 9 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Uninitialized", + "source_mapping": { + "start": 28, + "length": 148, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "transfer()" + } + } + ], + "description": "Uninitialized.destination (tests/detectors/uninitialized-state/0.5.16/uninitialized.sol#5) is never initialized. It is used in:\n\t- Uninitialized.transfer() (tests/detectors/uninitialized-state/0.5.16/uninitialized.sol#7-9)\n", + "markdown": "[Uninitialized.destination](tests/detectors/uninitialized-state/0.5.16/uninitialized.sol#L5) is never initialized. It is used in:\n\t- [Uninitialized.transfer()](tests/detectors/uninitialized-state/0.5.16/uninitialized.sol#L7-L9)\n", + "id": "e4711aebbd53922a9fe1e728917bf8e98eac065305e20d766b6b552debe79e44", + "check": "uninitialized-state", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "balances", + "source_mapping": { + "start": 199, + "length": 34, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "is_dependency": false, + "lines": [ + 15 + ], + "starting_column": 5, + "ending_column": 39 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 179, + "length": 349, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "function", + "name": "use", + "source_mapping": { + "start": 372, + "length": 154, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "is_dependency": false, + "lines": [ + 23, + 24, + 25, + 26 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 179, + "length": 349, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "use()" + } + } + ], + "description": "Test.balances (tests/detectors/uninitialized-state/0.5.16/uninitialized.sol#15) is never initialized. It is used in:\n\t- Test.use() (tests/detectors/uninitialized-state/0.5.16/uninitialized.sol#23-26)\n", + "markdown": "[Test.balances](tests/detectors/uninitialized-state/0.5.16/uninitialized.sol#L15) is never initialized. It is used in:\n\t- [Test.use()](tests/detectors/uninitialized-state/0.5.16/uninitialized.sol#L23-L26)\n", + "id": "a2750d175b02d51aeb47a4576f74725ba991d3c8cf828a33ee78ccc34cf9e7d7", + "check": "uninitialized-state", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "st", + "source_mapping": { + "start": 729, + "length": 15, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "is_dependency": false, + "lines": [ + 45 + ], + "starting_column": 5, + "ending_column": 20 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test2", + "source_mapping": { + "start": 675, + "length": 373, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "is_dependency": false, + "lines": [ + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "function", + "name": "use", + "source_mapping": { + "start": 916, + "length": 129, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "is_dependency": false, + "lines": [ + 53, + 54, + 55, + 56 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test2", + "source_mapping": { + "start": 675, + "length": 373, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "is_dependency": false, + "lines": [ + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "use()" + } + } + ], + "description": "Test2.st (tests/detectors/uninitialized-state/0.5.16/uninitialized.sol#45) is never initialized. It is used in:\n\t- Test2.use() (tests/detectors/uninitialized-state/0.5.16/uninitialized.sol#53-56)\n", + "markdown": "[Test2.st](tests/detectors/uninitialized-state/0.5.16/uninitialized.sol#L45) is never initialized. It is used in:\n\t- [Test2.use()](tests/detectors/uninitialized-state/0.5.16/uninitialized.sol#L53-L56)\n", + "id": "427f100397f455d8000eff7b1d2463763ca8e452d5d98f7b7de693fd5e625a32", + "check": "uninitialized-state", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "v", + "source_mapping": { + "start": 782, + "length": 6, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "is_dependency": false, + "lines": [ + 47 + ], + "starting_column": 5, + "ending_column": 11 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test2", + "source_mapping": { + "start": 675, + "length": 373, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "is_dependency": false, + "lines": [ + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "function", + "name": "init", + "source_mapping": { + "start": 851, + "length": 59, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "is_dependency": false, + "lines": [ + 49, + 50, + 51 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test2", + "source_mapping": { + "start": 675, + "length": 373, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "is_dependency": false, + "lines": [ + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "init()" + } + } + ], + "description": "Test2.v (tests/detectors/uninitialized-state/0.5.16/uninitialized.sol#47) is never initialized. It is used in:\n\t- Test2.init() (tests/detectors/uninitialized-state/0.5.16/uninitialized.sol#49-51)\n", + "markdown": "[Test2.v](tests/detectors/uninitialized-state/0.5.16/uninitialized.sol#L47) is never initialized. It is used in:\n\t- [Test2.init()](tests/detectors/uninitialized-state/0.5.16/uninitialized.sol#L49-L51)\n", + "id": "bf96eee949943a12926cf1407a2df2b07e99b30a6fc2e78aebf088cdefcf77a7", + "check": "uninitialized-state", + "impact": "High", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/uninitialized-state/0.6.11/uninitialized.sol b/tests/detectors/uninitialized-state/0.6.11/uninitialized.sol new file mode 100644 index 0000000000..7b5fbb5d9b --- /dev/null +++ b/tests/detectors/uninitialized-state/0.6.11/uninitialized.sol @@ -0,0 +1,58 @@ +// pragma solidity ^0.5.0; + +contract Uninitialized{ + + address payable destination; + + function transfer() payable public{ + destination.transfer(msg.value); + } + +} + + +contract Test { + mapping (address => uint) balances; + mapping (address => uint) balancesInitialized; + + + function init() public{ + balancesInitialized[msg.sender] = 0; + } + + function use() view public{ + // random operation to use the mapping + require(balances[msg.sender] == balancesInitialized[msg.sender]); + } +} + +library Lib{ + + struct MyStruct{ + uint val; + } + + function set(MyStruct storage st, uint v) public{ + st.val = v; + } + +} + + +contract Test2 { + using Lib for Lib.MyStruct; + + Lib.MyStruct st; + Lib.MyStruct stInitiliazed; + uint v; // v is used as parameter of the lib, but is never init + + function init() public{ + stInitiliazed.set(v); + } + + function use() view public{ + // random operation to use the structure + require(st.val == stInitiliazed.val); + } + +} diff --git a/tests/detectors/uninitialized-state/0.6.11/uninitialized.sol.0.6.11.UninitializedStateVarsDetection.json b/tests/detectors/uninitialized-state/0.6.11/uninitialized.sol.0.6.11.UninitializedStateVarsDetection.json new file mode 100644 index 0000000000..9cc41b350d --- /dev/null +++ b/tests/detectors/uninitialized-state/0.6.11/uninitialized.sol.0.6.11.UninitializedStateVarsDetection.json @@ -0,0 +1,468 @@ +[ + [ + { + "elements": [ + { + "type": "variable", + "name": "destination", + "source_mapping": { + "start": 57, + "length": 27, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "is_dependency": false, + "lines": [ + 5 + ], + "starting_column": 5, + "ending_column": 32 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Uninitialized", + "source_mapping": { + "start": 28, + "length": 148, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "function", + "name": "transfer", + "source_mapping": { + "start": 91, + "length": 82, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "is_dependency": false, + "lines": [ + 7, + 8, + 9 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Uninitialized", + "source_mapping": { + "start": 28, + "length": 148, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "transfer()" + } + } + ], + "description": "Uninitialized.destination (tests/detectors/uninitialized-state/0.6.11/uninitialized.sol#5) is never initialized. It is used in:\n\t- Uninitialized.transfer() (tests/detectors/uninitialized-state/0.6.11/uninitialized.sol#7-9)\n", + "markdown": "[Uninitialized.destination](tests/detectors/uninitialized-state/0.6.11/uninitialized.sol#L5) is never initialized. It is used in:\n\t- [Uninitialized.transfer()](tests/detectors/uninitialized-state/0.6.11/uninitialized.sol#L7-L9)\n", + "id": "e4711aebbd53922a9fe1e728917bf8e98eac065305e20d766b6b552debe79e44", + "check": "uninitialized-state", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "balances", + "source_mapping": { + "start": 199, + "length": 34, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "is_dependency": false, + "lines": [ + 15 + ], + "starting_column": 5, + "ending_column": 39 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 179, + "length": 349, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "function", + "name": "use", + "source_mapping": { + "start": 372, + "length": 154, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "is_dependency": false, + "lines": [ + 23, + 24, + 25, + 26 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test", + "source_mapping": { + "start": 179, + "length": 349, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "is_dependency": false, + "lines": [ + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "use()" + } + } + ], + "description": "Test.balances (tests/detectors/uninitialized-state/0.6.11/uninitialized.sol#15) is never initialized. It is used in:\n\t- Test.use() (tests/detectors/uninitialized-state/0.6.11/uninitialized.sol#23-26)\n", + "markdown": "[Test.balances](tests/detectors/uninitialized-state/0.6.11/uninitialized.sol#L15) is never initialized. It is used in:\n\t- [Test.use()](tests/detectors/uninitialized-state/0.6.11/uninitialized.sol#L23-L26)\n", + "id": "a2750d175b02d51aeb47a4576f74725ba991d3c8cf828a33ee78ccc34cf9e7d7", + "check": "uninitialized-state", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "st", + "source_mapping": { + "start": 729, + "length": 15, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "is_dependency": false, + "lines": [ + 45 + ], + "starting_column": 5, + "ending_column": 20 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test2", + "source_mapping": { + "start": 675, + "length": 373, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "is_dependency": false, + "lines": [ + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "function", + "name": "use", + "source_mapping": { + "start": 916, + "length": 129, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "is_dependency": false, + "lines": [ + 53, + 54, + 55, + 56 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test2", + "source_mapping": { + "start": 675, + "length": 373, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "is_dependency": false, + "lines": [ + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "use()" + } + } + ], + "description": "Test2.st (tests/detectors/uninitialized-state/0.6.11/uninitialized.sol#45) is never initialized. It is used in:\n\t- Test2.use() (tests/detectors/uninitialized-state/0.6.11/uninitialized.sol#53-56)\n", + "markdown": "[Test2.st](tests/detectors/uninitialized-state/0.6.11/uninitialized.sol#L45) is never initialized. It is used in:\n\t- [Test2.use()](tests/detectors/uninitialized-state/0.6.11/uninitialized.sol#L53-L56)\n", + "id": "427f100397f455d8000eff7b1d2463763ca8e452d5d98f7b7de693fd5e625a32", + "check": "uninitialized-state", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "v", + "source_mapping": { + "start": 782, + "length": 6, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "is_dependency": false, + "lines": [ + 47 + ], + "starting_column": 5, + "ending_column": 11 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test2", + "source_mapping": { + "start": 675, + "length": 373, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "is_dependency": false, + "lines": [ + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "function", + "name": "init", + "source_mapping": { + "start": 851, + "length": 59, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "is_dependency": false, + "lines": [ + 49, + 50, + 51 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Test2", + "source_mapping": { + "start": 675, + "length": 373, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "is_dependency": false, + "lines": [ + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "init()" + } + } + ], + "description": "Test2.v (tests/detectors/uninitialized-state/0.6.11/uninitialized.sol#47) is never initialized. It is used in:\n\t- Test2.init() (tests/detectors/uninitialized-state/0.6.11/uninitialized.sol#49-51)\n", + "markdown": "[Test2.v](tests/detectors/uninitialized-state/0.6.11/uninitialized.sol#L47) is never initialized. It is used in:\n\t- [Test2.init()](tests/detectors/uninitialized-state/0.6.11/uninitialized.sol#L49-L51)\n", + "id": "bf96eee949943a12926cf1407a2df2b07e99b30a6fc2e78aebf088cdefcf77a7", + "check": "uninitialized-state", + "impact": "High", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/uninitialized-state/0.7.6/uninitialized.sol b/tests/detectors/uninitialized-state/0.7.6/uninitialized.sol new file mode 100644 index 0000000000..7b5fbb5d9b --- /dev/null +++ b/tests/detectors/uninitialized-state/0.7.6/uninitialized.sol @@ -0,0 +1,58 @@ +// pragma solidity ^0.5.0; + +contract Uninitialized{ + + address payable destination; + + function transfer() payable public{ + destination.transfer(msg.value); + } + +} + + +contract Test { + mapping (address => uint) balances; + mapping (address => uint) balancesInitialized; + + + function init() public{ + balancesInitialized[msg.sender] = 0; + } + + function use() view public{ + // random operation to use the mapping + require(balances[msg.sender] == balancesInitialized[msg.sender]); + } +} + +library Lib{ + + struct MyStruct{ + uint val; + } + + function set(MyStruct storage st, uint v) public{ + st.val = v; + } + +} + + +contract Test2 { + using Lib for Lib.MyStruct; + + Lib.MyStruct st; + Lib.MyStruct stInitiliazed; + uint v; // v is used as parameter of the lib, but is never init + + function init() public{ + stInitiliazed.set(v); + } + + function use() view public{ + // random operation to use the structure + require(st.val == stInitiliazed.val); + } + +} diff --git a/tests/detectors/uninitialized-state/uninitialized-0.5.1.sol.0.5.1.UninitializedStateVarsDetection.json b/tests/detectors/uninitialized-state/0.7.6/uninitialized.sol.0.7.6.UninitializedStateVarsDetection.json similarity index 86% rename from tests/detectors/uninitialized-state/uninitialized-0.5.1.sol.0.5.1.UninitializedStateVarsDetection.json rename to tests/detectors/uninitialized-state/0.7.6/uninitialized.sol.0.7.6.UninitializedStateVarsDetection.json index fba3e074f2..7ab708ebbc 100644 --- a/tests/detectors/uninitialized-state/uninitialized-0.5.1.sol.0.5.1.UninitializedStateVarsDetection.json +++ b/tests/detectors/uninitialized-state/0.7.6/uninitialized.sol.0.7.6.UninitializedStateVarsDetection.json @@ -6,12 +6,12 @@ "type": "variable", "name": "destination", "source_mapping": { - "start": 54, + "start": 57, "length": 27, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_short": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "is_dependency": false, "lines": [ 5 @@ -24,12 +24,12 @@ "type": "contract", "name": "Uninitialized", "source_mapping": { - "start": 25, + "start": 28, "length": 148, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_short": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "is_dependency": false, "lines": [ 3, @@ -52,12 +52,12 @@ "type": "function", "name": "transfer", "source_mapping": { - "start": 88, + "start": 91, "length": 82, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_short": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "is_dependency": false, "lines": [ 7, @@ -72,12 +72,12 @@ "type": "contract", "name": "Uninitialized", "source_mapping": { - "start": 25, + "start": 28, "length": 148, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_short": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "is_dependency": false, "lines": [ 3, @@ -98,8 +98,8 @@ } } ], - "description": "Uninitialized.destination (tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#5) is never initialized. It is used in:\n\t- Uninitialized.transfer() (tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#7-9)\n", - "markdown": "[Uninitialized.destination](tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#L5) is never initialized. It is used in:\n\t- [Uninitialized.transfer()](tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#L7-L9)\n", + "description": "Uninitialized.destination (tests/detectors/uninitialized-state/0.7.6/uninitialized.sol#5) is never initialized. It is used in:\n\t- Uninitialized.transfer() (tests/detectors/uninitialized-state/0.7.6/uninitialized.sol#7-9)\n", + "markdown": "[Uninitialized.destination](tests/detectors/uninitialized-state/0.7.6/uninitialized.sol#L5) is never initialized. It is used in:\n\t- [Uninitialized.transfer()](tests/detectors/uninitialized-state/0.7.6/uninitialized.sol#L7-L9)\n", "id": "e4711aebbd53922a9fe1e728917bf8e98eac065305e20d766b6b552debe79e44", "check": "uninitialized-state", "impact": "High", @@ -111,12 +111,12 @@ "type": "variable", "name": "balances", "source_mapping": { - "start": 196, + "start": 199, "length": 34, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_short": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "is_dependency": false, "lines": [ 15 @@ -129,12 +129,12 @@ "type": "contract", "name": "Test", "source_mapping": { - "start": 176, + "start": 179, "length": 349, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_short": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "is_dependency": false, "lines": [ 14, @@ -162,12 +162,12 @@ "type": "function", "name": "use", "source_mapping": { - "start": 369, + "start": 372, "length": 154, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_short": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "is_dependency": false, "lines": [ 23, @@ -183,12 +183,12 @@ "type": "contract", "name": "Test", "source_mapping": { - "start": 176, + "start": 179, "length": 349, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_short": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "is_dependency": false, "lines": [ 14, @@ -214,8 +214,8 @@ } } ], - "description": "Test.balances (tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#15) is never initialized. It is used in:\n\t- Test.use() (tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#23-26)\n", - "markdown": "[Test.balances](tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#L15) is never initialized. It is used in:\n\t- [Test.use()](tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#L23-L26)\n", + "description": "Test.balances (tests/detectors/uninitialized-state/0.7.6/uninitialized.sol#15) is never initialized. It is used in:\n\t- Test.use() (tests/detectors/uninitialized-state/0.7.6/uninitialized.sol#23-26)\n", + "markdown": "[Test.balances](tests/detectors/uninitialized-state/0.7.6/uninitialized.sol#L15) is never initialized. It is used in:\n\t- [Test.use()](tests/detectors/uninitialized-state/0.7.6/uninitialized.sol#L23-L26)\n", "id": "a2750d175b02d51aeb47a4576f74725ba991d3c8cf828a33ee78ccc34cf9e7d7", "check": "uninitialized-state", "impact": "High", @@ -227,12 +227,12 @@ "type": "variable", "name": "st", "source_mapping": { - "start": 726, + "start": 729, "length": 15, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_short": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "is_dependency": false, "lines": [ 45 @@ -245,12 +245,12 @@ "type": "contract", "name": "Test2", "source_mapping": { - "start": 672, + "start": 675, "length": 373, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_short": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "is_dependency": false, "lines": [ 42, @@ -281,12 +281,12 @@ "type": "function", "name": "use", "source_mapping": { - "start": 913, + "start": 916, "length": 129, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_short": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "is_dependency": false, "lines": [ 53, @@ -302,12 +302,12 @@ "type": "contract", "name": "Test2", "source_mapping": { - "start": 672, + "start": 675, "length": 373, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_short": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "is_dependency": false, "lines": [ 42, @@ -336,8 +336,8 @@ } } ], - "description": "Test2.st (tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#45) is never initialized. It is used in:\n\t- Test2.use() (tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#53-56)\n", - "markdown": "[Test2.st](tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#L45) is never initialized. It is used in:\n\t- [Test2.use()](tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#L53-L56)\n", + "description": "Test2.st (tests/detectors/uninitialized-state/0.7.6/uninitialized.sol#45) is never initialized. It is used in:\n\t- Test2.use() (tests/detectors/uninitialized-state/0.7.6/uninitialized.sol#53-56)\n", + "markdown": "[Test2.st](tests/detectors/uninitialized-state/0.7.6/uninitialized.sol#L45) is never initialized. It is used in:\n\t- [Test2.use()](tests/detectors/uninitialized-state/0.7.6/uninitialized.sol#L53-L56)\n", "id": "427f100397f455d8000eff7b1d2463763ca8e452d5d98f7b7de693fd5e625a32", "check": "uninitialized-state", "impact": "High", @@ -349,12 +349,12 @@ "type": "variable", "name": "v", "source_mapping": { - "start": 779, + "start": 782, "length": 6, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_short": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "is_dependency": false, "lines": [ 47 @@ -367,12 +367,12 @@ "type": "contract", "name": "Test2", "source_mapping": { - "start": 672, + "start": 675, "length": 373, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_short": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "is_dependency": false, "lines": [ 42, @@ -403,12 +403,12 @@ "type": "function", "name": "init", "source_mapping": { - "start": 848, + "start": 851, "length": 59, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_short": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "is_dependency": false, "lines": [ 49, @@ -423,12 +423,12 @@ "type": "contract", "name": "Test2", "source_mapping": { - "start": 672, + "start": 675, "length": 373, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_relative": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", + "filename_short": "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", "is_dependency": false, "lines": [ 42, @@ -457,8 +457,8 @@ } } ], - "description": "Test2.v (tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#47) is never initialized. It is used in:\n\t- Test2.init() (tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#49-51)\n", - "markdown": "[Test2.v](tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#L47) is never initialized. It is used in:\n\t- [Test2.init()](tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#L49-L51)\n", + "description": "Test2.v (tests/detectors/uninitialized-state/0.7.6/uninitialized.sol#47) is never initialized. It is used in:\n\t- Test2.init() (tests/detectors/uninitialized-state/0.7.6/uninitialized.sol#49-51)\n", + "markdown": "[Test2.v](tests/detectors/uninitialized-state/0.7.6/uninitialized.sol#L47) is never initialized. It is used in:\n\t- [Test2.init()](tests/detectors/uninitialized-state/0.7.6/uninitialized.sol#L49-L51)\n", "id": "bf96eee949943a12926cf1407a2df2b07e99b30a6fc2e78aebf088cdefcf77a7", "check": "uninitialized-state", "impact": "High", diff --git a/tests/detectors/uninitialized-storage/uninitialized_storage_pointer.sol b/tests/detectors/uninitialized-storage/0.4.25/uninitialized_storage_pointer.sol similarity index 100% rename from tests/detectors/uninitialized-storage/uninitialized_storage_pointer.sol rename to tests/detectors/uninitialized-storage/0.4.25/uninitialized_storage_pointer.sol diff --git a/tests/detectors/uninitialized-storage/uninitialized_storage_pointer.sol.0.4.25.UninitializedStorageVars.json b/tests/detectors/uninitialized-storage/0.4.25/uninitialized_storage_pointer.sol.0.4.25.UninitializedStorageVars.json similarity index 85% rename from tests/detectors/uninitialized-storage/uninitialized_storage_pointer.sol.0.4.25.UninitializedStorageVars.json rename to tests/detectors/uninitialized-storage/0.4.25/uninitialized_storage_pointer.sol.0.4.25.UninitializedStorageVars.json index 8a54c307a6..2cd9cec244 100644 --- a/tests/detectors/uninitialized-storage/uninitialized_storage_pointer.sol.0.4.25.UninitializedStorageVars.json +++ b/tests/detectors/uninitialized-storage/0.4.25/uninitialized_storage_pointer.sol.0.4.25.UninitializedStorageVars.json @@ -9,9 +9,9 @@ "start": 171, "length": 9, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-storage/uninitialized_storage_pointer.sol", + "filename_relative": "tests/detectors/uninitialized-storage/0.4.25/uninitialized_storage_pointer.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-storage/uninitialized_storage_pointer.sol", + "filename_short": "tests/detectors/uninitialized-storage/0.4.25/uninitialized_storage_pointer.sol", "is_dependency": false, "lines": [ 10 @@ -27,9 +27,9 @@ "start": 67, "length": 143, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-storage/uninitialized_storage_pointer.sol", + "filename_relative": "tests/detectors/uninitialized-storage/0.4.25/uninitialized_storage_pointer.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-storage/uninitialized_storage_pointer.sol", + "filename_short": "tests/detectors/uninitialized-storage/0.4.25/uninitialized_storage_pointer.sol", "is_dependency": false, "lines": [ 7, @@ -50,9 +50,9 @@ "start": 0, "length": 217, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/uninitialized-storage/uninitialized_storage_pointer.sol", + "filename_relative": "tests/detectors/uninitialized-storage/0.4.25/uninitialized_storage_pointer.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/uninitialized-storage/uninitialized_storage_pointer.sol", + "filename_short": "tests/detectors/uninitialized-storage/0.4.25/uninitialized_storage_pointer.sol", "is_dependency": false, "lines": [ 1, @@ -80,8 +80,8 @@ } } ], - "description": "Uninitialized.func().st_bug (tests/detectors/uninitialized-storage/uninitialized_storage_pointer.sol#10) is a storage variable never initialized\n", - "markdown": "[Uninitialized.func().st_bug](tests/detectors/uninitialized-storage/uninitialized_storage_pointer.sol#L10) is a storage variable never initialized\n", + "description": "Uninitialized.func().st_bug (tests/detectors/uninitialized-storage/0.4.25/uninitialized_storage_pointer.sol#10) is a storage variable never initialized\n", + "markdown": "[Uninitialized.func().st_bug](tests/detectors/uninitialized-storage/0.4.25/uninitialized_storage_pointer.sol#L10) is a storage variable never initialized\n", "id": "b8f7c2470a8a7f83fd42dca40c50cbf2070e7fa5486c674585f2b0b39d3dc429", "check": "uninitialized-storage", "impact": "High", diff --git a/tests/detectors/unprotected-upgrade/0.4.25/Buggy.sol b/tests/detectors/unprotected-upgrade/0.4.25/Buggy.sol new file mode 100644 index 0000000000..05bd2d46bf --- /dev/null +++ b/tests/detectors/unprotected-upgrade/0.4.25/Buggy.sol @@ -0,0 +1,14 @@ +import "./Initializable.sol"; + +contract Buggy is Initializable{ + address owner; + + function initialize() external initializer{ + require(owner == address(0)); + owner = msg.sender; + } + function kill() external{ + require(msg.sender == owner); + selfdestruct(owner); + } +} \ No newline at end of file diff --git a/tests/detectors/unprotected-upgrade/0.4.25/Buggy.sol.0.4.25.UnprotectedUpgradeable.json b/tests/detectors/unprotected-upgrade/0.4.25/Buggy.sol.0.4.25.UnprotectedUpgradeable.json new file mode 100644 index 0000000000..598d05ce78 --- /dev/null +++ b/tests/detectors/unprotected-upgrade/0.4.25/Buggy.sol.0.4.25.UnprotectedUpgradeable.json @@ -0,0 +1,152 @@ +[ + [ + { + "elements": [ + { + "type": "contract", + "name": "Buggy", + "source_mapping": { + "start": 31, + "length": 277, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unprotected-upgrade/0.4.25/Buggy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unprotected-upgrade/0.4.25/Buggy.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + { + "type": "function", + "name": "initialize", + "source_mapping": { + "start": 88, + "length": 115, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unprotected-upgrade/0.4.25/Buggy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unprotected-upgrade/0.4.25/Buggy.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Buggy", + "source_mapping": { + "start": 31, + "length": 277, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unprotected-upgrade/0.4.25/Buggy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unprotected-upgrade/0.4.25/Buggy.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "initialize()" + } + }, + { + "type": "function", + "name": "kill", + "source_mapping": { + "start": 208, + "length": 98, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unprotected-upgrade/0.4.25/Buggy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unprotected-upgrade/0.4.25/Buggy.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Buggy", + "source_mapping": { + "start": 31, + "length": 277, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unprotected-upgrade/0.4.25/Buggy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unprotected-upgrade/0.4.25/Buggy.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "kill()" + } + } + ], + "description": "Buggy (tests/detectors/unprotected-upgrade/0.4.25/Buggy.sol#3-15) is an upgradeable contract that does not protect its initiliaze functions: Buggy.initialize() (tests/detectors/unprotected-upgrade/0.4.25/Buggy.sol#6-9). Anyone can delete the contract with: Buggy.kill() (tests/detectors/unprotected-upgrade/0.4.25/Buggy.sol#10-13)", + "markdown": "[Buggy](tests/detectors/unprotected-upgrade/0.4.25/Buggy.sol#L3-L15) is an upgradeable contract that does not protect its initiliaze functions: [Buggy.initialize()](tests/detectors/unprotected-upgrade/0.4.25/Buggy.sol#L6-L9). Anyone can delete the contract with: [Buggy.kill()](tests/detectors/unprotected-upgrade/0.4.25/Buggy.sol#L10-L13)", + "id": "aceca400ce0b482809a70df612af22e24d154c5c89c24d630ec0ee5a366d09fe", + "check": "unprotected-upgrade", + "impact": "High", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/unprotected-upgrade/0.4.25/Fixed.sol b/tests/detectors/unprotected-upgrade/0.4.25/Fixed.sol new file mode 100644 index 0000000000..3bcf418d60 --- /dev/null +++ b/tests/detectors/unprotected-upgrade/0.4.25/Fixed.sol @@ -0,0 +1,39 @@ +import "./Initializable.sol"; + +contract Fixed is Initializable{ + address owner; + + constructor() public{ + owner = msg.sender; + } + + function initialize() external initializer{ + require(owner == address(0)); + owner = msg.sender; + } + function kill() external{ + require(msg.sender == owner); + selfdestruct(owner); + } + + function other_function() external{ + + } +} + + +contract Not_Upgradeable{ +} + +contract UpgradeableNoDestruct is Initializable{ + address owner; + + constructor() public{ + owner = msg.sender; + } + + function initialize() external initializer{ + require(owner == address(0)); + owner = msg.sender; + } +} \ No newline at end of file diff --git a/tests/detectors/unprotected-upgrade/0.4.25/Fixed.sol.0.4.25.UnprotectedUpgradeable.json b/tests/detectors/unprotected-upgrade/0.4.25/Fixed.sol.0.4.25.UnprotectedUpgradeable.json new file mode 100644 index 0000000000..5825bcacc6 --- /dev/null +++ b/tests/detectors/unprotected-upgrade/0.4.25/Fixed.sol.0.4.25.UnprotectedUpgradeable.json @@ -0,0 +1,3 @@ +[ + [] +] \ No newline at end of file diff --git a/tests/detectors/unprotected-upgrade/Initializable.sol b/tests/detectors/unprotected-upgrade/0.4.25/Initializable.sol similarity index 100% rename from tests/detectors/unprotected-upgrade/Initializable.sol rename to tests/detectors/unprotected-upgrade/0.4.25/Initializable.sol diff --git a/tests/detectors/unprotected-upgrade/Buggy.sol b/tests/detectors/unprotected-upgrade/0.5.16/Buggy.sol similarity index 100% rename from tests/detectors/unprotected-upgrade/Buggy.sol rename to tests/detectors/unprotected-upgrade/0.5.16/Buggy.sol diff --git a/tests/detectors/unprotected-upgrade/0.5.16/Buggy.sol.0.5.16.UnprotectedUpgradeable.json b/tests/detectors/unprotected-upgrade/0.5.16/Buggy.sol.0.5.16.UnprotectedUpgradeable.json new file mode 100644 index 0000000000..4df38a929a --- /dev/null +++ b/tests/detectors/unprotected-upgrade/0.5.16/Buggy.sol.0.5.16.UnprotectedUpgradeable.json @@ -0,0 +1,152 @@ +[ + [ + { + "elements": [ + { + "type": "contract", + "name": "Buggy", + "source_mapping": { + "start": 31, + "length": 285, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unprotected-upgrade/0.5.16/Buggy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unprotected-upgrade/0.5.16/Buggy.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + { + "type": "function", + "name": "initialize", + "source_mapping": { + "start": 96, + "length": 115, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unprotected-upgrade/0.5.16/Buggy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unprotected-upgrade/0.5.16/Buggy.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Buggy", + "source_mapping": { + "start": 31, + "length": 285, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unprotected-upgrade/0.5.16/Buggy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unprotected-upgrade/0.5.16/Buggy.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "initialize()" + } + }, + { + "type": "function", + "name": "kill", + "source_mapping": { + "start": 216, + "length": 98, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unprotected-upgrade/0.5.16/Buggy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unprotected-upgrade/0.5.16/Buggy.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Buggy", + "source_mapping": { + "start": 31, + "length": 285, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unprotected-upgrade/0.5.16/Buggy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unprotected-upgrade/0.5.16/Buggy.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "kill()" + } + } + ], + "description": "Buggy (tests/detectors/unprotected-upgrade/0.5.16/Buggy.sol#3-15) is an upgradeable contract that does not protect its initiliaze functions: Buggy.initialize() (tests/detectors/unprotected-upgrade/0.5.16/Buggy.sol#6-9). Anyone can delete the contract with: Buggy.kill() (tests/detectors/unprotected-upgrade/0.5.16/Buggy.sol#10-13)", + "markdown": "[Buggy](tests/detectors/unprotected-upgrade/0.5.16/Buggy.sol#L3-L15) is an upgradeable contract that does not protect its initiliaze functions: [Buggy.initialize()](tests/detectors/unprotected-upgrade/0.5.16/Buggy.sol#L6-L9). Anyone can delete the contract with: [Buggy.kill()](tests/detectors/unprotected-upgrade/0.5.16/Buggy.sol#L10-L13)", + "id": "aceca400ce0b482809a70df612af22e24d154c5c89c24d630ec0ee5a366d09fe", + "check": "unprotected-upgrade", + "impact": "High", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/unprotected-upgrade/Fixed.sol b/tests/detectors/unprotected-upgrade/0.5.16/Fixed.sol similarity index 100% rename from tests/detectors/unprotected-upgrade/Fixed.sol rename to tests/detectors/unprotected-upgrade/0.5.16/Fixed.sol diff --git a/tests/detectors/unprotected-upgrade/0.5.16/Fixed.sol.0.5.16.UnprotectedUpgradeable.json b/tests/detectors/unprotected-upgrade/0.5.16/Fixed.sol.0.5.16.UnprotectedUpgradeable.json new file mode 100644 index 0000000000..5825bcacc6 --- /dev/null +++ b/tests/detectors/unprotected-upgrade/0.5.16/Fixed.sol.0.5.16.UnprotectedUpgradeable.json @@ -0,0 +1,3 @@ +[ + [] +] \ No newline at end of file diff --git a/tests/detectors/unprotected-upgrade/0.5.16/Initializable.sol b/tests/detectors/unprotected-upgrade/0.5.16/Initializable.sol new file mode 100644 index 0000000000..779a0e87c9 --- /dev/null +++ b/tests/detectors/unprotected-upgrade/0.5.16/Initializable.sol @@ -0,0 +1,5 @@ +contract Initializable{ + modifier initializer() { + _; + } +} \ No newline at end of file diff --git a/tests/detectors/unprotected-upgrade/0.6.11/Buggy.sol b/tests/detectors/unprotected-upgrade/0.6.11/Buggy.sol new file mode 100644 index 0000000000..a3df9841e6 --- /dev/null +++ b/tests/detectors/unprotected-upgrade/0.6.11/Buggy.sol @@ -0,0 +1,14 @@ +import "./Initializable.sol"; + +contract Buggy is Initializable{ + address payable owner; + + function initialize() external initializer{ + require(owner == address(0)); + owner = msg.sender; + } + function kill() external{ + require(msg.sender == owner); + selfdestruct(owner); + } +} \ No newline at end of file diff --git a/tests/detectors/unprotected-upgrade/0.6.11/Buggy.sol.0.6.11.UnprotectedUpgradeable.json b/tests/detectors/unprotected-upgrade/0.6.11/Buggy.sol.0.6.11.UnprotectedUpgradeable.json new file mode 100644 index 0000000000..5e25b4600c --- /dev/null +++ b/tests/detectors/unprotected-upgrade/0.6.11/Buggy.sol.0.6.11.UnprotectedUpgradeable.json @@ -0,0 +1,152 @@ +[ + [ + { + "elements": [ + { + "type": "contract", + "name": "Buggy", + "source_mapping": { + "start": 31, + "length": 285, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unprotected-upgrade/0.6.11/Buggy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unprotected-upgrade/0.6.11/Buggy.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + { + "type": "function", + "name": "initialize", + "source_mapping": { + "start": 96, + "length": 115, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unprotected-upgrade/0.6.11/Buggy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unprotected-upgrade/0.6.11/Buggy.sol", + "is_dependency": false, + "lines": [ + 6, + 7, + 8, + 9 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Buggy", + "source_mapping": { + "start": 31, + "length": 285, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unprotected-upgrade/0.6.11/Buggy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unprotected-upgrade/0.6.11/Buggy.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "initialize()" + } + }, + { + "type": "function", + "name": "kill", + "source_mapping": { + "start": 216, + "length": 98, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unprotected-upgrade/0.6.11/Buggy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unprotected-upgrade/0.6.11/Buggy.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12, + 13 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Buggy", + "source_mapping": { + "start": 31, + "length": 285, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unprotected-upgrade/0.6.11/Buggy.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unprotected-upgrade/0.6.11/Buggy.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "kill()" + } + } + ], + "description": "Buggy (tests/detectors/unprotected-upgrade/0.6.11/Buggy.sol#3-15) is an upgradeable contract that does not protect its initiliaze functions: Buggy.initialize() (tests/detectors/unprotected-upgrade/0.6.11/Buggy.sol#6-9). Anyone can delete the contract with: Buggy.kill() (tests/detectors/unprotected-upgrade/0.6.11/Buggy.sol#10-13)", + "markdown": "[Buggy](tests/detectors/unprotected-upgrade/0.6.11/Buggy.sol#L3-L15) is an upgradeable contract that does not protect its initiliaze functions: [Buggy.initialize()](tests/detectors/unprotected-upgrade/0.6.11/Buggy.sol#L6-L9). Anyone can delete the contract with: [Buggy.kill()](tests/detectors/unprotected-upgrade/0.6.11/Buggy.sol#L10-L13)", + "id": "aceca400ce0b482809a70df612af22e24d154c5c89c24d630ec0ee5a366d09fe", + "check": "unprotected-upgrade", + "impact": "High", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/unprotected-upgrade/0.6.11/Fixed.sol b/tests/detectors/unprotected-upgrade/0.6.11/Fixed.sol new file mode 100644 index 0000000000..1ef89baca2 --- /dev/null +++ b/tests/detectors/unprotected-upgrade/0.6.11/Fixed.sol @@ -0,0 +1,39 @@ +import "./Initializable.sol"; + +contract Fixed is Initializable{ + address payable owner; + + constructor() public{ + owner = msg.sender; + } + + function initialize() external initializer{ + require(owner == address(0)); + owner = msg.sender; + } + function kill() external{ + require(msg.sender == owner); + selfdestruct(owner); + } + + function other_function() external{ + + } +} + + +contract Not_Upgradeable{ +} + +contract UpgradeableNoDestruct is Initializable{ + address payable owner; + + constructor() public{ + owner = msg.sender; + } + + function initialize() external initializer{ + require(owner == address(0)); + owner = msg.sender; + } +} \ No newline at end of file diff --git a/tests/detectors/unprotected-upgrade/0.6.11/Fixed.sol.0.6.11.UnprotectedUpgradeable.json b/tests/detectors/unprotected-upgrade/0.6.11/Fixed.sol.0.6.11.UnprotectedUpgradeable.json new file mode 100644 index 0000000000..5825bcacc6 --- /dev/null +++ b/tests/detectors/unprotected-upgrade/0.6.11/Fixed.sol.0.6.11.UnprotectedUpgradeable.json @@ -0,0 +1,3 @@ +[ + [] +] \ No newline at end of file diff --git a/tests/detectors/unprotected-upgrade/0.6.11/Initializable.sol b/tests/detectors/unprotected-upgrade/0.6.11/Initializable.sol new file mode 100644 index 0000000000..779a0e87c9 --- /dev/null +++ b/tests/detectors/unprotected-upgrade/0.6.11/Initializable.sol @@ -0,0 +1,5 @@ +contract Initializable{ + modifier initializer() { + _; + } +} \ No newline at end of file diff --git a/tests/detectors/unprotected-upgrade/0.7.6/Buggy.sol b/tests/detectors/unprotected-upgrade/0.7.6/Buggy.sol new file mode 100644 index 0000000000..a3df9841e6 --- /dev/null +++ b/tests/detectors/unprotected-upgrade/0.7.6/Buggy.sol @@ -0,0 +1,14 @@ +import "./Initializable.sol"; + +contract Buggy is Initializable{ + address payable owner; + + function initialize() external initializer{ + require(owner == address(0)); + owner = msg.sender; + } + function kill() external{ + require(msg.sender == owner); + selfdestruct(owner); + } +} \ No newline at end of file diff --git a/tests/detectors/unprotected-upgrade/Buggy.sol.0.6.12.UnprotectedUpgradeable.json b/tests/detectors/unprotected-upgrade/0.7.6/Buggy.sol.0.7.6.UnprotectedUpgradeable.json similarity index 86% rename from tests/detectors/unprotected-upgrade/Buggy.sol.0.6.12.UnprotectedUpgradeable.json rename to tests/detectors/unprotected-upgrade/0.7.6/Buggy.sol.0.7.6.UnprotectedUpgradeable.json index 240a8343c2..e37e61abbd 100644 --- a/tests/detectors/unprotected-upgrade/Buggy.sol.0.6.12.UnprotectedUpgradeable.json +++ b/tests/detectors/unprotected-upgrade/0.7.6/Buggy.sol.0.7.6.UnprotectedUpgradeable.json @@ -9,9 +9,9 @@ "start": 31, "length": 285, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unprotected-upgrade/Buggy.sol", + "filename_relative": "tests/detectors/unprotected-upgrade/0.7.6/Buggy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unprotected-upgrade/Buggy.sol", + "filename_short": "tests/detectors/unprotected-upgrade/0.7.6/Buggy.sol", "is_dependency": false, "lines": [ 3, @@ -39,9 +39,9 @@ "start": 96, "length": 115, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unprotected-upgrade/Buggy.sol", + "filename_relative": "tests/detectors/unprotected-upgrade/0.7.6/Buggy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unprotected-upgrade/Buggy.sol", + "filename_short": "tests/detectors/unprotected-upgrade/0.7.6/Buggy.sol", "is_dependency": false, "lines": [ 6, @@ -60,9 +60,9 @@ "start": 31, "length": 285, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unprotected-upgrade/Buggy.sol", + "filename_relative": "tests/detectors/unprotected-upgrade/0.7.6/Buggy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unprotected-upgrade/Buggy.sol", + "filename_short": "tests/detectors/unprotected-upgrade/0.7.6/Buggy.sol", "is_dependency": false, "lines": [ 3, @@ -93,9 +93,9 @@ "start": 216, "length": 98, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unprotected-upgrade/Buggy.sol", + "filename_relative": "tests/detectors/unprotected-upgrade/0.7.6/Buggy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unprotected-upgrade/Buggy.sol", + "filename_short": "tests/detectors/unprotected-upgrade/0.7.6/Buggy.sol", "is_dependency": false, "lines": [ 10, @@ -114,9 +114,9 @@ "start": 31, "length": 285, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unprotected-upgrade/Buggy.sol", + "filename_relative": "tests/detectors/unprotected-upgrade/0.7.6/Buggy.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unprotected-upgrade/Buggy.sol", + "filename_short": "tests/detectors/unprotected-upgrade/0.7.6/Buggy.sol", "is_dependency": false, "lines": [ 3, @@ -141,8 +141,8 @@ } } ], - "description": "Buggy (tests/detectors/unprotected-upgrade/Buggy.sol#3-15) is an upgradeable contract that does not protect its initiliaze functions: Buggy.initialize() (tests/detectors/unprotected-upgrade/Buggy.sol#6-9). Anyone can delete the contract with: Buggy.kill() (tests/detectors/unprotected-upgrade/Buggy.sol#10-13)", - "markdown": "[Buggy](tests/detectors/unprotected-upgrade/Buggy.sol#L3-L15) is an upgradeable contract that does not protect its initiliaze functions: [Buggy.initialize()](tests/detectors/unprotected-upgrade/Buggy.sol#L6-L9). Anyone can delete the contract with: [Buggy.kill()](tests/detectors/unprotected-upgrade/Buggy.sol#L10-L13)", + "description": "Buggy (tests/detectors/unprotected-upgrade/0.7.6/Buggy.sol#3-15) is an upgradeable contract that does not protect its initiliaze functions: Buggy.initialize() (tests/detectors/unprotected-upgrade/0.7.6/Buggy.sol#6-9). Anyone can delete the contract with: Buggy.kill() (tests/detectors/unprotected-upgrade/0.7.6/Buggy.sol#10-13)", + "markdown": "[Buggy](tests/detectors/unprotected-upgrade/0.7.6/Buggy.sol#L3-L15) is an upgradeable contract that does not protect its initiliaze functions: [Buggy.initialize()](tests/detectors/unprotected-upgrade/0.7.6/Buggy.sol#L6-L9). Anyone can delete the contract with: [Buggy.kill()](tests/detectors/unprotected-upgrade/0.7.6/Buggy.sol#L10-L13)", "id": "aceca400ce0b482809a70df612af22e24d154c5c89c24d630ec0ee5a366d09fe", "check": "unprotected-upgrade", "impact": "High", diff --git a/tests/detectors/unprotected-upgrade/0.7.6/Fixed.sol b/tests/detectors/unprotected-upgrade/0.7.6/Fixed.sol new file mode 100644 index 0000000000..1ef89baca2 --- /dev/null +++ b/tests/detectors/unprotected-upgrade/0.7.6/Fixed.sol @@ -0,0 +1,39 @@ +import "./Initializable.sol"; + +contract Fixed is Initializable{ + address payable owner; + + constructor() public{ + owner = msg.sender; + } + + function initialize() external initializer{ + require(owner == address(0)); + owner = msg.sender; + } + function kill() external{ + require(msg.sender == owner); + selfdestruct(owner); + } + + function other_function() external{ + + } +} + + +contract Not_Upgradeable{ +} + +contract UpgradeableNoDestruct is Initializable{ + address payable owner; + + constructor() public{ + owner = msg.sender; + } + + function initialize() external initializer{ + require(owner == address(0)); + owner = msg.sender; + } +} \ No newline at end of file diff --git a/tests/detectors/unprotected-upgrade/0.7.6/Fixed.sol.0.7.6.UnprotectedUpgradeable.json b/tests/detectors/unprotected-upgrade/0.7.6/Fixed.sol.0.7.6.UnprotectedUpgradeable.json new file mode 100644 index 0000000000..5825bcacc6 --- /dev/null +++ b/tests/detectors/unprotected-upgrade/0.7.6/Fixed.sol.0.7.6.UnprotectedUpgradeable.json @@ -0,0 +1,3 @@ +[ + [] +] \ No newline at end of file diff --git a/tests/detectors/unprotected-upgrade/0.7.6/Initializable.sol b/tests/detectors/unprotected-upgrade/0.7.6/Initializable.sol new file mode 100644 index 0000000000..779a0e87c9 --- /dev/null +++ b/tests/detectors/unprotected-upgrade/0.7.6/Initializable.sol @@ -0,0 +1,5 @@ +contract Initializable{ + modifier initializer() { + _; + } +} \ No newline at end of file diff --git a/tests/detectors/unused-return/unused_return.sol b/tests/detectors/unused-return/0.4.25/unused_return.sol similarity index 100% rename from tests/detectors/unused-return/unused_return.sol rename to tests/detectors/unused-return/0.4.25/unused_return.sol diff --git a/tests/detectors/unused-return/unused_return.sol.0.4.25.UnusedReturnValues.json b/tests/detectors/unused-return/0.4.25/unused_return.sol.0.4.25.UnusedReturnValues.json similarity index 89% rename from tests/detectors/unused-return/unused_return.sol.0.4.25.UnusedReturnValues.json rename to tests/detectors/unused-return/0.4.25/unused_return.sol.0.4.25.UnusedReturnValues.json index f9b2f9b9b0..5a60cb35a1 100644 --- a/tests/detectors/unused-return/unused_return.sol.0.4.25.UnusedReturnValues.json +++ b/tests/detectors/unused-return/0.4.25/unused_return.sol.0.4.25.UnusedReturnValues.json @@ -9,9 +9,9 @@ "start": 239, "length": 354, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return/unused_return.sol", + "filename_relative": "tests/detectors/unused-return/0.4.25/unused_return.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return/unused_return.sol", + "filename_short": "tests/detectors/unused-return/0.4.25/unused_return.sol", "is_dependency": false, "lines": [ 17, @@ -39,9 +39,9 @@ "start": 189, "length": 406, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return/unused_return.sol", + "filename_relative": "tests/detectors/unused-return/0.4.25/unused_return.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return/unused_return.sol", + "filename_short": "tests/detectors/unused-return/0.4.25/unused_return.sol", "is_dependency": false, "lines": [ 13, @@ -77,9 +77,9 @@ "start": 279, "length": 5, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return/unused_return.sol", + "filename_relative": "tests/detectors/unused-return/0.4.25/unused_return.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return/unused_return.sol", + "filename_short": "tests/detectors/unused-return/0.4.25/unused_return.sol", "is_dependency": false, "lines": [ 18 @@ -95,9 +95,9 @@ "start": 239, "length": 354, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return/unused_return.sol", + "filename_relative": "tests/detectors/unused-return/0.4.25/unused_return.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return/unused_return.sol", + "filename_short": "tests/detectors/unused-return/0.4.25/unused_return.sol", "is_dependency": false, "lines": [ 17, @@ -125,9 +125,9 @@ "start": 189, "length": 406, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return/unused_return.sol", + "filename_relative": "tests/detectors/unused-return/0.4.25/unused_return.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return/unused_return.sol", + "filename_short": "tests/detectors/unused-return/0.4.25/unused_return.sol", "is_dependency": false, "lines": [ 13, @@ -159,9 +159,9 @@ } } ], - "description": "User.test(Target) (tests/detectors/unused-return/unused_return.sol#17-29) ignores return value by t.f() (tests/detectors/unused-return/unused_return.sol#18)\n", - "markdown": "[User.test(Target)](tests/detectors/unused-return/unused_return.sol#L17-L29) ignores return value by [t.f()](tests/detectors/unused-return/unused_return.sol#L18)\n", - "id": "000853c04bd511b08da14a492a5784575fb667c4c7432986706213e4f3215497", + "description": "User.test(Target) (tests/detectors/unused-return/0.4.25/unused_return.sol#17-29) ignores return value by t.f() (tests/detectors/unused-return/0.4.25/unused_return.sol#18)\n", + "markdown": "[User.test(Target)](tests/detectors/unused-return/0.4.25/unused_return.sol#L17-L29) ignores return value by [t.f()](tests/detectors/unused-return/0.4.25/unused_return.sol#L18)\n", + "id": "73c54c292f1f2fb8a8d88b230cd0bf2da3bc8fff0d758b009839ca883b36c84e", "check": "unused-return", "impact": "Medium", "confidence": "Medium" @@ -175,9 +175,9 @@ "start": 239, "length": 354, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return/unused_return.sol", + "filename_relative": "tests/detectors/unused-return/0.4.25/unused_return.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return/unused_return.sol", + "filename_short": "tests/detectors/unused-return/0.4.25/unused_return.sol", "is_dependency": false, "lines": [ 17, @@ -205,9 +205,9 @@ "start": 189, "length": 406, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return/unused_return.sol", + "filename_relative": "tests/detectors/unused-return/0.4.25/unused_return.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return/unused_return.sol", + "filename_short": "tests/detectors/unused-return/0.4.25/unused_return.sol", "is_dependency": false, "lines": [ 13, @@ -243,9 +243,9 @@ "start": 353, "length": 8, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return/unused_return.sol", + "filename_relative": "tests/detectors/unused-return/0.4.25/unused_return.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return/unused_return.sol", + "filename_short": "tests/detectors/unused-return/0.4.25/unused_return.sol", "is_dependency": false, "lines": [ 22 @@ -261,9 +261,9 @@ "start": 239, "length": 354, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return/unused_return.sol", + "filename_relative": "tests/detectors/unused-return/0.4.25/unused_return.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return/unused_return.sol", + "filename_short": "tests/detectors/unused-return/0.4.25/unused_return.sol", "is_dependency": false, "lines": [ 17, @@ -291,9 +291,9 @@ "start": 189, "length": 406, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return/unused_return.sol", + "filename_relative": "tests/detectors/unused-return/0.4.25/unused_return.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return/unused_return.sol", + "filename_short": "tests/detectors/unused-return/0.4.25/unused_return.sol", "is_dependency": false, "lines": [ 13, @@ -325,9 +325,9 @@ } } ], - "description": "User.test(Target) (tests/detectors/unused-return/unused_return.sol#17-29) ignores return value by a.add(0) (tests/detectors/unused-return/unused_return.sol#22)\n", - "markdown": "[User.test(Target)](tests/detectors/unused-return/unused_return.sol#L17-L29) ignores return value by [a.add(0)](tests/detectors/unused-return/unused_return.sol#L22)\n", - "id": "003cd4cef3010715d9b4605fb88240d6a24f8066ce65a9f26aa7e138cb7eb7a9", + "description": "User.test(Target) (tests/detectors/unused-return/0.4.25/unused_return.sol#17-29) ignores return value by a.add(0) (tests/detectors/unused-return/0.4.25/unused_return.sol#22)\n", + "markdown": "[User.test(Target)](tests/detectors/unused-return/0.4.25/unused_return.sol#L17-L29) ignores return value by [a.add(0)](tests/detectors/unused-return/0.4.25/unused_return.sol#L22)\n", + "id": "619bba0a79919e4f53e583a88cd4e32f204489c8d86e365a20bf3f9ce4c0f542", "check": "unused-return", "impact": "Medium", "confidence": "Medium" diff --git a/tests/detectors/unused-return/0.5.16/unused_return.sol b/tests/detectors/unused-return/0.5.16/unused_return.sol new file mode 100644 index 0000000000..d1c1895987 --- /dev/null +++ b/tests/detectors/unused-return/0.5.16/unused_return.sol @@ -0,0 +1,30 @@ +//pragma solidity ^0.4.24; + +library SafeMath{ + function add(uint a, uint b) public returns(uint){ + return a+b; + } +} + +contract Target{ + function f() public returns(uint); +} + +contract User{ + + using SafeMath for uint; + + function test(Target t) public{ + t.f(); + + // example with library usage + uint a; + a.add(0); + + // The value is not used + // But the detector should not detect it + // As the value returned by the call is stored + // (unused local variable should be another issue) + uint b = a.add(1); + } +} diff --git a/tests/detectors/unused-return/unused_return.sol.0.5.1.UnusedReturnValues.json b/tests/detectors/unused-return/0.5.16/unused_return.sol.0.5.16.UnusedReturnValues.json similarity index 89% rename from tests/detectors/unused-return/unused_return.sol.0.5.1.UnusedReturnValues.json rename to tests/detectors/unused-return/0.5.16/unused_return.sol.0.5.16.UnusedReturnValues.json index f9b2f9b9b0..d3d0b94384 100644 --- a/tests/detectors/unused-return/unused_return.sol.0.5.1.UnusedReturnValues.json +++ b/tests/detectors/unused-return/0.5.16/unused_return.sol.0.5.16.UnusedReturnValues.json @@ -9,9 +9,9 @@ "start": 239, "length": 354, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return/unused_return.sol", + "filename_relative": "tests/detectors/unused-return/0.5.16/unused_return.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return/unused_return.sol", + "filename_short": "tests/detectors/unused-return/0.5.16/unused_return.sol", "is_dependency": false, "lines": [ 17, @@ -39,9 +39,9 @@ "start": 189, "length": 406, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return/unused_return.sol", + "filename_relative": "tests/detectors/unused-return/0.5.16/unused_return.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return/unused_return.sol", + "filename_short": "tests/detectors/unused-return/0.5.16/unused_return.sol", "is_dependency": false, "lines": [ 13, @@ -77,9 +77,9 @@ "start": 279, "length": 5, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return/unused_return.sol", + "filename_relative": "tests/detectors/unused-return/0.5.16/unused_return.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return/unused_return.sol", + "filename_short": "tests/detectors/unused-return/0.5.16/unused_return.sol", "is_dependency": false, "lines": [ 18 @@ -95,9 +95,9 @@ "start": 239, "length": 354, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return/unused_return.sol", + "filename_relative": "tests/detectors/unused-return/0.5.16/unused_return.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return/unused_return.sol", + "filename_short": "tests/detectors/unused-return/0.5.16/unused_return.sol", "is_dependency": false, "lines": [ 17, @@ -125,9 +125,9 @@ "start": 189, "length": 406, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return/unused_return.sol", + "filename_relative": "tests/detectors/unused-return/0.5.16/unused_return.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return/unused_return.sol", + "filename_short": "tests/detectors/unused-return/0.5.16/unused_return.sol", "is_dependency": false, "lines": [ 13, @@ -159,9 +159,9 @@ } } ], - "description": "User.test(Target) (tests/detectors/unused-return/unused_return.sol#17-29) ignores return value by t.f() (tests/detectors/unused-return/unused_return.sol#18)\n", - "markdown": "[User.test(Target)](tests/detectors/unused-return/unused_return.sol#L17-L29) ignores return value by [t.f()](tests/detectors/unused-return/unused_return.sol#L18)\n", - "id": "000853c04bd511b08da14a492a5784575fb667c4c7432986706213e4f3215497", + "description": "User.test(Target) (tests/detectors/unused-return/0.5.16/unused_return.sol#17-29) ignores return value by t.f() (tests/detectors/unused-return/0.5.16/unused_return.sol#18)\n", + "markdown": "[User.test(Target)](tests/detectors/unused-return/0.5.16/unused_return.sol#L17-L29) ignores return value by [t.f()](tests/detectors/unused-return/0.5.16/unused_return.sol#L18)\n", + "id": "190c5a143431b8a4d621e698c6dc665e87146a1cd2543177212f1114eb714c43", "check": "unused-return", "impact": "Medium", "confidence": "Medium" @@ -175,9 +175,9 @@ "start": 239, "length": 354, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return/unused_return.sol", + "filename_relative": "tests/detectors/unused-return/0.5.16/unused_return.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return/unused_return.sol", + "filename_short": "tests/detectors/unused-return/0.5.16/unused_return.sol", "is_dependency": false, "lines": [ 17, @@ -205,9 +205,9 @@ "start": 189, "length": 406, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return/unused_return.sol", + "filename_relative": "tests/detectors/unused-return/0.5.16/unused_return.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return/unused_return.sol", + "filename_short": "tests/detectors/unused-return/0.5.16/unused_return.sol", "is_dependency": false, "lines": [ 13, @@ -243,9 +243,9 @@ "start": 353, "length": 8, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return/unused_return.sol", + "filename_relative": "tests/detectors/unused-return/0.5.16/unused_return.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return/unused_return.sol", + "filename_short": "tests/detectors/unused-return/0.5.16/unused_return.sol", "is_dependency": false, "lines": [ 22 @@ -261,9 +261,9 @@ "start": 239, "length": 354, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return/unused_return.sol", + "filename_relative": "tests/detectors/unused-return/0.5.16/unused_return.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return/unused_return.sol", + "filename_short": "tests/detectors/unused-return/0.5.16/unused_return.sol", "is_dependency": false, "lines": [ 17, @@ -291,9 +291,9 @@ "start": 189, "length": 406, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return/unused_return.sol", + "filename_relative": "tests/detectors/unused-return/0.5.16/unused_return.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return/unused_return.sol", + "filename_short": "tests/detectors/unused-return/0.5.16/unused_return.sol", "is_dependency": false, "lines": [ 13, @@ -325,9 +325,9 @@ } } ], - "description": "User.test(Target) (tests/detectors/unused-return/unused_return.sol#17-29) ignores return value by a.add(0) (tests/detectors/unused-return/unused_return.sol#22)\n", - "markdown": "[User.test(Target)](tests/detectors/unused-return/unused_return.sol#L17-L29) ignores return value by [a.add(0)](tests/detectors/unused-return/unused_return.sol#L22)\n", - "id": "003cd4cef3010715d9b4605fb88240d6a24f8066ce65a9f26aa7e138cb7eb7a9", + "description": "User.test(Target) (tests/detectors/unused-return/0.5.16/unused_return.sol#17-29) ignores return value by a.add(0) (tests/detectors/unused-return/0.5.16/unused_return.sol#22)\n", + "markdown": "[User.test(Target)](tests/detectors/unused-return/0.5.16/unused_return.sol#L17-L29) ignores return value by [a.add(0)](tests/detectors/unused-return/0.5.16/unused_return.sol#L22)\n", + "id": "c31ab267ad74015229067bab954de4f1edb4eaa7d39df6f3f01646911acddb14", "check": "unused-return", "impact": "Medium", "confidence": "Medium" diff --git a/tests/detectors/unused-return/0.6.11/unused_return.sol b/tests/detectors/unused-return/0.6.11/unused_return.sol new file mode 100644 index 0000000000..08d0eb3a59 --- /dev/null +++ b/tests/detectors/unused-return/0.6.11/unused_return.sol @@ -0,0 +1,30 @@ +//pragma solidity ^0.4.24; + +library SafeMath{ + function add(uint a, uint b) public returns(uint){ + return a+b; + } +} + +abstract contract Target{ + function f() public virtual returns(uint); +} + +contract User{ + + using SafeMath for uint; + + function test(Target t) public{ + t.f(); + + // example with library usage + uint a; + a.add(0); + + // The value is not used + // But the detector should not detect it + // As the value returned by the call is stored + // (unused local variable should be another issue) + uint b = a.add(1); + } +} diff --git a/tests/detectors/unused-return/0.6.11/unused_return.sol.0.6.11.UnusedReturnValues.json b/tests/detectors/unused-return/0.6.11/unused_return.sol.0.6.11.UnusedReturnValues.json new file mode 100644 index 0000000000..d46c4881b6 --- /dev/null +++ b/tests/detectors/unused-return/0.6.11/unused_return.sol.0.6.11.UnusedReturnValues.json @@ -0,0 +1,336 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "test", + "source_mapping": { + "start": 256, + "length": 354, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return/0.6.11/unused_return.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return/0.6.11/unused_return.sol", + "is_dependency": false, + "lines": [ + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "User", + "source_mapping": { + "start": 206, + "length": 406, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return/0.6.11/unused_return.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return/0.6.11/unused_return.sol", + "is_dependency": false, + "lines": [ + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "test(Target)" + } + }, + { + "type": "node", + "name": "t.f()", + "source_mapping": { + "start": 296, + "length": 5, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return/0.6.11/unused_return.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return/0.6.11/unused_return.sol", + "is_dependency": false, + "lines": [ + 18 + ], + "starting_column": 9, + "ending_column": 14 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "test", + "source_mapping": { + "start": 256, + "length": 354, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return/0.6.11/unused_return.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return/0.6.11/unused_return.sol", + "is_dependency": false, + "lines": [ + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "User", + "source_mapping": { + "start": 206, + "length": 406, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return/0.6.11/unused_return.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return/0.6.11/unused_return.sol", + "is_dependency": false, + "lines": [ + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "test(Target)" + } + } + } + } + ], + "description": "User.test(Target) (tests/detectors/unused-return/0.6.11/unused_return.sol#17-29) ignores return value by t.f() (tests/detectors/unused-return/0.6.11/unused_return.sol#18)\n", + "markdown": "[User.test(Target)](tests/detectors/unused-return/0.6.11/unused_return.sol#L17-L29) ignores return value by [t.f()](tests/detectors/unused-return/0.6.11/unused_return.sol#L18)\n", + "id": "4e72a6afeb16bff32ed54f32875103a79d36d8fb42eefeb6ddfdc9d2cfb9894a", + "check": "unused-return", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "test", + "source_mapping": { + "start": 256, + "length": 354, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return/0.6.11/unused_return.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return/0.6.11/unused_return.sol", + "is_dependency": false, + "lines": [ + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "User", + "source_mapping": { + "start": 206, + "length": 406, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return/0.6.11/unused_return.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return/0.6.11/unused_return.sol", + "is_dependency": false, + "lines": [ + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "test(Target)" + } + }, + { + "type": "node", + "name": "a.add(0)", + "source_mapping": { + "start": 370, + "length": 8, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return/0.6.11/unused_return.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return/0.6.11/unused_return.sol", + "is_dependency": false, + "lines": [ + 22 + ], + "starting_column": 9, + "ending_column": 17 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "test", + "source_mapping": { + "start": 256, + "length": 354, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return/0.6.11/unused_return.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return/0.6.11/unused_return.sol", + "is_dependency": false, + "lines": [ + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "User", + "source_mapping": { + "start": 206, + "length": 406, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return/0.6.11/unused_return.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return/0.6.11/unused_return.sol", + "is_dependency": false, + "lines": [ + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "test(Target)" + } + } + } + } + ], + "description": "User.test(Target) (tests/detectors/unused-return/0.6.11/unused_return.sol#17-29) ignores return value by a.add(0) (tests/detectors/unused-return/0.6.11/unused_return.sol#22)\n", + "markdown": "[User.test(Target)](tests/detectors/unused-return/0.6.11/unused_return.sol#L17-L29) ignores return value by [a.add(0)](tests/detectors/unused-return/0.6.11/unused_return.sol#L22)\n", + "id": "7dda2ecde076f87319f13a922c2b0daacf6fe31578c06e28fc45383520429a6d", + "check": "unused-return", + "impact": "Medium", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/unused-return/0.7.6/unused_return.sol b/tests/detectors/unused-return/0.7.6/unused_return.sol new file mode 100644 index 0000000000..08d0eb3a59 --- /dev/null +++ b/tests/detectors/unused-return/0.7.6/unused_return.sol @@ -0,0 +1,30 @@ +//pragma solidity ^0.4.24; + +library SafeMath{ + function add(uint a, uint b) public returns(uint){ + return a+b; + } +} + +abstract contract Target{ + function f() public virtual returns(uint); +} + +contract User{ + + using SafeMath for uint; + + function test(Target t) public{ + t.f(); + + // example with library usage + uint a; + a.add(0); + + // The value is not used + // But the detector should not detect it + // As the value returned by the call is stored + // (unused local variable should be another issue) + uint b = a.add(1); + } +} diff --git a/tests/detectors/unused-return/0.7.6/unused_return.sol.0.7.6.UnusedReturnValues.json b/tests/detectors/unused-return/0.7.6/unused_return.sol.0.7.6.UnusedReturnValues.json new file mode 100644 index 0000000000..a2572a7c20 --- /dev/null +++ b/tests/detectors/unused-return/0.7.6/unused_return.sol.0.7.6.UnusedReturnValues.json @@ -0,0 +1,336 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "test", + "source_mapping": { + "start": 256, + "length": 354, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return/0.7.6/unused_return.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return/0.7.6/unused_return.sol", + "is_dependency": false, + "lines": [ + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "User", + "source_mapping": { + "start": 206, + "length": 406, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return/0.7.6/unused_return.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return/0.7.6/unused_return.sol", + "is_dependency": false, + "lines": [ + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "test(Target)" + } + }, + { + "type": "node", + "name": "t.f()", + "source_mapping": { + "start": 296, + "length": 5, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return/0.7.6/unused_return.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return/0.7.6/unused_return.sol", + "is_dependency": false, + "lines": [ + 18 + ], + "starting_column": 9, + "ending_column": 14 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "test", + "source_mapping": { + "start": 256, + "length": 354, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return/0.7.6/unused_return.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return/0.7.6/unused_return.sol", + "is_dependency": false, + "lines": [ + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "User", + "source_mapping": { + "start": 206, + "length": 406, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return/0.7.6/unused_return.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return/0.7.6/unused_return.sol", + "is_dependency": false, + "lines": [ + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "test(Target)" + } + } + } + } + ], + "description": "User.test(Target) (tests/detectors/unused-return/0.7.6/unused_return.sol#17-29) ignores return value by t.f() (tests/detectors/unused-return/0.7.6/unused_return.sol#18)\n", + "markdown": "[User.test(Target)](tests/detectors/unused-return/0.7.6/unused_return.sol#L17-L29) ignores return value by [t.f()](tests/detectors/unused-return/0.7.6/unused_return.sol#L18)\n", + "id": "d5027a5d25ac3528c0d03d48a3bbd9ef6ea582b2a286b47e8e7f741c26c35634", + "check": "unused-return", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "test", + "source_mapping": { + "start": 256, + "length": 354, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return/0.7.6/unused_return.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return/0.7.6/unused_return.sol", + "is_dependency": false, + "lines": [ + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "User", + "source_mapping": { + "start": 206, + "length": 406, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return/0.7.6/unused_return.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return/0.7.6/unused_return.sol", + "is_dependency": false, + "lines": [ + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "test(Target)" + } + }, + { + "type": "node", + "name": "a.add(0)", + "source_mapping": { + "start": 370, + "length": 8, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return/0.7.6/unused_return.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return/0.7.6/unused_return.sol", + "is_dependency": false, + "lines": [ + 22 + ], + "starting_column": 9, + "ending_column": 17 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "test", + "source_mapping": { + "start": 256, + "length": 354, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return/0.7.6/unused_return.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return/0.7.6/unused_return.sol", + "is_dependency": false, + "lines": [ + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "User", + "source_mapping": { + "start": 206, + "length": 406, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return/0.7.6/unused_return.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return/0.7.6/unused_return.sol", + "is_dependency": false, + "lines": [ + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "test(Target)" + } + } + } + } + ], + "description": "User.test(Target) (tests/detectors/unused-return/0.7.6/unused_return.sol#17-29) ignores return value by a.add(0) (tests/detectors/unused-return/0.7.6/unused_return.sol#22)\n", + "markdown": "[User.test(Target)](tests/detectors/unused-return/0.7.6/unused_return.sol#L17-L29) ignores return value by [a.add(0)](tests/detectors/unused-return/0.7.6/unused_return.sol#L22)\n", + "id": "3774dfb7de028a13f2945c0e19a075ffb1fb27a7785aaaf79dff863f7f1bbec7", + "check": "unused-return", + "impact": "Medium", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/unused-state/unused_state.sol b/tests/detectors/unused-state/0.4.25/unused_state.sol similarity index 100% rename from tests/detectors/unused-state/unused_state.sol rename to tests/detectors/unused-state/0.4.25/unused_state.sol diff --git a/tests/detectors/unused-state/unused_state.sol.0.4.25.UnusedStateVars.json b/tests/detectors/unused-state/0.4.25/unused_state.sol.0.4.25.UnusedStateVars.json similarity index 87% rename from tests/detectors/unused-state/unused_state.sol.0.4.25.UnusedStateVars.json rename to tests/detectors/unused-state/0.4.25/unused_state.sol.0.4.25.UnusedStateVars.json index ef39332a7d..816a4a3a18 100644 --- a/tests/detectors/unused-state/unused_state.sol.0.4.25.UnusedStateVars.json +++ b/tests/detectors/unused-state/0.4.25/unused_state.sol.0.4.25.UnusedStateVars.json @@ -9,9 +9,9 @@ "start": 44, "length": 14, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-state/unused_state.sol", + "filename_relative": "tests/detectors/unused-state/0.4.25/unused_state.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-state/unused_state.sol", + "filename_short": "tests/detectors/unused-state/0.4.25/unused_state.sol", "is_dependency": false, "lines": [ 4 @@ -27,9 +27,9 @@ "start": 28, "length": 114, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-state/unused_state.sol", + "filename_relative": "tests/detectors/unused-state/0.4.25/unused_state.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-state/unused_state.sol", + "filename_short": "tests/detectors/unused-state/0.4.25/unused_state.sol", "is_dependency": false, "lines": [ 3, @@ -53,9 +53,9 @@ "start": 144, "length": 78, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-state/unused_state.sol", + "filename_relative": "tests/detectors/unused-state/0.4.25/unused_state.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-state/unused_state.sol", + "filename_short": "tests/detectors/unused-state/0.4.25/unused_state.sol", "is_dependency": false, "lines": [ 11, @@ -70,8 +70,8 @@ } } ], - "description": "A.unused (tests/detectors/unused-state/unused_state.sol#4) is never used in B (tests/detectors/unused-state/unused_state.sol#11-16)\n", - "markdown": "[A.unused](tests/detectors/unused-state/unused_state.sol#L4) is never used in [B](tests/detectors/unused-state/unused_state.sol#L11-L16)\n", + "description": "A.unused (tests/detectors/unused-state/0.4.25/unused_state.sol#4) is never used in B (tests/detectors/unused-state/0.4.25/unused_state.sol#11-16)\n", + "markdown": "[A.unused](tests/detectors/unused-state/0.4.25/unused_state.sol#L4) is never used in [B](tests/detectors/unused-state/0.4.25/unused_state.sol#L11-L16)\n", "id": "195279490862ae355bac3d27d0cdb1aa18200a5daed8f3dbd84dc5b120e29482", "check": "unused-state", "impact": "Informational", @@ -86,9 +86,9 @@ "start": 64, "length": 15, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-state/unused_state.sol", + "filename_relative": "tests/detectors/unused-state/0.4.25/unused_state.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-state/unused_state.sol", + "filename_short": "tests/detectors/unused-state/0.4.25/unused_state.sol", "is_dependency": false, "lines": [ 5 @@ -104,9 +104,9 @@ "start": 28, "length": 114, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-state/unused_state.sol", + "filename_relative": "tests/detectors/unused-state/0.4.25/unused_state.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-state/unused_state.sol", + "filename_short": "tests/detectors/unused-state/0.4.25/unused_state.sol", "is_dependency": false, "lines": [ 3, @@ -130,9 +130,9 @@ "start": 144, "length": 78, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-state/unused_state.sol", + "filename_relative": "tests/detectors/unused-state/0.4.25/unused_state.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-state/unused_state.sol", + "filename_short": "tests/detectors/unused-state/0.4.25/unused_state.sol", "is_dependency": false, "lines": [ 11, @@ -147,8 +147,8 @@ } } ], - "description": "A.unused2 (tests/detectors/unused-state/unused_state.sol#5) is never used in B (tests/detectors/unused-state/unused_state.sol#11-16)\n", - "markdown": "[A.unused2](tests/detectors/unused-state/unused_state.sol#L5) is never used in [B](tests/detectors/unused-state/unused_state.sol#L11-L16)\n", + "description": "A.unused2 (tests/detectors/unused-state/0.4.25/unused_state.sol#5) is never used in B (tests/detectors/unused-state/0.4.25/unused_state.sol#11-16)\n", + "markdown": "[A.unused2](tests/detectors/unused-state/0.4.25/unused_state.sol#L5) is never used in [B](tests/detectors/unused-state/0.4.25/unused_state.sol#L11-L16)\n", "id": "886250d01813743573f3d311b742e0f818e0012ccbf8ad97738c029fd129d870", "check": "unused-state", "impact": "Informational", @@ -163,9 +163,9 @@ "start": 85, "length": 15, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-state/unused_state.sol", + "filename_relative": "tests/detectors/unused-state/0.4.25/unused_state.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-state/unused_state.sol", + "filename_short": "tests/detectors/unused-state/0.4.25/unused_state.sol", "is_dependency": false, "lines": [ 6 @@ -181,9 +181,9 @@ "start": 28, "length": 114, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-state/unused_state.sol", + "filename_relative": "tests/detectors/unused-state/0.4.25/unused_state.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-state/unused_state.sol", + "filename_short": "tests/detectors/unused-state/0.4.25/unused_state.sol", "is_dependency": false, "lines": [ 3, @@ -207,9 +207,9 @@ "start": 144, "length": 78, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-state/unused_state.sol", + "filename_relative": "tests/detectors/unused-state/0.4.25/unused_state.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-state/unused_state.sol", + "filename_short": "tests/detectors/unused-state/0.4.25/unused_state.sol", "is_dependency": false, "lines": [ 11, @@ -224,8 +224,8 @@ } } ], - "description": "A.unused3 (tests/detectors/unused-state/unused_state.sol#6) is never used in B (tests/detectors/unused-state/unused_state.sol#11-16)\n", - "markdown": "[A.unused3](tests/detectors/unused-state/unused_state.sol#L6) is never used in [B](tests/detectors/unused-state/unused_state.sol#L11-L16)\n", + "description": "A.unused3 (tests/detectors/unused-state/0.4.25/unused_state.sol#6) is never used in B (tests/detectors/unused-state/0.4.25/unused_state.sol#11-16)\n", + "markdown": "[A.unused3](tests/detectors/unused-state/0.4.25/unused_state.sol#L6) is never used in [B](tests/detectors/unused-state/0.4.25/unused_state.sol#L11-L16)\n", "id": "e2ac51590509d97ff791ce50d9a711fc5ad01c20d23eacf6fb31939bd91b9f48", "check": "unused-state", "impact": "Informational", @@ -240,9 +240,9 @@ "start": 106, "length": 15, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-state/unused_state.sol", + "filename_relative": "tests/detectors/unused-state/0.4.25/unused_state.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-state/unused_state.sol", + "filename_short": "tests/detectors/unused-state/0.4.25/unused_state.sol", "is_dependency": false, "lines": [ 7 @@ -258,9 +258,9 @@ "start": 28, "length": 114, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-state/unused_state.sol", + "filename_relative": "tests/detectors/unused-state/0.4.25/unused_state.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-state/unused_state.sol", + "filename_short": "tests/detectors/unused-state/0.4.25/unused_state.sol", "is_dependency": false, "lines": [ 3, @@ -284,9 +284,9 @@ "start": 144, "length": 78, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-state/unused_state.sol", + "filename_relative": "tests/detectors/unused-state/0.4.25/unused_state.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-state/unused_state.sol", + "filename_short": "tests/detectors/unused-state/0.4.25/unused_state.sol", "is_dependency": false, "lines": [ 11, @@ -301,8 +301,8 @@ } } ], - "description": "A.unused4 (tests/detectors/unused-state/unused_state.sol#7) is never used in B (tests/detectors/unused-state/unused_state.sol#11-16)\n", - "markdown": "[A.unused4](tests/detectors/unused-state/unused_state.sol#L7) is never used in [B](tests/detectors/unused-state/unused_state.sol#L11-L16)\n", + "description": "A.unused4 (tests/detectors/unused-state/0.4.25/unused_state.sol#7) is never used in B (tests/detectors/unused-state/0.4.25/unused_state.sol#11-16)\n", + "markdown": "[A.unused4](tests/detectors/unused-state/0.4.25/unused_state.sol#L7) is never used in [B](tests/detectors/unused-state/0.4.25/unused_state.sol#L11-L16)\n", "id": "562d3e6a04f6f6068c3e4f0c074ecdbcff87929e43ec6fbeb6c088e715f63cf2", "check": "unused-state", "impact": "Informational", diff --git a/tests/detectors/unused-state/0.5.16/unused_state.sol b/tests/detectors/unused-state/0.5.16/unused_state.sol new file mode 100644 index 0000000000..8ee255dec7 --- /dev/null +++ b/tests/detectors/unused-state/0.5.16/unused_state.sol @@ -0,0 +1,16 @@ +//pragma solidity ^0.4.24; + +contract A{ + address unused; + address unused2; + address unused3; + address unused4; + address used; +} + +contract B is A{ + + function () external{ + used = address(0); + } +} diff --git a/tests/detectors/unused-state/0.5.16/unused_state.sol.0.5.16.UnusedStateVars.json b/tests/detectors/unused-state/0.5.16/unused_state.sol.0.5.16.UnusedStateVars.json new file mode 100644 index 0000000000..95631c4771 --- /dev/null +++ b/tests/detectors/unused-state/0.5.16/unused_state.sol.0.5.16.UnusedStateVars.json @@ -0,0 +1,312 @@ +[ + [ + { + "elements": [ + { + "type": "variable", + "name": "unused", + "source_mapping": { + "start": 44, + "length": 14, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-state/0.5.16/unused_state.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-state/0.5.16/unused_state.sol", + "is_dependency": false, + "lines": [ + 4 + ], + "starting_column": 5, + "ending_column": 19 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 28, + "length": 114, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-state/0.5.16/unused_state.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-state/0.5.16/unused_state.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "contract", + "name": "B", + "source_mapping": { + "start": 144, + "length": 78, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-state/0.5.16/unused_state.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-state/0.5.16/unused_state.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + } + ], + "description": "A.unused (tests/detectors/unused-state/0.5.16/unused_state.sol#4) is never used in B (tests/detectors/unused-state/0.5.16/unused_state.sol#11-16)\n", + "markdown": "[A.unused](tests/detectors/unused-state/0.5.16/unused_state.sol#L4) is never used in [B](tests/detectors/unused-state/0.5.16/unused_state.sol#L11-L16)\n", + "id": "195279490862ae355bac3d27d0cdb1aa18200a5daed8f3dbd84dc5b120e29482", + "check": "unused-state", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "unused2", + "source_mapping": { + "start": 64, + "length": 15, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-state/0.5.16/unused_state.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-state/0.5.16/unused_state.sol", + "is_dependency": false, + "lines": [ + 5 + ], + "starting_column": 5, + "ending_column": 20 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 28, + "length": 114, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-state/0.5.16/unused_state.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-state/0.5.16/unused_state.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "contract", + "name": "B", + "source_mapping": { + "start": 144, + "length": 78, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-state/0.5.16/unused_state.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-state/0.5.16/unused_state.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + } + ], + "description": "A.unused2 (tests/detectors/unused-state/0.5.16/unused_state.sol#5) is never used in B (tests/detectors/unused-state/0.5.16/unused_state.sol#11-16)\n", + "markdown": "[A.unused2](tests/detectors/unused-state/0.5.16/unused_state.sol#L5) is never used in [B](tests/detectors/unused-state/0.5.16/unused_state.sol#L11-L16)\n", + "id": "886250d01813743573f3d311b742e0f818e0012ccbf8ad97738c029fd129d870", + "check": "unused-state", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "unused3", + "source_mapping": { + "start": 85, + "length": 15, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-state/0.5.16/unused_state.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-state/0.5.16/unused_state.sol", + "is_dependency": false, + "lines": [ + 6 + ], + "starting_column": 5, + "ending_column": 20 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 28, + "length": 114, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-state/0.5.16/unused_state.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-state/0.5.16/unused_state.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "contract", + "name": "B", + "source_mapping": { + "start": 144, + "length": 78, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-state/0.5.16/unused_state.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-state/0.5.16/unused_state.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + } + ], + "description": "A.unused3 (tests/detectors/unused-state/0.5.16/unused_state.sol#6) is never used in B (tests/detectors/unused-state/0.5.16/unused_state.sol#11-16)\n", + "markdown": "[A.unused3](tests/detectors/unused-state/0.5.16/unused_state.sol#L6) is never used in [B](tests/detectors/unused-state/0.5.16/unused_state.sol#L11-L16)\n", + "id": "e2ac51590509d97ff791ce50d9a711fc5ad01c20d23eacf6fb31939bd91b9f48", + "check": "unused-state", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "unused4", + "source_mapping": { + "start": 106, + "length": 15, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-state/0.5.16/unused_state.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-state/0.5.16/unused_state.sol", + "is_dependency": false, + "lines": [ + 7 + ], + "starting_column": 5, + "ending_column": 20 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 28, + "length": 114, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-state/0.5.16/unused_state.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-state/0.5.16/unused_state.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "contract", + "name": "B", + "source_mapping": { + "start": 144, + "length": 78, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-state/0.5.16/unused_state.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-state/0.5.16/unused_state.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + } + ], + "description": "A.unused4 (tests/detectors/unused-state/0.5.16/unused_state.sol#7) is never used in B (tests/detectors/unused-state/0.5.16/unused_state.sol#11-16)\n", + "markdown": "[A.unused4](tests/detectors/unused-state/0.5.16/unused_state.sol#L7) is never used in [B](tests/detectors/unused-state/0.5.16/unused_state.sol#L11-L16)\n", + "id": "562d3e6a04f6f6068c3e4f0c074ecdbcff87929e43ec6fbeb6c088e715f63cf2", + "check": "unused-state", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/unused-state/0.6.11/unused_state.sol b/tests/detectors/unused-state/0.6.11/unused_state.sol new file mode 100644 index 0000000000..b603f88755 --- /dev/null +++ b/tests/detectors/unused-state/0.6.11/unused_state.sol @@ -0,0 +1,16 @@ +//pragma solidity ^0.4.24; + +contract A{ + address unused; + address unused2; + address unused3; + address unused4; + address used; +} + +contract B is A{ + + fallback () external{ + used = address(0); + } +} diff --git a/tests/detectors/unused-state/0.6.11/unused_state.sol.0.6.11.UnusedStateVars.json b/tests/detectors/unused-state/0.6.11/unused_state.sol.0.6.11.UnusedStateVars.json new file mode 100644 index 0000000000..24982d4a42 --- /dev/null +++ b/tests/detectors/unused-state/0.6.11/unused_state.sol.0.6.11.UnusedStateVars.json @@ -0,0 +1,312 @@ +[ + [ + { + "elements": [ + { + "type": "variable", + "name": "unused", + "source_mapping": { + "start": 44, + "length": 14, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-state/0.6.11/unused_state.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-state/0.6.11/unused_state.sol", + "is_dependency": false, + "lines": [ + 4 + ], + "starting_column": 5, + "ending_column": 19 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 28, + "length": 114, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-state/0.6.11/unused_state.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-state/0.6.11/unused_state.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "contract", + "name": "B", + "source_mapping": { + "start": 144, + "length": 78, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-state/0.6.11/unused_state.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-state/0.6.11/unused_state.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + } + ], + "description": "A.unused (tests/detectors/unused-state/0.6.11/unused_state.sol#4) is never used in B (tests/detectors/unused-state/0.6.11/unused_state.sol#11-16)\n", + "markdown": "[A.unused](tests/detectors/unused-state/0.6.11/unused_state.sol#L4) is never used in [B](tests/detectors/unused-state/0.6.11/unused_state.sol#L11-L16)\n", + "id": "195279490862ae355bac3d27d0cdb1aa18200a5daed8f3dbd84dc5b120e29482", + "check": "unused-state", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "unused2", + "source_mapping": { + "start": 64, + "length": 15, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-state/0.6.11/unused_state.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-state/0.6.11/unused_state.sol", + "is_dependency": false, + "lines": [ + 5 + ], + "starting_column": 5, + "ending_column": 20 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 28, + "length": 114, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-state/0.6.11/unused_state.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-state/0.6.11/unused_state.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "contract", + "name": "B", + "source_mapping": { + "start": 144, + "length": 78, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-state/0.6.11/unused_state.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-state/0.6.11/unused_state.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + } + ], + "description": "A.unused2 (tests/detectors/unused-state/0.6.11/unused_state.sol#5) is never used in B (tests/detectors/unused-state/0.6.11/unused_state.sol#11-16)\n", + "markdown": "[A.unused2](tests/detectors/unused-state/0.6.11/unused_state.sol#L5) is never used in [B](tests/detectors/unused-state/0.6.11/unused_state.sol#L11-L16)\n", + "id": "886250d01813743573f3d311b742e0f818e0012ccbf8ad97738c029fd129d870", + "check": "unused-state", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "unused3", + "source_mapping": { + "start": 85, + "length": 15, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-state/0.6.11/unused_state.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-state/0.6.11/unused_state.sol", + "is_dependency": false, + "lines": [ + 6 + ], + "starting_column": 5, + "ending_column": 20 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 28, + "length": 114, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-state/0.6.11/unused_state.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-state/0.6.11/unused_state.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "contract", + "name": "B", + "source_mapping": { + "start": 144, + "length": 78, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-state/0.6.11/unused_state.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-state/0.6.11/unused_state.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + } + ], + "description": "A.unused3 (tests/detectors/unused-state/0.6.11/unused_state.sol#6) is never used in B (tests/detectors/unused-state/0.6.11/unused_state.sol#11-16)\n", + "markdown": "[A.unused3](tests/detectors/unused-state/0.6.11/unused_state.sol#L6) is never used in [B](tests/detectors/unused-state/0.6.11/unused_state.sol#L11-L16)\n", + "id": "e2ac51590509d97ff791ce50d9a711fc5ad01c20d23eacf6fb31939bd91b9f48", + "check": "unused-state", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "unused4", + "source_mapping": { + "start": 106, + "length": 15, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-state/0.6.11/unused_state.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-state/0.6.11/unused_state.sol", + "is_dependency": false, + "lines": [ + 7 + ], + "starting_column": 5, + "ending_column": 20 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "A", + "source_mapping": { + "start": 28, + "length": 114, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-state/0.6.11/unused_state.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-state/0.6.11/unused_state.sol", + "is_dependency": false, + "lines": [ + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "starting_column": 1, + "ending_column": 2 + } + } + } + }, + { + "type": "contract", + "name": "B", + "source_mapping": { + "start": 144, + "length": 78, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-state/0.6.11/unused_state.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-state/0.6.11/unused_state.sol", + "is_dependency": false, + "lines": [ + 11, + 12, + 13, + 14, + 15, + 16 + ], + "starting_column": 1, + "ending_column": 2 + } + } + ], + "description": "A.unused4 (tests/detectors/unused-state/0.6.11/unused_state.sol#7) is never used in B (tests/detectors/unused-state/0.6.11/unused_state.sol#11-16)\n", + "markdown": "[A.unused4](tests/detectors/unused-state/0.6.11/unused_state.sol#L7) is never used in [B](tests/detectors/unused-state/0.6.11/unused_state.sol#L11-L16)\n", + "id": "562d3e6a04f6f6068c3e4f0c074ecdbcff87929e43ec6fbeb6c088e715f63cf2", + "check": "unused-state", + "impact": "Informational", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/unused-state/0.7.6/unused_state.sol b/tests/detectors/unused-state/0.7.6/unused_state.sol new file mode 100644 index 0000000000..b603f88755 --- /dev/null +++ b/tests/detectors/unused-state/0.7.6/unused_state.sol @@ -0,0 +1,16 @@ +//pragma solidity ^0.4.24; + +contract A{ + address unused; + address unused2; + address unused3; + address unused4; + address used; +} + +contract B is A{ + + fallback () external{ + used = address(0); + } +} diff --git a/tests/detectors/unused-state/unused_state.sol.0.5.1.UnusedStateVars.json b/tests/detectors/unused-state/0.7.6/unused_state.sol.0.7.6.UnusedStateVars.json similarity index 87% rename from tests/detectors/unused-state/unused_state.sol.0.5.1.UnusedStateVars.json rename to tests/detectors/unused-state/0.7.6/unused_state.sol.0.7.6.UnusedStateVars.json index ef39332a7d..bb0efa2541 100644 --- a/tests/detectors/unused-state/unused_state.sol.0.5.1.UnusedStateVars.json +++ b/tests/detectors/unused-state/0.7.6/unused_state.sol.0.7.6.UnusedStateVars.json @@ -9,9 +9,9 @@ "start": 44, "length": 14, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-state/unused_state.sol", + "filename_relative": "tests/detectors/unused-state/0.7.6/unused_state.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-state/unused_state.sol", + "filename_short": "tests/detectors/unused-state/0.7.6/unused_state.sol", "is_dependency": false, "lines": [ 4 @@ -27,9 +27,9 @@ "start": 28, "length": 114, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-state/unused_state.sol", + "filename_relative": "tests/detectors/unused-state/0.7.6/unused_state.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-state/unused_state.sol", + "filename_short": "tests/detectors/unused-state/0.7.6/unused_state.sol", "is_dependency": false, "lines": [ 3, @@ -53,9 +53,9 @@ "start": 144, "length": 78, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-state/unused_state.sol", + "filename_relative": "tests/detectors/unused-state/0.7.6/unused_state.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-state/unused_state.sol", + "filename_short": "tests/detectors/unused-state/0.7.6/unused_state.sol", "is_dependency": false, "lines": [ 11, @@ -70,8 +70,8 @@ } } ], - "description": "A.unused (tests/detectors/unused-state/unused_state.sol#4) is never used in B (tests/detectors/unused-state/unused_state.sol#11-16)\n", - "markdown": "[A.unused](tests/detectors/unused-state/unused_state.sol#L4) is never used in [B](tests/detectors/unused-state/unused_state.sol#L11-L16)\n", + "description": "A.unused (tests/detectors/unused-state/0.7.6/unused_state.sol#4) is never used in B (tests/detectors/unused-state/0.7.6/unused_state.sol#11-16)\n", + "markdown": "[A.unused](tests/detectors/unused-state/0.7.6/unused_state.sol#L4) is never used in [B](tests/detectors/unused-state/0.7.6/unused_state.sol#L11-L16)\n", "id": "195279490862ae355bac3d27d0cdb1aa18200a5daed8f3dbd84dc5b120e29482", "check": "unused-state", "impact": "Informational", @@ -86,9 +86,9 @@ "start": 64, "length": 15, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-state/unused_state.sol", + "filename_relative": "tests/detectors/unused-state/0.7.6/unused_state.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-state/unused_state.sol", + "filename_short": "tests/detectors/unused-state/0.7.6/unused_state.sol", "is_dependency": false, "lines": [ 5 @@ -104,9 +104,9 @@ "start": 28, "length": 114, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-state/unused_state.sol", + "filename_relative": "tests/detectors/unused-state/0.7.6/unused_state.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-state/unused_state.sol", + "filename_short": "tests/detectors/unused-state/0.7.6/unused_state.sol", "is_dependency": false, "lines": [ 3, @@ -130,9 +130,9 @@ "start": 144, "length": 78, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-state/unused_state.sol", + "filename_relative": "tests/detectors/unused-state/0.7.6/unused_state.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-state/unused_state.sol", + "filename_short": "tests/detectors/unused-state/0.7.6/unused_state.sol", "is_dependency": false, "lines": [ 11, @@ -147,8 +147,8 @@ } } ], - "description": "A.unused2 (tests/detectors/unused-state/unused_state.sol#5) is never used in B (tests/detectors/unused-state/unused_state.sol#11-16)\n", - "markdown": "[A.unused2](tests/detectors/unused-state/unused_state.sol#L5) is never used in [B](tests/detectors/unused-state/unused_state.sol#L11-L16)\n", + "description": "A.unused2 (tests/detectors/unused-state/0.7.6/unused_state.sol#5) is never used in B (tests/detectors/unused-state/0.7.6/unused_state.sol#11-16)\n", + "markdown": "[A.unused2](tests/detectors/unused-state/0.7.6/unused_state.sol#L5) is never used in [B](tests/detectors/unused-state/0.7.6/unused_state.sol#L11-L16)\n", "id": "886250d01813743573f3d311b742e0f818e0012ccbf8ad97738c029fd129d870", "check": "unused-state", "impact": "Informational", @@ -163,9 +163,9 @@ "start": 85, "length": 15, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-state/unused_state.sol", + "filename_relative": "tests/detectors/unused-state/0.7.6/unused_state.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-state/unused_state.sol", + "filename_short": "tests/detectors/unused-state/0.7.6/unused_state.sol", "is_dependency": false, "lines": [ 6 @@ -181,9 +181,9 @@ "start": 28, "length": 114, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-state/unused_state.sol", + "filename_relative": "tests/detectors/unused-state/0.7.6/unused_state.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-state/unused_state.sol", + "filename_short": "tests/detectors/unused-state/0.7.6/unused_state.sol", "is_dependency": false, "lines": [ 3, @@ -207,9 +207,9 @@ "start": 144, "length": 78, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-state/unused_state.sol", + "filename_relative": "tests/detectors/unused-state/0.7.6/unused_state.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-state/unused_state.sol", + "filename_short": "tests/detectors/unused-state/0.7.6/unused_state.sol", "is_dependency": false, "lines": [ 11, @@ -224,8 +224,8 @@ } } ], - "description": "A.unused3 (tests/detectors/unused-state/unused_state.sol#6) is never used in B (tests/detectors/unused-state/unused_state.sol#11-16)\n", - "markdown": "[A.unused3](tests/detectors/unused-state/unused_state.sol#L6) is never used in [B](tests/detectors/unused-state/unused_state.sol#L11-L16)\n", + "description": "A.unused3 (tests/detectors/unused-state/0.7.6/unused_state.sol#6) is never used in B (tests/detectors/unused-state/0.7.6/unused_state.sol#11-16)\n", + "markdown": "[A.unused3](tests/detectors/unused-state/0.7.6/unused_state.sol#L6) is never used in [B](tests/detectors/unused-state/0.7.6/unused_state.sol#L11-L16)\n", "id": "e2ac51590509d97ff791ce50d9a711fc5ad01c20d23eacf6fb31939bd91b9f48", "check": "unused-state", "impact": "Informational", @@ -240,9 +240,9 @@ "start": 106, "length": 15, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-state/unused_state.sol", + "filename_relative": "tests/detectors/unused-state/0.7.6/unused_state.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-state/unused_state.sol", + "filename_short": "tests/detectors/unused-state/0.7.6/unused_state.sol", "is_dependency": false, "lines": [ 7 @@ -258,9 +258,9 @@ "start": 28, "length": 114, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-state/unused_state.sol", + "filename_relative": "tests/detectors/unused-state/0.7.6/unused_state.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-state/unused_state.sol", + "filename_short": "tests/detectors/unused-state/0.7.6/unused_state.sol", "is_dependency": false, "lines": [ 3, @@ -284,9 +284,9 @@ "start": 144, "length": 78, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-state/unused_state.sol", + "filename_relative": "tests/detectors/unused-state/0.7.6/unused_state.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-state/unused_state.sol", + "filename_short": "tests/detectors/unused-state/0.7.6/unused_state.sol", "is_dependency": false, "lines": [ 11, @@ -301,8 +301,8 @@ } } ], - "description": "A.unused4 (tests/detectors/unused-state/unused_state.sol#7) is never used in B (tests/detectors/unused-state/unused_state.sol#11-16)\n", - "markdown": "[A.unused4](tests/detectors/unused-state/unused_state.sol#L7) is never used in [B](tests/detectors/unused-state/unused_state.sol#L11-L16)\n", + "description": "A.unused4 (tests/detectors/unused-state/0.7.6/unused_state.sol#7) is never used in B (tests/detectors/unused-state/0.7.6/unused_state.sol#11-16)\n", + "markdown": "[A.unused4](tests/detectors/unused-state/0.7.6/unused_state.sol#L7) is never used in [B](tests/detectors/unused-state/0.7.6/unused_state.sol#L11-L16)\n", "id": "562d3e6a04f6f6068c3e4f0c074ecdbcff87929e43ec6fbeb6c088e715f63cf2", "check": "unused-state", "impact": "Informational", diff --git a/tests/detectors/variable-scope/predeclaration_usage_local.sol b/tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol similarity index 100% rename from tests/detectors/variable-scope/predeclaration_usage_local.sol rename to tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol diff --git a/tests/detectors/variable-scope/predeclaration_usage_local.sol.0.4.25.PredeclarationUsageLocal.json b/tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol.0.4.25.PredeclarationUsageLocal.json similarity index 88% rename from tests/detectors/variable-scope/predeclaration_usage_local.sol.0.4.25.PredeclarationUsageLocal.json rename to tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol.0.4.25.PredeclarationUsageLocal.json index 928febf8a5..c298e28cb8 100644 --- a/tests/detectors/variable-scope/predeclaration_usage_local.sol.0.4.25.PredeclarationUsageLocal.json +++ b/tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol.0.4.25.PredeclarationUsageLocal.json @@ -9,9 +9,9 @@ "start": 130, "length": 10, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 5 @@ -27,9 +27,9 @@ "start": 17, "length": 442, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 2, @@ -60,9 +60,9 @@ "start": 0, "length": 461, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 1, @@ -101,9 +101,9 @@ "start": 17, "length": 442, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 2, @@ -134,9 +134,9 @@ "start": 0, "length": 461, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 1, @@ -173,9 +173,9 @@ "start": 69, "length": 13, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 4 @@ -191,9 +191,9 @@ "start": 17, "length": 442, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 2, @@ -224,9 +224,9 @@ "start": 0, "length": 461, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 1, @@ -259,9 +259,9 @@ } } ], - "description": "Variable 'C.f(uint256).x (tests/detectors/variable-scope/predeclaration_usage_local.sol#5)' in C.f(uint256) (tests/detectors/variable-scope/predeclaration_usage_local.sol#2-17) potentially used before declaration: y = x + 9 + z (tests/detectors/variable-scope/predeclaration_usage_local.sol#4)\n", - "markdown": "Variable '[C.f(uint256).x](tests/detectors/variable-scope/predeclaration_usage_local.sol#L5)' in [C.f(uint256)](tests/detectors/variable-scope/predeclaration_usage_local.sol#L2-L17) potentially used before declaration: [y = x + 9 + z](tests/detectors/variable-scope/predeclaration_usage_local.sol#L4)\n", - "id": "ae8657e5e605f868abb11f4568aa1cc99ccd0bd9ba4840bc7d5172e5fd6da165", + "description": "Variable 'C.f(uint256).x (tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#5)' in C.f(uint256) (tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#2-17) potentially used before declaration: y = x + 9 + z (tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#4)\n", + "markdown": "Variable '[C.f(uint256).x](tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#L5)' in [C.f(uint256)](tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#L2-L17) potentially used before declaration: [y = x + 9 + z](tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#L4)\n", + "id": "ede1e902fdfe70c5e7cf91f33df8540f1d15952d00f70a9a5dfb9edbcbe49cb6", "check": "variable-scope", "impact": "Low", "confidence": "High" @@ -275,9 +275,9 @@ "start": 199, "length": 11, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 8 @@ -293,9 +293,9 @@ "start": 17, "length": 442, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 2, @@ -326,9 +326,9 @@ "start": 0, "length": 461, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 1, @@ -367,9 +367,9 @@ "start": 17, "length": 442, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 2, @@ -400,9 +400,9 @@ "start": 0, "length": 461, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 1, @@ -439,9 +439,9 @@ "start": 402, "length": 6, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 14 @@ -457,9 +457,9 @@ "start": 17, "length": 442, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 2, @@ -490,9 +490,9 @@ "start": 0, "length": 461, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 1, @@ -525,9 +525,9 @@ } } ], - "description": "Variable 'C.f(uint256).i (tests/detectors/variable-scope/predeclaration_usage_local.sol#8)' in C.f(uint256) (tests/detectors/variable-scope/predeclaration_usage_local.sol#2-17) potentially used before declaration: i = 10 (tests/detectors/variable-scope/predeclaration_usage_local.sol#14)\n", - "markdown": "Variable '[C.f(uint256).i](tests/detectors/variable-scope/predeclaration_usage_local.sol#L8)' in [C.f(uint256)](tests/detectors/variable-scope/predeclaration_usage_local.sol#L2-L17) potentially used before declaration: [i = 10](tests/detectors/variable-scope/predeclaration_usage_local.sol#L14)\n", - "id": "16da9fedd4973449139402e4298178b35fd9fb1eb4d9dc85148790e742729ee4", + "description": "Variable 'C.f(uint256).i (tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#8)' in C.f(uint256) (tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#2-17) potentially used before declaration: i = 10 (tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#14)\n", + "markdown": "Variable '[C.f(uint256).i](tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#L8)' in [C.f(uint256)](tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#L2-L17) potentially used before declaration: [i = 10](tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#L14)\n", + "id": "940660958df422ffbfe30b13d535439b2cb3f84146a23034087228c4e9016d75", "check": "variable-scope", "impact": "Low", "confidence": "High" @@ -541,9 +541,9 @@ "start": 199, "length": 11, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 8 @@ -559,9 +559,9 @@ "start": 17, "length": 442, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 2, @@ -592,9 +592,9 @@ "start": 0, "length": 461, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 1, @@ -633,9 +633,9 @@ "start": 17, "length": 442, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 2, @@ -666,9 +666,9 @@ "start": 0, "length": 461, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 1, @@ -705,9 +705,9 @@ "start": 410, "length": 5, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 14 @@ -723,9 +723,9 @@ "start": 17, "length": 442, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 2, @@ -756,9 +756,9 @@ "start": 0, "length": 461, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 1, @@ -791,9 +791,9 @@ } } ], - "description": "Variable 'C.f(uint256).i (tests/detectors/variable-scope/predeclaration_usage_local.sol#8)' in C.f(uint256) (tests/detectors/variable-scope/predeclaration_usage_local.sol#2-17) potentially used before declaration: i > 0 (tests/detectors/variable-scope/predeclaration_usage_local.sol#14)\n", - "markdown": "Variable '[C.f(uint256).i](tests/detectors/variable-scope/predeclaration_usage_local.sol#L8)' in [C.f(uint256)](tests/detectors/variable-scope/predeclaration_usage_local.sol#L2-L17) potentially used before declaration: [i > 0](tests/detectors/variable-scope/predeclaration_usage_local.sol#L14)\n", - "id": "1645f4a9be79ab45d3fcb98b1b147212ee01517980a084481c9b26be36fb0d46", + "description": "Variable 'C.f(uint256).i (tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#8)' in C.f(uint256) (tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#2-17) potentially used before declaration: i > 0 (tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#14)\n", + "markdown": "Variable '[C.f(uint256).i](tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#L8)' in [C.f(uint256)](tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#L2-L17) potentially used before declaration: [i > 0](tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#L14)\n", + "id": "ffb778e86e0b11beed38687c3abf9ffd0de948ec4ccc0109a78954741220de9e", "check": "variable-scope", "impact": "Low", "confidence": "High" @@ -807,9 +807,9 @@ "start": 199, "length": 11, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 8 @@ -825,9 +825,9 @@ "start": 17, "length": 442, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 2, @@ -858,9 +858,9 @@ "start": 0, "length": 461, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 1, @@ -899,9 +899,9 @@ "start": 17, "length": 442, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 2, @@ -932,9 +932,9 @@ "start": 0, "length": 461, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 1, @@ -971,9 +971,9 @@ "start": 436, "length": 6, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 15 @@ -989,9 +989,9 @@ "start": 17, "length": 442, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 2, @@ -1022,9 +1022,9 @@ "start": 0, "length": 461, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 1, @@ -1057,9 +1057,9 @@ } } ], - "description": "Variable 'C.f(uint256).i (tests/detectors/variable-scope/predeclaration_usage_local.sol#8)' in C.f(uint256) (tests/detectors/variable-scope/predeclaration_usage_local.sol#2-17) potentially used before declaration: x += i (tests/detectors/variable-scope/predeclaration_usage_local.sol#15)\n", - "markdown": "Variable '[C.f(uint256).i](tests/detectors/variable-scope/predeclaration_usage_local.sol#L8)' in [C.f(uint256)](tests/detectors/variable-scope/predeclaration_usage_local.sol#L2-L17) potentially used before declaration: [x += i](tests/detectors/variable-scope/predeclaration_usage_local.sol#L15)\n", - "id": "1f58314c394d14558a0268c5241e448c32d6d74dcadc9a22dcd14b5a09fcbe0d", + "description": "Variable 'C.f(uint256).i (tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#8)' in C.f(uint256) (tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#2-17) potentially used before declaration: x += i (tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#15)\n", + "markdown": "Variable '[C.f(uint256).i](tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#L8)' in [C.f(uint256)](tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#L2-L17) potentially used before declaration: [x += i](tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#L15)\n", + "id": "e346a217ae6931f9fa7ff70302d05db17c0422dd4272f87935b633950239b592", "check": "variable-scope", "impact": "Low", "confidence": "High" @@ -1073,9 +1073,9 @@ "start": 199, "length": 11, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 8 @@ -1091,9 +1091,9 @@ "start": 17, "length": 442, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 2, @@ -1124,9 +1124,9 @@ "start": 0, "length": 461, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 1, @@ -1165,9 +1165,9 @@ "start": 17, "length": 442, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 2, @@ -1198,9 +1198,9 @@ "start": 0, "length": 461, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 1, @@ -1237,9 +1237,9 @@ "start": 417, "length": 3, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 14 @@ -1255,9 +1255,9 @@ "start": 17, "length": 442, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 2, @@ -1288,9 +1288,9 @@ "start": 0, "length": 461, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_relative": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "filename_short": "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "is_dependency": false, "lines": [ 1, @@ -1323,9 +1323,9 @@ } } ], - "description": "Variable 'C.f(uint256).i (tests/detectors/variable-scope/predeclaration_usage_local.sol#8)' in C.f(uint256) (tests/detectors/variable-scope/predeclaration_usage_local.sol#2-17) potentially used before declaration: i -- (tests/detectors/variable-scope/predeclaration_usage_local.sol#14)\n", - "markdown": "Variable '[C.f(uint256).i](tests/detectors/variable-scope/predeclaration_usage_local.sol#L8)' in [C.f(uint256)](tests/detectors/variable-scope/predeclaration_usage_local.sol#L2-L17) potentially used before declaration: [i --](tests/detectors/variable-scope/predeclaration_usage_local.sol#L14)\n", - "id": "a9a523e5ffe2ef3e4ae3fe06e6b411b269e804e071b5e04cd68cd2f942156cbb", + "description": "Variable 'C.f(uint256).i (tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#8)' in C.f(uint256) (tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#2-17) potentially used before declaration: i -- (tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#14)\n", + "markdown": "Variable '[C.f(uint256).i](tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#L8)' in [C.f(uint256)](tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#L2-L17) potentially used before declaration: [i --](tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol#L14)\n", + "id": "24ed055a29ee9bac066b9a99a36d40f7bd77314605d8f1a6440a5576a38b24fb", "check": "variable-scope", "impact": "Low", "confidence": "High" diff --git a/tests/detectors/void-cst/void-cst.sol b/tests/detectors/void-cst/0.4.25/void-cst.sol similarity index 100% rename from tests/detectors/void-cst/void-cst.sol rename to tests/detectors/void-cst/0.4.25/void-cst.sol diff --git a/tests/detectors/void-cst/0.4.25/void-cst.sol.0.4.25.VoidConstructor.json b/tests/detectors/void-cst/0.4.25/void-cst.sol.0.4.25.VoidConstructor.json new file mode 100644 index 0000000000..b43a4776c9 --- /dev/null +++ b/tests/detectors/void-cst/0.4.25/void-cst.sol.0.4.25.VoidConstructor.json @@ -0,0 +1,128 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "constructor", + "source_mapping": { + "start": 41, + "length": 32, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/void-cst/0.4.25/void-cst.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/void-cst/0.4.25/void-cst.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "D", + "source_mapping": { + "start": 19, + "length": 57, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/void-cst/0.4.25/void-cst.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/void-cst/0.4.25/void-cst.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "constructor()" + } + }, + { + "type": "node", + "name": "C()", + "source_mapping": { + "start": 62, + "length": 3, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/void-cst/0.4.25/void-cst.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/void-cst/0.4.25/void-cst.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 26, + "ending_column": 29 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "constructor", + "source_mapping": { + "start": 41, + "length": 32, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/void-cst/0.4.25/void-cst.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/void-cst/0.4.25/void-cst.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "D", + "source_mapping": { + "start": 19, + "length": 57, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/void-cst/0.4.25/void-cst.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/void-cst/0.4.25/void-cst.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "constructor()" + } + } + } + } + ], + "description": "Void constructor called in D.constructor() (tests/detectors/void-cst/0.4.25/void-cst.sol#10-12):\n\t- C() (tests/detectors/void-cst/0.4.25/void-cst.sol#10)\n", + "markdown": "Void constructor called in [D.constructor()](tests/detectors/void-cst/0.4.25/void-cst.sol#L10-L12):\n\t- [C()](tests/detectors/void-cst/0.4.25/void-cst.sol#L10)\n", + "id": "7681f77ce859599a0a88c8ba4dc60b6d55c064eca36867236bb157cbf2b65392", + "check": "void-cst", + "impact": "Low", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/void-cst/0.5.16/void-cst.sol b/tests/detectors/void-cst/0.5.16/void-cst.sol new file mode 100644 index 0000000000..43edc9d9a3 --- /dev/null +++ b/tests/detectors/void-cst/0.5.16/void-cst.sol @@ -0,0 +1,14 @@ + + +contract C{ + + +} + +contract D is C{ + + constructor() public C(){ + + } + +} diff --git a/tests/detectors/void-cst/0.5.16/void-cst.sol.0.5.16.VoidConstructor.json b/tests/detectors/void-cst/0.5.16/void-cst.sol.0.5.16.VoidConstructor.json new file mode 100644 index 0000000000..3eecef068d --- /dev/null +++ b/tests/detectors/void-cst/0.5.16/void-cst.sol.0.5.16.VoidConstructor.json @@ -0,0 +1,128 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "constructor", + "source_mapping": { + "start": 41, + "length": 32, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/void-cst/0.5.16/void-cst.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/void-cst/0.5.16/void-cst.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "D", + "source_mapping": { + "start": 19, + "length": 57, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/void-cst/0.5.16/void-cst.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/void-cst/0.5.16/void-cst.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "constructor()" + } + }, + { + "type": "node", + "name": "C()", + "source_mapping": { + "start": 62, + "length": 3, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/void-cst/0.5.16/void-cst.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/void-cst/0.5.16/void-cst.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 26, + "ending_column": 29 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "constructor", + "source_mapping": { + "start": 41, + "length": 32, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/void-cst/0.5.16/void-cst.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/void-cst/0.5.16/void-cst.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "D", + "source_mapping": { + "start": 19, + "length": 57, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/void-cst/0.5.16/void-cst.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/void-cst/0.5.16/void-cst.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "constructor()" + } + } + } + } + ], + "description": "Void constructor called in D.constructor() (tests/detectors/void-cst/0.5.16/void-cst.sol#10-12):\n\t- C() (tests/detectors/void-cst/0.5.16/void-cst.sol#10)\n", + "markdown": "Void constructor called in [D.constructor()](tests/detectors/void-cst/0.5.16/void-cst.sol#L10-L12):\n\t- [C()](tests/detectors/void-cst/0.5.16/void-cst.sol#L10)\n", + "id": "205eb5189a286fb251c8bfdf19fdd45acfab353670b5af81be434e43fbf1259f", + "check": "void-cst", + "impact": "Low", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/void-cst/0.6.11/void-cst.sol b/tests/detectors/void-cst/0.6.11/void-cst.sol new file mode 100644 index 0000000000..43edc9d9a3 --- /dev/null +++ b/tests/detectors/void-cst/0.6.11/void-cst.sol @@ -0,0 +1,14 @@ + + +contract C{ + + +} + +contract D is C{ + + constructor() public C(){ + + } + +} diff --git a/tests/detectors/void-cst/0.6.11/void-cst.sol.0.6.11.VoidConstructor.json b/tests/detectors/void-cst/0.6.11/void-cst.sol.0.6.11.VoidConstructor.json new file mode 100644 index 0000000000..30d6efa680 --- /dev/null +++ b/tests/detectors/void-cst/0.6.11/void-cst.sol.0.6.11.VoidConstructor.json @@ -0,0 +1,128 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "constructor", + "source_mapping": { + "start": 41, + "length": 32, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/void-cst/0.6.11/void-cst.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/void-cst/0.6.11/void-cst.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "D", + "source_mapping": { + "start": 19, + "length": 57, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/void-cst/0.6.11/void-cst.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/void-cst/0.6.11/void-cst.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "constructor()" + } + }, + { + "type": "node", + "name": "C()", + "source_mapping": { + "start": 62, + "length": 3, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/void-cst/0.6.11/void-cst.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/void-cst/0.6.11/void-cst.sol", + "is_dependency": false, + "lines": [ + 10 + ], + "starting_column": 26, + "ending_column": 29 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "constructor", + "source_mapping": { + "start": 41, + "length": 32, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/void-cst/0.6.11/void-cst.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/void-cst/0.6.11/void-cst.sol", + "is_dependency": false, + "lines": [ + 10, + 11, + 12 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "D", + "source_mapping": { + "start": 19, + "length": 57, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/void-cst/0.6.11/void-cst.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/void-cst/0.6.11/void-cst.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10, + 11, + 12, + 13, + 14 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "constructor()" + } + } + } + } + ], + "description": "Void constructor called in D.constructor() (tests/detectors/void-cst/0.6.11/void-cst.sol#10-12):\n\t- C() (tests/detectors/void-cst/0.6.11/void-cst.sol#10)\n", + "markdown": "Void constructor called in [D.constructor()](tests/detectors/void-cst/0.6.11/void-cst.sol#L10-L12):\n\t- [C()](tests/detectors/void-cst/0.6.11/void-cst.sol#L10)\n", + "id": "ad3ebdf765f3b6e552dc65d3fd2e92ec13535139316d1063cd76bb521b265bd7", + "check": "void-cst", + "impact": "Low", + "confidence": "High" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/void-cst/0.7.6/void-cst.sol b/tests/detectors/void-cst/0.7.6/void-cst.sol new file mode 100644 index 0000000000..43edc9d9a3 --- /dev/null +++ b/tests/detectors/void-cst/0.7.6/void-cst.sol @@ -0,0 +1,14 @@ + + +contract C{ + + +} + +contract D is C{ + + constructor() public C(){ + + } + +} diff --git a/tests/detectors/void-cst/void-cst.sol.0.5.1.VoidConstructor.json b/tests/detectors/void-cst/0.7.6/void-cst.sol.0.7.6.VoidConstructor.json similarity index 89% rename from tests/detectors/void-cst/void-cst.sol.0.5.1.VoidConstructor.json rename to tests/detectors/void-cst/0.7.6/void-cst.sol.0.7.6.VoidConstructor.json index 4280b9cf50..b678107290 100644 --- a/tests/detectors/void-cst/void-cst.sol.0.5.1.VoidConstructor.json +++ b/tests/detectors/void-cst/0.7.6/void-cst.sol.0.7.6.VoidConstructor.json @@ -9,9 +9,9 @@ "start": 41, "length": 32, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/void-cst/void-cst.sol", + "filename_relative": "tests/detectors/void-cst/0.7.6/void-cst.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/void-cst/void-cst.sol", + "filename_short": "tests/detectors/void-cst/0.7.6/void-cst.sol", "is_dependency": false, "lines": [ 10, @@ -29,9 +29,9 @@ "start": 19, "length": 57, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/void-cst/void-cst.sol", + "filename_relative": "tests/detectors/void-cst/0.7.6/void-cst.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/void-cst/void-cst.sol", + "filename_short": "tests/detectors/void-cst/0.7.6/void-cst.sol", "is_dependency": false, "lines": [ 8, @@ -56,9 +56,9 @@ "start": 62, "length": 3, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/void-cst/void-cst.sol", + "filename_relative": "tests/detectors/void-cst/0.7.6/void-cst.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/void-cst/void-cst.sol", + "filename_short": "tests/detectors/void-cst/0.7.6/void-cst.sol", "is_dependency": false, "lines": [ 10 @@ -74,9 +74,9 @@ "start": 41, "length": 32, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/void-cst/void-cst.sol", + "filename_relative": "tests/detectors/void-cst/0.7.6/void-cst.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/void-cst/void-cst.sol", + "filename_short": "tests/detectors/void-cst/0.7.6/void-cst.sol", "is_dependency": false, "lines": [ 10, @@ -94,9 +94,9 @@ "start": 19, "length": 57, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/void-cst/void-cst.sol", + "filename_relative": "tests/detectors/void-cst/0.7.6/void-cst.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/void-cst/void-cst.sol", + "filename_short": "tests/detectors/void-cst/0.7.6/void-cst.sol", "is_dependency": false, "lines": [ 8, @@ -117,9 +117,9 @@ } } ], - "description": "Void constructor called in D.constructor() (tests/detectors/void-cst/void-cst.sol#10-12):\n\t- C() (tests/detectors/void-cst/void-cst.sol#10)\n", - "markdown": "Void constructor called in [D.constructor()](tests/detectors/void-cst/void-cst.sol#L10-L12):\n\t- [C()](tests/detectors/void-cst/void-cst.sol#L10)\n", - "id": "f3dacabc6aa95b22e6d535c4de48393d830fb3d4f0df012f649c851b4958209e", + "description": "Void constructor called in D.constructor() (tests/detectors/void-cst/0.7.6/void-cst.sol#10-12):\n\t- C() (tests/detectors/void-cst/0.7.6/void-cst.sol#10)\n", + "markdown": "Void constructor called in [D.constructor()](tests/detectors/void-cst/0.7.6/void-cst.sol#L10-L12):\n\t- [C()](tests/detectors/void-cst/0.7.6/void-cst.sol#L10)\n", + "id": "deffcf2d974f53d4993c8cb12ada6abdb84e44ceea422e2261068e4fb2e663ac", "check": "void-cst", "impact": "Low", "confidence": "High" diff --git a/tests/detectors/weak-prng/bad_prng.sol b/tests/detectors/weak-prng/0.4.25/bad_prng.sol similarity index 100% rename from tests/detectors/weak-prng/bad_prng.sol rename to tests/detectors/weak-prng/0.4.25/bad_prng.sol diff --git a/tests/detectors/weak-prng/bad_prng.sol.0.4.25.BadPRNG.json b/tests/detectors/weak-prng/0.4.25/bad_prng.sol.0.4.25.BadPRNG.json similarity index 91% rename from tests/detectors/weak-prng/bad_prng.sol.0.4.25.BadPRNG.json rename to tests/detectors/weak-prng/0.4.25/bad_prng.sol.0.4.25.BadPRNG.json index ab9be4e251..8e2d0e2747 100644 --- a/tests/detectors/weak-prng/bad_prng.sol.0.4.25.BadPRNG.json +++ b/tests/detectors/weak-prng/0.4.25/bad_prng.sol.0.4.25.BadPRNG.json @@ -9,9 +9,9 @@ "start": 45, "length": 68, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/weak-prng/bad_prng.sol", + "filename_relative": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/weak-prng/bad_prng.sol", + "filename_short": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "is_dependency": false, "lines": [ 4, @@ -29,9 +29,9 @@ "start": 0, "length": 499, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/weak-prng/bad_prng.sol", + "filename_relative": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/weak-prng/bad_prng.sol", + "filename_short": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "is_dependency": false, "lines": [ 1, @@ -76,9 +76,9 @@ "start": 77, "length": 29, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/weak-prng/bad_prng.sol", + "filename_relative": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/weak-prng/bad_prng.sol", + "filename_short": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "is_dependency": false, "lines": [ 5 @@ -94,9 +94,9 @@ "start": 45, "length": 68, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/weak-prng/bad_prng.sol", + "filename_relative": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/weak-prng/bad_prng.sol", + "filename_short": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "is_dependency": false, "lines": [ 4, @@ -114,9 +114,9 @@ "start": 0, "length": 499, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/weak-prng/bad_prng.sol", + "filename_relative": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/weak-prng/bad_prng.sol", + "filename_short": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "is_dependency": false, "lines": [ 1, @@ -157,9 +157,9 @@ } } ], - "description": "BadPRNG.bad0() (tests/detectors/weak-prng/bad_prng.sol#4-6) uses a weak PRNG: \"i = block.timestamp % 10 (tests/detectors/weak-prng/bad_prng.sol#5)\" \n", - "markdown": "[BadPRNG.bad0()](tests/detectors/weak-prng/bad_prng.sol#L4-L6) uses a weak PRNG: \"[i = block.timestamp % 10](tests/detectors/weak-prng/bad_prng.sol#L5)\" \n", - "id": "af624d9c7f3f688c1bad5ecaee81085e0d5cde4e6a55de34ff93684527619748", + "description": "BadPRNG.bad0() (tests/detectors/weak-prng/0.4.25/bad_prng.sol#4-6) uses a weak PRNG: \"i = block.timestamp % 10 (tests/detectors/weak-prng/0.4.25/bad_prng.sol#5)\" \n", + "markdown": "[BadPRNG.bad0()](tests/detectors/weak-prng/0.4.25/bad_prng.sol#L4-L6) uses a weak PRNG: \"[i = block.timestamp % 10](tests/detectors/weak-prng/0.4.25/bad_prng.sol#L5)\" \n", + "id": "fc717c512384a74aab058df35c032bca15e276f4e03446ad7b52f33acac1a556", "check": "weak-prng", "impact": "High", "confidence": "Medium" @@ -173,9 +173,9 @@ "start": 122, "length": 56, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/weak-prng/bad_prng.sol", + "filename_relative": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/weak-prng/bad_prng.sol", + "filename_short": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "is_dependency": false, "lines": [ 8, @@ -193,9 +193,9 @@ "start": 0, "length": 499, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/weak-prng/bad_prng.sol", + "filename_relative": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/weak-prng/bad_prng.sol", + "filename_short": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "is_dependency": false, "lines": [ 1, @@ -240,9 +240,9 @@ "start": 154, "length": 17, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/weak-prng/bad_prng.sol", + "filename_relative": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/weak-prng/bad_prng.sol", + "filename_short": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "is_dependency": false, "lines": [ 9 @@ -258,9 +258,9 @@ "start": 122, "length": 56, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/weak-prng/bad_prng.sol", + "filename_relative": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/weak-prng/bad_prng.sol", + "filename_short": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "is_dependency": false, "lines": [ 8, @@ -278,9 +278,9 @@ "start": 0, "length": 499, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/weak-prng/bad_prng.sol", + "filename_relative": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/weak-prng/bad_prng.sol", + "filename_short": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "is_dependency": false, "lines": [ 1, @@ -321,9 +321,9 @@ } } ], - "description": "BadPRNG.bad1() (tests/detectors/weak-prng/bad_prng.sol#8-10) uses a weak PRNG: \"i = now % 10 (tests/detectors/weak-prng/bad_prng.sol#9)\" \n", - "markdown": "[BadPRNG.bad1()](tests/detectors/weak-prng/bad_prng.sol#L8-L10) uses a weak PRNG: \"[i = now % 10](tests/detectors/weak-prng/bad_prng.sol#L9)\" \n", - "id": "fe07d1e4f27274570cfb85530c1cbf7fb7a9004f475b91d1a3762452b017e1b9", + "description": "BadPRNG.bad1() (tests/detectors/weak-prng/0.4.25/bad_prng.sol#8-10) uses a weak PRNG: \"i = now % 10 (tests/detectors/weak-prng/0.4.25/bad_prng.sol#9)\" \n", + "markdown": "[BadPRNG.bad1()](tests/detectors/weak-prng/0.4.25/bad_prng.sol#L8-L10) uses a weak PRNG: \"[i = now % 10](tests/detectors/weak-prng/0.4.25/bad_prng.sol#L9)\" \n", + "id": "b6c45323a90c31dea54db817de9a3d13e40431227ca6240465e43183004f6541", "check": "weak-prng", "impact": "High", "confidence": "Medium" @@ -337,9 +337,9 @@ "start": 184, "length": 78, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/weak-prng/bad_prng.sol", + "filename_relative": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/weak-prng/bad_prng.sol", + "filename_short": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "is_dependency": false, "lines": [ 12, @@ -357,9 +357,9 @@ "start": 0, "length": 499, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/weak-prng/bad_prng.sol", + "filename_relative": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/weak-prng/bad_prng.sol", + "filename_short": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "is_dependency": false, "lines": [ 1, @@ -404,9 +404,9 @@ "start": 216, "length": 39, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/weak-prng/bad_prng.sol", + "filename_relative": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/weak-prng/bad_prng.sol", + "filename_short": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "is_dependency": false, "lines": [ 13 @@ -422,9 +422,9 @@ "start": 184, "length": 78, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/weak-prng/bad_prng.sol", + "filename_relative": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/weak-prng/bad_prng.sol", + "filename_short": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "is_dependency": false, "lines": [ 12, @@ -442,9 +442,9 @@ "start": 0, "length": 499, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/weak-prng/bad_prng.sol", + "filename_relative": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/weak-prng/bad_prng.sol", + "filename_short": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "is_dependency": false, "lines": [ 1, @@ -485,9 +485,9 @@ } } ], - "description": "BadPRNG.bad2() (tests/detectors/weak-prng/bad_prng.sol#12-14) uses a weak PRNG: \"i = uint256(blockhash(uint256)(10000)) % 10 (tests/detectors/weak-prng/bad_prng.sol#13)\" \n", - "markdown": "[BadPRNG.bad2()](tests/detectors/weak-prng/bad_prng.sol#L12-L14) uses a weak PRNG: \"[i = uint256(blockhash(uint256)(10000)) % 10](tests/detectors/weak-prng/bad_prng.sol#L13)\" \n", - "id": "100d285386f797a469c6797fcce41350b1984f7e7aab1532580d9b69a774b6f5", + "description": "BadPRNG.bad2() (tests/detectors/weak-prng/0.4.25/bad_prng.sol#12-14) uses a weak PRNG: \"i = uint256(blockhash(uint256)(10000)) % 10 (tests/detectors/weak-prng/0.4.25/bad_prng.sol#13)\" \n", + "markdown": "[BadPRNG.bad2()](tests/detectors/weak-prng/0.4.25/bad_prng.sol#L12-L14) uses a weak PRNG: \"[i = uint256(blockhash(uint256)(10000)) % 10](tests/detectors/weak-prng/0.4.25/bad_prng.sol#L13)\" \n", + "id": "4ac936f85dc1e903d3d6688aaea992d3a5b124bb90eb73eb372dffcc60ccd9dc", "check": "weak-prng", "impact": "High", "confidence": "Medium" @@ -501,9 +501,9 @@ "start": 363, "length": 58, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/weak-prng/bad_prng.sol", + "filename_relative": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/weak-prng/bad_prng.sol", + "filename_short": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "is_dependency": false, "lines": [ 20, @@ -521,9 +521,9 @@ "start": 0, "length": 499, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/weak-prng/bad_prng.sol", + "filename_relative": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/weak-prng/bad_prng.sol", + "filename_short": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "is_dependency": false, "lines": [ 1, @@ -568,9 +568,9 @@ "start": 395, "length": 19, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/weak-prng/bad_prng.sol", + "filename_relative": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/weak-prng/bad_prng.sol", + "filename_short": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "is_dependency": false, "lines": [ 21 @@ -586,9 +586,9 @@ "start": 363, "length": 58, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/weak-prng/bad_prng.sol", + "filename_relative": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/weak-prng/bad_prng.sol", + "filename_short": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "is_dependency": false, "lines": [ 20, @@ -606,9 +606,9 @@ "start": 0, "length": 499, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/weak-prng/bad_prng.sol", + "filename_relative": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/weak-prng/bad_prng.sol", + "filename_short": "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "is_dependency": false, "lines": [ 1, @@ -649,9 +649,9 @@ } } ], - "description": "BadPRNG.bad3() (tests/detectors/weak-prng/bad_prng.sol#20-22) uses a weak PRNG: \"i = foo() % 10 (tests/detectors/weak-prng/bad_prng.sol#21)\" \n", - "markdown": "[BadPRNG.bad3()](tests/detectors/weak-prng/bad_prng.sol#L20-L22) uses a weak PRNG: \"[i = foo() % 10](tests/detectors/weak-prng/bad_prng.sol#L21)\" \n", - "id": "a382f093e54d2c7beb2c10b3537790371f4b95545c48d1300fd25d20717d137a", + "description": "BadPRNG.bad3() (tests/detectors/weak-prng/0.4.25/bad_prng.sol#20-22) uses a weak PRNG: \"i = foo() % 10 (tests/detectors/weak-prng/0.4.25/bad_prng.sol#21)\" \n", + "markdown": "[BadPRNG.bad3()](tests/detectors/weak-prng/0.4.25/bad_prng.sol#L20-L22) uses a weak PRNG: \"[i = foo() % 10](tests/detectors/weak-prng/0.4.25/bad_prng.sol#L21)\" \n", + "id": "9ea8ea8faa26193b33dc2b3be5a338350aa82a076a4b5ec387ad8f5c15b7181f", "check": "weak-prng", "impact": "High", "confidence": "Medium" diff --git a/tests/detectors/weak-prng/0.5.16/bad_prng.sol b/tests/detectors/weak-prng/0.5.16/bad_prng.sol new file mode 100644 index 0000000000..f4cf0133a7 --- /dev/null +++ b/tests/detectors/weak-prng/0.5.16/bad_prng.sol @@ -0,0 +1,28 @@ +contract BadPRNG{ + event Time(uint); + + function bad0() external{ + uint i = block.timestamp % 10; + } + + function bad1() external{ + uint i = now % 10; + } + + function bad2() external{ + uint i = uint256(blockhash(10000)) % 10; + } + + function foo() public returns (uint) { + return(uint256(blockhash(10000))); + } + + function bad3() external{ + uint i = foo() % 10; + } + + function good() external{ + emit Time(block.timestamp); + } +} + diff --git a/tests/detectors/weak-prng/0.5.16/bad_prng.sol.0.5.16.BadPRNG.json b/tests/detectors/weak-prng/0.5.16/bad_prng.sol.0.5.16.BadPRNG.json new file mode 100644 index 0000000000..24bc23f7ee --- /dev/null +++ b/tests/detectors/weak-prng/0.5.16/bad_prng.sol.0.5.16.BadPRNG.json @@ -0,0 +1,660 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 45, + "length": 68, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BadPRNG", + "source_mapping": { + "start": 0, + "length": 499, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + }, + { + "type": "node", + "name": "i = block.timestamp % 10", + "source_mapping": { + "start": 77, + "length": 29, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "is_dependency": false, + "lines": [ + 5 + ], + "starting_column": 7, + "ending_column": 36 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 45, + "length": 68, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BadPRNG", + "source_mapping": { + "start": 0, + "length": 499, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + } + } + ], + "description": "BadPRNG.bad0() (tests/detectors/weak-prng/0.5.16/bad_prng.sol#4-6) uses a weak PRNG: \"i = block.timestamp % 10 (tests/detectors/weak-prng/0.5.16/bad_prng.sol#5)\" \n", + "markdown": "[BadPRNG.bad0()](tests/detectors/weak-prng/0.5.16/bad_prng.sol#L4-L6) uses a weak PRNG: \"[i = block.timestamp % 10](tests/detectors/weak-prng/0.5.16/bad_prng.sol#L5)\" \n", + "id": "5bb9fd5cdaccfeb6303fb8ea676c6aed0164ba2ce3fc8b5c2778cd280afe61b0", + "check": "weak-prng", + "impact": "High", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 122, + "length": 56, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BadPRNG", + "source_mapping": { + "start": 0, + "length": 499, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1()" + } + }, + { + "type": "node", + "name": "i = now % 10", + "source_mapping": { + "start": 154, + "length": 17, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "is_dependency": false, + "lines": [ + 9 + ], + "starting_column": 7, + "ending_column": 24 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 122, + "length": 56, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BadPRNG", + "source_mapping": { + "start": 0, + "length": 499, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1()" + } + } + } + } + ], + "description": "BadPRNG.bad1() (tests/detectors/weak-prng/0.5.16/bad_prng.sol#8-10) uses a weak PRNG: \"i = now % 10 (tests/detectors/weak-prng/0.5.16/bad_prng.sol#9)\" \n", + "markdown": "[BadPRNG.bad1()](tests/detectors/weak-prng/0.5.16/bad_prng.sol#L8-L10) uses a weak PRNG: \"[i = now % 10](tests/detectors/weak-prng/0.5.16/bad_prng.sol#L9)\" \n", + "id": "963866d884f65c4552ae10288cc1f92de1050f5f6254d4d2df132c7fbb7ce773", + "check": "weak-prng", + "impact": "High", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 184, + "length": 78, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "is_dependency": false, + "lines": [ + 12, + 13, + 14 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BadPRNG", + "source_mapping": { + "start": 0, + "length": 499, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + }, + { + "type": "node", + "name": "i = uint256(blockhash(uint256)(10000)) % 10", + "source_mapping": { + "start": 216, + "length": 39, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "is_dependency": false, + "lines": [ + 13 + ], + "starting_column": 7, + "ending_column": 46 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 184, + "length": 78, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "is_dependency": false, + "lines": [ + 12, + 13, + 14 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BadPRNG", + "source_mapping": { + "start": 0, + "length": 499, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + } + } + } + ], + "description": "BadPRNG.bad2() (tests/detectors/weak-prng/0.5.16/bad_prng.sol#12-14) uses a weak PRNG: \"i = uint256(blockhash(uint256)(10000)) % 10 (tests/detectors/weak-prng/0.5.16/bad_prng.sol#13)\" \n", + "markdown": "[BadPRNG.bad2()](tests/detectors/weak-prng/0.5.16/bad_prng.sol#L12-L14) uses a weak PRNG: \"[i = uint256(blockhash(uint256)(10000)) % 10](tests/detectors/weak-prng/0.5.16/bad_prng.sol#L13)\" \n", + "id": "4769d2b25e78345ad05fa046a989f5f5545739c20e8c2b93c2968cdca69a5501", + "check": "weak-prng", + "impact": "High", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad3", + "source_mapping": { + "start": 363, + "length": 58, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "is_dependency": false, + "lines": [ + 20, + 21, + 22 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BadPRNG", + "source_mapping": { + "start": 0, + "length": 499, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad3()" + } + }, + { + "type": "node", + "name": "i = foo() % 10", + "source_mapping": { + "start": 395, + "length": 19, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "is_dependency": false, + "lines": [ + 21 + ], + "starting_column": 7, + "ending_column": 26 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad3", + "source_mapping": { + "start": 363, + "length": 58, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "is_dependency": false, + "lines": [ + 20, + 21, + 22 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BadPRNG", + "source_mapping": { + "start": 0, + "length": 499, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.5.16/bad_prng.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad3()" + } + } + } + } + ], + "description": "BadPRNG.bad3() (tests/detectors/weak-prng/0.5.16/bad_prng.sol#20-22) uses a weak PRNG: \"i = foo() % 10 (tests/detectors/weak-prng/0.5.16/bad_prng.sol#21)\" \n", + "markdown": "[BadPRNG.bad3()](tests/detectors/weak-prng/0.5.16/bad_prng.sol#L20-L22) uses a weak PRNG: \"[i = foo() % 10](tests/detectors/weak-prng/0.5.16/bad_prng.sol#L21)\" \n", + "id": "342f1496b7a91c084d108fd76054672be5ac3a1a5481f907b93d3c72e32f70dc", + "check": "weak-prng", + "impact": "High", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/weak-prng/0.6.11/bad_prng.sol b/tests/detectors/weak-prng/0.6.11/bad_prng.sol new file mode 100644 index 0000000000..f4cf0133a7 --- /dev/null +++ b/tests/detectors/weak-prng/0.6.11/bad_prng.sol @@ -0,0 +1,28 @@ +contract BadPRNG{ + event Time(uint); + + function bad0() external{ + uint i = block.timestamp % 10; + } + + function bad1() external{ + uint i = now % 10; + } + + function bad2() external{ + uint i = uint256(blockhash(10000)) % 10; + } + + function foo() public returns (uint) { + return(uint256(blockhash(10000))); + } + + function bad3() external{ + uint i = foo() % 10; + } + + function good() external{ + emit Time(block.timestamp); + } +} + diff --git a/tests/detectors/weak-prng/0.6.11/bad_prng.sol.0.6.11.BadPRNG.json b/tests/detectors/weak-prng/0.6.11/bad_prng.sol.0.6.11.BadPRNG.json new file mode 100644 index 0000000000..4b2fb4bd55 --- /dev/null +++ b/tests/detectors/weak-prng/0.6.11/bad_prng.sol.0.6.11.BadPRNG.json @@ -0,0 +1,660 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 45, + "length": 68, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BadPRNG", + "source_mapping": { + "start": 0, + "length": 499, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + }, + { + "type": "node", + "name": "i = block.timestamp % 10", + "source_mapping": { + "start": 77, + "length": 29, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "is_dependency": false, + "lines": [ + 5 + ], + "starting_column": 7, + "ending_column": 36 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 45, + "length": 68, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BadPRNG", + "source_mapping": { + "start": 0, + "length": 499, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + } + } + ], + "description": "BadPRNG.bad0() (tests/detectors/weak-prng/0.6.11/bad_prng.sol#4-6) uses a weak PRNG: \"i = block.timestamp % 10 (tests/detectors/weak-prng/0.6.11/bad_prng.sol#5)\" \n", + "markdown": "[BadPRNG.bad0()](tests/detectors/weak-prng/0.6.11/bad_prng.sol#L4-L6) uses a weak PRNG: \"[i = block.timestamp % 10](tests/detectors/weak-prng/0.6.11/bad_prng.sol#L5)\" \n", + "id": "bfdb804ad9a58c4a694182e0f4dff561ffe37a0680f850763136ac57af57cea6", + "check": "weak-prng", + "impact": "High", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 122, + "length": 56, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BadPRNG", + "source_mapping": { + "start": 0, + "length": 499, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1()" + } + }, + { + "type": "node", + "name": "i = now % 10", + "source_mapping": { + "start": 154, + "length": 17, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "is_dependency": false, + "lines": [ + 9 + ], + "starting_column": 7, + "ending_column": 24 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 122, + "length": 56, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BadPRNG", + "source_mapping": { + "start": 0, + "length": 499, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1()" + } + } + } + } + ], + "description": "BadPRNG.bad1() (tests/detectors/weak-prng/0.6.11/bad_prng.sol#8-10) uses a weak PRNG: \"i = now % 10 (tests/detectors/weak-prng/0.6.11/bad_prng.sol#9)\" \n", + "markdown": "[BadPRNG.bad1()](tests/detectors/weak-prng/0.6.11/bad_prng.sol#L8-L10) uses a weak PRNG: \"[i = now % 10](tests/detectors/weak-prng/0.6.11/bad_prng.sol#L9)\" \n", + "id": "4651cdacc944504d793e3c0dfa85684df0c31ccd1435fb1bdf7f952a5c743aac", + "check": "weak-prng", + "impact": "High", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 184, + "length": 78, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "is_dependency": false, + "lines": [ + 12, + 13, + 14 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BadPRNG", + "source_mapping": { + "start": 0, + "length": 499, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + }, + { + "type": "node", + "name": "i = uint256(blockhash(uint256)(10000)) % 10", + "source_mapping": { + "start": 216, + "length": 39, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "is_dependency": false, + "lines": [ + 13 + ], + "starting_column": 7, + "ending_column": 46 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 184, + "length": 78, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "is_dependency": false, + "lines": [ + 12, + 13, + 14 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BadPRNG", + "source_mapping": { + "start": 0, + "length": 499, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + } + } + } + ], + "description": "BadPRNG.bad2() (tests/detectors/weak-prng/0.6.11/bad_prng.sol#12-14) uses a weak PRNG: \"i = uint256(blockhash(uint256)(10000)) % 10 (tests/detectors/weak-prng/0.6.11/bad_prng.sol#13)\" \n", + "markdown": "[BadPRNG.bad2()](tests/detectors/weak-prng/0.6.11/bad_prng.sol#L12-L14) uses a weak PRNG: \"[i = uint256(blockhash(uint256)(10000)) % 10](tests/detectors/weak-prng/0.6.11/bad_prng.sol#L13)\" \n", + "id": "95c977967e6bb17afe7c6c10389750fcd98a2f0bf7fa9beb08d3e7214e2f63d7", + "check": "weak-prng", + "impact": "High", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad3", + "source_mapping": { + "start": 363, + "length": 58, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "is_dependency": false, + "lines": [ + 20, + 21, + 22 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BadPRNG", + "source_mapping": { + "start": 0, + "length": 499, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad3()" + } + }, + { + "type": "node", + "name": "i = foo() % 10", + "source_mapping": { + "start": 395, + "length": 19, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "is_dependency": false, + "lines": [ + 21 + ], + "starting_column": 7, + "ending_column": 26 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad3", + "source_mapping": { + "start": 363, + "length": 58, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "is_dependency": false, + "lines": [ + 20, + 21, + 22 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BadPRNG", + "source_mapping": { + "start": 0, + "length": 499, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.6.11/bad_prng.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad3()" + } + } + } + } + ], + "description": "BadPRNG.bad3() (tests/detectors/weak-prng/0.6.11/bad_prng.sol#20-22) uses a weak PRNG: \"i = foo() % 10 (tests/detectors/weak-prng/0.6.11/bad_prng.sol#21)\" \n", + "markdown": "[BadPRNG.bad3()](tests/detectors/weak-prng/0.6.11/bad_prng.sol#L20-L22) uses a weak PRNG: \"[i = foo() % 10](tests/detectors/weak-prng/0.6.11/bad_prng.sol#L21)\" \n", + "id": "211bbc7b73c90c6ae03f3e73c2b306c74699381229a4af6d4687891b024f2189", + "check": "weak-prng", + "impact": "High", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/weak-prng/0.7.6/bad_prng.sol b/tests/detectors/weak-prng/0.7.6/bad_prng.sol new file mode 100644 index 0000000000..82340d05b7 --- /dev/null +++ b/tests/detectors/weak-prng/0.7.6/bad_prng.sol @@ -0,0 +1,28 @@ +contract BadPRNG{ + event Time(uint); + + function bad0() external{ + uint i = block.timestamp % 10; + } + + function bad1() external{ + uint i = block.timestamp % 10; + } + + function bad2() external{ + uint i = uint256(blockhash(10000)) % 10; + } + + function foo() public returns (uint) { + return(uint256(blockhash(10000))); + } + + function bad3() external{ + uint i = foo() % 10; + } + + function good() external{ + emit Time(block.timestamp); + } +} + diff --git a/tests/detectors/weak-prng/0.7.6/bad_prng.sol.0.7.6.BadPRNG.json b/tests/detectors/weak-prng/0.7.6/bad_prng.sol.0.7.6.BadPRNG.json new file mode 100644 index 0000000000..82add8a7eb --- /dev/null +++ b/tests/detectors/weak-prng/0.7.6/bad_prng.sol.0.7.6.BadPRNG.json @@ -0,0 +1,660 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 45, + "length": 68, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BadPRNG", + "source_mapping": { + "start": 0, + "length": 511, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + }, + { + "type": "node", + "name": "i = block.timestamp % 10", + "source_mapping": { + "start": 77, + "length": 29, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "is_dependency": false, + "lines": [ + 5 + ], + "starting_column": 7, + "ending_column": 36 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 45, + "length": 68, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "is_dependency": false, + "lines": [ + 4, + 5, + 6 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BadPRNG", + "source_mapping": { + "start": 0, + "length": 511, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad0()" + } + } + } + } + ], + "description": "BadPRNG.bad0() (tests/detectors/weak-prng/0.7.6/bad_prng.sol#4-6) uses a weak PRNG: \"i = block.timestamp % 10 (tests/detectors/weak-prng/0.7.6/bad_prng.sol#5)\" \n", + "markdown": "[BadPRNG.bad0()](tests/detectors/weak-prng/0.7.6/bad_prng.sol#L4-L6) uses a weak PRNG: \"[i = block.timestamp % 10](tests/detectors/weak-prng/0.7.6/bad_prng.sol#L5)\" \n", + "id": "1699e708ab01560cde36ac92caaf0abd7c3de733431340f4719b1dfd3544a6ef", + "check": "weak-prng", + "impact": "High", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 122, + "length": 68, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BadPRNG", + "source_mapping": { + "start": 0, + "length": 511, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1()" + } + }, + { + "type": "node", + "name": "i = block.timestamp % 10", + "source_mapping": { + "start": 154, + "length": 29, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "is_dependency": false, + "lines": [ + 9 + ], + "starting_column": 7, + "ending_column": 36 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 122, + "length": 68, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "is_dependency": false, + "lines": [ + 8, + 9, + 10 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BadPRNG", + "source_mapping": { + "start": 0, + "length": 511, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad1()" + } + } + } + } + ], + "description": "BadPRNG.bad1() (tests/detectors/weak-prng/0.7.6/bad_prng.sol#8-10) uses a weak PRNG: \"i = block.timestamp % 10 (tests/detectors/weak-prng/0.7.6/bad_prng.sol#9)\" \n", + "markdown": "[BadPRNG.bad1()](tests/detectors/weak-prng/0.7.6/bad_prng.sol#L8-L10) uses a weak PRNG: \"[i = block.timestamp % 10](tests/detectors/weak-prng/0.7.6/bad_prng.sol#L9)\" \n", + "id": "e27e978d7016cb26d0d372e84c7f4e1bbd6e45af239e195823b3b138713430a6", + "check": "weak-prng", + "impact": "High", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 196, + "length": 78, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "is_dependency": false, + "lines": [ + 12, + 13, + 14 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BadPRNG", + "source_mapping": { + "start": 0, + "length": 511, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + }, + { + "type": "node", + "name": "i = uint256(blockhash(uint256)(10000)) % 10", + "source_mapping": { + "start": 228, + "length": 39, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "is_dependency": false, + "lines": [ + 13 + ], + "starting_column": 7, + "ending_column": 46 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad2", + "source_mapping": { + "start": 196, + "length": 78, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "is_dependency": false, + "lines": [ + 12, + 13, + 14 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BadPRNG", + "source_mapping": { + "start": 0, + "length": 511, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad2()" + } + } + } + } + ], + "description": "BadPRNG.bad2() (tests/detectors/weak-prng/0.7.6/bad_prng.sol#12-14) uses a weak PRNG: \"i = uint256(blockhash(uint256)(10000)) % 10 (tests/detectors/weak-prng/0.7.6/bad_prng.sol#13)\" \n", + "markdown": "[BadPRNG.bad2()](tests/detectors/weak-prng/0.7.6/bad_prng.sol#L12-L14) uses a weak PRNG: \"[i = uint256(blockhash(uint256)(10000)) % 10](tests/detectors/weak-prng/0.7.6/bad_prng.sol#L13)\" \n", + "id": "0afae786715bc7bc677a2525aec172999533a2bc1ee62d9b974c9f13a45755c6", + "check": "weak-prng", + "impact": "High", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad3", + "source_mapping": { + "start": 375, + "length": 58, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "is_dependency": false, + "lines": [ + 20, + 21, + 22 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BadPRNG", + "source_mapping": { + "start": 0, + "length": 511, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad3()" + } + }, + { + "type": "node", + "name": "i = foo() % 10", + "source_mapping": { + "start": 407, + "length": 19, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "is_dependency": false, + "lines": [ + 21 + ], + "starting_column": 7, + "ending_column": 26 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad3", + "source_mapping": { + "start": 375, + "length": 58, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "is_dependency": false, + "lines": [ + 20, + 21, + 22 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BadPRNG", + "source_mapping": { + "start": 0, + "length": 511, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/weak-prng/0.7.6/bad_prng.sol", + "is_dependency": false, + "lines": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "bad3()" + } + } + } + } + ], + "description": "BadPRNG.bad3() (tests/detectors/weak-prng/0.7.6/bad_prng.sol#20-22) uses a weak PRNG: \"i = foo() % 10 (tests/detectors/weak-prng/0.7.6/bad_prng.sol#21)\" \n", + "markdown": "[BadPRNG.bad3()](tests/detectors/weak-prng/0.7.6/bad_prng.sol#L20-L22) uses a weak PRNG: \"[i = foo() % 10](tests/detectors/weak-prng/0.7.6/bad_prng.sol#L21)\" \n", + "id": "b3e0dbd29c5e74eaae470dcfe1ff523c67da580b1ae0c07559c02ee67d9d4c86", + "check": "weak-prng", + "impact": "High", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/test_detectors.py b/tests/test_detectors.py index b3bb4a50e2..78571b7a1f 100644 --- a/tests/test_detectors.py +++ b/tests/test_detectors.py @@ -53,369 +53,1101 @@ def id_test(test_item: Test): ALL_TESTS = [ + Test( # DO NOT move this specific test further down in this list, because for some inexplicable reason this test will then fail to report function bad2 ?! + all_detectors.UninitializedFunctionPtrsConstructor, + "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "0.4.25", + ), + Test( + all_detectors.UninitializedFunctionPtrsConstructor, + "tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol", + "0.5.8", + ), + Test( + all_detectors.UninitializedFunctionPtrsConstructor, + "tests/detectors/uninitialized-fptr-cst/0.5.16/uninitialized_function_ptr_constructor.sol", + "0.5.16", + ), + Test( + all_detectors.ReentrancyBenign, + "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", + "0.4.25", + ), Test( all_detectors.ReentrancyBenign, - "tests/detectors/reentrancy-benign/reentrancy-benign.sol", - "0.4.26", + "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "0.5.16", + ), + Test( + all_detectors.ReentrancyBenign, + "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "0.6.11", + ), + Test( + all_detectors.ReentrancyBenign, + "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "0.7.6", + ), + Test( + all_detectors.ReentrancyReadBeforeWritten, + "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "0.4.25", ), Test( all_detectors.ReentrancyReadBeforeWritten, - "tests/detectors/reentrancy-before-write/reentrancy-write.sol", - "0.4.26", + "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "0.5.16", + ), + Test( + all_detectors.ReentrancyReadBeforeWritten, + "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "0.6.11", + ), + Test( + all_detectors.ReentrancyReadBeforeWritten, + "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "0.7.6", ), Test( all_detectors.BooleanEquality, - "tests/detectors/boolean-constant-equality/boolean-constant-equality.sol", + "tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol", "0.4.25", ), + Test( + all_detectors.BooleanEquality, + "tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol", + "0.5.16", + ), + Test( + all_detectors.BooleanEquality, + "tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol", + "0.6.11", + ), + Test( + all_detectors.BooleanEquality, + "tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol", + "0.7.6", + ), Test( all_detectors.BooleanConstantMisuse, - "tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol", - "0.6.0", + "tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol", + "0.4.25", + ), + Test( + all_detectors.BooleanConstantMisuse, + "tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol", + "0.5.16", + ), + Test( + all_detectors.BooleanConstantMisuse, + "tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol", + "0.6.11", + ), + Test( + all_detectors.BooleanConstantMisuse, + "tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol", + "0.7.6", ), Test( all_detectors.UncheckedLowLevel, - "tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol", + "tests/detectors/unchecked-lowlevel/0.4.25/unchecked_lowlevel.sol", "0.4.25", ), Test( all_detectors.UncheckedLowLevel, - "tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol", - "0.5.1", + "tests/detectors/unchecked-lowlevel/0.5.16/unchecked_lowlevel.sol", + "0.5.16", ), Test( all_detectors.UncheckedLowLevel, - "tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol", - "0.5.1", + "tests/detectors/unchecked-lowlevel/0.6.11/unchecked_lowlevel.sol", + "0.6.11", + ), + Test( + all_detectors.UncheckedLowLevel, + "tests/detectors/unchecked-lowlevel/0.7.6/unchecked_lowlevel.sol", + "0.7.6", ), Test( all_detectors.UnindexedERC20EventParameters, - "tests/detectors/erc20-indexed/erc20_indexed.sol", + "tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol", "0.4.25", ), + Test( + all_detectors.UnindexedERC20EventParameters, + "tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol", + "0.5.16", + ), + Test( + all_detectors.UnindexedERC20EventParameters, + "tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol", + "0.6.11", + ), + Test( + all_detectors.UnindexedERC20EventParameters, + "tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol", + "0.7.6", + ), Test( all_detectors.IncorrectERC20InterfaceDetection, - "tests/detectors/erc20-interface/incorrect_erc20_interface.sol", + "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", "0.4.25", ), + Test( + all_detectors.IncorrectERC20InterfaceDetection, + "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "0.5.16", + ), + Test( + all_detectors.IncorrectERC20InterfaceDetection, + "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "0.6.11", + ), + Test( + all_detectors.IncorrectERC20InterfaceDetection, + "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "0.7.6", + ), Test( all_detectors.IncorrectERC721InterfaceDetection, - "tests/detectors/erc721-interface/incorrect_erc721_interface.sol", + "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", "0.4.25", ), + Test( + all_detectors.IncorrectERC721InterfaceDetection, + "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "0.5.16", + ), + Test( + all_detectors.IncorrectERC721InterfaceDetection, + "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "0.6.11", + ), + Test( + all_detectors.IncorrectERC721InterfaceDetection, + "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "0.7.6", + ), Test( all_detectors.UninitializedStateVarsDetection, - "tests/detectors/uninitialized-state/uninitialized.sol", + "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", "0.4.25", ), Test( all_detectors.UninitializedStateVarsDetection, - "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol", - "0.5.1", + "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "0.5.16", ), - Test(all_detectors.Backdoor, "tests/detectors/backdoor/backdoor.sol", "0.4.25"), - Test(all_detectors.Backdoor, "tests/detectors/backdoor/backdoor.sol", "0.5.1"), - Test(all_detectors.Suicidal, "tests/detectors/backdoor/backdoor.sol", "0.4.25"), - Test(all_detectors.Suicidal, "tests/detectors/backdoor/backdoor.sol", "0.5.1"), + Test( + all_detectors.UninitializedStateVarsDetection, + "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "0.6.11", + ), + Test( + all_detectors.UninitializedStateVarsDetection, + "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", + "0.7.6", + ), + Test(all_detectors.Backdoor, "tests/detectors/backdoor/0.4.25/backdoor.sol", "0.4.25"), + Test(all_detectors.Backdoor, "tests/detectors/backdoor/0.5.16/backdoor.sol", "0.5.16"), + Test(all_detectors.Backdoor, "tests/detectors/backdoor/0.6.11/backdoor.sol", "0.6.11"), + Test(all_detectors.Backdoor, "tests/detectors/backdoor/0.7.6/backdoor.sol", "0.7.6"), + Test(all_detectors.Suicidal, "tests/detectors/suicidal/0.4.25/suicidal.sol", "0.4.25"), + Test(all_detectors.Suicidal, "tests/detectors/suicidal/0.5.16/suicidal.sol", "0.5.16"), + Test(all_detectors.Suicidal, "tests/detectors/suicidal/0.6.11/suicidal.sol", "0.6.11"), + Test(all_detectors.Suicidal, "tests/detectors/suicidal/0.7.6/suicidal.sol", "0.7.6"), Test( all_detectors.ConstantPragma, - "tests/detectors/pragma/pragma.0.4.24.sol", + "tests/detectors/pragma/0.4.25/pragma.0.4.25.sol", "0.4.25", - ["tests/detectors/pragma/pragma.0.4.23.sol"], + ["tests/detectors/pragma/0.4.25/pragma.0.4.24.sol"], ), - Test(all_detectors.IncorrectSolc, "tests/detectors/solc-version/old_solc.sol", "0.4.21"), Test( - all_detectors.IncorrectSolc, - "tests/detectors/solc-version/solc_version_incorrect.sol", - "0.4.25", + all_detectors.ConstantPragma, + "tests/detectors/pragma/0.5.16/pragma.0.5.16.sol", + "0.5.16", + ["tests/detectors/pragma/0.5.16/pragma.0.5.15.sol"], + ), + Test( + all_detectors.ConstantPragma, + "tests/detectors/pragma/0.6.11/pragma.0.6.11.sol", + "0.6.11", + ["tests/detectors/pragma/0.6.11/pragma.0.6.10.sol"], + ), + Test( + all_detectors.ConstantPragma, + "tests/detectors/pragma/0.7.6/pragma.0.7.6.sol", + "0.7.6", + ["tests/detectors/pragma/0.7.6/pragma.0.7.5.sol"], + ), + Test(all_detectors.IncorrectSolc, "tests/detectors/solc-version/0.4.25/static.sol", "0.4.25"), + Test(all_detectors.IncorrectSolc, "tests/detectors/solc-version/0.5.14/static.sol", "0.5.14"), + Test(all_detectors.IncorrectSolc, "tests/detectors/solc-version/0.5.16/static.sol", "0.5.16"), + Test( + all_detectors.IncorrectSolc, "tests/detectors/solc-version/0.5.16/dynamic_1.sol", "0.5.16" ), Test( - all_detectors.IncorrectSolc, - "tests/detectors/solc-version/solc_version_incorrect_05.sol", - "0.5.7", + all_detectors.IncorrectSolc, "tests/detectors/solc-version/0.5.16/dynamic_2.sol", "0.5.16" ), - Test(all_detectors.ReentrancyEth, "tests/detectors/reentrancy-eth/reentrancy.sol", "0.4.25"), + Test(all_detectors.IncorrectSolc, "tests/detectors/solc-version/0.6.10/static.sol", "0.6.10"), + Test(all_detectors.IncorrectSolc, "tests/detectors/solc-version/0.6.11/static.sol", "0.6.11"), + Test( + all_detectors.IncorrectSolc, "tests/detectors/solc-version/0.6.11/dynamic_1.sol", "0.6.11" + ), + Test( + all_detectors.IncorrectSolc, "tests/detectors/solc-version/0.6.11/dynamic_2.sol", "0.6.11" + ), + Test(all_detectors.IncorrectSolc, "tests/detectors/solc-version/0.7.4/static.sol", "0.7.4"), + Test(all_detectors.IncorrectSolc, "tests/detectors/solc-version/0.7.6/static.sol", "0.7.6"), + Test(all_detectors.IncorrectSolc, "tests/detectors/solc-version/0.7.6/dynamic_1.sol", "0.7.6"), + Test(all_detectors.IncorrectSolc, "tests/detectors/solc-version/0.7.6/dynamic_2.sol", "0.7.6"), Test( all_detectors.ReentrancyEth, - "tests/detectors/reentrancy-eth/reentrancy_indirect.sol", + "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", "0.4.25", ), Test( - all_detectors.ReentrancyEth, "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol", "0.5.1" + all_detectors.ReentrancyEth, + "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", + "0.4.25", + ), + Test( + all_detectors.ReentrancyEth, + "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", + "0.5.16", + ), + Test( + all_detectors.ReentrancyEth, + "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "0.5.16", + ), + Test( + all_detectors.ReentrancyEth, + "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "0.6.11", + ), + Test( + all_detectors.ReentrancyEth, + "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "0.6.11", + ), + Test( + all_detectors.ReentrancyEth, "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", "0.7.6" + ), + Test( + all_detectors.ReentrancyEth, + "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "0.7.6", ), Test( all_detectors.UninitializedStorageVars, - "tests/detectors/uninitialized-storage/uninitialized_storage_pointer.sol", + "tests/detectors/uninitialized-storage/0.4.25/uninitialized_storage_pointer.sol", + "0.4.25", + ), + Test(all_detectors.TxOrigin, "tests/detectors/tx-origin/0.4.25/tx_origin.sol", "0.4.25"), + Test(all_detectors.TxOrigin, "tests/detectors/tx-origin/0.5.16/tx_origin.sol", "0.5.16"), + Test(all_detectors.TxOrigin, "tests/detectors/tx-origin/0.6.11/tx_origin.sol", "0.6.11"), + Test(all_detectors.TxOrigin, "tests/detectors/tx-origin/0.7.6/tx_origin.sol", "0.7.6"), + Test( + all_detectors.UnusedStateVars, + "tests/detectors/unused-state/0.4.25/unused_state.sol", + "0.4.25", + ), + Test( + all_detectors.UnusedStateVars, + "tests/detectors/unused-state/0.5.16/unused_state.sol", + "0.5.16", + ), + Test( + all_detectors.UnusedStateVars, + "tests/detectors/unused-state/0.6.11/unused_state.sol", + "0.6.11", + ), + Test( + all_detectors.UnusedStateVars, + "tests/detectors/unused-state/0.7.6/unused_state.sol", + "0.7.6", + ), + Test( + all_detectors.LockedEther, "tests/detectors/locked-ether/0.4.25/locked_ether.sol", "0.4.25" + ), + Test( + all_detectors.LockedEther, "tests/detectors/locked-ether/0.5.16/locked_ether.sol", "0.5.16" + ), + Test( + all_detectors.LockedEther, "tests/detectors/locked-ether/0.6.11/locked_ether.sol", "0.6.11" + ), + Test(all_detectors.LockedEther, "tests/detectors/locked-ether/0.7.6/locked_ether.sol", "0.7.6"), + Test( + all_detectors.ArbitrarySend, + "tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol", "0.4.25", ), - Test(all_detectors.TxOrigin, "tests/detectors/tx-origin/tx_origin.sol", "0.4.25"), - Test(all_detectors.TxOrigin, "tests/detectors/tx-origin/tx_origin-0.5.1.sol", "0.5.1"), - Test(all_detectors.UnusedStateVars, "tests/detectors/unused-state/unused_state.sol", "0.4.25"), - Test(all_detectors.UnusedStateVars, "tests/detectors/unused-state/unused_state.sol", "0.5.1"), - Test(all_detectors.LockedEther, "tests/detectors/locked-ether/locked_ether.sol", "0.4.25"), - Test(all_detectors.LockedEther, "tests/detectors/locked-ether/locked_ether-0.5.1.sol", "0.5.1"), Test( - all_detectors.ArbitrarySend, "tests/detectors/arbitrary-send/arbitrary_send.sol", "0.4.25" + all_detectors.ArbitrarySend, + "tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol", + "0.5.16", ), Test( all_detectors.ArbitrarySend, - "tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol", - "0.5.1", + "tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol", + "0.6.11", + ), + Test( + all_detectors.ArbitrarySend, + "tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol", + "0.7.6", + ), + Test( + all_detectors.Assembly, + "tests/detectors/assembly/0.4.25/inline_assembly_contract.sol", + "0.4.25", + ), + Test( + all_detectors.Assembly, + "tests/detectors/assembly/0.4.25/inline_assembly_library.sol", + "0.4.25", ), - Test(all_detectors.Assembly, "tests/detectors/assembly/inline_assembly_contract.sol", "0.4.25"), - Test(all_detectors.Assembly, "tests/detectors/assembly/inline_assembly_library.sol", "0.4.25"), Test( all_detectors.Assembly, - "tests/detectors/assembly/inline_assembly_contract-0.5.1.sol", - "0.5.1", + "tests/detectors/assembly/0.5.16/inline_assembly_contract.sol", + "0.5.16", ), Test( all_detectors.Assembly, - "tests/detectors/assembly/inline_assembly_library-0.5.1.sol", - "0.5.1", + "tests/detectors/assembly/0.5.16/inline_assembly_library.sol", + "0.5.16", + ), + Test( + all_detectors.Assembly, + "tests/detectors/assembly/0.6.11/inline_assembly_contract.sol", + "0.6.11", + ), + Test( + all_detectors.Assembly, + "tests/detectors/assembly/0.6.11/inline_assembly_library.sol", + "0.6.11", + ), + Test( + all_detectors.Assembly, + "tests/detectors/assembly/0.7.6/inline_assembly_contract.sol", + "0.7.6", + ), + Test( + all_detectors.Assembly, + "tests/detectors/assembly/0.7.6/inline_assembly_library.sol", + "0.7.6", + ), + Test( + all_detectors.LowLevelCalls, + "tests/detectors/low-level-calls/0.4.25/low_level_calls.sol", + "0.4.25", + ), + Test( + all_detectors.LowLevelCalls, + "tests/detectors/low-level-calls/0.5.16/low_level_calls.sol", + "0.5.16", ), Test( - all_detectors.LowLevelCalls, "tests/detectors/low-level-calls/low_level_calls.sol", "0.4.25" + all_detectors.LowLevelCalls, + "tests/detectors/low-level-calls/0.6.11/low_level_calls.sol", + "0.6.11", ), Test( - all_detectors.LowLevelCalls, "tests/detectors/low-level-calls/low_level_calls.sol", "0.5.1" + all_detectors.LowLevelCalls, + "tests/detectors/low-level-calls/0.7.6/low_level_calls.sol", + "0.7.6", ), Test( all_detectors.ConstCandidateStateVars, - "tests/detectors/constable-states/const_state_variables.sol", + "tests/detectors/constable-states/0.4.25/const_state_variables.sol", "0.4.25", ), Test( all_detectors.ConstCandidateStateVars, - "tests/detectors/constable-states/const_state_variables.sol", - "0.5.1", + "tests/detectors/constable-states/0.5.16/const_state_variables.sol", + "0.5.16", + ), + Test( + all_detectors.ConstCandidateStateVars, + "tests/detectors/constable-states/0.6.11/const_state_variables.sol", + "0.6.11", + ), + Test( + all_detectors.ConstCandidateStateVars, + "tests/detectors/constable-states/0.7.6/const_state_variables.sol", + "0.7.6", ), Test( all_detectors.ExternalFunction, - "tests/detectors/external-function/external_function.sol", + "tests/detectors/external-function/0.4.25/external_function.sol", "0.4.25", ), Test( all_detectors.ExternalFunction, - "tests/detectors/external-function/external_function_2.sol", + "tests/detectors/external-function/0.4.25/external_function_2.sol", "0.4.25", ), Test( all_detectors.ExternalFunction, - "tests/detectors/external-function/external_function.sol", - "0.5.1", + "tests/detectors/external-function/0.5.16/external_function.sol", + "0.5.16", + ), + Test( + all_detectors.ExternalFunction, + "tests/detectors/external-function/0.5.16/external_function_2.sol", + "0.5.16", ), Test( all_detectors.ExternalFunction, - "tests/detectors/external-function/external_function_2.sol", - "0.5.1", + "tests/detectors/external-function/0.6.11/external_function.sol", + "0.6.11", + ), + Test( + all_detectors.ExternalFunction, + "tests/detectors/external-function/0.6.11/external_function_2.sol", + "0.6.11", + ), + Test( + all_detectors.ExternalFunction, + "tests/detectors/external-function/0.7.6/external_function.sol", + "0.7.6", + ), + Test( + all_detectors.ExternalFunction, + "tests/detectors/external-function/0.7.6/external_function_2.sol", + "0.7.6", ), Test( all_detectors.NamingConvention, - "tests/detectors/naming-convention/naming_convention.sol", + "tests/detectors/naming-convention/0.4.25/naming_convention.sol", "0.4.25", ), Test( all_detectors.NamingConvention, - "tests/detectors/naming-convention/naming_convention.sol", - "0.5.1", + "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "0.5.16", + ), + Test( + all_detectors.NamingConvention, + "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "0.6.11", + ), + Test( + all_detectors.NamingConvention, + "tests/detectors/naming-convention/0.7.6/naming_convention.sol", + "0.7.6", ), Test( all_detectors.ControlledDelegateCall, - "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", + "tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol", "0.4.25", ), Test( all_detectors.ControlledDelegateCall, - "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol", - "0.5.1", + "tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol", + "0.5.16", + ), + Test( + all_detectors.ControlledDelegateCall, + "tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol", + "0.6.11", + ), + Test( + all_detectors.ControlledDelegateCall, + "tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol", + "0.7.6", ), Test( all_detectors.UninitializedLocalVars, - "tests/detectors/uninitialized-local/uninitialized_local_variable.sol", + "tests/detectors/uninitialized-local/0.4.25/uninitialized_local_variable.sol", "0.4.25", ), - Test(all_detectors.ConstantFunctionsAsm, "tests/detectors/constant/constant.sol", "0.4.25"), - Test(all_detectors.ConstantFunctionsState, "tests/detectors/constant/constant.sol", "0.4.25"), Test( - all_detectors.ConstantFunctionsAsm, "tests/detectors/constant/constant-0.5.1.sol", "0.5.1" + all_detectors.UninitializedLocalVars, + "tests/detectors/uninitialized-local/0.5.16/uninitialized_local_variable.sol", + "0.5.16", + ), + Test( + all_detectors.UninitializedLocalVars, + "tests/detectors/uninitialized-local/0.6.11/uninitialized_local_variable.sol", + "0.6.11", + ), + Test( + all_detectors.UninitializedLocalVars, + "tests/detectors/uninitialized-local/0.7.6/uninitialized_local_variable.sol", + "0.7.6", ), Test( - all_detectors.ConstantFunctionsState, "tests/detectors/constant/constant-0.5.1.sol", "0.5.1" + all_detectors.ConstantFunctionsAsm, "tests/detectors/constant/0.4.25/constant.sol", "0.4.25" + ), + Test( + all_detectors.ConstantFunctionsState, + "tests/detectors/constant/0.4.25/constant.sol", + "0.4.25", + ), + Test( + all_detectors.ConstantFunctionsAsm, "tests/detectors/constant/0.5.16/constant.sol", "0.5.16" + ), + Test( + all_detectors.ConstantFunctionsState, + "tests/detectors/constant/0.5.16/constant.sol", + "0.5.16", + ), + Test( + all_detectors.ConstantFunctionsAsm, "tests/detectors/constant/0.6.11/constant.sol", "0.6.11" + ), + Test( + all_detectors.ConstantFunctionsState, + "tests/detectors/constant/0.6.11/constant.sol", + "0.6.11", + ), + Test( + all_detectors.ConstantFunctionsAsm, "tests/detectors/constant/0.7.6/constant.sol", "0.7.6" + ), + Test( + all_detectors.ConstantFunctionsState, "tests/detectors/constant/0.7.6/constant.sol", "0.7.6" ), Test( all_detectors.UnusedReturnValues, - "tests/detectors/unused-return/unused_return.sol", + "tests/detectors/unused-return/0.4.25/unused_return.sol", "0.4.25", ), Test( - all_detectors.UnusedReturnValues, "tests/detectors/unused-return/unused_return.sol", "0.5.1" + all_detectors.UnusedReturnValues, + "tests/detectors/unused-return/0.5.16/unused_return.sol", + "0.5.16", + ), + Test( + all_detectors.UnusedReturnValues, + "tests/detectors/unused-return/0.6.11/unused_return.sol", + "0.6.11", + ), + Test( + all_detectors.UnusedReturnValues, + "tests/detectors/unused-return/0.7.6/unused_return.sol", + "0.7.6", ), Test( all_detectors.ShadowingAbstractDetection, - "tests/detectors/shadowing-abstract/shadowing_abstract.sol", + "tests/detectors/shadowing-abstract/0.4.25/shadowing_abstract.sol", "0.4.25", ), + Test( + all_detectors.ShadowingAbstractDetection, + "tests/detectors/shadowing-abstract/0.5.16/shadowing_abstract.sol", + "0.5.16", + ), Test( all_detectors.StateShadowing, - "tests/detectors/shadowing-state/shadowing_state_variable.sol", + "tests/detectors/shadowing-state/0.4.25/shadowing_state_variable.sol", "0.4.25", ), - Test(all_detectors.Timestamp, "tests/detectors/timestamp/timestamp.sol", "0.4.25"), - Test(all_detectors.Timestamp, "tests/detectors/timestamp/timestamp.sol", "0.5.1"), + Test( + all_detectors.StateShadowing, + "tests/detectors/shadowing-state/0.5.16/shadowing_state_variable.sol", + "0.5.16", + ), + Test( + all_detectors.StateShadowing, + "tests/detectors/shadowing-state/0.6.11/shadowing_state_variable.sol", + "0.6.11", + ), + Test( + all_detectors.StateShadowing, + "tests/detectors/shadowing-state/0.7.6/shadowing_state_variable.sol", + "0.7.6", + ), + Test(all_detectors.Timestamp, "tests/detectors/timestamp/0.4.25/timestamp.sol", "0.4.25"), + Test(all_detectors.Timestamp, "tests/detectors/timestamp/0.5.16/timestamp.sol", "0.5.16"), + Test(all_detectors.Timestamp, "tests/detectors/timestamp/0.6.11/timestamp.sol", "0.6.11"), + Test(all_detectors.Timestamp, "tests/detectors/timestamp/0.7.6/timestamp.sol", "0.7.6"), Test( all_detectors.MultipleCallsInLoop, - "tests/detectors/calls-loop/multiple_calls_in_loop.sol", + "tests/detectors/calls-loop/0.4.25/multiple_calls_in_loop.sol", "0.4.25", ), + Test( + all_detectors.MultipleCallsInLoop, + "tests/detectors/calls-loop/0.5.16/multiple_calls_in_loop.sol", + "0.5.16", + ), + Test( + all_detectors.MultipleCallsInLoop, + "tests/detectors/calls-loop/0.6.11/multiple_calls_in_loop.sol", + "0.6.11", + ), + Test( + all_detectors.MultipleCallsInLoop, + "tests/detectors/calls-loop/0.7.6/multiple_calls_in_loop.sol", + "0.7.6", + ), Test( all_detectors.BuiltinSymbolShadowing, - "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol", + "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", "0.4.25", ), + Test( + all_detectors.BuiltinSymbolShadowing, + "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "0.5.16", + ), Test( all_detectors.LocalShadowing, - "tests/detectors/shadowing-local/shadowing_local_variable.sol", + "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", "0.4.25", ), + Test( + all_detectors.LocalShadowing, + "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "0.5.16", + ), + Test( + all_detectors.LocalShadowing, + "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "0.6.11", + ), + Test( + all_detectors.LocalShadowing, + "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "0.7.6", + ), Test( all_detectors.RightToLeftOverride, - "tests/detectors/rtlo/right_to_left_override.sol", + "tests/detectors/rtlo/0.4.25/right_to_left_override.sol", "0.4.25", ), - Test(all_detectors.VoidConstructor, "tests/detectors/void-cst/void-cst.sol", "0.5.1"), + Test( + all_detectors.RightToLeftOverride, + "tests/detectors/rtlo/0.5.16/right_to_left_override.sol", + "0.5.16", + ), + Test( + all_detectors.RightToLeftOverride, + "tests/detectors/rtlo/0.6.11/right_to_left_override.sol", + "0.6.11", + ), + Test(all_detectors.VoidConstructor, "tests/detectors/void-cst/0.4.25/void-cst.sol", "0.4.25"), + Test(all_detectors.VoidConstructor, "tests/detectors/void-cst/0.5.16/void-cst.sol", "0.5.16"), + Test(all_detectors.VoidConstructor, "tests/detectors/void-cst/0.6.11/void-cst.sol", "0.6.11"), + Test(all_detectors.VoidConstructor, "tests/detectors/void-cst/0.7.6/void-cst.sol", "0.7.6"), Test( all_detectors.UncheckedSend, - "tests/detectors/unchecked-send/unchecked_send-0.5.1.sol", - "0.5.1", + "tests/detectors/unchecked-send/0.4.25/unchecked_send.sol", + "0.4.25", + ), + Test( + all_detectors.UncheckedSend, + "tests/detectors/unchecked-send/0.5.16/unchecked_send.sol", + "0.5.16", + ), + Test( + all_detectors.UncheckedSend, + "tests/detectors/unchecked-send/0.6.11/unchecked_send.sol", + "0.6.11", + ), + Test( + all_detectors.UncheckedSend, + "tests/detectors/unchecked-send/0.7.6/unchecked_send.sol", + "0.7.6", + ), + Test( + all_detectors.ReentrancyEvent, + "tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol", + "0.5.16", ), Test( all_detectors.ReentrancyEvent, - "tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol", - "0.5.1", + "tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol", + "0.6.11", + ), + Test( + all_detectors.ReentrancyEvent, + "tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol", + "0.7.6", + ), + Test( + all_detectors.IncorrectStrictEquality, + "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", + "0.4.25", + ), + Test( + all_detectors.IncorrectStrictEquality, + "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "0.5.16", + ), + Test( + all_detectors.IncorrectStrictEquality, + "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "0.6.11", ), Test( all_detectors.IncorrectStrictEquality, - "tests/detectors/incorrect-equality/incorrect_equality.sol", - "0.5.1", + "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "0.7.6", + ), + Test( + all_detectors.TooManyDigits, + "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", + "0.4.25", + ), + Test( + all_detectors.TooManyDigits, + "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "0.5.16", + ), + Test( + all_detectors.TooManyDigits, + "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "0.6.11", ), Test( - all_detectors.TooManyDigits, "tests/detectors/too-many-digits/too_many_digits.sol", "0.5.1" + all_detectors.TooManyDigits, + "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "0.7.6", ), Test( all_detectors.UnprotectedUpgradeable, - "tests/detectors/unprotected-upgrade/Buggy.sol", - "0.6.12", + "tests/detectors/unprotected-upgrade/0.4.25/Buggy.sol", + "0.4.25", ), Test( all_detectors.UnprotectedUpgradeable, - "tests/detectors/unprotected-upgrade/Fixed.sol", - "0.6.12", + "tests/detectors/unprotected-upgrade/0.4.25/Fixed.sol", + "0.4.25", + ), + Test( + all_detectors.UnprotectedUpgradeable, + "tests/detectors/unprotected-upgrade/0.5.16/Buggy.sol", + "0.5.16", + ), + Test( + all_detectors.UnprotectedUpgradeable, + "tests/detectors/unprotected-upgrade/0.5.16/Fixed.sol", + "0.5.16", + ), + Test( + all_detectors.UnprotectedUpgradeable, + "tests/detectors/unprotected-upgrade/0.6.11/Buggy.sol", + "0.6.11", + ), + Test( + all_detectors.UnprotectedUpgradeable, + "tests/detectors/unprotected-upgrade/0.6.11/Fixed.sol", + "0.6.11", + ), + Test( + all_detectors.UnprotectedUpgradeable, + "tests/detectors/unprotected-upgrade/0.7.6/Buggy.sol", + "0.7.6", + ), + Test( + all_detectors.UnprotectedUpgradeable, + "tests/detectors/unprotected-upgrade/0.7.6/Fixed.sol", + "0.7.6", ), Test( all_detectors.NamingConvention, - "tests/detectors/naming-convention/naming_convention_ignore.sol", + "tests/detectors/naming-convention/0.4.25/naming_convention_ignore.sol", "0.4.25", ), Test( all_detectors.ABIEncoderV2Array, - "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", + "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "0.4.25", ), + Test( + all_detectors.ABIEncoderV2Array, + "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "0.5.10", + ), + Test( + all_detectors.ABIEncoderV2Array, + "tests/detectors/abiencoderv2-array/0.5.11/storage_ABIEncoderV2_array.sol", + "0.5.11", + ), Test( all_detectors.ArrayByReference, - "tests/detectors/array-by-reference/array_by_reference.sol", + "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", "0.4.25", ), + Test( + all_detectors.ArrayByReference, + "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "0.5.16", + ), + Test( + all_detectors.ArrayByReference, + "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "0.6.11", + ), + Test( + all_detectors.ArrayByReference, + "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "0.7.6", + ), Test( all_detectors.AssertStateChange, - "tests/detectors/assert-state-change/assert_state_change.sol", - "0.5.8", + "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "0.4.25", + ), + Test( + all_detectors.AssertStateChange, + "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "0.5.16", + ), + Test( + all_detectors.AssertStateChange, + "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "0.6.11", + ), + Test( + all_detectors.AssertStateChange, + "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", + "0.7.6", ), Test( all_detectors.ArrayLengthAssignment, - "tests/detectors/controlled-array-length/array_length_assignment.sol", + "tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol", "0.4.25", ), + Test( + all_detectors.ArrayLengthAssignment, + "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", + "0.5.16", + ), Test( all_detectors.CostlyOperationsInLoop, - "tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol", + "tests/detectors/costly-loop/0.4.25/multiple_costly_operations_in_loop.sol", "0.4.25", ), + Test( + all_detectors.CostlyOperationsInLoop, + "tests/detectors/costly-loop/0.5.16/multiple_costly_operations_in_loop.sol", + "0.5.16", + ), + Test( + all_detectors.CostlyOperationsInLoop, + "tests/detectors/costly-loop/0.6.11/multiple_costly_operations_in_loop.sol", + "0.6.11", + ), + Test( + all_detectors.CostlyOperationsInLoop, + "tests/detectors/costly-loop/0.7.6/multiple_costly_operations_in_loop.sol", + "0.7.6", + ), Test( all_detectors.FunctionInitializedState, - "tests/detectors/function-init-state/function_init_state_variables.sol", + "tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol", "0.4.25", ), + Test( + all_detectors.FunctionInitializedState, + "tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol", + "0.5.16", + ), + Test( + all_detectors.FunctionInitializedState, + "tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol", + "0.6.11", + ), + Test( + all_detectors.FunctionInitializedState, + "tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol", + "0.7.6", + ), Test( all_detectors.MappingDeletionDetection, - "tests/detectors/mapping-deletion/MappingDeletion.sol", + "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", "0.4.25", ), + Test( + all_detectors.MappingDeletionDetection, + "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "0.5.16", + ), + Test( + all_detectors.MappingDeletionDetection, + "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "0.6.11", + ), + Test( + all_detectors.MappingDeletionDetection, + "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", + "0.7.6", + ), + Test( + all_detectors.UnimplementedFunctionDetection, + "tests/detectors/missing-inheritance/0.5.16/unimplemented_interfaces.sol", + "0.5.16", + ), + Test( + all_detectors.UnimplementedFunctionDetection, + "tests/detectors/missing-inheritance/0.6.11/unimplemented_interfaces.sol", + "0.6.11", + ), Test( all_detectors.UnimplementedFunctionDetection, - "tests/detectors/missing-inheritance/unimplemented_interfaces.sol", - "0.5.12", + "tests/detectors/missing-inheritance/0.7.6/unimplemented_interfaces.sol", + "0.7.6", ), Test( all_detectors.PublicMappingNested, - "tests/detectors/public-mappings-nested/public_mappings_nested.sol", + "tests/detectors/public-mappings-nested/0.4.25/public_mappings_nested.sol", "0.4.25", ), Test( all_detectors.RedundantStatements, - "tests/detectors/redundant-statements/redundant_statements.sol", + "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", "0.4.25", ), + Test( + all_detectors.RedundantStatements, + "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "0.5.16", + ), + Test( + all_detectors.RedundantStatements, + "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "0.6.11", + ), + Test( + all_detectors.RedundantStatements, + "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "0.7.6", + ), Test( all_detectors.ReusedBaseConstructor, - "tests/detectors/reused-constructor/reused_base_constructor.sol", + "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "0.4.21", + ), + Test( + all_detectors.ReusedBaseConstructor, + "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", "0.4.25", ), Test( all_detectors.StorageSignedIntegerArray, - "tests/detectors/storage-array/storage_signed_integer_array.sol", - "0.5.8", + "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol", + "0.5.10", + ), + Test( + all_detectors.StorageSignedIntegerArray, + "tests/detectors/storage-array/0.5.16/storage_signed_integer_array.sol", + "0.5.16", ), Test( all_detectors.UnimplementedFunctionDetection, - "tests/detectors/unimplemented-functions/unimplemented.sol", + "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", "0.4.25", ), Test( - all_detectors.UninitializedFunctionPtrsConstructor, - "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", - "0.5.8", + all_detectors.UnimplementedFunctionDetection, + "tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol", + "0.5.16", + ), + Test( + all_detectors.UnimplementedFunctionDetection, + "tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol", + "0.6.11", + ), + Test( + all_detectors.UnimplementedFunctionDetection, + "tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol", + "0.7.6", + ), + Test(all_detectors.BadPRNG, "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "0.4.25"), + Test(all_detectors.BadPRNG, "tests/detectors/weak-prng/0.5.16/bad_prng.sol", "0.5.16"), + Test(all_detectors.BadPRNG, "tests/detectors/weak-prng/0.6.11/bad_prng.sol", "0.6.11"), + Test(all_detectors.BadPRNG, "tests/detectors/weak-prng/0.7.6/bad_prng.sol", "0.7.6"), + Test( + all_detectors.MissingEventsAccessControl, + "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "0.4.25", + ), + Test( + all_detectors.MissingEventsAccessControl, + "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "0.5.16", + ), + Test( + all_detectors.MissingEventsAccessControl, + "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "0.6.11", + ), + Test( + all_detectors.MissingEventsAccessControl, + "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "0.7.6", + ), + Test( + all_detectors.MissingEventsArithmetic, + "tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol", + "0.4.25", + ), + Test( + all_detectors.MissingEventsArithmetic, + "tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol", + "0.5.16", ), - Test(all_detectors.BadPRNG, "tests/detectors/weak-prng/bad_prng.sol", "0.4.25"), Test( all_detectors.MissingEventsArithmetic, - "tests/detectors/events-access/missing_events_access_control.sol", - "0.5.12", + "tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol", + "0.6.11", ), Test( all_detectors.MissingEventsArithmetic, - "tests/detectors/events-maths/missing_events_arithmetic.sol", - "0.5.12", + "tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol", + "0.7.6", ), Test( all_detectors.ModifierDefaultDetection, - "tests/detectors/incorrect-modifier/modifier_default.sol", + "tests/detectors/incorrect-modifier/0.4.25/modifier_default.sol", "0.4.25", ), + Test( + all_detectors.ModifierDefaultDetection, + "tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol", + "0.5.16", + ), + Test( + all_detectors.ModifierDefaultDetection, + "tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol", + "0.6.11", + ), + Test( + all_detectors.ModifierDefaultDetection, + "tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol", + "0.7.6", + ), Test( all_detectors.IncorrectUnaryExpressionDetection, - "tests/detectors/incorrect-unary/invalid_unary_expression.sol", + "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", + "0.4.25", + ), + Test( + all_detectors.MissingZeroAddressValidation, + "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", "0.4.25", ), Test( all_detectors.MissingZeroAddressValidation, - "tests/detectors/missing-zero-check/missing_zero_address_validation.sol", - "0.5.12", + "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "0.5.16", + ), + Test( + all_detectors.MissingZeroAddressValidation, + "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "0.6.11", + ), + Test( + all_detectors.MissingZeroAddressValidation, + "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", + "0.7.6", ), Test( all_detectors.PredeclarationUsageLocal, - "tests/detectors/variable-scope/predeclaration_usage_local.sol", + "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", "0.4.25", ), ] From c4948d2cea2edf2e1fb15b906d1780f75ef4ad4d Mon Sep 17 00:00:00 2001 From: Alexander Remie Date: Tue, 13 Apr 2021 15:06:16 +0200 Subject: [PATCH 2/3] deduce test file path from solc version and detector name --- ...V2_array.sol.0.4.25.ABIEncoderV2Array.json | 220 +++---- ...V2_array.sol.0.5.10.ABIEncoderV2Array.json | 220 +++---- ...bitrary_send.sol.0.4.25.ArbitrarySend.json | 388 ----------- .../0.4.25/boolean-constant-misuse.sol | 0 ...suse.sol.0.4.25.BooleanConstantMisuse.json | 26 +- .../0.5.16/boolean-constant-misuse.sol | 0 ...suse.sol.0.5.16.BooleanConstantMisuse.json | 26 +- .../0.6.11/boolean-constant-misuse.sol | 0 ...suse.sol.0.6.11.BooleanConstantMisuse.json | 26 +- .../0.7.6/boolean-constant-misuse.sol | 0 ...isuse.sol.0.7.6.BooleanConstantMisuse.json | 26 +- .../0.4.25/boolean-constant-equality.sol | 0 ...t-equality.sol.0.4.25.BooleanEquality.json | 26 +- .../0.5.16/boolean-constant-equality.sol | 0 ...t-equality.sol.0.5.16.BooleanEquality.json | 26 +- .../0.6.11/boolean-constant-equality.sol | 0 ...t-equality.sol.0.6.11.BooleanEquality.json | 26 +- .../0.7.6/boolean-constant-equality.sol | 0 ...nt-equality.sol.0.7.6.BooleanEquality.json | 26 +- .../0.4.25/constant.sol | 0 ...stant.sol.0.4.25.ConstantFunctionsAsm.json | 12 +- .../0.5.16/constant.sol | 0 ...stant.sol.0.5.16.ConstantFunctionsAsm.json | 0 .../0.6.11/constant.sol | 0 ...stant.sol.0.6.11.ConstantFunctionsAsm.json | 0 .../0.7.6/constant.sol | 0 ...nstant.sol.0.7.6.ConstantFunctionsAsm.json | 0 .../0.4.25/constant.sol | 25 + ...ant.sol.0.4.25.ConstantFunctionsState.json | 40 +- .../0.5.16/constant.sol | 20 + ...ant.sol.0.5.16.ConstantFunctionsState.json | 0 .../0.6.11/constant.sol | 20 + ...ant.sol.0.6.11.ConstantFunctionsState.json | 0 .../0.7.6/constant.sol | 20 + ...tant.sol.0.7.6.ConstantFunctionsState.json | 0 ...ment.sol.0.5.16.ArrayLengthAssignment.json | 50 +- ...on_ignore.sol.0.4.25.NamingConvention.json | 76 --- ...on_ignore.sol.0.5.16.NamingConvention.json | 76 --- ...on_ignore.sol.0.6.11.NamingConvention.json | 76 --- ...ion_ignore.sol.0.7.6.NamingConvention.json | 76 --- .../0.4.25/reentrancy-write.sol | 0 ...ol.0.4.25.ReentrancyReadBeforeWritten.json | 112 ++-- .../0.5.16/reentrancy-write.sol | 0 ...ol.0.5.16.ReentrancyReadBeforeWritten.json | 112 ++-- .../0.6.11/reentrancy-write.sol | 0 ...ol.0.6.11.ReentrancyReadBeforeWritten.json | 112 ++-- .../0.7.6/reentrancy-write.sol | 0 ...sol.0.7.6.ReentrancyReadBeforeWritten.json | 112 ++-- .../0.5.16/unimplemented_interfaces.sol | 0 ...0.5.16.UnimplementedFunctionDetection.json | 0 .../0.6.11/unimplemented_interfaces.sol | 0 ...0.6.11.UnimplementedFunctionDetection.json | 0 .../0.7.6/unimplemented_interfaces.sol | 0 ....0.7.6.UnimplementedFunctionDetection.json | 0 tests/test_detectors.py | 621 +++++++++--------- 55 files changed, 987 insertions(+), 1609 deletions(-) delete mode 100644 tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol.0.4.25.ArbitrarySend.json rename tests/detectors/{boolean-constant-misuse => boolean-cst}/0.4.25/boolean-constant-misuse.sol (100%) rename tests/detectors/{boolean-constant-misuse => boolean-cst}/0.4.25/boolean-constant-misuse.sol.0.4.25.BooleanConstantMisuse.json (88%) rename tests/detectors/{boolean-constant-misuse => boolean-cst}/0.5.16/boolean-constant-misuse.sol (100%) rename tests/detectors/{boolean-constant-misuse => boolean-cst}/0.5.16/boolean-constant-misuse.sol.0.5.16.BooleanConstantMisuse.json (88%) rename tests/detectors/{boolean-constant-misuse => boolean-cst}/0.6.11/boolean-constant-misuse.sol (100%) rename tests/detectors/{boolean-constant-misuse => boolean-cst}/0.6.11/boolean-constant-misuse.sol.0.6.11.BooleanConstantMisuse.json (88%) rename tests/detectors/{boolean-constant-misuse => boolean-cst}/0.7.6/boolean-constant-misuse.sol (100%) rename tests/detectors/{boolean-constant-misuse => boolean-cst}/0.7.6/boolean-constant-misuse.sol.0.7.6.BooleanConstantMisuse.json (88%) rename tests/detectors/{boolean-constant-equality => boolean-equal}/0.4.25/boolean-constant-equality.sol (100%) rename tests/detectors/{boolean-constant-equality => boolean-equal}/0.4.25/boolean-constant-equality.sol.0.4.25.BooleanEquality.json (86%) rename tests/detectors/{boolean-constant-equality => boolean-equal}/0.5.16/boolean-constant-equality.sol (100%) rename tests/detectors/{boolean-constant-equality => boolean-equal}/0.5.16/boolean-constant-equality.sol.0.5.16.BooleanEquality.json (86%) rename tests/detectors/{boolean-constant-equality => boolean-equal}/0.6.11/boolean-constant-equality.sol (100%) rename tests/detectors/{boolean-constant-equality => boolean-equal}/0.6.11/boolean-constant-equality.sol.0.6.11.BooleanEquality.json (86%) rename tests/detectors/{boolean-constant-equality => boolean-equal}/0.7.6/boolean-constant-equality.sol (100%) rename tests/detectors/{boolean-constant-equality => boolean-equal}/0.7.6/boolean-constant-equality.sol.0.7.6.BooleanEquality.json (86%) rename tests/detectors/{constant => constant-function-asm}/0.4.25/constant.sol (100%) rename tests/detectors/{constant => constant-function-asm}/0.4.25/constant.sol.0.4.25.ConstantFunctionsAsm.json (89%) rename tests/detectors/{constant => constant-function-asm}/0.5.16/constant.sol (100%) rename tests/detectors/{constant => constant-function-asm}/0.5.16/constant.sol.0.5.16.ConstantFunctionsAsm.json (100%) rename tests/detectors/{constant => constant-function-asm}/0.6.11/constant.sol (100%) rename tests/detectors/{constant => constant-function-asm}/0.6.11/constant.sol.0.6.11.ConstantFunctionsAsm.json (100%) rename tests/detectors/{constant => constant-function-asm}/0.7.6/constant.sol (100%) rename tests/detectors/{constant => constant-function-asm}/0.7.6/constant.sol.0.7.6.ConstantFunctionsAsm.json (100%) create mode 100644 tests/detectors/constant-function-state/0.4.25/constant.sol rename tests/detectors/{constant => constant-function-state}/0.4.25/constant.sol.0.4.25.ConstantFunctionsState.json (88%) create mode 100644 tests/detectors/constant-function-state/0.5.16/constant.sol rename tests/detectors/{constant => constant-function-state}/0.5.16/constant.sol.0.5.16.ConstantFunctionsState.json (100%) create mode 100644 tests/detectors/constant-function-state/0.6.11/constant.sol rename tests/detectors/{constant => constant-function-state}/0.6.11/constant.sol.0.6.11.ConstantFunctionsState.json (100%) create mode 100644 tests/detectors/constant-function-state/0.7.6/constant.sol rename tests/detectors/{constant => constant-function-state}/0.7.6/constant.sol.0.7.6.ConstantFunctionsState.json (100%) delete mode 100644 tests/detectors/naming-convention/0.4.25/naming_convention_ignore.sol.0.4.25.NamingConvention.json delete mode 100644 tests/detectors/naming-convention/0.5.16/naming_convention_ignore.sol.0.5.16.NamingConvention.json delete mode 100644 tests/detectors/naming-convention/0.6.11/naming_convention_ignore.sol.0.6.11.NamingConvention.json delete mode 100644 tests/detectors/naming-convention/0.7.6/naming_convention_ignore.sol.0.7.6.NamingConvention.json rename tests/detectors/{reentrancy-before-write => reentrancy-no-eth}/0.4.25/reentrancy-write.sol (100%) rename tests/detectors/{reentrancy-before-write => reentrancy-no-eth}/0.4.25/reentrancy-write.sol.0.4.25.ReentrancyReadBeforeWritten.json (88%) rename tests/detectors/{reentrancy-before-write => reentrancy-no-eth}/0.5.16/reentrancy-write.sol (100%) rename tests/detectors/{reentrancy-before-write => reentrancy-no-eth}/0.5.16/reentrancy-write.sol.0.5.16.ReentrancyReadBeforeWritten.json (88%) rename tests/detectors/{reentrancy-before-write => reentrancy-no-eth}/0.6.11/reentrancy-write.sol (100%) rename tests/detectors/{reentrancy-before-write => reentrancy-no-eth}/0.6.11/reentrancy-write.sol.0.6.11.ReentrancyReadBeforeWritten.json (88%) rename tests/detectors/{reentrancy-before-write => reentrancy-no-eth}/0.7.6/reentrancy-write.sol (100%) rename tests/detectors/{reentrancy-before-write => reentrancy-no-eth}/0.7.6/reentrancy-write.sol.0.7.6.ReentrancyReadBeforeWritten.json (88%) rename tests/detectors/{missing-inheritance => unimplemented-functions}/0.5.16/unimplemented_interfaces.sol (100%) rename tests/detectors/{missing-inheritance => unimplemented-functions}/0.5.16/unimplemented_interfaces.sol.0.5.16.UnimplementedFunctionDetection.json (100%) rename tests/detectors/{missing-inheritance => unimplemented-functions}/0.6.11/unimplemented_interfaces.sol (100%) rename tests/detectors/{missing-inheritance => unimplemented-functions}/0.6.11/unimplemented_interfaces.sol.0.6.11.UnimplementedFunctionDetection.json (100%) rename tests/detectors/{missing-inheritance => unimplemented-functions}/0.7.6/unimplemented_interfaces.sol (100%) rename tests/detectors/{missing-inheritance => unimplemented-functions}/0.7.6/unimplemented_interfaces.sol.0.7.6.UnimplementedFunctionDetection.json (100%) diff --git a/tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol.0.4.25.ABIEncoderV2Array.json b/tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol.0.4.25.ABIEncoderV2Array.json index 5efc65c52a..e17fd33b21 100644 --- a/tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol.0.4.25.ABIEncoderV2Array.json +++ b/tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol.0.4.25.ABIEncoderV2Array.json @@ -4,19 +4,19 @@ "elements": [ { "type": "function", - "name": "bad4", + "name": "bad1", "source_mapping": { - "start": 1296, - "length": 148, + "start": 726, + "length": 63, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 44, - 45, - 46 + 29, + 30, + 31 ], "starting_column": 3, "ending_column": 4 @@ -136,42 +136,42 @@ "ending_column": 2 } }, - "signature": "bad4()" + "signature": "bad1(A.S[3])" } }, { "type": "node", - "name": "event1_bad(bad_arr)", + "name": "this.bad1_external(s)", "source_mapping": { - "start": 1415, - "length": 24, + "start": 763, + "length": 21, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 45 + 30 ], "starting_column": 5, - "ending_column": 29 + "ending_column": 26 }, "type_specific_fields": { "parent": { "type": "function", - "name": "bad4", + "name": "bad1", "source_mapping": { - "start": 1296, - "length": 148, + "start": 726, + "length": 63, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 44, - 45, - 46 + 29, + 30, + 31 ], "starting_column": 3, "ending_column": 4 @@ -291,15 +291,15 @@ "ending_column": 2 } }, - "signature": "bad4()" + "signature": "bad1(A.S[3])" } } } } ], - "description": "Function A.bad4() (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#44-46) trigger an abi encoding bug:\n\t- event1_bad(bad_arr) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#45)\n", - "markdown": "Function [A.bad4()](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L44-L46) trigger an abi encoding bug:\n\t- [event1_bad(bad_arr)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L45)\n", - "id": "144c77aebb4037fe38c2864892ecb888a4fb7d5e92e321e664b2d2226658a166", + "description": "Function A.bad1(A.S[3]) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#29-31) trigger an abi encoding bug:\n\t- this.bad1_external(s) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#30)\n", + "markdown": "Function [A.bad1(A.S[3])](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L29-L31) trigger an abi encoding bug:\n\t- [this.bad1_external(s)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L30)\n", + "id": "3febdd98f71332c80290c9557c5ef89ea9dbea4f520a084b0307f21b00da5010", "check": "abiencoderv2-array", "impact": "High", "confidence": "High" @@ -612,19 +612,19 @@ "elements": [ { "type": "function", - "name": "bad2", + "name": "bad4", "source_mapping": { - "start": 852, - "length": 160, + "start": 1296, + "length": 148, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 34, - 35, - 36 + 44, + 45, + 46 ], "starting_column": 3, "ending_column": 4 @@ -744,42 +744,42 @@ "ending_column": 2 } }, - "signature": "bad2()" + "signature": "bad4()" } }, { "type": "node", - "name": "b = abi.encode(bad_arr)", + "name": "event1_bad(bad_arr)", "source_mapping": { - "start": 971, - "length": 36, + "start": 1415, + "length": 24, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 35 + 45 ], "starting_column": 5, - "ending_column": 41 + "ending_column": 29 }, "type_specific_fields": { "parent": { "type": "function", - "name": "bad2", + "name": "bad4", "source_mapping": { - "start": 852, - "length": 160, + "start": 1296, + "length": 148, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 34, - 35, - 36 + 44, + 45, + 46 ], "starting_column": 3, "ending_column": 4 @@ -899,15 +899,15 @@ "ending_column": 2 } }, - "signature": "bad2()" + "signature": "bad4()" } } } } ], - "description": "Function A.bad2() (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#34-36) trigger an abi encoding bug:\n\t- b = abi.encode(bad_arr) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#35)\n", - "markdown": "Function [A.bad2()](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L34-L36) trigger an abi encoding bug:\n\t- [b = abi.encode(bad_arr)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L35)\n", - "id": "d5860309d331920d1e3f44508fea706df75a4a7c2e93666ca96ca00ef32d7e01", + "description": "Function A.bad4() (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#44-46) trigger an abi encoding bug:\n\t- event1_bad(bad_arr) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#45)\n", + "markdown": "Function [A.bad4()](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L44-L46) trigger an abi encoding bug:\n\t- [event1_bad(bad_arr)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L45)\n", + "id": "144c77aebb4037fe38c2864892ecb888a4fb7d5e92e321e664b2d2226658a166", "check": "abiencoderv2-array", "impact": "High", "confidence": "High" @@ -916,19 +916,19 @@ "elements": [ { "type": "function", - "name": "bad0", + "name": "bad5", "source_mapping": { - "start": 540, - "length": 61, + "start": 1511, + "length": 142, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 21, - 22, - 23 + 49, + 50, + 51 ], "starting_column": 3, "ending_column": 4 @@ -1048,42 +1048,42 @@ "ending_column": 2 } }, - "signature": "bad0()" + "signature": "bad5()" } }, { "type": "node", - "name": "this.bad0_external(bad_arr)", + "name": "event2_bad(s)", "source_mapping": { - "start": 569, - "length": 27, + "start": 1630, + "length": 18, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 22 + 50 ], "starting_column": 5, - "ending_column": 32 + "ending_column": 23 }, "type_specific_fields": { "parent": { "type": "function", - "name": "bad0", + "name": "bad5", "source_mapping": { - "start": 540, - "length": 61, + "start": 1511, + "length": 142, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 21, - 22, - 23 + 49, + 50, + 51 ], "starting_column": 3, "ending_column": 4 @@ -1203,15 +1203,15 @@ "ending_column": 2 } }, - "signature": "bad0()" + "signature": "bad5()" } } } } ], - "description": "Function A.bad0() (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#21-23) trigger an abi encoding bug:\n\t- this.bad0_external(bad_arr) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#22)\n", - "markdown": "Function [A.bad0()](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L21-L23) trigger an abi encoding bug:\n\t- [this.bad0_external(bad_arr)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L22)\n", - "id": "3752da45df0ba78cc9ac01a10b398e4ad74e6ddd572764cf2f361e523a43a998", + "description": "Function A.bad5() (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#49-51) trigger an abi encoding bug:\n\t- event2_bad(s) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#50)\n", + "markdown": "Function [A.bad5()](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L49-L51) trigger an abi encoding bug:\n\t- [event2_bad(s)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L50)\n", + "id": "e77767c95f4548636027a859ca0c63402cfb50af242f116dd3cfc5b038a4128e", "check": "abiencoderv2-array", "impact": "High", "confidence": "High" @@ -1220,19 +1220,19 @@ "elements": [ { "type": "function", - "name": "bad5", + "name": "bad0", "source_mapping": { - "start": 1511, - "length": 142, + "start": 540, + "length": 61, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 49, - 50, - 51 + 21, + 22, + 23 ], "starting_column": 3, "ending_column": 4 @@ -1352,42 +1352,42 @@ "ending_column": 2 } }, - "signature": "bad5()" + "signature": "bad0()" } }, { "type": "node", - "name": "event2_bad(s)", + "name": "this.bad0_external(bad_arr)", "source_mapping": { - "start": 1630, - "length": 18, + "start": 569, + "length": 27, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 50 + 22 ], "starting_column": 5, - "ending_column": 23 + "ending_column": 32 }, "type_specific_fields": { "parent": { "type": "function", - "name": "bad5", + "name": "bad0", "source_mapping": { - "start": 1511, - "length": 142, + "start": 540, + "length": 61, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 49, - 50, - 51 + 21, + 22, + 23 ], "starting_column": 3, "ending_column": 4 @@ -1507,15 +1507,15 @@ "ending_column": 2 } }, - "signature": "bad5()" + "signature": "bad0()" } } } } ], - "description": "Function A.bad5() (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#49-51) trigger an abi encoding bug:\n\t- event2_bad(s) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#50)\n", - "markdown": "Function [A.bad5()](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L49-L51) trigger an abi encoding bug:\n\t- [event2_bad(s)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L50)\n", - "id": "e77767c95f4548636027a859ca0c63402cfb50af242f116dd3cfc5b038a4128e", + "description": "Function A.bad0() (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#21-23) trigger an abi encoding bug:\n\t- this.bad0_external(bad_arr) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#22)\n", + "markdown": "Function [A.bad0()](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L21-L23) trigger an abi encoding bug:\n\t- [this.bad0_external(bad_arr)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L22)\n", + "id": "3752da45df0ba78cc9ac01a10b398e4ad74e6ddd572764cf2f361e523a43a998", "check": "abiencoderv2-array", "impact": "High", "confidence": "High" @@ -1524,19 +1524,19 @@ "elements": [ { "type": "function", - "name": "bad1", + "name": "bad2", "source_mapping": { - "start": 726, - "length": 63, + "start": 852, + "length": 160, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 29, - 30, - 31 + 34, + 35, + 36 ], "starting_column": 3, "ending_column": 4 @@ -1656,42 +1656,42 @@ "ending_column": 2 } }, - "signature": "bad1(A.S[3])" + "signature": "bad2()" } }, { "type": "node", - "name": "this.bad1_external(s)", + "name": "b = abi.encode(bad_arr)", "source_mapping": { - "start": 763, - "length": 21, + "start": 971, + "length": 36, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 30 + 35 ], "starting_column": 5, - "ending_column": 26 + "ending_column": 41 }, "type_specific_fields": { "parent": { "type": "function", - "name": "bad1", + "name": "bad2", "source_mapping": { - "start": 726, - "length": 63, + "start": 852, + "length": 160, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 29, - 30, - 31 + 34, + 35, + 36 ], "starting_column": 3, "ending_column": 4 @@ -1811,15 +1811,15 @@ "ending_column": 2 } }, - "signature": "bad1(A.S[3])" + "signature": "bad2()" } } } } ], - "description": "Function A.bad1(A.S[3]) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#29-31) trigger an abi encoding bug:\n\t- this.bad1_external(s) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#30)\n", - "markdown": "Function [A.bad1(A.S[3])](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L29-L31) trigger an abi encoding bug:\n\t- [this.bad1_external(s)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L30)\n", - "id": "3febdd98f71332c80290c9557c5ef89ea9dbea4f520a084b0307f21b00da5010", + "description": "Function A.bad2() (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#34-36) trigger an abi encoding bug:\n\t- b = abi.encode(bad_arr) (tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#35)\n", + "markdown": "Function [A.bad2()](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L34-L36) trigger an abi encoding bug:\n\t- [b = abi.encode(bad_arr)](tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol#L35)\n", + "id": "d5860309d331920d1e3f44508fea706df75a4a7c2e93666ca96ca00ef32d7e01", "check": "abiencoderv2-array", "impact": "High", "confidence": "High" diff --git a/tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol.0.5.10.ABIEncoderV2Array.json b/tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol.0.5.10.ABIEncoderV2Array.json index 1616cc0e48..32e73918f5 100644 --- a/tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol.0.5.10.ABIEncoderV2Array.json +++ b/tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol.0.5.10.ABIEncoderV2Array.json @@ -4,19 +4,19 @@ "elements": [ { "type": "function", - "name": "bad4", + "name": "bad5", "source_mapping": { - "start": 1321, - "length": 148, + "start": 1536, + "length": 142, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 44, - 45, - 46 + 49, + 50, + 51 ], "starting_column": 3, "ending_column": 4 @@ -136,42 +136,42 @@ "ending_column": 2 } }, - "signature": "bad4()" + "signature": "bad5()" } }, { "type": "node", - "name": "event1_bad(bad_arr)", + "name": "event2_bad(s)", "source_mapping": { - "start": 1440, - "length": 24, + "start": 1655, + "length": 18, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 45 + 50 ], "starting_column": 5, - "ending_column": 29 + "ending_column": 23 }, "type_specific_fields": { "parent": { "type": "function", - "name": "bad4", + "name": "bad5", "source_mapping": { - "start": 1321, - "length": 148, + "start": 1536, + "length": 142, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 44, - 45, - 46 + 49, + 50, + 51 ], "starting_column": 3, "ending_column": 4 @@ -291,15 +291,15 @@ "ending_column": 2 } }, - "signature": "bad4()" + "signature": "bad5()" } } } } ], - "description": "Function A.bad4() (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#44-46) trigger an abi encoding bug:\n\t- event1_bad(bad_arr) (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#45)\n", - "markdown": "Function [A.bad4()](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L44-L46) trigger an abi encoding bug:\n\t- [event1_bad(bad_arr)](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L45)\n", - "id": "41b64698d5678d4095816d22b2d431371ca18801800bcf35b077e2675724a4e6", + "description": "Function A.bad5() (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#49-51) trigger an abi encoding bug:\n\t- event2_bad(s) (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#50)\n", + "markdown": "Function [A.bad5()](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L49-L51) trigger an abi encoding bug:\n\t- [event2_bad(s)](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L50)\n", + "id": "eeb6e1300bf8056da088cb4f3e2703471fee9fdca73774ce3643fb884954d216", "check": "abiencoderv2-array", "impact": "High", "confidence": "High" @@ -308,19 +308,19 @@ "elements": [ { "type": "function", - "name": "bad0", + "name": "bad1", "source_mapping": { - "start": 549, - "length": 61, + "start": 744, + "length": 70, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 21, - 22, - 23 + 29, + 30, + 31 ], "starting_column": 3, "ending_column": 4 @@ -440,42 +440,42 @@ "ending_column": 2 } }, - "signature": "bad0()" + "signature": "bad1(A.S[3])" } }, { "type": "node", - "name": "this.bad0_external(bad_arr)", + "name": "this.bad1_external(s)", "source_mapping": { - "start": 578, - "length": 27, + "start": 788, + "length": 21, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 22 + 30 ], "starting_column": 5, - "ending_column": 32 + "ending_column": 26 }, "type_specific_fields": { "parent": { "type": "function", - "name": "bad0", + "name": "bad1", "source_mapping": { - "start": 549, - "length": 61, + "start": 744, + "length": 70, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 21, - 22, - 23 + 29, + 30, + 31 ], "starting_column": 3, "ending_column": 4 @@ -595,15 +595,15 @@ "ending_column": 2 } }, - "signature": "bad0()" + "signature": "bad1(A.S[3])" } } } } ], - "description": "Function A.bad0() (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#21-23) trigger an abi encoding bug:\n\t- this.bad0_external(bad_arr) (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#22)\n", - "markdown": "Function [A.bad0()](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L21-L23) trigger an abi encoding bug:\n\t- [this.bad0_external(bad_arr)](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L22)\n", - "id": "f9335a48cb948e294b54605d1c63d61e863a824f3346be2db07c923896aafac0", + "description": "Function A.bad1(A.S[3]) (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#29-31) trigger an abi encoding bug:\n\t- this.bad1_external(s) (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#30)\n", + "markdown": "Function [A.bad1(A.S[3])](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L29-L31) trigger an abi encoding bug:\n\t- [this.bad1_external(s)](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L30)\n", + "id": "e432c7633b89e67459b76c1265a299e59fe6a651edd8888067df47200840451d", "check": "abiencoderv2-array", "impact": "High", "confidence": "High" @@ -612,19 +612,19 @@ "elements": [ { "type": "function", - "name": "bad5", + "name": "bad2", "source_mapping": { - "start": 1536, - "length": 142, + "start": 877, + "length": 160, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 49, - 50, - 51 + 34, + 35, + 36 ], "starting_column": 3, "ending_column": 4 @@ -744,42 +744,42 @@ "ending_column": 2 } }, - "signature": "bad5()" + "signature": "bad2()" } }, { "type": "node", - "name": "event2_bad(s)", + "name": "b = abi.encode(bad_arr)", "source_mapping": { - "start": 1655, - "length": 18, + "start": 996, + "length": 36, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 50 + 35 ], "starting_column": 5, - "ending_column": 23 + "ending_column": 41 }, "type_specific_fields": { "parent": { "type": "function", - "name": "bad5", + "name": "bad2", "source_mapping": { - "start": 1536, - "length": 142, + "start": 877, + "length": 160, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 49, - 50, - 51 + 34, + 35, + 36 ], "starting_column": 3, "ending_column": 4 @@ -899,15 +899,15 @@ "ending_column": 2 } }, - "signature": "bad5()" + "signature": "bad2()" } } } } ], - "description": "Function A.bad5() (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#49-51) trigger an abi encoding bug:\n\t- event2_bad(s) (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#50)\n", - "markdown": "Function [A.bad5()](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L49-L51) trigger an abi encoding bug:\n\t- [event2_bad(s)](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L50)\n", - "id": "eeb6e1300bf8056da088cb4f3e2703471fee9fdca73774ce3643fb884954d216", + "description": "Function A.bad2() (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#34-36) trigger an abi encoding bug:\n\t- b = abi.encode(bad_arr) (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#35)\n", + "markdown": "Function [A.bad2()](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L34-L36) trigger an abi encoding bug:\n\t- [b = abi.encode(bad_arr)](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L35)\n", + "id": "fb8e8ba854095891e3a490b43b126215858286a4a59902e7c63394a83befab0b", "check": "abiencoderv2-array", "impact": "High", "confidence": "High" @@ -916,19 +916,19 @@ "elements": [ { "type": "function", - "name": "bad2", + "name": "bad4", "source_mapping": { - "start": 877, - "length": 160, + "start": 1321, + "length": 148, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 34, - 35, - 36 + 44, + 45, + 46 ], "starting_column": 3, "ending_column": 4 @@ -1048,42 +1048,42 @@ "ending_column": 2 } }, - "signature": "bad2()" + "signature": "bad4()" } }, { "type": "node", - "name": "b = abi.encode(bad_arr)", + "name": "event1_bad(bad_arr)", "source_mapping": { - "start": 996, - "length": 36, + "start": 1440, + "length": 24, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 35 + 45 ], "starting_column": 5, - "ending_column": 41 + "ending_column": 29 }, "type_specific_fields": { "parent": { "type": "function", - "name": "bad2", + "name": "bad4", "source_mapping": { - "start": 877, - "length": 160, + "start": 1321, + "length": 148, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 34, - 35, - 36 + 44, + 45, + 46 ], "starting_column": 3, "ending_column": 4 @@ -1203,15 +1203,15 @@ "ending_column": 2 } }, - "signature": "bad2()" + "signature": "bad4()" } } } } ], - "description": "Function A.bad2() (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#34-36) trigger an abi encoding bug:\n\t- b = abi.encode(bad_arr) (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#35)\n", - "markdown": "Function [A.bad2()](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L34-L36) trigger an abi encoding bug:\n\t- [b = abi.encode(bad_arr)](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L35)\n", - "id": "fb8e8ba854095891e3a490b43b126215858286a4a59902e7c63394a83befab0b", + "description": "Function A.bad4() (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#44-46) trigger an abi encoding bug:\n\t- event1_bad(bad_arr) (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#45)\n", + "markdown": "Function [A.bad4()](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L44-L46) trigger an abi encoding bug:\n\t- [event1_bad(bad_arr)](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L45)\n", + "id": "41b64698d5678d4095816d22b2d431371ca18801800bcf35b077e2675724a4e6", "check": "abiencoderv2-array", "impact": "High", "confidence": "High" @@ -1524,19 +1524,19 @@ "elements": [ { "type": "function", - "name": "bad1", + "name": "bad0", "source_mapping": { - "start": 744, - "length": 70, + "start": 549, + "length": 61, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 29, - 30, - 31 + 21, + 22, + 23 ], "starting_column": 3, "ending_column": 4 @@ -1656,42 +1656,42 @@ "ending_column": 2 } }, - "signature": "bad1(A.S[3])" + "signature": "bad0()" } }, { "type": "node", - "name": "this.bad1_external(s)", + "name": "this.bad0_external(bad_arr)", "source_mapping": { - "start": 788, - "length": 21, + "start": 578, + "length": 27, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 30 + 22 ], "starting_column": 5, - "ending_column": 26 + "ending_column": 32 }, "type_specific_fields": { "parent": { "type": "function", - "name": "bad1", + "name": "bad0", "source_mapping": { - "start": 744, - "length": 70, + "start": 549, + "length": 61, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 29, - 30, - 31 + 21, + 22, + 23 ], "starting_column": 3, "ending_column": 4 @@ -1811,15 +1811,15 @@ "ending_column": 2 } }, - "signature": "bad1(A.S[3])" + "signature": "bad0()" } } } } ], - "description": "Function A.bad1(A.S[3]) (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#29-31) trigger an abi encoding bug:\n\t- this.bad1_external(s) (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#30)\n", - "markdown": "Function [A.bad1(A.S[3])](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L29-L31) trigger an abi encoding bug:\n\t- [this.bad1_external(s)](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L30)\n", - "id": "e432c7633b89e67459b76c1265a299e59fe6a651edd8888067df47200840451d", + "description": "Function A.bad0() (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#21-23) trigger an abi encoding bug:\n\t- this.bad0_external(bad_arr) (tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#22)\n", + "markdown": "Function [A.bad0()](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L21-L23) trigger an abi encoding bug:\n\t- [this.bad0_external(bad_arr)](tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol#L22)\n", + "id": "f9335a48cb948e294b54605d1c63d61e863a824f3346be2db07c923896aafac0", "check": "abiencoderv2-array", "impact": "High", "confidence": "High" diff --git a/tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol.0.4.25.ArbitrarySend.json b/tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol.0.4.25.ArbitrarySend.json deleted file mode 100644 index 2ead6ce0c3..0000000000 --- a/tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol.0.4.25.ArbitrarySend.json +++ /dev/null @@ -1,388 +0,0 @@ -[ - [ - { - "elements": [ - { - "type": "function", - "name": "direct", - "source_mapping": { - "start": 147, - "length": 79, - "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/arbitrary-send/arbitrary_send.sol", - "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/arbitrary-send/arbitrary_send.sol", - "is_dependency": false, - "lines": [ - 11, - 12, - 13 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "Test", - "source_mapping": { - "start": 0, - "length": 869, - "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/arbitrary-send/arbitrary_send.sol", - "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/arbitrary-send/arbitrary_send.sol", - "is_dependency": false, - "lines": [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 30, - 31, - 32, - 33, - 34, - 35, - 36, - 37, - 38, - 39, - 40, - 41 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "direct()" - } - }, - { - "type": "node", - "name": "msg.sender.send(address(this).balance)", - "source_mapping": { - "start": 181, - "length": 38, - "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/arbitrary-send/arbitrary_send.sol", - "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/arbitrary-send/arbitrary_send.sol", - "is_dependency": false, - "lines": [ - 12 - ], - "starting_column": 9, - "ending_column": 47 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "direct", - "source_mapping": { - "start": 147, - "length": 79, - "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/arbitrary-send/arbitrary_send.sol", - "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/arbitrary-send/arbitrary_send.sol", - "is_dependency": false, - "lines": [ - 11, - 12, - 13 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "Test", - "source_mapping": { - "start": 0, - "length": 869, - "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/arbitrary-send/arbitrary_send.sol", - "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/arbitrary-send/arbitrary_send.sol", - "is_dependency": false, - "lines": [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 30, - 31, - 32, - 33, - 34, - 35, - 36, - 37, - 38, - 39, - 40, - 41 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "direct()" - } - } - } - } - ], - "description": "Test.direct() (tests/detectors/arbitrary-send/arbitrary_send.sol#11-13) sends eth to arbitrary user\n\tDangerous calls:\n\t- msg.sender.send(address(this).balance) (tests/detectors/arbitrary-send/arbitrary_send.sol#12)\n", - "markdown": "[Test.direct()](tests/detectors/arbitrary-send/arbitrary_send.sol#L11-L13) sends eth to arbitrary user\n\tDangerous calls:\n\t- [msg.sender.send(address(this).balance)](tests/detectors/arbitrary-send/arbitrary_send.sol#L12)\n", - "id": "62016ac9363a509bd815fc0bb31b326b235dad50d7771dea249037d40169138e", - "check": "arbitrary-send", - "impact": "High", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "indirect", - "source_mapping": { - "start": 301, - "length": 82, - "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/arbitrary-send/arbitrary_send.sol", - "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/arbitrary-send/arbitrary_send.sol", - "is_dependency": false, - "lines": [ - 19, - 20, - 21 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "Test", - "source_mapping": { - "start": 0, - "length": 869, - "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/arbitrary-send/arbitrary_send.sol", - "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/arbitrary-send/arbitrary_send.sol", - "is_dependency": false, - "lines": [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 30, - 31, - 32, - 33, - 34, - 35, - 36, - 37, - 38, - 39, - 40, - 41 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "indirect()" - } - }, - { - "type": "node", - "name": "destination.send(address(this).balance)", - "source_mapping": { - "start": 337, - "length": 39, - "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/arbitrary-send/arbitrary_send.sol", - "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/arbitrary-send/arbitrary_send.sol", - "is_dependency": false, - "lines": [ - 20 - ], - "starting_column": 9, - "ending_column": 48 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "indirect", - "source_mapping": { - "start": 301, - "length": 82, - "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/arbitrary-send/arbitrary_send.sol", - "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/arbitrary-send/arbitrary_send.sol", - "is_dependency": false, - "lines": [ - 19, - 20, - 21 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "Test", - "source_mapping": { - "start": 0, - "length": 869, - "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/arbitrary-send/arbitrary_send.sol", - "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/arbitrary-send/arbitrary_send.sol", - "is_dependency": false, - "lines": [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 30, - 31, - 32, - 33, - 34, - 35, - 36, - 37, - 38, - 39, - 40, - 41 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "indirect()" - } - } - } - } - ], - "description": "Test.indirect() (tests/detectors/arbitrary-send/arbitrary_send.sol#19-21) sends eth to arbitrary user\n\tDangerous calls:\n\t- destination.send(address(this).balance) (tests/detectors/arbitrary-send/arbitrary_send.sol#20)\n", - "markdown": "[Test.indirect()](tests/detectors/arbitrary-send/arbitrary_send.sol#L19-L21) sends eth to arbitrary user\n\tDangerous calls:\n\t- [destination.send(address(this).balance)](tests/detectors/arbitrary-send/arbitrary_send.sol#L20)\n", - "id": "62a25f56dfce54ce59cdf81a1821f2ea8a8eb7d12a6a794b9c4f09ba7f7bc543", - "check": "arbitrary-send", - "impact": "High", - "confidence": "Medium" - } - ] -] \ No newline at end of file diff --git a/tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol b/tests/detectors/boolean-cst/0.4.25/boolean-constant-misuse.sol similarity index 100% rename from tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol rename to tests/detectors/boolean-cst/0.4.25/boolean-constant-misuse.sol diff --git a/tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol.0.4.25.BooleanConstantMisuse.json b/tests/detectors/boolean-cst/0.4.25/boolean-constant-misuse.sol.0.4.25.BooleanConstantMisuse.json similarity index 88% rename from tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol.0.4.25.BooleanConstantMisuse.json rename to tests/detectors/boolean-cst/0.4.25/boolean-constant-misuse.sol.0.4.25.BooleanConstantMisuse.json index 0ab8443637..2dc6887049 100644 --- a/tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol.0.4.25.BooleanConstantMisuse.json +++ b/tests/detectors/boolean-cst/0.4.25/boolean-constant-misuse.sol.0.4.25.BooleanConstantMisuse.json @@ -9,9 +9,9 @@ "start": 162, "length": 84, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol", + "filename_relative": "tests/detectors/boolean-cst/0.4.25/boolean-constant-misuse.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol", + "filename_short": "tests/detectors/boolean-cst/0.4.25/boolean-constant-misuse.sol", "is_dependency": false, "lines": [ 9, @@ -29,9 +29,9 @@ "start": 0, "length": 923, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol", + "filename_relative": "tests/detectors/boolean-cst/0.4.25/boolean-constant-misuse.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol", + "filename_short": "tests/detectors/boolean-cst/0.4.25/boolean-constant-misuse.sol", "is_dependency": false, "lines": [ 1, @@ -96,9 +96,9 @@ "start": 221, "length": 18, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol", + "filename_relative": "tests/detectors/boolean-cst/0.4.25/boolean-constant-misuse.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol", + "filename_short": "tests/detectors/boolean-cst/0.4.25/boolean-constant-misuse.sol", "is_dependency": false, "lines": [ 10 @@ -114,9 +114,9 @@ "start": 162, "length": 84, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol", + "filename_relative": "tests/detectors/boolean-cst/0.4.25/boolean-constant-misuse.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol", + "filename_short": "tests/detectors/boolean-cst/0.4.25/boolean-constant-misuse.sol", "is_dependency": false, "lines": [ 9, @@ -134,9 +134,9 @@ "start": 0, "length": 923, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol", + "filename_relative": "tests/detectors/boolean-cst/0.4.25/boolean-constant-misuse.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol", + "filename_short": "tests/detectors/boolean-cst/0.4.25/boolean-constant-misuse.sol", "is_dependency": false, "lines": [ 1, @@ -197,9 +197,9 @@ } } ], - "description": "MyConc.bad1(bool) (tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol#9-11) uses a Boolean constant improperly:\n\t-(b || true) (tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol#10)\n", - "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol#L9-L11) uses a Boolean constant improperly:\n\t-[(b || true)](tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol#L10)\n", - "id": "c8c323396d19d9ddfd97f18ed731c7f07bb1cc030c198c830b595a770aeb26c2", + "description": "MyConc.bad1(bool) (tests/detectors/boolean-cst/0.4.25/boolean-constant-misuse.sol#9-11) uses a Boolean constant improperly:\n\t-(b || true) (tests/detectors/boolean-cst/0.4.25/boolean-constant-misuse.sol#10)\n", + "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-cst/0.4.25/boolean-constant-misuse.sol#L9-L11) uses a Boolean constant improperly:\n\t-[(b || true)](tests/detectors/boolean-cst/0.4.25/boolean-constant-misuse.sol#L10)\n", + "id": "4b8abd9aa6870f3044de67a84b3139e4a79c9ac13b4c0ed4f0772713f12c709b", "check": "boolean-cst", "impact": "Medium", "confidence": "Medium" diff --git a/tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol b/tests/detectors/boolean-cst/0.5.16/boolean-constant-misuse.sol similarity index 100% rename from tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol rename to tests/detectors/boolean-cst/0.5.16/boolean-constant-misuse.sol diff --git a/tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol.0.5.16.BooleanConstantMisuse.json b/tests/detectors/boolean-cst/0.5.16/boolean-constant-misuse.sol.0.5.16.BooleanConstantMisuse.json similarity index 88% rename from tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol.0.5.16.BooleanConstantMisuse.json rename to tests/detectors/boolean-cst/0.5.16/boolean-constant-misuse.sol.0.5.16.BooleanConstantMisuse.json index a30e3ec86e..94bf5d0d6f 100644 --- a/tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol.0.5.16.BooleanConstantMisuse.json +++ b/tests/detectors/boolean-cst/0.5.16/boolean-constant-misuse.sol.0.5.16.BooleanConstantMisuse.json @@ -9,9 +9,9 @@ "start": 162, "length": 84, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol", + "filename_relative": "tests/detectors/boolean-cst/0.5.16/boolean-constant-misuse.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol", + "filename_short": "tests/detectors/boolean-cst/0.5.16/boolean-constant-misuse.sol", "is_dependency": false, "lines": [ 9, @@ -29,9 +29,9 @@ "start": 0, "length": 923, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol", + "filename_relative": "tests/detectors/boolean-cst/0.5.16/boolean-constant-misuse.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol", + "filename_short": "tests/detectors/boolean-cst/0.5.16/boolean-constant-misuse.sol", "is_dependency": false, "lines": [ 1, @@ -96,9 +96,9 @@ "start": 221, "length": 18, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol", + "filename_relative": "tests/detectors/boolean-cst/0.5.16/boolean-constant-misuse.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol", + "filename_short": "tests/detectors/boolean-cst/0.5.16/boolean-constant-misuse.sol", "is_dependency": false, "lines": [ 10 @@ -114,9 +114,9 @@ "start": 162, "length": 84, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol", + "filename_relative": "tests/detectors/boolean-cst/0.5.16/boolean-constant-misuse.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol", + "filename_short": "tests/detectors/boolean-cst/0.5.16/boolean-constant-misuse.sol", "is_dependency": false, "lines": [ 9, @@ -134,9 +134,9 @@ "start": 0, "length": 923, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol", + "filename_relative": "tests/detectors/boolean-cst/0.5.16/boolean-constant-misuse.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol", + "filename_short": "tests/detectors/boolean-cst/0.5.16/boolean-constant-misuse.sol", "is_dependency": false, "lines": [ 1, @@ -197,9 +197,9 @@ } } ], - "description": "MyConc.bad1(bool) (tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol#9-11) uses a Boolean constant improperly:\n\t-(b || true) (tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol#10)\n", - "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol#L9-L11) uses a Boolean constant improperly:\n\t-[(b || true)](tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol#L10)\n", - "id": "f6ceb7e0651a96a88da265b955956fb4a3878f1491c81cf6bc8e433b5006e6aa", + "description": "MyConc.bad1(bool) (tests/detectors/boolean-cst/0.5.16/boolean-constant-misuse.sol#9-11) uses a Boolean constant improperly:\n\t-(b || true) (tests/detectors/boolean-cst/0.5.16/boolean-constant-misuse.sol#10)\n", + "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-cst/0.5.16/boolean-constant-misuse.sol#L9-L11) uses a Boolean constant improperly:\n\t-[(b || true)](tests/detectors/boolean-cst/0.5.16/boolean-constant-misuse.sol#L10)\n", + "id": "bd4514763d71bc7fcb2a681b1fe98928e9d1dd92882c5fe0480e52cba9130cfe", "check": "boolean-cst", "impact": "Medium", "confidence": "Medium" diff --git a/tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol b/tests/detectors/boolean-cst/0.6.11/boolean-constant-misuse.sol similarity index 100% rename from tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol rename to tests/detectors/boolean-cst/0.6.11/boolean-constant-misuse.sol diff --git a/tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol.0.6.11.BooleanConstantMisuse.json b/tests/detectors/boolean-cst/0.6.11/boolean-constant-misuse.sol.0.6.11.BooleanConstantMisuse.json similarity index 88% rename from tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol.0.6.11.BooleanConstantMisuse.json rename to tests/detectors/boolean-cst/0.6.11/boolean-constant-misuse.sol.0.6.11.BooleanConstantMisuse.json index e1330807b8..62425f97a4 100644 --- a/tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol.0.6.11.BooleanConstantMisuse.json +++ b/tests/detectors/boolean-cst/0.6.11/boolean-constant-misuse.sol.0.6.11.BooleanConstantMisuse.json @@ -9,9 +9,9 @@ "start": 162, "length": 84, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol", + "filename_relative": "tests/detectors/boolean-cst/0.6.11/boolean-constant-misuse.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol", + "filename_short": "tests/detectors/boolean-cst/0.6.11/boolean-constant-misuse.sol", "is_dependency": false, "lines": [ 9, @@ -29,9 +29,9 @@ "start": 0, "length": 923, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol", + "filename_relative": "tests/detectors/boolean-cst/0.6.11/boolean-constant-misuse.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol", + "filename_short": "tests/detectors/boolean-cst/0.6.11/boolean-constant-misuse.sol", "is_dependency": false, "lines": [ 1, @@ -96,9 +96,9 @@ "start": 221, "length": 18, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol", + "filename_relative": "tests/detectors/boolean-cst/0.6.11/boolean-constant-misuse.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol", + "filename_short": "tests/detectors/boolean-cst/0.6.11/boolean-constant-misuse.sol", "is_dependency": false, "lines": [ 10 @@ -114,9 +114,9 @@ "start": 162, "length": 84, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol", + "filename_relative": "tests/detectors/boolean-cst/0.6.11/boolean-constant-misuse.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol", + "filename_short": "tests/detectors/boolean-cst/0.6.11/boolean-constant-misuse.sol", "is_dependency": false, "lines": [ 9, @@ -134,9 +134,9 @@ "start": 0, "length": 923, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol", + "filename_relative": "tests/detectors/boolean-cst/0.6.11/boolean-constant-misuse.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol", + "filename_short": "tests/detectors/boolean-cst/0.6.11/boolean-constant-misuse.sol", "is_dependency": false, "lines": [ 1, @@ -197,9 +197,9 @@ } } ], - "description": "MyConc.bad1(bool) (tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol#9-11) uses a Boolean constant improperly:\n\t-(b || true) (tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol#10)\n", - "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol#L9-L11) uses a Boolean constant improperly:\n\t-[(b || true)](tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol#L10)\n", - "id": "0b2599e627a1163a49a4113426fe385f5987d7e247cdbe8e2d9b39988b95478a", + "description": "MyConc.bad1(bool) (tests/detectors/boolean-cst/0.6.11/boolean-constant-misuse.sol#9-11) uses a Boolean constant improperly:\n\t-(b || true) (tests/detectors/boolean-cst/0.6.11/boolean-constant-misuse.sol#10)\n", + "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-cst/0.6.11/boolean-constant-misuse.sol#L9-L11) uses a Boolean constant improperly:\n\t-[(b || true)](tests/detectors/boolean-cst/0.6.11/boolean-constant-misuse.sol#L10)\n", + "id": "81067a443028f22790f44718bff947b7ec6de12b929bd89147d3b34044b3890d", "check": "boolean-cst", "impact": "Medium", "confidence": "Medium" diff --git a/tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol b/tests/detectors/boolean-cst/0.7.6/boolean-constant-misuse.sol similarity index 100% rename from tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol rename to tests/detectors/boolean-cst/0.7.6/boolean-constant-misuse.sol diff --git a/tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol.0.7.6.BooleanConstantMisuse.json b/tests/detectors/boolean-cst/0.7.6/boolean-constant-misuse.sol.0.7.6.BooleanConstantMisuse.json similarity index 88% rename from tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol.0.7.6.BooleanConstantMisuse.json rename to tests/detectors/boolean-cst/0.7.6/boolean-constant-misuse.sol.0.7.6.BooleanConstantMisuse.json index 62b170eb16..835d09fb7f 100644 --- a/tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol.0.7.6.BooleanConstantMisuse.json +++ b/tests/detectors/boolean-cst/0.7.6/boolean-constant-misuse.sol.0.7.6.BooleanConstantMisuse.json @@ -9,9 +9,9 @@ "start": 162, "length": 84, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol", + "filename_relative": "tests/detectors/boolean-cst/0.7.6/boolean-constant-misuse.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol", + "filename_short": "tests/detectors/boolean-cst/0.7.6/boolean-constant-misuse.sol", "is_dependency": false, "lines": [ 9, @@ -29,9 +29,9 @@ "start": 0, "length": 923, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol", + "filename_relative": "tests/detectors/boolean-cst/0.7.6/boolean-constant-misuse.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol", + "filename_short": "tests/detectors/boolean-cst/0.7.6/boolean-constant-misuse.sol", "is_dependency": false, "lines": [ 1, @@ -96,9 +96,9 @@ "start": 221, "length": 18, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol", + "filename_relative": "tests/detectors/boolean-cst/0.7.6/boolean-constant-misuse.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol", + "filename_short": "tests/detectors/boolean-cst/0.7.6/boolean-constant-misuse.sol", "is_dependency": false, "lines": [ 10 @@ -114,9 +114,9 @@ "start": 162, "length": 84, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol", + "filename_relative": "tests/detectors/boolean-cst/0.7.6/boolean-constant-misuse.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol", + "filename_short": "tests/detectors/boolean-cst/0.7.6/boolean-constant-misuse.sol", "is_dependency": false, "lines": [ 9, @@ -134,9 +134,9 @@ "start": 0, "length": 923, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol", + "filename_relative": "tests/detectors/boolean-cst/0.7.6/boolean-constant-misuse.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol", + "filename_short": "tests/detectors/boolean-cst/0.7.6/boolean-constant-misuse.sol", "is_dependency": false, "lines": [ 1, @@ -197,9 +197,9 @@ } } ], - "description": "MyConc.bad1(bool) (tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol#9-11) uses a Boolean constant improperly:\n\t-(b || true) (tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol#10)\n", - "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol#L9-L11) uses a Boolean constant improperly:\n\t-[(b || true)](tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol#L10)\n", - "id": "a7e009ec0e6c5e4bf5dd828bcbeff63d020b9e2a10ad7ad350c13ad8cd277697", + "description": "MyConc.bad1(bool) (tests/detectors/boolean-cst/0.7.6/boolean-constant-misuse.sol#9-11) uses a Boolean constant improperly:\n\t-(b || true) (tests/detectors/boolean-cst/0.7.6/boolean-constant-misuse.sol#10)\n", + "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-cst/0.7.6/boolean-constant-misuse.sol#L9-L11) uses a Boolean constant improperly:\n\t-[(b || true)](tests/detectors/boolean-cst/0.7.6/boolean-constant-misuse.sol#L10)\n", + "id": "d96572f8601700902d157c2b4ad0b66254eba7a6d9c83710f26ea8cbdf2085fa", "check": "boolean-cst", "impact": "Medium", "confidence": "Medium" diff --git a/tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol b/tests/detectors/boolean-equal/0.4.25/boolean-constant-equality.sol similarity index 100% rename from tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol rename to tests/detectors/boolean-equal/0.4.25/boolean-constant-equality.sol diff --git a/tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol.0.4.25.BooleanEquality.json b/tests/detectors/boolean-equal/0.4.25/boolean-constant-equality.sol.0.4.25.BooleanEquality.json similarity index 86% rename from tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol.0.4.25.BooleanEquality.json rename to tests/detectors/boolean-equal/0.4.25/boolean-constant-equality.sol.0.4.25.BooleanEquality.json index a04357142d..fb6f0efc5a 100644 --- a/tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol.0.4.25.BooleanEquality.json +++ b/tests/detectors/boolean-equal/0.4.25/boolean-constant-equality.sol.0.4.25.BooleanEquality.json @@ -9,9 +9,9 @@ "start": 139, "length": 84, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol", + "filename_relative": "tests/detectors/boolean-equal/0.4.25/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol", + "filename_short": "tests/detectors/boolean-equal/0.4.25/boolean-constant-equality.sol", "is_dependency": false, "lines": [ 7, @@ -29,9 +29,9 @@ "start": 0, "length": 578, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol", + "filename_relative": "tests/detectors/boolean-equal/0.4.25/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol", + "filename_short": "tests/detectors/boolean-equal/0.4.25/boolean-constant-equality.sol", "is_dependency": false, "lines": [ 1, @@ -77,9 +77,9 @@ "start": 198, "length": 18, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol", + "filename_relative": "tests/detectors/boolean-equal/0.4.25/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol", + "filename_short": "tests/detectors/boolean-equal/0.4.25/boolean-constant-equality.sol", "is_dependency": false, "lines": [ 8 @@ -95,9 +95,9 @@ "start": 139, "length": 84, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol", + "filename_relative": "tests/detectors/boolean-equal/0.4.25/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol", + "filename_short": "tests/detectors/boolean-equal/0.4.25/boolean-constant-equality.sol", "is_dependency": false, "lines": [ 7, @@ -115,9 +115,9 @@ "start": 0, "length": 578, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol", + "filename_relative": "tests/detectors/boolean-equal/0.4.25/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol", + "filename_short": "tests/detectors/boolean-equal/0.4.25/boolean-constant-equality.sol", "is_dependency": false, "lines": [ 1, @@ -159,9 +159,9 @@ } } ], - "description": "MyConc.bad1(bool) (tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol#7-9) compares to a boolean constant:\n\t-(b == true) (tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol#8)\n", - "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol#L7-L9) compares to a boolean constant:\n\t-[(b == true)](tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol#L8)\n", - "id": "953771b4660b92d842bccca2554dbcb5bc0988f4b0875b573a0b1211959c84be", + "description": "MyConc.bad1(bool) (tests/detectors/boolean-equal/0.4.25/boolean-constant-equality.sol#7-9) compares to a boolean constant:\n\t-(b == true) (tests/detectors/boolean-equal/0.4.25/boolean-constant-equality.sol#8)\n", + "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-equal/0.4.25/boolean-constant-equality.sol#L7-L9) compares to a boolean constant:\n\t-[(b == true)](tests/detectors/boolean-equal/0.4.25/boolean-constant-equality.sol#L8)\n", + "id": "55ba7d7edfd3cc9012d1fbd9d2ba12a488d950a885c3664fe080b90288a2c715", "check": "boolean-equal", "impact": "Informational", "confidence": "High" diff --git a/tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol b/tests/detectors/boolean-equal/0.5.16/boolean-constant-equality.sol similarity index 100% rename from tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol rename to tests/detectors/boolean-equal/0.5.16/boolean-constant-equality.sol diff --git a/tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol.0.5.16.BooleanEquality.json b/tests/detectors/boolean-equal/0.5.16/boolean-constant-equality.sol.0.5.16.BooleanEquality.json similarity index 86% rename from tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol.0.5.16.BooleanEquality.json rename to tests/detectors/boolean-equal/0.5.16/boolean-constant-equality.sol.0.5.16.BooleanEquality.json index 1ca1294048..e92f0ba00a 100644 --- a/tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol.0.5.16.BooleanEquality.json +++ b/tests/detectors/boolean-equal/0.5.16/boolean-constant-equality.sol.0.5.16.BooleanEquality.json @@ -9,9 +9,9 @@ "start": 139, "length": 84, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol", + "filename_relative": "tests/detectors/boolean-equal/0.5.16/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol", + "filename_short": "tests/detectors/boolean-equal/0.5.16/boolean-constant-equality.sol", "is_dependency": false, "lines": [ 7, @@ -29,9 +29,9 @@ "start": 0, "length": 578, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol", + "filename_relative": "tests/detectors/boolean-equal/0.5.16/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol", + "filename_short": "tests/detectors/boolean-equal/0.5.16/boolean-constant-equality.sol", "is_dependency": false, "lines": [ 1, @@ -77,9 +77,9 @@ "start": 198, "length": 18, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol", + "filename_relative": "tests/detectors/boolean-equal/0.5.16/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol", + "filename_short": "tests/detectors/boolean-equal/0.5.16/boolean-constant-equality.sol", "is_dependency": false, "lines": [ 8 @@ -95,9 +95,9 @@ "start": 139, "length": 84, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol", + "filename_relative": "tests/detectors/boolean-equal/0.5.16/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol", + "filename_short": "tests/detectors/boolean-equal/0.5.16/boolean-constant-equality.sol", "is_dependency": false, "lines": [ 7, @@ -115,9 +115,9 @@ "start": 0, "length": 578, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol", + "filename_relative": "tests/detectors/boolean-equal/0.5.16/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol", + "filename_short": "tests/detectors/boolean-equal/0.5.16/boolean-constant-equality.sol", "is_dependency": false, "lines": [ 1, @@ -159,9 +159,9 @@ } } ], - "description": "MyConc.bad1(bool) (tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol#7-9) compares to a boolean constant:\n\t-(b == true) (tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol#8)\n", - "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol#L7-L9) compares to a boolean constant:\n\t-[(b == true)](tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol#L8)\n", - "id": "55f3ed7ce9767b07a34113bd35c34e61c20eb8ec35174086cdfea6c0063bd946", + "description": "MyConc.bad1(bool) (tests/detectors/boolean-equal/0.5.16/boolean-constant-equality.sol#7-9) compares to a boolean constant:\n\t-(b == true) (tests/detectors/boolean-equal/0.5.16/boolean-constant-equality.sol#8)\n", + "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-equal/0.5.16/boolean-constant-equality.sol#L7-L9) compares to a boolean constant:\n\t-[(b == true)](tests/detectors/boolean-equal/0.5.16/boolean-constant-equality.sol#L8)\n", + "id": "be01fe651d102dc47ca3eb623ba9078138896f662948665b8d4e03780305c085", "check": "boolean-equal", "impact": "Informational", "confidence": "High" diff --git a/tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol b/tests/detectors/boolean-equal/0.6.11/boolean-constant-equality.sol similarity index 100% rename from tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol rename to tests/detectors/boolean-equal/0.6.11/boolean-constant-equality.sol diff --git a/tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol.0.6.11.BooleanEquality.json b/tests/detectors/boolean-equal/0.6.11/boolean-constant-equality.sol.0.6.11.BooleanEquality.json similarity index 86% rename from tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol.0.6.11.BooleanEquality.json rename to tests/detectors/boolean-equal/0.6.11/boolean-constant-equality.sol.0.6.11.BooleanEquality.json index 645981de85..eb9f633015 100644 --- a/tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol.0.6.11.BooleanEquality.json +++ b/tests/detectors/boolean-equal/0.6.11/boolean-constant-equality.sol.0.6.11.BooleanEquality.json @@ -9,9 +9,9 @@ "start": 139, "length": 84, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol", + "filename_relative": "tests/detectors/boolean-equal/0.6.11/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol", + "filename_short": "tests/detectors/boolean-equal/0.6.11/boolean-constant-equality.sol", "is_dependency": false, "lines": [ 7, @@ -29,9 +29,9 @@ "start": 0, "length": 578, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol", + "filename_relative": "tests/detectors/boolean-equal/0.6.11/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol", + "filename_short": "tests/detectors/boolean-equal/0.6.11/boolean-constant-equality.sol", "is_dependency": false, "lines": [ 1, @@ -77,9 +77,9 @@ "start": 198, "length": 18, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol", + "filename_relative": "tests/detectors/boolean-equal/0.6.11/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol", + "filename_short": "tests/detectors/boolean-equal/0.6.11/boolean-constant-equality.sol", "is_dependency": false, "lines": [ 8 @@ -95,9 +95,9 @@ "start": 139, "length": 84, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol", + "filename_relative": "tests/detectors/boolean-equal/0.6.11/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol", + "filename_short": "tests/detectors/boolean-equal/0.6.11/boolean-constant-equality.sol", "is_dependency": false, "lines": [ 7, @@ -115,9 +115,9 @@ "start": 0, "length": 578, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol", + "filename_relative": "tests/detectors/boolean-equal/0.6.11/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol", + "filename_short": "tests/detectors/boolean-equal/0.6.11/boolean-constant-equality.sol", "is_dependency": false, "lines": [ 1, @@ -159,9 +159,9 @@ } } ], - "description": "MyConc.bad1(bool) (tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol#7-9) compares to a boolean constant:\n\t-(b == true) (tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol#8)\n", - "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol#L7-L9) compares to a boolean constant:\n\t-[(b == true)](tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol#L8)\n", - "id": "c51b5452fc3e68aff071a2c4ab0963cbbb1b55871b53c0131c11d4cf8abd046f", + "description": "MyConc.bad1(bool) (tests/detectors/boolean-equal/0.6.11/boolean-constant-equality.sol#7-9) compares to a boolean constant:\n\t-(b == true) (tests/detectors/boolean-equal/0.6.11/boolean-constant-equality.sol#8)\n", + "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-equal/0.6.11/boolean-constant-equality.sol#L7-L9) compares to a boolean constant:\n\t-[(b == true)](tests/detectors/boolean-equal/0.6.11/boolean-constant-equality.sol#L8)\n", + "id": "0f863694c7b456673256b0f8002c9ac9f050b89b9ec3c86936c6399b3eb4b2e1", "check": "boolean-equal", "impact": "Informational", "confidence": "High" diff --git a/tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol b/tests/detectors/boolean-equal/0.7.6/boolean-constant-equality.sol similarity index 100% rename from tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol rename to tests/detectors/boolean-equal/0.7.6/boolean-constant-equality.sol diff --git a/tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol.0.7.6.BooleanEquality.json b/tests/detectors/boolean-equal/0.7.6/boolean-constant-equality.sol.0.7.6.BooleanEquality.json similarity index 86% rename from tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol.0.7.6.BooleanEquality.json rename to tests/detectors/boolean-equal/0.7.6/boolean-constant-equality.sol.0.7.6.BooleanEquality.json index 367bb3d6f0..0b863a5f4f 100644 --- a/tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol.0.7.6.BooleanEquality.json +++ b/tests/detectors/boolean-equal/0.7.6/boolean-constant-equality.sol.0.7.6.BooleanEquality.json @@ -9,9 +9,9 @@ "start": 139, "length": 84, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol", + "filename_relative": "tests/detectors/boolean-equal/0.7.6/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol", + "filename_short": "tests/detectors/boolean-equal/0.7.6/boolean-constant-equality.sol", "is_dependency": false, "lines": [ 7, @@ -29,9 +29,9 @@ "start": 0, "length": 578, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol", + "filename_relative": "tests/detectors/boolean-equal/0.7.6/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol", + "filename_short": "tests/detectors/boolean-equal/0.7.6/boolean-constant-equality.sol", "is_dependency": false, "lines": [ 1, @@ -77,9 +77,9 @@ "start": 198, "length": 18, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol", + "filename_relative": "tests/detectors/boolean-equal/0.7.6/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol", + "filename_short": "tests/detectors/boolean-equal/0.7.6/boolean-constant-equality.sol", "is_dependency": false, "lines": [ 8 @@ -95,9 +95,9 @@ "start": 139, "length": 84, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol", + "filename_relative": "tests/detectors/boolean-equal/0.7.6/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol", + "filename_short": "tests/detectors/boolean-equal/0.7.6/boolean-constant-equality.sol", "is_dependency": false, "lines": [ 7, @@ -115,9 +115,9 @@ "start": 0, "length": 578, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol", + "filename_relative": "tests/detectors/boolean-equal/0.7.6/boolean-constant-equality.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol", + "filename_short": "tests/detectors/boolean-equal/0.7.6/boolean-constant-equality.sol", "is_dependency": false, "lines": [ 1, @@ -159,9 +159,9 @@ } } ], - "description": "MyConc.bad1(bool) (tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol#7-9) compares to a boolean constant:\n\t-(b == true) (tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol#8)\n", - "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol#L7-L9) compares to a boolean constant:\n\t-[(b == true)](tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol#L8)\n", - "id": "f74a4de05a37e9f8a5f8926e2981a611972623fd7a0281f6d2bc4ec32899abfe", + "description": "MyConc.bad1(bool) (tests/detectors/boolean-equal/0.7.6/boolean-constant-equality.sol#7-9) compares to a boolean constant:\n\t-(b == true) (tests/detectors/boolean-equal/0.7.6/boolean-constant-equality.sol#8)\n", + "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-equal/0.7.6/boolean-constant-equality.sol#L7-L9) compares to a boolean constant:\n\t-[(b == true)](tests/detectors/boolean-equal/0.7.6/boolean-constant-equality.sol#L8)\n", + "id": "7c89c8f828e73eb875b8f06bb1404ed2271cc5806f167d621604c23f62705f60", "check": "boolean-equal", "impact": "Informational", "confidence": "High" diff --git a/tests/detectors/constant/0.4.25/constant.sol b/tests/detectors/constant-function-asm/0.4.25/constant.sol similarity index 100% rename from tests/detectors/constant/0.4.25/constant.sol rename to tests/detectors/constant-function-asm/0.4.25/constant.sol diff --git a/tests/detectors/constant/0.4.25/constant.sol.0.4.25.ConstantFunctionsAsm.json b/tests/detectors/constant-function-asm/0.4.25/constant.sol.0.4.25.ConstantFunctionsAsm.json similarity index 89% rename from tests/detectors/constant/0.4.25/constant.sol.0.4.25.ConstantFunctionsAsm.json rename to tests/detectors/constant-function-asm/0.4.25/constant.sol.0.4.25.ConstantFunctionsAsm.json index 672df1efca..b51a914483 100644 --- a/tests/detectors/constant/0.4.25/constant.sol.0.4.25.ConstantFunctionsAsm.json +++ b/tests/detectors/constant-function-asm/0.4.25/constant.sol.0.4.25.ConstantFunctionsAsm.json @@ -9,9 +9,9 @@ "start": 324, "length": 66, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constant/0.4.25/constant.sol", + "filename_relative": "tests/detectors/constant-function-asm/0.4.25/constant.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constant/0.4.25/constant.sol", + "filename_short": "tests/detectors/constant-function-asm/0.4.25/constant.sol", "is_dependency": false, "lines": [ 22, @@ -29,9 +29,9 @@ "start": 0, "length": 392, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constant/0.4.25/constant.sol", + "filename_relative": "tests/detectors/constant-function-asm/0.4.25/constant.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constant/0.4.25/constant.sol", + "filename_short": "tests/detectors/constant-function-asm/0.4.25/constant.sol", "is_dependency": false, "lines": [ 1, @@ -68,8 +68,8 @@ } } ], - "description": "Constant.test_assembly_bug() (tests/detectors/constant/0.4.25/constant.sol#22-24) is declared view but contains assembly code\n", - "markdown": "[Constant.test_assembly_bug()](tests/detectors/constant/0.4.25/constant.sol#L22-L24) is declared view but contains assembly code\n", + "description": "Constant.test_assembly_bug() (tests/detectors/constant-function-asm/0.4.25/constant.sol#22-24) is declared view but contains assembly code\n", + "markdown": "[Constant.test_assembly_bug()](tests/detectors/constant-function-asm/0.4.25/constant.sol#L22-L24) is declared view but contains assembly code\n", "id": "1f892cae08b89096bdc4d6ecdf55a3adc4b4314390e054fe2547d9c8e9f76e23", "additional_fields": { "contains_assembly": true diff --git a/tests/detectors/constant/0.5.16/constant.sol b/tests/detectors/constant-function-asm/0.5.16/constant.sol similarity index 100% rename from tests/detectors/constant/0.5.16/constant.sol rename to tests/detectors/constant-function-asm/0.5.16/constant.sol diff --git a/tests/detectors/constant/0.5.16/constant.sol.0.5.16.ConstantFunctionsAsm.json b/tests/detectors/constant-function-asm/0.5.16/constant.sol.0.5.16.ConstantFunctionsAsm.json similarity index 100% rename from tests/detectors/constant/0.5.16/constant.sol.0.5.16.ConstantFunctionsAsm.json rename to tests/detectors/constant-function-asm/0.5.16/constant.sol.0.5.16.ConstantFunctionsAsm.json diff --git a/tests/detectors/constant/0.6.11/constant.sol b/tests/detectors/constant-function-asm/0.6.11/constant.sol similarity index 100% rename from tests/detectors/constant/0.6.11/constant.sol rename to tests/detectors/constant-function-asm/0.6.11/constant.sol diff --git a/tests/detectors/constant/0.6.11/constant.sol.0.6.11.ConstantFunctionsAsm.json b/tests/detectors/constant-function-asm/0.6.11/constant.sol.0.6.11.ConstantFunctionsAsm.json similarity index 100% rename from tests/detectors/constant/0.6.11/constant.sol.0.6.11.ConstantFunctionsAsm.json rename to tests/detectors/constant-function-asm/0.6.11/constant.sol.0.6.11.ConstantFunctionsAsm.json diff --git a/tests/detectors/constant/0.7.6/constant.sol b/tests/detectors/constant-function-asm/0.7.6/constant.sol similarity index 100% rename from tests/detectors/constant/0.7.6/constant.sol rename to tests/detectors/constant-function-asm/0.7.6/constant.sol diff --git a/tests/detectors/constant/0.7.6/constant.sol.0.7.6.ConstantFunctionsAsm.json b/tests/detectors/constant-function-asm/0.7.6/constant.sol.0.7.6.ConstantFunctionsAsm.json similarity index 100% rename from tests/detectors/constant/0.7.6/constant.sol.0.7.6.ConstantFunctionsAsm.json rename to tests/detectors/constant-function-asm/0.7.6/constant.sol.0.7.6.ConstantFunctionsAsm.json diff --git a/tests/detectors/constant-function-state/0.4.25/constant.sol b/tests/detectors/constant-function-state/0.4.25/constant.sol new file mode 100644 index 0000000000..9346348030 --- /dev/null +++ b/tests/detectors/constant-function-state/0.4.25/constant.sol @@ -0,0 +1,25 @@ +contract Constant { + + uint a; + + function test_view_bug() public view{ + a = 0; + } + + function test_constant_bug() public constant{ + a = 0; + } + + function test_view_shadow() public view{ + uint a; + a = 0; + } + + function test_view() public view{ + a; + } + + function test_assembly_bug() public view{ + assembly{} + } +} diff --git a/tests/detectors/constant/0.4.25/constant.sol.0.4.25.ConstantFunctionsState.json b/tests/detectors/constant-function-state/0.4.25/constant.sol.0.4.25.ConstantFunctionsState.json similarity index 88% rename from tests/detectors/constant/0.4.25/constant.sol.0.4.25.ConstantFunctionsState.json rename to tests/detectors/constant-function-state/0.4.25/constant.sol.0.4.25.ConstantFunctionsState.json index 2ee21c819a..c8d8db0f50 100644 --- a/tests/detectors/constant/0.4.25/constant.sol.0.4.25.ConstantFunctionsState.json +++ b/tests/detectors/constant-function-state/0.4.25/constant.sol.0.4.25.ConstantFunctionsState.json @@ -9,9 +9,9 @@ "start": 45, "length": 58, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constant/0.4.25/constant.sol", + "filename_relative": "tests/detectors/constant-function-state/0.4.25/constant.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constant/0.4.25/constant.sol", + "filename_short": "tests/detectors/constant-function-state/0.4.25/constant.sol", "is_dependency": false, "lines": [ 5, @@ -29,9 +29,9 @@ "start": 0, "length": 392, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constant/0.4.25/constant.sol", + "filename_relative": "tests/detectors/constant-function-state/0.4.25/constant.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constant/0.4.25/constant.sol", + "filename_short": "tests/detectors/constant-function-state/0.4.25/constant.sol", "is_dependency": false, "lines": [ 1, @@ -74,9 +74,9 @@ "start": 28, "length": 6, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constant/0.4.25/constant.sol", + "filename_relative": "tests/detectors/constant-function-state/0.4.25/constant.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constant/0.4.25/constant.sol", + "filename_short": "tests/detectors/constant-function-state/0.4.25/constant.sol", "is_dependency": false, "lines": [ 3 @@ -92,9 +92,9 @@ "start": 0, "length": 392, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constant/0.4.25/constant.sol", + "filename_relative": "tests/detectors/constant-function-state/0.4.25/constant.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constant/0.4.25/constant.sol", + "filename_short": "tests/detectors/constant-function-state/0.4.25/constant.sol", "is_dependency": false, "lines": [ 1, @@ -130,8 +130,8 @@ } } ], - "description": "Constant.test_view_bug() (tests/detectors/constant/0.4.25/constant.sol#5-7) is declared view but changes state variables:\n\t- Constant.a (tests/detectors/constant/0.4.25/constant.sol#3)\n", - "markdown": "[Constant.test_view_bug()](tests/detectors/constant/0.4.25/constant.sol#L5-L7) is declared view but changes state variables:\n\t- [Constant.a](tests/detectors/constant/0.4.25/constant.sol#L3)\n", + "description": "Constant.test_view_bug() (tests/detectors/constant-function-state/0.4.25/constant.sol#5-7) is declared view but changes state variables:\n\t- Constant.a (tests/detectors/constant-function-state/0.4.25/constant.sol#3)\n", + "markdown": "[Constant.test_view_bug()](tests/detectors/constant-function-state/0.4.25/constant.sol#L5-L7) is declared view but changes state variables:\n\t- [Constant.a](tests/detectors/constant-function-state/0.4.25/constant.sol#L3)\n", "id": "4dee61d8835d20c6f1f7c195d8bd1e9de5dbcc096396a5b8db391136f9f5fdf1", "additional_fields": { "contains_assembly": false @@ -149,9 +149,9 @@ "start": 113, "length": 66, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constant/0.4.25/constant.sol", + "filename_relative": "tests/detectors/constant-function-state/0.4.25/constant.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constant/0.4.25/constant.sol", + "filename_short": "tests/detectors/constant-function-state/0.4.25/constant.sol", "is_dependency": false, "lines": [ 9, @@ -169,9 +169,9 @@ "start": 0, "length": 392, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constant/0.4.25/constant.sol", + "filename_relative": "tests/detectors/constant-function-state/0.4.25/constant.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constant/0.4.25/constant.sol", + "filename_short": "tests/detectors/constant-function-state/0.4.25/constant.sol", "is_dependency": false, "lines": [ 1, @@ -214,9 +214,9 @@ "start": 28, "length": 6, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constant/0.4.25/constant.sol", + "filename_relative": "tests/detectors/constant-function-state/0.4.25/constant.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constant/0.4.25/constant.sol", + "filename_short": "tests/detectors/constant-function-state/0.4.25/constant.sol", "is_dependency": false, "lines": [ 3 @@ -232,9 +232,9 @@ "start": 0, "length": 392, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/constant/0.4.25/constant.sol", + "filename_relative": "tests/detectors/constant-function-state/0.4.25/constant.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/constant/0.4.25/constant.sol", + "filename_short": "tests/detectors/constant-function-state/0.4.25/constant.sol", "is_dependency": false, "lines": [ 1, @@ -270,8 +270,8 @@ } } ], - "description": "Constant.test_constant_bug() (tests/detectors/constant/0.4.25/constant.sol#9-11) is declared view but changes state variables:\n\t- Constant.a (tests/detectors/constant/0.4.25/constant.sol#3)\n", - "markdown": "[Constant.test_constant_bug()](tests/detectors/constant/0.4.25/constant.sol#L9-L11) is declared view but changes state variables:\n\t- [Constant.a](tests/detectors/constant/0.4.25/constant.sol#L3)\n", + "description": "Constant.test_constant_bug() (tests/detectors/constant-function-state/0.4.25/constant.sol#9-11) is declared view but changes state variables:\n\t- Constant.a (tests/detectors/constant-function-state/0.4.25/constant.sol#3)\n", + "markdown": "[Constant.test_constant_bug()](tests/detectors/constant-function-state/0.4.25/constant.sol#L9-L11) is declared view but changes state variables:\n\t- [Constant.a](tests/detectors/constant-function-state/0.4.25/constant.sol#L3)\n", "id": "145e2d34dfc5b932c8d67d480c0eaec9baa8c728e2a310529572c0c4a5c6046a", "additional_fields": { "contains_assembly": false diff --git a/tests/detectors/constant-function-state/0.5.16/constant.sol b/tests/detectors/constant-function-state/0.5.16/constant.sol new file mode 100644 index 0000000000..5f01a0d7e4 --- /dev/null +++ b/tests/detectors/constant-function-state/0.5.16/constant.sol @@ -0,0 +1,20 @@ +// pragma solidity 0.5.1; + +contract Constant { + + uint a; + + + function test_view_shadow() public view{ + uint a; + a = 0; + } + + function test_view() public view{ + a; + } + + function test_assembly_bug() public view{ + assembly{} + } +} diff --git a/tests/detectors/constant/0.5.16/constant.sol.0.5.16.ConstantFunctionsState.json b/tests/detectors/constant-function-state/0.5.16/constant.sol.0.5.16.ConstantFunctionsState.json similarity index 100% rename from tests/detectors/constant/0.5.16/constant.sol.0.5.16.ConstantFunctionsState.json rename to tests/detectors/constant-function-state/0.5.16/constant.sol.0.5.16.ConstantFunctionsState.json diff --git a/tests/detectors/constant-function-state/0.6.11/constant.sol b/tests/detectors/constant-function-state/0.6.11/constant.sol new file mode 100644 index 0000000000..5f01a0d7e4 --- /dev/null +++ b/tests/detectors/constant-function-state/0.6.11/constant.sol @@ -0,0 +1,20 @@ +// pragma solidity 0.5.1; + +contract Constant { + + uint a; + + + function test_view_shadow() public view{ + uint a; + a = 0; + } + + function test_view() public view{ + a; + } + + function test_assembly_bug() public view{ + assembly{} + } +} diff --git a/tests/detectors/constant/0.6.11/constant.sol.0.6.11.ConstantFunctionsState.json b/tests/detectors/constant-function-state/0.6.11/constant.sol.0.6.11.ConstantFunctionsState.json similarity index 100% rename from tests/detectors/constant/0.6.11/constant.sol.0.6.11.ConstantFunctionsState.json rename to tests/detectors/constant-function-state/0.6.11/constant.sol.0.6.11.ConstantFunctionsState.json diff --git a/tests/detectors/constant-function-state/0.7.6/constant.sol b/tests/detectors/constant-function-state/0.7.6/constant.sol new file mode 100644 index 0000000000..5f01a0d7e4 --- /dev/null +++ b/tests/detectors/constant-function-state/0.7.6/constant.sol @@ -0,0 +1,20 @@ +// pragma solidity 0.5.1; + +contract Constant { + + uint a; + + + function test_view_shadow() public view{ + uint a; + a = 0; + } + + function test_view() public view{ + a; + } + + function test_assembly_bug() public view{ + assembly{} + } +} diff --git a/tests/detectors/constant/0.7.6/constant.sol.0.7.6.ConstantFunctionsState.json b/tests/detectors/constant-function-state/0.7.6/constant.sol.0.7.6.ConstantFunctionsState.json similarity index 100% rename from tests/detectors/constant/0.7.6/constant.sol.0.7.6.ConstantFunctionsState.json rename to tests/detectors/constant-function-state/0.7.6/constant.sol.0.7.6.ConstantFunctionsState.json diff --git a/tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol.0.5.16.ArrayLengthAssignment.json b/tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol.0.5.16.ArrayLengthAssignment.json index e3c44d7dbf..105c35a3e6 100644 --- a/tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol.0.5.16.ArrayLengthAssignment.json +++ b/tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol.0.5.16.ArrayLengthAssignment.json @@ -67,20 +67,20 @@ }, { "type": "node", - "name": "b.subStruct.x.length = param + 1", + "name": "arr.length = param", "source_mapping": { - "start": 964, - "length": 32, + "start": 527, + "length": 18, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", "is_dependency": false, "lines": [ - 41 + 26 ], - "starting_column": 9, - "ending_column": 41 + "starting_column": 13, + "ending_column": 31 }, "type_specific_fields": { "parent": { @@ -193,9 +193,9 @@ } } ], - "description": "ArrayLengthAssignment (tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#1-46) contract sets array length with a user-controlled value:\n\t- b.subStruct.x.length = param + 1 (tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#41)\n", - "markdown": "[ArrayLengthAssignment](tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#L1-L46) contract sets array length with a user-controlled value:\n\t- [b.subStruct.x.length = param + 1](tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#L41)\n", - "id": "ba005d0d2665bc40c7c33b2a6a32bf426b4a5ccea38e75a6265976a20c9b7ae3", + "description": "ArrayLengthAssignment (tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#1-46) contract sets array length with a user-controlled value:\n\t- arr.length = param (tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#26)\n", + "markdown": "[ArrayLengthAssignment](tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#L1-L46) contract sets array length with a user-controlled value:\n\t- [arr.length = param](tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#L26)\n", + "id": "5120add82e5b674971638ddcd430301e4fd0ff0abc12b425d78bb09baa519dd0", "check": "controlled-array-length", "impact": "High", "confidence": "Medium" @@ -267,20 +267,20 @@ }, { "type": "node", - "name": "a.x.length = param", + "name": "b.subStruct.x.length = param + 1", "source_mapping": { - "start": 818, - "length": 18, + "start": 964, + "length": 32, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", "is_dependency": false, "lines": [ - 36 + 41 ], "starting_column": 9, - "ending_column": 27 + "ending_column": 41 }, "type_specific_fields": { "parent": { @@ -393,9 +393,9 @@ } } ], - "description": "ArrayLengthAssignment (tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#1-46) contract sets array length with a user-controlled value:\n\t- a.x.length = param (tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#36)\n", - "markdown": "[ArrayLengthAssignment](tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#L1-L46) contract sets array length with a user-controlled value:\n\t- [a.x.length = param](tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#L36)\n", - "id": "3ee7c4c1f07506f88bcd3b42a86641b32b24a3978768cbcb99301bd8a1fcb975", + "description": "ArrayLengthAssignment (tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#1-46) contract sets array length with a user-controlled value:\n\t- b.subStruct.x.length = param + 1 (tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#41)\n", + "markdown": "[ArrayLengthAssignment](tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#L1-L46) contract sets array length with a user-controlled value:\n\t- [b.subStruct.x.length = param + 1](tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#L41)\n", + "id": "ba005d0d2665bc40c7c33b2a6a32bf426b4a5ccea38e75a6265976a20c9b7ae3", "check": "controlled-array-length", "impact": "High", "confidence": "Medium" @@ -467,9 +467,9 @@ }, { "type": "node", - "name": "arr.length = param", + "name": "a.x.length = param", "source_mapping": { - "start": 527, + "start": 818, "length": 18, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", @@ -477,10 +477,10 @@ "filename_short": "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", "is_dependency": false, "lines": [ - 26 + 36 ], - "starting_column": 13, - "ending_column": 31 + "starting_column": 9, + "ending_column": 27 }, "type_specific_fields": { "parent": { @@ -593,9 +593,9 @@ } } ], - "description": "ArrayLengthAssignment (tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#1-46) contract sets array length with a user-controlled value:\n\t- arr.length = param (tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#26)\n", - "markdown": "[ArrayLengthAssignment](tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#L1-L46) contract sets array length with a user-controlled value:\n\t- [arr.length = param](tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#L26)\n", - "id": "5120add82e5b674971638ddcd430301e4fd0ff0abc12b425d78bb09baa519dd0", + "description": "ArrayLengthAssignment (tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#1-46) contract sets array length with a user-controlled value:\n\t- a.x.length = param (tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#36)\n", + "markdown": "[ArrayLengthAssignment](tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#L1-L46) contract sets array length with a user-controlled value:\n\t- [a.x.length = param](tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol#L36)\n", + "id": "3ee7c4c1f07506f88bcd3b42a86641b32b24a3978768cbcb99301bd8a1fcb975", "check": "controlled-array-length", "impact": "High", "confidence": "Medium" diff --git a/tests/detectors/naming-convention/0.4.25/naming_convention_ignore.sol.0.4.25.NamingConvention.json b/tests/detectors/naming-convention/0.4.25/naming_convention_ignore.sol.0.4.25.NamingConvention.json deleted file mode 100644 index 9246c3f1ff..0000000000 --- a/tests/detectors/naming-convention/0.4.25/naming_convention_ignore.sol.0.4.25.NamingConvention.json +++ /dev/null @@ -1,76 +0,0 @@ -[ - [ - { - "elements": [ - { - "type": "struct", - "name": "test3", - "source_mapping": { - "start": 320, - "length": 36, - "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention_ignore.sol", - "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention_ignore.sol", - "is_dependency": false, - "lines": [ - 18, - 19, - 20 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "naming", - "source_mapping": { - "start": 61, - "length": 299, - "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/0.4.25/naming_convention_ignore.sol", - "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/0.4.25/naming_convention_ignore.sol", - "is_dependency": false, - "lines": [ - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22 - ], - "starting_column": 1, - "ending_column": 2 - } - } - }, - "additional_fields": { - "target": "structure", - "convention": "CapWords" - } - } - ], - "description": "Struct naming.test3 (tests/detectors/naming-convention/0.4.25/naming_convention_ignore.sol#18-20) is not in CapWords\n", - "markdown": "Struct [naming.test3](tests/detectors/naming-convention/0.4.25/naming_convention_ignore.sol#L18-L20) is not in CapWords\n", - "id": "34b66b0b5acf6c00b066dd7f5bbcdbc6f3879ab5ece850f113d00e3318eac10f", - "check": "naming-convention", - "impact": "Informational", - "confidence": "High" - } - ] -] \ No newline at end of file diff --git a/tests/detectors/naming-convention/0.5.16/naming_convention_ignore.sol.0.5.16.NamingConvention.json b/tests/detectors/naming-convention/0.5.16/naming_convention_ignore.sol.0.5.16.NamingConvention.json deleted file mode 100644 index baeee9bf16..0000000000 --- a/tests/detectors/naming-convention/0.5.16/naming_convention_ignore.sol.0.5.16.NamingConvention.json +++ /dev/null @@ -1,76 +0,0 @@ -[ - [ - { - "elements": [ - { - "type": "struct", - "name": "test3", - "source_mapping": { - "start": 320, - "length": 36, - "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention_ignore.sol", - "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention_ignore.sol", - "is_dependency": false, - "lines": [ - 18, - 19, - 20 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "naming", - "source_mapping": { - "start": 61, - "length": 299, - "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/0.5.16/naming_convention_ignore.sol", - "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/0.5.16/naming_convention_ignore.sol", - "is_dependency": false, - "lines": [ - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22 - ], - "starting_column": 1, - "ending_column": 2 - } - } - }, - "additional_fields": { - "target": "structure", - "convention": "CapWords" - } - } - ], - "description": "Struct naming.test3 (tests/detectors/naming-convention/0.5.16/naming_convention_ignore.sol#18-20) is not in CapWords\n", - "markdown": "Struct [naming.test3](tests/detectors/naming-convention/0.5.16/naming_convention_ignore.sol#L18-L20) is not in CapWords\n", - "id": "34b66b0b5acf6c00b066dd7f5bbcdbc6f3879ab5ece850f113d00e3318eac10f", - "check": "naming-convention", - "impact": "Informational", - "confidence": "High" - } - ] -] \ No newline at end of file diff --git a/tests/detectors/naming-convention/0.6.11/naming_convention_ignore.sol.0.6.11.NamingConvention.json b/tests/detectors/naming-convention/0.6.11/naming_convention_ignore.sol.0.6.11.NamingConvention.json deleted file mode 100644 index 6eac384faf..0000000000 --- a/tests/detectors/naming-convention/0.6.11/naming_convention_ignore.sol.0.6.11.NamingConvention.json +++ /dev/null @@ -1,76 +0,0 @@ -[ - [ - { - "elements": [ - { - "type": "struct", - "name": "test3", - "source_mapping": { - "start": 320, - "length": 36, - "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention_ignore.sol", - "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention_ignore.sol", - "is_dependency": false, - "lines": [ - 18, - 19, - 20 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "naming", - "source_mapping": { - "start": 61, - "length": 299, - "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/0.6.11/naming_convention_ignore.sol", - "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/0.6.11/naming_convention_ignore.sol", - "is_dependency": false, - "lines": [ - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22 - ], - "starting_column": 1, - "ending_column": 2 - } - } - }, - "additional_fields": { - "target": "structure", - "convention": "CapWords" - } - } - ], - "description": "Struct naming.test3 (tests/detectors/naming-convention/0.6.11/naming_convention_ignore.sol#18-20) is not in CapWords\n", - "markdown": "Struct [naming.test3](tests/detectors/naming-convention/0.6.11/naming_convention_ignore.sol#L18-L20) is not in CapWords\n", - "id": "34b66b0b5acf6c00b066dd7f5bbcdbc6f3879ab5ece850f113d00e3318eac10f", - "check": "naming-convention", - "impact": "Informational", - "confidence": "High" - } - ] -] \ No newline at end of file diff --git a/tests/detectors/naming-convention/0.7.6/naming_convention_ignore.sol.0.7.6.NamingConvention.json b/tests/detectors/naming-convention/0.7.6/naming_convention_ignore.sol.0.7.6.NamingConvention.json deleted file mode 100644 index 78101ada5b..0000000000 --- a/tests/detectors/naming-convention/0.7.6/naming_convention_ignore.sol.0.7.6.NamingConvention.json +++ /dev/null @@ -1,76 +0,0 @@ -[ - [ - { - "elements": [ - { - "type": "struct", - "name": "test3", - "source_mapping": { - "start": 320, - "length": 36, - "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention_ignore.sol", - "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention_ignore.sol", - "is_dependency": false, - "lines": [ - 18, - 19, - 20 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "naming", - "source_mapping": { - "start": 61, - "length": 299, - "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/naming-convention/0.7.6/naming_convention_ignore.sol", - "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/naming-convention/0.7.6/naming_convention_ignore.sol", - "is_dependency": false, - "lines": [ - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22 - ], - "starting_column": 1, - "ending_column": 2 - } - } - }, - "additional_fields": { - "target": "structure", - "convention": "CapWords" - } - } - ], - "description": "Struct naming.test3 (tests/detectors/naming-convention/0.7.6/naming_convention_ignore.sol#18-20) is not in CapWords\n", - "markdown": "Struct [naming.test3](tests/detectors/naming-convention/0.7.6/naming_convention_ignore.sol#L18-L20) is not in CapWords\n", - "id": "34b66b0b5acf6c00b066dd7f5bbcdbc6f3879ab5ece850f113d00e3318eac10f", - "check": "naming-convention", - "impact": "Informational", - "confidence": "High" - } - ] -] \ No newline at end of file diff --git a/tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol b/tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol similarity index 100% rename from tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol rename to tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol diff --git a/tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol.0.4.25.ReentrancyReadBeforeWritten.json b/tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol.0.4.25.ReentrancyReadBeforeWritten.json similarity index 88% rename from tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol.0.4.25.ReentrancyReadBeforeWritten.json rename to tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol.0.4.25.ReentrancyReadBeforeWritten.json index 39c3d85095..e5a4c7ed11 100644 --- a/tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol.0.4.25.ReentrancyReadBeforeWritten.json +++ b/tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol.0.4.25.ReentrancyReadBeforeWritten.json @@ -9,9 +9,9 @@ "start": 87, "length": 153, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 6, @@ -33,9 +33,9 @@ "start": 28, "length": 537, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -80,9 +80,9 @@ "start": 152, "length": 20, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 8 @@ -98,9 +98,9 @@ "start": 87, "length": 153, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 6, @@ -122,9 +122,9 @@ "start": 28, "length": 537, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -174,9 +174,9 @@ "start": 216, "length": 17, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 11 @@ -192,9 +192,9 @@ "start": 87, "length": 153, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 6, @@ -216,9 +216,9 @@ "start": 28, "length": 537, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -263,9 +263,9 @@ } } ], - "description": "Reentrancy in ReentrancyWrite.bad0() (tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#6-12):\n\tExternal calls:\n\t- ! (msg.sender.call()) (tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- notCalled = false (tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#11)\n", - "markdown": "Reentrancy in [ReentrancyWrite.bad0()](tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#L6-L12):\n\tExternal calls:\n\t- [! (msg.sender.call())](tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [notCalled = false](tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#L11)\n", - "id": "b6460b2a0b12df1225dcc8a10e0301fe4b474cccf05822d2a7c157470b689402", + "description": "Reentrancy in ReentrancyWrite.bad0() (tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#6-12):\n\tExternal calls:\n\t- ! (msg.sender.call()) (tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- notCalled = false (tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#11)\n", + "markdown": "Reentrancy in [ReentrancyWrite.bad0()](tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L6-L12):\n\tExternal calls:\n\t- [! (msg.sender.call())](tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [notCalled = false](tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L11)\n", + "id": "f933b0dd64ecd6dfb70018248bff9e11c03a35657032529ff992308456d475dd", "check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium" @@ -279,9 +279,9 @@ "start": 246, "length": 158, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 14, @@ -302,9 +302,9 @@ "start": 28, "length": 537, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -349,9 +349,9 @@ "start": 321, "length": 34, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 16 @@ -367,9 +367,9 @@ "start": 246, "length": 158, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 14, @@ -390,9 +390,9 @@ "start": 28, "length": 537, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -442,9 +442,9 @@ "start": 391, "length": 6, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 18 @@ -460,9 +460,9 @@ "start": 246, "length": 158, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 14, @@ -483,9 +483,9 @@ "start": 28, "length": 537, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -535,9 +535,9 @@ "start": 152, "length": 20, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 8 @@ -553,9 +553,9 @@ "start": 87, "length": 153, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 6, @@ -577,9 +577,9 @@ "start": 28, "length": 537, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -629,9 +629,9 @@ "start": 391, "length": 6, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 18 @@ -647,9 +647,9 @@ "start": 246, "length": 158, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 14, @@ -670,9 +670,9 @@ "start": 28, "length": 537, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -723,9 +723,9 @@ "start": 216, "length": 17, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 11 @@ -741,9 +741,9 @@ "start": 87, "length": 153, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 6, @@ -765,9 +765,9 @@ "start": 28, "length": 537, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -812,9 +812,9 @@ } } ], - "description": "Reentrancy in ReentrancyWrite.bad1(address) (tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#14-19):\n\tExternal calls:\n\t- success = msg.sender.call() (tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#16)\n\t- bad0() (tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#18)\n\t\t- ! (msg.sender.call()) (tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- bad0() (tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#18)\n\t\t- notCalled = false (tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#11)\n", - "markdown": "Reentrancy in [ReentrancyWrite.bad1(address)](tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#L14-L19):\n\tExternal calls:\n\t- [success = msg.sender.call()](tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#L16)\n\t- [bad0()](tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#L18)\n\t\t- [! (msg.sender.call())](tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [bad0()](tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#L18)\n\t\t- [notCalled = false](tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol#L11)\n", - "id": "49aa9488337b9cce5fa0d5b961bae4d1fff7d79001371769dea3abbc4a1a059b", + "description": "Reentrancy in ReentrancyWrite.bad1(address) (tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#14-19):\n\tExternal calls:\n\t- success = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#16)\n\t- bad0() (tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#18)\n\t\t- ! (msg.sender.call()) (tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- bad0() (tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#18)\n\t\t- notCalled = false (tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#11)\n", + "markdown": "Reentrancy in [ReentrancyWrite.bad1(address)](tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L14-L19):\n\tExternal calls:\n\t- [success = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L16)\n\t- [bad0()](tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L18)\n\t\t- [! (msg.sender.call())](tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [bad0()](tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L18)\n\t\t- [notCalled = false](tests/detectors/reentrancy-no-eth/0.4.25/reentrancy-write.sol#L11)\n", + "id": "7bb6139d33983b626159983e8a4d7fc049710a8f08908c1d212bd13b68640a6a", "check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium" diff --git a/tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol b/tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol similarity index 100% rename from tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol rename to tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol diff --git a/tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol.0.5.16.ReentrancyReadBeforeWritten.json b/tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol.0.5.16.ReentrancyReadBeforeWritten.json similarity index 88% rename from tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol.0.5.16.ReentrancyReadBeforeWritten.json rename to tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol.0.5.16.ReentrancyReadBeforeWritten.json index 5f7696f983..9ba6850f3e 100644 --- a/tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol.0.5.16.ReentrancyReadBeforeWritten.json +++ b/tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol.0.5.16.ReentrancyReadBeforeWritten.json @@ -9,9 +9,9 @@ "start": 87, "length": 188, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "is_dependency": false, "lines": [ 6, @@ -34,9 +34,9 @@ "start": 28, "length": 610, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -83,9 +83,9 @@ "start": 148, "length": 37, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "is_dependency": false, "lines": [ 8 @@ -101,9 +101,9 @@ "start": 87, "length": 188, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "is_dependency": false, "lines": [ 6, @@ -126,9 +126,9 @@ "start": 28, "length": 610, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -180,9 +180,9 @@ "start": 251, "length": 17, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "is_dependency": false, "lines": [ 12 @@ -198,9 +198,9 @@ "start": 87, "length": 188, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "is_dependency": false, "lines": [ 6, @@ -223,9 +223,9 @@ "start": 28, "length": 610, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -272,9 +272,9 @@ } } ], - "description": "Reentrancy in ReentrancyWrite.bad0() (tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#6-13):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- notCalled = false (tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#12)\n", - "markdown": "Reentrancy in [ReentrancyWrite.bad0()](tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#L6-L13):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [notCalled = false](tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#L12)\n", - "id": "2d6670618c55850a7db95d384607492b69a837ccae5c496cfcf716b5f492d95f", + "description": "Reentrancy in ReentrancyWrite.bad0() (tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#6-13):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- notCalled = false (tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#12)\n", + "markdown": "Reentrancy in [ReentrancyWrite.bad0()](tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L6-L13):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [notCalled = false](tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L12)\n", + "id": "0aac5bbaf3a6f1b7de2ac725771ade12f8b1453c0639d09517b8bddb098a13d2", "check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium" @@ -288,9 +288,9 @@ "start": 281, "length": 161, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "is_dependency": false, "lines": [ 15, @@ -311,9 +311,9 @@ "start": 28, "length": 610, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -360,9 +360,9 @@ "start": 356, "length": 37, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "is_dependency": false, "lines": [ 17 @@ -378,9 +378,9 @@ "start": 281, "length": 161, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "is_dependency": false, "lines": [ 15, @@ -401,9 +401,9 @@ "start": 28, "length": 610, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -455,9 +455,9 @@ "start": 429, "length": 6, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "is_dependency": false, "lines": [ 19 @@ -473,9 +473,9 @@ "start": 281, "length": 161, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "is_dependency": false, "lines": [ 15, @@ -496,9 +496,9 @@ "start": 28, "length": 610, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -550,9 +550,9 @@ "start": 148, "length": 37, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "is_dependency": false, "lines": [ 8 @@ -568,9 +568,9 @@ "start": 87, "length": 188, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "is_dependency": false, "lines": [ 6, @@ -593,9 +593,9 @@ "start": 28, "length": 610, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -647,9 +647,9 @@ "start": 429, "length": 6, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "is_dependency": false, "lines": [ 19 @@ -665,9 +665,9 @@ "start": 281, "length": 161, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "is_dependency": false, "lines": [ 15, @@ -688,9 +688,9 @@ "start": 28, "length": 610, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -743,9 +743,9 @@ "start": 251, "length": 17, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "is_dependency": false, "lines": [ 12 @@ -761,9 +761,9 @@ "start": 87, "length": 188, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "is_dependency": false, "lines": [ 6, @@ -786,9 +786,9 @@ "start": 28, "length": 610, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -835,9 +835,9 @@ } } ], - "description": "Reentrancy in ReentrancyWrite.bad1(address) (tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#15-20):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#17)\n\t- bad0() (tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#19)\n\t\t- (success) = msg.sender.call() (tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- bad0() (tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#19)\n\t\t- notCalled = false (tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#12)\n", - "markdown": "Reentrancy in [ReentrancyWrite.bad1(address)](tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#L15-L20):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#L17)\n\t- [bad0()](tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#L19)\n\t\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [bad0()](tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#L19)\n\t\t- [notCalled = false](tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol#L12)\n", - "id": "18e7eee4cf4c349dbaad3f54387eb6b3b174e868b94a3ebb991f7403b276b0d9", + "description": "Reentrancy in ReentrancyWrite.bad1(address) (tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#15-20):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#17)\n\t- bad0() (tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#19)\n\t\t- (success) = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- bad0() (tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#19)\n\t\t- notCalled = false (tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#12)\n", + "markdown": "Reentrancy in [ReentrancyWrite.bad1(address)](tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L15-L20):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L17)\n\t- [bad0()](tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L19)\n\t\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [bad0()](tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L19)\n\t\t- [notCalled = false](tests/detectors/reentrancy-no-eth/0.5.16/reentrancy-write.sol#L12)\n", + "id": "05033b6ee9ae71d9cc7b1ec3f6b09d4c0a43a6c92393f54fa45ce27c89a1e771", "check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium" diff --git a/tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol b/tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol similarity index 100% rename from tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol rename to tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol diff --git a/tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol.0.6.11.ReentrancyReadBeforeWritten.json b/tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol.0.6.11.ReentrancyReadBeforeWritten.json similarity index 88% rename from tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol.0.6.11.ReentrancyReadBeforeWritten.json rename to tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol.0.6.11.ReentrancyReadBeforeWritten.json index e7dcf3b7e9..5e20c87772 100644 --- a/tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol.0.6.11.ReentrancyReadBeforeWritten.json +++ b/tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol.0.6.11.ReentrancyReadBeforeWritten.json @@ -9,9 +9,9 @@ "start": 87, "length": 188, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "is_dependency": false, "lines": [ 6, @@ -34,9 +34,9 @@ "start": 28, "length": 610, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -83,9 +83,9 @@ "start": 148, "length": 37, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "is_dependency": false, "lines": [ 8 @@ -101,9 +101,9 @@ "start": 87, "length": 188, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "is_dependency": false, "lines": [ 6, @@ -126,9 +126,9 @@ "start": 28, "length": 610, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -180,9 +180,9 @@ "start": 251, "length": 17, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "is_dependency": false, "lines": [ 12 @@ -198,9 +198,9 @@ "start": 87, "length": 188, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "is_dependency": false, "lines": [ 6, @@ -223,9 +223,9 @@ "start": 28, "length": 610, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -272,9 +272,9 @@ } } ], - "description": "Reentrancy in ReentrancyWrite.bad0() (tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#6-13):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- notCalled = false (tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#12)\n", - "markdown": "Reentrancy in [ReentrancyWrite.bad0()](tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#L6-L13):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [notCalled = false](tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#L12)\n", - "id": "0bfc3b0d021a94a74467bb46a134e5fbcefeed8f7351fc4de972d81737eb6964", + "description": "Reentrancy in ReentrancyWrite.bad0() (tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#6-13):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- notCalled = false (tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#12)\n", + "markdown": "Reentrancy in [ReentrancyWrite.bad0()](tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L6-L13):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [notCalled = false](tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L12)\n", + "id": "a786c050fdd723d3185d93105e0903cb696bf4ce71996fc791e79d8f97c5e72d", "check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium" @@ -288,9 +288,9 @@ "start": 281, "length": 161, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "is_dependency": false, "lines": [ 15, @@ -311,9 +311,9 @@ "start": 28, "length": 610, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -360,9 +360,9 @@ "start": 356, "length": 37, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "is_dependency": false, "lines": [ 17 @@ -378,9 +378,9 @@ "start": 281, "length": 161, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "is_dependency": false, "lines": [ 15, @@ -401,9 +401,9 @@ "start": 28, "length": 610, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -455,9 +455,9 @@ "start": 429, "length": 6, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "is_dependency": false, "lines": [ 19 @@ -473,9 +473,9 @@ "start": 281, "length": 161, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "is_dependency": false, "lines": [ 15, @@ -496,9 +496,9 @@ "start": 28, "length": 610, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -550,9 +550,9 @@ "start": 148, "length": 37, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "is_dependency": false, "lines": [ 8 @@ -568,9 +568,9 @@ "start": 87, "length": 188, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "is_dependency": false, "lines": [ 6, @@ -593,9 +593,9 @@ "start": 28, "length": 610, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -647,9 +647,9 @@ "start": 429, "length": 6, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "is_dependency": false, "lines": [ 19 @@ -665,9 +665,9 @@ "start": 281, "length": 161, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "is_dependency": false, "lines": [ 15, @@ -688,9 +688,9 @@ "start": 28, "length": 610, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -743,9 +743,9 @@ "start": 251, "length": 17, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "is_dependency": false, "lines": [ 12 @@ -761,9 +761,9 @@ "start": 87, "length": 188, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "is_dependency": false, "lines": [ 6, @@ -786,9 +786,9 @@ "start": 28, "length": 610, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -835,9 +835,9 @@ } } ], - "description": "Reentrancy in ReentrancyWrite.bad1(address) (tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#15-20):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#17)\n\t- bad0() (tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#19)\n\t\t- (success) = msg.sender.call() (tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- bad0() (tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#19)\n\t\t- notCalled = false (tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#12)\n", - "markdown": "Reentrancy in [ReentrancyWrite.bad1(address)](tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#L15-L20):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#L17)\n\t- [bad0()](tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#L19)\n\t\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [bad0()](tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#L19)\n\t\t- [notCalled = false](tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol#L12)\n", - "id": "273aa0b14294c7230099633c801857a2cb116cc8cc5f8c3c20ced1cf67cc1c31", + "description": "Reentrancy in ReentrancyWrite.bad1(address) (tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#15-20):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#17)\n\t- bad0() (tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#19)\n\t\t- (success) = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- bad0() (tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#19)\n\t\t- notCalled = false (tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#12)\n", + "markdown": "Reentrancy in [ReentrancyWrite.bad1(address)](tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L15-L20):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L17)\n\t- [bad0()](tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L19)\n\t\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [bad0()](tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L19)\n\t\t- [notCalled = false](tests/detectors/reentrancy-no-eth/0.6.11/reentrancy-write.sol#L12)\n", + "id": "02d9e7190770aed44ccdabc149dfc114e91d2f90346cfbfff570c7ccbc1d64e8", "check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium" diff --git a/tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol b/tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol similarity index 100% rename from tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol rename to tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol diff --git a/tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol.0.7.6.ReentrancyReadBeforeWritten.json b/tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol.0.7.6.ReentrancyReadBeforeWritten.json similarity index 88% rename from tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol.0.7.6.ReentrancyReadBeforeWritten.json rename to tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol.0.7.6.ReentrancyReadBeforeWritten.json index eee4e183f3..63632b5668 100644 --- a/tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol.0.7.6.ReentrancyReadBeforeWritten.json +++ b/tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol.0.7.6.ReentrancyReadBeforeWritten.json @@ -9,9 +9,9 @@ "start": 87, "length": 188, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "is_dependency": false, "lines": [ 6, @@ -34,9 +34,9 @@ "start": 28, "length": 610, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -83,9 +83,9 @@ "start": 148, "length": 37, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "is_dependency": false, "lines": [ 8 @@ -101,9 +101,9 @@ "start": 87, "length": 188, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "is_dependency": false, "lines": [ 6, @@ -126,9 +126,9 @@ "start": 28, "length": 610, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -180,9 +180,9 @@ "start": 251, "length": 17, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "is_dependency": false, "lines": [ 12 @@ -198,9 +198,9 @@ "start": 87, "length": 188, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "is_dependency": false, "lines": [ 6, @@ -223,9 +223,9 @@ "start": 28, "length": 610, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -272,9 +272,9 @@ } } ], - "description": "Reentrancy in ReentrancyWrite.bad0() (tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#6-13):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- notCalled = false (tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#12)\n", - "markdown": "Reentrancy in [ReentrancyWrite.bad0()](tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#L6-L13):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [notCalled = false](tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#L12)\n", - "id": "f3e3f74c6502fba4ea12147b4301547c7b46172cb358f54c8a3d05f0fc127698", + "description": "Reentrancy in ReentrancyWrite.bad0() (tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#6-13):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- notCalled = false (tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#12)\n", + "markdown": "Reentrancy in [ReentrancyWrite.bad0()](tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L6-L13):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [notCalled = false](tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L12)\n", + "id": "10fd7c0322e6af411a40589a36dd17ec3e91b73cb56a6757dd9b192bcc2b6955", "check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium" @@ -288,9 +288,9 @@ "start": 281, "length": 161, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "is_dependency": false, "lines": [ 15, @@ -311,9 +311,9 @@ "start": 28, "length": 610, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -360,9 +360,9 @@ "start": 356, "length": 37, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "is_dependency": false, "lines": [ 17 @@ -378,9 +378,9 @@ "start": 281, "length": 161, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "is_dependency": false, "lines": [ 15, @@ -401,9 +401,9 @@ "start": 28, "length": 610, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -455,9 +455,9 @@ "start": 429, "length": 6, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "is_dependency": false, "lines": [ 19 @@ -473,9 +473,9 @@ "start": 281, "length": 161, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "is_dependency": false, "lines": [ 15, @@ -496,9 +496,9 @@ "start": 28, "length": 610, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -550,9 +550,9 @@ "start": 148, "length": 37, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "is_dependency": false, "lines": [ 8 @@ -568,9 +568,9 @@ "start": 87, "length": 188, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "is_dependency": false, "lines": [ 6, @@ -593,9 +593,9 @@ "start": 28, "length": 610, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -647,9 +647,9 @@ "start": 429, "length": 6, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "is_dependency": false, "lines": [ 19 @@ -665,9 +665,9 @@ "start": 281, "length": 161, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "is_dependency": false, "lines": [ 15, @@ -688,9 +688,9 @@ "start": 28, "length": 610, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -743,9 +743,9 @@ "start": 251, "length": 17, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "is_dependency": false, "lines": [ 12 @@ -761,9 +761,9 @@ "start": 87, "length": 188, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "is_dependency": false, "lines": [ 6, @@ -786,9 +786,9 @@ "start": 28, "length": 610, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "filename_short": "tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol", "is_dependency": false, "lines": [ 3, @@ -835,9 +835,9 @@ } } ], - "description": "Reentrancy in ReentrancyWrite.bad1(address) (tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#15-20):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#17)\n\t- bad0() (tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#19)\n\t\t- (success) = msg.sender.call() (tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- bad0() (tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#19)\n\t\t- notCalled = false (tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#12)\n", - "markdown": "Reentrancy in [ReentrancyWrite.bad1(address)](tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#L15-L20):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#L17)\n\t- [bad0()](tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#L19)\n\t\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [bad0()](tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#L19)\n\t\t- [notCalled = false](tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol#L12)\n", - "id": "139c24158771526e3497a6bc730b32d173e3e67728f1833073694eb9df339b69", + "description": "Reentrancy in ReentrancyWrite.bad1(address) (tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#15-20):\n\tExternal calls:\n\t- (success) = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#17)\n\t- bad0() (tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#19)\n\t\t- (success) = msg.sender.call() (tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- bad0() (tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#19)\n\t\t- notCalled = false (tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#12)\n", + "markdown": "Reentrancy in [ReentrancyWrite.bad1(address)](tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L15-L20):\n\tExternal calls:\n\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L17)\n\t- [bad0()](tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L19)\n\t\t- [(success) = msg.sender.call()](tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [bad0()](tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L19)\n\t\t- [notCalled = false](tests/detectors/reentrancy-no-eth/0.7.6/reentrancy-write.sol#L12)\n", + "id": "a9d96103d5786a77ba0de28c96dc94a27ea5acda47af8fef59a80327925a286b", "check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium" diff --git a/tests/detectors/missing-inheritance/0.5.16/unimplemented_interfaces.sol b/tests/detectors/unimplemented-functions/0.5.16/unimplemented_interfaces.sol similarity index 100% rename from tests/detectors/missing-inheritance/0.5.16/unimplemented_interfaces.sol rename to tests/detectors/unimplemented-functions/0.5.16/unimplemented_interfaces.sol diff --git a/tests/detectors/missing-inheritance/0.5.16/unimplemented_interfaces.sol.0.5.16.UnimplementedFunctionDetection.json b/tests/detectors/unimplemented-functions/0.5.16/unimplemented_interfaces.sol.0.5.16.UnimplementedFunctionDetection.json similarity index 100% rename from tests/detectors/missing-inheritance/0.5.16/unimplemented_interfaces.sol.0.5.16.UnimplementedFunctionDetection.json rename to tests/detectors/unimplemented-functions/0.5.16/unimplemented_interfaces.sol.0.5.16.UnimplementedFunctionDetection.json diff --git a/tests/detectors/missing-inheritance/0.6.11/unimplemented_interfaces.sol b/tests/detectors/unimplemented-functions/0.6.11/unimplemented_interfaces.sol similarity index 100% rename from tests/detectors/missing-inheritance/0.6.11/unimplemented_interfaces.sol rename to tests/detectors/unimplemented-functions/0.6.11/unimplemented_interfaces.sol diff --git a/tests/detectors/missing-inheritance/0.6.11/unimplemented_interfaces.sol.0.6.11.UnimplementedFunctionDetection.json b/tests/detectors/unimplemented-functions/0.6.11/unimplemented_interfaces.sol.0.6.11.UnimplementedFunctionDetection.json similarity index 100% rename from tests/detectors/missing-inheritance/0.6.11/unimplemented_interfaces.sol.0.6.11.UnimplementedFunctionDetection.json rename to tests/detectors/unimplemented-functions/0.6.11/unimplemented_interfaces.sol.0.6.11.UnimplementedFunctionDetection.json diff --git a/tests/detectors/missing-inheritance/0.7.6/unimplemented_interfaces.sol b/tests/detectors/unimplemented-functions/0.7.6/unimplemented_interfaces.sol similarity index 100% rename from tests/detectors/missing-inheritance/0.7.6/unimplemented_interfaces.sol rename to tests/detectors/unimplemented-functions/0.7.6/unimplemented_interfaces.sol diff --git a/tests/detectors/missing-inheritance/0.7.6/unimplemented_interfaces.sol.0.7.6.UnimplementedFunctionDetection.json b/tests/detectors/unimplemented-functions/0.7.6/unimplemented_interfaces.sol.0.7.6.UnimplementedFunctionDetection.json similarity index 100% rename from tests/detectors/missing-inheritance/0.7.6/unimplemented_interfaces.sol.0.7.6.UnimplementedFunctionDetection.json rename to tests/detectors/unimplemented-functions/0.7.6/unimplemented_interfaces.sol.0.7.6.UnimplementedFunctionDetection.json diff --git a/tests/test_detectors.py b/tests/test_detectors.py index 78571b7a1f..d93dd75ba9 100644 --- a/tests/test_detectors.py +++ b/tests/test_detectors.py @@ -40,7 +40,7 @@ def __init__( self.additional_files = additional_files -def set_solc(test_item: Test): +def set_solc(test_item: Test): # pylint: disable=too-many-lines # hacky hack hack to pick the solc version we want env = dict(os.environ) env["SOLC_VERSION"] = test_item.solc_ver @@ -49,1105 +49,1074 @@ def set_solc(test_item: Test): def id_test(test_item: Test): - return f"{test_item.detector}: {test_item.test_file}" + return f"{test_item.detector}: {test_item.solc_ver}/{test_item.test_file}" ALL_TESTS = [ Test( # DO NOT move this specific test further down in this list, because for some inexplicable reason this test will then fail to report function bad2 ?! all_detectors.UninitializedFunctionPtrsConstructor, - "tests/detectors/uninitialized-fptr-cst/0.4.25/uninitialized_function_ptr_constructor.sol", + "uninitialized_function_ptr_constructor.sol", "0.4.25", ), Test( all_detectors.UninitializedFunctionPtrsConstructor, - "tests/detectors/uninitialized-fptr-cst/0.5.8/uninitialized_function_ptr_constructor.sol", + "uninitialized_function_ptr_constructor.sol", "0.5.8", ), Test( all_detectors.UninitializedFunctionPtrsConstructor, - "tests/detectors/uninitialized-fptr-cst/0.5.16/uninitialized_function_ptr_constructor.sol", + "uninitialized_function_ptr_constructor.sol", "0.5.16", ), Test( all_detectors.ReentrancyBenign, - "tests/detectors/reentrancy-benign/0.4.25/reentrancy-benign.sol", + "reentrancy-benign.sol", "0.4.25", ), Test( all_detectors.ReentrancyBenign, - "tests/detectors/reentrancy-benign/0.5.16/reentrancy-benign.sol", + "reentrancy-benign.sol", "0.5.16", ), Test( all_detectors.ReentrancyBenign, - "tests/detectors/reentrancy-benign/0.6.11/reentrancy-benign.sol", + "reentrancy-benign.sol", "0.6.11", ), Test( all_detectors.ReentrancyBenign, - "tests/detectors/reentrancy-benign/0.7.6/reentrancy-benign.sol", + "reentrancy-benign.sol", "0.7.6", ), Test( all_detectors.ReentrancyReadBeforeWritten, - "tests/detectors/reentrancy-before-write/0.4.25/reentrancy-write.sol", + "reentrancy-write.sol", "0.4.25", ), Test( all_detectors.ReentrancyReadBeforeWritten, - "tests/detectors/reentrancy-before-write/0.5.16/reentrancy-write.sol", + "reentrancy-write.sol", "0.5.16", ), Test( all_detectors.ReentrancyReadBeforeWritten, - "tests/detectors/reentrancy-before-write/0.6.11/reentrancy-write.sol", + "reentrancy-write.sol", "0.6.11", ), Test( all_detectors.ReentrancyReadBeforeWritten, - "tests/detectors/reentrancy-before-write/0.7.6/reentrancy-write.sol", + "reentrancy-write.sol", "0.7.6", ), Test( all_detectors.BooleanEquality, - "tests/detectors/boolean-constant-equality/0.4.25/boolean-constant-equality.sol", + "boolean-constant-equality.sol", "0.4.25", ), Test( all_detectors.BooleanEquality, - "tests/detectors/boolean-constant-equality/0.5.16/boolean-constant-equality.sol", + "boolean-constant-equality.sol", "0.5.16", ), Test( all_detectors.BooleanEquality, - "tests/detectors/boolean-constant-equality/0.6.11/boolean-constant-equality.sol", + "boolean-constant-equality.sol", "0.6.11", ), Test( all_detectors.BooleanEquality, - "tests/detectors/boolean-constant-equality/0.7.6/boolean-constant-equality.sol", + "boolean-constant-equality.sol", "0.7.6", ), Test( all_detectors.BooleanConstantMisuse, - "tests/detectors/boolean-constant-misuse/0.4.25/boolean-constant-misuse.sol", + "boolean-constant-misuse.sol", "0.4.25", ), Test( all_detectors.BooleanConstantMisuse, - "tests/detectors/boolean-constant-misuse/0.5.16/boolean-constant-misuse.sol", + "boolean-constant-misuse.sol", "0.5.16", ), Test( all_detectors.BooleanConstantMisuse, - "tests/detectors/boolean-constant-misuse/0.6.11/boolean-constant-misuse.sol", + "boolean-constant-misuse.sol", "0.6.11", ), Test( all_detectors.BooleanConstantMisuse, - "tests/detectors/boolean-constant-misuse/0.7.6/boolean-constant-misuse.sol", + "boolean-constant-misuse.sol", "0.7.6", ), Test( all_detectors.UncheckedLowLevel, - "tests/detectors/unchecked-lowlevel/0.4.25/unchecked_lowlevel.sol", + "unchecked_lowlevel.sol", "0.4.25", ), Test( all_detectors.UncheckedLowLevel, - "tests/detectors/unchecked-lowlevel/0.5.16/unchecked_lowlevel.sol", + "unchecked_lowlevel.sol", "0.5.16", ), Test( all_detectors.UncheckedLowLevel, - "tests/detectors/unchecked-lowlevel/0.6.11/unchecked_lowlevel.sol", + "unchecked_lowlevel.sol", "0.6.11", ), Test( all_detectors.UncheckedLowLevel, - "tests/detectors/unchecked-lowlevel/0.7.6/unchecked_lowlevel.sol", + "unchecked_lowlevel.sol", "0.7.6", ), Test( all_detectors.UnindexedERC20EventParameters, - "tests/detectors/erc20-indexed/0.4.25/erc20_indexed.sol", + "erc20_indexed.sol", "0.4.25", ), Test( all_detectors.UnindexedERC20EventParameters, - "tests/detectors/erc20-indexed/0.5.16/erc20_indexed.sol", + "erc20_indexed.sol", "0.5.16", ), Test( all_detectors.UnindexedERC20EventParameters, - "tests/detectors/erc20-indexed/0.6.11/erc20_indexed.sol", + "erc20_indexed.sol", "0.6.11", ), Test( all_detectors.UnindexedERC20EventParameters, - "tests/detectors/erc20-indexed/0.7.6/erc20_indexed.sol", + "erc20_indexed.sol", "0.7.6", ), Test( all_detectors.IncorrectERC20InterfaceDetection, - "tests/detectors/erc20-interface/0.4.25/incorrect_erc20_interface.sol", + "incorrect_erc20_interface.sol", "0.4.25", ), Test( all_detectors.IncorrectERC20InterfaceDetection, - "tests/detectors/erc20-interface/0.5.16/incorrect_erc20_interface.sol", + "incorrect_erc20_interface.sol", "0.5.16", ), Test( all_detectors.IncorrectERC20InterfaceDetection, - "tests/detectors/erc20-interface/0.6.11/incorrect_erc20_interface.sol", + "incorrect_erc20_interface.sol", "0.6.11", ), Test( all_detectors.IncorrectERC20InterfaceDetection, - "tests/detectors/erc20-interface/0.7.6/incorrect_erc20_interface.sol", + "incorrect_erc20_interface.sol", "0.7.6", ), Test( all_detectors.IncorrectERC721InterfaceDetection, - "tests/detectors/erc721-interface/0.4.25/incorrect_erc721_interface.sol", + "incorrect_erc721_interface.sol", "0.4.25", ), Test( all_detectors.IncorrectERC721InterfaceDetection, - "tests/detectors/erc721-interface/0.5.16/incorrect_erc721_interface.sol", + "incorrect_erc721_interface.sol", "0.5.16", ), Test( all_detectors.IncorrectERC721InterfaceDetection, - "tests/detectors/erc721-interface/0.6.11/incorrect_erc721_interface.sol", + "incorrect_erc721_interface.sol", "0.6.11", ), Test( all_detectors.IncorrectERC721InterfaceDetection, - "tests/detectors/erc721-interface/0.7.6/incorrect_erc721_interface.sol", + "incorrect_erc721_interface.sol", "0.7.6", ), Test( all_detectors.UninitializedStateVarsDetection, - "tests/detectors/uninitialized-state/0.4.25/uninitialized.sol", + "uninitialized.sol", "0.4.25", ), Test( all_detectors.UninitializedStateVarsDetection, - "tests/detectors/uninitialized-state/0.5.16/uninitialized.sol", + "uninitialized.sol", "0.5.16", ), Test( all_detectors.UninitializedStateVarsDetection, - "tests/detectors/uninitialized-state/0.6.11/uninitialized.sol", + "uninitialized.sol", "0.6.11", ), Test( all_detectors.UninitializedStateVarsDetection, - "tests/detectors/uninitialized-state/0.7.6/uninitialized.sol", + "uninitialized.sol", "0.7.6", ), - Test(all_detectors.Backdoor, "tests/detectors/backdoor/0.4.25/backdoor.sol", "0.4.25"), - Test(all_detectors.Backdoor, "tests/detectors/backdoor/0.5.16/backdoor.sol", "0.5.16"), - Test(all_detectors.Backdoor, "tests/detectors/backdoor/0.6.11/backdoor.sol", "0.6.11"), - Test(all_detectors.Backdoor, "tests/detectors/backdoor/0.7.6/backdoor.sol", "0.7.6"), - Test(all_detectors.Suicidal, "tests/detectors/suicidal/0.4.25/suicidal.sol", "0.4.25"), - Test(all_detectors.Suicidal, "tests/detectors/suicidal/0.5.16/suicidal.sol", "0.5.16"), - Test(all_detectors.Suicidal, "tests/detectors/suicidal/0.6.11/suicidal.sol", "0.6.11"), - Test(all_detectors.Suicidal, "tests/detectors/suicidal/0.7.6/suicidal.sol", "0.7.6"), + Test(all_detectors.Backdoor, "backdoor.sol", "0.4.25"), + Test(all_detectors.Backdoor, "backdoor.sol", "0.5.16"), + Test(all_detectors.Backdoor, "backdoor.sol", "0.6.11"), + Test(all_detectors.Backdoor, "backdoor.sol", "0.7.6"), + Test(all_detectors.Suicidal, "suicidal.sol", "0.4.25"), + Test(all_detectors.Suicidal, "suicidal.sol", "0.5.16"), + Test(all_detectors.Suicidal, "suicidal.sol", "0.6.11"), + Test(all_detectors.Suicidal, "suicidal.sol", "0.7.6"), Test( all_detectors.ConstantPragma, - "tests/detectors/pragma/0.4.25/pragma.0.4.25.sol", + "pragma.0.4.25.sol", "0.4.25", - ["tests/detectors/pragma/0.4.25/pragma.0.4.24.sol"], + ["pragma.0.4.24.sol"], ), Test( all_detectors.ConstantPragma, - "tests/detectors/pragma/0.5.16/pragma.0.5.16.sol", + "pragma.0.5.16.sol", "0.5.16", - ["tests/detectors/pragma/0.5.16/pragma.0.5.15.sol"], + ["pragma.0.5.15.sol"], ), Test( all_detectors.ConstantPragma, - "tests/detectors/pragma/0.6.11/pragma.0.6.11.sol", + "pragma.0.6.11.sol", "0.6.11", - ["tests/detectors/pragma/0.6.11/pragma.0.6.10.sol"], + ["pragma.0.6.10.sol"], ), Test( all_detectors.ConstantPragma, - "tests/detectors/pragma/0.7.6/pragma.0.7.6.sol", + "pragma.0.7.6.sol", "0.7.6", - ["tests/detectors/pragma/0.7.6/pragma.0.7.5.sol"], - ), - Test(all_detectors.IncorrectSolc, "tests/detectors/solc-version/0.4.25/static.sol", "0.4.25"), - Test(all_detectors.IncorrectSolc, "tests/detectors/solc-version/0.5.14/static.sol", "0.5.14"), - Test(all_detectors.IncorrectSolc, "tests/detectors/solc-version/0.5.16/static.sol", "0.5.16"), - Test( - all_detectors.IncorrectSolc, "tests/detectors/solc-version/0.5.16/dynamic_1.sol", "0.5.16" - ), - Test( - all_detectors.IncorrectSolc, "tests/detectors/solc-version/0.5.16/dynamic_2.sol", "0.5.16" - ), - Test(all_detectors.IncorrectSolc, "tests/detectors/solc-version/0.6.10/static.sol", "0.6.10"), - Test(all_detectors.IncorrectSolc, "tests/detectors/solc-version/0.6.11/static.sol", "0.6.11"), - Test( - all_detectors.IncorrectSolc, "tests/detectors/solc-version/0.6.11/dynamic_1.sol", "0.6.11" - ), - Test( - all_detectors.IncorrectSolc, "tests/detectors/solc-version/0.6.11/dynamic_2.sol", "0.6.11" - ), - Test(all_detectors.IncorrectSolc, "tests/detectors/solc-version/0.7.4/static.sol", "0.7.4"), - Test(all_detectors.IncorrectSolc, "tests/detectors/solc-version/0.7.6/static.sol", "0.7.6"), - Test(all_detectors.IncorrectSolc, "tests/detectors/solc-version/0.7.6/dynamic_1.sol", "0.7.6"), - Test(all_detectors.IncorrectSolc, "tests/detectors/solc-version/0.7.6/dynamic_2.sol", "0.7.6"), + ["pragma.0.7.5.sol"], + ), + Test(all_detectors.IncorrectSolc, "static.sol", "0.4.25"), + Test(all_detectors.IncorrectSolc, "static.sol", "0.5.14"), + Test(all_detectors.IncorrectSolc, "static.sol", "0.5.16"), + Test(all_detectors.IncorrectSolc, "dynamic_1.sol", "0.5.16"), + Test(all_detectors.IncorrectSolc, "dynamic_2.sol", "0.5.16"), + Test(all_detectors.IncorrectSolc, "static.sol", "0.6.10"), + Test(all_detectors.IncorrectSolc, "static.sol", "0.6.11"), + Test(all_detectors.IncorrectSolc, "dynamic_1.sol", "0.6.11"), + Test(all_detectors.IncorrectSolc, "dynamic_2.sol", "0.6.11"), + Test(all_detectors.IncorrectSolc, "static.sol", "0.7.4"), + Test(all_detectors.IncorrectSolc, "static.sol", "0.7.6"), + Test(all_detectors.IncorrectSolc, "dynamic_1.sol", "0.7.6"), + Test(all_detectors.IncorrectSolc, "dynamic_2.sol", "0.7.6"), Test( all_detectors.ReentrancyEth, - "tests/detectors/reentrancy-eth/0.4.25/reentrancy.sol", + "reentrancy.sol", "0.4.25", ), Test( all_detectors.ReentrancyEth, - "tests/detectors/reentrancy-eth/0.4.25/reentrancy_indirect.sol", + "reentrancy_indirect.sol", "0.4.25", ), Test( all_detectors.ReentrancyEth, - "tests/detectors/reentrancy-eth/0.5.16/reentrancy.sol", + "reentrancy.sol", "0.5.16", ), Test( all_detectors.ReentrancyEth, - "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", + "reentrancy_indirect.sol", "0.5.16", ), Test( all_detectors.ReentrancyEth, - "tests/detectors/reentrancy-eth/0.6.11/reentrancy.sol", + "reentrancy.sol", "0.6.11", ), Test( all_detectors.ReentrancyEth, - "tests/detectors/reentrancy-eth/0.6.11/reentrancy_indirect.sol", + "reentrancy_indirect.sol", "0.6.11", ), - Test( - all_detectors.ReentrancyEth, "tests/detectors/reentrancy-eth/0.7.6/reentrancy.sol", "0.7.6" - ), + Test(all_detectors.ReentrancyEth, "reentrancy.sol", "0.7.6"), Test( all_detectors.ReentrancyEth, - "tests/detectors/reentrancy-eth/0.7.6/reentrancy_indirect.sol", + "reentrancy_indirect.sol", "0.7.6", ), Test( all_detectors.UninitializedStorageVars, - "tests/detectors/uninitialized-storage/0.4.25/uninitialized_storage_pointer.sol", + "uninitialized_storage_pointer.sol", "0.4.25", ), - Test(all_detectors.TxOrigin, "tests/detectors/tx-origin/0.4.25/tx_origin.sol", "0.4.25"), - Test(all_detectors.TxOrigin, "tests/detectors/tx-origin/0.5.16/tx_origin.sol", "0.5.16"), - Test(all_detectors.TxOrigin, "tests/detectors/tx-origin/0.6.11/tx_origin.sol", "0.6.11"), - Test(all_detectors.TxOrigin, "tests/detectors/tx-origin/0.7.6/tx_origin.sol", "0.7.6"), + Test(all_detectors.TxOrigin, "tx_origin.sol", "0.4.25"), + Test(all_detectors.TxOrigin, "tx_origin.sol", "0.5.16"), + Test(all_detectors.TxOrigin, "tx_origin.sol", "0.6.11"), + Test(all_detectors.TxOrigin, "tx_origin.sol", "0.7.6"), Test( all_detectors.UnusedStateVars, - "tests/detectors/unused-state/0.4.25/unused_state.sol", + "unused_state.sol", "0.4.25", ), Test( all_detectors.UnusedStateVars, - "tests/detectors/unused-state/0.5.16/unused_state.sol", + "unused_state.sol", "0.5.16", ), Test( all_detectors.UnusedStateVars, - "tests/detectors/unused-state/0.6.11/unused_state.sol", + "unused_state.sol", "0.6.11", ), Test( all_detectors.UnusedStateVars, - "tests/detectors/unused-state/0.7.6/unused_state.sol", + "unused_state.sol", "0.7.6", ), - Test( - all_detectors.LockedEther, "tests/detectors/locked-ether/0.4.25/locked_ether.sol", "0.4.25" - ), - Test( - all_detectors.LockedEther, "tests/detectors/locked-ether/0.5.16/locked_ether.sol", "0.5.16" - ), - Test( - all_detectors.LockedEther, "tests/detectors/locked-ether/0.6.11/locked_ether.sol", "0.6.11" - ), - Test(all_detectors.LockedEther, "tests/detectors/locked-ether/0.7.6/locked_ether.sol", "0.7.6"), + Test(all_detectors.LockedEther, "locked_ether.sol", "0.4.25"), + Test(all_detectors.LockedEther, "locked_ether.sol", "0.5.16"), + Test(all_detectors.LockedEther, "locked_ether.sol", "0.6.11"), + Test(all_detectors.LockedEther, "locked_ether.sol", "0.7.6"), Test( all_detectors.ArbitrarySend, - "tests/detectors/arbitrary-send/0.4.25/arbitrary_send.sol", + "arbitrary_send.sol", "0.4.25", ), Test( all_detectors.ArbitrarySend, - "tests/detectors/arbitrary-send/0.5.16/arbitrary_send.sol", + "arbitrary_send.sol", "0.5.16", ), Test( all_detectors.ArbitrarySend, - "tests/detectors/arbitrary-send/0.6.11/arbitrary_send.sol", + "arbitrary_send.sol", "0.6.11", ), Test( all_detectors.ArbitrarySend, - "tests/detectors/arbitrary-send/0.7.6/arbitrary_send.sol", + "arbitrary_send.sol", "0.7.6", ), Test( all_detectors.Assembly, - "tests/detectors/assembly/0.4.25/inline_assembly_contract.sol", + "inline_assembly_contract.sol", "0.4.25", ), Test( all_detectors.Assembly, - "tests/detectors/assembly/0.4.25/inline_assembly_library.sol", + "inline_assembly_library.sol", "0.4.25", ), Test( all_detectors.Assembly, - "tests/detectors/assembly/0.5.16/inline_assembly_contract.sol", + "inline_assembly_contract.sol", "0.5.16", ), Test( all_detectors.Assembly, - "tests/detectors/assembly/0.5.16/inline_assembly_library.sol", + "inline_assembly_library.sol", "0.5.16", ), Test( all_detectors.Assembly, - "tests/detectors/assembly/0.6.11/inline_assembly_contract.sol", + "inline_assembly_contract.sol", "0.6.11", ), Test( all_detectors.Assembly, - "tests/detectors/assembly/0.6.11/inline_assembly_library.sol", + "inline_assembly_library.sol", "0.6.11", ), Test( all_detectors.Assembly, - "tests/detectors/assembly/0.7.6/inline_assembly_contract.sol", + "inline_assembly_contract.sol", "0.7.6", ), Test( all_detectors.Assembly, - "tests/detectors/assembly/0.7.6/inline_assembly_library.sol", + "inline_assembly_library.sol", "0.7.6", ), Test( all_detectors.LowLevelCalls, - "tests/detectors/low-level-calls/0.4.25/low_level_calls.sol", + "low_level_calls.sol", "0.4.25", ), Test( all_detectors.LowLevelCalls, - "tests/detectors/low-level-calls/0.5.16/low_level_calls.sol", + "low_level_calls.sol", "0.5.16", ), Test( all_detectors.LowLevelCalls, - "tests/detectors/low-level-calls/0.6.11/low_level_calls.sol", + "low_level_calls.sol", "0.6.11", ), Test( all_detectors.LowLevelCalls, - "tests/detectors/low-level-calls/0.7.6/low_level_calls.sol", + "low_level_calls.sol", "0.7.6", ), Test( all_detectors.ConstCandidateStateVars, - "tests/detectors/constable-states/0.4.25/const_state_variables.sol", + "const_state_variables.sol", "0.4.25", ), Test( all_detectors.ConstCandidateStateVars, - "tests/detectors/constable-states/0.5.16/const_state_variables.sol", + "const_state_variables.sol", "0.5.16", ), Test( all_detectors.ConstCandidateStateVars, - "tests/detectors/constable-states/0.6.11/const_state_variables.sol", + "const_state_variables.sol", "0.6.11", ), Test( all_detectors.ConstCandidateStateVars, - "tests/detectors/constable-states/0.7.6/const_state_variables.sol", + "const_state_variables.sol", "0.7.6", ), Test( all_detectors.ExternalFunction, - "tests/detectors/external-function/0.4.25/external_function.sol", + "external_function.sol", "0.4.25", ), Test( all_detectors.ExternalFunction, - "tests/detectors/external-function/0.4.25/external_function_2.sol", + "external_function_2.sol", "0.4.25", ), Test( all_detectors.ExternalFunction, - "tests/detectors/external-function/0.5.16/external_function.sol", + "external_function.sol", "0.5.16", ), Test( all_detectors.ExternalFunction, - "tests/detectors/external-function/0.5.16/external_function_2.sol", + "external_function_2.sol", "0.5.16", ), Test( all_detectors.ExternalFunction, - "tests/detectors/external-function/0.6.11/external_function.sol", + "external_function.sol", "0.6.11", ), Test( all_detectors.ExternalFunction, - "tests/detectors/external-function/0.6.11/external_function_2.sol", + "external_function_2.sol", "0.6.11", ), Test( all_detectors.ExternalFunction, - "tests/detectors/external-function/0.7.6/external_function.sol", + "external_function.sol", "0.7.6", ), Test( all_detectors.ExternalFunction, - "tests/detectors/external-function/0.7.6/external_function_2.sol", + "external_function_2.sol", "0.7.6", ), Test( all_detectors.NamingConvention, - "tests/detectors/naming-convention/0.4.25/naming_convention.sol", + "naming_convention.sol", "0.4.25", ), Test( all_detectors.NamingConvention, - "tests/detectors/naming-convention/0.5.16/naming_convention.sol", + "naming_convention.sol", "0.5.16", ), Test( all_detectors.NamingConvention, - "tests/detectors/naming-convention/0.6.11/naming_convention.sol", + "naming_convention.sol", "0.6.11", ), Test( all_detectors.NamingConvention, - "tests/detectors/naming-convention/0.7.6/naming_convention.sol", + "naming_convention.sol", "0.7.6", ), Test( all_detectors.ControlledDelegateCall, - "tests/detectors/controlled-delegatecall/0.4.25/controlled_delegatecall.sol", + "controlled_delegatecall.sol", "0.4.25", ), Test( all_detectors.ControlledDelegateCall, - "tests/detectors/controlled-delegatecall/0.5.16/controlled_delegatecall.sol", + "controlled_delegatecall.sol", "0.5.16", ), Test( all_detectors.ControlledDelegateCall, - "tests/detectors/controlled-delegatecall/0.6.11/controlled_delegatecall.sol", + "controlled_delegatecall.sol", "0.6.11", ), Test( all_detectors.ControlledDelegateCall, - "tests/detectors/controlled-delegatecall/0.7.6/controlled_delegatecall.sol", + "controlled_delegatecall.sol", "0.7.6", ), Test( all_detectors.UninitializedLocalVars, - "tests/detectors/uninitialized-local/0.4.25/uninitialized_local_variable.sol", + "uninitialized_local_variable.sol", "0.4.25", ), Test( all_detectors.UninitializedLocalVars, - "tests/detectors/uninitialized-local/0.5.16/uninitialized_local_variable.sol", + "uninitialized_local_variable.sol", "0.5.16", ), Test( all_detectors.UninitializedLocalVars, - "tests/detectors/uninitialized-local/0.6.11/uninitialized_local_variable.sol", + "uninitialized_local_variable.sol", "0.6.11", ), Test( all_detectors.UninitializedLocalVars, - "tests/detectors/uninitialized-local/0.7.6/uninitialized_local_variable.sol", + "uninitialized_local_variable.sol", "0.7.6", ), - Test( - all_detectors.ConstantFunctionsAsm, "tests/detectors/constant/0.4.25/constant.sol", "0.4.25" - ), + Test(all_detectors.ConstantFunctionsAsm, "constant.sol", "0.4.25"), Test( all_detectors.ConstantFunctionsState, - "tests/detectors/constant/0.4.25/constant.sol", + "constant.sol", "0.4.25", ), - Test( - all_detectors.ConstantFunctionsAsm, "tests/detectors/constant/0.5.16/constant.sol", "0.5.16" - ), + Test(all_detectors.ConstantFunctionsAsm, "constant.sol", "0.5.16"), Test( all_detectors.ConstantFunctionsState, - "tests/detectors/constant/0.5.16/constant.sol", + "constant.sol", "0.5.16", ), - Test( - all_detectors.ConstantFunctionsAsm, "tests/detectors/constant/0.6.11/constant.sol", "0.6.11" - ), + Test(all_detectors.ConstantFunctionsAsm, "constant.sol", "0.6.11"), Test( all_detectors.ConstantFunctionsState, - "tests/detectors/constant/0.6.11/constant.sol", + "constant.sol", "0.6.11", ), - Test( - all_detectors.ConstantFunctionsAsm, "tests/detectors/constant/0.7.6/constant.sol", "0.7.6" - ), - Test( - all_detectors.ConstantFunctionsState, "tests/detectors/constant/0.7.6/constant.sol", "0.7.6" - ), + Test(all_detectors.ConstantFunctionsAsm, "constant.sol", "0.7.6"), + Test(all_detectors.ConstantFunctionsState, "constant.sol", "0.7.6"), Test( all_detectors.UnusedReturnValues, - "tests/detectors/unused-return/0.4.25/unused_return.sol", + "unused_return.sol", "0.4.25", ), Test( all_detectors.UnusedReturnValues, - "tests/detectors/unused-return/0.5.16/unused_return.sol", + "unused_return.sol", "0.5.16", ), Test( all_detectors.UnusedReturnValues, - "tests/detectors/unused-return/0.6.11/unused_return.sol", + "unused_return.sol", "0.6.11", ), Test( all_detectors.UnusedReturnValues, - "tests/detectors/unused-return/0.7.6/unused_return.sol", + "unused_return.sol", "0.7.6", ), Test( all_detectors.ShadowingAbstractDetection, - "tests/detectors/shadowing-abstract/0.4.25/shadowing_abstract.sol", + "shadowing_abstract.sol", "0.4.25", ), Test( all_detectors.ShadowingAbstractDetection, - "tests/detectors/shadowing-abstract/0.5.16/shadowing_abstract.sol", + "shadowing_abstract.sol", "0.5.16", ), Test( all_detectors.StateShadowing, - "tests/detectors/shadowing-state/0.4.25/shadowing_state_variable.sol", + "shadowing_state_variable.sol", "0.4.25", ), Test( all_detectors.StateShadowing, - "tests/detectors/shadowing-state/0.5.16/shadowing_state_variable.sol", + "shadowing_state_variable.sol", "0.5.16", ), Test( all_detectors.StateShadowing, - "tests/detectors/shadowing-state/0.6.11/shadowing_state_variable.sol", + "shadowing_state_variable.sol", "0.6.11", ), Test( all_detectors.StateShadowing, - "tests/detectors/shadowing-state/0.7.6/shadowing_state_variable.sol", + "shadowing_state_variable.sol", "0.7.6", ), - Test(all_detectors.Timestamp, "tests/detectors/timestamp/0.4.25/timestamp.sol", "0.4.25"), - Test(all_detectors.Timestamp, "tests/detectors/timestamp/0.5.16/timestamp.sol", "0.5.16"), - Test(all_detectors.Timestamp, "tests/detectors/timestamp/0.6.11/timestamp.sol", "0.6.11"), - Test(all_detectors.Timestamp, "tests/detectors/timestamp/0.7.6/timestamp.sol", "0.7.6"), + Test(all_detectors.Timestamp, "timestamp.sol", "0.4.25"), + Test(all_detectors.Timestamp, "timestamp.sol", "0.5.16"), + Test(all_detectors.Timestamp, "timestamp.sol", "0.6.11"), + Test(all_detectors.Timestamp, "timestamp.sol", "0.7.6"), Test( all_detectors.MultipleCallsInLoop, - "tests/detectors/calls-loop/0.4.25/multiple_calls_in_loop.sol", + "multiple_calls_in_loop.sol", "0.4.25", ), Test( all_detectors.MultipleCallsInLoop, - "tests/detectors/calls-loop/0.5.16/multiple_calls_in_loop.sol", + "multiple_calls_in_loop.sol", "0.5.16", ), Test( all_detectors.MultipleCallsInLoop, - "tests/detectors/calls-loop/0.6.11/multiple_calls_in_loop.sol", + "multiple_calls_in_loop.sol", "0.6.11", ), Test( all_detectors.MultipleCallsInLoop, - "tests/detectors/calls-loop/0.7.6/multiple_calls_in_loop.sol", + "multiple_calls_in_loop.sol", "0.7.6", ), Test( all_detectors.BuiltinSymbolShadowing, - "tests/detectors/shadowing-builtin/0.4.25/shadowing_builtin_symbols.sol", + "shadowing_builtin_symbols.sol", "0.4.25", ), Test( all_detectors.BuiltinSymbolShadowing, - "tests/detectors/shadowing-builtin/0.5.16/shadowing_builtin_symbols.sol", + "shadowing_builtin_symbols.sol", "0.5.16", ), Test( all_detectors.LocalShadowing, - "tests/detectors/shadowing-local/0.4.25/shadowing_local_variable.sol", + "shadowing_local_variable.sol", "0.4.25", ), Test( all_detectors.LocalShadowing, - "tests/detectors/shadowing-local/0.5.16/shadowing_local_variable.sol", + "shadowing_local_variable.sol", "0.5.16", ), Test( all_detectors.LocalShadowing, - "tests/detectors/shadowing-local/0.6.11/shadowing_local_variable.sol", + "shadowing_local_variable.sol", "0.6.11", ), Test( all_detectors.LocalShadowing, - "tests/detectors/shadowing-local/0.7.6/shadowing_local_variable.sol", + "shadowing_local_variable.sol", "0.7.6", ), Test( all_detectors.RightToLeftOverride, - "tests/detectors/rtlo/0.4.25/right_to_left_override.sol", + "right_to_left_override.sol", "0.4.25", ), Test( all_detectors.RightToLeftOverride, - "tests/detectors/rtlo/0.5.16/right_to_left_override.sol", + "right_to_left_override.sol", "0.5.16", ), Test( all_detectors.RightToLeftOverride, - "tests/detectors/rtlo/0.6.11/right_to_left_override.sol", + "right_to_left_override.sol", "0.6.11", ), - Test(all_detectors.VoidConstructor, "tests/detectors/void-cst/0.4.25/void-cst.sol", "0.4.25"), - Test(all_detectors.VoidConstructor, "tests/detectors/void-cst/0.5.16/void-cst.sol", "0.5.16"), - Test(all_detectors.VoidConstructor, "tests/detectors/void-cst/0.6.11/void-cst.sol", "0.6.11"), - Test(all_detectors.VoidConstructor, "tests/detectors/void-cst/0.7.6/void-cst.sol", "0.7.6"), + Test(all_detectors.VoidConstructor, "void-cst.sol", "0.4.25"), + Test(all_detectors.VoidConstructor, "void-cst.sol", "0.5.16"), + Test(all_detectors.VoidConstructor, "void-cst.sol", "0.6.11"), + Test(all_detectors.VoidConstructor, "void-cst.sol", "0.7.6"), Test( all_detectors.UncheckedSend, - "tests/detectors/unchecked-send/0.4.25/unchecked_send.sol", + "unchecked_send.sol", "0.4.25", ), Test( all_detectors.UncheckedSend, - "tests/detectors/unchecked-send/0.5.16/unchecked_send.sol", + "unchecked_send.sol", "0.5.16", ), Test( all_detectors.UncheckedSend, - "tests/detectors/unchecked-send/0.6.11/unchecked_send.sol", + "unchecked_send.sol", "0.6.11", ), Test( all_detectors.UncheckedSend, - "tests/detectors/unchecked-send/0.7.6/unchecked_send.sol", + "unchecked_send.sol", "0.7.6", ), Test( all_detectors.ReentrancyEvent, - "tests/detectors/reentrancy-events/0.5.16/reentrancy-events.sol", + "reentrancy-events.sol", "0.5.16", ), Test( all_detectors.ReentrancyEvent, - "tests/detectors/reentrancy-events/0.6.11/reentrancy-events.sol", + "reentrancy-events.sol", "0.6.11", ), Test( all_detectors.ReentrancyEvent, - "tests/detectors/reentrancy-events/0.7.6/reentrancy-events.sol", + "reentrancy-events.sol", "0.7.6", ), Test( all_detectors.IncorrectStrictEquality, - "tests/detectors/incorrect-equality/0.4.25/incorrect_equality.sol", + "incorrect_equality.sol", "0.4.25", ), Test( all_detectors.IncorrectStrictEquality, - "tests/detectors/incorrect-equality/0.5.16/incorrect_equality.sol", + "incorrect_equality.sol", "0.5.16", ), Test( all_detectors.IncorrectStrictEquality, - "tests/detectors/incorrect-equality/0.6.11/incorrect_equality.sol", + "incorrect_equality.sol", "0.6.11", ), Test( all_detectors.IncorrectStrictEquality, - "tests/detectors/incorrect-equality/0.7.6/incorrect_equality.sol", + "incorrect_equality.sol", "0.7.6", ), Test( all_detectors.TooManyDigits, - "tests/detectors/too-many-digits/0.4.25/too_many_digits.sol", + "too_many_digits.sol", "0.4.25", ), Test( all_detectors.TooManyDigits, - "tests/detectors/too-many-digits/0.5.16/too_many_digits.sol", + "too_many_digits.sol", "0.5.16", ), Test( all_detectors.TooManyDigits, - "tests/detectors/too-many-digits/0.6.11/too_many_digits.sol", + "too_many_digits.sol", "0.6.11", ), Test( all_detectors.TooManyDigits, - "tests/detectors/too-many-digits/0.7.6/too_many_digits.sol", + "too_many_digits.sol", "0.7.6", ), Test( all_detectors.UnprotectedUpgradeable, - "tests/detectors/unprotected-upgrade/0.4.25/Buggy.sol", + "Buggy.sol", "0.4.25", ), Test( all_detectors.UnprotectedUpgradeable, - "tests/detectors/unprotected-upgrade/0.4.25/Fixed.sol", + "Fixed.sol", "0.4.25", ), Test( all_detectors.UnprotectedUpgradeable, - "tests/detectors/unprotected-upgrade/0.5.16/Buggy.sol", + "Buggy.sol", "0.5.16", ), Test( all_detectors.UnprotectedUpgradeable, - "tests/detectors/unprotected-upgrade/0.5.16/Fixed.sol", + "Fixed.sol", "0.5.16", ), Test( all_detectors.UnprotectedUpgradeable, - "tests/detectors/unprotected-upgrade/0.6.11/Buggy.sol", + "Buggy.sol", "0.6.11", ), Test( all_detectors.UnprotectedUpgradeable, - "tests/detectors/unprotected-upgrade/0.6.11/Fixed.sol", + "Fixed.sol", "0.6.11", ), Test( all_detectors.UnprotectedUpgradeable, - "tests/detectors/unprotected-upgrade/0.7.6/Buggy.sol", + "Buggy.sol", "0.7.6", ), Test( all_detectors.UnprotectedUpgradeable, - "tests/detectors/unprotected-upgrade/0.7.6/Fixed.sol", + "Fixed.sol", "0.7.6", ), - Test( - all_detectors.NamingConvention, - "tests/detectors/naming-convention/0.4.25/naming_convention_ignore.sol", - "0.4.25", - ), Test( all_detectors.ABIEncoderV2Array, - "tests/detectors/abiencoderv2-array/0.4.25/storage_ABIEncoderV2_array.sol", + "storage_ABIEncoderV2_array.sol", "0.4.25", ), Test( all_detectors.ABIEncoderV2Array, - "tests/detectors/abiencoderv2-array/0.5.10/storage_ABIEncoderV2_array.sol", + "storage_ABIEncoderV2_array.sol", "0.5.10", ), Test( all_detectors.ABIEncoderV2Array, - "tests/detectors/abiencoderv2-array/0.5.11/storage_ABIEncoderV2_array.sol", + "storage_ABIEncoderV2_array.sol", "0.5.11", ), Test( all_detectors.ArrayByReference, - "tests/detectors/array-by-reference/0.4.25/array_by_reference.sol", + "array_by_reference.sol", "0.4.25", ), Test( all_detectors.ArrayByReference, - "tests/detectors/array-by-reference/0.5.16/array_by_reference.sol", + "array_by_reference.sol", "0.5.16", ), Test( all_detectors.ArrayByReference, - "tests/detectors/array-by-reference/0.6.11/array_by_reference.sol", + "array_by_reference.sol", "0.6.11", ), Test( all_detectors.ArrayByReference, - "tests/detectors/array-by-reference/0.7.6/array_by_reference.sol", + "array_by_reference.sol", "0.7.6", ), Test( all_detectors.AssertStateChange, - "tests/detectors/assert-state-change/0.4.25/assert_state_change.sol", + "assert_state_change.sol", "0.4.25", ), Test( all_detectors.AssertStateChange, - "tests/detectors/assert-state-change/0.5.16/assert_state_change.sol", + "assert_state_change.sol", "0.5.16", ), Test( all_detectors.AssertStateChange, - "tests/detectors/assert-state-change/0.6.11/assert_state_change.sol", + "assert_state_change.sol", "0.6.11", ), Test( all_detectors.AssertStateChange, - "tests/detectors/assert-state-change/0.7.6/assert_state_change.sol", + "assert_state_change.sol", "0.7.6", ), Test( all_detectors.ArrayLengthAssignment, - "tests/detectors/controlled-array-length/0.4.25/array_length_assignment.sol", + "array_length_assignment.sol", "0.4.25", ), Test( all_detectors.ArrayLengthAssignment, - "tests/detectors/controlled-array-length/0.5.16/array_length_assignment.sol", + "array_length_assignment.sol", "0.5.16", ), Test( all_detectors.CostlyOperationsInLoop, - "tests/detectors/costly-loop/0.4.25/multiple_costly_operations_in_loop.sol", + "multiple_costly_operations_in_loop.sol", "0.4.25", ), Test( all_detectors.CostlyOperationsInLoop, - "tests/detectors/costly-loop/0.5.16/multiple_costly_operations_in_loop.sol", + "multiple_costly_operations_in_loop.sol", "0.5.16", ), Test( all_detectors.CostlyOperationsInLoop, - "tests/detectors/costly-loop/0.6.11/multiple_costly_operations_in_loop.sol", + "multiple_costly_operations_in_loop.sol", "0.6.11", ), Test( all_detectors.CostlyOperationsInLoop, - "tests/detectors/costly-loop/0.7.6/multiple_costly_operations_in_loop.sol", + "multiple_costly_operations_in_loop.sol", "0.7.6", ), Test( all_detectors.FunctionInitializedState, - "tests/detectors/function-init-state/0.4.25/function_init_state_variables.sol", + "function_init_state_variables.sol", "0.4.25", ), Test( all_detectors.FunctionInitializedState, - "tests/detectors/function-init-state/0.5.16/function_init_state_variables.sol", + "function_init_state_variables.sol", "0.5.16", ), Test( all_detectors.FunctionInitializedState, - "tests/detectors/function-init-state/0.6.11/function_init_state_variables.sol", + "function_init_state_variables.sol", "0.6.11", ), Test( all_detectors.FunctionInitializedState, - "tests/detectors/function-init-state/0.7.6/function_init_state_variables.sol", + "function_init_state_variables.sol", "0.7.6", ), Test( all_detectors.MappingDeletionDetection, - "tests/detectors/mapping-deletion/0.4.25/MappingDeletion.sol", + "MappingDeletion.sol", "0.4.25", ), Test( all_detectors.MappingDeletionDetection, - "tests/detectors/mapping-deletion/0.5.16/MappingDeletion.sol", + "MappingDeletion.sol", "0.5.16", ), Test( all_detectors.MappingDeletionDetection, - "tests/detectors/mapping-deletion/0.6.11/MappingDeletion.sol", + "MappingDeletion.sol", "0.6.11", ), Test( all_detectors.MappingDeletionDetection, - "tests/detectors/mapping-deletion/0.7.6/MappingDeletion.sol", - "0.7.6", - ), - Test( - all_detectors.UnimplementedFunctionDetection, - "tests/detectors/missing-inheritance/0.5.16/unimplemented_interfaces.sol", - "0.5.16", - ), - Test( - all_detectors.UnimplementedFunctionDetection, - "tests/detectors/missing-inheritance/0.6.11/unimplemented_interfaces.sol", - "0.6.11", - ), - Test( - all_detectors.UnimplementedFunctionDetection, - "tests/detectors/missing-inheritance/0.7.6/unimplemented_interfaces.sol", + "MappingDeletion.sol", "0.7.6", ), Test( all_detectors.PublicMappingNested, - "tests/detectors/public-mappings-nested/0.4.25/public_mappings_nested.sol", + "public_mappings_nested.sol", "0.4.25", ), Test( all_detectors.RedundantStatements, - "tests/detectors/redundant-statements/0.4.25/redundant_statements.sol", + "redundant_statements.sol", "0.4.25", ), Test( all_detectors.RedundantStatements, - "tests/detectors/redundant-statements/0.5.16/redundant_statements.sol", + "redundant_statements.sol", "0.5.16", ), Test( all_detectors.RedundantStatements, - "tests/detectors/redundant-statements/0.6.11/redundant_statements.sol", + "redundant_statements.sol", "0.6.11", ), Test( all_detectors.RedundantStatements, - "tests/detectors/redundant-statements/0.7.6/redundant_statements.sol", + "redundant_statements.sol", "0.7.6", ), Test( all_detectors.ReusedBaseConstructor, - "tests/detectors/reused-constructor/0.4.21/reused_base_constructor.sol", + "reused_base_constructor.sol", "0.4.21", ), Test( all_detectors.ReusedBaseConstructor, - "tests/detectors/reused-constructor/0.4.25/reused_base_constructor.sol", + "reused_base_constructor.sol", "0.4.25", ), Test( all_detectors.StorageSignedIntegerArray, - "tests/detectors/storage-array/0.5.10/storage_signed_integer_array.sol", + "storage_signed_integer_array.sol", "0.5.10", ), Test( all_detectors.StorageSignedIntegerArray, - "tests/detectors/storage-array/0.5.16/storage_signed_integer_array.sol", + "storage_signed_integer_array.sol", "0.5.16", ), Test( all_detectors.UnimplementedFunctionDetection, - "tests/detectors/unimplemented-functions/0.4.25/unimplemented.sol", + "unimplemented.sol", "0.4.25", ), Test( all_detectors.UnimplementedFunctionDetection, - "tests/detectors/unimplemented-functions/0.5.16/unimplemented.sol", + "unimplemented.sol", "0.5.16", ), Test( all_detectors.UnimplementedFunctionDetection, - "tests/detectors/unimplemented-functions/0.6.11/unimplemented.sol", + "unimplemented.sol", "0.6.11", ), Test( all_detectors.UnimplementedFunctionDetection, - "tests/detectors/unimplemented-functions/0.7.6/unimplemented.sol", + "unimplemented.sol", "0.7.6", ), - Test(all_detectors.BadPRNG, "tests/detectors/weak-prng/0.4.25/bad_prng.sol", "0.4.25"), - Test(all_detectors.BadPRNG, "tests/detectors/weak-prng/0.5.16/bad_prng.sol", "0.5.16"), - Test(all_detectors.BadPRNG, "tests/detectors/weak-prng/0.6.11/bad_prng.sol", "0.6.11"), - Test(all_detectors.BadPRNG, "tests/detectors/weak-prng/0.7.6/bad_prng.sol", "0.7.6"), + Test( + all_detectors.UnimplementedFunctionDetection, + "unimplemented_interfaces.sol", + "0.5.16", + ), + Test( + all_detectors.UnimplementedFunctionDetection, + "unimplemented_interfaces.sol", + "0.6.11", + ), + Test( + all_detectors.UnimplementedFunctionDetection, + "unimplemented_interfaces.sol", + "0.7.6", + ), + Test(all_detectors.BadPRNG, "bad_prng.sol", "0.4.25"), + Test(all_detectors.BadPRNG, "bad_prng.sol", "0.5.16"), + Test(all_detectors.BadPRNG, "bad_prng.sol", "0.6.11"), + Test(all_detectors.BadPRNG, "bad_prng.sol", "0.7.6"), Test( all_detectors.MissingEventsAccessControl, - "tests/detectors/events-access/0.4.25/missing_events_access_control.sol", + "missing_events_access_control.sol", "0.4.25", ), Test( all_detectors.MissingEventsAccessControl, - "tests/detectors/events-access/0.5.16/missing_events_access_control.sol", + "missing_events_access_control.sol", "0.5.16", ), Test( all_detectors.MissingEventsAccessControl, - "tests/detectors/events-access/0.6.11/missing_events_access_control.sol", + "missing_events_access_control.sol", "0.6.11", ), Test( all_detectors.MissingEventsAccessControl, - "tests/detectors/events-access/0.7.6/missing_events_access_control.sol", + "missing_events_access_control.sol", "0.7.6", ), Test( all_detectors.MissingEventsArithmetic, - "tests/detectors/events-maths/0.4.25/missing_events_arithmetic.sol", + "missing_events_arithmetic.sol", "0.4.25", ), Test( all_detectors.MissingEventsArithmetic, - "tests/detectors/events-maths/0.5.16/missing_events_arithmetic.sol", + "missing_events_arithmetic.sol", "0.5.16", ), Test( all_detectors.MissingEventsArithmetic, - "tests/detectors/events-maths/0.6.11/missing_events_arithmetic.sol", + "missing_events_arithmetic.sol", "0.6.11", ), Test( all_detectors.MissingEventsArithmetic, - "tests/detectors/events-maths/0.7.6/missing_events_arithmetic.sol", + "missing_events_arithmetic.sol", "0.7.6", ), Test( all_detectors.ModifierDefaultDetection, - "tests/detectors/incorrect-modifier/0.4.25/modifier_default.sol", + "modifier_default.sol", "0.4.25", ), Test( all_detectors.ModifierDefaultDetection, - "tests/detectors/incorrect-modifier/0.5.16/modifier_default.sol", + "modifier_default.sol", "0.5.16", ), Test( all_detectors.ModifierDefaultDetection, - "tests/detectors/incorrect-modifier/0.6.11/modifier_default.sol", + "modifier_default.sol", "0.6.11", ), Test( all_detectors.ModifierDefaultDetection, - "tests/detectors/incorrect-modifier/0.7.6/modifier_default.sol", + "modifier_default.sol", "0.7.6", ), Test( all_detectors.IncorrectUnaryExpressionDetection, - "tests/detectors/incorrect-unary/0.4.25/invalid_unary_expression.sol", + "invalid_unary_expression.sol", "0.4.25", ), Test( all_detectors.MissingZeroAddressValidation, - "tests/detectors/missing-zero-check/0.4.25/missing_zero_address_validation.sol", + "missing_zero_address_validation.sol", "0.4.25", ), Test( all_detectors.MissingZeroAddressValidation, - "tests/detectors/missing-zero-check/0.5.16/missing_zero_address_validation.sol", + "missing_zero_address_validation.sol", "0.5.16", ), Test( all_detectors.MissingZeroAddressValidation, - "tests/detectors/missing-zero-check/0.6.11/missing_zero_address_validation.sol", + "missing_zero_address_validation.sol", "0.6.11", ), Test( all_detectors.MissingZeroAddressValidation, - "tests/detectors/missing-zero-check/0.7.6/missing_zero_address_validation.sol", + "missing_zero_address_validation.sol", "0.7.6", ), Test( all_detectors.PredeclarationUsageLocal, - "tests/detectors/variable-scope/0.4.25/predeclaration_usage_local.sol", + "predeclaration_usage_local.sol", "0.4.25", ), ] @@ -1156,22 +1125,33 @@ def id_test(test_item: Test): @pytest.mark.parametrize("test_item", ALL_TESTS, ids=id_test) def test_detector(test_item: Test): + test_dir_path = pathlib.Path( + pathlib.Path().absolute(), + "tests", + "detectors", + test_item.detector.ARGUMENT, + test_item.solc_ver, + ) + test_file_path = str(pathlib.Path(test_dir_path, test_item.test_file)) + expected_result_path = str(pathlib.Path(test_dir_path, test_item.expected_result).absolute()) + set_solc(test_item) - sl = Slither(test_item.test_file) + sl = Slither(test_file_path) sl.register_detector(test_item.detector) results = sl.run_detectors() - with open(test_item.expected_result, encoding="utf8") as f: + with open(expected_result_path, encoding="utf8") as f: expected_result = json.load(f) results_as_string = json.dumps(results) - current_path = str(pathlib.Path(pathlib.Path().absolute(), test_item.test_file).absolute()) + for additional_file in test_item.additional_files: - additional_path = str(pathlib.Path(pathlib.Path().absolute(), additional_file).absolute()) + additional_path = str(pathlib.Path(test_dir_path, additional_file).absolute()) results_as_string = results_as_string.replace( additional_path, str(pathlib.Path(GENERIC_PATH)) ) - results_as_string = results_as_string.replace(current_path, str(pathlib.Path(GENERIC_PATH))) + results_as_string = results_as_string.replace(test_file_path, str(pathlib.Path(GENERIC_PATH))) + results = json.loads(results_as_string) diff = DeepDiff(results, expected_result, ignore_order=True, verbose_level=2) @@ -1181,41 +1161,46 @@ def test_detector(test_item: Test): if "iterable_item_added" in diff_as_dict: print("#### Findings added") - for findings_added in diff_as_dict["iterable_item_added"].values(): - for finding_added in findings_added: - print(finding_added["description"]) + for finding_added in diff_as_dict["iterable_item_added"].values(): + print(finding_added["description"]) if "iterable_item_removed" in diff_as_dict: print("#### Findings removed") - for findings_added in diff_as_dict["iterable_item_removed"].values(): - for finding_added in findings_added: - print(finding_added["description"]) + for finding_added in diff_as_dict["iterable_item_removed"].values(): + print(finding_added["description"]) assert False def _generate_test(test_item: Test, skip_existing=False): + test_dir_path = pathlib.Path( + pathlib.Path().absolute(), + "tests", + "detectors", + test_item.detector.ARGUMENT, + test_item.solc_ver, + ) + test_file_path = str(pathlib.Path(test_dir_path, test_item.test_file)) + expected_result_path = str(pathlib.Path(test_dir_path, test_item.expected_result).absolute()) if skip_existing: - if os.path.isfile(test_item.expected_result): + if os.path.isfile(expected_result_path): return set_solc(test_item) - sl = Slither(test_item.test_file) + sl = Slither(test_file_path) sl.register_detector(test_item.detector) results = sl.run_detectors() results_as_string = json.dumps(results) - current_path = str(pathlib.Path(pathlib.Path().absolute(), test_item.test_file).absolute()) - results_as_string = results_as_string.replace(current_path, str(pathlib.Path(GENERIC_PATH))) + results_as_string = results_as_string.replace(test_file_path, str(pathlib.Path(GENERIC_PATH))) for additional_file in test_item.additional_files: - additional_path = str(pathlib.Path(pathlib.Path().absolute(), additional_file).absolute()) + additional_path = str(pathlib.Path(test_dir_path, additional_file).absolute()) results_as_string = results_as_string.replace( additional_path, str(pathlib.Path(GENERIC_PATH)) ) results = json.loads(results_as_string) - - with open(test_item.expected_result, "w") as f: + with open(expected_result_path, "w") as f: f.write(json.dumps(results, indent=4)) From afeb77c44400a6f30a8558d321437a25455de2ca Mon Sep 17 00:00:00 2001 From: Alexander Remie Date: Fri, 16 Apr 2021 16:01:56 +0200 Subject: [PATCH 3/3] added DAO contract for reentrancy-eth test --- tests/detectors/reentrancy-eth/0.4.25/DAO.sol | 1242 + .../0.4.25/DAO.sol.0.4.25.ReentrancyEth.json | 9354 ++++++ .../reentrancy-no-eth/0.4.25/DAO.sol | 1242 + ...ol.0.4.25.ReentrancyReadBeforeWritten.json | 27667 ++++++++++++++++ tests/test_detectors.py | 10 + 5 files changed, 39515 insertions(+) create mode 100644 tests/detectors/reentrancy-eth/0.4.25/DAO.sol create mode 100644 tests/detectors/reentrancy-eth/0.4.25/DAO.sol.0.4.25.ReentrancyEth.json create mode 100644 tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol create mode 100644 tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol.0.4.25.ReentrancyReadBeforeWritten.json diff --git a/tests/detectors/reentrancy-eth/0.4.25/DAO.sol b/tests/detectors/reentrancy-eth/0.4.25/DAO.sol new file mode 100644 index 0000000000..6f03a624ca --- /dev/null +++ b/tests/detectors/reentrancy-eth/0.4.25/DAO.sol @@ -0,0 +1,1242 @@ + +// +// Modified version to be compiler with sol 0.4 +// +/* + +- Bytecode Verification performed was compared on second iteration - + +This file is part of the DAO. + +The DAO is free software: you can redistribute it and/or modify +it under the terms of the GNU lesser General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +The DAO is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU lesser General Public License for more details. + +You should have received a copy of the GNU lesser General Public License +along with the DAO. If not, see . +*/ + + +/* +Basic, standardized Token contract with no "premine". Defines the functions to +check token balances, send tokens, send tokens on behalf of a 3rd party and the +corresponding approval process. Tokens need to be created by a derived +contract (e.g. TokenCreation.sol). + +Thank you ConsenSys, this contract originated from: +https://github.com/ConsenSys/Tokens/blob/master/Token_Contracts/contracts/Standard_Token.sol +Which is itself based on the Ethereum standardized contract APIs: +https://github.com/ethereum/wiki/wiki/Standardized_Contract_APIs +*/ + +/// @title Standard Token Contract. + +contract TokenInterface { + mapping (address => uint256) balances; + mapping (address => mapping (address => uint256)) allowed; + + /// Total amount of tokens + uint256 public totalSupply; + + /// @param _owner The address from which the balance will be retrieved + /// @return The balance + function balanceOf(address _owner) constant returns (uint256 balance); + + /// @notice Send `_amount` tokens to `_to` from `msg.sender` + /// @param _to The address of the recipient + /// @param _amount The amount of tokens to be transferred + /// @return Whether the transfer was successful or not + function transfer(address _to, uint256 _amount) returns (bool success); + + /// @notice Send `_amount` tokens to `_to` from `_from` on the condition it + /// is approved by `_from` + /// @param _from The address of the origin of the transfer + /// @param _to The address of the recipient + /// @param _amount The amount of tokens to be transferred + /// @return Whether the transfer was successful or not + function transferFrom(address _from, address _to, uint256 _amount) returns (bool success); + + /// @notice `msg.sender` approves `_spender` to spend `_amount` tokens on + /// its behalf + /// @param _spender The address of the account able to transfer the tokens + /// @param _amount The amount of tokens to be approved for transfer + /// @return Whether the approval was successful or not + function approve(address _spender, uint256 _amount) returns (bool success); + + /// @param _owner The address of the account owning tokens + /// @param _spender The address of the account able to transfer the tokens + /// @return Amount of remaining tokens of _owner that _spender is allowed + /// to spend + function allowance( + address _owner, + address _spender + ) constant returns (uint256 remaining); + + event Transfer(address indexed _from, address indexed _to, uint256 _amount); + event Approval( + address indexed _owner, + address indexed _spender, + uint256 _amount + ); +} + + +contract Token is TokenInterface { + // Protects users by preventing the execution of method calls that + // inadvertently also transferred ether + modifier noEther() {if (msg.value > 0) throw; _;} + + function balanceOf(address _owner) constant returns (uint256 balance) { + return balances[_owner]; + } + + function transfer(address _to, uint256 _amount) noEther returns (bool success) { + if (balances[msg.sender] >= _amount && _amount > 0) { + balances[msg.sender] -= _amount; + balances[_to] += _amount; + Transfer(msg.sender, _to, _amount); + return true; + } else { + return false; + } + } + + function transferFrom( + address _from, + address _to, + uint256 _amount + ) noEther returns (bool success) { + + if (balances[_from] >= _amount + && allowed[_from][msg.sender] >= _amount + && _amount > 0) { + + balances[_to] += _amount; + balances[_from] -= _amount; + allowed[_from][msg.sender] -= _amount; + Transfer(_from, _to, _amount); + return true; + } else { + return false; + } + } + + function approve(address _spender, uint256 _amount) returns (bool success) { + allowed[msg.sender][_spender] = _amount; + Approval(msg.sender, _spender, _amount); + return true; + } + + function allowance(address _owner, address _spender) constant returns (uint256 remaining) { + return allowed[_owner][_spender]; + } +} + + +/* +This file is part of the DAO. + +The DAO is free software: you can redistribute it and/or modify +it under the terms of the GNU lesser General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +The DAO is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU lesser General Public License for more details. + +You should have received a copy of the GNU lesser General Public License +along with the DAO. If not, see . +*/ + + +/* +Basic account, used by the DAO contract to separately manage both the rewards +and the extraBalance accounts. +*/ + +contract ManagedAccountInterface { + // The only address with permission to withdraw from this account + address public owner; + // If true, only the owner of the account can receive ether from it + bool public payOwnerOnly; + // The sum of ether (in wei) which has been sent to this contract + uint public accumulatedInput; + + /// @notice Sends `_amount` of wei to _recipient + /// @param _amount The amount of wei to send to `_recipient` + /// @param _recipient The address to receive `_amount` of wei + /// @return True if the send completed + function payOut(address _recipient, uint _amount) returns (bool); + + event PayOut(address indexed _recipient, uint _amount); +} + + +contract ManagedAccount is ManagedAccountInterface{ + + // The constructor sets the owner of the account + function ManagedAccount(address _owner, bool _payOwnerOnly) { + owner = _owner; + payOwnerOnly = _payOwnerOnly; + } + + // When the contract receives a transaction without data this is called. + // It counts the amount of ether it receives and stores it in + // accumulatedInput. + function() { + accumulatedInput += msg.value; + } + + function payOut(address _recipient, uint _amount) returns (bool) { + if (msg.sender != owner || msg.value > 0 || (payOwnerOnly && _recipient != owner)) + throw; + if (_recipient.call.value(_amount)()) { + PayOut(_recipient, _amount); + return true; + } else { + return false; + } + } +} +/* +This file is part of the DAO. + +The DAO is free software: you can redistribute it and/or modify +it under the terms of the GNU lesser General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +The DAO is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU lesser General Public License for more details. + +You should have received a copy of the GNU lesser General Public License +along with the DAO. If not, see . +*/ + + +/* + * Token Creation contract, used by the DAO to create its tokens and initialize + * its ether. Feel free to modify the divisor method to implement different + * Token Creation parameters +*/ + + +contract TokenCreationInterface { + + // End of token creation, in Unix time + uint public closingTime; + // Minimum fueling goal of the token creation, denominated in tokens to + // be created + uint public minTokensToCreate; + // True if the DAO reached its minimum fueling goal, false otherwise + bool public isFueled; + // For DAO splits - if privateCreation is 0, then it is a public token + // creation, otherwise only the address stored in privateCreation is + // allowed to create tokens + address public privateCreation; + // hold extra ether which has been sent after the DAO token + // creation rate has increased + ManagedAccount public extraBalance; + // tracks the amount of wei given from each contributor (used for refund) + mapping (address => uint256) weiGiven; + + /// @dev Constructor setting the minimum fueling goal and the + /// end of the Token Creation + /// @param _minTokensToCreate Minimum fueling goal in number of + /// Tokens to be created + /// @param _closingTime Date (in Unix time) of the end of the Token Creation + /// @param _privateCreation Zero means that the creation is public. A + /// non-zero address represents the only address that can create Tokens + /// (the address can also create Tokens on behalf of other accounts) + // This is the constructor: it can not be overloaded so it is commented out + // function TokenCreation( + // uint _minTokensTocreate, + // uint _closingTime, + // address _privateCreation + // ); + + /// @notice Create Token with `_tokenHolder` as the initial owner of the Token + /// @param _tokenHolder The address of the Tokens's recipient + /// @return Whether the token creation was successful + function createTokenProxy(address _tokenHolder) payable returns (bool success); + + /// @notice Refund `msg.sender` in the case the Token Creation did + /// not reach its minimum fueling goal + function refund(); + + /// @return The divisor used to calculate the token creation rate during + /// the creation phase + function divisor() constant returns (uint divisor); + + event FuelingToDate(uint value); + event CreatedToken(address indexed to, uint amount); + event Refund(address indexed to, uint value); +} + + +contract TokenCreation is TokenCreationInterface, Token { + function TokenCreation( + uint _minTokensToCreate, + uint _closingTime, + address _privateCreation) { + + closingTime = _closingTime; + minTokensToCreate = _minTokensToCreate; + privateCreation = _privateCreation; + extraBalance = new ManagedAccount(address(this), true); + } + + function createTokenProxy(address _tokenHolder) payable returns (bool success) { + if (now < closingTime && msg.value > 0 + && (privateCreation == 0 || privateCreation == msg.sender)) { + + uint token = (msg.value * 20) / divisor(); + extraBalance.call.value(msg.value - token)(); + balances[_tokenHolder] += token; + totalSupply += token; + weiGiven[_tokenHolder] += msg.value; + CreatedToken(_tokenHolder, token); + if (totalSupply >= minTokensToCreate && !isFueled) { + isFueled = true; + FuelingToDate(totalSupply); + } + return true; + } + throw; + } + + function refund() noEther { + if (now > closingTime && !isFueled) { + // Get extraBalance - will only succeed when called for the first time + if (extraBalance.balance >= extraBalance.accumulatedInput()) + extraBalance.payOut(address(this), extraBalance.accumulatedInput()); + + // Execute refund + if (msg.sender.call.value(weiGiven[msg.sender])()) { + Refund(msg.sender, weiGiven[msg.sender]); + totalSupply -= balances[msg.sender]; + balances[msg.sender] = 0; + weiGiven[msg.sender] = 0; + } + } + } + + function divisor() constant returns (uint divisor) { + // The number of (base unit) tokens per wei is calculated + // as `msg.value` * 20 / `divisor` + // The fueling period starts with a 1:1 ratio + if (closingTime - 2 weeks > now) { + return 20; + // Followed by 10 days with a daily creation rate increase of 5% + } else if (closingTime - 4 days > now) { + return (20 + (now - (closingTime - 2 weeks)) / (1 days)); + // The last 4 days there is a constant creation rate ratio of 1:1.5 + } else { + return 30; + } + } +} +/* +This file is part of the DAO. + +The DAO is free software: you can redistribute it and/or modify +it under the terms of the GNU lesser General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +The DAO is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU lesser General Public License for more details. + +You should have received a copy of the GNU lesser General Public License +along with the DAO. If not, see . +*/ + + +/* +Standard smart contract for a Decentralized Autonomous Organization (DAO) +to automate organizational governance and decision-making. +*/ + + +contract DAOInterface { + + // The amount of days for which people who try to participate in the + // creation by calling the fallback function will still get their ether back + uint constant creationGracePeriod = 40 days; + // The minimum debate period that a generic proposal can have + uint constant minProposalDebatePeriod = 2 weeks; + // The minimum debate period that a split proposal can have + uint constant minSplitDebatePeriod = 1 weeks; + // Period of days inside which it's possible to execute a DAO split + uint constant splitExecutionPeriod = 27 days; + // Period of time after which the minimum Quorum is halved + uint constant quorumHalvingPeriod = 25 weeks; + // Period after which a proposal is closed + // (used in the case `executeProposal` fails because it throws) + uint constant executeProposalPeriod = 10 days; + // Denotes the maximum proposal deposit that can be given. It is given as + // a fraction of total Ether spent plus balance of the DAO + uint constant maxDepositDivisor = 100; + + // Proposals to spend the DAO's ether or to choose a new Curator + Proposal[] public proposals; + // The quorum needed for each proposal is partially calculated by + // totalSupply / minQuorumDivisor + uint public minQuorumDivisor; + // The unix time of the last time quorum was reached on a proposal + uint public lastTimeMinQuorumMet; + + // Address of the curator + address public curator; + // The whitelist: List of addresses the DAO is allowed to send ether to + mapping (address => bool) public allowedRecipients; + + // Tracks the addresses that own Reward Tokens. Those addresses can only be + // DAOs that have split from the original DAO. Conceptually, Reward Tokens + // represent the proportion of the rewards that the DAO has the right to + // receive. These Reward Tokens are generated when the DAO spends ether. + mapping (address => uint) public rewardToken; + // Total supply of rewardToken + uint public totalRewardToken; + + // The account used to manage the rewards which are to be distributed to the + // DAO Token Holders of this DAO + ManagedAccount public rewardAccount; + + // The account used to manage the rewards which are to be distributed to + // any DAO that holds Reward Tokens + ManagedAccount public DAOrewardAccount; + + // Amount of rewards (in wei) already paid out to a certain DAO + mapping (address => uint) public DAOpaidOut; + + // Amount of rewards (in wei) already paid out to a certain address + mapping (address => uint) public paidOut; + // Map of addresses blocked during a vote (not allowed to transfer DAO + // tokens). The address points to the proposal ID. + mapping (address => uint) public blocked; + + // The minimum deposit (in wei) required to submit any proposal that is not + // requesting a new Curator (no deposit is required for splits) + uint public proposalDeposit; + + // the accumulated sum of all current proposal deposits + uint sumOfProposalDeposits; + + // Contract that is able to create a new DAO (with the same code as + // this one), used for splits + DAO_Creator public daoCreator; + + // A proposal with `newCurator == false` represents a transaction + // to be issued by this DAO + // A proposal with `newCurator == true` represents a DAO split + struct Proposal { + // The address where the `amount` will go to if the proposal is accepted + // or if `newCurator` is true, the proposed Curator of + // the new DAO). + address recipient; + // The amount to transfer to `recipient` if the proposal is accepted. + uint amount; + // A plain text description of the proposal + string description; + // A unix timestamp, denoting the end of the voting period + uint votingDeadline; + // True if the proposal's votes have yet to be counted, otherwise False + bool open; + // True if quorum has been reached, the votes have been counted, and + // the majority said yes + bool proposalPassed; + // A hash to check validity of a proposal + bytes32 proposalHash; + // Deposit in wei the creator added when submitting their proposal. It + // is taken from the msg.value of a newProposal call. + uint proposalDeposit; + // True if this proposal is to assign a new Curator + bool newCurator; + // Data needed for splitting the DAO + + SplitData[][] splitData2; + SplitData[] splitData; + // Number of Tokens in favor of the proposal + uint yea; + // Number of Tokens opposed to the proposal + uint nay; + // Simple mapping to check if a shareholder has voted for it + mapping (address => bool) votedYes; + // Simple mapping to check if a shareholder has voted against it + mapping (address => bool) votedNo; + // Address of the shareholder who created the proposal + address creator; + } + + // Used only in the case of a newCurator proposal. + struct SplitData { + // The balance of the current DAO minus the deposit at the time of split + uint splitBalance; + // The total amount of DAO Tokens in existence at the time of split. + uint totalSupply; + // Amount of Reward Tokens owned by the DAO at the time of split. + uint rewardToken; + // The new DAO contract created at the time of split. + DAO newDAO; + } + + // Used to restrict access to certain functions to only DAO Token Holders + modifier onlyTokenholders {_;} + + /// @dev Constructor setting the Curator and the address + /// for the contract able to create another DAO as well as the parameters + /// for the DAO Token Creation + /// @param _curator The Curator + /// @param _daoCreator The contract able to (re)create this DAO + /// @param _proposalDeposit The deposit to be paid for a regular proposal + /// @param _minTokensToCreate Minimum required wei-equivalent tokens + /// to be created for a successful DAO Token Creation + /// @param _closingTime Date (in Unix time) of the end of the DAO Token Creation + /// @param _privateCreation If zero the DAO Token Creation is open to public, a + /// non-zero address means that the DAO Token Creation is only for the address + // This is the constructor: it can not be overloaded so it is commented out + // function DAO( + // address _curator, + // DAO_Creator _daoCreator, + // uint _proposalDeposit, + // uint _minTokensToCreate, + // uint _closingTime, + // address _privateCreation + // ); + + /// @notice Create Token with `msg.sender` as the beneficiary + /// @return Whether the token creation was successful + function (); + + + /// @dev This function is used to send ether back + /// to the DAO, it can also be used to receive payments that should not be + /// counted as rewards (donations, grants, etc.) + /// @return Whether the DAO received the ether successfully + function receiveEther() returns(bool); + + /// @notice `msg.sender` creates a proposal to send `_amount` Wei to + /// `_recipient` with the transaction data `_transactionData`. If + /// `_newCurator` is true, then this is a proposal that splits the + /// DAO and sets `_recipient` as the new DAO's Curator. + /// @param _recipient Address of the recipient of the proposed transaction + /// @param _amount Amount of wei to be sent with the proposed transaction + /// @param _description String describing the proposal + /// @param _transactionData Data of the proposed transaction + /// @param _debatingPeriod Time used for debating a proposal, at least 2 + /// weeks for a regular proposal, 10 days for new Curator proposal + /// @param _newCurator Bool defining whether this proposal is about + /// a new Curator or not + /// @return The proposal ID. Needed for voting on the proposal + function newProposal( + address _recipient, + uint _amount, + string _description, + bytes _transactionData, + uint _debatingPeriod, + bool _newCurator + ) onlyTokenholders returns (uint _proposalID); + + /// @notice Check that the proposal with the ID `_proposalID` matches the + /// transaction which sends `_amount` with data `_transactionData` + /// to `_recipient` + /// @param _proposalID The proposal ID + /// @param _recipient The recipient of the proposed transaction + /// @param _amount The amount of wei to be sent in the proposed transaction + /// @param _transactionData The data of the proposed transaction + /// @return Whether the proposal ID matches the transaction data or not + function checkProposalCode( + uint _proposalID, + address _recipient, + uint _amount, + bytes _transactionData + ) constant returns (bool _codeChecksOut); + + /// @notice Vote on proposal `_proposalID` with `_supportsProposal` + /// @param _proposalID The proposal ID + /// @param _supportsProposal Yes/No - support of the proposal + /// @return The vote ID. + function vote( + uint _proposalID, + bool _supportsProposal + ) onlyTokenholders returns (uint _voteID); + + /// @notice Checks whether proposal `_proposalID` with transaction data + /// `_transactionData` has been voted for or rejected, and executes the + /// transaction in the case it has been voted for. + /// @param _proposalID The proposal ID + /// @param _transactionData The data of the proposed transaction + /// @return Whether the proposed transaction has been executed or not + function executeProposal( + uint _proposalID, + bytes _transactionData + ) returns (bool _success); + + /// @notice ATTENTION! I confirm to move my remaining ether to a new DAO + /// with `_newCurator` as the new Curator, as has been + /// proposed in proposal `_proposalID`. This will burn my tokens. This can + /// not be undone and will split the DAO into two DAO's, with two + /// different underlying tokens. + /// @param _proposalID The proposal ID + /// @param _newCurator The new Curator of the new DAO + /// @dev This function, when called for the first time for this proposal, + /// will create a new DAO and send the sender's portion of the remaining + /// ether and Reward Tokens to the new DAO. It will also burn the DAO Tokens + /// of the sender. + function splitDAO( + uint _proposalID, + address _newCurator + ) returns (bool _success); + + /// @dev can only be called by the DAO itself through a proposal + /// updates the contract of the DAO by sending all ether and rewardTokens + /// to the new DAO. The new DAO needs to be approved by the Curator + /// @param _newContract the address of the new contract + function newContract(address _newContract); + + + /// @notice Add a new possible recipient `_recipient` to the whitelist so + /// that the DAO can send transactions to them (using proposals) + /// @param _recipient New recipient address + /// @dev Can only be called by the current Curator + /// @return Whether successful or not + function changeAllowedRecipients(address _recipient, bool _allowed) external returns (bool _success); + + + /// @notice Change the minimum deposit required to submit a proposal + /// @param _proposalDeposit The new proposal deposit + /// @dev Can only be called by this DAO (through proposals with the + /// recipient being this DAO itself) + function changeProposalDeposit(uint _proposalDeposit) external; + + /// @notice Move rewards from the DAORewards managed account + /// @param _toMembers If true rewards are moved to the actual reward account + /// for the DAO. If not then it's moved to the DAO itself + /// @return Whether the call was successful + function retrieveDAOReward(bool _toMembers) external returns (bool _success); + + /// @notice Get my portion of the reward that was sent to `rewardAccount` + /// @return Whether the call was successful + function getMyReward() returns(bool _success); + + /// @notice Withdraw `_account`'s portion of the reward from `rewardAccount` + /// to `_account`'s balance + /// @return Whether the call was successful + function withdrawRewardFor(address _account) internal returns (bool _success); + + /// @notice Send `_amount` tokens to `_to` from `msg.sender`. Prior to this + /// getMyReward() is called. + /// @param _to The address of the recipient + /// @param _amount The amount of tokens to be transfered + /// @return Whether the transfer was successful or not + function transferWithoutReward(address _to, uint256 _amount) returns (bool success); + + /// @notice Send `_amount` tokens to `_to` from `_from` on the condition it + /// is approved by `_from`. Prior to this getMyReward() is called. + /// @param _from The address of the sender + /// @param _to The address of the recipient + /// @param _amount The amount of tokens to be transfered + /// @return Whether the transfer was successful or not + function transferFromWithoutReward( + address _from, + address _to, + uint256 _amount + ) returns (bool success); + + /// @notice Doubles the 'minQuorumDivisor' in the case quorum has not been + /// achieved in 52 weeks + /// @return Whether the change was successful or not + function halveMinQuorum() returns (bool _success); + + /// @return total number of proposals ever created + function numberOfProposals() constant returns (uint _numberOfProposals); + + /// @param _proposalID Id of the new curator proposal + /// @return Address of the new DAO + function getNewDAOAddress(uint _proposalID) constant returns (address _newDAO); + + /// @param _account The address of the account which is checked. + /// @return Whether the account is blocked (not allowed to transfer tokens) or not. + function isBlocked(address _account) internal returns (bool); + + /// @notice If the caller is blocked by a proposal whose voting deadline + /// has exprired then unblock him. + /// @return Whether the account is blocked (not allowed to transfer tokens) or not. + function unblockMe() returns (bool); + + event ProposalAdded( + uint indexed proposalID, + address recipient, + uint amount, + bool newCurator, + string description + ); + event Voted(uint indexed proposalID, bool position, address indexed voter); + event ProposalTallied(uint indexed proposalID, bool result, uint quorum); + event NewCurator(address indexed _newCurator); + event AllowedRecipientChanged(address indexed _recipient, bool _allowed); +} + +// The DAO contract itself +contract DAO is DAOInterface, Token, TokenCreation { + + // Modifier that allows only shareholders to vote and create new proposals + modifier onlyTokenholders { + if (balanceOf(msg.sender) == 0) throw; + _; + } + + function DAO( + address _curator, + DAO_Creator _daoCreator, + uint _proposalDeposit, + uint _minTokensToCreate, + uint _closingTime, + address _privateCreation + ) TokenCreation(_minTokensToCreate, _closingTime, _privateCreation) { + + curator = _curator; + daoCreator = _daoCreator; + proposalDeposit = _proposalDeposit; + rewardAccount = new ManagedAccount(address(this), false); + DAOrewardAccount = new ManagedAccount(address(this), false); + if (address(rewardAccount) == 0) + throw; + if (address(DAOrewardAccount) == 0) + throw; + lastTimeMinQuorumMet = now; + minQuorumDivisor = 5; // sets the minimal quorum to 20% + proposals.length = 1; // avoids a proposal with ID 0 because it is used + + allowedRecipients[address(this)] = true; + allowedRecipients[curator] = true; + } + + function () { +/* if (now < closingTime + creationGracePeriod && msg.sender != address(extraBalance)) + return createTokenProxy(msg.sender); + else + return receiveEther();*/ + } + + + function receiveEther() returns (bool) { + return true; + } + + + function newProposal( + address _recipient, + uint _amount, + string _description, + bytes _transactionData, + uint _debatingPeriod, + bool _newCurator + ) onlyTokenholders returns (uint _proposalID) { + + // Sanity check + if (_newCurator && ( + _amount != 0 + || _transactionData.length != 0 + || _recipient == curator + || msg.value > 0 + || _debatingPeriod < minSplitDebatePeriod)) { + throw; + } else if ( + !_newCurator + && (!isRecipientAllowed(_recipient) || (_debatingPeriod < minProposalDebatePeriod)) + ) { + throw; + } + + if (_debatingPeriod > 8 weeks) + throw; + + if (!isFueled + || now < closingTime + || (msg.value < proposalDeposit && !_newCurator)) { + + throw; + } + + if (now + _debatingPeriod < now) // prevents overflow + throw; + + // to prevent a 51% attacker to convert the ether into deposit + if (msg.sender == address(this)) + throw; + + _proposalID = proposals.length++; + Proposal p = proposals[_proposalID]; + p.recipient = _recipient; + p.amount = _amount; + p.description = _description; + p.proposalHash = sha3(_recipient, _amount, _transactionData); + p.votingDeadline = now + _debatingPeriod; + p.open = true; + //p.proposalPassed = False; // that's default + p.newCurator = _newCurator; + if (_newCurator) + p.splitData.length++; + p.creator = msg.sender; + p.proposalDeposit = msg.value; + + sumOfProposalDeposits += msg.value; + + ProposalAdded( + _proposalID, + _recipient, + _amount, + _newCurator, + _description + ); + } + + + function checkProposalCode( + uint _proposalID, + address _recipient, + uint _amount, + bytes _transactionData + ) noEther constant returns (bool _codeChecksOut) { + Proposal p = proposals[_proposalID]; + return p.proposalHash == sha3(_recipient, _amount, _transactionData); + } + + + function vote( + uint _proposalID, + bool _supportsProposal + ) onlyTokenholders noEther returns (uint _voteID) { + + Proposal p = proposals[_proposalID]; + if (p.votedYes[msg.sender] + || p.votedNo[msg.sender] + || now >= p.votingDeadline) { + + throw; + } + + if (_supportsProposal) { + p.yea += balances[msg.sender]; + p.votedYes[msg.sender] = true; + } else { + p.nay += balances[msg.sender]; + p.votedNo[msg.sender] = true; + } + + if (blocked[msg.sender] == 0) { + blocked[msg.sender] = _proposalID; + } else if (p.votingDeadline > proposals[blocked[msg.sender]].votingDeadline) { + // this proposal's voting deadline is further into the future than + // the proposal that blocks the sender so make it the blocker + blocked[msg.sender] = _proposalID; + } + + Voted(_proposalID, _supportsProposal, msg.sender); + } + + + function executeProposal( + uint _proposalID, + bytes _transactionData + ) noEther returns (bool _success) { + + Proposal p = proposals[_proposalID]; + + uint waitPeriod = p.newCurator + ? splitExecutionPeriod + : executeProposalPeriod; + // If we are over deadline and waiting period, assert proposal is closed + if (p.open && now > p.votingDeadline + waitPeriod) { + closeProposal(_proposalID); + return; + } + + // Check if the proposal can be executed + if (now < p.votingDeadline // has the voting deadline arrived? + // Have the votes been counted? + || !p.open + // Does the transaction code match the proposal? + || p.proposalHash != sha3(p.recipient, p.amount, _transactionData)) { + + throw; + } + + // If the curator removed the recipient from the whitelist, close the proposal + // in order to free the deposit and allow unblocking of voters + if (!isRecipientAllowed(p.recipient)) { + closeProposal(_proposalID); + p.creator.send(p.proposalDeposit); + return; + } + + bool proposalCheck = true; + + if (p.amount > actualBalance()) + proposalCheck = false; + + uint quorum = p.yea + p.nay; + + // require 53% for calling newContract() + if (_transactionData.length >= 4 && _transactionData[0] == 0x68 + && _transactionData[1] == 0x37 && _transactionData[2] == 0xff + && _transactionData[3] == 0x1e + && quorum < minQuorum(actualBalance() + rewardToken[address(this)])) { + + proposalCheck = false; + } + + if (quorum >= minQuorum(p.amount)) { + if (!p.creator.send(p.proposalDeposit)) + throw; + + lastTimeMinQuorumMet = now; + // set the minQuorum to 20% again, in the case it has been reached + if (quorum > totalSupply / 5) + minQuorumDivisor = 5; + } + + // Execute result + if (quorum >= minQuorum(p.amount) && p.yea > p.nay && proposalCheck) { + if (!p.recipient.call.value(p.amount)(_transactionData)) + throw; + + p.proposalPassed = true; + _success = true; + + // only create reward tokens when ether is not sent to the DAO itself and + // related addresses. Proxy addresses should be forbidden by the curator. + if (p.recipient != address(this) && p.recipient != address(rewardAccount) + && p.recipient != address(DAOrewardAccount) + && p.recipient != address(extraBalance) + && p.recipient != address(curator)) { + + rewardToken[address(this)] += p.amount; + totalRewardToken += p.amount; + } + } + + closeProposal(_proposalID); + + // Initiate event + ProposalTallied(_proposalID, _success, quorum); + } + + + function closeProposal(uint _proposalID) internal { + Proposal p = proposals[_proposalID]; + if (p.open) + sumOfProposalDeposits -= p.proposalDeposit; + p.open = false; + } + + function splitDAO( + uint _proposalID, + address _newCurator + ) noEther onlyTokenholders returns (bool _success) { + + Proposal p = proposals[_proposalID]; + + // Sanity check + + if (now < p.votingDeadline // has the voting deadline arrived? + //The request for a split expires XX days after the voting deadline + || now > p.votingDeadline + splitExecutionPeriod + // Does the new Curator address match? + || p.recipient != _newCurator + // Is it a new curator proposal? + || !p.newCurator + // Have you voted for this split? + || !p.votedYes[msg.sender] + // Did you already vote on another proposal? + || (blocked[msg.sender] != _proposalID && blocked[msg.sender] != 0) ) { + + throw; + } + + // If the new DAO doesn't exist yet, create the new DAO and store the + // current split data + if (address(p.splitData[0].newDAO) == 0) { + p.splitData[0].newDAO = createNewDAO(_newCurator); + // Call depth limit reached, etc. + if (address(p.splitData[0].newDAO) == 0) + throw; + // should never happen + if (this.balance < sumOfProposalDeposits) + throw; + p.splitData[0].splitBalance = actualBalance(); + p.splitData[0].rewardToken = rewardToken[address(this)]; + p.splitData[0].totalSupply = totalSupply; + p.proposalPassed = true; + } + + // Move ether and assign new Tokens + uint fundsToBeMoved = + (balances[msg.sender] * p.splitData[0].splitBalance) / + p.splitData[0].totalSupply; + if (p.splitData[0].newDAO.createTokenProxy.value(fundsToBeMoved)(msg.sender) == false) + throw; + + + // Assign reward rights to new DAO + uint rewardTokenToBeMoved = + (balances[msg.sender] * p.splitData[0].rewardToken) / + p.splitData[0].totalSupply; + + uint paidOutToBeMoved = DAOpaidOut[address(this)] * rewardTokenToBeMoved / + rewardToken[address(this)]; + + rewardToken[address(p.splitData[0].newDAO)] += rewardTokenToBeMoved; + if (rewardToken[address(this)] < rewardTokenToBeMoved) + throw; + rewardToken[address(this)] -= rewardTokenToBeMoved; + + DAOpaidOut[address(p.splitData[0].newDAO)] += paidOutToBeMoved; + if (DAOpaidOut[address(this)] < paidOutToBeMoved) + throw; + DAOpaidOut[address(this)] -= paidOutToBeMoved; + + // Burn DAO Tokens + Transfer(msg.sender, 0, balances[msg.sender]); + withdrawRewardFor(msg.sender); // be nice, and get his rewards + totalSupply -= balances[msg.sender]; + balances[msg.sender] = 0; + paidOut[msg.sender] = 0; + return true; + } + + function newContract(address _newContract){ + if (msg.sender != address(this) || !allowedRecipients[_newContract]) return; + // move all ether + if (!_newContract.call.value(address(this).balance)()) { + throw; + } + + //move all reward tokens + rewardToken[_newContract] += rewardToken[address(this)]; + rewardToken[address(this)] = 0; + DAOpaidOut[_newContract] += DAOpaidOut[address(this)]; + DAOpaidOut[address(this)] = 0; + } + + + function retrieveDAOReward(bool _toMembers) external noEther returns (bool _success) { + DAO dao = DAO(msg.sender); + + if ((rewardToken[msg.sender] * DAOrewardAccount.accumulatedInput()) / + totalRewardToken < DAOpaidOut[msg.sender]) + throw; + + uint reward = + (rewardToken[msg.sender] * DAOrewardAccount.accumulatedInput()) / + totalRewardToken - DAOpaidOut[msg.sender]; + if(_toMembers) { + if (!DAOrewardAccount.payOut(dao.rewardAccount(), reward)) + throw; + } + else { + if (!DAOrewardAccount.payOut(dao, reward)) + throw; + } + DAOpaidOut[msg.sender] += reward; + return true; + } + + function getMyReward() noEther returns (bool _success) { + return withdrawRewardFor(msg.sender); + } + + + function withdrawRewardFor(address _account) noEther internal returns (bool _success) { + if ((balanceOf(_account) * rewardAccount.accumulatedInput()) / totalSupply < paidOut[_account]) + throw; + + uint reward = + (balanceOf(_account) * rewardAccount.accumulatedInput()) / totalSupply - paidOut[_account]; + if (!rewardAccount.payOut(_account, reward)) + throw; + paidOut[_account] += reward; + return true; + } + + + function transfer(address _to, uint256 _value) returns (bool success) { + if (isFueled + && now > closingTime + && !isBlocked(msg.sender) + && transferPaidOut(msg.sender, _to, _value) + && super.transfer(_to, _value)) { + + return true; + } else { + throw; + } + } + + + function transferWithoutReward(address _to, uint256 _value) returns (bool success) { + if (!getMyReward()) + throw; + return transfer(_to, _value); + } + + + function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { + if (isFueled + && now > closingTime + && !isBlocked(_from) + && transferPaidOut(_from, _to, _value) + && super.transferFrom(_from, _to, _value)) { + + return true; + } else { + throw; + } + } + + + function transferFromWithoutReward( + address _from, + address _to, + uint256 _value + ) returns (bool success) { + + if (!withdrawRewardFor(_from)) + throw; + return transferFrom(_from, _to, _value); + } + + + function transferPaidOut( + address _from, + address _to, + uint256 _value + ) internal returns (bool success) { + + uint transferPaidOut = paidOut[_from] * _value / balanceOf(_from); + if (transferPaidOut > paidOut[_from]) + throw; + paidOut[_from] -= transferPaidOut; + paidOut[_to] += transferPaidOut; + return true; + } + + + function changeProposalDeposit(uint _proposalDeposit) noEther external { + if (msg.sender != address(this) || _proposalDeposit > (actualBalance() + rewardToken[address(this)]) + / maxDepositDivisor) { + + throw; + } + proposalDeposit = _proposalDeposit; + } + + + function changeAllowedRecipients(address _recipient, bool _allowed) noEther external returns (bool _success) { + if (msg.sender != curator) + throw; + allowedRecipients[_recipient] = _allowed; + AllowedRecipientChanged(_recipient, _allowed); + return true; + } + + + function isRecipientAllowed(address _recipient) internal returns (bool _isAllowed) { + if (allowedRecipients[_recipient] + || (_recipient == address(extraBalance) + // only allowed when at least the amount held in the + // extraBalance account has been spent from the DAO + && totalRewardToken > extraBalance.accumulatedInput())) + return true; + else + return false; + } + + function actualBalance() constant returns (uint _actualBalance) { + return this.balance - sumOfProposalDeposits; + } + + + function minQuorum(uint _value) internal constant returns (uint _minQuorum) { + // minimum of 20% and maximum of 53.33% + return totalSupply / minQuorumDivisor + + (_value * totalSupply) / (3 * (actualBalance() + rewardToken[address(this)])); + } + + + function halveMinQuorum() returns (bool _success) { + // this can only be called after `quorumHalvingPeriod` has passed or at anytime + // by the curator with a delay of at least `minProposalDebatePeriod` between the calls + if ((lastTimeMinQuorumMet < (now - quorumHalvingPeriod) || msg.sender == curator) + && lastTimeMinQuorumMet < (now - minProposalDebatePeriod)) { + lastTimeMinQuorumMet = now; + minQuorumDivisor *= 2; + return true; + } else { + return false; + } + } + + function createNewDAO(address _newCurator) internal returns (DAO _newDAO) { + NewCurator(_newCurator); + return daoCreator.createDAO(_newCurator, 0, 0, now + splitExecutionPeriod); + } + + function numberOfProposals() constant returns (uint _numberOfProposals) { + // Don't count index 0. It's used by isBlocked() and exists from start + return proposals.length - 1; + } + + function getNewDAOAddress(uint _proposalID) constant returns (address _newDAO) { + return proposals[_proposalID].splitData[0].newDAO; + } + + function isBlocked(address _account) internal returns (bool) { + if (blocked[_account] == 0) + return false; + Proposal p = proposals[blocked[_account]]; + if (now > p.votingDeadline) { + blocked[_account] = 0; + return false; + } else { + return true; + } + } + + function unblockMe() returns (bool) { + return isBlocked(msg.sender); + } +} + +contract DAO_Creator { + function createDAO( + address _curator, + uint _proposalDeposit, + uint _minTokensToCreate, + uint _closingTime + ) returns (DAO _newDAO) { + + return new DAO( + _curator, + DAO_Creator(this), + _proposalDeposit, + _minTokensToCreate, + _closingTime, + msg.sender + ); + } +} diff --git a/tests/detectors/reentrancy-eth/0.4.25/DAO.sol.0.4.25.ReentrancyEth.json b/tests/detectors/reentrancy-eth/0.4.25/DAO.sol.0.4.25.ReentrancyEth.json new file mode 100644 index 0000000000..5f983e3108 --- /dev/null +++ b/tests/detectors/reentrancy-eth/0.4.25/DAO.sol.0.4.25.ReentrancyEth.json @@ -0,0 +1,9354 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "executeProposal", + "source_mapping": { + "start": 32955, + "length": 2978, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "executeProposal(uint256,bytes)" + } + }, + { + "type": "node", + "name": "! isRecipientAllowed(p.recipient)", + "source_mapping": { + "start": 33981, + "length": 32, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 881 + ], + "starting_column": 13, + "ending_column": 45 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "executeProposal", + "source_mapping": { + "start": 32955, + "length": 2978, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "executeProposal(uint256,bytes)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "allowedRecipients[_recipient] || (_recipient == address(extraBalance) && totalRewardToken > extraBalance.accumulatedInput())", + "source_mapping": { + "start": 43091, + "length": 289, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1159, + 1160, + 1161, + 1162, + 1163 + ], + "starting_column": 13, + "ending_column": 71 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "isRecipientAllowed", + "source_mapping": { + "start": 42994, + "length": 457, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "isRecipientAllowed(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "! p.recipient.call.value(p.amount)(_transactionData)", + "source_mapping": { + "start": 35109, + "length": 51, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 915 + ], + "starting_column": 17, + "ending_column": 68 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "executeProposal", + "source_mapping": { + "start": 32955, + "length": 2978, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "executeProposal(uint256,bytes)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "! p.creator.send(p.proposalDeposit)", + "source_mapping": { + "start": 34718, + "length": 34, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 904 + ], + "starting_column": 17, + "ending_column": 51 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "executeProposal", + "source_mapping": { + "start": 32955, + "length": 2978, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "executeProposal(uint256,bytes)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "! p.recipient.call.value(p.amount)(_transactionData)", + "source_mapping": { + "start": 35109, + "length": 51, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 915 + ], + "starting_column": 17, + "ending_column": 68 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "executeProposal", + "source_mapping": { + "start": 32955, + "length": 2978, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "executeProposal(uint256,bytes)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "p.proposalPassed = true", + "source_mapping": { + "start": 35198, + "length": 23, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 918 + ], + "starting_column": 13, + "ending_column": 36 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "executeProposal", + "source_mapping": { + "start": 32955, + "length": 2978, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "executeProposal(uint256,bytes)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "proposals" + } + }, + { + "type": "node", + "name": "closeProposal(_proposalID)", + "source_mapping": { + "start": 35817, + "length": 26, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 933 + ], + "starting_column": 9, + "ending_column": 35 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "executeProposal", + "source_mapping": { + "start": 32955, + "length": 2978, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "executeProposal(uint256,bytes)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "proposals" + } + }, + { + "type": "node", + "name": "p.open = false", + "source_mapping": { + "start": 36121, + "length": 14, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 944 + ], + "starting_column": 9, + "ending_column": 23 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "closeProposal", + "source_mapping": { + "start": 35940, + "length": 202, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 940, + 941, + 942, + 943, + 944, + 945 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "closeProposal(uint256)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "proposals" + } + }, + { + "type": "node", + "name": "rewardToken[address(this)] += p.amount", + "source_mapping": { + "start": 35698, + "length": 38, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 928 + ], + "starting_column": 17, + "ending_column": 55 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "executeProposal", + "source_mapping": { + "start": 32955, + "length": 2978, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "executeProposal(uint256,bytes)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "rewardToken" + } + }, + { + "type": "node", + "name": "closeProposal(_proposalID)", + "source_mapping": { + "start": 35817, + "length": 26, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 933 + ], + "starting_column": 9, + "ending_column": 35 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "executeProposal", + "source_mapping": { + "start": 32955, + "length": 2978, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "executeProposal(uint256,bytes)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "sumOfProposalDeposits" + } + }, + { + "type": "node", + "name": "sumOfProposalDeposits -= p.proposalDeposit", + "source_mapping": { + "start": 36069, + "length": 42, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 943 + ], + "starting_column": 13, + "ending_column": 55 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "closeProposal", + "source_mapping": { + "start": 35940, + "length": 202, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 940, + 941, + 942, + 943, + 944, + 945 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "closeProposal(uint256)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "sumOfProposalDeposits" + } + }, + { + "type": "node", + "name": "totalRewardToken += p.amount", + "source_mapping": { + "start": 35754, + "length": 28, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 929 + ], + "starting_column": 17, + "ending_column": 45 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "executeProposal", + "source_mapping": { + "start": 32955, + "length": 2978, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "executeProposal(uint256,bytes)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "totalRewardToken" + } + } + ], + "description": "Reentrancy in DAO.executeProposal(uint256,bytes) (tests/detectors/reentrancy-eth/0.4.25/DAO.sol#853-937):\n\tExternal calls:\n\t- ! isRecipientAllowed(p.recipient) (tests/detectors/reentrancy-eth/0.4.25/DAO.sol#881)\n\t\t- allowedRecipients[_recipient] || (_recipient == address(extraBalance) && totalRewardToken > extraBalance.accumulatedInput()) (tests/detectors/reentrancy-eth/0.4.25/DAO.sol#1159-1163)\n\t- ! p.recipient.call.value(p.amount)(_transactionData) (tests/detectors/reentrancy-eth/0.4.25/DAO.sol#915)\n\tExternal calls sending eth:\n\t- ! p.creator.send(p.proposalDeposit) (tests/detectors/reentrancy-eth/0.4.25/DAO.sol#904)\n\t- ! p.recipient.call.value(p.amount)(_transactionData) (tests/detectors/reentrancy-eth/0.4.25/DAO.sol#915)\n\tState variables written after the call(s):\n\t- p.proposalPassed = true (tests/detectors/reentrancy-eth/0.4.25/DAO.sol#918)\n\t- closeProposal(_proposalID) (tests/detectors/reentrancy-eth/0.4.25/DAO.sol#933)\n\t\t- p.open = false (tests/detectors/reentrancy-eth/0.4.25/DAO.sol#944)\n\t- rewardToken[address(this)] += p.amount (tests/detectors/reentrancy-eth/0.4.25/DAO.sol#928)\n\t- closeProposal(_proposalID) (tests/detectors/reentrancy-eth/0.4.25/DAO.sol#933)\n\t\t- sumOfProposalDeposits -= p.proposalDeposit (tests/detectors/reentrancy-eth/0.4.25/DAO.sol#943)\n\t- totalRewardToken += p.amount (tests/detectors/reentrancy-eth/0.4.25/DAO.sol#929)\n", + "markdown": "Reentrancy in [DAO.executeProposal(uint256,bytes)](tests/detectors/reentrancy-eth/0.4.25/DAO.sol#L853-L937):\n\tExternal calls:\n\t- [! isRecipientAllowed(p.recipient)](tests/detectors/reentrancy-eth/0.4.25/DAO.sol#L881)\n\t\t- [allowedRecipients[_recipient] || (_recipient == address(extraBalance) && totalRewardToken > extraBalance.accumulatedInput())](tests/detectors/reentrancy-eth/0.4.25/DAO.sol#L1159-L1163)\n\t- [! p.recipient.call.value(p.amount)(_transactionData)](tests/detectors/reentrancy-eth/0.4.25/DAO.sol#L915)\n\tExternal calls sending eth:\n\t- [! p.creator.send(p.proposalDeposit)](tests/detectors/reentrancy-eth/0.4.25/DAO.sol#L904)\n\t- [! p.recipient.call.value(p.amount)(_transactionData)](tests/detectors/reentrancy-eth/0.4.25/DAO.sol#L915)\n\tState variables written after the call(s):\n\t- [p.proposalPassed = true](tests/detectors/reentrancy-eth/0.4.25/DAO.sol#L918)\n\t- [closeProposal(_proposalID)](tests/detectors/reentrancy-eth/0.4.25/DAO.sol#L933)\n\t\t- [p.open = false](tests/detectors/reentrancy-eth/0.4.25/DAO.sol#L944)\n\t- [rewardToken[address(this)] += p.amount](tests/detectors/reentrancy-eth/0.4.25/DAO.sol#L928)\n\t- [closeProposal(_proposalID)](tests/detectors/reentrancy-eth/0.4.25/DAO.sol#L933)\n\t\t- [sumOfProposalDeposits -= p.proposalDeposit](tests/detectors/reentrancy-eth/0.4.25/DAO.sol#L943)\n\t- [totalRewardToken += p.amount](tests/detectors/reentrancy-eth/0.4.25/DAO.sol#L929)\n", + "id": "da2955efdedec834e2cbc56b913933ba273e4a4da5d9c5c6be9ff59c9249b84c", + "check": "reentrancy-eth", + "impact": "High", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "refund", + "source_mapping": { + "start": 11531, + "length": 635, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 318, + 319, + 320, + 321, + 322, + 323, + 324, + 325, + 326, + 327, + 328, + 329, + 330, + 331, + 332 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TokenCreation", + "source_mapping": { + "start": 10437, + "length": 2342, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 287, + 288, + 289, + 290, + 291, + 292, + 293, + 294, + 295, + 296, + 297, + 298, + 299, + 300, + 301, + 302, + 303, + 304, + 305, + 306, + 307, + 308, + 309, + 310, + 311, + 312, + 313, + 314, + 315, + 316, + 317, + 318, + 319, + 320, + 321, + 322, + 323, + 324, + 325, + 326, + 327, + 328, + 329, + 330, + 331, + 332, + 333, + 334, + 335, + 336, + 337, + 338, + 339, + 340, + 341, + 342, + 343, + 344, + 345, + 346, + 347, + 348 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "refund()" + } + }, + { + "type": "node", + "name": "extraBalance.balance >= extraBalance.accumulatedInput()", + "source_mapping": { + "start": 11704, + "length": 55, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 321 + ], + "starting_column": 17, + "ending_column": 72 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "refund", + "source_mapping": { + "start": 11531, + "length": 635, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 318, + 319, + 320, + 321, + 322, + 323, + 324, + 325, + 326, + 327, + 328, + 329, + 330, + 331, + 332 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TokenCreation", + "source_mapping": { + "start": 10437, + "length": 2342, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 287, + 288, + 289, + 290, + 291, + 292, + 293, + 294, + 295, + 296, + 297, + 298, + 299, + 300, + 301, + 302, + 303, + 304, + 305, + 306, + 307, + 308, + 309, + 310, + 311, + 312, + 313, + 314, + 315, + 316, + 317, + 318, + 319, + 320, + 321, + 322, + 323, + 324, + 325, + 326, + 327, + 328, + 329, + 330, + 331, + 332, + 333, + 334, + 335, + 336, + 337, + 338, + 339, + 340, + 341, + 342, + 343, + 344, + 345, + 346, + 347, + 348 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "refund()" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "extraBalance.payOut(address(this),extraBalance.accumulatedInput())", + "source_mapping": { + "start": 11777, + "length": 67, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 322 + ], + "starting_column": 17, + "ending_column": 84 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "refund", + "source_mapping": { + "start": 11531, + "length": 635, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 318, + 319, + 320, + 321, + 322, + 323, + 324, + 325, + 326, + 327, + 328, + 329, + 330, + 331, + 332 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TokenCreation", + "source_mapping": { + "start": 10437, + "length": 2342, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 287, + 288, + 289, + 290, + 291, + 292, + 293, + 294, + 295, + 296, + 297, + 298, + 299, + 300, + 301, + 302, + 303, + 304, + 305, + 306, + 307, + 308, + 309, + 310, + 311, + 312, + 313, + 314, + 315, + 316, + 317, + 318, + 319, + 320, + 321, + 322, + 323, + 324, + 325, + 326, + 327, + 328, + 329, + 330, + 331, + 332, + 333, + 334, + 335, + 336, + 337, + 338, + 339, + 340, + 341, + 342, + 343, + 344, + 345, + 346, + 347, + 348 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "refund()" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "msg.sender.call.value(weiGiven[msg.sender])()", + "source_mapping": { + "start": 11893, + "length": 45, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 325 + ], + "starting_column": 17, + "ending_column": 62 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "refund", + "source_mapping": { + "start": 11531, + "length": 635, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 318, + 319, + 320, + 321, + 322, + 323, + 324, + 325, + 326, + 327, + 328, + 329, + 330, + 331, + 332 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TokenCreation", + "source_mapping": { + "start": 10437, + "length": 2342, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 287, + 288, + 289, + 290, + 291, + 292, + 293, + 294, + 295, + 296, + 297, + 298, + 299, + 300, + 301, + 302, + 303, + 304, + 305, + 306, + 307, + 308, + 309, + 310, + 311, + 312, + 313, + 314, + 315, + 316, + 317, + 318, + 319, + 320, + 321, + 322, + 323, + 324, + 325, + 326, + 327, + 328, + 329, + 330, + 331, + 332, + 333, + 334, + 335, + 336, + 337, + 338, + 339, + 340, + 341, + 342, + 343, + 344, + 345, + 346, + 347, + 348 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "refund()" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "msg.sender.call.value(weiGiven[msg.sender])()", + "source_mapping": { + "start": 11893, + "length": 45, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 325 + ], + "starting_column": 17, + "ending_column": 62 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "refund", + "source_mapping": { + "start": 11531, + "length": 635, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 318, + 319, + 320, + 321, + 322, + 323, + 324, + 325, + 326, + 327, + 328, + 329, + 330, + 331, + 332 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TokenCreation", + "source_mapping": { + "start": 10437, + "length": 2342, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 287, + 288, + 289, + 290, + 291, + 292, + 293, + 294, + 295, + 296, + 297, + 298, + 299, + 300, + 301, + 302, + 303, + 304, + 305, + 306, + 307, + 308, + 309, + 310, + 311, + 312, + 313, + 314, + 315, + 316, + 317, + 318, + 319, + 320, + 321, + 322, + 323, + 324, + 325, + 326, + 327, + 328, + 329, + 330, + 331, + 332, + 333, + 334, + 335, + 336, + 337, + 338, + 339, + 340, + 341, + 342, + 343, + 344, + 345, + 346, + 347, + 348 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "refund()" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "weiGiven[msg.sender] = 0", + "source_mapping": { + "start": 12111, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 329 + ], + "starting_column": 17, + "ending_column": 41 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "refund", + "source_mapping": { + "start": 11531, + "length": 635, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 318, + 319, + 320, + 321, + 322, + 323, + 324, + 325, + 326, + 327, + 328, + 329, + 330, + 331, + 332 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TokenCreation", + "source_mapping": { + "start": 10437, + "length": 2342, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 287, + 288, + 289, + 290, + 291, + 292, + 293, + 294, + 295, + 296, + 297, + 298, + 299, + 300, + 301, + 302, + 303, + 304, + 305, + 306, + 307, + 308, + 309, + 310, + 311, + 312, + 313, + 314, + 315, + 316, + 317, + 318, + 319, + 320, + 321, + 322, + 323, + 324, + 325, + 326, + 327, + 328, + 329, + 330, + 331, + 332, + 333, + 334, + 335, + 336, + 337, + 338, + 339, + 340, + 341, + 342, + 343, + 344, + 345, + 346, + 347, + 348 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "refund()" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "weiGiven" + } + } + ], + "description": "Reentrancy in TokenCreation.refund() (tests/detectors/reentrancy-eth/0.4.25/DAO.sol#318-332):\n\tExternal calls:\n\t- extraBalance.balance >= extraBalance.accumulatedInput() (tests/detectors/reentrancy-eth/0.4.25/DAO.sol#321)\n\t- extraBalance.payOut(address(this),extraBalance.accumulatedInput()) (tests/detectors/reentrancy-eth/0.4.25/DAO.sol#322)\n\t- msg.sender.call.value(weiGiven[msg.sender])() (tests/detectors/reentrancy-eth/0.4.25/DAO.sol#325)\n\tExternal calls sending eth:\n\t- msg.sender.call.value(weiGiven[msg.sender])() (tests/detectors/reentrancy-eth/0.4.25/DAO.sol#325)\n\tState variables written after the call(s):\n\t- weiGiven[msg.sender] = 0 (tests/detectors/reentrancy-eth/0.4.25/DAO.sol#329)\n", + "markdown": "Reentrancy in [TokenCreation.refund()](tests/detectors/reentrancy-eth/0.4.25/DAO.sol#L318-L332):\n\tExternal calls:\n\t- [extraBalance.balance >= extraBalance.accumulatedInput()](tests/detectors/reentrancy-eth/0.4.25/DAO.sol#L321)\n\t- [extraBalance.payOut(address(this),extraBalance.accumulatedInput())](tests/detectors/reentrancy-eth/0.4.25/DAO.sol#L322)\n\t- [msg.sender.call.value(weiGiven[msg.sender])()](tests/detectors/reentrancy-eth/0.4.25/DAO.sol#L325)\n\tExternal calls sending eth:\n\t- [msg.sender.call.value(weiGiven[msg.sender])()](tests/detectors/reentrancy-eth/0.4.25/DAO.sol#L325)\n\tState variables written after the call(s):\n\t- [weiGiven[msg.sender] = 0](tests/detectors/reentrancy-eth/0.4.25/DAO.sol#L329)\n", + "id": "c464e3c8a788029668f77cdff5d7e6a2af53a5ec0f79e21392a5910bfb9dcbe5", + "check": "reentrancy-eth", + "impact": "High", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol b/tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol new file mode 100644 index 0000000000..6f03a624ca --- /dev/null +++ b/tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol @@ -0,0 +1,1242 @@ + +// +// Modified version to be compiler with sol 0.4 +// +/* + +- Bytecode Verification performed was compared on second iteration - + +This file is part of the DAO. + +The DAO is free software: you can redistribute it and/or modify +it under the terms of the GNU lesser General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +The DAO is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU lesser General Public License for more details. + +You should have received a copy of the GNU lesser General Public License +along with the DAO. If not, see . +*/ + + +/* +Basic, standardized Token contract with no "premine". Defines the functions to +check token balances, send tokens, send tokens on behalf of a 3rd party and the +corresponding approval process. Tokens need to be created by a derived +contract (e.g. TokenCreation.sol). + +Thank you ConsenSys, this contract originated from: +https://github.com/ConsenSys/Tokens/blob/master/Token_Contracts/contracts/Standard_Token.sol +Which is itself based on the Ethereum standardized contract APIs: +https://github.com/ethereum/wiki/wiki/Standardized_Contract_APIs +*/ + +/// @title Standard Token Contract. + +contract TokenInterface { + mapping (address => uint256) balances; + mapping (address => mapping (address => uint256)) allowed; + + /// Total amount of tokens + uint256 public totalSupply; + + /// @param _owner The address from which the balance will be retrieved + /// @return The balance + function balanceOf(address _owner) constant returns (uint256 balance); + + /// @notice Send `_amount` tokens to `_to` from `msg.sender` + /// @param _to The address of the recipient + /// @param _amount The amount of tokens to be transferred + /// @return Whether the transfer was successful or not + function transfer(address _to, uint256 _amount) returns (bool success); + + /// @notice Send `_amount` tokens to `_to` from `_from` on the condition it + /// is approved by `_from` + /// @param _from The address of the origin of the transfer + /// @param _to The address of the recipient + /// @param _amount The amount of tokens to be transferred + /// @return Whether the transfer was successful or not + function transferFrom(address _from, address _to, uint256 _amount) returns (bool success); + + /// @notice `msg.sender` approves `_spender` to spend `_amount` tokens on + /// its behalf + /// @param _spender The address of the account able to transfer the tokens + /// @param _amount The amount of tokens to be approved for transfer + /// @return Whether the approval was successful or not + function approve(address _spender, uint256 _amount) returns (bool success); + + /// @param _owner The address of the account owning tokens + /// @param _spender The address of the account able to transfer the tokens + /// @return Amount of remaining tokens of _owner that _spender is allowed + /// to spend + function allowance( + address _owner, + address _spender + ) constant returns (uint256 remaining); + + event Transfer(address indexed _from, address indexed _to, uint256 _amount); + event Approval( + address indexed _owner, + address indexed _spender, + uint256 _amount + ); +} + + +contract Token is TokenInterface { + // Protects users by preventing the execution of method calls that + // inadvertently also transferred ether + modifier noEther() {if (msg.value > 0) throw; _;} + + function balanceOf(address _owner) constant returns (uint256 balance) { + return balances[_owner]; + } + + function transfer(address _to, uint256 _amount) noEther returns (bool success) { + if (balances[msg.sender] >= _amount && _amount > 0) { + balances[msg.sender] -= _amount; + balances[_to] += _amount; + Transfer(msg.sender, _to, _amount); + return true; + } else { + return false; + } + } + + function transferFrom( + address _from, + address _to, + uint256 _amount + ) noEther returns (bool success) { + + if (balances[_from] >= _amount + && allowed[_from][msg.sender] >= _amount + && _amount > 0) { + + balances[_to] += _amount; + balances[_from] -= _amount; + allowed[_from][msg.sender] -= _amount; + Transfer(_from, _to, _amount); + return true; + } else { + return false; + } + } + + function approve(address _spender, uint256 _amount) returns (bool success) { + allowed[msg.sender][_spender] = _amount; + Approval(msg.sender, _spender, _amount); + return true; + } + + function allowance(address _owner, address _spender) constant returns (uint256 remaining) { + return allowed[_owner][_spender]; + } +} + + +/* +This file is part of the DAO. + +The DAO is free software: you can redistribute it and/or modify +it under the terms of the GNU lesser General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +The DAO is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU lesser General Public License for more details. + +You should have received a copy of the GNU lesser General Public License +along with the DAO. If not, see . +*/ + + +/* +Basic account, used by the DAO contract to separately manage both the rewards +and the extraBalance accounts. +*/ + +contract ManagedAccountInterface { + // The only address with permission to withdraw from this account + address public owner; + // If true, only the owner of the account can receive ether from it + bool public payOwnerOnly; + // The sum of ether (in wei) which has been sent to this contract + uint public accumulatedInput; + + /// @notice Sends `_amount` of wei to _recipient + /// @param _amount The amount of wei to send to `_recipient` + /// @param _recipient The address to receive `_amount` of wei + /// @return True if the send completed + function payOut(address _recipient, uint _amount) returns (bool); + + event PayOut(address indexed _recipient, uint _amount); +} + + +contract ManagedAccount is ManagedAccountInterface{ + + // The constructor sets the owner of the account + function ManagedAccount(address _owner, bool _payOwnerOnly) { + owner = _owner; + payOwnerOnly = _payOwnerOnly; + } + + // When the contract receives a transaction without data this is called. + // It counts the amount of ether it receives and stores it in + // accumulatedInput. + function() { + accumulatedInput += msg.value; + } + + function payOut(address _recipient, uint _amount) returns (bool) { + if (msg.sender != owner || msg.value > 0 || (payOwnerOnly && _recipient != owner)) + throw; + if (_recipient.call.value(_amount)()) { + PayOut(_recipient, _amount); + return true; + } else { + return false; + } + } +} +/* +This file is part of the DAO. + +The DAO is free software: you can redistribute it and/or modify +it under the terms of the GNU lesser General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +The DAO is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU lesser General Public License for more details. + +You should have received a copy of the GNU lesser General Public License +along with the DAO. If not, see . +*/ + + +/* + * Token Creation contract, used by the DAO to create its tokens and initialize + * its ether. Feel free to modify the divisor method to implement different + * Token Creation parameters +*/ + + +contract TokenCreationInterface { + + // End of token creation, in Unix time + uint public closingTime; + // Minimum fueling goal of the token creation, denominated in tokens to + // be created + uint public minTokensToCreate; + // True if the DAO reached its minimum fueling goal, false otherwise + bool public isFueled; + // For DAO splits - if privateCreation is 0, then it is a public token + // creation, otherwise only the address stored in privateCreation is + // allowed to create tokens + address public privateCreation; + // hold extra ether which has been sent after the DAO token + // creation rate has increased + ManagedAccount public extraBalance; + // tracks the amount of wei given from each contributor (used for refund) + mapping (address => uint256) weiGiven; + + /// @dev Constructor setting the minimum fueling goal and the + /// end of the Token Creation + /// @param _minTokensToCreate Minimum fueling goal in number of + /// Tokens to be created + /// @param _closingTime Date (in Unix time) of the end of the Token Creation + /// @param _privateCreation Zero means that the creation is public. A + /// non-zero address represents the only address that can create Tokens + /// (the address can also create Tokens on behalf of other accounts) + // This is the constructor: it can not be overloaded so it is commented out + // function TokenCreation( + // uint _minTokensTocreate, + // uint _closingTime, + // address _privateCreation + // ); + + /// @notice Create Token with `_tokenHolder` as the initial owner of the Token + /// @param _tokenHolder The address of the Tokens's recipient + /// @return Whether the token creation was successful + function createTokenProxy(address _tokenHolder) payable returns (bool success); + + /// @notice Refund `msg.sender` in the case the Token Creation did + /// not reach its minimum fueling goal + function refund(); + + /// @return The divisor used to calculate the token creation rate during + /// the creation phase + function divisor() constant returns (uint divisor); + + event FuelingToDate(uint value); + event CreatedToken(address indexed to, uint amount); + event Refund(address indexed to, uint value); +} + + +contract TokenCreation is TokenCreationInterface, Token { + function TokenCreation( + uint _minTokensToCreate, + uint _closingTime, + address _privateCreation) { + + closingTime = _closingTime; + minTokensToCreate = _minTokensToCreate; + privateCreation = _privateCreation; + extraBalance = new ManagedAccount(address(this), true); + } + + function createTokenProxy(address _tokenHolder) payable returns (bool success) { + if (now < closingTime && msg.value > 0 + && (privateCreation == 0 || privateCreation == msg.sender)) { + + uint token = (msg.value * 20) / divisor(); + extraBalance.call.value(msg.value - token)(); + balances[_tokenHolder] += token; + totalSupply += token; + weiGiven[_tokenHolder] += msg.value; + CreatedToken(_tokenHolder, token); + if (totalSupply >= minTokensToCreate && !isFueled) { + isFueled = true; + FuelingToDate(totalSupply); + } + return true; + } + throw; + } + + function refund() noEther { + if (now > closingTime && !isFueled) { + // Get extraBalance - will only succeed when called for the first time + if (extraBalance.balance >= extraBalance.accumulatedInput()) + extraBalance.payOut(address(this), extraBalance.accumulatedInput()); + + // Execute refund + if (msg.sender.call.value(weiGiven[msg.sender])()) { + Refund(msg.sender, weiGiven[msg.sender]); + totalSupply -= balances[msg.sender]; + balances[msg.sender] = 0; + weiGiven[msg.sender] = 0; + } + } + } + + function divisor() constant returns (uint divisor) { + // The number of (base unit) tokens per wei is calculated + // as `msg.value` * 20 / `divisor` + // The fueling period starts with a 1:1 ratio + if (closingTime - 2 weeks > now) { + return 20; + // Followed by 10 days with a daily creation rate increase of 5% + } else if (closingTime - 4 days > now) { + return (20 + (now - (closingTime - 2 weeks)) / (1 days)); + // The last 4 days there is a constant creation rate ratio of 1:1.5 + } else { + return 30; + } + } +} +/* +This file is part of the DAO. + +The DAO is free software: you can redistribute it and/or modify +it under the terms of the GNU lesser General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +The DAO is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU lesser General Public License for more details. + +You should have received a copy of the GNU lesser General Public License +along with the DAO. If not, see . +*/ + + +/* +Standard smart contract for a Decentralized Autonomous Organization (DAO) +to automate organizational governance and decision-making. +*/ + + +contract DAOInterface { + + // The amount of days for which people who try to participate in the + // creation by calling the fallback function will still get their ether back + uint constant creationGracePeriod = 40 days; + // The minimum debate period that a generic proposal can have + uint constant minProposalDebatePeriod = 2 weeks; + // The minimum debate period that a split proposal can have + uint constant minSplitDebatePeriod = 1 weeks; + // Period of days inside which it's possible to execute a DAO split + uint constant splitExecutionPeriod = 27 days; + // Period of time after which the minimum Quorum is halved + uint constant quorumHalvingPeriod = 25 weeks; + // Period after which a proposal is closed + // (used in the case `executeProposal` fails because it throws) + uint constant executeProposalPeriod = 10 days; + // Denotes the maximum proposal deposit that can be given. It is given as + // a fraction of total Ether spent plus balance of the DAO + uint constant maxDepositDivisor = 100; + + // Proposals to spend the DAO's ether or to choose a new Curator + Proposal[] public proposals; + // The quorum needed for each proposal is partially calculated by + // totalSupply / minQuorumDivisor + uint public minQuorumDivisor; + // The unix time of the last time quorum was reached on a proposal + uint public lastTimeMinQuorumMet; + + // Address of the curator + address public curator; + // The whitelist: List of addresses the DAO is allowed to send ether to + mapping (address => bool) public allowedRecipients; + + // Tracks the addresses that own Reward Tokens. Those addresses can only be + // DAOs that have split from the original DAO. Conceptually, Reward Tokens + // represent the proportion of the rewards that the DAO has the right to + // receive. These Reward Tokens are generated when the DAO spends ether. + mapping (address => uint) public rewardToken; + // Total supply of rewardToken + uint public totalRewardToken; + + // The account used to manage the rewards which are to be distributed to the + // DAO Token Holders of this DAO + ManagedAccount public rewardAccount; + + // The account used to manage the rewards which are to be distributed to + // any DAO that holds Reward Tokens + ManagedAccount public DAOrewardAccount; + + // Amount of rewards (in wei) already paid out to a certain DAO + mapping (address => uint) public DAOpaidOut; + + // Amount of rewards (in wei) already paid out to a certain address + mapping (address => uint) public paidOut; + // Map of addresses blocked during a vote (not allowed to transfer DAO + // tokens). The address points to the proposal ID. + mapping (address => uint) public blocked; + + // The minimum deposit (in wei) required to submit any proposal that is not + // requesting a new Curator (no deposit is required for splits) + uint public proposalDeposit; + + // the accumulated sum of all current proposal deposits + uint sumOfProposalDeposits; + + // Contract that is able to create a new DAO (with the same code as + // this one), used for splits + DAO_Creator public daoCreator; + + // A proposal with `newCurator == false` represents a transaction + // to be issued by this DAO + // A proposal with `newCurator == true` represents a DAO split + struct Proposal { + // The address where the `amount` will go to if the proposal is accepted + // or if `newCurator` is true, the proposed Curator of + // the new DAO). + address recipient; + // The amount to transfer to `recipient` if the proposal is accepted. + uint amount; + // A plain text description of the proposal + string description; + // A unix timestamp, denoting the end of the voting period + uint votingDeadline; + // True if the proposal's votes have yet to be counted, otherwise False + bool open; + // True if quorum has been reached, the votes have been counted, and + // the majority said yes + bool proposalPassed; + // A hash to check validity of a proposal + bytes32 proposalHash; + // Deposit in wei the creator added when submitting their proposal. It + // is taken from the msg.value of a newProposal call. + uint proposalDeposit; + // True if this proposal is to assign a new Curator + bool newCurator; + // Data needed for splitting the DAO + + SplitData[][] splitData2; + SplitData[] splitData; + // Number of Tokens in favor of the proposal + uint yea; + // Number of Tokens opposed to the proposal + uint nay; + // Simple mapping to check if a shareholder has voted for it + mapping (address => bool) votedYes; + // Simple mapping to check if a shareholder has voted against it + mapping (address => bool) votedNo; + // Address of the shareholder who created the proposal + address creator; + } + + // Used only in the case of a newCurator proposal. + struct SplitData { + // The balance of the current DAO minus the deposit at the time of split + uint splitBalance; + // The total amount of DAO Tokens in existence at the time of split. + uint totalSupply; + // Amount of Reward Tokens owned by the DAO at the time of split. + uint rewardToken; + // The new DAO contract created at the time of split. + DAO newDAO; + } + + // Used to restrict access to certain functions to only DAO Token Holders + modifier onlyTokenholders {_;} + + /// @dev Constructor setting the Curator and the address + /// for the contract able to create another DAO as well as the parameters + /// for the DAO Token Creation + /// @param _curator The Curator + /// @param _daoCreator The contract able to (re)create this DAO + /// @param _proposalDeposit The deposit to be paid for a regular proposal + /// @param _minTokensToCreate Minimum required wei-equivalent tokens + /// to be created for a successful DAO Token Creation + /// @param _closingTime Date (in Unix time) of the end of the DAO Token Creation + /// @param _privateCreation If zero the DAO Token Creation is open to public, a + /// non-zero address means that the DAO Token Creation is only for the address + // This is the constructor: it can not be overloaded so it is commented out + // function DAO( + // address _curator, + // DAO_Creator _daoCreator, + // uint _proposalDeposit, + // uint _minTokensToCreate, + // uint _closingTime, + // address _privateCreation + // ); + + /// @notice Create Token with `msg.sender` as the beneficiary + /// @return Whether the token creation was successful + function (); + + + /// @dev This function is used to send ether back + /// to the DAO, it can also be used to receive payments that should not be + /// counted as rewards (donations, grants, etc.) + /// @return Whether the DAO received the ether successfully + function receiveEther() returns(bool); + + /// @notice `msg.sender` creates a proposal to send `_amount` Wei to + /// `_recipient` with the transaction data `_transactionData`. If + /// `_newCurator` is true, then this is a proposal that splits the + /// DAO and sets `_recipient` as the new DAO's Curator. + /// @param _recipient Address of the recipient of the proposed transaction + /// @param _amount Amount of wei to be sent with the proposed transaction + /// @param _description String describing the proposal + /// @param _transactionData Data of the proposed transaction + /// @param _debatingPeriod Time used for debating a proposal, at least 2 + /// weeks for a regular proposal, 10 days for new Curator proposal + /// @param _newCurator Bool defining whether this proposal is about + /// a new Curator or not + /// @return The proposal ID. Needed for voting on the proposal + function newProposal( + address _recipient, + uint _amount, + string _description, + bytes _transactionData, + uint _debatingPeriod, + bool _newCurator + ) onlyTokenholders returns (uint _proposalID); + + /// @notice Check that the proposal with the ID `_proposalID` matches the + /// transaction which sends `_amount` with data `_transactionData` + /// to `_recipient` + /// @param _proposalID The proposal ID + /// @param _recipient The recipient of the proposed transaction + /// @param _amount The amount of wei to be sent in the proposed transaction + /// @param _transactionData The data of the proposed transaction + /// @return Whether the proposal ID matches the transaction data or not + function checkProposalCode( + uint _proposalID, + address _recipient, + uint _amount, + bytes _transactionData + ) constant returns (bool _codeChecksOut); + + /// @notice Vote on proposal `_proposalID` with `_supportsProposal` + /// @param _proposalID The proposal ID + /// @param _supportsProposal Yes/No - support of the proposal + /// @return The vote ID. + function vote( + uint _proposalID, + bool _supportsProposal + ) onlyTokenholders returns (uint _voteID); + + /// @notice Checks whether proposal `_proposalID` with transaction data + /// `_transactionData` has been voted for or rejected, and executes the + /// transaction in the case it has been voted for. + /// @param _proposalID The proposal ID + /// @param _transactionData The data of the proposed transaction + /// @return Whether the proposed transaction has been executed or not + function executeProposal( + uint _proposalID, + bytes _transactionData + ) returns (bool _success); + + /// @notice ATTENTION! I confirm to move my remaining ether to a new DAO + /// with `_newCurator` as the new Curator, as has been + /// proposed in proposal `_proposalID`. This will burn my tokens. This can + /// not be undone and will split the DAO into two DAO's, with two + /// different underlying tokens. + /// @param _proposalID The proposal ID + /// @param _newCurator The new Curator of the new DAO + /// @dev This function, when called for the first time for this proposal, + /// will create a new DAO and send the sender's portion of the remaining + /// ether and Reward Tokens to the new DAO. It will also burn the DAO Tokens + /// of the sender. + function splitDAO( + uint _proposalID, + address _newCurator + ) returns (bool _success); + + /// @dev can only be called by the DAO itself through a proposal + /// updates the contract of the DAO by sending all ether and rewardTokens + /// to the new DAO. The new DAO needs to be approved by the Curator + /// @param _newContract the address of the new contract + function newContract(address _newContract); + + + /// @notice Add a new possible recipient `_recipient` to the whitelist so + /// that the DAO can send transactions to them (using proposals) + /// @param _recipient New recipient address + /// @dev Can only be called by the current Curator + /// @return Whether successful or not + function changeAllowedRecipients(address _recipient, bool _allowed) external returns (bool _success); + + + /// @notice Change the minimum deposit required to submit a proposal + /// @param _proposalDeposit The new proposal deposit + /// @dev Can only be called by this DAO (through proposals with the + /// recipient being this DAO itself) + function changeProposalDeposit(uint _proposalDeposit) external; + + /// @notice Move rewards from the DAORewards managed account + /// @param _toMembers If true rewards are moved to the actual reward account + /// for the DAO. If not then it's moved to the DAO itself + /// @return Whether the call was successful + function retrieveDAOReward(bool _toMembers) external returns (bool _success); + + /// @notice Get my portion of the reward that was sent to `rewardAccount` + /// @return Whether the call was successful + function getMyReward() returns(bool _success); + + /// @notice Withdraw `_account`'s portion of the reward from `rewardAccount` + /// to `_account`'s balance + /// @return Whether the call was successful + function withdrawRewardFor(address _account) internal returns (bool _success); + + /// @notice Send `_amount` tokens to `_to` from `msg.sender`. Prior to this + /// getMyReward() is called. + /// @param _to The address of the recipient + /// @param _amount The amount of tokens to be transfered + /// @return Whether the transfer was successful or not + function transferWithoutReward(address _to, uint256 _amount) returns (bool success); + + /// @notice Send `_amount` tokens to `_to` from `_from` on the condition it + /// is approved by `_from`. Prior to this getMyReward() is called. + /// @param _from The address of the sender + /// @param _to The address of the recipient + /// @param _amount The amount of tokens to be transfered + /// @return Whether the transfer was successful or not + function transferFromWithoutReward( + address _from, + address _to, + uint256 _amount + ) returns (bool success); + + /// @notice Doubles the 'minQuorumDivisor' in the case quorum has not been + /// achieved in 52 weeks + /// @return Whether the change was successful or not + function halveMinQuorum() returns (bool _success); + + /// @return total number of proposals ever created + function numberOfProposals() constant returns (uint _numberOfProposals); + + /// @param _proposalID Id of the new curator proposal + /// @return Address of the new DAO + function getNewDAOAddress(uint _proposalID) constant returns (address _newDAO); + + /// @param _account The address of the account which is checked. + /// @return Whether the account is blocked (not allowed to transfer tokens) or not. + function isBlocked(address _account) internal returns (bool); + + /// @notice If the caller is blocked by a proposal whose voting deadline + /// has exprired then unblock him. + /// @return Whether the account is blocked (not allowed to transfer tokens) or not. + function unblockMe() returns (bool); + + event ProposalAdded( + uint indexed proposalID, + address recipient, + uint amount, + bool newCurator, + string description + ); + event Voted(uint indexed proposalID, bool position, address indexed voter); + event ProposalTallied(uint indexed proposalID, bool result, uint quorum); + event NewCurator(address indexed _newCurator); + event AllowedRecipientChanged(address indexed _recipient, bool _allowed); +} + +// The DAO contract itself +contract DAO is DAOInterface, Token, TokenCreation { + + // Modifier that allows only shareholders to vote and create new proposals + modifier onlyTokenholders { + if (balanceOf(msg.sender) == 0) throw; + _; + } + + function DAO( + address _curator, + DAO_Creator _daoCreator, + uint _proposalDeposit, + uint _minTokensToCreate, + uint _closingTime, + address _privateCreation + ) TokenCreation(_minTokensToCreate, _closingTime, _privateCreation) { + + curator = _curator; + daoCreator = _daoCreator; + proposalDeposit = _proposalDeposit; + rewardAccount = new ManagedAccount(address(this), false); + DAOrewardAccount = new ManagedAccount(address(this), false); + if (address(rewardAccount) == 0) + throw; + if (address(DAOrewardAccount) == 0) + throw; + lastTimeMinQuorumMet = now; + minQuorumDivisor = 5; // sets the minimal quorum to 20% + proposals.length = 1; // avoids a proposal with ID 0 because it is used + + allowedRecipients[address(this)] = true; + allowedRecipients[curator] = true; + } + + function () { +/* if (now < closingTime + creationGracePeriod && msg.sender != address(extraBalance)) + return createTokenProxy(msg.sender); + else + return receiveEther();*/ + } + + + function receiveEther() returns (bool) { + return true; + } + + + function newProposal( + address _recipient, + uint _amount, + string _description, + bytes _transactionData, + uint _debatingPeriod, + bool _newCurator + ) onlyTokenholders returns (uint _proposalID) { + + // Sanity check + if (_newCurator && ( + _amount != 0 + || _transactionData.length != 0 + || _recipient == curator + || msg.value > 0 + || _debatingPeriod < minSplitDebatePeriod)) { + throw; + } else if ( + !_newCurator + && (!isRecipientAllowed(_recipient) || (_debatingPeriod < minProposalDebatePeriod)) + ) { + throw; + } + + if (_debatingPeriod > 8 weeks) + throw; + + if (!isFueled + || now < closingTime + || (msg.value < proposalDeposit && !_newCurator)) { + + throw; + } + + if (now + _debatingPeriod < now) // prevents overflow + throw; + + // to prevent a 51% attacker to convert the ether into deposit + if (msg.sender == address(this)) + throw; + + _proposalID = proposals.length++; + Proposal p = proposals[_proposalID]; + p.recipient = _recipient; + p.amount = _amount; + p.description = _description; + p.proposalHash = sha3(_recipient, _amount, _transactionData); + p.votingDeadline = now + _debatingPeriod; + p.open = true; + //p.proposalPassed = False; // that's default + p.newCurator = _newCurator; + if (_newCurator) + p.splitData.length++; + p.creator = msg.sender; + p.proposalDeposit = msg.value; + + sumOfProposalDeposits += msg.value; + + ProposalAdded( + _proposalID, + _recipient, + _amount, + _newCurator, + _description + ); + } + + + function checkProposalCode( + uint _proposalID, + address _recipient, + uint _amount, + bytes _transactionData + ) noEther constant returns (bool _codeChecksOut) { + Proposal p = proposals[_proposalID]; + return p.proposalHash == sha3(_recipient, _amount, _transactionData); + } + + + function vote( + uint _proposalID, + bool _supportsProposal + ) onlyTokenholders noEther returns (uint _voteID) { + + Proposal p = proposals[_proposalID]; + if (p.votedYes[msg.sender] + || p.votedNo[msg.sender] + || now >= p.votingDeadline) { + + throw; + } + + if (_supportsProposal) { + p.yea += balances[msg.sender]; + p.votedYes[msg.sender] = true; + } else { + p.nay += balances[msg.sender]; + p.votedNo[msg.sender] = true; + } + + if (blocked[msg.sender] == 0) { + blocked[msg.sender] = _proposalID; + } else if (p.votingDeadline > proposals[blocked[msg.sender]].votingDeadline) { + // this proposal's voting deadline is further into the future than + // the proposal that blocks the sender so make it the blocker + blocked[msg.sender] = _proposalID; + } + + Voted(_proposalID, _supportsProposal, msg.sender); + } + + + function executeProposal( + uint _proposalID, + bytes _transactionData + ) noEther returns (bool _success) { + + Proposal p = proposals[_proposalID]; + + uint waitPeriod = p.newCurator + ? splitExecutionPeriod + : executeProposalPeriod; + // If we are over deadline and waiting period, assert proposal is closed + if (p.open && now > p.votingDeadline + waitPeriod) { + closeProposal(_proposalID); + return; + } + + // Check if the proposal can be executed + if (now < p.votingDeadline // has the voting deadline arrived? + // Have the votes been counted? + || !p.open + // Does the transaction code match the proposal? + || p.proposalHash != sha3(p.recipient, p.amount, _transactionData)) { + + throw; + } + + // If the curator removed the recipient from the whitelist, close the proposal + // in order to free the deposit and allow unblocking of voters + if (!isRecipientAllowed(p.recipient)) { + closeProposal(_proposalID); + p.creator.send(p.proposalDeposit); + return; + } + + bool proposalCheck = true; + + if (p.amount > actualBalance()) + proposalCheck = false; + + uint quorum = p.yea + p.nay; + + // require 53% for calling newContract() + if (_transactionData.length >= 4 && _transactionData[0] == 0x68 + && _transactionData[1] == 0x37 && _transactionData[2] == 0xff + && _transactionData[3] == 0x1e + && quorum < minQuorum(actualBalance() + rewardToken[address(this)])) { + + proposalCheck = false; + } + + if (quorum >= minQuorum(p.amount)) { + if (!p.creator.send(p.proposalDeposit)) + throw; + + lastTimeMinQuorumMet = now; + // set the minQuorum to 20% again, in the case it has been reached + if (quorum > totalSupply / 5) + minQuorumDivisor = 5; + } + + // Execute result + if (quorum >= minQuorum(p.amount) && p.yea > p.nay && proposalCheck) { + if (!p.recipient.call.value(p.amount)(_transactionData)) + throw; + + p.proposalPassed = true; + _success = true; + + // only create reward tokens when ether is not sent to the DAO itself and + // related addresses. Proxy addresses should be forbidden by the curator. + if (p.recipient != address(this) && p.recipient != address(rewardAccount) + && p.recipient != address(DAOrewardAccount) + && p.recipient != address(extraBalance) + && p.recipient != address(curator)) { + + rewardToken[address(this)] += p.amount; + totalRewardToken += p.amount; + } + } + + closeProposal(_proposalID); + + // Initiate event + ProposalTallied(_proposalID, _success, quorum); + } + + + function closeProposal(uint _proposalID) internal { + Proposal p = proposals[_proposalID]; + if (p.open) + sumOfProposalDeposits -= p.proposalDeposit; + p.open = false; + } + + function splitDAO( + uint _proposalID, + address _newCurator + ) noEther onlyTokenholders returns (bool _success) { + + Proposal p = proposals[_proposalID]; + + // Sanity check + + if (now < p.votingDeadline // has the voting deadline arrived? + //The request for a split expires XX days after the voting deadline + || now > p.votingDeadline + splitExecutionPeriod + // Does the new Curator address match? + || p.recipient != _newCurator + // Is it a new curator proposal? + || !p.newCurator + // Have you voted for this split? + || !p.votedYes[msg.sender] + // Did you already vote on another proposal? + || (blocked[msg.sender] != _proposalID && blocked[msg.sender] != 0) ) { + + throw; + } + + // If the new DAO doesn't exist yet, create the new DAO and store the + // current split data + if (address(p.splitData[0].newDAO) == 0) { + p.splitData[0].newDAO = createNewDAO(_newCurator); + // Call depth limit reached, etc. + if (address(p.splitData[0].newDAO) == 0) + throw; + // should never happen + if (this.balance < sumOfProposalDeposits) + throw; + p.splitData[0].splitBalance = actualBalance(); + p.splitData[0].rewardToken = rewardToken[address(this)]; + p.splitData[0].totalSupply = totalSupply; + p.proposalPassed = true; + } + + // Move ether and assign new Tokens + uint fundsToBeMoved = + (balances[msg.sender] * p.splitData[0].splitBalance) / + p.splitData[0].totalSupply; + if (p.splitData[0].newDAO.createTokenProxy.value(fundsToBeMoved)(msg.sender) == false) + throw; + + + // Assign reward rights to new DAO + uint rewardTokenToBeMoved = + (balances[msg.sender] * p.splitData[0].rewardToken) / + p.splitData[0].totalSupply; + + uint paidOutToBeMoved = DAOpaidOut[address(this)] * rewardTokenToBeMoved / + rewardToken[address(this)]; + + rewardToken[address(p.splitData[0].newDAO)] += rewardTokenToBeMoved; + if (rewardToken[address(this)] < rewardTokenToBeMoved) + throw; + rewardToken[address(this)] -= rewardTokenToBeMoved; + + DAOpaidOut[address(p.splitData[0].newDAO)] += paidOutToBeMoved; + if (DAOpaidOut[address(this)] < paidOutToBeMoved) + throw; + DAOpaidOut[address(this)] -= paidOutToBeMoved; + + // Burn DAO Tokens + Transfer(msg.sender, 0, balances[msg.sender]); + withdrawRewardFor(msg.sender); // be nice, and get his rewards + totalSupply -= balances[msg.sender]; + balances[msg.sender] = 0; + paidOut[msg.sender] = 0; + return true; + } + + function newContract(address _newContract){ + if (msg.sender != address(this) || !allowedRecipients[_newContract]) return; + // move all ether + if (!_newContract.call.value(address(this).balance)()) { + throw; + } + + //move all reward tokens + rewardToken[_newContract] += rewardToken[address(this)]; + rewardToken[address(this)] = 0; + DAOpaidOut[_newContract] += DAOpaidOut[address(this)]; + DAOpaidOut[address(this)] = 0; + } + + + function retrieveDAOReward(bool _toMembers) external noEther returns (bool _success) { + DAO dao = DAO(msg.sender); + + if ((rewardToken[msg.sender] * DAOrewardAccount.accumulatedInput()) / + totalRewardToken < DAOpaidOut[msg.sender]) + throw; + + uint reward = + (rewardToken[msg.sender] * DAOrewardAccount.accumulatedInput()) / + totalRewardToken - DAOpaidOut[msg.sender]; + if(_toMembers) { + if (!DAOrewardAccount.payOut(dao.rewardAccount(), reward)) + throw; + } + else { + if (!DAOrewardAccount.payOut(dao, reward)) + throw; + } + DAOpaidOut[msg.sender] += reward; + return true; + } + + function getMyReward() noEther returns (bool _success) { + return withdrawRewardFor(msg.sender); + } + + + function withdrawRewardFor(address _account) noEther internal returns (bool _success) { + if ((balanceOf(_account) * rewardAccount.accumulatedInput()) / totalSupply < paidOut[_account]) + throw; + + uint reward = + (balanceOf(_account) * rewardAccount.accumulatedInput()) / totalSupply - paidOut[_account]; + if (!rewardAccount.payOut(_account, reward)) + throw; + paidOut[_account] += reward; + return true; + } + + + function transfer(address _to, uint256 _value) returns (bool success) { + if (isFueled + && now > closingTime + && !isBlocked(msg.sender) + && transferPaidOut(msg.sender, _to, _value) + && super.transfer(_to, _value)) { + + return true; + } else { + throw; + } + } + + + function transferWithoutReward(address _to, uint256 _value) returns (bool success) { + if (!getMyReward()) + throw; + return transfer(_to, _value); + } + + + function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { + if (isFueled + && now > closingTime + && !isBlocked(_from) + && transferPaidOut(_from, _to, _value) + && super.transferFrom(_from, _to, _value)) { + + return true; + } else { + throw; + } + } + + + function transferFromWithoutReward( + address _from, + address _to, + uint256 _value + ) returns (bool success) { + + if (!withdrawRewardFor(_from)) + throw; + return transferFrom(_from, _to, _value); + } + + + function transferPaidOut( + address _from, + address _to, + uint256 _value + ) internal returns (bool success) { + + uint transferPaidOut = paidOut[_from] * _value / balanceOf(_from); + if (transferPaidOut > paidOut[_from]) + throw; + paidOut[_from] -= transferPaidOut; + paidOut[_to] += transferPaidOut; + return true; + } + + + function changeProposalDeposit(uint _proposalDeposit) noEther external { + if (msg.sender != address(this) || _proposalDeposit > (actualBalance() + rewardToken[address(this)]) + / maxDepositDivisor) { + + throw; + } + proposalDeposit = _proposalDeposit; + } + + + function changeAllowedRecipients(address _recipient, bool _allowed) noEther external returns (bool _success) { + if (msg.sender != curator) + throw; + allowedRecipients[_recipient] = _allowed; + AllowedRecipientChanged(_recipient, _allowed); + return true; + } + + + function isRecipientAllowed(address _recipient) internal returns (bool _isAllowed) { + if (allowedRecipients[_recipient] + || (_recipient == address(extraBalance) + // only allowed when at least the amount held in the + // extraBalance account has been spent from the DAO + && totalRewardToken > extraBalance.accumulatedInput())) + return true; + else + return false; + } + + function actualBalance() constant returns (uint _actualBalance) { + return this.balance - sumOfProposalDeposits; + } + + + function minQuorum(uint _value) internal constant returns (uint _minQuorum) { + // minimum of 20% and maximum of 53.33% + return totalSupply / minQuorumDivisor + + (_value * totalSupply) / (3 * (actualBalance() + rewardToken[address(this)])); + } + + + function halveMinQuorum() returns (bool _success) { + // this can only be called after `quorumHalvingPeriod` has passed or at anytime + // by the curator with a delay of at least `minProposalDebatePeriod` between the calls + if ((lastTimeMinQuorumMet < (now - quorumHalvingPeriod) || msg.sender == curator) + && lastTimeMinQuorumMet < (now - minProposalDebatePeriod)) { + lastTimeMinQuorumMet = now; + minQuorumDivisor *= 2; + return true; + } else { + return false; + } + } + + function createNewDAO(address _newCurator) internal returns (DAO _newDAO) { + NewCurator(_newCurator); + return daoCreator.createDAO(_newCurator, 0, 0, now + splitExecutionPeriod); + } + + function numberOfProposals() constant returns (uint _numberOfProposals) { + // Don't count index 0. It's used by isBlocked() and exists from start + return proposals.length - 1; + } + + function getNewDAOAddress(uint _proposalID) constant returns (address _newDAO) { + return proposals[_proposalID].splitData[0].newDAO; + } + + function isBlocked(address _account) internal returns (bool) { + if (blocked[_account] == 0) + return false; + Proposal p = proposals[blocked[_account]]; + if (now > p.votingDeadline) { + blocked[_account] = 0; + return false; + } else { + return true; + } + } + + function unblockMe() returns (bool) { + return isBlocked(msg.sender); + } +} + +contract DAO_Creator { + function createDAO( + address _curator, + uint _proposalDeposit, + uint _minTokensToCreate, + uint _closingTime + ) returns (DAO _newDAO) { + + return new DAO( + _curator, + DAO_Creator(this), + _proposalDeposit, + _minTokensToCreate, + _closingTime, + msg.sender + ); + } +} diff --git a/tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol.0.4.25.ReentrancyReadBeforeWritten.json b/tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol.0.4.25.ReentrancyReadBeforeWritten.json new file mode 100644 index 0000000000..6488984cac --- /dev/null +++ b/tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol.0.4.25.ReentrancyReadBeforeWritten.json @@ -0,0 +1,27667 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "retrieveDAOReward", + "source_mapping": { + "start": 39505, + "length": 735, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "retrieveDAOReward(bool)" + } + }, + { + "type": "node", + "name": "reward = (rewardToken[msg.sender] * DAOrewardAccount.accumulatedInput()) / totalRewardToken - DAOpaidOut[msg.sender]", + "source_mapping": { + "start": 39789, + "length": 145, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1044, + 1045, + 1046 + ], + "starting_column": 9, + "ending_column": 54 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "retrieveDAOReward", + "source_mapping": { + "start": 39505, + "length": 735, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "retrieveDAOReward(bool)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "! DAOrewardAccount.payOut(dao.rewardAccount(),reward)", + "source_mapping": { + "start": 39977, + "length": 53, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1048 + ], + "starting_column": 17, + "ending_column": 70 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "retrieveDAOReward", + "source_mapping": { + "start": 39505, + "length": 735, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "retrieveDAOReward(bool)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "! DAOrewardAccount.payOut(dao,reward)", + "source_mapping": { + "start": 40100, + "length": 37, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1052 + ], + "starting_column": 17, + "ending_column": 54 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "retrieveDAOReward", + "source_mapping": { + "start": 39505, + "length": 735, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "retrieveDAOReward(bool)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "DAOpaidOut[msg.sender] += reward", + "source_mapping": { + "start": 40180, + "length": 32, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1055 + ], + "starting_column": 9, + "ending_column": 41 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "retrieveDAOReward", + "source_mapping": { + "start": 39505, + "length": 735, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "retrieveDAOReward(bool)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "DAOpaidOut" + } + } + ], + "description": "Reentrancy in DAO.retrieveDAOReward(bool) (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1037-1057):\n\tExternal calls:\n\t- reward = (rewardToken[msg.sender] * DAOrewardAccount.accumulatedInput()) / totalRewardToken - DAOpaidOut[msg.sender] (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1044-1046)\n\t- ! DAOrewardAccount.payOut(dao.rewardAccount(),reward) (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1048)\n\t- ! DAOrewardAccount.payOut(dao,reward) (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1052)\n\tState variables written after the call(s):\n\t- DAOpaidOut[msg.sender] += reward (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1055)\n", + "markdown": "Reentrancy in [DAO.retrieveDAOReward(bool)](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1037-L1057):\n\tExternal calls:\n\t- [reward = (rewardToken[msg.sender] * DAOrewardAccount.accumulatedInput()) / totalRewardToken - DAOpaidOut[msg.sender]](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1044-L1046)\n\t- [! DAOrewardAccount.payOut(dao.rewardAccount(),reward)](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1048)\n\t- [! DAOrewardAccount.payOut(dao,reward)](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1052)\n\tState variables written after the call(s):\n\t- [DAOpaidOut[msg.sender] += reward](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1055)\n", + "id": "f4fcbe9e693a60538ed19ff7c298fa578309af52604f3265bac4254b82e45d8f", + "check": "reentrancy-no-eth", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "splitDAO", + "source_mapping": { + "start": 36148, + "length": 2849, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "splitDAO(uint256,address)" + } + }, + { + "type": "node", + "name": "p.splitData[0].newDAO = createNewDAO(_newCurator)", + "source_mapping": { + "start": 37159, + "length": 49, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 974 + ], + "starting_column": 13, + "ending_column": 62 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "splitDAO", + "source_mapping": { + "start": 36148, + "length": 2849, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "splitDAO(uint256,address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "daoCreator.createDAO(_newCurator,0,0,now + splitExecutionPeriod)", + "source_mapping": { + "start": 44544, + "length": 74, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1196 + ], + "starting_column": 9, + "ending_column": 83 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "createNewDAO", + "source_mapping": { + "start": 44427, + "length": 198, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1194, + 1195, + 1196, + 1197 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "createNewDAO(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "p.splitData[0].splitBalance = actualBalance()", + "source_mapping": { + "start": 37456, + "length": 45, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 981 + ], + "starting_column": 13, + "ending_column": 58 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "splitDAO", + "source_mapping": { + "start": 36148, + "length": 2849, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "splitDAO(uint256,address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "proposals" + } + }, + { + "type": "node", + "name": "p.splitData[0].rewardToken = rewardToken[address(this)]", + "source_mapping": { + "start": 37515, + "length": 55, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 982 + ], + "starting_column": 13, + "ending_column": 68 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "splitDAO", + "source_mapping": { + "start": 36148, + "length": 2849, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "splitDAO(uint256,address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "proposals" + } + }, + { + "type": "node", + "name": "p.splitData[0].totalSupply = totalSupply", + "source_mapping": { + "start": 37584, + "length": 40, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 983 + ], + "starting_column": 13, + "ending_column": 53 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "splitDAO", + "source_mapping": { + "start": 36148, + "length": 2849, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "splitDAO(uint256,address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "proposals" + } + }, + { + "type": "node", + "name": "p.proposalPassed = true", + "source_mapping": { + "start": 37638, + "length": 23, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 984 + ], + "starting_column": 13, + "ending_column": 36 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "splitDAO", + "source_mapping": { + "start": 36148, + "length": 2849, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "splitDAO(uint256,address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "proposals" + } + } + ], + "description": "Reentrancy in DAO.splitDAO(uint256,address) (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#947-1020):\n\tExternal calls:\n\t- p.splitData[0].newDAO = createNewDAO(_newCurator) (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#974)\n\t\t- daoCreator.createDAO(_newCurator,0,0,now + splitExecutionPeriod) (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1196)\n\tState variables written after the call(s):\n\t- p.splitData[0].splitBalance = actualBalance() (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#981)\n\t- p.splitData[0].rewardToken = rewardToken[address(this)] (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#982)\n\t- p.splitData[0].totalSupply = totalSupply (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#983)\n\t- p.proposalPassed = true (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#984)\n", + "markdown": "Reentrancy in [DAO.splitDAO(uint256,address)](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L947-L1020):\n\tExternal calls:\n\t- [p.splitData[0].newDAO = createNewDAO(_newCurator)](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L974)\n\t\t- [daoCreator.createDAO(_newCurator,0,0,now + splitExecutionPeriod)](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1196)\n\tState variables written after the call(s):\n\t- [p.splitData[0].splitBalance = actualBalance()](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L981)\n\t- [p.splitData[0].rewardToken = rewardToken[address(this)]](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L982)\n\t- [p.splitData[0].totalSupply = totalSupply](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L983)\n\t- [p.proposalPassed = true](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L984)\n", + "id": "ca170302627c298d8230a6d9f9cae19a84c58325d2df49a6ef15a0b17208bf00", + "check": "reentrancy-no-eth", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "splitDAO", + "source_mapping": { + "start": 36148, + "length": 2849, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "splitDAO(uint256,address)" + } + }, + { + "type": "node", + "name": "p.splitData[0].newDAO = createNewDAO(_newCurator)", + "source_mapping": { + "start": 37159, + "length": 49, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 974 + ], + "starting_column": 13, + "ending_column": 62 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "splitDAO", + "source_mapping": { + "start": 36148, + "length": 2849, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "splitDAO(uint256,address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "daoCreator.createDAO(_newCurator,0,0,now + splitExecutionPeriod)", + "source_mapping": { + "start": 44544, + "length": 74, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1196 + ], + "starting_column": 9, + "ending_column": 83 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "createNewDAO", + "source_mapping": { + "start": 44427, + "length": 198, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1194, + 1195, + 1196, + 1197 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "createNewDAO(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "withdrawRewardFor(msg.sender)", + "source_mapping": { + "start": 38796, + "length": 29, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1015 + ], + "starting_column": 9, + "ending_column": 38 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "splitDAO", + "source_mapping": { + "start": 36148, + "length": 2849, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "splitDAO(uint256,address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "(balanceOf(_account) * rewardAccount.accumulatedInput()) / totalSupply < paidOut[_account]", + "source_mapping": { + "start": 40461, + "length": 90, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1065 + ], + "starting_column": 13, + "ending_column": 103 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdrawRewardFor", + "source_mapping": { + "start": 40361, + "length": 473, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdrawRewardFor(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "reward = (balanceOf(_account) * rewardAccount.accumulatedInput()) / totalSupply - paidOut[_account]", + "source_mapping": { + "start": 40581, + "length": 116, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1068, + 1069 + ], + "starting_column": 9, + "ending_column": 103 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdrawRewardFor", + "source_mapping": { + "start": 40361, + "length": 473, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdrawRewardFor(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "! rewardAccount.payOut(_account,reward)", + "source_mapping": { + "start": 40711, + "length": 39, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1070 + ], + "starting_column": 13, + "ending_column": 52 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdrawRewardFor", + "source_mapping": { + "start": 40361, + "length": 473, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdrawRewardFor(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "balances[msg.sender] = 0", + "source_mapping": { + "start": 38912, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1017 + ], + "starting_column": 9, + "ending_column": 33 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "splitDAO", + "source_mapping": { + "start": 36148, + "length": 2849, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "splitDAO(uint256,address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "balances" + } + }, + { + "type": "node", + "name": "paidOut[msg.sender] = 0", + "source_mapping": { + "start": 38946, + "length": 23, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1018 + ], + "starting_column": 9, + "ending_column": 32 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "splitDAO", + "source_mapping": { + "start": 36148, + "length": 2849, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "splitDAO(uint256,address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "paidOut" + } + }, + { + "type": "node", + "name": "totalSupply -= balances[msg.sender]", + "source_mapping": { + "start": 38867, + "length": 35, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1016 + ], + "starting_column": 9, + "ending_column": 44 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "splitDAO", + "source_mapping": { + "start": 36148, + "length": 2849, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "splitDAO(uint256,address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "totalSupply" + } + } + ], + "description": "Reentrancy in DAO.splitDAO(uint256,address) (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#947-1020):\n\tExternal calls:\n\t- p.splitData[0].newDAO = createNewDAO(_newCurator) (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#974)\n\t\t- daoCreator.createDAO(_newCurator,0,0,now + splitExecutionPeriod) (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1196)\n\t- withdrawRewardFor(msg.sender) (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1015)\n\t\t- (balanceOf(_account) * rewardAccount.accumulatedInput()) / totalSupply < paidOut[_account] (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1065)\n\t\t- reward = (balanceOf(_account) * rewardAccount.accumulatedInput()) / totalSupply - paidOut[_account] (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1068-1069)\n\t\t- ! rewardAccount.payOut(_account,reward) (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1070)\n\tState variables written after the call(s):\n\t- balances[msg.sender] = 0 (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1017)\n\t- paidOut[msg.sender] = 0 (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1018)\n\t- totalSupply -= balances[msg.sender] (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1016)\n", + "markdown": "Reentrancy in [DAO.splitDAO(uint256,address)](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L947-L1020):\n\tExternal calls:\n\t- [p.splitData[0].newDAO = createNewDAO(_newCurator)](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L974)\n\t\t- [daoCreator.createDAO(_newCurator,0,0,now + splitExecutionPeriod)](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1196)\n\t- [withdrawRewardFor(msg.sender)](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1015)\n\t\t- [(balanceOf(_account) * rewardAccount.accumulatedInput()) / totalSupply < paidOut[_account]](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1065)\n\t\t- [reward = (balanceOf(_account) * rewardAccount.accumulatedInput()) / totalSupply - paidOut[_account]](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1068-L1069)\n\t\t- [! rewardAccount.payOut(_account,reward)](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1070)\n\tState variables written after the call(s):\n\t- [balances[msg.sender] = 0](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1017)\n\t- [paidOut[msg.sender] = 0](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1018)\n\t- [totalSupply -= balances[msg.sender]](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1016)\n", + "id": "4ce8b483e6c9e8e2bbc854d3ff7713e20404b0be5e7cc714329c9a56c52e8d31", + "check": "reentrancy-no-eth", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "transferFromWithoutReward", + "source_mapping": { + "start": 41743, + "length": 247, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "transferFromWithoutReward(address,address,uint256)" + } + }, + { + "type": "node", + "name": "! withdrawRewardFor(_from)", + "source_mapping": { + "start": 41890, + "length": 25, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1118 + ], + "starting_column": 13, + "ending_column": 38 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "transferFromWithoutReward", + "source_mapping": { + "start": 41743, + "length": 247, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "transferFromWithoutReward(address,address,uint256)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "(balanceOf(_account) * rewardAccount.accumulatedInput()) / totalSupply < paidOut[_account]", + "source_mapping": { + "start": 40461, + "length": 90, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1065 + ], + "starting_column": 13, + "ending_column": 103 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdrawRewardFor", + "source_mapping": { + "start": 40361, + "length": 473, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdrawRewardFor(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "reward = (balanceOf(_account) * rewardAccount.accumulatedInput()) / totalSupply - paidOut[_account]", + "source_mapping": { + "start": 40581, + "length": 116, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1068, + 1069 + ], + "starting_column": 9, + "ending_column": 103 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdrawRewardFor", + "source_mapping": { + "start": 40361, + "length": 473, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdrawRewardFor(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "! rewardAccount.payOut(_account,reward)", + "source_mapping": { + "start": 40711, + "length": 39, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1070 + ], + "starting_column": 13, + "ending_column": 52 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdrawRewardFor", + "source_mapping": { + "start": 40361, + "length": 473, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdrawRewardFor(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "transferFrom(_from,_to,_value)", + "source_mapping": { + "start": 41944, + "length": 39, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1120 + ], + "starting_column": 9, + "ending_column": 48 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "transferFromWithoutReward", + "source_mapping": { + "start": 41743, + "length": 247, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "transferFromWithoutReward(address,address,uint256)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "balances" + } + }, + { + "type": "node", + "name": "balances[_to] += _amount", + "source_mapping": { + "start": 4393, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 120 + ], + "starting_column": 13, + "ending_column": 37 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "transferFrom", + "source_mapping": { + "start": 4127, + "length": 509, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 3440, + "length": 1550, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97, + 98, + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135, + 136, + 137, + 138, + 139 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "transferFrom(address,address,uint256)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "balances" + } + }, + { + "type": "node", + "name": "balances[_from] -= _amount", + "source_mapping": { + "start": 4431, + "length": 26, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 121 + ], + "starting_column": 13, + "ending_column": 39 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "transferFrom", + "source_mapping": { + "start": 4127, + "length": 509, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 3440, + "length": 1550, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97, + 98, + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135, + 136, + 137, + 138, + 139 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "transferFrom(address,address,uint256)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "balances" + } + }, + { + "type": "node", + "name": "transferFrom(_from,_to,_value)", + "source_mapping": { + "start": 41944, + "length": 39, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1120 + ], + "starting_column": 9, + "ending_column": 48 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "transferFromWithoutReward", + "source_mapping": { + "start": 41743, + "length": 247, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "transferFromWithoutReward(address,address,uint256)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "paidOut" + } + }, + { + "type": "node", + "name": "paidOut[_from] -= transferPaidOut", + "source_mapping": { + "start": 42279, + "length": 33, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1133 + ], + "starting_column": 9, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "transferPaidOut", + "source_mapping": { + "start": 41997, + "length": 384, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "transferPaidOut(address,address,uint256)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "paidOut" + } + }, + { + "type": "node", + "name": "paidOut[_to] += transferPaidOut", + "source_mapping": { + "start": 42322, + "length": 31, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1134 + ], + "starting_column": 9, + "ending_column": 40 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "transferPaidOut", + "source_mapping": { + "start": 41997, + "length": 384, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "transferPaidOut(address,address,uint256)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "paidOut" + } + } + ], + "description": "Reentrancy in DAO.transferFromWithoutReward(address,address,uint256) (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1112-1121):\n\tExternal calls:\n\t- ! withdrawRewardFor(_from) (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1118)\n\t\t- (balanceOf(_account) * rewardAccount.accumulatedInput()) / totalSupply < paidOut[_account] (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1065)\n\t\t- reward = (balanceOf(_account) * rewardAccount.accumulatedInput()) / totalSupply - paidOut[_account] (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1068-1069)\n\t\t- ! rewardAccount.payOut(_account,reward) (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1070)\n\tState variables written after the call(s):\n\t- transferFrom(_from,_to,_value) (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1120)\n\t\t- balances[_to] += _amount (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#120)\n\t\t- balances[_from] -= _amount (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#121)\n\t- transferFrom(_from,_to,_value) (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1120)\n\t\t- paidOut[_from] -= transferPaidOut (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1133)\n\t\t- paidOut[_to] += transferPaidOut (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1134)\n", + "markdown": "Reentrancy in [DAO.transferFromWithoutReward(address,address,uint256)](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1112-L1121):\n\tExternal calls:\n\t- [! withdrawRewardFor(_from)](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1118)\n\t\t- [(balanceOf(_account) * rewardAccount.accumulatedInput()) / totalSupply < paidOut[_account]](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1065)\n\t\t- [reward = (balanceOf(_account) * rewardAccount.accumulatedInput()) / totalSupply - paidOut[_account]](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1068-L1069)\n\t\t- [! rewardAccount.payOut(_account,reward)](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1070)\n\tState variables written after the call(s):\n\t- [transferFrom(_from,_to,_value)](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1120)\n\t\t- [balances[_to] += _amount](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L120)\n\t\t- [balances[_from] -= _amount](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L121)\n\t- [transferFrom(_from,_to,_value)](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1120)\n\t\t- [paidOut[_from] -= transferPaidOut](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1133)\n\t\t- [paidOut[_to] += transferPaidOut](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1134)\n", + "id": "b888f2335a7b1a29c1f4940886bfbe26a6277d2dca59310ede3dfdb6f02adeb0", + "check": "reentrancy-no-eth", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "transferWithoutReward", + "source_mapping": { + "start": 41191, + "length": 175, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1091, + 1092, + 1093, + 1094, + 1095 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "transferWithoutReward(address,uint256)" + } + }, + { + "type": "node", + "name": "! getMyReward()", + "source_mapping": { + "start": 41288, + "length": 14, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1092 + ], + "starting_column": 13, + "ending_column": 27 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "transferWithoutReward", + "source_mapping": { + "start": 41191, + "length": 175, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1091, + 1092, + 1093, + 1094, + 1095 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "transferWithoutReward(address,uint256)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "(balanceOf(_account) * rewardAccount.accumulatedInput()) / totalSupply < paidOut[_account]", + "source_mapping": { + "start": 40461, + "length": 90, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1065 + ], + "starting_column": 13, + "ending_column": 103 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdrawRewardFor", + "source_mapping": { + "start": 40361, + "length": 473, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdrawRewardFor(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "reward = (balanceOf(_account) * rewardAccount.accumulatedInput()) / totalSupply - paidOut[_account]", + "source_mapping": { + "start": 40581, + "length": 116, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1068, + 1069 + ], + "starting_column": 9, + "ending_column": 103 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdrawRewardFor", + "source_mapping": { + "start": 40361, + "length": 473, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdrawRewardFor(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "! rewardAccount.payOut(_account,reward)", + "source_mapping": { + "start": 40711, + "length": 39, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1070 + ], + "starting_column": 13, + "ending_column": 52 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdrawRewardFor", + "source_mapping": { + "start": 40361, + "length": 473, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdrawRewardFor(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "transfer(_to,_value)", + "source_mapping": { + "start": 41331, + "length": 28, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1094 + ], + "starting_column": 9, + "ending_column": 37 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "transferWithoutReward", + "source_mapping": { + "start": 41191, + "length": 175, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1091, + 1092, + 1093, + 1094, + 1095 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "transferWithoutReward(address,uint256)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "balances" + } + }, + { + "type": "node", + "name": "balances[msg.sender] -= _amount", + "source_mapping": { + "start": 3920, + "length": 31, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 101 + ], + "starting_column": 13, + "ending_column": 44 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "transfer", + "source_mapping": { + "start": 3765, + "length": 356, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 3440, + "length": 1550, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97, + 98, + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135, + 136, + 137, + 138, + 139 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "transfer(address,uint256)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "balances" + } + }, + { + "type": "node", + "name": "balances[_to] += _amount", + "source_mapping": { + "start": 3965, + "length": 24, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 102 + ], + "starting_column": 13, + "ending_column": 37 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "transfer", + "source_mapping": { + "start": 3765, + "length": 356, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Token", + "source_mapping": { + "start": 3440, + "length": 1550, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97, + 98, + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135, + 136, + 137, + 138, + 139 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "transfer(address,uint256)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "balances" + } + }, + { + "type": "node", + "name": "transfer(_to,_value)", + "source_mapping": { + "start": 41331, + "length": 28, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1094 + ], + "starting_column": 9, + "ending_column": 37 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "transferWithoutReward", + "source_mapping": { + "start": 41191, + "length": 175, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1091, + 1092, + 1093, + 1094, + 1095 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "transferWithoutReward(address,uint256)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "paidOut" + } + }, + { + "type": "node", + "name": "paidOut[_from] -= transferPaidOut", + "source_mapping": { + "start": 42279, + "length": 33, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1133 + ], + "starting_column": 9, + "ending_column": 42 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "transferPaidOut", + "source_mapping": { + "start": 41997, + "length": 384, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "transferPaidOut(address,address,uint256)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "paidOut" + } + }, + { + "type": "node", + "name": "paidOut[_to] += transferPaidOut", + "source_mapping": { + "start": 42322, + "length": 31, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1134 + ], + "starting_column": 9, + "ending_column": 40 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "transferPaidOut", + "source_mapping": { + "start": 41997, + "length": 384, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "transferPaidOut(address,address,uint256)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "paidOut" + } + } + ], + "description": "Reentrancy in DAO.transferWithoutReward(address,uint256) (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1091-1095):\n\tExternal calls:\n\t- ! getMyReward() (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1092)\n\t\t- (balanceOf(_account) * rewardAccount.accumulatedInput()) / totalSupply < paidOut[_account] (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1065)\n\t\t- reward = (balanceOf(_account) * rewardAccount.accumulatedInput()) / totalSupply - paidOut[_account] (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1068-1069)\n\t\t- ! rewardAccount.payOut(_account,reward) (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1070)\n\tState variables written after the call(s):\n\t- transfer(_to,_value) (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1094)\n\t\t- balances[msg.sender] -= _amount (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#101)\n\t\t- balances[_to] += _amount (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#102)\n\t- transfer(_to,_value) (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1094)\n\t\t- paidOut[_from] -= transferPaidOut (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1133)\n\t\t- paidOut[_to] += transferPaidOut (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1134)\n", + "markdown": "Reentrancy in [DAO.transferWithoutReward(address,uint256)](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1091-L1095):\n\tExternal calls:\n\t- [! getMyReward()](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1092)\n\t\t- [(balanceOf(_account) * rewardAccount.accumulatedInput()) / totalSupply < paidOut[_account]](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1065)\n\t\t- [reward = (balanceOf(_account) * rewardAccount.accumulatedInput()) / totalSupply - paidOut[_account]](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1068-L1069)\n\t\t- [! rewardAccount.payOut(_account,reward)](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1070)\n\tState variables written after the call(s):\n\t- [transfer(_to,_value)](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1094)\n\t\t- [balances[msg.sender] -= _amount](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L101)\n\t\t- [balances[_to] += _amount](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L102)\n\t- [transfer(_to,_value)](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1094)\n\t\t- [paidOut[_from] -= transferPaidOut](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1133)\n\t\t- [paidOut[_to] += transferPaidOut](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1134)\n", + "id": "bb78c66126a39c10a22c2be95caccd1bc16b010bc959bdeb23bdc1d728654eea", + "check": "reentrancy-no-eth", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "withdrawRewardFor", + "source_mapping": { + "start": 40361, + "length": 473, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdrawRewardFor(address)" + } + }, + { + "type": "node", + "name": "reward = (balanceOf(_account) * rewardAccount.accumulatedInput()) / totalSupply - paidOut[_account]", + "source_mapping": { + "start": 40581, + "length": 116, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1068, + 1069 + ], + "starting_column": 9, + "ending_column": 103 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdrawRewardFor", + "source_mapping": { + "start": 40361, + "length": 473, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdrawRewardFor(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "! rewardAccount.payOut(_account,reward)", + "source_mapping": { + "start": 40711, + "length": 39, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1070 + ], + "starting_column": 13, + "ending_column": 52 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdrawRewardFor", + "source_mapping": { + "start": 40361, + "length": 473, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdrawRewardFor(address)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "paidOut[_account] += reward", + "source_mapping": { + "start": 40779, + "length": 27, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1072 + ], + "starting_column": 9, + "ending_column": 36 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdrawRewardFor", + "source_mapping": { + "start": 40361, + "length": 473, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DAO", + "source_mapping": { + "start": 28296, + "length": 17108, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol", + "is_dependency": false, + "lines": [ + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 735, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 751, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 759, + 760, + 761, + 762, + 763, + 764, + 765, + 766, + 767, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 887, + 888, + 889, + 890, + 891, + 892, + 893, + 894, + 895, + 896, + 897, + 898, + 899, + 900, + 901, + 902, + 903, + 904, + 905, + 906, + 907, + 908, + 909, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 930, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1014, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdrawRewardFor(address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "paidOut" + } + } + ], + "description": "Reentrancy in DAO.withdrawRewardFor(address) (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1064-1074):\n\tExternal calls:\n\t- reward = (balanceOf(_account) * rewardAccount.accumulatedInput()) / totalSupply - paidOut[_account] (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1068-1069)\n\t- ! rewardAccount.payOut(_account,reward) (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1070)\n\tState variables written after the call(s):\n\t- paidOut[_account] += reward (tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#1072)\n", + "markdown": "Reentrancy in [DAO.withdrawRewardFor(address)](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1064-L1074):\n\tExternal calls:\n\t- [reward = (balanceOf(_account) * rewardAccount.accumulatedInput()) / totalSupply - paidOut[_account]](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1068-L1069)\n\t- [! rewardAccount.payOut(_account,reward)](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1070)\n\tState variables written after the call(s):\n\t- [paidOut[_account] += reward](tests/detectors/reentrancy-no-eth/0.4.25/DAO.sol#L1072)\n", + "id": "fb092ddf0ad631483e2154ebe8224d43f9bf6212386128fcac54c051b2db88db", + "check": "reentrancy-no-eth", + "impact": "Medium", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/test_detectors.py b/tests/test_detectors.py index d93dd75ba9..93d0afaf85 100644 --- a/tests/test_detectors.py +++ b/tests/test_detectors.py @@ -108,6 +108,11 @@ def id_test(test_item: Test): "reentrancy-write.sol", "0.7.6", ), + Test( + all_detectors.ReentrancyReadBeforeWritten, + "DAO.sol", + "0.4.25", + ), Test( all_detectors.BooleanEquality, "boolean-constant-equality.sol", @@ -329,6 +334,11 @@ def id_test(test_item: Test): "reentrancy_indirect.sol", "0.7.6", ), + Test( + all_detectors.ReentrancyEth, + "DAO.sol", + "0.4.25", + ), Test( all_detectors.UninitializedStorageVars, "uninitialized_storage_pointer.sol",