├── test
├── .solhintignore
├── cmdlineTests
│ ├── too_long_line
│ │ └── exit
│ ├── object_compiler
│ │ ├── exit
│ │ ├── args
│ │ └── err
│ ├── require_overload
│ │ ├── exit
│ │ └── input.sol
│ ├── strict_asm_jump
│ │ ├── exit
│ │ ├── args
│ │ ├── input.sol
│ │ └── err
│ ├── standard_default_success
│ │ ├── exit
│ │ ├── output.json
│ │ └── input.json
│ ├── standard_wrong_key_root
│ │ ├── exit
│ │ └── output.json
│ ├── standard_wrong_type_root
│ │ ├── exit
│ │ ├── input.json
│ │ └── output.json
│ ├── too_long_line_edge_in
│ │ ├── exit
│ │ └── input.sol
│ ├── too_long_line_edge_out
│ │ ├── exit
│ │ └── input.sol
│ ├── too_long_line_left_short
│ │ ├── exit
│ │ └── input.sol
│ ├── too_long_line_multiline
│ │ └── exit
│ ├── yul_stack_opt_disabled
│ │ ├── exit
│ │ └── args
│ ├── standard_wrong_key_metadata
│ │ ├── exit
│ │ └── output.json
│ ├── standard_wrong_key_optimizer
│ │ ├── exit
│ │ └── output.json
│ ├── standard_wrong_key_settings
│ │ ├── exit
│ │ └── output.json
│ ├── standard_wrong_key_source
│ │ ├── exit
│ │ └── output.json
│ ├── standard_wrong_type_metadata
│ │ ├── exit
│ │ └── output.json
│ ├── standard_wrong_type_optimizer
│ │ ├── exit
│ │ └── output.json
│ ├── standard_wrong_type_settings
│ │ ├── exit
│ │ └── output.json
│ ├── standard_wrong_type_source
│ │ ├── exit
│ │ └── output.json
│ ├── standard_wrong_type_sources
│ │ ├── exit
│ │ ├── input.json
│ │ └── output.json
│ ├── too_long_line_right_short
│ │ └── exit
│ ├── standard_secondary_source_location
│ │ └── exit
│ ├── standard_wrong_key_auxiliary_input
│ │ ├── exit
│ │ └── output.json
│ ├── standard_wrong_type_remappings
│ │ └── exit
│ ├── too_long_line_both_sides_short
│ │ └── exit
│ ├── standard_missing_key_useLiteralContent
│ │ ├── exit
│ │ └── output.json
│ ├── standard_wrong_type_auxiliary_input
│ │ ├── exit
│ │ └── output.json
│ ├── standard_wrong_type_output_selection
│ │ └── exit
│ ├── standard_wrong_type_remappings_entry
│ │ └── exit
│ ├── standard_wrong_type_useLiteralContent
│ │ └── exit
│ ├── evm_to_wasm
│ │ ├── input.sol
│ │ ├── args
│ │ └── err
│ ├── standard_wrong_type_output_selection_file
│ │ └── exit
│ ├── standard_wrong_type_output_selection_output
│ │ └── exit
│ ├── yul_stack_opt
│ │ ├── args
│ │ └── err
│ ├── standard_wrong_type_output_selection_contract
│ │ └── exit
│ ├── standard_wrong_type_auxiliary_input_smtlib2responses
│ │ └── exit
│ ├── recovery_ast_constructor
│ │ └── args
│ ├── standard_wrong_type_auxiliary_input_smtlib2responses_member
│ │ └── exit
│ ├── standard_method_identifiers_requested
│ │ └── output.json
│ ├── standard_optimizer_invalid_details
│ │ └── output.json
│ └── standard_yul_multiple_files
│ │ └── output.json
├── libsolidity
│ ├── ASTJSON
│ │ ├── smoke.sol
│ │ ├── array_type_name.sol
│ │ ├── enum_value.sol
│ │ ├── event_definition.sol
│ │ ├── inheritance_specifier.sol
│ │ ├── placeholder_statement.sol
│ │ ├── fallback_payable.sol
│ │ ├── source_location.sol
│ │ ├── constructor.sol
│ │ ├── non_utf8.sol
│ │ ├── using_for_directive.sol
│ │ ├── fallback.sol
│ │ ├── short_type_name.sol
│ │ ├── short_type_name_ref.sol
│ │ ├── long_type_name_binary_operation.sol
│ │ ├── modifier_definition.sol
│ │ ├── modifier_invocation.sol
│ │ ├── long_type_name_identifier.sol
│ │ ├── contract_dep_order.sol
│ │ └── function_type.sol
│ ├── syntaxTests
│ │ ├── parsing
│ │ │ ├── empty_comment.sol
│ │ │ ├── event.sol
│ │ │ ├── event_arguments.sol
│ │ │ ├── mapping.sol
│ │ │ ├── library_simple.sol
│ │ │ ├── smoke_test.sol
│ │ │ ├── external_function.sol
│ │ │ ├── fallback_function.sol
│ │ │ ├── interface_basic.sol
│ │ │ ├── comment_end_with_double_star.sol
│ │ │ ├── function_type_state_variable.sol
│ │ │ ├── address_payable_constant.sol
│ │ │ ├── arrays_in_events.sol
│ │ │ ├── import_empty.sol
│ │ │ ├── multi_arrays.sol
│ │ │ ├── address_payable_library.sol
│ │ │ ├── modifier_arguments.sol
│ │ │ ├── event_arguments_indexed.sol
│ │ │ ├── import_complex_without_from.sol
│ │ │ ├── assembly_evmasm_type.sol
│ │ │ ├── function_no_body.sol
│ │ │ ├── function_type_as_storage_variable.sol
│ │ │ ├── modifier.sol
│ │ │ ├── no_function_params.sol
│ │ │ ├── address_in_struct.sol
│ │ │ ├── empty_enum.sol
│ │ │ ├── event_with_no_argument_list.sol
│ │ │ ├── from_is_not_keyword.sol
│ │ │ ├── import_complex_invalid_from.sol
│ │ │ ├── import_invalid_token.sol
│ │ │ ├── import_simple.sol
│ │ │ ├── trailing_dot3.sol
│ │ │ ├── constant_is_keyword.sol
│ │ │ ├── external_variable.sol
│ │ │ ├── var_array.sol
│ │ │ ├── malformed_enum_declaration.sol
│ │ │ ├── import_complex.sol
│ │ │ ├── mapping_nonelementary_key_1.sol
│ │ │ ├── fixed_literal_with_double_radix.sol
│ │ │ ├── mapping_nonelementary_key_4.sol
│ │ │ ├── missing_variable_name_in_declaration.sol
│ │ │ ├── new_invalid_type_name.sol
│ │ │ ├── single_function_param.sol
│ │ │ ├── var_storage_var.sol
│ │ │ ├── modifier_without_semicolon.sol
│ │ │ ├── new_address_payable.sol
│ │ │ ├── payable_accessor.sol
│ │ │ ├── struct_definition.sol
│ │ │ ├── address_public_payable_error.sol
│ │ │ ├── emit_without_event.sol
│ │ │ ├── empty_function.sol
│ │ │ ├── location_specifiers_for_state_variables.sol
│ │ │ ├── tuples_without_commas.sol
│ │ │ ├── mapping_from_address_payable.sol
│ │ │ ├── scientific_notation.sol
│ │ │ ├── address_constant_payable.sol
│ │ │ ├── arrays_in_storage.sol
│ │ │ ├── function_type_as_parameter.sol
│ │ │ ├── location_specifiers_with_var.sol
│ │ │ ├── single_function_param_trailing_comma.sol
│ │ │ ├── assembly_invalid_type.sol
│ │ │ ├── address_nonpayable.sol
│ │ │ ├── location_specifiers_for_state_variables_multi.sol
│ │ │ ├── multiple_function_param_trailing_comma.sol
│ │ │ ├── single_return_param_trailing_comma.sol
│ │ │ ├── trailing_dot2.sol
│ │ │ ├── mapping_in_struct.sol
│ │ │ ├── mapping_to_mapping_in_struct.sol
│ │ │ ├── multiple_return_param_trailing_comma.sol
│ │ │ ├── single_event_arg_trailing_comma.sol
│ │ │ ├── tuples_decl_without_rhs.sol
│ │ │ ├── address_function_arguments_and_returns.sol
│ │ │ ├── address_payable_type_expression.sol
│ │ │ ├── conditional_with_assignment.sol
│ │ │ ├── enum_valid_declaration.sol
│ │ │ ├── function_normal_comments.sol
│ │ │ ├── inline_array_declaration.sol
│ │ │ ├── literal_constants_with_ether_subdenominations_in_expressions.sol
│ │ │ ├── function_type_as_storage_variable_with_modifiers.sol
│ │ │ ├── address_payable.sol
│ │ │ ├── function_type_as_storage_variable_with_assignment.sol
│ │ │ ├── mapping_nonelementary_key_2.sol
│ │ │ ├── mapping_nonelementary_key_3.sol
│ │ │ ├── multiple_event_arg_trailing_comma.sol
│ │ │ ├── single_modifier_arg_trailing_comma.sol
│ │ │ ├── variable_definition_in_mapping.sol
│ │ │ ├── invalid_fixed_conversion_leading_zeroes_check.sol
│ │ │ ├── address_payable_conversion.sol
│ │ │ ├── enum_from_interface.sol
│ │ │ └── enum_from_library.sol
│ │ ├── imports
│ │ │ ├── smoke_test.sol
│ │ │ ├── regular_import.sol
│ │ │ ├── library_name_clash_with_contract.sol
│ │ │ ├── name_clash_in_import_5.sol
│ │ │ ├── circular_import.sol
│ │ │ ├── relative_import_multiplex.sol
│ │ │ ├── import_is_transitive.sol
│ │ │ ├── relative_import.sol
│ │ │ ├── simple_alias.sol
│ │ │ ├── name_clash_in_import_1.sol
│ │ │ ├── name_clash_in_import_2.sol
│ │ │ ├── name_clash_in_import_4.sol
│ │ │ ├── name_clash_in_import_3.sol
│ │ │ └── shadowing_builtins_with_alias.sol
│ │ ├── nameAndTypeResolution
│ │ │ ├── 414_interface.sol
│ │ │ ├── 228_valid_library.sol
│ │ │ ├── 417_interface_events.sol
│ │ │ ├── 506_large_storage_array_fine.sol
│ │ │ ├── 422_interface_enums.sol
│ │ │ ├── 187_large_utf8_codepoint.sol
│ │ │ ├── 251_using_for_library.sol
│ │ │ ├── 355_payable_external.sol
│ │ │ ├── 526_fallback_marked_external.sol
│ │ │ ├── 191_negative_integers_to_signed_min.sol
│ │ │ ├── shadowsBuiltin
│ │ │ │ ├── ignores_constructor.sol
│ │ │ │ ├── ignores_struct.sol
│ │ │ │ ├── global_scope.sol
│ │ │ │ ├── events.sol
│ │ │ │ ├── storage_variables.sol
│ │ │ │ └── functions.sol
│ │ │ ├── 084_events_with_same_name.sol
│ │ │ ├── 074_fallback_function.sol
│ │ │ ├── 193_positive_integers_to_signed_out_of_bound_max.sol
│ │ │ ├── 104_empty_name_input_parameter.sol
│ │ │ ├── 168_assignment_to_const_var_involving_conversion.sol
│ │ │ ├── 169_assignment_to_const_var_involving_expression.sol
│ │ │ ├── 419_interface_structs.sol
│ │ │ ├── 438_unused_unnamed_function_parameter.sol
│ │ │ ├── 497_gasleft.sol
│ │ │ ├── 568_blockhash.sol
│ │ │ ├── 086_events_with_same_name_different_types.sol
│ │ │ ├── 106_empty_name_return_parameter.sol
│ │ │ ├── 146_external_argument_assign.sol
│ │ │ ├── 147_external_argument_increment.sol
│ │ │ ├── 170_assignment_to_const_var_involving_keccak.sol
│ │ │ ├── 441_unused_unnamed_return_parameter.sol
│ │ │ ├── 461_event_parameter_cannot_shadow_state_variable.sol
│ │ │ ├── warnUnused
│ │ │ │ ├── function_parameter.sol
│ │ │ │ ├── return_parameter.sol
│ │ │ │ ├── local.sol
│ │ │ │ └── local_assignment.sol
│ │ │ ├── 085_events_with_same_name_unnamed_arguments.sol
│ │ │ ├── 174_address_is_constant.sol
│ │ │ ├── 415_interface_functions.sol
│ │ │ ├── 421_interface_function_parameters.sol
│ │ │ ├── 446_no_unused_warning_abstract_arguments.sol
│ │ │ ├── 061_missing_base_constructor_arguments.sol
│ │ │ ├── 062_base_constructor_arguments_override.sol
│ │ │ ├── 400_does_not_warn_msg_value_in_library.sol
│ │ │ ├── 445_no_unused_warning_interface_arguments.sol
│ │ │ ├── 524_accept_library_creation.sol
│ │ │ ├── 560_event_emit_simple.sol
│ │ │ ├── 057_legal_override_direct.sol
│ │ │ ├── 442_named_return_parameter.sol
│ │ │ ├── 515_experimental_pragma_empty.sol
│ │ │ ├── 115_exp_warn_literal_base_3.sol
│ │ │ ├── 268_function_overload_array_type.sol
│ │ │ ├── 459_function_overload_is_not_shadowing.sol
│ │ │ ├── 004_reference_to_later_declaration.sol
│ │ │ ├── 118_shift_warn_literal_base_3.sol
│ │ │ ├── 398_does_not_warn_msg_value_in_payable_function.sol
│ │ │ ├── 399_does_not_warn_msg_value_in_internal_function.sol
│ │ │ ├── 082_anonymous_event_four_indexed.sol
│ │ │ ├── 095_multiple_events_argument_clash.sol
│ │ │ ├── 226_inheriting_library.sol
│ │ │ ├── 227_library_having_variables.sol
│ │ │ ├── 353_callcode_not_deprecated_as_function.sol
│ │ │ ├── 418_interface_inheritance.sol
│ │ │ ├── 420_interface_variables.sol
│ │ │ ├── 431_bare_assert.sol
│ │ │ ├── 139_no_name_suggestion.sol
│ │ │ ├── 155_array_copy_with_different_types_static_dynamic.sol
│ │ │ ├── 225_inheriting_from_library.sol
│ │ │ ├── 460_function_override_is_not_shadowing.sol
│ │ │ ├── 487_function_types_selector_4.sol
│ │ │ ├── 058_legal_override_indirect.sol
│ │ │ ├── 154_array_copy_with_different_types_conversion_possible.sol
│ │ │ ├── 157_array_of_undeclared_type.sol
│ │ │ ├── 175_uninitialized_const_variable.sol
│ │ │ ├── 252_using_for_not_library.sol
│ │ │ ├── 423_using_interface.sol
│ │ │ ├── 430_bare_selfdestruct.sol
│ │ │ ├── 443_named_return_parameter_with_explicit_return.sol
│ │ │ ├── 444_unnamed_return_parameter_with_explicit_return.sol
│ │ │ ├── 516_experimental_pragma_unknown_number_literal.sol
│ │ │ ├── 519_experimental_pragma_empy_string_literal.sol
│ │ │ ├── 520_experimental_pragma_multiple_same_line.sol
│ │ │ ├── 354_payable_in_library.sol
│ │ │ ├── 357_payable_private.sol
│ │ │ ├── 425_interface_implement_public_contract.sol
│ │ │ ├── 447_no_unused_warnings.sol
│ │ │ ├── 483_modifiers_access_storage_pointer.sol
│ │ │ ├── 076_fallback_function_in_library.sol
│ │ │ ├── 080_event.sol
│ │ │ ├── 090_event_call.sol
│ │ │ ├── 214_assignment_mem_storage_variable_directly.sol
│ │ │ ├── 298_invalid_fixed_types_0x7_mxn.sol
│ │ │ ├── 345_unused_return_value.sol
│ │ │ ├── 356_payable_internal.sol
│ │ │ ├── 434_pure_statement_check_for_regular_for_loop.sol
│ │ │ ├── 479_explicit_literal_to_memory_string_assignment.sol
│ │ │ ├── 517_experimental_pragma_unknown_string_literal.sol
│ │ │ ├── 529_fallback_marked_public.sol
│ │ │ ├── 096_access_to_default_function_visibility.sol
│ │ │ ├── 114_exp_warn_literal_base_2.sol
│ │ │ ├── 119_shift_warn_literal_base_4.sol
│ │ │ ├── 300_invalid_fixed_types_7x8_mxn.sol
│ │ │ ├── 511_library_function_without_implementation_public.sol
│ │ │ ├── 527_fallback_marked_internal.sol
│ │ │ ├── 528_fallback_marked_private.sol
│ │ │ ├── 056_cyclic_inheritance.sol
│ │ │ ├── 079_fallback_function_inheritance.sol
│ │ │ ├── 117_shift_warn_literal_base_2.sol
│ │ │ ├── 198_integer_boolean_not.sol
│ │ │ ├── 401_does_not_warn_msg_value_in_modifier_following_non_payable_public_function.sol
│ │ │ ├── 518_experimental_pragma_unknown_quoted_string_literal.sol
│ │ │ ├── 151_array_with_negative_length.sol
│ │ │ ├── 172_assignment_to_const_string_bytes.sol
│ │ │ ├── 245_tuples_empty_components.sol
│ │ │ ├── 405_address_checksum_type_deduction.sol
│ │ │ ├── 188_string_index.sol
│ │ │ ├── 561_event_emit_complex.sol
│ │ │ ├── 077_fallback_function_with_return_parameters.sol
│ │ │ ├── 148_external_argument_delete.sol
│ │ │ ├── 171_assignment_to_const_array_vars.sol
│ │ │ ├── 429_revert_with_reason.sol
│ │ │ ├── 470_specified_storage_no_warn.sol
│ │ │ ├── 570_function_type_undeclared_type.sol
│ │ │ ├── 015_balance_invalid.sol
│ │ │ ├── 133_enum_duplicate_values.sol
│ │ │ ├── 196_integer_boolean_or.sol
│ │ │ ├── 197_integer_boolean_and.sol
│ │ │ ├── 366_invalid_array_as_statement.sol
│ │ │ ├── 402_assignment_to_constant.sol
│ │ │ ├── 416_interface_function_bodies.sol
│ │ │ ├── 501_gasleft_shadowing_2.sol
│ │ │ ├── 521_experimental_pragma_test_warning.sol
│ │ │ ├── 533_tuple_invalid_literal_too_large_exp.sol
│ │ │ ├── 559_no_warning_for_using_members_that_look_like_address_members.sol
│ │ │ ├── 584_abi_decode_with_tuple_of_other_than_types.sol
│ │ │ ├── typeChecking
│ │ │ │ ├── return.sol
│ │ │ │ └── function_call.sol
│ │ │ ├── 054_inheritance_basic.sol
│ │ │ ├── 059_illegal_override_visibility.sol
│ │ │ ├── 075_fallback_function_with_arguments.sol
│ │ │ ├── 087_double_event_declaration.sol
│ │ │ ├── 194_negative_integers_to_unsigned.sol
│ │ │ ├── 216_function_argument_storage_to_mem.sol
│ │ │ ├── 265_new_for_non_array.sol
│ │ │ ├── 482_explicit_literal_to_unspecified_string.sol
│ │ │ ├── 512_library_function_without_implementation_internal.sol
│ │ │ ├── 513_library_function_without_implementation_private.sol
│ │ │ ├── 540_array_length_invalid_expression_division_by_zero.sol
│ │ │ ├── 094_event_inheritance.sol
│ │ │ ├── 110_no_overflow_with_large_literal.sol
│ │ │ ├── 199_integer_unsigned_exp_signed.sol
│ │ │ ├── 200_integer_signed_exp_unsigned.sol
│ │ │ ├── 368_shift_constant_left_negative_rvalue.sol
│ │ │ ├── 369_shift_constant_right_negative_rvalue.sol
│ │ │ ├── 478_too_large_arrays_for_calldata_public.sol
│ │ │ ├── 523_reject_interface_creation.sol
│ │ │ └── 536_array_length_invalid_expression_negative_bool.sol
│ │ ├── constructor
│ │ ├── events
│ │ │ └── event_nested_array_2.sol
│ │ ├── pragma
│ │ │ ├── invalid_pragma.sol
│ │ │ └── unknown_pragma.sol
│ │ ├── types
│ │ │ ├── mapping
│ │ │ │ ├── mapping_dynamic_key.sol
│ │ │ │ ├── mapping_dynamic_key_public.sol
│ │ │ │ ├── library_argument_private.sol
│ │ │ │ ├── argument_private.sol
│ │ │ │ ├── library_argument_internal.sol
│ │ │ │ ├── argument_internal.sol
│ │ │ │ ├── library_argument_public.sol
│ │ │ │ ├── library_array_argument_internal.sol
│ │ │ │ ├── library_array_argument_private.sol
│ │ │ │ ├── array_argument_internal.sol
│ │ │ │ ├── array_argument_private.sol
│ │ │ │ ├── library_argument_external.sol
│ │ │ │ ├── function_type_argument_internal.sol
│ │ │ │ ├── function_type_return_internal.sol
│ │ │ │ ├── library_array_argument_public.sol
│ │ │ │ ├── access_index_omitted.sol
│ │ │ │ └── library_array_argument_external.sol
│ │ │ ├── bytes0.sol
│ │ │ ├── bytes256.sol
│ │ │ ├── bytes33.sol
│ │ │ ├── address
│ │ │ │ ├── address_to_contract.sol
│ │ │ │ ├── address_payable_selfdestruct.sol
│ │ │ │ ├── contract_to_address.sol
│ │ │ │ ├── uint_to_payable_address.sol
│ │ │ │ ├── bytes_to_payable_address.sol
│ │ │ │ ├── payable_address_to_address.sol
│ │ │ │ ├── address_to_contract_payable_fallback.sol
│ │ │ │ └── address_abi_decode.sol
│ │ │ ├── index_access_for_bytes.sol
│ │ │ ├── rational_negative_numerator_negative_exp.sol
│ │ │ ├── library_to_address.sol
│ │ │ ├── contract_to_base.sol
│ │ │ ├── var_empty_decl_3.sol
│ │ │ ├── no_singleton_tuple.sol
│ │ │ ├── contract_to_base_base.sol
│ │ │ ├── function_call_fail2.sol
│ │ │ ├── empty_tuple_event.sol
│ │ │ └── var_empty_decl_1.sol
│ │ ├── viewPureChecker
│ │ │ ├── suggest_pure.sol
│ │ │ ├── creation_no_restrict_warning.sol
│ │ │ ├── interface.sol
│ │ │ ├── constant.sol
│ │ │ ├── overriding_no_restrict_warning.sol
│ │ │ ├── callvalue_payable_assembly_function.sol
│ │ │ ├── suggest_view.sol
│ │ │ └── callvalue_payable_assembly_fallback.sol
│ │ ├── visibility
│ │ │ ├── interface
│ │ │ │ ├── function_external.sol
│ │ │ │ ├── function_internal.sol
│ │ │ │ ├── function_private.sol
│ │ │ │ └── function_public.sol
│ │ │ └── function_no_visibility.sol
│ │ ├── array
│ │ │ ├── length
│ │ │ │ ├── constant_var.sol
│ │ │ │ ├── can_be_constant_in_struct.sol
│ │ │ │ ├── can_be_recursive_constant.sol
│ │ │ │ ├── too_large.sol
│ │ │ │ ├── tuples.sol
│ │ │ │ ├── inline_array.sol
│ │ │ │ ├── invalid_expression_5.sol
│ │ │ │ ├── bytes32_too_large.sol
│ │ │ │ ├── const_cannot_be_fractional.sol
│ │ │ │ ├── invalid_expression_1.sol
│ │ │ │ ├── invalid_expression_2.sol
│ │ │ │ ├── invalid_expression_3.sol
│ │ │ │ ├── can_be_constant_in_function.sol
│ │ │ │ ├── not_convertible_to_integer.sol
│ │ │ │ ├── parameter_too_large.sol
│ │ │ │ ├── uint_too_large_multidim.sol
│ │ │ │ ├── bytes32_too_large_multidim.sol
│ │ │ │ ├── invalid_expression_4.sol
│ │ │ │ ├── cannot_be_function.sol
│ │ │ │ └── non_integer_constant_var.sol
│ │ │ ├── bytes_pop.sol
│ │ │ ├── array_pop.sol
│ │ │ ├── calldata_resize.sol
│ │ │ └── invalid
│ │ │ │ ├── library_index_access.sol
│ │ │ │ └── contract_index_access.sol
│ │ ├── metaTypes
│ │ │ ├── name_constant.sol
│ │ │ ├── name.sol
│ │ │ ├── typeNotRegularIdentifierContractName.sol
│ │ │ ├── typeNotRegularIdentifierStateVariable.sol
│ │ │ ├── typeNotRegularIdentifierFunction.sol
│ │ │ ├── typeNotRegularIdentifierParameter.sol
│ │ │ ├── typeNotRegularIdentifierVariable.sol
│ │ │ ├── typeOfContract.sol
│ │ │ └── codeAccessIsConstant.sol
│ │ ├── empty_struct.sol
│ │ ├── getter
│ │ │ ├── simple_struct.sol
│ │ │ └── complex_struct.sol
│ │ ├── modifiers
│ │ │ ├── legal_modifier_override.sol
│ │ │ ├── modifier_without_underscore.sol
│ │ │ ├── function_modifier_double_invocation.sol
│ │ │ ├── constructor_as_modifier.sol
│ │ │ └── illegal_modifier_override.sol
│ │ ├── conversion
│ │ │ ├── conversion_to_bytes.sol
│ │ │ ├── implicit_conversion_from_storage_array_ref.sol
│ │ │ ├── allowed_conversion_to_bytes_array.sol
│ │ │ └── allowed_conversion_to_string.sol
│ │ ├── inheritance
│ │ │ ├── override
│ │ │ │ ├── function_state_variable.sol
│ │ │ │ └── external_turns_public_no_params.sol
│ │ │ ├── allow_empty_duplicated_super_constructor_call.sol
│ │ │ ├── base_arguments_no_parentheses.sol
│ │ │ └── reference_non_base_ctor.sol
│ │ ├── structs
│ │ │ └── recursion
│ │ │ │ ├── struct_definition_not_really_recursive.sol
│ │ │ │ ├── struct_definition_not_really_recursive_array.sol
│ │ │ │ ├── struct_definition_directly_recursive_dynamic_array.sol
│ │ │ │ └── struct_definition_recursion_via_mapping.sol
│ │ ├── functionTypes
│ │ │ ├── function_type.sol
│ │ │ ├── external_function_type_to_address.sol
│ │ │ ├── function_type_struct.sol
│ │ │ ├── function_type_returned.sol
│ │ │ ├── internal_function_as_external_parameter_in_library_internal.sol
│ │ │ ├── warn_function_type_parameters_with_names.sol
│ │ │ ├── call_value_on_payable_function_type.sol
│ │ │ ├── delete_function_type_invalid.sol
│ │ │ ├── payable_internal_function_type.sol
│ │ │ ├── delete_external_function_type_invalid.sol
│ │ │ ├── function_type_return_parameters_with_names.sol
│ │ │ └── external_function_type_taking_internal.sol
│ │ ├── emit
│ │ │ └── emit_empty.sol
│ │ ├── inlineAssembly
│ │ │ ├── assignment_from_functiontype.sol
│ │ │ ├── assignment_from_library.sol
│ │ │ ├── no_unused_variable_warning.sol
│ │ │ ├── use_msize_without_optimizer.sol
│ │ │ ├── assignment_from_contract.sol
│ │ │ ├── constant_computation.sol
│ │ │ ├── function_call_not_found.sol
│ │ │ └── invalid
│ │ │ │ └── constant_access.sol
│ │ ├── scoping
│ │ │ ├── scoping_for2.sol
│ │ │ ├── scoping_for.sol
│ │ │ ├── function_state_variable_conflict.sol
│ │ │ ├── state_variable_function_conflict.sol
│ │ │ ├── double_function_declaration.sol
│ │ │ └── name_shadowing.sol
│ │ ├── unterminatedBlocks
│ │ │ ├── one_dot.sol
│ │ │ ├── zero_dot.sol
│ │ │ ├── one_dot_x.sol
│ │ │ └── zero_dot_x.sol
│ │ ├── controlFlow
│ │ │ ├── unreachableCode
│ │ │ │ ├── comment_fine.sol
│ │ │ │ ├── double_revert.sol
│ │ │ │ ├── revert.sol
│ │ │ │ └── double_return.sol
│ │ │ ├── storageReturn
│ │ │ │ ├── unimplemented_library.sol
│ │ │ │ └── unimplemented_internal.sol
│ │ │ └── mappingReturn
│ │ │ │ ├── named_fine.sol
│ │ │ │ └── unnamed_fine.sol
│ │ ├── dataLocations
│ │ │ ├── libraryExternalFunction
│ │ │ │ ├── function_argument_location_specifier_test_external_storage.sol
│ │ │ │ └── function_argument_location_specifier_test_external_calldata.sol
│ │ │ ├── publicFunction
│ │ │ │ └── function_argument_location_specifier_test_public_memory.sol
│ │ │ ├── internalFunction
│ │ │ │ ├── function_argument_location_specifier_test_internal_memory.sol
│ │ │ │ └── function_argument_location_specifier_test_internal_storage.sol
│ │ │ ├── libraryInternalFunction
│ │ │ │ ├── function_argument_location_specifier_test_internal_memory.sol
│ │ │ │ └── function_argument_location_specifier_test_internal_storage.sol
│ │ │ ├── externalFunction
│ │ │ │ └── function_argument_location_specifier_test_external_calldata.sol
│ │ │ └── data_location_in_function_type.sol
│ │ ├── literal_comparisons.sol
│ │ ├── multiVariableDeclaration
│ │ │ ├── multiSingleVariableDeclaration.sol
│ │ │ └── oneElementTuple.sol
│ │ ├── string
│ │ │ ├── string_unterminated_no_new_line.sol
│ │ │ └── string_escapes.sol
│ │ ├── denominations
│ │ │ └── deprecated_year.sol
│ │ ├── constants
│ │ │ ├── cyclic_dependency_1.sol
│ │ │ └── cyclic_dependency_4.sol
│ │ ├── double_stateVariable_declaration.sol
│ │ ├── multiSource
│ │ │ └── import_not_found.sol
│ │ ├── natspec
│ │ │ ├── docstring_empty_tag.sol
│ │ │ └── docstring_empty_description.sol
│ │ ├── specialFunctions
│ │ │ └── abidecode
│ │ │ │ ├── abi_decode_single_return.sol
│ │ │ │ ├── abi_decode_singletontuple.sol
│ │ │ │ ├── abi_decode_simple.sol
│ │ │ │ └── abi_decode_empty.sol
│ │ ├── literalOperations
│ │ │ ├── mod_zero.sol
│ │ │ ├── division_by_zero.sol
│ │ │ ├── division_by_zero_complex.sol
│ │ │ └── mod_zero_complex.sol
│ │ ├── tupleAssignments
│ │ │ └── nowarn_swap_memory.sol
│ │ ├── memberLookup
│ │ │ ├── msg_value_modifier_payable.sol
│ │ │ └── internal_function_type.sol
│ │ ├── indexing
│ │ │ ├── array_without_index.sol
│ │ │ ├── fixedbytes_out_of_bounds_index.sol
│ │ │ ├── fixedbytes_without_index.sol
│ │ │ ├── array_out_of_bounds_index.sol
│ │ │ ├── function_type.sol
│ │ │ └── function_type_without_index.sol
│ │ ├── fallback
│ │ │ ├── pure_modifier.sol
│ │ │ └── view_modifier.sol
│ │ ├── globalFunctions
│ │ │ ├── sha3_no_call.sol
│ │ │ └── suicide_no_call.sol
│ │ ├── lvalues
│ │ │ └── calldata_index_access.sol
│ │ ├── bound
│ │ │ ├── bound_call.sol
│ │ │ └── bound_no_call.sol
│ │ └── smoke_test.sol
│ ├── ABIJson
│ │ └── empty_contract.sol
│ ├── smtCheckerTests
│ │ ├── simple
│ │ │ └── smoke_test.sol
│ │ ├── types
│ │ │ ├── function_type_as_argument.sol
│ │ │ ├── bool_simple_5.sol
│ │ │ ├── tuple_declarations_empty.sol
│ │ │ ├── bool_simple_3.sol
│ │ │ ├── bytes_2.sol
│ │ │ ├── contract_3.sol
│ │ │ ├── mapping_1.sol
│ │ │ ├── bool_simple_1.sol
│ │ │ └── data_location_in_function_type.sol
│ │ ├── control_flow
│ │ │ └── assignment_in_declaration.sol
│ │ ├── verification_target
│ │ │ ├── simple_assert_with_require.sol
│ │ │ └── simple_assert.sol
│ │ ├── loops
│ │ │ ├── for_loop_2.sol
│ │ │ ├── for_loop_1.sol
│ │ │ └── for_loop_3.sol
│ │ ├── functions
│ │ │ ├── functions_trivial_condition_for_only_call.sol
│ │ │ ├── functions_trivial_condition_require_only_call.sol
│ │ │ ├── functions_trivial_condition_while_only_call.sol
│ │ │ └── functions_trivial_condition_if.sol
│ │ ├── operators
│ │ │ ├── mod_n.sol
│ │ │ ├── mod_even.sol
│ │ │ └── delete_array_2d.sol
│ │ ├── overflow
│ │ │ └── safe_add_1.sol
│ │ ├── special
│ │ │ └── msg_sender_1.sol
│ │ └── invariants
│ │ │ └── loop_basic_for.sol
│ ├── semanticTests
│ │ ├── viaYul
│ │ │ ├── smoke_test.sol
│ │ │ └── return.sol
│ │ ├── empty_contract.sol
│ │ ├── storage
│ │ │ └── simple_accessor.sol
│ │ └── expressions
│ │ │ ├── exp_operator_const.sol
│ │ │ ├── exp_zero_literal.sol
│ │ │ ├── conditional_expression_true_literal.sol
│ │ │ ├── conditional_expression_false_literal.sol
│ │ │ └── exp_operator_const_signed.sol
│ ├── smtCheckerTestsJSON
│ │ └── simple.json
│ └── errorRecoveryTests
│ │ └── contract_recovery.sol
├── tools
│ └── ossfuzz
│ │ └── config
│ │ ├── solc_noopt_ossfuzz.options
│ │ ├── solc_opt_ossfuzz.options
│ │ ├── strictasm_opt_ossfuzz.options
│ │ └── strictasm_assembly_ossfuzz.options
├── libyul
│ ├── objectCompiler
│ │ ├── smoke.yul
│ │ └── namedObject.yul
│ ├── ewasmTranslationTests
│ │ └── smoke.yul
│ ├── yulInterpreterTests
│ │ ├── smoke.yul
│ │ ├── exp.yul
│ │ └── simple_mstore.yul
│ ├── yulOptimizerTests
│ │ ├── splitJoin
│ │ │ └── smoke.yul
│ │ ├── disambiguator
│ │ │ ├── smoke.yul
│ │ │ ├── smoke_yul.yul
│ │ │ └── variables.yul
│ │ ├── fullSimplify
│ │ │ ├── smoke.yul
│ │ │ ├── constants.yul
│ │ │ ├── identity_rules_simple.yul
│ │ │ ├── identity_rules_complex.yul
│ │ │ └── reversed.yul
│ │ ├── unusedPruner
│ │ │ ├── smoke.yul
│ │ │ ├── multi_declarations.yul
│ │ │ ├── pop.yul
│ │ │ ├── multi_declare.yul
│ │ │ ├── functions.yul
│ │ │ ├── trivial.yul
│ │ │ ├── no_msize.yul
│ │ │ ├── multi_partial_assignments.yul
│ │ │ ├── intermediate_assignment.yul
│ │ │ └── multi_assignments.yul
│ │ ├── rematerialiser
│ │ │ └── smoke.yul
│ │ ├── expressionJoiner
│ │ │ └── smoke.yul
│ │ ├── expressionSplitter
│ │ │ └── smoke.yul
│ │ ├── functionGrouper
│ │ │ └── smoke.yul
│ │ ├── functionHoister
│ │ │ └── smoke.yul
│ │ ├── expressionSimplifier
│ │ │ ├── smoke.yul
│ │ │ ├── constants.yul
│ │ │ ├── reversed.yul
│ │ │ ├── constant_propagation.yul
│ │ │ ├── identity_rules_complex.yul
│ │ │ └── mod_and_1.yul
│ │ ├── conditionalSimplifier
│ │ │ └── smoke.yul
│ │ ├── conditionalUnsimplifier
│ │ │ └── smoke.yul
│ │ ├── commonSubexpressionEliminator
│ │ │ └── smoke.yul
│ │ ├── varDeclInitializer
│ │ │ └── simple.yul
│ │ ├── structuralSimplifier
│ │ │ ├── if_false_condition.yul
│ │ │ ├── if_true_condition.yul
│ │ │ ├── if_unassigned_condition.yul
│ │ │ ├── nested.yul
│ │ │ ├── for_false_condition.sol
│ │ │ ├── if_multi_unassigned_condition.yul
│ │ │ └── switch_inline_no_match.yul
│ │ ├── varNameCleaner
│ │ │ ├── instructions.yul
│ │ │ └── builtins.yul
│ │ ├── controlFlowSimplifier
│ │ │ ├── empty_if_non_movable_condition.yul
│ │ │ └── empty_if_movable_condition.yul
│ │ ├── mainFunction
│ │ │ └── smoke.yul
│ │ ├── ssaReverser
│ │ │ └── self_assign.yul
│ │ └── redundantAssignEliminator
│ │ │ └── simple.yul
│ └── functionSideEffects
│ │ ├── empty.yul
│ │ ├── empty_with_sstore.yul
│ │ ├── recursive_function.yul
│ │ ├── with_loop.yul
│ │ ├── doubly_recursive_function.yul
│ │ └── cyclic_graph.yul
├── compilationTests
│ ├── corion
│ │ └── README.md
│ ├── gnosis
│ │ └── README.md
│ ├── MultiSigWallet
│ │ └── README.md
│ ├── milestonetracker
│ │ └── README.md
│ └── stringutils
│ │ └── README.md
├── evmc
│ └── README.md
└── .solhint.json
├── .gitattributes
├── docs
├── requirements.txt
└── _templates
│ └── layout.html
├── scripts
├── bytecodecompare
│ └── deploy_key.enc
├── travis-emscripten
│ └── deploy_key.enc
├── download_ossfuzz_corpus.sh
├── codespell_whitelist.txt
├── isoltest.sh
├── Dockerfile_alpine
└── install_static_z3.sh
├── cmake
└── toolchains
│ ├── emscripten.cmake
│ ├── cxx20.cmake
│ └── default.cmake
├── .dockerignore
└── CONTRIBUTING.md
/test/.solhintignore:
--------------------------------------------------------------------------------
1 | *contributing_rst*
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/too_long_line/exit:
--------------------------------------------------------------------------------
1 | 1
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/object_compiler/exit:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/require_overload/exit:
--------------------------------------------------------------------------------
1 | 1
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/strict_asm_jump/exit:
--------------------------------------------------------------------------------
1 | 1
2 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.sol linguist-language=Solidity
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_default_success/exit:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_key_root/exit:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_type_root/exit:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/too_long_line_edge_in/exit:
--------------------------------------------------------------------------------
1 | 1
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/too_long_line_edge_out/exit:
--------------------------------------------------------------------------------
1 | 1
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/too_long_line_left_short/exit:
--------------------------------------------------------------------------------
1 | 1
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/too_long_line_multiline/exit:
--------------------------------------------------------------------------------
1 | 1
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/yul_stack_opt_disabled/exit:
--------------------------------------------------------------------------------
1 | 1
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_key_metadata/exit:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_key_optimizer/exit:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_key_settings/exit:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_key_source/exit:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_type_metadata/exit:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_type_optimizer/exit:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_type_settings/exit:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_type_source/exit:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_type_sources/exit:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/strict_asm_jump/args:
--------------------------------------------------------------------------------
1 | --strict-assembly
--------------------------------------------------------------------------------
/test/cmdlineTests/strict_asm_jump/input.sol:
--------------------------------------------------------------------------------
1 | { jump(1) }
--------------------------------------------------------------------------------
/test/cmdlineTests/too_long_line_right_short/exit:
--------------------------------------------------------------------------------
1 | 1
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_secondary_source_location/exit:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_key_auxiliary_input/exit:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_type_remappings/exit:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/too_long_line_both_sides_short/exit:
--------------------------------------------------------------------------------
1 | 1
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_missing_key_useLiteralContent/exit:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_type_auxiliary_input/exit:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_type_output_selection/exit:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_type_remappings_entry/exit:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_type_root/input.json:
--------------------------------------------------------------------------------
1 | ["abc"]
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_type_useLiteralContent/exit:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/yul_stack_opt_disabled/args:
--------------------------------------------------------------------------------
1 | --strict-assembly
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/evm_to_wasm/input.sol:
--------------------------------------------------------------------------------
1 | {
2 | sstore(0, 1)
3 | }
4 |
--------------------------------------------------------------------------------
/test/cmdlineTests/object_compiler/args:
--------------------------------------------------------------------------------
1 | --strict-assembly --optimize
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_type_output_selection_file/exit:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_type_output_selection_output/exit:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/yul_stack_opt/args:
--------------------------------------------------------------------------------
1 | --strict-assembly --optimize
2 |
--------------------------------------------------------------------------------
/test/libsolidity/ASTJSON/smoke.sol:
--------------------------------------------------------------------------------
1 | contract C {}
2 |
3 | // ----
4 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_type_output_selection_contract/exit:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_type_auxiliary_input_smtlib2responses/exit:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/docs/requirements.txt:
--------------------------------------------------------------------------------
1 | sphinx_rtd_theme>=0.3.1
2 | pygments-lexer-solidity>=0.3.1
3 |
--------------------------------------------------------------------------------
/test/cmdlineTests/recovery_ast_constructor/args:
--------------------------------------------------------------------------------
1 | --error-recovery --ast --hashes
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_default_success/output.json:
--------------------------------------------------------------------------------
1 | {"sources":{"A":{"id":0}}}
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_type_auxiliary_input_smtlib2responses_member/exit:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/empty_comment.sol:
--------------------------------------------------------------------------------
1 | //
2 | contract test
3 | {}
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/event.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | event e();
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/ASTJSON/array_type_name.sol:
--------------------------------------------------------------------------------
1 | contract C { uint[] i; }
2 |
3 | // ----
4 |
--------------------------------------------------------------------------------
/test/libsolidity/ASTJSON/enum_value.sol:
--------------------------------------------------------------------------------
1 | contract C { enum E { A, B } }
2 |
3 | // ----
4 |
--------------------------------------------------------------------------------
/test/libsolidity/ASTJSON/event_definition.sol:
--------------------------------------------------------------------------------
1 | contract C { event E(); }
2 |
3 | // ----
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/imports/smoke_test.sol:
--------------------------------------------------------------------------------
1 | ==== Source: a ====
2 | contract C {}
3 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/414_interface.sol:
--------------------------------------------------------------------------------
1 | interface I {
2 | }
3 |
--------------------------------------------------------------------------------
/test/tools/ossfuzz/config/solc_noopt_ossfuzz.options:
--------------------------------------------------------------------------------
1 | [libfuzzer]
2 | dict = solidity.dict
3 |
--------------------------------------------------------------------------------
/test/tools/ossfuzz/config/solc_opt_ossfuzz.options:
--------------------------------------------------------------------------------
1 | [libfuzzer]
2 | dict = solidity.dict
3 |
--------------------------------------------------------------------------------
/test/cmdlineTests/evm_to_wasm/args:
--------------------------------------------------------------------------------
1 | --assemble --optimize --yul-dialect evm --machine ewasm
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_missing_key_useLiteralContent/output.json:
--------------------------------------------------------------------------------
1 | {"sources":{"A":{"id":0}}}
2 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/constructor/constructor.sol:
--------------------------------------------------------------------------------
1 | contract A { constructor() public {} }
2 |
--------------------------------------------------------------------------------
/test/tools/ossfuzz/config/strictasm_opt_ossfuzz.options:
--------------------------------------------------------------------------------
1 | [libfuzzer]
2 | dict = strict_assembly.dict
3 |
--------------------------------------------------------------------------------
/test/libsolidity/ABIJson/empty_contract.sol:
--------------------------------------------------------------------------------
1 | contract test { }
2 | // ----
3 | // :test
4 | // []
5 |
--------------------------------------------------------------------------------
/test/libsolidity/ASTJSON/inheritance_specifier.sol:
--------------------------------------------------------------------------------
1 | contract C1 {} contract C2 is C1 {}
2 |
3 | // ----
4 |
--------------------------------------------------------------------------------
/test/libsolidity/ASTJSON/placeholder_statement.sol:
--------------------------------------------------------------------------------
1 | contract C { modifier M { _; } }
2 |
3 | // ----
4 |
--------------------------------------------------------------------------------
/test/libyul/objectCompiler/smoke.yul:
--------------------------------------------------------------------------------
1 | {
2 | }
3 | // ----
4 | // Assembly:
5 | // -- empty bytecode --
6 |
--------------------------------------------------------------------------------
/test/tools/ossfuzz/config/strictasm_assembly_ossfuzz.options:
--------------------------------------------------------------------------------
1 | [libfuzzer]
2 | dict = strict_assembly.dict
3 |
--------------------------------------------------------------------------------
/test/libsolidity/ASTJSON/fallback_payable.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function() external {}
3 | }
4 |
5 | // ----
6 |
--------------------------------------------------------------------------------
/test/libsolidity/ASTJSON/source_location.sol:
--------------------------------------------------------------------------------
1 | contract C { function f() { var x = 2; x++; } }
2 |
3 | // ----
4 |
--------------------------------------------------------------------------------
/test/libsolidity/smtCheckerTests/simple/smoke_test.sol:
--------------------------------------------------------------------------------
1 | pragma experimental SMTChecker;
2 | contract C {
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/228_valid_library.sol:
--------------------------------------------------------------------------------
1 | library Lib { uint constant x = 9; }
2 |
--------------------------------------------------------------------------------
/test/libsolidity/ASTJSON/constructor.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | constructor() public {
3 | }
4 | }
5 |
6 | // ----
7 |
--------------------------------------------------------------------------------
/test/libsolidity/ASTJSON/non_utf8.sol:
--------------------------------------------------------------------------------
1 | contract C { function f() public { var x = hex"ff"; } }
2 |
3 | // ----
4 |
--------------------------------------------------------------------------------
/test/libsolidity/ASTJSON/using_for_directive.sol:
--------------------------------------------------------------------------------
1 | library L {} contract C { using L for uint; }
2 |
3 | // ----
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/417_interface_events.sol:
--------------------------------------------------------------------------------
1 | interface I {
2 | event E();
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/event_arguments.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | event e(uint a, bytes32 s);
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/mapping.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | mapping(address => bytes32) names;
3 | }
4 |
--------------------------------------------------------------------------------
/test/libyul/ewasmTranslationTests/smoke.yul:
--------------------------------------------------------------------------------
1 | {}
2 | // ----
3 | // Trace:
4 | // Memory dump:
5 | // Storage dump:
6 |
--------------------------------------------------------------------------------
/test/libyul/yulInterpreterTests/smoke.yul:
--------------------------------------------------------------------------------
1 | {}
2 | // ----
3 | // Trace:
4 | // Memory dump:
5 | // Storage dump:
6 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/splitJoin/smoke.yul:
--------------------------------------------------------------------------------
1 | {}
2 | // ====
3 | // step: splitJoin
4 | // ----
5 | // { }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/ASTJSON/fallback.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function() external payable {
3 | }
4 | }
5 |
6 | // ----
7 |
--------------------------------------------------------------------------------
/test/libsolidity/ASTJSON/short_type_name.sol:
--------------------------------------------------------------------------------
1 | contract c { function f() public { uint[] memory x; } }
2 |
3 | // ----
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/events/event_nested_array_2.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | event E(uint[2][]);
3 | }
4 | // ----
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/library_simple.sol:
--------------------------------------------------------------------------------
1 | library Lib {
2 | function f() public { }
3 | }
4 | // ----
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/smoke_test.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | uint256 stateVariable1;
3 | }
4 | // ----
5 |
--------------------------------------------------------------------------------
/test/libyul/functionSideEffects/empty.yul:
--------------------------------------------------------------------------------
1 | {
2 | }
3 | // ----
4 | // : movable, sideEffectFree, sideEffectFreeIfNoMSize
5 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/disambiguator/smoke.yul:
--------------------------------------------------------------------------------
1 | { }
2 | // ====
3 | // step: disambiguator
4 | // ----
5 | // { }
6 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/fullSimplify/smoke.yul:
--------------------------------------------------------------------------------
1 | { }
2 | // ====
3 | // step: fullSimplify
4 | // ----
5 | // { }
6 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/unusedPruner/smoke.yul:
--------------------------------------------------------------------------------
1 | { }
2 | // ====
3 | // step: unusedPruner
4 | // ----
5 | // { }
6 |
--------------------------------------------------------------------------------
/scripts/bytecodecompare/deploy_key.enc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/geohot/solidity/HEAD/scripts/bytecodecompare/deploy_key.enc
--------------------------------------------------------------------------------
/test/cmdlineTests/evm_to_wasm/err:
--------------------------------------------------------------------------------
1 | Warning: Yul and its optimizer are still experimental. Please use the output with care.
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/yul_stack_opt/err:
--------------------------------------------------------------------------------
1 | Warning: Yul and its optimizer are still experimental. Please use the output with care.
2 |
--------------------------------------------------------------------------------
/test/compilationTests/corion/README.md:
--------------------------------------------------------------------------------
1 | CORION contracts, originally from
2 |
3 | https://github.com/CORIONplatform/solidity
4 |
--------------------------------------------------------------------------------
/test/compilationTests/gnosis/README.md:
--------------------------------------------------------------------------------
1 | Gnosis contracts, originally from
2 |
3 | https://github.com/gnosis/gnosis-contracts
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/external_function.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | function x() external {}
3 | }
4 | // ----
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/fallback_function.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | function() external { }
3 | }
4 | // ----
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/interface_basic.sol:
--------------------------------------------------------------------------------
1 | interface Interface {
2 | function f() external;
3 | }
4 | // ----
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/pragma/invalid_pragma.sol:
--------------------------------------------------------------------------------
1 | pragma 0;
2 | // ----
3 | // SyntaxError: (0-9): Invalid pragma "0"
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/mapping/mapping_dynamic_key.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | mapping(string => uint) data;
3 | }
4 |
--------------------------------------------------------------------------------
/test/libyul/functionSideEffects/empty_with_sstore.yul:
--------------------------------------------------------------------------------
1 | {
2 | sstore(0, 1)
3 | }
4 | // ----
5 | // : invalidatesStorage
6 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/rematerialiser/smoke.yul:
--------------------------------------------------------------------------------
1 | {}
2 | // ====
3 | // step: rematerialiser
4 | // ----
5 | // { }
6 |
--------------------------------------------------------------------------------
/scripts/travis-emscripten/deploy_key.enc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/geohot/solidity/HEAD/scripts/travis-emscripten/deploy_key.enc
--------------------------------------------------------------------------------
/test/cmdlineTests/object_compiler/err:
--------------------------------------------------------------------------------
1 | Warning: Yul and its optimizer are still experimental. Please use the output with care.
2 |
--------------------------------------------------------------------------------
/test/libsolidity/ASTJSON/short_type_name_ref.sol:
--------------------------------------------------------------------------------
1 | contract c { function f() public { uint[][] memory rows; } }
2 |
3 | // ----
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/506_large_storage_array_fine.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint[2**64 - 1] x;
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/comment_end_with_double_star.sol:
--------------------------------------------------------------------------------
1 | contract C1 {
2 | /**
3 | **/
4 | }
5 | contract C2 {}
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/function_type_state_variable.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function() x;
3 | function() y = x;
4 | }
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/viewPureChecker/suggest_pure.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function g() view public { }
3 | }
4 | // ----
5 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/expressionJoiner/smoke.yul:
--------------------------------------------------------------------------------
1 | { }
2 | // ====
3 | // step: expressionJoiner
4 | // ----
5 | // { }
6 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/expressionSplitter/smoke.yul:
--------------------------------------------------------------------------------
1 | { }
2 | // ====
3 | // step: expressionSplitter
4 | // ----
5 | // { }
6 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/functionGrouper/smoke.yul:
--------------------------------------------------------------------------------
1 | { }
2 | // ====
3 | // step: functionGrouper
4 | // ----
5 | // { { } }
6 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/functionHoister/smoke.yul:
--------------------------------------------------------------------------------
1 | {
2 | }
3 | // ====
4 | // step: functionHoister
5 | // ----
6 | // { }
7 |
--------------------------------------------------------------------------------
/test/libsolidity/ASTJSON/long_type_name_binary_operation.sol:
--------------------------------------------------------------------------------
1 | contract c { function f() public { uint a = 2 + 3; } }
2 |
3 | // ----
4 |
--------------------------------------------------------------------------------
/test/libsolidity/ASTJSON/modifier_definition.sol:
--------------------------------------------------------------------------------
1 | contract C { modifier M(uint i) { _; } function F() M(1) public {} }
2 |
3 | // ----
4 |
--------------------------------------------------------------------------------
/test/libsolidity/ASTJSON/modifier_invocation.sol:
--------------------------------------------------------------------------------
1 | contract C { modifier M(uint i) { _; } function F() M(1) public {} }
2 |
3 | // ----
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/422_interface_enums.sol:
--------------------------------------------------------------------------------
1 | interface I {
2 | enum A { B, C }
3 | }
4 | // ----
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/address_payable_constant.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | address payable constant a = address(0);
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/arrays_in_events.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | event e(uint[10] a, bytes7[8] indexed b, c[3] x);
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/import_empty.sol:
--------------------------------------------------------------------------------
1 | import "";
2 | // ----
3 | // ParserError: (9-10): Import path cannot be empty.
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/multi_arrays.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | mapping(uint => mapping(uint => int8)[8][][9])[] x;
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/visibility/interface/function_external.sol:
--------------------------------------------------------------------------------
1 | interface I {
2 | function f() external;
3 | }
4 | // ----
5 |
--------------------------------------------------------------------------------
/test/libyul/objectCompiler/namedObject.yul:
--------------------------------------------------------------------------------
1 | object "a" {
2 | code {}
3 | }
4 | // ----
5 | // Assembly:
6 | // -- empty bytecode --
7 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/expressionSimplifier/smoke.yul:
--------------------------------------------------------------------------------
1 | { }
2 | // ====
3 | // step: expressionSimplifier
4 | // ----
5 | // { }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/array/length/constant_var.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint constant LEN = 10;
3 | uint[LEN] ids;
4 | }
5 | // ----
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/metaTypes/name_constant.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | string public constant name = type(C).name;
3 | }
4 | // ----
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/187_large_utf8_codepoint.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | string s = "\xf0\x9f\xa6\x84";
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/251_using_for_library.sol:
--------------------------------------------------------------------------------
1 | library D { }
2 | contract C {
3 | using D for uint;
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/355_payable_external.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f() payable external {}
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/526_fallback_marked_external.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function () external { }
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/address_payable_library.sol:
--------------------------------------------------------------------------------
1 | library L {
2 | }
3 | contract C {
4 | using L for address payable;
5 | }
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/modifier_arguments.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | modifier mod(address a) { if (msg.sender == a) _; }
3 | }
4 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/conditionalSimplifier/smoke.yul:
--------------------------------------------------------------------------------
1 | { }
2 | // ====
3 | // step: conditionalSimplifier
4 | // ----
5 | // { }
6 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/conditionalUnsimplifier/smoke.yul:
--------------------------------------------------------------------------------
1 | { }
2 | // ====
3 | // step: conditionalUnsimplifier
4 | // ----
5 | // { }
6 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_type_sources/input.json:
--------------------------------------------------------------------------------
1 | {
2 | "language": "Solidity",
3 | "sources": ["source1", "source2", "source3"]
4 | }
5 |
--------------------------------------------------------------------------------
/test/compilationTests/MultiSigWallet/README.md:
--------------------------------------------------------------------------------
1 | MultiSigWallet contracts, originally from
2 |
3 | https://github.com/ConsenSys/MultiSigWallet
4 |
--------------------------------------------------------------------------------
/test/compilationTests/milestonetracker/README.md:
--------------------------------------------------------------------------------
1 | Giveth milestone tracker, originally from
2 |
3 | https://github.com/Giveth/milestonetracker/
4 |
--------------------------------------------------------------------------------
/test/compilationTests/stringutils/README.md:
--------------------------------------------------------------------------------
1 | String utilities, originally from
2 |
3 | https://github.com/Arachnid/solidity-stringutils
4 |
5 |
--------------------------------------------------------------------------------
/test/libsolidity/ASTJSON/long_type_name_identifier.sol:
--------------------------------------------------------------------------------
1 | contract c { uint[] a; function f() public { uint[] storage b = a; } }
2 |
3 | // ----
4 |
--------------------------------------------------------------------------------
/test/libsolidity/semanticTests/viaYul/smoke_test.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | }
3 | // ====
4 | // compileViaYul: true
5 | // ----
6 | // f() -> FAILURE
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/191_negative_integers_to_signed_min.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | int8 public i = -128;
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/ignores_constructor.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | constructor() public {}
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/event_arguments_indexed.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | event e(uint a, bytes32 indexed s, bool indexed b);
3 | }
4 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/disambiguator/smoke_yul.yul:
--------------------------------------------------------------------------------
1 | { }
2 | // ====
3 | // step: disambiguator
4 | // yul: true
5 | // ----
6 | // { }
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/imports/regular_import.sol:
--------------------------------------------------------------------------------
1 | ==== Source: a ====
2 | contract C {}
3 | ==== Source: b ====
4 | import "a"; contract D is C {}
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/084_events_with_same_name.sol:
--------------------------------------------------------------------------------
1 | contract TestIt {
2 | event A();
3 | event A(uint i);
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/import_complex_without_from.sol:
--------------------------------------------------------------------------------
1 | import {hello, world};
2 | // ----
3 | // ParserError: (21-22): Expected "from".
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/mapping/mapping_dynamic_key_public.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | mapping(string => uint) public data;
3 | }
4 | // ----
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/imports/library_name_clash_with_contract.sol:
--------------------------------------------------------------------------------
1 | ==== Source: a ====
2 | contract A {}
3 | ==== Source: b ====
4 | library A {}
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/074_fallback_function.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint x;
3 | function() external { x = 2; }
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/193_positive_integers_to_signed_out_of_bound_max.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | int8 public j = 127;
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/ignores_struct.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | struct a {
3 | uint msg;
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/assembly_evmasm_type.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public pure {
3 | assembly "evmasm" {}
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/function_no_body.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function functionName(bytes32 input) public returns (bytes32 out);
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/function_type_as_storage_variable.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function (uint, uint) internal returns (uint) f1;
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/pragma/unknown_pragma.sol:
--------------------------------------------------------------------------------
1 | pragma thisdoesntexist;
2 | // ----
3 | // SyntaxError: (0-23): Unknown pragma "thisdoesntexist"
4 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/smoke.yul:
--------------------------------------------------------------------------------
1 | { }
2 | // ====
3 | // step: commonSubexpressionEliminator
4 | // ----
5 | // { }
6 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/unusedPruner/multi_declarations.yul:
--------------------------------------------------------------------------------
1 | {
2 | let x, y
3 | }
4 | // ====
5 | // step: unusedPruner
6 | // ----
7 | // { }
8 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/unusedPruner/pop.yul:
--------------------------------------------------------------------------------
1 | {
2 | let a := 1
3 | pop(a)
4 | }
5 | // ====
6 | // step: unusedPruner
7 | // ----
8 | // { }
9 |
--------------------------------------------------------------------------------
/cmake/toolchains/emscripten.cmake:
--------------------------------------------------------------------------------
1 | include("${CMAKE_CURRENT_LIST_DIR}/default.cmake")
2 | include("$ENV{EMSCRIPTEN}/cmake/Modules/Platform/Emscripten.cmake")
3 |
--------------------------------------------------------------------------------
/scripts/download_ossfuzz_corpus.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 | set -e
3 | cd /tmp
4 | git clone --depth 1 https://github.com/ethereum/solidity-fuzzing-corpus.git
5 |
--------------------------------------------------------------------------------
/test/libsolidity/semanticTests/empty_contract.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | }
3 | // ====
4 | // compileViaYul: also
5 | // ----
6 | // i_am_not_there() -> FAILURE
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/104_empty_name_input_parameter.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f(uint) public { }
3 | }
4 | // ----
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/168_assignment_to_const_var_involving_conversion.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | C constant x = C(0x123);
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/modifier.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | modifier mod { if (msg.sender == 0x0000000000000000000000000000000000000000) _; }
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/no_function_params.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | uint256 stateVar;
3 | function functionName() public {}
4 | }
5 | // ----
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/viewPureChecker/creation_no_restrict_warning.sol:
--------------------------------------------------------------------------------
1 | contract D {}
2 | contract C {
3 | function f() public { new D(); }
4 | }
5 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/varDeclInitializer/simple.yul:
--------------------------------------------------------------------------------
1 | {
2 | let a
3 | }
4 | // ====
5 | // step: varDeclInitializer
6 | // ----
7 | // { let a := 0 }
8 |
--------------------------------------------------------------------------------
/test/cmdlineTests/require_overload/input.sol:
--------------------------------------------------------------------------------
1 | pragma solidity >=0.0;
2 | contract C {
3 | function f() public pure {
4 | require(this);
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/array/bytes_pop.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | bytes data;
3 | function test() public {
4 | data.pop();
5 | }
6 | }
7 | // ----
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/empty_struct.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | struct A {}
3 | }
4 | // ----
5 | // SyntaxError: (17-28): Defining empty structs is disallowed.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/getter/simple_struct.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | struct Y {
3 | uint b;
4 | }
5 | mapping(uint256 => Y) public m;
6 | }
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/imports/name_clash_in_import_5.sol:
--------------------------------------------------------------------------------
1 | ==== Source: a ====
2 | contract A {}
3 | ==== Source: b ====
4 | import {A} from "a"; contract B {}
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/modifiers/legal_modifier_override.sol:
--------------------------------------------------------------------------------
1 | contract A { modifier mod(uint a) { _; } }
2 | contract B is A { modifier mod(uint a) { _; } }
3 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/169_assignment_to_const_var_involving_expression.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint constant x = 0x123 + 0x456;
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/419_interface_structs.sol:
--------------------------------------------------------------------------------
1 | interface I {
2 | struct A {
3 | int dummy;
4 | }
5 | }
6 | // ----
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/438_unused_unnamed_function_parameter.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f(uint) pure public {
3 | }
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/497_gasleft.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public view returns (uint256 val) { return gasleft(); }
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/568_blockhash.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public view returns (bytes32) { return blockhash(3); }
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/address_in_struct.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | struct S {
3 | address payable a;
4 | address b;
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/mapping/library_argument_private.sol:
--------------------------------------------------------------------------------
1 | library L {
2 | function f(mapping(uint => uint) storage) private pure {
3 | }
4 | }
5 |
--------------------------------------------------------------------------------
/scripts/codespell_whitelist.txt:
--------------------------------------------------------------------------------
1 | iff
2 | nd
3 | assignend
4 | uint
5 | mut
6 | BA
7 | FO
8 | ba
9 | fo
10 | compilability
11 | errorstring
12 | hist
13 | otion
14 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_method_identifiers_requested/output.json:
--------------------------------------------------------------------------------
1 | {"contracts":{"A":{"C":{"evm":{"methodIdentifiers":{"f()":"26121ff0"}}}}},"sources":{"A":{"id":0}}}
2 |
--------------------------------------------------------------------------------
/test/evmc/README.md:
--------------------------------------------------------------------------------
1 | # EVMC
2 |
3 | This is an import of [EVMC](https://github.com/ethereum/evmc) version [7.0.0](https://github.com/ethereum/evmc/releases/tag/v7.0.0).
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/array/array_pop.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint[] data;
3 | function test() public {
4 | data.pop();
5 | }
6 | }
7 | // ----
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/086_events_with_same_name_different_types.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | event A(uint);
3 | event A(bytes);
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/106_empty_name_return_parameter.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f() public returns (bool) { }
3 | }
4 | // ----
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/146_external_argument_assign.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | function f(uint a) external pure { a = 1; }
3 | }
4 | // ----
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/147_external_argument_increment.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | function f(uint a) external pure { a++; }
3 | }
4 | // ----
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/170_assignment_to_const_var_involving_keccak.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | bytes32 constant x = keccak256("abc");
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/441_unused_unnamed_return_parameter.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() pure public returns (uint) {
3 | }
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/461_event_parameter_cannot_shadow_state_variable.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | address a;
3 | event E(address a);
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/warnUnused/function_parameter.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f(uint a) pure public {
3 | }
4 | }
5 | // ----
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/empty_enum.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | enum foo { }
3 | }
4 | // ----
5 | // ParserError: (25-26): enum with no members is not allowed.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/event_with_no_argument_list.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | event e;
3 | }
4 | // ----
5 | // ParserError: (21-22): Expected '(' but got ';'
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/from_is_not_keyword.sol:
--------------------------------------------------------------------------------
1 | // "from" is not a keyword although it is used as a keyword in import directives.
2 | contract from {
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/import_complex_invalid_from.sol:
--------------------------------------------------------------------------------
1 | import {hello, world} from function;
2 | // ----
3 | // ParserError: (27-35): Expected import path.
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/import_invalid_token.sol:
--------------------------------------------------------------------------------
1 | import function;
2 | // ----
3 | // ParserError: (7-15): Expected string literal (path), "*" or alias list.
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/import_simple.sol:
--------------------------------------------------------------------------------
1 | import "hello";
2 | // ----
3 | // ParserError: (0-15): Source "hello" not found: File not supplied initially.
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/bytes0.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | bytes0 b0 = 1;
3 | }
4 | // ----
5 | // DeclarationError: (15-21): Identifier not found or not unique.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/mapping/argument_private.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f(mapping(uint => uint) storage) private pure {
3 | }
4 | }
5 | // ----
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/mapping/library_argument_internal.sol:
--------------------------------------------------------------------------------
1 | library L {
2 | function f(mapping(uint => uint) storage) internal pure {
3 | }
4 | }
5 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/structuralSimplifier/if_false_condition.yul:
--------------------------------------------------------------------------------
1 | { if 0 { mstore(0, 0) } }
2 | // ====
3 | // step: structuralSimplifier
4 | // ----
5 | // { }
6 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/varNameCleaner/instructions.yul:
--------------------------------------------------------------------------------
1 | {
2 | let mul_256 := 1
3 | }
4 | // ====
5 | // step: varNameCleaner
6 | // ----
7 | // { let mul_1 := 1 }
8 |
--------------------------------------------------------------------------------
/scripts/isoltest.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 |
5 | REPO_ROOT="$(dirname "$0")"/..
6 | exec ${REPO_ROOT}/build/test/tools/isoltest --testpath ${REPO_ROOT}/test
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/imports/circular_import.sol:
--------------------------------------------------------------------------------
1 | ==== Source: a ====
2 | import "b"; contract C { D d; }
3 | ==== Source: b ====
4 | import "a"; contract D { C c; }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/metaTypes/name.sol:
--------------------------------------------------------------------------------
1 | contract Test {
2 | function f() public pure returns (string memory) {
3 | return type(Test).name;
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/metaTypes/typeNotRegularIdentifierContractName.sol:
--------------------------------------------------------------------------------
1 | contract type { }
2 | // ----
3 | // ParserError: (9-13): Expected identifier but got 'type'
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/085_events_with_same_name_unnamed_arguments.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | event A(uint);
3 | event A(uint, uint);
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/174_address_is_constant.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | address constant x = 0x1212121212121212121212121212121212121212;
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/415_interface_functions.sol:
--------------------------------------------------------------------------------
1 | interface I {
2 | function() external;
3 | function f() external;
4 | }
5 | // ----
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/421_interface_function_parameters.sol:
--------------------------------------------------------------------------------
1 | interface I {
2 | function f(uint a) external returns (bool);
3 | }
4 | // ----
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/446_no_unused_warning_abstract_arguments.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f(uint a) pure public returns (uint b);
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/trailing_dot3.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | uint a = 2.
3 | // ----
4 | // ParserError: (29-29): Expected identifier but got end of source
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/bytes256.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | bytes256 b256 = 1;
3 | }
4 | // ----
5 | // DeclarationError: (15-23): Identifier not found or not unique.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/bytes33.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | bytes33 b33 = 1;
3 | }
4 | // ----
5 | // DeclarationError: (15-22): Identifier not found or not unique.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/mapping/argument_internal.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f(mapping(uint => uint) storage) internal pure {
3 | }
4 | }
5 | // ----
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/mapping/library_argument_public.sol:
--------------------------------------------------------------------------------
1 | library L {
2 | function f(mapping(uint => uint) storage) public pure {
3 | }
4 | }
5 | // ----
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/mapping/library_array_argument_internal.sol:
--------------------------------------------------------------------------------
1 | library L {
2 | function f(mapping(uint => uint)[] storage) internal pure {
3 | }
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/mapping/library_array_argument_private.sol:
--------------------------------------------------------------------------------
1 | library L {
2 | function f(mapping(uint => uint)[] storage) private pure {
3 | }
4 | }
5 |
--------------------------------------------------------------------------------
/test/libyul/functionSideEffects/recursive_function.yul:
--------------------------------------------------------------------------------
1 | {
2 | function a() { a() }
3 | }
4 | // ----
5 | // : movable, sideEffectFree, sideEffectFreeIfNoMSize
6 | // a:
7 |
--------------------------------------------------------------------------------
/docs/_templates/layout.html:
--------------------------------------------------------------------------------
1 | {% extends "!layout.html" %}
2 |
3 | {% block menu %}
4 | {{ super() }}
5 | Keyword Index
6 | {% endblock %}
7 |
--------------------------------------------------------------------------------
/test/libsolidity/ASTJSON/contract_dep_order.sol:
--------------------------------------------------------------------------------
1 | contract A { }
2 | contract B is A { }
3 | contract C is B { }
4 | contract D is C { }
5 | contract E is D { }
6 |
7 | // ----
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/conversion/conversion_to_bytes.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f() public pure returns (bytes memory) {
3 | return bytes("abc");
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/inheritance/override/function_state_variable.sol:
--------------------------------------------------------------------------------
1 | interface ERC20 { function x() external returns (uint); }
2 | contract C is ERC20 { uint public x; }
3 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/061_missing_base_constructor_arguments.sol:
--------------------------------------------------------------------------------
1 | contract A { constructor(uint a) public { } }
2 | contract B is A { }
3 | // ----
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/062_base_constructor_arguments_override.sol:
--------------------------------------------------------------------------------
1 | contract A { constructor(uint a) public { } }
2 | contract B is A { }
3 | // ----
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/400_does_not_warn_msg_value_in_library.sol:
--------------------------------------------------------------------------------
1 | library C {
2 | function f() view public {
3 | msg.value;
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/445_no_unused_warning_interface_arguments.sol:
--------------------------------------------------------------------------------
1 | interface I {
2 | function f(uint a) pure external returns (uint b);
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/524_accept_library_creation.sol:
--------------------------------------------------------------------------------
1 | library L {}
2 | contract C {
3 | function f() public {
4 | new L();
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/560_event_emit_simple.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | event e();
3 | function f() public {
4 | emit e();
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/warnUnused/return_parameter.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() pure public returns (uint a) {
3 | }
4 | }
5 | // ----
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/constant_is_keyword.sol:
--------------------------------------------------------------------------------
1 | contract Foo {
2 | uint constant = 4;
3 | }
4 | // ----
5 | // ParserError: (30-31): Expected identifier but got '='
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/external_variable.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | uint external x;
3 | }
4 | // ----
5 | // ParserError: (19-27): Expected identifier but got 'external'
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/var_array.sol:
--------------------------------------------------------------------------------
1 | contract Foo {
2 | function f() { var[] a; }
3 | }
4 | // ----
5 | // ParserError: (34-35): Expected identifier but got '['
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/structs/recursion/struct_definition_not_really_recursive.sol:
--------------------------------------------------------------------------------
1 | contract Test {
2 | struct S1 { uint a; }
3 | struct S2 { S1 x; S1 y; }
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/address/address_to_contract.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public pure returns (C c) {
3 | c = C(address(2));
4 | }
5 | }
6 | // ----
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/mapping/array_argument_internal.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f(mapping(uint => uint)[] storage) internal pure {
3 | }
4 | }
5 | // ----
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/mapping/array_argument_private.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f(mapping(uint => uint)[] storage) private pure {
3 | }
4 | }
5 | // ----
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/mapping/library_argument_external.sol:
--------------------------------------------------------------------------------
1 | library L {
2 | function f(mapping(uint => uint) storage) external pure {
3 | }
4 | }
5 | // ----
6 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/expressionSimplifier/constants.yul:
--------------------------------------------------------------------------------
1 | { let a := add(1, mul(3, 4)) }
2 | // ====
3 | // step: expressionSimplifier
4 | // ----
5 | // { let a := 13 }
6 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/varNameCleaner/builtins.yul:
--------------------------------------------------------------------------------
1 | {
2 | let datasize_256 := 1
3 | }
4 | // ====
5 | // step: varNameCleaner
6 | // ----
7 | // { let datasize_1 := 1 }
8 |
--------------------------------------------------------------------------------
/scripts/Dockerfile_alpine:
--------------------------------------------------------------------------------
1 | FROM alpine
2 | MAINTAINER chriseth
3 |
4 | COPY upload/solc-static-linux /usr/local/bin/solc
5 | ENTRYPOINT ["/usr/local/bin/solc"]
6 |
--------------------------------------------------------------------------------
/test/libsolidity/ASTJSON/function_type.sol:
--------------------------------------------------------------------------------
1 | contract C { function f(function() external payable returns (uint) x) returns (function() external view returns (uint)) {} }
2 |
3 | // ----
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/conversion/implicit_conversion_from_storage_array_ref.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | int[10] x;
3 | int[] y;
4 | function f() public {
5 | y = x;
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/functionTypes/function_type.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() pure public {
3 | function(uint) returns (uint) x;
4 | x;
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/getter/complex_struct.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | struct Y {
3 | uint a;
4 | uint b;
5 | }
6 | mapping(uint256 => Y) public m;
7 | }
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/imports/relative_import_multiplex.sol:
--------------------------------------------------------------------------------
1 | ==== Source: a ====
2 | contract A {}
3 | ==== Source: dir/a/b/c ====
4 | import "../../.././a"; contract B is A {}
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/inheritance/allow_empty_duplicated_super_constructor_call.sol:
--------------------------------------------------------------------------------
1 | contract A { constructor() public { } }
2 | contract B is A { constructor() A() public { } }
3 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/057_legal_override_direct.sol:
--------------------------------------------------------------------------------
1 | contract B { function f() public {} }
2 | contract C is B { function f(uint i) public {} }
3 | // ----
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/442_named_return_parameter.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() pure public returns (uint a) {
3 | a = 1;
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/515_experimental_pragma_empty.sol:
--------------------------------------------------------------------------------
1 | pragma experimental;
2 | // ----
3 | // SyntaxError: (0-20): Experimental feature name is missing.
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/global_scope.sol:
--------------------------------------------------------------------------------
1 | contract msg {
2 | }
3 | // ----
4 | // Warning: (0-16): This declaration shadows a builtin symbol.
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/malformed_enum_declaration.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | enum foo { WARNING,}
3 | }
4 | // ----
5 | // ParserError: (33-34): Expected identifier after ','
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/address/address_payable_selfdestruct.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f(address payable a) public {
3 | selfdestruct(a);
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/address/contract_to_address.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public view {
3 | address a = address(this);
4 | a;
5 | }
6 | }
7 | // ----
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/index_access_for_bytes.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | bytes20 x;
3 | function f(bytes16 b) public view {
4 | b[uint8(x[2])];
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/viewPureChecker/interface.sol:
--------------------------------------------------------------------------------
1 | interface D {
2 | function f() view external;
3 | }
4 | contract C is D {
5 | function f() view external {}
6 | }
7 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/structuralSimplifier/if_true_condition.yul:
--------------------------------------------------------------------------------
1 | { if 1 { mstore(0, 0) } }
2 | // ====
3 | // step: structuralSimplifier
4 | // ----
5 | // { mstore(0, 0) }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/smtCheckerTests/types/function_type_as_argument.sol:
--------------------------------------------------------------------------------
1 | pragma experimental SMTChecker;
2 | contract C {
3 | function f(function(uint) external g) public {
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/constructor/constructible_internal_constructor.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | constructor() internal {}
3 | }
4 | contract D is C {
5 | constructor() public { }
6 | }
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/emit/emit_empty.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public {
3 | emit;
4 | }
5 | }
6 | // ----
7 | // ParserError: (45-46): Expected event name or path.
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/inlineAssembly/assignment_from_functiontype.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public pure {
3 | assembly {
4 | let x := f
5 | }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/115_exp_warn_literal_base_3.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f() pure public returns(uint) {
3 | return 2**80;
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/268_function_overload_array_type.sol:
--------------------------------------------------------------------------------
1 | contract M {
2 | function f(uint[] memory) public;
3 | function f(int[] memory) public;
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/459_function_overload_is_not_shadowing.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() pure public {}
3 | function f(uint) pure public {}
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/import_complex.sol:
--------------------------------------------------------------------------------
1 | import {hello, world} from "hello";
2 | // ----
3 | // ParserError: (0-35): Source "hello" not found: File not supplied initially.
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/mapping_nonelementary_key_1.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | mapping(uint[] => uint) data;
3 | }
4 | // ----
5 | // ParserError: (26-27): Expected '=>' but got '['
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/scoping/scoping_for2.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f() pure public {
3 | for (uint x = 0; x < 10; x ++)
4 | x = 2;
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/structs/recursion/struct_definition_not_really_recursive_array.sol:
--------------------------------------------------------------------------------
1 | contract Test {
2 | struct S1 { uint a; }
3 | struct S2 { S1[1] x; S1[1] y; }
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/unterminatedBlocks/one_dot.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | function f() pure public { 1.
3 | // ----
4 | // ParserError: (47-47): Expected identifier but got end of source
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/unterminatedBlocks/zero_dot.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | function f() pure public { 0.
3 | // ----
4 | // ParserError: (47-47): Expected identifier but got end of source
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/viewPureChecker/constant.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint constant x = 2;
3 | function k() pure public returns (uint) {
4 | return x;
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/controlFlowSimplifier/empty_if_non_movable_condition.yul:
--------------------------------------------------------------------------------
1 | { if mload(0) {} }
2 | // ====
3 | // step: controlFlowSimplifier
4 | // ----
5 | // { pop(mload(0)) }
6 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/unusedPruner/multi_declare.yul:
--------------------------------------------------------------------------------
1 | {
2 | function f() -> x, y { }
3 | let a, b := f()
4 | }
5 | // ====
6 | // step: unusedPruner
7 | // ----
8 | // { }
9 |
--------------------------------------------------------------------------------
/test/.solhint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "solhint:default",
3 | "plugins": [],
4 | "rules": {
5 | "compiler-fixed": "off",
6 | "no-inline-assembly": "off"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/array/length/can_be_constant_in_struct.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint constant LEN = 10;
3 | struct Test {
4 | uint[LEN] ids;
5 | }
6 | }
7 | // ----
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/array/length/can_be_recursive_constant.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint constant L = 5;
3 | uint constant LEN = L + 4 * L;
4 | uint[LEN] ids;
5 | }
6 | // ----
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/controlFlow/unreachableCode/comment_fine.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public pure {
3 | return;
4 | // unreachable comment
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/dataLocations/libraryExternalFunction/function_argument_location_specifier_test_external_storage.sol:
--------------------------------------------------------------------------------
1 | library test {
2 | function f(bytes storage) external;
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/dataLocations/publicFunction/function_argument_location_specifier_test_public_memory.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f(bytes memory) public;
3 | }
4 | // ----
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/literal_comparisons.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f(int8 x) public pure {
3 | if (x == 1) {}
4 | if (1 == x) {}
5 | }
6 | }
7 | // ----
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/modifiers/modifier_without_underscore.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | modifier m() {}
3 | }
4 | // ----
5 | // SyntaxError: (33-35): Modifier body does not contain '_'.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/004_reference_to_later_declaration.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function g() public { f(); }
3 | function f() public {}
4 | }
5 | // ----
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/118_shift_warn_literal_base_3.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f() pure public returns(uint) {
3 | return 2 << 80;
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/398_does_not_warn_msg_value_in_payable_function.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() payable public {
3 | msg.value;
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/399_does_not_warn_msg_value_in_internal_function.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() view internal {
3 | msg.value;
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/fixed_literal_with_double_radix.sol:
--------------------------------------------------------------------------------
1 | contract A {
2 | fixed40x40 pi = 3.14.15;
3 | }
4 | // ----
5 | // ParserError: (34-37): Expected ';' but got 'Number'
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/mapping_nonelementary_key_4.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | mapping(string[] => uint) data;
3 | }
4 | // ----
5 | // ParserError: (28-29): Expected '=>' but got '['
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/missing_variable_name_in_declaration.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | uint256 ;
3 | }
4 | // ----
5 | // ParserError: (28-29): Expected identifier but got ';'
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/new_invalid_type_name.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() {
3 | new var;
4 | }
5 | }
6 | // ----
7 | // ParserError: (35-38): Expected explicit type name.
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/single_function_param.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | uint256 stateVar;
3 | function functionName(bytes32 input) public returns (bytes32 out) {}
4 | }
5 | // ----
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/var_storage_var.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | var a;
3 | }
4 | // ----
5 | // ParserError: (17-20): Function, variable, struct or modifier declaration expected.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/mapping/function_type_argument_internal.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f(function(mapping(uint=>uint) storage) internal) internal pure {
3 | }
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/rational_negative_numerator_negative_exp.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public pure returns (int) {
3 | return (-1 / 2) ** -1;
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/expressionSimplifier/reversed.yul:
--------------------------------------------------------------------------------
1 | {
2 | let a := add(0, mload(0))
3 | }
4 | // ====
5 | // step: expressionSimplifier
6 | // ----
7 | // { let a := mload(0) }
8 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/mainFunction/smoke.yul:
--------------------------------------------------------------------------------
1 | {}
2 | // ====
3 | // step: mainFunction
4 | // yul: true
5 | // ----
6 | // {
7 | // function main()
8 | // { }
9 | // }
10 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/unusedPruner/functions.yul:
--------------------------------------------------------------------------------
1 | {
2 | function f() { let a := 1 }
3 | function g() { f() }
4 | }
5 | // ====
6 | // step: unusedPruner
7 | // ----
8 | // { }
9 |
--------------------------------------------------------------------------------
/test/libsolidity/smtCheckerTests/control_flow/assignment_in_declaration.sol:
--------------------------------------------------------------------------------
1 | pragma experimental SMTChecker;
2 | contract C {
3 | function f() public pure { uint a = 2; assert(a == 2); }
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/constructor/external_constructor.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | constructor() external {}
3 | }
4 | // ----
5 | // TypeError: (17-42): Constructor must be public or internal.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/dataLocations/internalFunction/function_argument_location_specifier_test_internal_memory.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f(bytes memory) internal;
3 | }
4 | // ----
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/dataLocations/libraryExternalFunction/function_argument_location_specifier_test_external_calldata.sol:
--------------------------------------------------------------------------------
1 | library test {
2 | function f(bytes calldata) external;
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/dataLocations/libraryInternalFunction/function_argument_location_specifier_test_internal_memory.sol:
--------------------------------------------------------------------------------
1 | library test {
2 | function f(bytes memory) internal pure {}
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/functionTypes/external_function_type_to_address.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public view returns (address) {
3 | return address(this.f);
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/imports/import_is_transitive.sol:
--------------------------------------------------------------------------------
1 | ==== Source: a ====
2 | contract C { }
3 | ==== Source: b ====
4 | import "a";
5 | ==== Source: c ====
6 | import "b";
7 | contract D is C {}
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/metaTypes/typeNotRegularIdentifierStateVariable.sol:
--------------------------------------------------------------------------------
1 | contract Test {
2 | uint type;
3 | }
4 | // ----
5 | // ParserError: (25-29): Expected identifier but got 'type'
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/multiVariableDeclaration/multiSingleVariableDeclaration.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() internal returns (uint) {
3 | (uint a) = f();
4 | a;
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/082_anonymous_event_four_indexed.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | event e(uint indexed a, bytes3 indexed b, bool indexed c, uint indexed d) anonymous;
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/095_multiple_events_argument_clash.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | event e1(uint a, uint e1, uint e2);
3 | event e2(uint a, uint e1, uint e2);
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/226_inheriting_library.sol:
--------------------------------------------------------------------------------
1 | contract Test {}
2 | library Lib is Test {}
3 | // ----
4 | // TypeError: (17-39): Library is not allowed to inherit.
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/227_library_having_variables.sol:
--------------------------------------------------------------------------------
1 | library Lib { uint x; }
2 | // ----
3 | // TypeError: (14-20): Library cannot have non-constant state variables
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/353_callcode_not_deprecated_as_function.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function callcode() pure public {
3 | test.callcode();
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/418_interface_inheritance.sol:
--------------------------------------------------------------------------------
1 | interface A {
2 | }
3 | interface I is A {
4 | }
5 | // ----
6 | // TypeError: (31-32): Interfaces cannot inherit.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/420_interface_variables.sol:
--------------------------------------------------------------------------------
1 | interface I {
2 | uint a;
3 | }
4 | // ----
5 | // TypeError: (18-24): Variables cannot be declared in interfaces.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/431_bare_assert.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() pure public { assert; }
3 | }
4 | // ----
5 | // Warning: (44-50): Statement has no effect.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/modifier_without_semicolon.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | modifier mod { if (msg.sender == 0) _ }
3 | }
4 | // ----
5 | // ParserError: (52-53): Expected ';' but got '}'
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/new_address_payable.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public pure returns(address payable[] memory m) {
3 | m = new address payable[](10);
4 | }
5 | }
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/payable_accessor.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | uint payable x;
3 | }
4 | // ----
5 | // ParserError: (22-29): State mutability can only be specified for address types.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/struct_definition.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | uint256 stateVar;
3 | struct MyStructName {
4 | address addr;
5 | uint256 count;
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/string/string_unterminated_no_new_line.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f() pure public { "abc\
3 | // ----
4 | // ParserError: (47-53): Expected string end-quote.
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/address/uint_to_payable_address.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f(uint x) public pure returns (address payable) {
3 | return address(x);
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/mapping/function_type_return_internal.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f(function() internal returns (mapping(uint=>uint) storage)) internal pure {
3 | }
4 | }
5 |
--------------------------------------------------------------------------------
/test/libyul/functionSideEffects/with_loop.yul:
--------------------------------------------------------------------------------
1 | {
2 | function f() -> x { x := g() }
3 | function g() -> x { for {} 1 {} {} }
4 | pop(f())
5 | }
6 | // ----
7 | // :
8 | // f:
9 | // g:
10 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/fullSimplify/constants.yul:
--------------------------------------------------------------------------------
1 | {
2 | let a := add(1, mul(3, 4))
3 | mstore(0, a)
4 | }
5 | // ====
6 | // step: fullSimplify
7 | // ----
8 | // { mstore(0, 13) }
9 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/ssaReverser/self_assign.yul:
--------------------------------------------------------------------------------
1 | {
2 | let a := calldataload(0)
3 | a := a
4 | }
5 | // ====
6 | // step: ssaReverser
7 | // ----
8 | // { let a := calldataload(0) }
9 |
--------------------------------------------------------------------------------
/.dockerignore:
--------------------------------------------------------------------------------
1 | # out-of-tree builds usually go here. This helps improving performance of uploading
2 | # the build context to the docker image build server
3 | /build
4 |
5 | # in-tree builds
6 | /deps
7 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_key_root/output.json:
--------------------------------------------------------------------------------
1 | {"errors":[{"component":"general","formattedMessage":"Unknown key \"key1\"","message":"Unknown key \"key1\"","severity":"error","type":"JSONError"}]}
2 |
--------------------------------------------------------------------------------
/test/libsolidity/semanticTests/storage/simple_accessor.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | uint256 public data;
3 | constructor() public {
4 | data = 8;
5 | }
6 | }
7 | // ----
8 | // data() -> 8
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/constructor/constructor_no_visibility.sol:
--------------------------------------------------------------------------------
1 | contract A { constructor() {} }
2 | // ----
3 | // SyntaxError: (13-29): No visibility specified. Did you intend to add "public"?
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/dataLocations/externalFunction/function_argument_location_specifier_test_external_calldata.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f(bytes calldata) external;
3 | }
4 | // ----
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/dataLocations/internalFunction/function_argument_location_specifier_test_internal_storage.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f(bytes storage) internal;
3 | }
4 | // ----
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/dataLocations/libraryInternalFunction/function_argument_location_specifier_test_internal_storage.sol:
--------------------------------------------------------------------------------
1 | library test {
2 | function f(bytes storage) internal pure {}
3 | }
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/denominations/deprecated_year.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint constant a = 3 years;
3 | }
4 | // ----
5 | // TypeError: (32-39): Using "years" as a unit denomination is deprecated.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/functionTypes/function_type_struct.sol:
--------------------------------------------------------------------------------
1 | library L
2 | {
3 | struct Nested
4 | {
5 | uint y;
6 | }
7 | function f(function(Nested memory) external) external pure {}
8 | }
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/modifiers/function_modifier_double_invocation.sol:
--------------------------------------------------------------------------------
1 | contract B {
2 | function f(uint x) mod(x) mod(2) public pure { }
3 | modifier mod(uint a) { if (a > 0) _; }
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/139_no_name_suggestion.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | function g() public { fun(); }
3 | }
4 | // ----
5 | // DeclarationError: (39-42): Undeclared identifier.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/155_array_copy_with_different_types_static_dynamic.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | uint32[] a;
3 | uint8[80] b;
4 | function f() public { a = b; }
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/225_inheriting_from_library.sol:
--------------------------------------------------------------------------------
1 | library Lib {}
2 | contract Test is Lib {}
3 | // ----
4 | // TypeError: (32-35): Libraries cannot be inherited from.
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/460_function_override_is_not_shadowing.sol:
--------------------------------------------------------------------------------
1 | contract D { function f() pure public {} }
2 | contract C is D {
3 | function f(uint) pure public {}
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/487_function_types_selector_4.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() pure external returns (bytes4) {
3 | return this.f.selector;
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/events.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | event keccak256();
3 | }
4 | // ----
5 | // Warning: (17-35): This declaration shadows a builtin symbol.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/storage_variables.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint msg;
3 | }
4 | // ----
5 | // Warning: (17-25): This declaration shadows a builtin symbol.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/address_public_payable_error.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | address public payable a;
3 | }
4 | // ----
5 | // ParserError: (32-39): Expected identifier but got 'payable'
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/emit_without_event.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | event A();
3 | function f() {
4 | emit A;
5 | }
6 | }
7 | // ----
8 | // ParserError: (49-50): Expected '(' but got ';'
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/empty_function.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | uint256 stateVar;
3 | function functionName(bytes20 arg1, address addr) public view returns (int id) { }
4 | }
5 | // ----
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/location_specifiers_for_state_variables.sol:
--------------------------------------------------------------------------------
1 | contract Foo {
2 | uint[] memory x;
3 | }
4 | // ----
5 | // ParserError: (23-29): Expected identifier but got 'memory'
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/tuples_without_commas.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() {
3 | var a = (2 2);
4 | }
5 | }
6 | // ----
7 | // ParserError: (42-43): Expected ',' but got 'Number'
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/scoping/scoping_for.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f() pure public {
3 | for (uint x = 0; x < 10; x ++){
4 | x = 2;
5 | }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/address/bytes_to_payable_address.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f(bytes20 x) public pure returns (address payable) {
3 | return address(x);
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/library_to_address.sol:
--------------------------------------------------------------------------------
1 | library L {
2 | }
3 | contract C {
4 | function f() public pure returns (address) {
5 | return address(L);
6 | }
7 | }
8 | // ----
9 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/expressionSimplifier/constant_propagation.yul:
--------------------------------------------------------------------------------
1 | { let a := add(7, sub(mload(0), 7)) }
2 | // ====
3 | // step: expressionSimplifier
4 | // ----
5 | // { let a := mload(0) }
6 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_key_metadata/output.json:
--------------------------------------------------------------------------------
1 | {"errors":[{"component":"general","formattedMessage":"Unknown key \"key1\"","message":"Unknown key \"key1\"","severity":"error","type":"JSONError"}]}
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_key_optimizer/output.json:
--------------------------------------------------------------------------------
1 | {"errors":[{"component":"general","formattedMessage":"Unknown key \"key1\"","message":"Unknown key \"key1\"","severity":"error","type":"JSONError"}]}
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_key_settings/output.json:
--------------------------------------------------------------------------------
1 | {"errors":[{"component":"general","formattedMessage":"Unknown key \"key1\"","message":"Unknown key \"key1\"","severity":"error","type":"JSONError"}]}
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_key_source/output.json:
--------------------------------------------------------------------------------
1 | {"errors":[{"component":"general","formattedMessage":"Unknown key \"key1\"","message":"Unknown key \"key1\"","severity":"error","type":"JSONError"}]}
2 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/array/length/too_large.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint[8**90] ids;
3 | }
4 | // ----
5 | // TypeError: (22-27): Invalid array length, expected integer literal or constant expression.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/array/length/tuples.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint[(1,2)] a15;
3 | }
4 | // ----
5 | // TypeError: (22-27): Invalid array length, expected integer literal or constant expression.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/constants/cyclic_dependency_1.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint constant a = a;
3 | }
4 | // ----
5 | // TypeError: (17-36): The value of the constant a has a cyclic dependency via a.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/constructor/constructor_without_implementation.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | constructor() public;
3 | }
4 | // ----
5 | // TypeError: (14-35): Constructor must be implemented if declared.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/controlFlow/storageReturn/unimplemented_library.sol:
--------------------------------------------------------------------------------
1 | library L {
2 | function f() public returns(uint[] storage);
3 | function g() public returns(uint[] storage s);
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/double_stateVariable_declaration.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | uint256 variable;
3 | uint128 variable;
4 | }
5 | // ----
6 | // DeclarationError: (36-52): Identifier already declared.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/inheritance/base_arguments_no_parentheses.sol:
--------------------------------------------------------------------------------
1 | contract Base {
2 | constructor(uint) public {}
3 | }
4 | contract Derived is Base(2) { }
5 | contract Derived2 is Base, Derived {}
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/multiSource/import_not_found.sol:
--------------------------------------------------------------------------------
1 | ==== Source: a ====
2 | import "b";
3 | contract C {}
4 | // ----
5 | // ParserError: (a:0-11): Source "b" not found: File not supplied initially.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/058_legal_override_indirect.sol:
--------------------------------------------------------------------------------
1 | contract A { function f(uint a) public {} }
2 | contract B { function f() public {} }
3 | contract C is A, B { }
4 | // ----
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/154_array_copy_with_different_types_conversion_possible.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | uint32[] a;
3 | uint8[] b;
4 | function f() public { a = b; }
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/157_array_of_undeclared_type.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | a[] public foo;
3 | }
4 | // ----
5 | // DeclarationError: (17-18): Identifier not found or not unique.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/175_uninitialized_const_variable.sol:
--------------------------------------------------------------------------------
1 | contract Foo {
2 | uint constant y;
3 | }
4 | // ----
5 | // TypeError: (19-34): Uninitialized "constant" variable.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/252_using_for_not_library.sol:
--------------------------------------------------------------------------------
1 | contract D { }
2 | contract C {
3 | using D for uint;
4 | }
5 | // ----
6 | // TypeError: (38-39): Library name expected.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/423_using_interface.sol:
--------------------------------------------------------------------------------
1 | interface I {
2 | function f() external;
3 | }
4 | contract C is I {
5 | function f() public {
6 | }
7 | }
8 | // ----
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/430_bare_selfdestruct.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() pure public { selfdestruct; }
3 | }
4 | // ----
5 | // Warning: (44-56): Statement has no effect.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/443_named_return_parameter_with_explicit_return.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() pure public returns (uint a) {
3 | return 1;
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/444_unnamed_return_parameter_with_explicit_return.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() pure public returns (uint) {
3 | return 1;
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/516_experimental_pragma_unknown_number_literal.sol:
--------------------------------------------------------------------------------
1 | pragma experimental 123;
2 | // ----
3 | // SyntaxError: (0-24): Unsupported experimental feature name.
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/519_experimental_pragma_empy_string_literal.sol:
--------------------------------------------------------------------------------
1 | pragma experimental "";
2 | // ----
3 | // SyntaxError: (0-23): Empty experimental feature name is invalid.
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/520_experimental_pragma_multiple_same_line.sol:
--------------------------------------------------------------------------------
1 | pragma experimental unsupportedName unsupportedName;
2 | // ----
3 | // SyntaxError: (0-52): Stray arguments.
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/natspec/docstring_empty_tag.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | /// @param
3 | function vote(uint id) public;
4 | }
5 | // ----
6 | // DocstringParsingError: End of tag @param not found
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/mapping_from_address_payable.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | mapping(address payable => uint) m;
3 | }
4 | // ----
5 | // ParserError: (33-40): Expected '=>' but got 'payable'
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/scientific_notation.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | uint256 a = 2e10;
3 | uint256 b = 2E10;
4 | uint256 c = 200e-2;
5 | uint256 d = 2E10 wei;
6 | uint256 e = 2.5e10;
7 | }
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/contract_to_base.sol:
--------------------------------------------------------------------------------
1 | contract A {}
2 | contract B is A {}
3 | contract C {
4 | function f() public {
5 | A a = new B();
6 | a;
7 | }
8 | }
9 | // ----
10 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/visibility/interface/function_internal.sol:
--------------------------------------------------------------------------------
1 | interface I {
2 | function f() internal;
3 | }
4 | // ----
5 | // TypeError: (15-37): Functions in interfaces must be declared external.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/visibility/interface/function_private.sol:
--------------------------------------------------------------------------------
1 | interface I {
2 | function f() private;
3 | }
4 | // ----
5 | // TypeError: (15-36): Functions in interfaces must be declared external.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/visibility/interface/function_public.sol:
--------------------------------------------------------------------------------
1 | interface I {
2 | function f() public;
3 | }
4 | // ----
5 | // TypeError: (15-35): Functions in interfaces must be declared external.
6 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_complex.yul:
--------------------------------------------------------------------------------
1 | { let a := sub(calldataload(0), calldataload(0)) }
2 | // ====
3 | // step: expressionSimplifier
4 | // ----
5 | // { let a := 0 }
6 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_simple.yul:
--------------------------------------------------------------------------------
1 | {
2 | let a := mload(0)
3 | mstore(0, sub(a, a))
4 | }
5 | // ====
6 | // step: fullSimplify
7 | // ----
8 | // { mstore(0, 0) }
9 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/redundantAssignEliminator/simple.yul:
--------------------------------------------------------------------------------
1 | {
2 | let a
3 | a := 1
4 | a := 2
5 | }
6 | // ====
7 | // step: redundantAssignEliminator
8 | // ----
9 | // { let a }
10 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/structuralSimplifier/if_unassigned_condition.yul:
--------------------------------------------------------------------------------
1 | {
2 | let x
3 | if x { mstore(0, 0) }
4 | }
5 | // ====
6 | // step: structuralSimplifier
7 | // ----
8 | // { let x }
9 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/unusedPruner/trivial.yul:
--------------------------------------------------------------------------------
1 | {
2 | let a := 1
3 | let b := 1
4 | mstore(0, 1)
5 | }
6 | // ====
7 | // step: unusedPruner
8 | // ----
9 | // { mstore(0, 1) }
10 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_key_auxiliary_input/output.json:
--------------------------------------------------------------------------------
1 | {"errors":[{"component":"general","formattedMessage":"Unknown key \"key1\"","message":"Unknown key \"key1\"","severity":"error","type":"JSONError"}]}
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/strict_asm_jump/err:
--------------------------------------------------------------------------------
1 | Warning: Yul and its optimizer are still experimental. Please use the output with care.
2 | strict_asm_jump/input.sol:1:3: Error: Function not found.
3 | { jump(1) }
4 | ^--^
5 |
--------------------------------------------------------------------------------
/test/libsolidity/smtCheckerTests/types/bool_simple_5.sol:
--------------------------------------------------------------------------------
1 | pragma experimental SMTChecker;
2 | contract C {
3 | function f(bool x) public pure {
4 | bool y = x;
5 | assert(x == y);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/test/libsolidity/smtCheckerTests/verification_target/simple_assert_with_require.sol:
--------------------------------------------------------------------------------
1 | pragma experimental SMTChecker;
2 | contract C {
3 | function f(uint a) public pure { require(a < 10); assert(a < 20); }
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/array/length/inline_array.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint[[2]] a15;
3 | }
4 | // ----
5 | // TypeError: (22-25): Invalid array length, expected integer literal or constant expression.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/array/length/invalid_expression_5.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint[3/0] ids;
3 | }
4 | // ----
5 | // TypeError: (22-25): Operator / not compatible with types int_const 3 and int_const 0
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/controlFlow/storageReturn/unimplemented_internal.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() internal returns(uint[] storage);
3 | function g() internal returns(uint[] storage s);
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/functionTypes/function_type_returned.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public pure returns (function(uint) pure external returns (uint) g) {
3 | return g;
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/354_payable_in_library.sol:
--------------------------------------------------------------------------------
1 | library test {
2 | function f() payable public {}
3 | }
4 | // ----
5 | // TypeError: (19-49): Library functions cannot be payable.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/357_payable_private.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f() payable private {}
3 | }
4 | // ----
5 | // TypeError: (20-51): Internal functions cannot be payable.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/425_interface_implement_public_contract.sol:
--------------------------------------------------------------------------------
1 | interface I {
2 | function f() external;
3 | }
4 | contract C is I {
5 | function f() public {
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/447_no_unused_warnings.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f(uint a) pure public returns (uint b) {
3 | uint c = 1;
4 | b = a + c;
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/483_modifiers_access_storage_pointer.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | struct S { uint a; }
3 | modifier m(S storage x) {
4 | x;
5 | _;
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/address_constant_payable.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | address constant payable b = address(0);
3 | }
4 | // ----
5 | // ParserError: (34-41): Expected identifier but got 'payable'
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/arrays_in_storage.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | uint[10] a;
3 | uint[] a2;
4 | struct x { uint[2**20] b; y[1] c; }
5 | struct y { uint d; mapping(uint=>x)[] e; }
6 | }
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/function_type_as_parameter.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f(function(uint) external returns (uint) g) internal returns (uint a) {
3 | return g(1);
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/location_specifiers_with_var.sol:
--------------------------------------------------------------------------------
1 | contract Foo {
2 | function f() { var memory x; }
3 | }
4 | // ----
5 | // ParserError: (35-41): Location specifier needs explicit type name.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/single_function_param_trailing_comma.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function(uint a,) {}
3 | }
4 | // ----
5 | // ParserError: (32-33): Unexpected trailing comma in parameter list.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_single_return.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public pure returns (bool) {
3 | return abi.decode("abc", (uint)) == 2;
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_singletontuple.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public pure returns (uint) {
3 | return abi.decode("abc", (uint));
4 | }
5 | }
6 | // ----
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/viewPureChecker/overriding_no_restrict_warning.sol:
--------------------------------------------------------------------------------
1 | contract D {
2 | uint x;
3 | function f() public { x = 2; }
4 | }
5 | contract C is D {
6 | function f() public {}
7 | }
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/visibility/function_no_visibility.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() pure { }
3 | }
4 | // ----
5 | // SyntaxError: (17-38): No visibility specified. Did you intend to add "public"?
6 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/unusedPruner/no_msize.yul:
--------------------------------------------------------------------------------
1 | {
2 | let a := 1
3 | let b := mload(10)
4 | sstore(0, 5)
5 | }
6 | // ====
7 | // step: unusedPruner
8 | // ----
9 | // { sstore(0, 5) }
10 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contribution Guidelines
2 |
3 | Please see our contribution guidelines in [the Solidity documentation](http://solidity.readthedocs.io/en/latest/contributing.html).
4 |
5 | Thank you for your help!
6 |
--------------------------------------------------------------------------------
/cmake/toolchains/cxx20.cmake:
--------------------------------------------------------------------------------
1 | # Require C++20.
2 | set(CMAKE_CXX_STANDARD 20) # This requires at least CMake 3.12 to understand this C++20 flag
3 | set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
4 | set(CMAKE_CXX_EXTENSIONS OFF)
5 |
--------------------------------------------------------------------------------
/cmake/toolchains/default.cmake:
--------------------------------------------------------------------------------
1 | # Require C++17.
2 | set(CMAKE_CXX_STANDARD 17) # This requires at least CMake 3.8 to accept this C++17 flag.
3 | set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
4 | set(CMAKE_CXX_EXTENSIONS OFF)
5 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_type_root/output.json:
--------------------------------------------------------------------------------
1 | {"errors":[{"component":"general","formattedMessage":"Input is not a JSON object.","message":"Input is not a JSON object.","severity":"error","type":"JSONError"}]}
2 |
--------------------------------------------------------------------------------
/test/libsolidity/semanticTests/expressions/exp_operator_const.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f() public returns(uint d) { return 2 ** 3; }
3 | }
4 | // ====
5 | // compileViaYul: also
6 | // ----
7 | // f() -> 8
8 |
--------------------------------------------------------------------------------
/test/libsolidity/semanticTests/expressions/exp_zero_literal.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f() public returns(uint d) { return 0 ** 0; }
3 | }
4 | // ====
5 | // compileViaYul: also
6 | // ----
7 | // f() -> 1
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/controlFlow/mappingReturn/named_fine.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | mapping(uint=>uint) m;
3 | function f() internal view returns (mapping(uint=>uint) storage r) { r = m; }
4 | }
5 | // ----
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/functionTypes/internal_function_as_external_parameter_in_library_internal.sol:
--------------------------------------------------------------------------------
1 | library L {
2 | function f(function(uint) internal returns (uint) /*x*/) pure internal {
3 | }
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/functionTypes/warn_function_type_parameters_with_names.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function(uint a) f;
3 | }
4 | // ----
5 | // Warning: (26-32): Naming function type parameters is deprecated.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/inheritance/override/external_turns_public_no_params.sol:
--------------------------------------------------------------------------------
1 | contract A {
2 | function f() external pure {}
3 | }
4 | contract B is A {
5 | function f() public pure {
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/inlineAssembly/assignment_from_library.sol:
--------------------------------------------------------------------------------
1 | library L {
2 | }
3 |
4 | contract C {
5 | function f() public pure {
6 | assembly {
7 | let x := L
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/inlineAssembly/no_unused_variable_warning.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() pure public {
3 | uint a;
4 | assembly {
5 | a := 1
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/literalOperations/mod_zero.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint constant b3 = 1 % 0;
3 | }
4 | // ----
5 | // TypeError: (36-41): Operator % not compatible with types int_const 1 and int_const 0
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/modifiers/constructor_as_modifier.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | constructor() C() public {}
3 | }
4 | // ----
5 | // TypeError: (31-34): Referenced declaration is neither modifier nor base class.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/076_fallback_function_in_library.sol:
--------------------------------------------------------------------------------
1 | library C {
2 | function() external {}
3 | }
4 | // ----
5 | // TypeError: (16-38): Libraries cannot have fallback functions.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/080_event.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | event e(uint indexed a, bytes3 indexed s, bool indexed b);
3 | function f() public { emit e(2, "abc", true); }
4 | }
5 | // ----
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/090_event_call.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | event e(uint a, bytes3 indexed s, bool indexed b);
3 | function f() public { emit e(2, "abc", true); }
4 | }
5 | // ----
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/214_assignment_mem_storage_variable_directly.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint[] data;
3 | function f(uint[] memory x) public {
4 | data = x;
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/298_invalid_fixed_types_0x7_mxn.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | fixed0x7 a = .3;
3 | }
4 | // ----
5 | // DeclarationError: (20-28): Identifier not found or not unique.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/345_unused_return_value.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function g() public returns (uint) {}
3 | function f() public {
4 | g();
5 | }
6 | }
7 | // ----
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/356_payable_internal.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f() payable internal {}
3 | }
4 | // ----
5 | // TypeError: (20-52): Internal functions cannot be payable.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/434_pure_statement_check_for_regular_for_loop.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() pure public {
3 | for (uint x = 0; true; x++)
4 | {}
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/479_explicit_literal_to_memory_string_assignment.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() pure public {
3 | string memory x = "abc";
4 | x;
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/517_experimental_pragma_unknown_string_literal.sol:
--------------------------------------------------------------------------------
1 | pragma experimental unsupportedName;
2 | // ----
3 | // SyntaxError: (0-36): Unsupported experimental feature name.
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/529_fallback_marked_public.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function () public { }
3 | }
4 | // ----
5 | // TypeError: (17-39): Fallback function must be defined as "external".
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/warnUnused/local.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() pure public {
3 | uint a;
4 | }
5 | }
6 | // ----
7 | // Warning: (52-58): Unused local variable.
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/assembly_invalid_type.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public pure {
3 | assembly "failasm" {}
4 | }
5 | }
6 | // ----
7 | // ParserError: (55-64): Only "evmasm" supported.
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_simple.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public pure returns (uint, bytes32, C) {
3 | return abi.decode("abc", (uint, bytes32, C));
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/tupleAssignments/nowarn_swap_memory.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | struct S { uint a; uint b; }
3 | function f() pure public {
4 | S memory x;
5 | S memory y;
6 | (x, y) = (y, x);
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/test/libyul/functionSideEffects/doubly_recursive_function.yul:
--------------------------------------------------------------------------------
1 | {
2 | function a() { b() }
3 | function b() { a() }
4 | }
5 | // ----
6 | // : movable, sideEffectFree, sideEffectFreeIfNoMSize
7 | // a:
8 | // b:
9 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_optimizer_invalid_details/output.json:
--------------------------------------------------------------------------------
1 | {"errors":[{"component":"general","formattedMessage":"Unknown key \"notThere\"","message":"Unknown key \"notThere\"","severity":"error","type":"JSONError"}]}
2 |
--------------------------------------------------------------------------------
/test/libsolidity/semanticTests/expressions/conditional_expression_true_literal.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f() public returns(uint d) {
3 | return true ? 5 : 10;
4 | }
5 | }
6 | // ----
7 | // f() -> 5
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/array/length/bytes32_too_large.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | bytes32[8**90] ids;
3 | }
4 | // ----
5 | // TypeError: (25-30): Invalid array length, expected integer literal or constant expression.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/array/length/const_cannot_be_fractional.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | fixed constant L = 10.5;
3 | uint[L] ids;
4 | }
5 | // ----
6 | // TypeError: (51-52): Array with fractional length specified.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/array/length/invalid_expression_1.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint[-true] ids;
3 | }
4 | // ----
5 | // TypeError: (22-27): Invalid array length, expected integer literal or constant expression.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/array/length/invalid_expression_2.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint[true/1] ids;
3 | }
4 | // ----
5 | // TypeError: (22-28): Invalid array length, expected integer literal or constant expression.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/array/length/invalid_expression_3.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint[1/true] ids;
3 | }
4 | // ----
5 | // TypeError: (22-28): Invalid array length, expected integer literal or constant expression.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/constructor/returns_in_constructor.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | constructor() public returns (uint a) { }
3 | }
4 | // ----
5 | // TypeError: (46-54): Non-empty "returns" directive for constructor.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/controlFlow/mappingReturn/unnamed_fine.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | mapping(uint=>uint) m;
3 | function f() internal view returns (mapping(uint=>uint) storage) { return m; }
4 | }
5 | // ----
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/dataLocations/data_location_in_function_type.sol:
--------------------------------------------------------------------------------
1 | library L {
2 | struct Nested { uint y; }
3 | function c(function(Nested memory) external returns (uint)[] storage) external pure {}
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/imports/relative_import.sol:
--------------------------------------------------------------------------------
1 | ==== Source: a ====
2 | import "./dir/b"; contract A is B {}
3 | ==== Source: dir/b ====
4 | contract B {}
5 | ==== Source: dir/c ====
6 | import "../a"; contract C is A {}
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/imports/simple_alias.sol:
--------------------------------------------------------------------------------
1 | ==== Source: a ====
2 | contract A {}
3 | ==== Source: dir/a/b/c ====
4 | import "../../.././a" as x; contract B is x.A { function() external { x.A r = x.A(20); r; } }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/inlineAssembly/use_msize_without_optimizer.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() pure public {
3 | assembly {
4 | let x := msize()
5 | }
6 | }
7 | }
8 | // ----
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/literalOperations/division_by_zero.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint constant a = 1 / 0;
3 | }
4 | // ----
5 | // TypeError: (35-40): Operator / not compatible with types int_const 1 and int_const 0
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/memberLookup/msg_value_modifier_payable.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | modifier costs(uint _amount) { require(msg.value >= _amount); _; }
3 | function f() costs(1 ether) public payable {}
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/metaTypes/typeNotRegularIdentifierFunction.sol:
--------------------------------------------------------------------------------
1 | contract Test {
2 | function type() public pure {
3 | }
4 | }
5 | // ----
6 | // ParserError: (29-33): Expected identifier but got 'type'
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/metaTypes/typeNotRegularIdentifierParameter.sol:
--------------------------------------------------------------------------------
1 | contract Test {
2 | function f(uint type) public pure {
3 | }
4 | }
5 | // ----
6 | // ParserError: (36-40): Expected ',' but got 'type'
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/096_access_to_default_function_visibility.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | function f() public {}
3 | }
4 | contract d {
5 | function g() public { c(0).f(); }
6 | }
7 | // ----
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/114_exp_warn_literal_base_2.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f() pure public returns(uint) {
3 | uint8 x = 100;
4 | return uint8(10)**x;
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/119_shift_warn_literal_base_4.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f() pure public returns(uint) {
3 | uint8 x = 100;
4 | return 10 >> x;
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/300_invalid_fixed_types_7x8_mxn.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | fixed7x8 c = 3.12345678;
3 | }
4 | // ----
5 | // DeclarationError: (20-28): Identifier not found or not unique.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/511_library_function_without_implementation_public.sol:
--------------------------------------------------------------------------------
1 | library L {
2 | // This can be used as an "interface", hence it is allowed.
3 | function f() public;
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/527_fallback_marked_internal.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function () internal { }
3 | }
4 | // ----
5 | // TypeError: (17-41): Fallback function must be defined as "external".
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/528_fallback_marked_private.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function () private { }
3 | }
4 | // ----
5 | // TypeError: (17-40): Fallback function must be defined as "external".
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/functions.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function keccak256() pure public {}
3 | }
4 | // ----
5 | // Warning: (17-52): This declaration shadows a builtin symbol.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/natspec/docstring_empty_description.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | /// @param id
3 | function vote(uint id) public;
4 | }
5 | // ----
6 | // DocstringParsingError: No description given for param id
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/address_nonpayable.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | address a;
3 | function f(address b) public pure returns (address c) {
4 | address d = b;
5 | return d;
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/location_specifiers_for_state_variables_multi.sol:
--------------------------------------------------------------------------------
1 | contract Foo {
2 | uint[] memory storage calldata x;
3 | }
4 | // ----
5 | // ParserError: (23-29): Expected identifier but got 'memory'
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/multiple_function_param_trailing_comma.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function(uint a, uint b,) {}
3 | }
4 | // ----
5 | // ParserError: (40-41): Unexpected trailing comma in parameter list.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/single_return_param_trailing_comma.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function() returns (uint a,) {}
3 | }
4 | // ----
5 | // ParserError: (43-44): Unexpected trailing comma in parameter list.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/trailing_dot2.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | uint256 a = 2.2e10;
3 | uint256 b = .5E10;
4 | uint256 c = 2 + 2.;
5 | }
6 | // ----
7 | // ParserError: (76-77): Expected identifier but got ';'
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/var_empty_decl_3.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public pure {
3 | var (d, e,);
4 | }
5 | }
6 | // ----
7 | // TypeError: (52-63): Use of the "var" keyword is disallowed.
8 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_type_settings/output.json:
--------------------------------------------------------------------------------
1 | {"errors":[{"component":"general","formattedMessage":"\"settings\" must be an object","message":"\"settings\" must be an object","severity":"error","type":"JSONError"}]}
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_type_source/output.json:
--------------------------------------------------------------------------------
1 | {"errors":[{"component":"general","formattedMessage":"\"sources.A\" must be an object","message":"\"sources.A\" must be an object","severity":"error","type":"JSONError"}]}
2 |
--------------------------------------------------------------------------------
/test/libsolidity/semanticTests/expressions/conditional_expression_false_literal.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f() public returns(uint d) {
3 | return false ? 5 : 10;
4 | }
5 | }
6 | // ----
7 | // f() -> 10
8 |
--------------------------------------------------------------------------------
/test/libsolidity/semanticTests/expressions/exp_operator_const_signed.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f() public returns(int d) { return (-2) ** 3; }
3 | }
4 | // ====
5 | // compileViaYul: also
6 | // ----
7 | // f() -> -8
8 |
--------------------------------------------------------------------------------
/test/libsolidity/smtCheckerTests/types/tuple_declarations_empty.sol:
--------------------------------------------------------------------------------
1 | pragma experimental SMTChecker;
2 |
3 | contract C
4 | {
5 | function g() public pure {
6 | (uint x, ) = (2, 4);
7 | assert(x == 2);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/array/length/can_be_constant_in_function.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint constant LEN = 10;
3 | function f() public pure {
4 | uint[LEN] memory a;
5 | a;
6 | }
7 | }
8 | // ----
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/array/length/not_convertible_to_integer.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint[true] ids;
3 | }
4 | // ----
5 | // TypeError: (22-26): Invalid array length, expected integer literal or constant expression.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/array/length/parameter_too_large.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f(bytes32[1263941234127518272] memory) public pure {}
3 | }
4 | // ----
5 | // TypeError: (26-61): Array is too large to be encoded.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/array/length/uint_too_large_multidim.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint[8**90][500] ids;
3 | }
4 | // ----
5 | // TypeError: (22-27): Invalid array length, expected integer literal or constant expression.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/constructor/two_constructors.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | constructor(uint) public { }
3 | constructor() public {}
4 | }
5 | // ----
6 | // DeclarationError: (47-70): More than one constructor defined.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/functionTypes/call_value_on_payable_function_type.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function (uint) external payable returns (uint) x;
3 | function f() public {
4 | x.value(2)(1);
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/functionTypes/delete_function_type_invalid.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public {
3 | delete f;
4 | }
5 | }
6 | // ----
7 | // TypeError: (54-55): Expression has to be an lvalue.
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/indexing/array_without_index.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public {
3 | bytes memory a;
4 | a[];
5 | }
6 | }
7 | // ----
8 | // TypeError: (61-64): Index expression cannot be omitted.
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/indexing/fixedbytes_out_of_bounds_index.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public {
3 | bytes32 b;
4 | b[64];
5 | }
6 | }
7 | // ----
8 | // TypeError: (56-61): Out of bounds array access.
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/indexing/fixedbytes_without_index.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public {
3 | bytes32 b;
4 | b[];
5 | }
6 | }
7 | // ----
8 | // TypeError: (56-59): Index expression cannot be omitted.
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/056_cyclic_inheritance.sol:
--------------------------------------------------------------------------------
1 | contract A is B { }
2 | contract B is A { }
3 | // ----
4 | // TypeError: (14-15): Definition of base has to precede definition of derived contract
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/079_fallback_function_inheritance.sol:
--------------------------------------------------------------------------------
1 | contract A {
2 | uint x;
3 | function() external { x = 1; }
4 | }
5 | contract C is A {
6 | function() external { x = 2; }
7 | }
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/117_shift_warn_literal_base_2.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f() pure public returns(uint) {
3 | uint8 x = 100;
4 | return uint8(10) << x;
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/198_integer_boolean_not.sol:
--------------------------------------------------------------------------------
1 | contract test { function() external { uint x = 1; !x; } }
2 | // ----
3 | // TypeError: (50-52): Unary operator ! cannot be applied to type uint256
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/401_does_not_warn_msg_value_in_modifier_following_non_payable_public_function.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | function f() pure public { }
3 | modifier m() { msg.value; _; }
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/518_experimental_pragma_unknown_quoted_string_literal.sol:
--------------------------------------------------------------------------------
1 | pragma experimental "unsupportedName";
2 | // ----
3 | // SyntaxError: (0-38): Unsupported experimental feature name.
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/address/payable_address_to_address.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f(address payable a) public pure {
3 | address payable b;
4 | address c = a;
5 | c = b;
6 | }
7 | }
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/no_singleton_tuple.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public pure {
3 | uint a;
4 | (a,) = (uint(1),);
5 | }
6 | }
7 | // ----
8 | // TypeError: (60-70): Tuple component cannot be empty.
9 |
--------------------------------------------------------------------------------
/test/libyul/yulInterpreterTests/exp.yul:
--------------------------------------------------------------------------------
1 | {
2 | mstore(0, exp(3,not(1)))
3 | }
4 | // ----
5 | // Trace:
6 | // Memory dump:
7 | // 0: 8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e39
8 | // Storage dump:
9 |
--------------------------------------------------------------------------------
/test/libyul/yulInterpreterTests/simple_mstore.yul:
--------------------------------------------------------------------------------
1 | {
2 | mstore(10, 11)
3 | }
4 | // ----
5 | // Trace:
6 | // Memory dump:
7 | // 20: 0000000000000000000b00000000000000000000000000000000000000000000
8 | // Storage dump:
9 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_complex.yul:
--------------------------------------------------------------------------------
1 | {
2 | let a := sub(calldataload(0), calldataload(0))
3 | mstore(a, 0)
4 | }
5 | // ====
6 | // step: fullSimplify
7 | // ----
8 | // { mstore(0, 0) }
9 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_type_sources/output.json:
--------------------------------------------------------------------------------
1 | {"errors":[{"component":"general","formattedMessage":"\"sources\" is not a JSON object.","message":"\"sources\" is not a JSON object.","severity":"error","type":"JSONError"}]}
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/too_long_line_left_short/input.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f(announcementType Type, string Announcement, string Link, bool Oppositable, string _str, uint256 _uint, address _addr) onlyOwner external {
3 | }
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/array/length/bytes32_too_large_multidim.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | bytes32[8**90][500] ids;
3 | }
4 | // ----
5 | // TypeError: (25-30): Invalid array length, expected integer literal or constant expression.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/imports/name_clash_in_import_1.sol:
--------------------------------------------------------------------------------
1 | ==== Source: a ====
2 | contract A {}
3 | ==== Source: b ====
4 | import "a"; contract A {}
5 | // ----
6 | // DeclarationError: (b:12-25): Identifier already declared.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/indexing/array_out_of_bounds_index.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public {
3 | bytes[32] memory a;
4 | a[64];
5 | }
6 | }
7 | // ----
8 | // TypeError: (65-70): Out of bounds array access.
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/indexing/function_type.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public {
3 | f[0];
4 | }
5 | }
6 | // ----
7 | // TypeError: (41-42): Indexed expression has to be a type, mapping or array (is function ())
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/metaTypes/typeNotRegularIdentifierVariable.sol:
--------------------------------------------------------------------------------
1 | contract Test {
2 | function f() public pure {
3 | uint type;
4 | }
5 | }
6 | // ----
7 | // ParserError: (60-64): Expected ';' but got 'type'
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/metaTypes/typeOfContract.sol:
--------------------------------------------------------------------------------
1 | contract Test {
2 | function f() public pure returns (bytes memory) {
3 | type(Test);
4 | }
5 | }
6 | // ----
7 | // Warning: (78-88): Statement has no effect.
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/151_array_with_negative_length.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | function f(uint a) public { uint8[-1] x; }
3 | }
4 | // ----
5 | // TypeError: (51-53): Array with negative length specified.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/172_assignment_to_const_string_bytes.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | bytes constant a = "\x00\x01\x02";
3 | bytes constant b = hex"000102";
4 | string constant c = "hello";
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/245_tuples_empty_components.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public {
3 | (1,,2);
4 | }
5 | }
6 | // ----
7 | // TypeError: (47-53): Tuple component cannot be empty.
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/405_address_checksum_type_deduction.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public {
3 | (0xfA0bFc97E48458494Ccd857e1A85DC91F7F0046E).transfer(2);
4 | }
5 | }
6 | // ----
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/warnUnused/local_assignment.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() pure public {
3 | uint a = 1;
4 | }
5 | }
6 | // ----
7 | // Warning: (52-58): Unused local variable.
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/mapping_in_struct.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | struct test_struct {
3 | address addr;
4 | uint256 count;
5 | mapping(bytes32 => test_struct) self_reference;
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/mapping_to_mapping_in_struct.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | struct test_struct {
3 | address addr;
4 | mapping (uint64 => mapping (bytes32 => uint)) complex_mapping;
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/multiple_return_param_trailing_comma.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function() returns (uint a, uint b,) {}
3 | }
4 | // ----
5 | // ParserError: (54-55): Unexpected trailing comma in parameter list.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/single_event_arg_trailing_comma.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | event Test(uint a,);
3 | function(uint a) {}
4 | }
5 | // ----
6 | // ParserError: (34-35): Unexpected trailing comma in parameter list.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/tuples_decl_without_rhs.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public pure {
3 | (uint a, uint b, uint c);
4 | }
5 | }
6 | // ----
7 | // ParserError: (76-77): Expected '=' but got ';'
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/scoping/function_state_variable_conflict.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f(uint) public pure {}
3 | uint public f = 0;
4 | }
5 | // ----
6 | // DeclarationError: (53-70): Identifier already declared.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/scoping/state_variable_function_conflict.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint public f = 0;
3 | function f(uint) public pure {}
4 | }
5 | // ----
6 | // DeclarationError: (40-71): Identifier already declared.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/structs/recursion/struct_definition_directly_recursive_dynamic_array.sol:
--------------------------------------------------------------------------------
1 | contract Test {
2 | struct MyStructName {
3 | address addr;
4 | MyStructName[] x;
5 | }
6 | }
7 | // ----
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/viewPureChecker/callvalue_payable_assembly_function.sol:
--------------------------------------------------------------------------------
1 | contract C
2 | {
3 | function f(uint x) public payable {
4 | assembly {
5 | x := callvalue()
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/structuralSimplifier/nested.yul:
--------------------------------------------------------------------------------
1 | { if 1 { if 1 { for { mstore(0, 0) } 0 {} { mstore(2, 3) } if 0 { mstore(1, 2) } } } }
2 | // ====
3 | // step: structuralSimplifier
4 | // ----
5 | // { mstore(0, 0) }
6 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/unusedPruner/multi_partial_assignments.yul:
--------------------------------------------------------------------------------
1 | {
2 | let x, y
3 | x := 1
4 | }
5 | // ====
6 | // step: unusedPruner
7 | // ----
8 | // {
9 | // let x, y
10 | // x := 1
11 | // }
12 |
--------------------------------------------------------------------------------
/test/libsolidity/smtCheckerTests/loops/for_loop_2.sol:
--------------------------------------------------------------------------------
1 | pragma experimental SMTChecker;
2 | contract C {
3 | function f(uint x) public pure {
4 | for (; x == 2; ) {
5 | assert(x == 2);
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/test/libsolidity/smtCheckerTests/types/bool_simple_3.sol:
--------------------------------------------------------------------------------
1 | pragma experimental SMTChecker;
2 | contract C {
3 | function f(bool x, bool y) public pure {
4 | bool z = x || y;
5 | assert(!(x && y) || z);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/array/length/invalid_expression_4.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint[1.111111E1111111111111] ids;
3 | }
4 | // ----
5 | // TypeError: (22-44): Invalid array length, expected integer literal or constant expression.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/controlFlow/unreachableCode/double_revert.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public pure {
3 | revert();
4 | revert();
5 | }
6 | }
7 | // ----
8 | // Warning: (70-78): Unreachable code.
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/controlFlow/unreachableCode/revert.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public pure {
3 | revert();
4 | uint a = 0; a;
5 | }
6 | }
7 | // ----
8 | // Warning: (70-83): Unreachable code.
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/fallback/pure_modifier.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint x;
3 | function() external pure { x = 2; }
4 | }
5 | // ----
6 | // TypeError: (29-64): Fallback function must be payable or non-payable, but is "pure".
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/fallback/view_modifier.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint x;
3 | function() external view { x = 2; }
4 | }
5 | // ----
6 | // TypeError: (29-64): Fallback function must be payable or non-payable, but is "view".
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/functionTypes/payable_internal_function_type.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function (uint) internal payable returns (uint) x;
3 | }
4 | // ----
5 | // TypeError: (17-66): Only external function types can be payable.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/imports/name_clash_in_import_2.sol:
--------------------------------------------------------------------------------
1 | ==== Source: a ====
2 | contract A {}
3 | ==== Source: b ====
4 | import "a" as A; contract A {}
5 | // ----
6 | // DeclarationError: (b:17-30): Identifier already declared.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/literalOperations/division_by_zero_complex.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint constant a = 1 / ((1+3)-4);
3 | }
4 | // ----
5 | // TypeError: (35-48): Operator / not compatible with types int_const 1 and int_const 0
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/literalOperations/mod_zero_complex.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint constant b3 = 1 % (-4+((2)*2));
3 | }
4 | // ----
5 | // TypeError: (36-52): Operator % not compatible with types int_const 1 and int_const 0
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/188_string_index.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | string s;
3 | function f() public { bytes1 a = s[2]; }
4 | }
5 | // ----
6 | // TypeError: (64-68): Index access for string is not possible.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/561_event_emit_complex.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | event e(uint a, string b);
3 | function f() public {
4 | emit e(2, "abc");
5 | emit e({b: "abc", a: 8});
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/address_function_arguments_and_returns.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f(address) public pure returns (address) {}
3 | function g(address payable) public pure returns (address payable) {}
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/address_payable_type_expression.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public pure {
3 | address payable;
4 | }
5 | }
6 | // ----
7 | // ParserError: (67-68): Expected identifier but got ';'
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/conditional_with_assignment.sol:
--------------------------------------------------------------------------------
1 | contract A {
2 | function f() public pure {
3 | uint y = 1;
4 | uint x = 3 < 0 ? y = 3 : 6;
5 | true ? x = 3 : 4;
6 | }
7 | }
8 | // ----
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/enum_valid_declaration.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | enum validEnum { Value1, Value2, Value3, Value4 }
3 | constructor() public {
4 | a = validEnum.Value3;
5 | }
6 | validEnum a;
7 | }
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/function_normal_comments.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | uint256 stateVar;
3 | // We won't see this comment
4 | function functionName(bytes32 input) public returns (bytes32 out) {}
5 | }
6 | // ----
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/inline_array_declaration.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | uint[] a;
3 | function f() public returns (uint, uint) {
4 | a = [1,2,3];
5 | return (a[3], [2,3,4][0]);
6 | }
7 | }
8 | // ----
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/literal_constants_with_ether_subdenominations_in_expressions.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | constructor() public
3 | {
4 | a = 1 wei * 100 wei + 7 szabo - 3;
5 | }
6 | uint256 a;
7 | }
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_empty.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public pure {
3 | abi.decode("abc", ());
4 | }
5 | }
6 | // ----
7 | // Warning: (52-73): Statement has no effect.
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/contract_to_base_base.sol:
--------------------------------------------------------------------------------
1 | contract A {}
2 | contract B is A {}
3 | contract C is B {}
4 | contract D {
5 | function f() public {
6 | A a = new C();
7 | a;
8 | }
9 | }
10 | // ----
11 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/function_call_fail2.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f(uint y) public pure returns (uint) {
3 | (f(y)) = 2;
4 | }
5 | }
6 | // ----
7 | // TypeError: (74-78): Expression has to be an lvalue.
8 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/controlFlowSimplifier/empty_if_movable_condition.yul:
--------------------------------------------------------------------------------
1 | { let a := mload(0) if a {} }
2 | // ====
3 | // step: controlFlowSimplifier
4 | // ----
5 | // {
6 | // let a := mload(0)
7 | // pop(a)
8 | // }
9 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_default_success/input.json:
--------------------------------------------------------------------------------
1 | {
2 | "language": "Solidity",
3 | "sources":
4 | {
5 | "A":
6 | {
7 | "content": "pragma solidity >=0.0; contract C { function f() public pure {} }"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/test/libsolidity/smtCheckerTests/loops/for_loop_1.sol:
--------------------------------------------------------------------------------
1 | pragma experimental SMTChecker;
2 | contract C {
3 | function f(uint x) public pure {
4 | require(x == 2);
5 | for (;;) {}
6 | assert(x == 2);
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/test/libsolidity/smtCheckerTests/types/bytes_2.sol:
--------------------------------------------------------------------------------
1 | pragma experimental SMTChecker;
2 |
3 | contract C
4 | {
5 | function f(bytes memory b1, bytes memory b2) public pure {
6 | b1 = b2;
7 | assert(b1[1] == b2[1]);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/array/calldata_resize.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f (uint256[] calldata x) external pure {
3 | x.length = 42;
4 | }
5 | }
6 | // ----
7 | // TypeError: (75-83): Calldata arrays cannot be resized.
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/array/invalid/library_index_access.sol:
--------------------------------------------------------------------------------
1 | library C {
2 | function f() view public {
3 | C[0];
4 | }
5 | }
6 | // ----
7 | // TypeError: (51-55): Index access for contracts or libraries is not possible.
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/functionTypes/delete_external_function_type_invalid.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public {
3 | delete this.f;
4 | }
5 | }
6 | // ----
7 | // TypeError: (54-60): Expression has to be an lvalue.
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/globalFunctions/sha3_no_call.sol:
--------------------------------------------------------------------------------
1 | contract C
2 | {
3 | function f(bytes memory data) public pure {
4 | sha3;
5 | }
6 | }
7 | // ----
8 | // TypeError: (60-64): "sha3" has been deprecated in favour of "keccak256".
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/imports/name_clash_in_import_4.sol:
--------------------------------------------------------------------------------
1 | ==== Source: a ====
2 | contract A {}
3 | ==== Source: b ====
4 | import {A} from "a"; contract A {}
5 | // ----
6 | // DeclarationError: (b:21-34): Identifier already declared.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/inheritance/reference_non_base_ctor.sol:
--------------------------------------------------------------------------------
1 | contract X {}
2 | contract D {
3 | constructor() X(5) public {}
4 | }
5 | // ----
6 | // TypeError: (45-49): Referenced declaration is neither modifier nor base class.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/lvalues/calldata_index_access.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f(uint256[] calldata x) external pure {
3 | x[0] = 42;
4 | }
5 | }
6 | // ----
7 | // TypeError: (74-78): Calldata arrays are read-only.
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/modifiers/illegal_modifier_override.sol:
--------------------------------------------------------------------------------
1 | contract A { modifier mod(uint a) { _; } }
2 | contract B is A { modifier mod(uint8 a) { _; } }
3 | // ----
4 | // TypeError: (61-89): Override changes modifier signature.
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/077_fallback_function_with_return_parameters.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function() external returns (uint) { }
3 | }
4 | // ----
5 | // TypeError: (45-51): Fallback function cannot return values.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/148_external_argument_delete.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | function f(uint a) external { delete a; }
3 | }
4 | // ----
5 | // Warning: (17-58): Function state mutability can be restricted to pure
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/171_assignment_to_const_array_vars.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint[3] constant x = [uint(1), 2, 3];
3 | }
4 | // ----
5 | // TypeError: (17-53): Constants of non-value type not yet implemented.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/429_revert_with_reason.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f(uint x) pure public {
3 | if (x > 7)
4 | revert("abc");
5 | else
6 | revert();
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/470_specified_storage_no_warn.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | struct S { uint a; string b; }
3 | S x;
4 | function f() view public {
5 | S storage y = x;
6 | y;
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/570_function_type_undeclared_type.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function a(function(Nested)) external pure {}
3 | }
4 | // ----
5 | // DeclarationError: (37-43): Identifier not found or not unique.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/function_type_as_storage_variable_with_modifiers.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function (uint, uint) modifier1() returns (uint) f1;
3 | }
4 | // ----
5 | // ParserError: (66-68): Expected '{' but got identifier
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/address/address_to_contract_payable_fallback.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public pure returns (C c) {
3 | c = C(address(2));
4 | }
5 | function() external payable {
6 | }
7 | }
8 | // ----
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/unterminatedBlocks/one_dot_x.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f() pure public { 1.x; }
3 | }
4 | // ----
5 | // TypeError: (47-50): Member "x" not found or not visible after argument-dependent lookup in int_const 1.
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/unterminatedBlocks/zero_dot_x.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f() pure public { 0.x; }
3 | }
4 | // ----
5 | // TypeError: (47-50): Member "x" not found or not visible after argument-dependent lookup in int_const 0.
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/viewPureChecker/suggest_view.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint x;
3 | function g() public returns (uint) { return x; }
4 | }
5 | // ----
6 | // Warning: (29-77): Function state mutability can be restricted to view
7 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/disambiguator/variables.yul:
--------------------------------------------------------------------------------
1 | { { let a:u256 } { let a:u256 } }
2 | // ====
3 | // step: disambiguator
4 | // yul: true
5 | // ----
6 | // {
7 | // { let a:u256 }
8 | // { let a_1:u256 }
9 | // }
10 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_type_auxiliary_input/output.json:
--------------------------------------------------------------------------------
1 | {"errors":[{"component":"general","formattedMessage":"\"auxiliaryInput\" must be an object","message":"\"auxiliaryInput\" must be an object","severity":"error","type":"JSONError"}]}
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_type_metadata/output.json:
--------------------------------------------------------------------------------
1 | {"errors":[{"component":"general","formattedMessage":"\"settings.metadata\" must be an object","message":"\"settings.metadata\" must be an object","severity":"error","type":"JSONError"}]}
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_wrong_type_optimizer/output.json:
--------------------------------------------------------------------------------
1 | {"errors":[{"component":"general","formattedMessage":"\"settings.optimizer\" must be an object","message":"\"settings.optimizer\" must be an object","severity":"error","type":"JSONError"}]}
2 |
--------------------------------------------------------------------------------
/test/cmdlineTests/too_long_line_edge_in/input.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function ffffffffffffffffffffff(announcementTypeTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT Ty, string A) onlyOwner external {
3 | }
4 | }
5 |
--------------------------------------------------------------------------------
/test/cmdlineTests/too_long_line_edge_out/input.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function fffffffffffffffffffffff(announcementTypeTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT Typ, string A) onlyOwner external {
3 | }
4 | }
5 |
--------------------------------------------------------------------------------
/test/libsolidity/semanticTests/viaYul/return.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public pure returns (uint x) {
3 | return 7;
4 | x = 3;
5 | }
6 | }
7 | // ====
8 | // compileViaYul: true
9 | // ----
10 | // f() -> 7
11 |
--------------------------------------------------------------------------------
/test/libsolidity/smtCheckerTests/functions/functions_trivial_condition_for_only_call.sol:
--------------------------------------------------------------------------------
1 | pragma experimental SMTChecker;
2 |
3 | contract C
4 | {
5 | function f(bool x) public pure { for (;x;) {} }
6 | function g() public pure { f(true); }
7 | }
8 |
--------------------------------------------------------------------------------
/test/libsolidity/smtCheckerTests/loops/for_loop_3.sol:
--------------------------------------------------------------------------------
1 | pragma experimental SMTChecker;
2 | contract C {
3 | function f(uint x) public pure {
4 | for (uint y = 2; x < 10; ) {
5 | assert(y == 2);
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/test/libsolidity/smtCheckerTests/operators/mod_n.sol:
--------------------------------------------------------------------------------
1 | pragma experimental SMTChecker;
2 |
3 | contract C
4 | {
5 | function f(uint x, uint y) public pure {
6 | require(y > 0);
7 | uint z = x % y;
8 | assert(z < y);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/test/libsolidity/smtCheckerTests/overflow/safe_add_1.sol:
--------------------------------------------------------------------------------
1 | pragma experimental SMTChecker;
2 |
3 | contract C
4 | {
5 | function add(uint x, uint y) public pure returns (uint) {
6 | require(x + y >= x);
7 | return x + y;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/test/libsolidity/smtCheckerTests/types/contract_3.sol:
--------------------------------------------------------------------------------
1 | pragma experimental SMTChecker;
2 |
3 | contract C
4 | {
5 | function f(C c, C d, C e) public pure {
6 | require(c == d);
7 | require(d == e);
8 | assert(c == e);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/test/libsolidity/smtCheckerTests/types/mapping_1.sol:
--------------------------------------------------------------------------------
1 | pragma experimental SMTChecker;
2 |
3 | contract C
4 | {
5 | mapping (uint => uint) map;
6 | function f(uint x) public {
7 | map[2] = x;
8 | assert(x == map[2]);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/array/invalid/contract_index_access.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() view public {
3 | C[0];
4 | }
5 | }
6 | // ----
7 | // TypeError: (52-56): Index access for contracts or libraries is not possible.
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/array/length/cannot_be_function.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public {}
3 | uint[f] ids;
4 | }
5 | // ----
6 | // TypeError: (49-50): Invalid array length, expected integer literal or constant expression.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/bound/bound_call.sol:
--------------------------------------------------------------------------------
1 | library D { function double(uint self) internal pure returns (uint) { return 2*self; } }
2 | contract C {
3 | using D for uint;
4 | function f(uint a) public pure {
5 | a.double();
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/bound/bound_no_call.sol:
--------------------------------------------------------------------------------
1 | library D { function double(uint self) public pure returns (uint) { return 2*self; } }
2 | contract C {
3 | using D for uint;
4 | function f(uint a) public pure {
5 | a.double;
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/conversion/allowed_conversion_to_bytes_array.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | bytes a;
3 | bytes b;
4 | function f() public view {
5 | bytes storage c = a;
6 | bytes memory d = b;
7 | d = bytes(c);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/conversion/allowed_conversion_to_string.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | string a;
3 | string b;
4 | function f() public view {
5 | string storage c = a;
6 | string memory d = b;
7 | d = string(c);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/functionTypes/function_type_return_parameters_with_names.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function(uint) returns (bool ret) f;
3 | }
4 | // ----
5 | // SyntaxError: (41-49): Return parameters in function types may not be named.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/imports/name_clash_in_import_3.sol:
--------------------------------------------------------------------------------
1 | ==== Source: a ====
2 | contract A {}
3 | ==== Source: b ====
4 | import {A as b} from "a"; contract b {}
5 | // ----
6 | // DeclarationError: (b:26-39): Identifier already declared.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/indexing/function_type_without_index.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public {
3 | f[];
4 | }
5 | }
6 | // ----
7 | // TypeError: (41-42): Indexed expression has to be a type, mapping or array (is function ())
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/memberLookup/internal_function_type.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function () internal returns (uint) x;
3 | constructor() public {
4 | C.x = g;
5 | }
6 | function g() public pure returns (uint) {}
7 | }
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/metaTypes/codeAccessIsConstant.sol:
--------------------------------------------------------------------------------
1 | contract Test {
2 | bytes constant c = type(B).creationCode;
3 | bytes constant r = type(B).runtimeCode;
4 |
5 | }
6 | contract B { function f() public pure {} }
7 | // ----
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/multiVariableDeclaration/oneElementTuple.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public {
3 | (uint a,) = (1,);
4 | a;
5 | }
6 | }
7 | // ----
8 | // TypeError: (59-63): Tuple component cannot be empty.
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/015_balance_invalid.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function fun() public {
3 | address(0).balance = 7;
4 | }
5 | }
6 | // ----
7 | // TypeError: (52-70): Expression has to be an lvalue.
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/133_enum_duplicate_values.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | enum ActionChoices { GoLeft, GoRight, GoLeft, Sit }
3 | }
4 | // ----
5 | // DeclarationError: (66-72): Identifier already declared.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/196_integer_boolean_or.sol:
--------------------------------------------------------------------------------
1 | contract test { function() external { uint x = 1; uint y = 2; x || y; } }
2 | // ----
3 | // TypeError: (62-68): Operator || not compatible with types uint256 and uint256
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/197_integer_boolean_and.sol:
--------------------------------------------------------------------------------
1 | contract test { function() external { uint x = 1; uint y = 2; x && y; } }
2 | // ----
3 | // TypeError: (62-68): Operator && not compatible with types uint256 and uint256
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/366_invalid_array_as_statement.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | struct S { uint x; }
3 | constructor(uint k) public { S[k]; }
4 | }
5 | // ----
6 | // TypeError: (76-77): Integer constant expected.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/402_assignment_to_constant.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | uint constant a = 1;
3 | function f() public { a = 2; }
4 | }
5 | // ----
6 | // TypeError: (64-65): Cannot assign to a constant variable.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/416_interface_function_bodies.sol:
--------------------------------------------------------------------------------
1 | interface I {
2 | function f() external pure {
3 | }
4 | }
5 | // ----
6 | // TypeError: (18-52): Functions in interfaces cannot have an implementation.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/501_gasleft_shadowing_2.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint gasleft;
3 | function f() public { gasleft = 42; }
4 | }
5 | // ----
6 | // Warning: (17-29): This declaration shadows a builtin symbol.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/521_experimental_pragma_test_warning.sol:
--------------------------------------------------------------------------------
1 | pragma experimental __test;
2 | // ----
3 | // Warning: (0-27): Experimental features are turned on. Do not use experimental features on live deployments.
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/533_tuple_invalid_literal_too_large_exp.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() pure public {
3 | (2**270, 1);
4 | }
5 | }
6 | // ----
7 | // TypeError: (53-59): Invalid rational number.
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/559_no_warning_for_using_members_that_look_like_address_members.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function transfer(uint) public;
3 | function f() public {
4 | this.transfer(10);
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/584_abi_decode_with_tuple_of_other_than_types.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() pure public { abi.decode("", (0)); }
3 | }
4 | // ----
5 | // TypeError: (60-61): Argument has to be a type name.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/typeChecking/return.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f() public returns (bool r) { return 1 >= 2; }
3 | }
4 | // ----
5 | // Warning: (20-75): Function state mutability can be restricted to pure
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/address_payable.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | address payable a;
3 | function f(address payable b) public pure returns (address payable c) {
4 | address payable d = b;
5 | return d;
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/function_type_as_storage_variable_with_assignment.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f(uint x, uint y) public returns (uint a) {}
3 | function (uint, uint) internal returns (uint) f1 = f;
4 | }
5 | // ----
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/mapping_nonelementary_key_2.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | struct S {
3 | uint x;
4 | }
5 | mapping(S => uint) data;
6 | }
7 | // ----
8 | // ParserError: (47-48): Expected elementary type name for mapping key type
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/mapping_nonelementary_key_3.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | struct S {
3 | string s;
4 | }
5 | mapping(S => uint) data;
6 | }
7 | // ----
8 | // ParserError: (49-50): Expected elementary type name for mapping key type
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/multiple_event_arg_trailing_comma.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | event Test(uint a, uint b,);
3 | function(uint a) {}
4 | }
5 | // ----
6 | // ParserError: (45-46): Unexpected trailing comma in parameter list.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/single_modifier_arg_trailing_comma.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | modifier modTest(uint a,) { _; }
3 | function(uint a) {}
4 | }
5 | // ----
6 | // ParserError: (40-41): Unexpected trailing comma in parameter list.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/variable_definition_in_mapping.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function fun() {
3 | mapping(var=>bytes32) d;
4 | }
5 | }
6 | // ----
7 | // ParserError: (44-47): Expected elementary type name for mapping key type
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/smoke_test.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | uint256 stateVariable1;
3 | function fun(uint256 arg1) public { uint256 y; y = arg1; }
4 | }
5 | // ----
6 | // Warning: (42-100): Function state mutability can be restricted to pure
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/string/string_escapes.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f() public pure returns (bytes32) {
3 | bytes32 escapeCharacters = "\t\b\n\r\f\'\"\\\b";
4 | return escapeCharacters;
5 | }
6 | }
7 | // ----
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/address/address_abi_decode.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f(bytes memory b) public pure returns (address payable) {
3 | (address payable c) = abi.decode(b, (address));
4 | return c;
5 | }
6 | }
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/empty_tuple_event.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | event SomeEvent();
3 | function a() public {
4 | (emit SomeEvent(), 7);
5 | }
6 | }
7 | // ----
8 | // ParserError: (71-75): Expected primary expression.
9 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/structuralSimplifier/for_false_condition.sol:
--------------------------------------------------------------------------------
1 | {
2 | for { let a := 42 } 0 { a := a } {
3 | let b := a
4 | }
5 | }
6 | // ====
7 | // step: structuralSimplifier
8 | // ----
9 | // { let a := 42 }
10 |
--------------------------------------------------------------------------------
/scripts/install_static_z3.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | git clone --depth 1 --branch z3-4.8.7 https://github.com/Z3Prover/z3.git
4 | cd z3
5 | mkdir build
6 | cd build
7 | LDFLAGS="-static" cmake -DZ3_BUILD_LIBZ3_SHARED=OFF ..
8 | make -j 4
9 | make install
--------------------------------------------------------------------------------
/test/libsolidity/smtCheckerTests/functions/functions_trivial_condition_require_only_call.sol:
--------------------------------------------------------------------------------
1 | pragma experimental SMTChecker;
2 |
3 | contract C
4 | {
5 | function f(bool x) public pure { require(x); }
6 | function g() public pure { f(true); }
7 | }
8 |
--------------------------------------------------------------------------------
/test/libsolidity/smtCheckerTests/functions/functions_trivial_condition_while_only_call.sol:
--------------------------------------------------------------------------------
1 | pragma experimental SMTChecker;
2 |
3 | contract C
4 | {
5 | function f(bool x) public pure { while (x) {} }
6 | function g() public pure { f(true); }
7 | }
8 |
--------------------------------------------------------------------------------
/test/libsolidity/smtCheckerTests/operators/mod_even.sol:
--------------------------------------------------------------------------------
1 | pragma experimental SMTChecker;
2 |
3 | contract C
4 | {
5 | function f(uint x) public pure {
6 | require(x < 10000);
7 | uint y = x * 2;
8 | assert((y % 2) == 0);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/test/libsolidity/smtCheckerTests/special/msg_sender_1.sol:
--------------------------------------------------------------------------------
1 | pragma experimental SMTChecker;
2 |
3 | contract C
4 | {
5 | function f() public view {
6 | address a = msg.sender;
7 | address b = msg.sender;
8 | assert(a == b);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/test/libsolidity/smtCheckerTests/verification_target/simple_assert.sol:
--------------------------------------------------------------------------------
1 | pragma experimental SMTChecker;
2 | contract C {
3 | function f(uint a) public pure { assert(a == 2); }
4 | }
5 | // ----
6 | // Warning: (82-96): Assertion violation happens here
7 |
--------------------------------------------------------------------------------
/test/libsolidity/smtCheckerTestsJSON/simple.json:
--------------------------------------------------------------------------------
1 | {
2 | "auxiliaryInput":
3 | {
4 | "smtlib2responses":
5 | {
6 | "0x45c37a9829e623d7838d82b547d297cd446d6b5faff36c53a56862fcee50fb41": "sat\n((|EVALEXPR_0| 0))\n"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/constants/cyclic_dependency_4.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint constant a = b * c;
3 | uint constant b = 7;
4 | uint constant c = 4 + uint(keccak256(abi.encode(d)));
5 | uint constant d = 2 + b;
6 | }
7 | // ----
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/controlFlow/unreachableCode/double_return.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public pure returns (uint) {
3 | return 0;
4 | return 0;
5 | }
6 | }
7 | // ----
8 | // Warning: (85-93): Unreachable code.
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/functionTypes/external_function_type_taking_internal.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function(function () internal) external x;
3 | }
4 | // ----
5 | // TypeError: (26-47): Internal type cannot be used for external function type.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/imports/shadowing_builtins_with_alias.sol:
--------------------------------------------------------------------------------
1 | ==== Source: B.sol ====
2 | contract C {}
3 | ==== Source: b ====
4 | import {C as msg} from "B.sol";
5 | // ----
6 | // Warning: (b:13-16): This declaration shadows a builtin symbol.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/inlineAssembly/assignment_from_contract.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public pure {
3 | assembly {
4 | let x := C
5 | }
6 | }
7 | }
8 | // ----
9 | // TypeError: (72-73): Expected a library.
10 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/inlineAssembly/constant_computation.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint constant x = 2**20;
3 | function f() public pure {
4 | assembly {
5 | let a := x
6 | }
7 | }
8 | }
9 | // ----
10 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/inlineAssembly/function_call_not_found.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public pure {
3 | assembly {
4 | k()
5 | }
6 | }
7 | }
8 | // ----
9 | // DeclarationError: (63-64): Function not found.
10 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/inlineAssembly/invalid/constant_access.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | uint constant x = 1;
3 | function f() public pure {
4 | assembly {
5 | let y := x
6 | }
7 | }
8 | }
9 | // ----
10 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/054_inheritance_basic.sol:
--------------------------------------------------------------------------------
1 | contract base { uint baseMember; struct BaseType { uint element; } }
2 | contract derived is base {
3 | BaseType data;
4 | function f() public { baseMember = 7; }
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/059_illegal_override_visibility.sol:
--------------------------------------------------------------------------------
1 | contract B { function f() internal {} }
2 | contract C is B { function f() public {} }
3 | // ----
4 | // TypeError: (58-80): Overriding function visibility differs.
5 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/075_fallback_function_with_arguments.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint x;
3 | function(uint a) external { x = 2; }
4 | }
5 | // ----
6 | // TypeError: (37-45): Fallback function cannot take parameters.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/087_double_event_declaration.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | event A(uint i);
3 | event A(uint i);
4 | }
5 | // ----
6 | // DeclarationError: (20-36): Event with same name and arguments defined twice.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/194_negative_integers_to_unsigned.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | uint8 public x = -1;
3 | }
4 | // ----
5 | // TypeError: (37-39): Type int_const -1 is not implicitly convertible to expected type uint8.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/216_function_argument_storage_to_mem.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f(uint[] storage x) private {
3 | g(x);
4 | }
5 | function g(uint[] memory x) public {
6 | }
7 | }
8 | // ----
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/265_new_for_non_array.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f(uint size) public {
3 | uint x = new uint(7);
4 | }
5 | }
6 | // ----
7 | // TypeError: (65-73): Contract or array type expected.
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/482_explicit_literal_to_unspecified_string.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() pure public {
3 | string("abc");
4 | }
5 | }
6 | // ----
7 | // Warning: (52-65): Statement has no effect.
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/512_library_function_without_implementation_internal.sol:
--------------------------------------------------------------------------------
1 | library L {
2 | function f() internal;
3 | }
4 | // ----
5 | // TypeError: (16-38): Internal library function must be implemented if declared.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/513_library_function_without_implementation_private.sol:
--------------------------------------------------------------------------------
1 | library L {
2 | function f() private;
3 | }
4 | // ----
5 | // TypeError: (16-37): Internal library function must be implemented if declared.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/540_array_length_invalid_expression_division_by_zero.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint[3/0] ids;
3 | }
4 | // ----
5 | // TypeError: (22-25): Operator / not compatible with types int_const 3 and int_const 0
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/typeChecking/function_call.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f() public returns (bool) { return g(12, true) == 3; }
3 | function g(uint256, bool) public returns (uint256) { }
4 | }
5 | // ----
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/invalid_fixed_conversion_leading_zeroes_check.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function f() {
3 | fixed a = 1.0x2;
4 | }
5 | }
6 | // ----
7 | // ParserError: (44-47): Identifier-start is not allowed at end of a number.
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/structs/recursion/struct_definition_recursion_via_mapping.sol:
--------------------------------------------------------------------------------
1 | contract Test {
2 | struct MyStructName1 {
3 | address addr;
4 | uint256 count;
5 | mapping(uint => MyStructName1) x;
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/mapping/library_array_argument_public.sol:
--------------------------------------------------------------------------------
1 | library L {
2 | function f(mapping(uint => uint)[] storage) public pure {
3 | }
4 | }
5 | // ----
6 | // TypeError: (27-58): Type is required to live outside storage.
7 |
--------------------------------------------------------------------------------
/test/libyul/functionSideEffects/cyclic_graph.yul:
--------------------------------------------------------------------------------
1 | {
2 | function a() { b() }
3 | function b() { c() }
4 | function c() { b() }
5 | }
6 | // ----
7 | // : movable, sideEffectFree, sideEffectFreeIfNoMSize
8 | // a:
9 | // b:
10 | // c:
11 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/fullSimplify/reversed.yul:
--------------------------------------------------------------------------------
1 | {
2 | let a := add(0, mload(0))
3 | mstore(0, a)
4 | }
5 | // ====
6 | // step: fullSimplify
7 | // ----
8 | // {
9 | // let _1 := 0
10 | // mstore(_1, mload(_1))
11 | // }
12 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/unusedPruner/intermediate_assignment.yul:
--------------------------------------------------------------------------------
1 | {
2 | let a := 1
3 | a := 4
4 | let b := 1
5 | }
6 | // ====
7 | // step: unusedPruner
8 | // ----
9 | // {
10 | // let a := 1
11 | // a := 4
12 | // }
13 |
--------------------------------------------------------------------------------
/test/cmdlineTests/standard_yul_multiple_files/output.json:
--------------------------------------------------------------------------------
1 | {"errors":[{"component":"general","formattedMessage":"Yul mode only supports exactly one input file.","message":"Yul mode only supports exactly one input file.","severity":"error","type":"JSONError"}]}
2 |
--------------------------------------------------------------------------------
/test/libsolidity/errorRecoveryTests/contract_recovery.sol:
--------------------------------------------------------------------------------
1 | contract Errort6 {
2 | using foo for ; // missing type name
3 | }
4 |
5 | // ----
6 | // ParserError: (36-37): Expected type name
7 | // Warning: (59-60): Recovered in ContractDefinition at '}'.
8 |
--------------------------------------------------------------------------------
/test/libsolidity/smtCheckerTests/types/bool_simple_1.sol:
--------------------------------------------------------------------------------
1 | pragma experimental SMTChecker;
2 | contract C {
3 | function f(bool x) public pure {
4 | assert(x);
5 | }
6 | }
7 | // ----
8 | // Warning: (90-99): Assertion violation happens here
9 |
--------------------------------------------------------------------------------
/test/libsolidity/smtCheckerTests/types/data_location_in_function_type.sol:
--------------------------------------------------------------------------------
1 | pragma experimental SMTChecker;
2 | library L {
3 | struct Nested { uint y; }
4 | function c(function(Nested memory) external returns (uint)[] storage) external pure {}
5 | }
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/array/length/non_integer_constant_var.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | bool constant LEN = true;
3 | uint[LEN] ids;
4 | }
5 | // ----
6 | // TypeError: (52-55): Invalid array length, expected integer literal or constant expression.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/globalFunctions/suicide_no_call.sol:
--------------------------------------------------------------------------------
1 | contract C
2 | {
3 | function f(bytes memory data) public pure {
4 | suicide;
5 | }
6 | }
7 | // ----
8 | // TypeError: (60-67): "suicide" has been deprecated in favour of "selfdestruct".
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/094_event_inheritance.sol:
--------------------------------------------------------------------------------
1 | contract base {
2 | event e(uint a, bytes3 indexed s, bool indexed b);
3 | }
4 | contract c is base {
5 | function f() public { emit e(2, "abc", true); }
6 | }
7 | // ----
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/110_no_overflow_with_large_literal.sol:
--------------------------------------------------------------------------------
1 | contract c {
2 | constructor() public {
3 | a = 115792089237316195423570985008687907853269984665640564039458;
4 | }
5 | uint256 a;
6 | }
7 | // ----
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/199_integer_unsigned_exp_signed.sol:
--------------------------------------------------------------------------------
1 | contract test { function() external { uint x = 3; int y = -4; x ** y; } }
2 | // ----
3 | // TypeError: (62-68): Operator ** not compatible with types uint256 and int256
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/200_integer_signed_exp_unsigned.sol:
--------------------------------------------------------------------------------
1 | contract test { function() external { uint x = 3; int y = -4; y ** x; } }
2 | // ----
3 | // TypeError: (62-68): Operator ** not compatible with types int256 and uint256
4 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/368_shift_constant_left_negative_rvalue.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint public a = 0x42 << -8;
3 | }
4 | // ----
5 | // TypeError: (33-43): Operator << not compatible with types int_const 66 and int_const -8
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/369_shift_constant_right_negative_rvalue.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint public a = 0x42 >> -8;
3 | }
4 | // ----
5 | // TypeError: (33-43): Operator >> not compatible with types int_const 66 and int_const -8
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/478_too_large_arrays_for_calldata_public.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f(uint[85678901234] memory a) pure public {
3 | }
4 | }
5 | // ----
6 | // TypeError: (28-54): Array is too large to be encoded.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/523_reject_interface_creation.sol:
--------------------------------------------------------------------------------
1 | interface I {}
2 | contract C {
3 | function f() public {
4 | new I();
5 | }
6 | }
7 | // ----
8 | // TypeError: (62-67): Cannot instantiate an interface.
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/nameAndTypeResolution/536_array_length_invalid_expression_negative_bool.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | uint[-true] ids;
3 | }
4 | // ----
5 | // TypeError: (22-27): Invalid array length, expected integer literal or constant expression.
6 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/address_payable_conversion.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public pure {
3 | address payable a = address payable(this);
4 | }
5 | }
6 | // ----
7 | // ParserError: (80-87): Expected ';' but got 'payable'
8 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/enum_from_interface.sol:
--------------------------------------------------------------------------------
1 | interface I {
2 | enum Direction { Left, Right }
3 | }
4 |
5 | contract D {
6 | function f() public pure returns (I.Direction) {
7 | return I.Direction.Left;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/parsing/enum_from_library.sol:
--------------------------------------------------------------------------------
1 | library L {
2 | enum Direction { Left, Right }
3 | }
4 |
5 | contract D {
6 | function f() public pure returns (L.Direction) {
7 | return L.Direction.Left;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/scoping/double_function_declaration.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | function fun() public { }
3 | function fun() public { }
4 | }
5 | // ----
6 | // DeclarationError: (20-45): Function with same name and arguments defined twice.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/scoping/name_shadowing.sol:
--------------------------------------------------------------------------------
1 | contract test {
2 | uint256 variable;
3 | function f() pure public { uint32 variable; variable = 2; }
4 | }
5 | // ----
6 | // Warning: (69-84): This declaration shadows an existing declaration.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/mapping/access_index_omitted.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | mapping(uint => uint) m;
3 | function f() public {
4 | m[] = 3;
5 | }
6 | }
7 | // ----
8 | // TypeError: (76-79): Index expression cannot be omitted.
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/mapping/library_array_argument_external.sol:
--------------------------------------------------------------------------------
1 | library L {
2 | function f(mapping(uint => uint)[] storage) external pure {
3 | }
4 | }
5 | // ----
6 | // TypeError: (27-58): Type is required to live outside storage.
7 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/types/var_empty_decl_1.sol:
--------------------------------------------------------------------------------
1 | contract C {
2 | function f() public pure {
3 | var a;
4 | a.NeverReachedByParser();
5 | }
6 | }
7 | // ----
8 | // TypeError: (52-57): Use of the "var" keyword is disallowed.
9 |
--------------------------------------------------------------------------------
/test/libsolidity/syntaxTests/viewPureChecker/callvalue_payable_assembly_fallback.sol:
--------------------------------------------------------------------------------
1 | contract C
2 | {
3 | function () external payable {
4 | uint x;
5 | assembly {
6 | x := callvalue()
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/expressionSimplifier/mod_and_1.yul:
--------------------------------------------------------------------------------
1 | {
2 | mstore(0, mod(calldataload(0), exp(2, 8)))
3 | }
4 | // ====
5 | // step: expressionSimplifier
6 | // ----
7 | // {
8 | // mstore(0, and(calldataload(0), 255))
9 | // }
10 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/structuralSimplifier/if_multi_unassigned_condition.yul:
--------------------------------------------------------------------------------
1 | {
2 | let x, y
3 | if x { mstore(0, 0) }
4 | if y { mstore(0, 0) }
5 | }
6 | // ====
7 | // step: structuralSimplifier
8 | // ----
9 | // { let x, y }
10 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_no_match.yul:
--------------------------------------------------------------------------------
1 | {
2 | let y := 200
3 | switch 3
4 | case 0 { y := 8 }
5 | case 1 { y := 9 }
6 | }
7 | // ====
8 | // step: structuralSimplifier
9 | // ----
10 | // { let y := 200 }
11 |
--------------------------------------------------------------------------------
/test/libyul/yulOptimizerTests/unusedPruner/multi_assignments.yul:
--------------------------------------------------------------------------------
1 | {
2 | let x, y
3 | x := 1
4 | y := 2
5 | }
6 | // ====
7 | // step: unusedPruner
8 | // ----
9 | // {
10 | // let x, y
11 | // x := 1
12 | // y := 2
13 | // }
14 |
--------------------------------------------------------------------------------
/test/libsolidity/smtCheckerTests/functions/functions_trivial_condition_if.sol:
--------------------------------------------------------------------------------
1 | pragma experimental SMTChecker;
2 | contract C
3 | {
4 | function f(bool x) public pure { require(x); if (x) {} }
5 | }
6 | // ----
7 | // Warning: (95-96): Condition is always true.
8 |
--------------------------------------------------------------------------------
/test/libsolidity/smtCheckerTests/invariants/loop_basic_for.sol:
--------------------------------------------------------------------------------
1 | pragma experimental SMTChecker;
2 |
3 | contract Simple {
4 | function f(uint x) public pure {
5 | uint y;
6 | for (y = 0; y < x; ++y) {}
7 | assert(y == x);
8 | }
9 | }
10 | // ----
11 |
--------------------------------------------------------------------------------
/test/libsolidity/smtCheckerTests/operators/delete_array_2d.sol:
--------------------------------------------------------------------------------
1 | pragma experimental SMTChecker;
2 |
3 | contract C
4 | {
5 | uint[][] a;
6 | function f() public {
7 | require(a[2][3] == 4);
8 | delete a;
9 | assert(a[2][3] == 0);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------