From c95891b6ed8b137895f024feb21f32ed579fcc57 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 23 Feb 2021 14:13:52 +0100 Subject: [PATCH] Export all events. Update tests. Additional tests Revert changes to the Natspec --- Changelog.md | 10 +- libsolidity/ast/AST.cpp | 15 + libsolidity/ast/AST.h | 4 + libsolidity/ast/ASTJsonExporter.cpp | 2 + libsolidity/interface/ABI.cpp | 2 +- libsolidity/interface/Natspec.cpp | 6 +- .../ast_compact_json_no_pretty_json/output | 2 +- .../ast_compact_json_with_base_path/output | 1 + .../combined_json_with_base_path/output | 1 + test/cmdlineTests/events_in_abi/args | 1 + test/cmdlineTests/events_in_abi/input.sol | 16 + test/cmdlineTests/events_in_abi/output | 59 +++ .../recovery_ast_constructor/output | 1 + .../recovery_standard_json/output.json | 1 + .../standard_only_ast_requested/output.json | 1 + ...t_from_aggregated_contract_not_emmited.sol | 42 ++ .../libsolidity/ABIJson/event_inheritance.sol | 62 +++ test/libsolidity/ABIJson/events_indirect.sol | 88 ++++ .../ABIJson/events_repetitions.sol | 45 ++ .../ABIJson/same_event_defined_twice.sol | 61 +++ .../ASTJSON/abstract_contract.json | 1 + .../ASTJSON/abstract_contract_parseOnly.json | 1 + test/libsolidity/ASTJSON/address_payable.json | 1 + .../ASTJSON/address_payable_parseOnly.json | 1 + test/libsolidity/ASTJSON/array_type_name.json | 1 + .../ASTJSON/array_type_name_parseOnly.json | 1 + test/libsolidity/ASTJSON/assembly/call.json | 1 + .../ASTJSON/assembly/call_parseOnly.json | 1 + .../ASTJSON/assembly/empty_block.json | 1 + .../assembly/empty_block_parseOnly.json | 1 + .../ASTJSON/assembly/function.json | 1 + .../ASTJSON/assembly/function_parseOnly.json | 1 + test/libsolidity/ASTJSON/assembly/leave.json | 1 + .../ASTJSON/assembly/leave_parseOnly.json | 1 + test/libsolidity/ASTJSON/assembly/loop.json | 1 + .../ASTJSON/assembly/loop_parseOnly.json | 1 + .../ASTJSON/assembly/nested_functions.json | 1 + .../assembly/nested_functions_parseOnly.json | 1 + .../ASTJSON/assembly/slot_offset.json | 1 + .../assembly/slot_offset_parseOnly.json | 1 + .../ASTJSON/assembly/stringlit.json | 1 + .../ASTJSON/assembly/stringlit_parseOnly.json | 1 + test/libsolidity/ASTJSON/assembly/switch.json | 1 + .../ASTJSON/assembly/switch_default.json | 1 + .../assembly/switch_default_parseOnly.json | 1 + .../ASTJSON/assembly/switch_parseOnly.json | 1 + .../ASTJSON/assembly/var_access.json | 1 + .../assembly/var_access_parseOnly.json | 1 + .../ASTJSON/base_constructor_call.json | 2 + .../base_constructor_call_parseOnly.json | 2 + test/libsolidity/ASTJSON/constructor.json | 1 + .../ASTJSON/constructor_parseOnly.json | 1 + .../ASTJSON/contract_dep_order.json | 5 + .../ASTJSON/contract_dep_order_parseOnly.json | 5 + test/libsolidity/ASTJSON/documentation.json | 6 + .../ASTJSON/documentation_local_variable.json | 1 + ...ocumentation_local_variable_parseOnly.json | 1 + .../ASTJSON/documentation_on_statements.json | 1 + ...documentation_on_statements_parseOnly.json | 1 + .../ASTJSON/documentation_parseOnly.json | 3 + .../ASTJSON/documentation_triple.json | 1 + .../documentation_triple_parseOnly.json | 1 + test/libsolidity/ASTJSON/enum_value.json | 1 + .../ASTJSON/enum_value_parseOnly.json | 1 + .../ASTJSON/event_aggregated_contract.json | 398 ++++++++++++++++++ .../ASTJSON/event_aggregated_contract.sol | 15 + .../libsolidity/ASTJSON/event_definition.json | 4 + .../ASTJSON/event_definition_parseOnly.json | 1 + .../ASTJSON/event_inheritance.json | 194 +++++++++ .../libsolidity/ASTJSON/event_inheritance.sol | 9 + ...variables_of_internal_types_parseOnly.json | 1 + .../ASTJSON/fail_after_parsing_parseOnly.json | 1 + test/libsolidity/ASTJSON/fallback.json | 1 + .../ASTJSON/fallback_and_reveice_ether.json | 1 + .../fallback_and_reveice_ether_parseOnly.json | 1 + .../ASTJSON/fallback_parseOnly.json | 1 + .../libsolidity/ASTJSON/fallback_payable.json | 1 + .../ASTJSON/fallback_payable_parseOnly.json | 1 + test/libsolidity/ASTJSON/function_type.json | 1 + .../ASTJSON/function_type_parseOnly.json | 1 + test/libsolidity/ASTJSON/indirect_event.json | 319 ++++++++++++++ test/libsolidity/ASTJSON/indirect_event.sol | 11 + .../ASTJSON/indirect_event_parseOnly.json | 228 ++++++++++ .../ASTJSON/inheritance_specifier.json | 2 + .../inheritance_specifier_parseOnly.json | 2 + test/libsolidity/ASTJSON/license.json | 1 + .../ASTJSON/license_parseOnly.json | 1 + .../long_type_name_binary_operation.json | 1 + ..._type_name_binary_operation_parseOnly.json | 1 + .../ASTJSON/long_type_name_identifier.json | 1 + .../long_type_name_identifier_parseOnly.json | 1 + test/libsolidity/ASTJSON/mappings.json | 1 + .../ASTJSON/modifier_definition.json | 1 + .../modifier_definition_parseOnly.json | 1 + .../ASTJSON/modifier_invocation.json | 1 + .../modifier_invocation_parseOnly.json | 1 + test/libsolidity/ASTJSON/mutability.json | 1 + .../ASTJSON/mutability_parseOnly.json | 1 + test/libsolidity/ASTJSON/non_utf8.json | 1 + .../ASTJSON/non_utf8_parseOnly.json | 1 + .../not_existing_import_parseOnly.json | 1 + test/libsolidity/ASTJSON/override.json | 3 + .../ASTJSON/override_parseOnly.json | 3 + .../ASTJSON/placeholder_statement.json | 1 + .../placeholder_statement_parseOnly.json | 1 + test/libsolidity/ASTJSON/receive_ether.json | 1 + .../ASTJSON/receive_ether_parseOnly.json | 1 + test/libsolidity/ASTJSON/short_type_name.json | 1 + .../ASTJSON/short_type_name_parseOnly.json | 1 + .../ASTJSON/short_type_name_ref.json | 1 + .../short_type_name_ref_parseOnly.json | 1 + test/libsolidity/ASTJSON/smoke.json | 1 + test/libsolidity/ASTJSON/smoke_parseOnly.json | 1 + test/libsolidity/ASTJSON/source_location.json | 1 + .../ASTJSON/source_location_parseOnly.json | 1 + test/libsolidity/ASTJSON/string.json | 1 + .../libsolidity/ASTJSON/string_parseOnly.json | 1 + .../ASTJSON/two_base_functions.json | 3 + .../ASTJSON/two_base_functions_parseOnly.json | 3 + test/libsolidity/ASTJSON/unicode.json | 1 + .../ASTJSON/unicode_parseOnly.json | 1 + test/libsolidity/ASTJSON/used_errors.json | 1 + .../ASTJSON/used_errors_parseOnly.json | 1 + .../ASTJSON/userDefinedValueType.json | 1 + .../userDefinedValueType_parseOnly.json | 1 + .../ASTJSON/using_for_directive.json | 2 + .../using_for_directive_parseOnly.json | 2 + test/libsolidity/ASTJSON/yul_hex_literal.json | 1 + .../ASTJSON/yul_hex_literal_parseOnly.json | 1 + test/libsolidity/SolidityNatspecJSON.cpp | 2 - test/libsolidity/StandardCompiler.cpp | 3 +- 131 files changed, 1726 insertions(+), 7 deletions(-) create mode 100644 test/cmdlineTests/events_in_abi/args create mode 100644 test/cmdlineTests/events_in_abi/input.sol create mode 100644 test/cmdlineTests/events_in_abi/output create mode 100644 test/libsolidity/ABIJson/event_from_aggregated_contract_not_emmited.sol create mode 100644 test/libsolidity/ABIJson/event_inheritance.sol create mode 100644 test/libsolidity/ABIJson/events_indirect.sol create mode 100644 test/libsolidity/ABIJson/events_repetitions.sol create mode 100644 test/libsolidity/ABIJson/same_event_defined_twice.sol create mode 100644 test/libsolidity/ASTJSON/event_aggregated_contract.json create mode 100644 test/libsolidity/ASTJSON/event_aggregated_contract.sol create mode 100644 test/libsolidity/ASTJSON/event_inheritance.json create mode 100644 test/libsolidity/ASTJSON/event_inheritance.sol create mode 100644 test/libsolidity/ASTJSON/indirect_event.json create mode 100644 test/libsolidity/ASTJSON/indirect_event.sol create mode 100644 test/libsolidity/ASTJSON/indirect_event_parseOnly.json diff --git a/Changelog.md b/Changelog.md index 3efe2bb2a..daa7bd8f0 100644 --- a/Changelog.md +++ b/Changelog.md @@ -9,10 +9,18 @@ Compiler Features: Bugfixes: +Important Bugfixes: + * ABI: Include events in the ABI that are emitted by a contract but defined outside of it. + + +AST Changes: + * Add field ``emittedEvents`` to ``ContractDefinition`` which contains the AST IDs of all inherited and emitted events. + + ### 0.8.19 (2023-02-22) Language Features: -* Allow defining custom operators for user-defined value types via ``using {f as +} for T global`` syntax. + * Allow defining custom operators for user-defined value types via ``using {f as +} for T global`` syntax. Compiler Features: diff --git a/libsolidity/ast/AST.cpp b/libsolidity/ast/AST.cpp index fab1a20f8..e419b2890 100644 --- a/libsolidity/ast/AST.cpp +++ b/libsolidity/ast/AST.cpp @@ -243,6 +243,21 @@ vector const ContractDefinition::usedInterfaceEvents() c ); } +vector ContractDefinition::interfaceEvents(bool _requireCallGraph) const +{ + set result; + for (ContractDefinition const* contract: annotation().linearizedBaseContracts) + result += contract->events(); + solAssert(annotation().creationCallGraph.set() == annotation().deployedCallGraph.set()); + if (_requireCallGraph) + solAssert(annotation().creationCallGraph.set()); + if (annotation().creationCallGraph.set()) + result += usedInterfaceEvents(); + // We could filter out all events that do not have an external interface + // if _requireCallGraph is false. + return util::convertContainer>(std::move(result)); +} + vector ContractDefinition::interfaceErrors(bool _requireCallGraph) const { set result; diff --git a/libsolidity/ast/AST.h b/libsolidity/ast/AST.h index 93a264622..c2ca42f03 100644 --- a/libsolidity/ast/AST.h +++ b/libsolidity/ast/AST.h @@ -522,6 +522,10 @@ public: std::vector events() const { return filteredNodes(m_subNodes); } std::vector const& definedInterfaceEvents() const; std::vector const usedInterfaceEvents() const; + /// @return all events defined in this contract and its base contracts and all events + /// that are emitted during the execution of the contract. + /// @param _requireCallGraph if false, do not fail if the call graph has not been computed yet. + std::vector interfaceEvents(bool _requireCallGraph = true) const; /// @returns all errors defined in this contract or any base contract /// and all errors referenced during execution. /// @param _requireCallGraph if false, do not fail if the call graph has not been computed yet. diff --git a/libsolidity/ast/ASTJsonExporter.cpp b/libsolidity/ast/ASTJsonExporter.cpp index e35d10821..4fcb606e0 100644 --- a/libsolidity/ast/ASTJsonExporter.cpp +++ b/libsolidity/ast/ASTJsonExporter.cpp @@ -286,6 +286,8 @@ bool ASTJsonExporter::visit(ContractDefinition const& _node) make_pair("abstract", _node.abstract()), make_pair("baseContracts", toJson(_node.baseContracts())), make_pair("contractDependencies", getContainerIds(_node.annotation().contractDependencies | ranges::views::keys)), + // Do not require call graph because the AST is also created for incorrect sources. + make_pair("emittedEvents", getContainerIds(_node.interfaceEvents(false))), make_pair("usedErrors", getContainerIds(_node.interfaceErrors(false))), make_pair("nodes", toJson(_node.subNodes())), make_pair("scope", idOrNull(_node.scope())) diff --git a/libsolidity/interface/ABI.cpp b/libsolidity/interface/ABI.cpp index cbfa36122..bfc9c07a5 100644 --- a/libsolidity/interface/ABI.cpp +++ b/libsolidity/interface/ABI.cpp @@ -101,7 +101,7 @@ Json::Value ABI::generate(ContractDefinition const& _contractDef) method["stateMutability"] = stateMutabilityToString(externalFunctionType->stateMutability()); abi.emplace(std::move(method)); } - for (auto const& it: _contractDef.definedInterfaceEvents()) + for (auto const& it: _contractDef.interfaceEvents()) { Json::Value event{Json::objectValue}; event["type"] = "event"; diff --git a/libsolidity/interface/Natspec.cpp b/libsolidity/interface/Natspec.cpp index 27efd1c24..592b35a06 100644 --- a/libsolidity/interface/Natspec.cpp +++ b/libsolidity/interface/Natspec.cpp @@ -82,7 +82,11 @@ Json::Value Natspec::userDocumentation(ContractDefinition const& _contractDef) { string value = extractDoc(event->annotation().docTags, "notice"); if (!value.empty()) - doc["events"][event->functionType(true)->externalSignature()]["notice"] = value; + { + Json::Value eventDoc{Json::objectValue}; + eventDoc["notice"] = value; + doc["events"][event->functionType(true)->externalSignature()].append(std::move(eventDoc)); + } } for (auto const& error: _contractDef.interfaceErrors()) diff --git a/test/cmdlineTests/ast_compact_json_no_pretty_json/output b/test/cmdlineTests/ast_compact_json_no_pretty_json/output index abdc17125..987c08964 100644 --- a/test/cmdlineTests/ast_compact_json_no_pretty_json/output +++ b/test/cmdlineTests/ast_compact_json_no_pretty_json/output @@ -2,4 +2,4 @@ JSON AST (compact format): ======= ast_compact_json_no_pretty_json/input.sol ======= -{"absolutePath":"ast_compact_json_no_pretty_json/input.sol","exportedSymbols":{"C":[2]},"id":3,"license":"GPL-3.0","nodeType":"SourceUnit","nodes":[{"id":1,"literals":["solidity",">=","0.0"],"nodeType":"PragmaDirective","src":"36:22:0"},{"abstract":false,"baseContracts":[],"canonicalName":"C","contractDependencies":[],"contractKind":"contract","fullyImplemented":true,"id":2,"linearizedBaseContracts":[2],"name":"C","nameLocation":"69:1:0","nodeType":"ContractDefinition","nodes":[],"scope":3,"src":"60:13:0","usedErrors":[]}],"src":"36:38:0"} +{"absolutePath":"ast_compact_json_no_pretty_json/input.sol","exportedSymbols":{"C":[2]},"id":3,"license":"GPL-3.0","nodeType":"SourceUnit","nodes":[{"id":1,"literals":["solidity",">=","0.0"],"nodeType":"PragmaDirective","src":"36:22:0"},{"abstract":false,"baseContracts":[],"canonicalName":"C","contractDependencies":[],"contractKind":"contract","emittedEvents":[],"fullyImplemented":true,"id":2,"linearizedBaseContracts":[2],"name":"C","nameLocation":"69:1:0","nodeType":"ContractDefinition","nodes":[],"scope":3,"src":"60:13:0","usedErrors":[]}],"src":"36:38:0"} diff --git a/test/cmdlineTests/ast_compact_json_with_base_path/output b/test/cmdlineTests/ast_compact_json_with_base_path/output index 6404ef3bd..fe8623314 100644 --- a/test/cmdlineTests/ast_compact_json_with_base_path/output +++ b/test/cmdlineTests/ast_compact_json_with_base_path/output @@ -33,6 +33,7 @@ JSON AST (compact format): "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 5, "linearizedBaseContracts": diff --git a/test/cmdlineTests/combined_json_with_base_path/output b/test/cmdlineTests/combined_json_with_base_path/output index 9acdea553..37095c3af 100644 --- a/test/cmdlineTests/combined_json_with_base_path/output +++ b/test/cmdlineTests/combined_json_with_base_path/output @@ -44,6 +44,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 5, "linearizedBaseContracts": diff --git a/test/cmdlineTests/events_in_abi/args b/test/cmdlineTests/events_in_abi/args new file mode 100644 index 000000000..d27d3ef12 --- /dev/null +++ b/test/cmdlineTests/events_in_abi/args @@ -0,0 +1 @@ +--abi --pretty-json --json-indent 4 diff --git a/test/cmdlineTests/events_in_abi/input.sol b/test/cmdlineTests/events_in_abi/input.sol new file mode 100644 index 000000000..3d73639e0 --- /dev/null +++ b/test/cmdlineTests/events_in_abi/input.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.0; +library L { + event e1(uint b); +} + +function f() { + emit L.e1(5); +} + +contract C { + event e1(uint indexed a); + function g() public { + f(); + } +} diff --git a/test/cmdlineTests/events_in_abi/output b/test/cmdlineTests/events_in_abi/output new file mode 100644 index 000000000..6c18a1752 --- /dev/null +++ b/test/cmdlineTests/events_in_abi/output @@ -0,0 +1,59 @@ + +======= events_in_abi/input.sol:C ======= +Contract JSON ABI +[ + { + "anonymous": false, + "inputs": + [ + { + "indexed": false, + "internalType": "uint256", + "name": "b", + "type": "uint256" + } + ], + "name": "e1", + "type": "event" + }, + { + "anonymous": false, + "inputs": + [ + { + "indexed": true, + "internalType": "uint256", + "name": "a", + "type": "uint256" + } + ], + "name": "e1", + "type": "event" + }, + { + "inputs": [], + "name": "g", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] + +======= events_in_abi/input.sol:L ======= +Contract JSON ABI +[ + { + "anonymous": false, + "inputs": + [ + { + "indexed": false, + "internalType": "uint256", + "name": "b", + "type": "uint256" + } + ], + "name": "e1", + "type": "event" + } +] diff --git a/test/cmdlineTests/recovery_ast_constructor/output b/test/cmdlineTests/recovery_ast_constructor/output index 33c07b4c1..d705cf988 100644 --- a/test/cmdlineTests/recovery_ast_constructor/output +++ b/test/cmdlineTests/recovery_ast_constructor/output @@ -34,6 +34,7 @@ JSON AST (compact format): "canonicalName": "Error1", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 18, "linearizedBaseContracts": diff --git a/test/cmdlineTests/recovery_standard_json/output.json b/test/cmdlineTests/recovery_standard_json/output.json index 68415ac0c..11a7145ee 100644 --- a/test/cmdlineTests/recovery_standard_json/output.json +++ b/test/cmdlineTests/recovery_standard_json/output.json @@ -78,6 +78,7 @@ "canonicalName": "Errort6", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 3, "linearizedBaseContracts": diff --git a/test/cmdlineTests/standard_only_ast_requested/output.json b/test/cmdlineTests/standard_only_ast_requested/output.json index 4caa8a764..00f07da73 100644 --- a/test/cmdlineTests/standard_only_ast_requested/output.json +++ b/test/cmdlineTests/standard_only_ast_requested/output.json @@ -35,6 +35,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 6, "linearizedBaseContracts": diff --git a/test/libsolidity/ABIJson/event_from_aggregated_contract_not_emmited.sol b/test/libsolidity/ABIJson/event_from_aggregated_contract_not_emmited.sol new file mode 100644 index 000000000..6a930589d --- /dev/null +++ b/test/libsolidity/ABIJson/event_from_aggregated_contract_not_emmited.sol @@ -0,0 +1,42 @@ +contract C { + event e(); + function f() public { + emit e(); + } +} + +contract D { + C c; + constructor() { + c = new C(); + c.f(); + } +} + +// ---- +// :C +// [ +// { +// "anonymous": false, +// "inputs": [], +// "name": "e", +// "type": "event" +// }, +// { +// "inputs": [], +// "name": "f", +// "outputs": [], +// "stateMutability": "nonpayable", +// "type": "function" +// } +// ] +// +// +// :D +// [ +// { +// "inputs": [], +// "stateMutability": "nonpayable", +// "type": "constructor" +// } +// ] diff --git a/test/libsolidity/ABIJson/event_inheritance.sol b/test/libsolidity/ABIJson/event_inheritance.sol new file mode 100644 index 000000000..e4a8aeea4 --- /dev/null +++ b/test/libsolidity/ABIJson/event_inheritance.sol @@ -0,0 +1,62 @@ +interface B { + event EB(); +} + +contract C is B { + event EC(); +} + +contract D is C { + event ED(); +} + +// ---- +// :B +// [ +// { +// "anonymous": false, +// "inputs": [], +// "name": "EB", +// "type": "event" +// } +// ] +// +// +// :C +// [ +// { +// "anonymous": false, +// "inputs": [], +// "name": "EB", +// "type": "event" +// }, +// { +// "anonymous": false, +// "inputs": [], +// "name": "EC", +// "type": "event" +// } +// ] +// +// +// :D +// [ +// { +// "anonymous": false, +// "inputs": [], +// "name": "EB", +// "type": "event" +// }, +// { +// "anonymous": false, +// "inputs": [], +// "name": "EC", +// "type": "event" +// }, +// { +// "anonymous": false, +// "inputs": [], +// "name": "ED", +// "type": "event" +// } +// ] diff --git a/test/libsolidity/ABIJson/events_indirect.sol b/test/libsolidity/ABIJson/events_indirect.sol new file mode 100644 index 000000000..86368028c --- /dev/null +++ b/test/libsolidity/ABIJson/events_indirect.sol @@ -0,0 +1,88 @@ +library L { + event e1(uint b); + event e2(); + event e2(uint a); + event e3() anonymous; +} +contract test { + function f() public { + emit L.e1(1); + emit L.e3(); + } +} +// ---- +// :L +// [ +// { +// "anonymous": false, +// "inputs": +// [ +// { +// "indexed": false, +// "internalType": "uint256", +// "name": "b", +// "type": "uint256" +// } +// ], +// "name": "e1", +// "type": "event" +// }, +// { +// "anonymous": false, +// "inputs": [], +// "name": "e2", +// "type": "event" +// }, +// { +// "anonymous": false, +// "inputs": +// [ +// { +// "indexed": false, +// "internalType": "uint256", +// "name": "a", +// "type": "uint256" +// } +// ], +// "name": "e2", +// "type": "event" +// }, +// { +// "anonymous": true, +// "inputs": [], +// "name": "e3", +// "type": "event" +// } +// ] +// +// +// :test +// [ +// { +// "anonymous": false, +// "inputs": +// [ +// { +// "indexed": false, +// "internalType": "uint256", +// "name": "b", +// "type": "uint256" +// } +// ], +// "name": "e1", +// "type": "event" +// }, +// { +// "anonymous": true, +// "inputs": [], +// "name": "e3", +// "type": "event" +// }, +// { +// "inputs": [], +// "name": "f", +// "outputs": [], +// "stateMutability": "nonpayable", +// "type": "function" +// } +// ] diff --git a/test/libsolidity/ABIJson/events_repetitions.sol b/test/libsolidity/ABIJson/events_repetitions.sol new file mode 100644 index 000000000..8dd980a6a --- /dev/null +++ b/test/libsolidity/ABIJson/events_repetitions.sol @@ -0,0 +1,45 @@ +library L { + event e(); +} +contract C { + constructor() { + emit L.e(); + } + function f() public { + emit L.e(); + } +} + +// ---- +// :C +// [ +// { +// "inputs": [], +// "stateMutability": "nonpayable", +// "type": "constructor" +// }, +// { +// "anonymous": false, +// "inputs": [], +// "name": "e", +// "type": "event" +// }, +// { +// "inputs": [], +// "name": "f", +// "outputs": [], +// "stateMutability": "nonpayable", +// "type": "function" +// } +// ] +// +// +// :L +// [ +// { +// "anonymous": false, +// "inputs": [], +// "name": "e", +// "type": "event" +// } +// ] diff --git a/test/libsolidity/ABIJson/same_event_defined_twice.sol b/test/libsolidity/ABIJson/same_event_defined_twice.sol new file mode 100644 index 000000000..9a65e61d6 --- /dev/null +++ b/test/libsolidity/ABIJson/same_event_defined_twice.sol @@ -0,0 +1,61 @@ +library L1 { event e(); } +library L2 { event e(); } +contract C { + constructor() { + emit L1.e(); + } + function f() public { + emit L2.e(); + } +} + +// ---- +// :C +// [ +// { +// "inputs": [], +// "stateMutability": "nonpayable", +// "type": "constructor" +// }, +// { +// "anonymous": false, +// "inputs": [], +// "name": "e", +// "type": "event" +// }, +// { +// "anonymous": false, +// "inputs": [], +// "name": "e", +// "type": "event" +// }, +// { +// "inputs": [], +// "name": "f", +// "outputs": [], +// "stateMutability": "nonpayable", +// "type": "function" +// } +// ] +// +// +// :L1 +// [ +// { +// "anonymous": false, +// "inputs": [], +// "name": "e", +// "type": "event" +// } +// ] +// +// +// :L2 +// [ +// { +// "anonymous": false, +// "inputs": [], +// "name": "e", +// "type": "event" +// } +// ] diff --git a/test/libsolidity/ASTJSON/abstract_contract.json b/test/libsolidity/ASTJSON/abstract_contract.json index 168433eb9..28b5886d1 100644 --- a/test/libsolidity/ASTJSON/abstract_contract.json +++ b/test/libsolidity/ASTJSON/abstract_contract.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 5, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/abstract_contract_parseOnly.json b/test/libsolidity/ASTJSON/abstract_contract_parseOnly.json index 51dd803a3..bf9395061 100644 --- a/test/libsolidity/ASTJSON/abstract_contract_parseOnly.json +++ b/test/libsolidity/ASTJSON/abstract_contract_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 5, "name": "C", "nameLocation": "18:1:1", diff --git a/test/libsolidity/ASTJSON/address_payable.json b/test/libsolidity/ASTJSON/address_payable.json index 83ba2c6d7..e7a034d4e 100644 --- a/test/libsolidity/ASTJSON/address_payable.json +++ b/test/libsolidity/ASTJSON/address_payable.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 39, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/address_payable_parseOnly.json b/test/libsolidity/ASTJSON/address_payable_parseOnly.json index 9d095dc68..f9f20d8c8 100644 --- a/test/libsolidity/ASTJSON/address_payable_parseOnly.json +++ b/test/libsolidity/ASTJSON/address_payable_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 39, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/array_type_name.json b/test/libsolidity/ASTJSON/array_type_name.json index c1bcaa985..486da0114 100644 --- a/test/libsolidity/ASTJSON/array_type_name.json +++ b/test/libsolidity/ASTJSON/array_type_name.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 4, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/array_type_name_parseOnly.json b/test/libsolidity/ASTJSON/array_type_name_parseOnly.json index 4248a3f98..6318bb272 100644 --- a/test/libsolidity/ASTJSON/array_type_name_parseOnly.json +++ b/test/libsolidity/ASTJSON/array_type_name_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 4, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/assembly/call.json b/test/libsolidity/ASTJSON/assembly/call.json index c6e0561ed..cee2866ea 100644 --- a/test/libsolidity/ASTJSON/assembly/call.json +++ b/test/libsolidity/ASTJSON/assembly/call.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 6, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/assembly/call_parseOnly.json b/test/libsolidity/ASTJSON/assembly/call_parseOnly.json index 27d6ac07d..4fea3a1a6 100644 --- a/test/libsolidity/ASTJSON/assembly/call_parseOnly.json +++ b/test/libsolidity/ASTJSON/assembly/call_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 6, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/assembly/empty_block.json b/test/libsolidity/ASTJSON/assembly/empty_block.json index 19779b076..81cfac1f7 100644 --- a/test/libsolidity/ASTJSON/assembly/empty_block.json +++ b/test/libsolidity/ASTJSON/assembly/empty_block.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 6, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/assembly/empty_block_parseOnly.json b/test/libsolidity/ASTJSON/assembly/empty_block_parseOnly.json index 8b07db893..80b2b94a6 100644 --- a/test/libsolidity/ASTJSON/assembly/empty_block_parseOnly.json +++ b/test/libsolidity/ASTJSON/assembly/empty_block_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 6, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/assembly/function.json b/test/libsolidity/ASTJSON/assembly/function.json index e528baa4c..0caaf56f7 100644 --- a/test/libsolidity/ASTJSON/assembly/function.json +++ b/test/libsolidity/ASTJSON/assembly/function.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 6, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/assembly/function_parseOnly.json b/test/libsolidity/ASTJSON/assembly/function_parseOnly.json index f89a2fa6d..cdc983578 100644 --- a/test/libsolidity/ASTJSON/assembly/function_parseOnly.json +++ b/test/libsolidity/ASTJSON/assembly/function_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 6, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/assembly/leave.json b/test/libsolidity/ASTJSON/assembly/leave.json index eefc5105f..a538f6a3c 100644 --- a/test/libsolidity/ASTJSON/assembly/leave.json +++ b/test/libsolidity/ASTJSON/assembly/leave.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 6, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/assembly/leave_parseOnly.json b/test/libsolidity/ASTJSON/assembly/leave_parseOnly.json index ba8b54507..014be4742 100644 --- a/test/libsolidity/ASTJSON/assembly/leave_parseOnly.json +++ b/test/libsolidity/ASTJSON/assembly/leave_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 6, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/assembly/loop.json b/test/libsolidity/ASTJSON/assembly/loop.json index 8a887a80f..4dcbd422e 100644 --- a/test/libsolidity/ASTJSON/assembly/loop.json +++ b/test/libsolidity/ASTJSON/assembly/loop.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 6, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/assembly/loop_parseOnly.json b/test/libsolidity/ASTJSON/assembly/loop_parseOnly.json index 8ee936747..2c2afc139 100644 --- a/test/libsolidity/ASTJSON/assembly/loop_parseOnly.json +++ b/test/libsolidity/ASTJSON/assembly/loop_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 6, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/assembly/nested_functions.json b/test/libsolidity/ASTJSON/assembly/nested_functions.json index 41a18a1d0..7861e3b12 100644 --- a/test/libsolidity/ASTJSON/assembly/nested_functions.json +++ b/test/libsolidity/ASTJSON/assembly/nested_functions.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 8, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/assembly/nested_functions_parseOnly.json b/test/libsolidity/ASTJSON/assembly/nested_functions_parseOnly.json index f5f554608..421201cd1 100644 --- a/test/libsolidity/ASTJSON/assembly/nested_functions_parseOnly.json +++ b/test/libsolidity/ASTJSON/assembly/nested_functions_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 8, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/assembly/slot_offset.json b/test/libsolidity/ASTJSON/assembly/slot_offset.json index 1e6fe1447..e852e73dc 100644 --- a/test/libsolidity/ASTJSON/assembly/slot_offset.json +++ b/test/libsolidity/ASTJSON/assembly/slot_offset.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 12, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/assembly/slot_offset_parseOnly.json b/test/libsolidity/ASTJSON/assembly/slot_offset_parseOnly.json index 4135bb343..c4aa22900 100644 --- a/test/libsolidity/ASTJSON/assembly/slot_offset_parseOnly.json +++ b/test/libsolidity/ASTJSON/assembly/slot_offset_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 12, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/assembly/stringlit.json b/test/libsolidity/ASTJSON/assembly/stringlit.json index 64777e947..9735ec8f8 100644 --- a/test/libsolidity/ASTJSON/assembly/stringlit.json +++ b/test/libsolidity/ASTJSON/assembly/stringlit.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 6, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/assembly/stringlit_parseOnly.json b/test/libsolidity/ASTJSON/assembly/stringlit_parseOnly.json index e82999a78..0c8dede47 100644 --- a/test/libsolidity/ASTJSON/assembly/stringlit_parseOnly.json +++ b/test/libsolidity/ASTJSON/assembly/stringlit_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 6, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/assembly/switch.json b/test/libsolidity/ASTJSON/assembly/switch.json index f78699ef6..4fbb0f7c7 100644 --- a/test/libsolidity/ASTJSON/assembly/switch.json +++ b/test/libsolidity/ASTJSON/assembly/switch.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 6, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/assembly/switch_default.json b/test/libsolidity/ASTJSON/assembly/switch_default.json index 16e1f1bf4..c1e3007b5 100644 --- a/test/libsolidity/ASTJSON/assembly/switch_default.json +++ b/test/libsolidity/ASTJSON/assembly/switch_default.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 6, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/assembly/switch_default_parseOnly.json b/test/libsolidity/ASTJSON/assembly/switch_default_parseOnly.json index 4539f8596..be35e99ef 100644 --- a/test/libsolidity/ASTJSON/assembly/switch_default_parseOnly.json +++ b/test/libsolidity/ASTJSON/assembly/switch_default_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 6, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/assembly/switch_parseOnly.json b/test/libsolidity/ASTJSON/assembly/switch_parseOnly.json index 54d38b638..4557b9f66 100644 --- a/test/libsolidity/ASTJSON/assembly/switch_parseOnly.json +++ b/test/libsolidity/ASTJSON/assembly/switch_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 6, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/assembly/var_access.json b/test/libsolidity/ASTJSON/assembly/var_access.json index 9cddf4460..0733ccb11 100644 --- a/test/libsolidity/ASTJSON/assembly/var_access.json +++ b/test/libsolidity/ASTJSON/assembly/var_access.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 9, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/assembly/var_access_parseOnly.json b/test/libsolidity/ASTJSON/assembly/var_access_parseOnly.json index 1444a3da1..1816b5391 100644 --- a/test/libsolidity/ASTJSON/assembly/var_access_parseOnly.json +++ b/test/libsolidity/ASTJSON/assembly/var_access_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 9, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/base_constructor_call.json b/test/libsolidity/ASTJSON/base_constructor_call.json index 774981fa9..9e17ccc48 100644 --- a/test/libsolidity/ASTJSON/base_constructor_call.json +++ b/test/libsolidity/ASTJSON/base_constructor_call.json @@ -21,6 +21,7 @@ "canonicalName": "A", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 7, "linearizedBaseContracts": @@ -129,6 +130,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 17, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/base_constructor_call_parseOnly.json b/test/libsolidity/ASTJSON/base_constructor_call_parseOnly.json index 8af0c0b2c..5c0a8694a 100644 --- a/test/libsolidity/ASTJSON/base_constructor_call_parseOnly.json +++ b/test/libsolidity/ASTJSON/base_constructor_call_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 7, "name": "A", "nameLocation": "9:1:1", @@ -98,6 +99,7 @@ ], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 17, "name": "C", "nameLocation": "45:1:1", diff --git a/test/libsolidity/ASTJSON/constructor.json b/test/libsolidity/ASTJSON/constructor.json index 9ac4ac9c8..f4d0aef8f 100644 --- a/test/libsolidity/ASTJSON/constructor.json +++ b/test/libsolidity/ASTJSON/constructor.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 5, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/constructor_parseOnly.json b/test/libsolidity/ASTJSON/constructor_parseOnly.json index 19d647058..b8ac74905 100644 --- a/test/libsolidity/ASTJSON/constructor_parseOnly.json +++ b/test/libsolidity/ASTJSON/constructor_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 5, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/contract_dep_order.json b/test/libsolidity/ASTJSON/contract_dep_order.json index 83865d7d4..8dde14eaa 100644 --- a/test/libsolidity/ASTJSON/contract_dep_order.json +++ b/test/libsolidity/ASTJSON/contract_dep_order.json @@ -33,6 +33,7 @@ "canonicalName": "A", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 1, "linearizedBaseContracts": @@ -72,6 +73,7 @@ "canonicalName": "B", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 4, "linearizedBaseContracts": @@ -112,6 +114,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 7, "linearizedBaseContracts": @@ -153,6 +156,7 @@ "canonicalName": "D", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 10, "linearizedBaseContracts": @@ -195,6 +199,7 @@ "canonicalName": "E", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 13, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/contract_dep_order_parseOnly.json b/test/libsolidity/ASTJSON/contract_dep_order_parseOnly.json index 2c8bdc745..f29fe8180 100644 --- a/test/libsolidity/ASTJSON/contract_dep_order_parseOnly.json +++ b/test/libsolidity/ASTJSON/contract_dep_order_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 1, "name": "A", "nameLocation": "9:1:1", @@ -40,6 +41,7 @@ ], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 4, "name": "B", "nameLocation": "24:1:1", @@ -71,6 +73,7 @@ ], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 7, "name": "C", "nameLocation": "44:1:1", @@ -102,6 +105,7 @@ ], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 10, "name": "D", "nameLocation": "64:1:1", @@ -133,6 +137,7 @@ ], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 13, "name": "E", "nameLocation": "84:1:1", diff --git a/test/libsolidity/ASTJSON/documentation.json b/test/libsolidity/ASTJSON/documentation.json index f31382d3a..8b663f2d8 100644 --- a/test/libsolidity/ASTJSON/documentation.json +++ b/test/libsolidity/ASTJSON/documentation.json @@ -25,6 +25,7 @@ "src": "0:27:1", "text": "This contract is empty" }, + "emittedEvents": [], "fullyImplemented": true, "id": 2, "linearizedBaseContracts": @@ -68,6 +69,7 @@ "src": "0:61:2", "text": "This contract is empty\nand has a line-breaking comment." }, + "emittedEvents": [], "fullyImplemented": true, "id": 5, "linearizedBaseContracts": @@ -104,6 +106,10 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": + [ + 12 + ], "fullyImplemented": true, "id": 23, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/documentation_local_variable.json b/test/libsolidity/ASTJSON/documentation_local_variable.json index 24e38eb1a..b67b089fb 100644 --- a/test/libsolidity/ASTJSON/documentation_local_variable.json +++ b/test/libsolidity/ASTJSON/documentation_local_variable.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 41, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/documentation_local_variable_parseOnly.json b/test/libsolidity/ASTJSON/documentation_local_variable_parseOnly.json index 93fd1c9bd..ce8131a78 100644 --- a/test/libsolidity/ASTJSON/documentation_local_variable_parseOnly.json +++ b/test/libsolidity/ASTJSON/documentation_local_variable_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 41, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/documentation_on_statements.json b/test/libsolidity/ASTJSON/documentation_on_statements.json index bb3ee28d1..c9720e917 100644 --- a/test/libsolidity/ASTJSON/documentation_on_statements.json +++ b/test/libsolidity/ASTJSON/documentation_on_statements.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 27, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/documentation_on_statements_parseOnly.json b/test/libsolidity/ASTJSON/documentation_on_statements_parseOnly.json index bb265a4cc..f85053e69 100644 --- a/test/libsolidity/ASTJSON/documentation_on_statements_parseOnly.json +++ b/test/libsolidity/ASTJSON/documentation_on_statements_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 27, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/documentation_parseOnly.json b/test/libsolidity/ASTJSON/documentation_parseOnly.json index b3cda7e19..1586aaaec 100644 --- a/test/libsolidity/ASTJSON/documentation_parseOnly.json +++ b/test/libsolidity/ASTJSON/documentation_parseOnly.json @@ -17,6 +17,7 @@ "src": "0:27:1", "text": "This contract is empty" }, + "emittedEvents": [], "id": 2, "name": "C", "nameLocation": "37:1:1", @@ -46,6 +47,7 @@ "src": "0:61:2", "text": "This contract is empty\nand has a line-breaking comment." }, + "emittedEvents": [], "id": 5, "name": "C", "nameLocation": "71:1:2", @@ -68,6 +70,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 23, "name": "C", "nameLocation": "9:1:3", diff --git a/test/libsolidity/ASTJSON/documentation_triple.json b/test/libsolidity/ASTJSON/documentation_triple.json index 9124e68b1..0fc0bf125 100644 --- a/test/libsolidity/ASTJSON/documentation_triple.json +++ b/test/libsolidity/ASTJSON/documentation_triple.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 28, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/documentation_triple_parseOnly.json b/test/libsolidity/ASTJSON/documentation_triple_parseOnly.json index bd6612acc..5ef459d8c 100644 --- a/test/libsolidity/ASTJSON/documentation_triple_parseOnly.json +++ b/test/libsolidity/ASTJSON/documentation_triple_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 28, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/enum_value.json b/test/libsolidity/ASTJSON/enum_value.json index 2cca00902..1ab7ecd2b 100644 --- a/test/libsolidity/ASTJSON/enum_value.json +++ b/test/libsolidity/ASTJSON/enum_value.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 4, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/enum_value_parseOnly.json b/test/libsolidity/ASTJSON/enum_value_parseOnly.json index 93b3cffcd..af389bd06 100644 --- a/test/libsolidity/ASTJSON/enum_value_parseOnly.json +++ b/test/libsolidity/ASTJSON/enum_value_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 4, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/event_aggregated_contract.json b/test/libsolidity/ASTJSON/event_aggregated_contract.json new file mode 100644 index 000000000..3a36d418c --- /dev/null +++ b/test/libsolidity/ASTJSON/event_aggregated_contract.json @@ -0,0 +1,398 @@ +{ + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 10 + ], + "D": + [ + 30 + ] + }, + "id": 31, + "nodeType": "SourceUnit", + "nodes": + [ + { + "abstract": false, + "baseContracts": [], + "canonicalName": "C", + "contractDependencies": [], + "contractKind": "contract", + "emittedEvents": + [ + 2 + ], + "fullyImplemented": true, + "id": 10, + "linearizedBaseContracts": + [ + 10 + ], + "name": "C", + "nameLocation": "9:1:1", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "anonymous": false, + "eventSelector": "ffae15ba29768297c9b951e2e14bc33dc84599d1572acc234266fc70392babc8", + "id": 2, + "name": "e", + "nameLocation": "23:1:1", + "nodeType": "EventDefinition", + "parameters": + { + "id": 1, + "nodeType": "ParameterList", + "parameters": [], + "src": "24:2:1" + }, + "src": "17:10:1" + }, + { + "body": + { + "id": 8, + "nodeType": "Block", + "src": "52:25:1", + "statements": + [ + { + "eventCall": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "id": 5, + "name": "e", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2, + "src": "67:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_event_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 6, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "67:3:1", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 7, + "nodeType": "EmitStatement", + "src": "62:8:1" + } + ] + }, + "functionSelector": "26121ff0", + "id": 9, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "f", + "nameLocation": "41:1:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 3, + "nodeType": "ParameterList", + "parameters": [], + "src": "42:2:1" + }, + "returnParameters": + { + "id": 4, + "nodeType": "ParameterList", + "parameters": [], + "src": "52:0:1" + }, + "scope": 10, + "src": "32:45:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + } + ], + "scope": 31, + "src": "0:79:1", + "usedErrors": [] + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "D", + "contractDependencies": + [ + 10 + ], + "contractKind": "contract", + "emittedEvents": [], + "fullyImplemented": true, + "id": 30, + "linearizedBaseContracts": + [ + 30 + ], + "name": "D", + "nameLocation": "89:1:1", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "constant": false, + "id": 13, + "mutability": "mutable", + "name": "c", + "nameLocation": "99:1:1", + "nodeType": "VariableDeclaration", + "scope": 30, + "src": "97:3:1", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_contract$_C_$10", + "typeString": "contract C" + }, + "typeName": + { + "id": 12, + "nodeType": "UserDefinedTypeName", + "pathNode": + { + "id": 11, + "name": "C", + "nameLocations": + [ + "97:1:1" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 10, + "src": "97:1:1" + }, + "referencedDeclaration": 10, + "src": "97:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_contract$_C_$10", + "typeString": "contract C" + } + }, + "visibility": "internal" + }, + { + "body": + { + "id": 28, + "nodeType": "Block", + "src": "120:43:1", + "statements": + [ + { + "expression": + { + "id": 21, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": + { + "id": 16, + "name": "c", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13, + "src": "130:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_contract$_C_$10", + "typeString": "contract C" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "id": 19, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "134:5:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_creation_nonpayable$__$returns$_t_contract$_C_$10_$", + "typeString": "function () returns (contract C)" + }, + "typeName": + { + "id": 18, + "nodeType": "UserDefinedTypeName", + "pathNode": + { + "id": 17, + "name": "C", + "nameLocations": + [ + "138:1:1" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 10, + "src": "138:1:1" + }, + "referencedDeclaration": 10, + "src": "138:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_contract$_C_$10", + "typeString": "contract C" + } + } + }, + "id": 20, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "134:7:1", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_contract$_C_$10", + "typeString": "contract C" + } + }, + "src": "130:11:1", + "typeDescriptions": + { + "typeIdentifier": "t_contract$_C_$10", + "typeString": "contract C" + } + }, + "id": 22, + "nodeType": "ExpressionStatement", + "src": "130:11:1" + }, + { + "expression": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "expression": + { + "id": 23, + "name": "c", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13, + "src": "151:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_contract$_C_$10", + "typeString": "contract C" + } + }, + "id": 25, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "153:1:1", + "memberName": "f", + "nodeType": "MemberAccess", + "referencedDeclaration": 9, + "src": "151:3:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_external_nonpayable$__$returns$__$", + "typeString": "function () external" + } + }, + "id": 26, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "151:5:1", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 27, + "nodeType": "ExpressionStatement", + "src": "151:5:1" + } + ] + }, + "id": 29, + "implemented": true, + "kind": "constructor", + "modifiers": [], + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 14, + "nodeType": "ParameterList", + "parameters": [], + "src": "117:2:1" + }, + "returnParameters": + { + "id": 15, + "nodeType": "ParameterList", + "parameters": [], + "src": "120:0:1" + }, + "scope": 30, + "src": "106:57:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + } + ], + "scope": 31, + "src": "80:85:1", + "usedErrors": [] + } + ], + "src": "0:166:1" +} diff --git a/test/libsolidity/ASTJSON/event_aggregated_contract.sol b/test/libsolidity/ASTJSON/event_aggregated_contract.sol new file mode 100644 index 000000000..b8fe2b276 --- /dev/null +++ b/test/libsolidity/ASTJSON/event_aggregated_contract.sol @@ -0,0 +1,15 @@ +contract C { + event e(); + function f() public { + emit e(); + } +} +contract D { + C c; + constructor() { + c = new C(); + c.f(); + } +} + +// ---- diff --git a/test/libsolidity/ASTJSON/event_definition.json b/test/libsolidity/ASTJSON/event_definition.json index 0bb614c22..629067f35 100644 --- a/test/libsolidity/ASTJSON/event_definition.json +++ b/test/libsolidity/ASTJSON/event_definition.json @@ -17,6 +17,10 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": + [ + 2 + ], "fullyImplemented": true, "id": 3, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/event_definition_parseOnly.json b/test/libsolidity/ASTJSON/event_definition_parseOnly.json index ee5773a3b..446ef890a 100644 --- a/test/libsolidity/ASTJSON/event_definition_parseOnly.json +++ b/test/libsolidity/ASTJSON/event_definition_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 3, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/event_inheritance.json b/test/libsolidity/ASTJSON/event_inheritance.json new file mode 100644 index 000000000..cf23bce16 --- /dev/null +++ b/test/libsolidity/ASTJSON/event_inheritance.json @@ -0,0 +1,194 @@ +{ + "absolutePath": "a", + "exportedSymbols": + { + "B": + [ + 3 + ], + "C": + [ + 8 + ], + "D": + [ + 13 + ] + }, + "id": 14, + "nodeType": "SourceUnit", + "nodes": + [ + { + "abstract": false, + "baseContracts": [], + "canonicalName": "B", + "contractDependencies": [], + "contractKind": "interface", + "emittedEvents": + [ + 2 + ], + "fullyImplemented": true, + "id": 3, + "linearizedBaseContracts": + [ + 3 + ], + "name": "B", + "nameLocation": "10:1:1", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "anonymous": false, + "eventSelector": "dbec0351ad6bb0c1f07ea56e236e3e692fde2259f0165fd422f241da339b7e4f", + "id": 2, + "name": "EB", + "nameLocation": "24:2:1", + "nodeType": "EventDefinition", + "parameters": + { + "id": 1, + "nodeType": "ParameterList", + "parameters": [], + "src": "26:2:1" + }, + "src": "18:11:1" + } + ], + "scope": 14, + "src": "0:31:1", + "usedErrors": [] + }, + { + "abstract": false, + "baseContracts": + [ + { + "baseName": + { + "id": 4, + "name": "B", + "nameLocations": + [ + "46:1:1" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 3, + "src": "46:1:1" + }, + "id": 5, + "nodeType": "InheritanceSpecifier", + "src": "46:1:1" + } + ], + "canonicalName": "C", + "contractDependencies": [], + "contractKind": "contract", + "emittedEvents": + [ + 2, + 7 + ], + "fullyImplemented": true, + "id": 8, + "linearizedBaseContracts": + [ + 8, + 3 + ], + "name": "C", + "nameLocation": "41:1:1", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "anonymous": false, + "eventSelector": "a08b3367d3fa83ea27f8951ffb5d9d160cbfadbd80816b47f677e7699d76f5a0", + "id": 7, + "name": "EC", + "nameLocation": "60:2:1", + "nodeType": "EventDefinition", + "parameters": + { + "id": 6, + "nodeType": "ParameterList", + "parameters": [], + "src": "62:2:1" + }, + "src": "54:11:1" + } + ], + "scope": 14, + "src": "32:35:1", + "usedErrors": [] + }, + { + "abstract": false, + "baseContracts": + [ + { + "baseName": + { + "id": 9, + "name": "C", + "nameLocations": + [ + "82:1:1" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 8, + "src": "82:1:1" + }, + "id": 10, + "nodeType": "InheritanceSpecifier", + "src": "82:1:1" + } + ], + "canonicalName": "D", + "contractDependencies": [], + "contractKind": "contract", + "emittedEvents": + [ + 2, + 7, + 12 + ], + "fullyImplemented": true, + "id": 13, + "linearizedBaseContracts": + [ + 13, + 8, + 3 + ], + "name": "D", + "nameLocation": "77:1:1", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "anonymous": false, + "eventSelector": "caa54b91a2314ab89b39714b1cd283762e53a2f59cfb997d6770e2824c39db0d", + "id": 12, + "name": "ED", + "nameLocation": "96:2:1", + "nodeType": "EventDefinition", + "parameters": + { + "id": 11, + "nodeType": "ParameterList", + "parameters": [], + "src": "98:2:1" + }, + "src": "90:11:1" + } + ], + "scope": 14, + "src": "68:35:1", + "usedErrors": [] + } + ], + "src": "0:104:1" +} diff --git a/test/libsolidity/ASTJSON/event_inheritance.sol b/test/libsolidity/ASTJSON/event_inheritance.sol new file mode 100644 index 000000000..33144b313 --- /dev/null +++ b/test/libsolidity/ASTJSON/event_inheritance.sol @@ -0,0 +1,9 @@ +interface B { + event EB(); +} +contract C is B { + event EC(); +} +contract D is C { + event ED(); +} diff --git a/test/libsolidity/ASTJSON/event_with_variables_of_internal_types_parseOnly.json b/test/libsolidity/ASTJSON/event_with_variables_of_internal_types_parseOnly.json index 0c90ee840..d16f5acee 100644 --- a/test/libsolidity/ASTJSON/event_with_variables_of_internal_types_parseOnly.json +++ b/test/libsolidity/ASTJSON/event_with_variables_of_internal_types_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 7, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/fail_after_parsing_parseOnly.json b/test/libsolidity/ASTJSON/fail_after_parsing_parseOnly.json index 5368d5862..c639fe512 100644 --- a/test/libsolidity/ASTJSON/fail_after_parsing_parseOnly.json +++ b/test/libsolidity/ASTJSON/fail_after_parsing_parseOnly.json @@ -36,6 +36,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "interface", + "emittedEvents": [], "id": 29, "name": "I", "nameLocation": "31:1:1", diff --git a/test/libsolidity/ASTJSON/fallback.json b/test/libsolidity/ASTJSON/fallback.json index 25a9b8588..475665f88 100644 --- a/test/libsolidity/ASTJSON/fallback.json +++ b/test/libsolidity/ASTJSON/fallback.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 5, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/fallback_and_reveice_ether.json b/test/libsolidity/ASTJSON/fallback_and_reveice_ether.json index 26b4ada77..270abbe59 100644 --- a/test/libsolidity/ASTJSON/fallback_and_reveice_ether.json +++ b/test/libsolidity/ASTJSON/fallback_and_reveice_ether.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 9, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/fallback_and_reveice_ether_parseOnly.json b/test/libsolidity/ASTJSON/fallback_and_reveice_ether_parseOnly.json index 55804a9f5..2febe1e08 100644 --- a/test/libsolidity/ASTJSON/fallback_and_reveice_ether_parseOnly.json +++ b/test/libsolidity/ASTJSON/fallback_and_reveice_ether_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 9, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/fallback_parseOnly.json b/test/libsolidity/ASTJSON/fallback_parseOnly.json index 4d626dcba..92ce02d1d 100644 --- a/test/libsolidity/ASTJSON/fallback_parseOnly.json +++ b/test/libsolidity/ASTJSON/fallback_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 5, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/fallback_payable.json b/test/libsolidity/ASTJSON/fallback_payable.json index 4331b5edf..3406ebb2e 100644 --- a/test/libsolidity/ASTJSON/fallback_payable.json +++ b/test/libsolidity/ASTJSON/fallback_payable.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 5, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/fallback_payable_parseOnly.json b/test/libsolidity/ASTJSON/fallback_payable_parseOnly.json index 2d029e56a..257d3412e 100644 --- a/test/libsolidity/ASTJSON/fallback_payable_parseOnly.json +++ b/test/libsolidity/ASTJSON/fallback_payable_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 5, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/function_type.json b/test/libsolidity/ASTJSON/function_type.json index 924f9cdb9..2525b4d5a 100644 --- a/test/libsolidity/ASTJSON/function_type.json +++ b/test/libsolidity/ASTJSON/function_type.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 17, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/function_type_parseOnly.json b/test/libsolidity/ASTJSON/function_type_parseOnly.json index fd1d7637b..74452738a 100644 --- a/test/libsolidity/ASTJSON/function_type_parseOnly.json +++ b/test/libsolidity/ASTJSON/function_type_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 17, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/indirect_event.json b/test/libsolidity/ASTJSON/indirect_event.json new file mode 100644 index 000000000..fe4190b08 --- /dev/null +++ b/test/libsolidity/ASTJSON/indirect_event.json @@ -0,0 +1,319 @@ +{ + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 25 + ], + "L": + [ + 10 + ] + }, + "id": 26, + "license": "GPL-3.0", + "nodeType": "SourceUnit", + "nodes": + [ + { + "abstract": false, + "baseContracts": [], + "canonicalName": "L", + "contractDependencies": [], + "contractKind": "library", + "emittedEvents": + [ + 2 + ], + "fullyImplemented": true, + "id": 10, + "linearizedBaseContracts": + [ + 10 + ], + "name": "L", + "nameLocation": "44:1:1", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "anonymous": false, + "eventSelector": "92bbf6e823a631f3c8e09b1c8df90f378fb56f7fbc9701827e1ff8aad7f6a028", + "id": 2, + "name": "E", + "nameLocation": "58:1:1", + "nodeType": "EventDefinition", + "parameters": + { + "id": 1, + "nodeType": "ParameterList", + "parameters": [], + "src": "59:2:1" + }, + "src": "52:10:1" + }, + { + "body": + { + "id": 8, + "nodeType": "Block", + "src": "89:13:1", + "statements": + [ + { + "eventCall": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "id": 5, + "name": "E", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2, + "src": "96:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_event_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 6, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "96:3:1", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 7, + "nodeType": "EmitStatement", + "src": "91:8:1" + } + ] + }, + "id": 9, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "f", + "nameLocation": "76:1:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 3, + "nodeType": "ParameterList", + "parameters": [], + "src": "77:2:1" + }, + "returnParameters": + { + "id": 4, + "nodeType": "ParameterList", + "parameters": [], + "src": "89:0:1" + }, + "scope": 10, + "src": "67:35:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + } + ], + "scope": 26, + "src": "36:68:1", + "usedErrors": [] + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "C", + "contractDependencies": [], + "contractKind": "contract", + "emittedEvents": + [ + 2, + 12 + ], + "fullyImplemented": true, + "id": 25, + "linearizedBaseContracts": + [ + 25 + ], + "name": "C", + "nameLocation": "114:1:1", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "anonymous": false, + "eventSelector": "70a5d861ef9816388422765f41d618eb3abdf490acb37354b539729e37b09f0e", + "id": 12, + "name": "H", + "nameLocation": "128:1:1", + "nodeType": "EventDefinition", + "parameters": + { + "id": 11, + "nodeType": "ParameterList", + "parameters": [], + "src": "129:2:1" + }, + "src": "122:10:1" + }, + { + "body": + { + "id": 23, + "nodeType": "Block", + "src": "157:20:1", + "statements": + [ + { + "expression": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "expression": + { + "id": 15, + "name": "L", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10, + "src": "159:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_type$_t_contract$_L_$10_$", + "typeString": "type(library L)" + } + }, + "id": 17, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "161:1:1", + "memberName": "f", + "nodeType": "MemberAccess", + "referencedDeclaration": 9, + "src": "159:3:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 18, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "159:5:1", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 19, + "nodeType": "ExpressionStatement", + "src": "159:5:1" + }, + { + "eventCall": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "id": 20, + "name": "H", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12, + "src": "171:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_event_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 21, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "171:3:1", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 22, + "nodeType": "EmitStatement", + "src": "166:8:1" + } + ] + }, + "functionSelector": "e2179b8e", + "id": 24, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "g", + "nameLocation": "146:1:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 13, + "nodeType": "ParameterList", + "parameters": [], + "src": "147:2:1" + }, + "returnParameters": + { + "id": 14, + "nodeType": "ParameterList", + "parameters": [], + "src": "157:0:1" + }, + "scope": 25, + "src": "137:40:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + } + ], + "scope": 26, + "src": "105:74:1", + "usedErrors": [] + } + ], + "src": "36:144:1" +} diff --git a/test/libsolidity/ASTJSON/indirect_event.sol b/test/libsolidity/ASTJSON/indirect_event.sol new file mode 100644 index 000000000..c4bba01c2 --- /dev/null +++ b/test/libsolidity/ASTJSON/indirect_event.sol @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-3.0 +library L { + event E(); + function f() internal { emit E(); } +} +contract C { + event H(); + function g() public { L.f(); emit H(); } +} + +// ---- diff --git a/test/libsolidity/ASTJSON/indirect_event_parseOnly.json b/test/libsolidity/ASTJSON/indirect_event_parseOnly.json new file mode 100644 index 000000000..757e76f08 --- /dev/null +++ b/test/libsolidity/ASTJSON/indirect_event_parseOnly.json @@ -0,0 +1,228 @@ +{ + "absolutePath": "a", + "id": 26, + "license": "GPL-3.0", + "nodeType": "SourceUnit", + "nodes": + [ + { + "abstract": false, + "baseContracts": [], + "contractDependencies": [], + "contractKind": "library", + "emittedEvents": [], + "id": 10, + "name": "L", + "nameLocation": "44:1:1", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "anonymous": false, + "id": 2, + "name": "E", + "nameLocation": "58:1:1", + "nodeType": "EventDefinition", + "parameters": + { + "id": 1, + "nodeType": "ParameterList", + "parameters": [], + "src": "59:2:1" + }, + "src": "52:10:1" + }, + { + "body": + { + "id": 8, + "nodeType": "Block", + "src": "89:13:1", + "statements": + [ + { + "eventCall": + { + "arguments": [], + "expression": + { + "id": 5, + "name": "E", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "src": "96:1:1", + "typeDescriptions": {} + }, + "id": 6, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "96:3:1", + "tryCall": false, + "typeDescriptions": {} + }, + "id": 7, + "nodeType": "EmitStatement", + "src": "91:8:1" + } + ] + }, + "id": 9, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "f", + "nameLocation": "76:1:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 3, + "nodeType": "ParameterList", + "parameters": [], + "src": "77:2:1" + }, + "returnParameters": + { + "id": 4, + "nodeType": "ParameterList", + "parameters": [], + "src": "89:0:1" + }, + "src": "67:35:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + } + ], + "src": "36:68:1", + "usedErrors": [] + }, + { + "abstract": false, + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "emittedEvents": [], + "id": 25, + "name": "C", + "nameLocation": "114:1:1", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "anonymous": false, + "id": 12, + "name": "H", + "nameLocation": "128:1:1", + "nodeType": "EventDefinition", + "parameters": + { + "id": 11, + "nodeType": "ParameterList", + "parameters": [], + "src": "129:2:1" + }, + "src": "122:10:1" + }, + { + "body": + { + "id": 23, + "nodeType": "Block", + "src": "157:20:1", + "statements": + [ + { + "expression": + { + "arguments": [], + "expression": + { + "expression": + { + "id": 15, + "name": "L", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "src": "159:1:1", + "typeDescriptions": {} + }, + "id": 17, + "memberLocation": "161:1:1", + "memberName": "f", + "nodeType": "MemberAccess", + "src": "159:3:1", + "typeDescriptions": {} + }, + "id": 18, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "159:5:1", + "tryCall": false, + "typeDescriptions": {} + }, + "id": 19, + "nodeType": "ExpressionStatement", + "src": "159:5:1" + }, + { + "eventCall": + { + "arguments": [], + "expression": + { + "id": 20, + "name": "H", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "src": "171:1:1", + "typeDescriptions": {} + }, + "id": 21, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "171:3:1", + "tryCall": false, + "typeDescriptions": {} + }, + "id": 22, + "nodeType": "EmitStatement", + "src": "166:8:1" + } + ] + }, + "id": 24, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "g", + "nameLocation": "146:1:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 13, + "nodeType": "ParameterList", + "parameters": [], + "src": "147:2:1" + }, + "returnParameters": + { + "id": 14, + "nodeType": "ParameterList", + "parameters": [], + "src": "157:0:1" + }, + "src": "137:40:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + } + ], + "src": "105:74:1", + "usedErrors": [] + } + ], + "src": "36:144:1" +} diff --git a/test/libsolidity/ASTJSON/inheritance_specifier.json b/test/libsolidity/ASTJSON/inheritance_specifier.json index 8959d5b5d..51d8335e6 100644 --- a/test/libsolidity/ASTJSON/inheritance_specifier.json +++ b/test/libsolidity/ASTJSON/inheritance_specifier.json @@ -21,6 +21,7 @@ "canonicalName": "C1", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 1, "linearizedBaseContracts": @@ -60,6 +61,7 @@ "canonicalName": "C2", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 4, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/inheritance_specifier_parseOnly.json b/test/libsolidity/ASTJSON/inheritance_specifier_parseOnly.json index 72da9ad2c..906361951 100644 --- a/test/libsolidity/ASTJSON/inheritance_specifier_parseOnly.json +++ b/test/libsolidity/ASTJSON/inheritance_specifier_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 1, "name": "C1", "nameLocation": "9:2:1", @@ -40,6 +41,7 @@ ], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 4, "name": "C2", "nameLocation": "24:2:1", diff --git a/test/libsolidity/ASTJSON/license.json b/test/libsolidity/ASTJSON/license.json index 9f996e051..ad8dd66b2 100644 --- a/test/libsolidity/ASTJSON/license.json +++ b/test/libsolidity/ASTJSON/license.json @@ -18,6 +18,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 1, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/license_parseOnly.json b/test/libsolidity/ASTJSON/license_parseOnly.json index 748b2548a..f524d8b3b 100644 --- a/test/libsolidity/ASTJSON/license_parseOnly.json +++ b/test/libsolidity/ASTJSON/license_parseOnly.json @@ -10,6 +10,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 1, "name": "C", "nameLocation": "45:1:1", diff --git a/test/libsolidity/ASTJSON/long_type_name_binary_operation.json b/test/libsolidity/ASTJSON/long_type_name_binary_operation.json index 8340eaf40..e1964c12f 100644 --- a/test/libsolidity/ASTJSON/long_type_name_binary_operation.json +++ b/test/libsolidity/ASTJSON/long_type_name_binary_operation.json @@ -17,6 +17,7 @@ "canonicalName": "c", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 11, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/long_type_name_binary_operation_parseOnly.json b/test/libsolidity/ASTJSON/long_type_name_binary_operation_parseOnly.json index df2db3926..266e1c1e1 100644 --- a/test/libsolidity/ASTJSON/long_type_name_binary_operation_parseOnly.json +++ b/test/libsolidity/ASTJSON/long_type_name_binary_operation_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 11, "name": "c", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/long_type_name_identifier.json b/test/libsolidity/ASTJSON/long_type_name_identifier.json index c810283d2..0c7b85f5d 100644 --- a/test/libsolidity/ASTJSON/long_type_name_identifier.json +++ b/test/libsolidity/ASTJSON/long_type_name_identifier.json @@ -17,6 +17,7 @@ "canonicalName": "c", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 15, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/long_type_name_identifier_parseOnly.json b/test/libsolidity/ASTJSON/long_type_name_identifier_parseOnly.json index ef76f30aa..e0b7f73d1 100644 --- a/test/libsolidity/ASTJSON/long_type_name_identifier_parseOnly.json +++ b/test/libsolidity/ASTJSON/long_type_name_identifier_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 15, "name": "c", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/mappings.json b/test/libsolidity/ASTJSON/mappings.json index 0bf816eb4..3486340c2 100644 --- a/test/libsolidity/ASTJSON/mappings.json +++ b/test/libsolidity/ASTJSON/mappings.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 23, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/modifier_definition.json b/test/libsolidity/ASTJSON/modifier_definition.json index aa448568c..207863e85 100644 --- a/test/libsolidity/ASTJSON/modifier_definition.json +++ b/test/libsolidity/ASTJSON/modifier_definition.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 14, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/modifier_definition_parseOnly.json b/test/libsolidity/ASTJSON/modifier_definition_parseOnly.json index 9344e419a..802d0c08f 100644 --- a/test/libsolidity/ASTJSON/modifier_definition_parseOnly.json +++ b/test/libsolidity/ASTJSON/modifier_definition_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 14, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/modifier_invocation.json b/test/libsolidity/ASTJSON/modifier_invocation.json index aa448568c..207863e85 100644 --- a/test/libsolidity/ASTJSON/modifier_invocation.json +++ b/test/libsolidity/ASTJSON/modifier_invocation.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 14, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/modifier_invocation_parseOnly.json b/test/libsolidity/ASTJSON/modifier_invocation_parseOnly.json index 9344e419a..802d0c08f 100644 --- a/test/libsolidity/ASTJSON/modifier_invocation_parseOnly.json +++ b/test/libsolidity/ASTJSON/modifier_invocation_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 14, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/mutability.json b/test/libsolidity/ASTJSON/mutability.json index 90bbf05d5..c04d47def 100644 --- a/test/libsolidity/ASTJSON/mutability.json +++ b/test/libsolidity/ASTJSON/mutability.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 10, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/mutability_parseOnly.json b/test/libsolidity/ASTJSON/mutability_parseOnly.json index 88d3968f2..8c1bc581c 100644 --- a/test/libsolidity/ASTJSON/mutability_parseOnly.json +++ b/test/libsolidity/ASTJSON/mutability_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 10, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/non_utf8.json b/test/libsolidity/ASTJSON/non_utf8.json index 926f858b5..055e894b0 100644 --- a/test/libsolidity/ASTJSON/non_utf8.json +++ b/test/libsolidity/ASTJSON/non_utf8.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 15, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/non_utf8_parseOnly.json b/test/libsolidity/ASTJSON/non_utf8_parseOnly.json index ef265cbe4..00d6f1bc8 100644 --- a/test/libsolidity/ASTJSON/non_utf8_parseOnly.json +++ b/test/libsolidity/ASTJSON/non_utf8_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 15, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/not_existing_import_parseOnly.json b/test/libsolidity/ASTJSON/not_existing_import_parseOnly.json index de14043f3..23b6d58a6 100644 --- a/test/libsolidity/ASTJSON/not_existing_import_parseOnly.json +++ b/test/libsolidity/ASTJSON/not_existing_import_parseOnly.json @@ -38,6 +38,7 @@ ], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 11, "name": "C", "nameLocation": "50:1:1", diff --git a/test/libsolidity/ASTJSON/override.json b/test/libsolidity/ASTJSON/override.json index a7c43767f..e7f64a95d 100644 --- a/test/libsolidity/ASTJSON/override.json +++ b/test/libsolidity/ASTJSON/override.json @@ -25,6 +25,7 @@ "canonicalName": "A", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 5, "linearizedBaseContracts": @@ -102,6 +103,7 @@ "canonicalName": "B", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": false, "id": 16, "linearizedBaseContracts": @@ -220,6 +222,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 29, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/override_parseOnly.json b/test/libsolidity/ASTJSON/override_parseOnly.json index fe9d8a7c6..8182b68a0 100644 --- a/test/libsolidity/ASTJSON/override_parseOnly.json +++ b/test/libsolidity/ASTJSON/override_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 5, "name": "A", "nameLocation": "9:1:1", @@ -76,6 +77,7 @@ ], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 16, "name": "B", "nameLocation": "67:1:1", @@ -177,6 +179,7 @@ ], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 29, "name": "C", "nameLocation": "162:1:1", diff --git a/test/libsolidity/ASTJSON/placeholder_statement.json b/test/libsolidity/ASTJSON/placeholder_statement.json index 5a6d51b21..4e27cc2a2 100644 --- a/test/libsolidity/ASTJSON/placeholder_statement.json +++ b/test/libsolidity/ASTJSON/placeholder_statement.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 5, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/placeholder_statement_parseOnly.json b/test/libsolidity/ASTJSON/placeholder_statement_parseOnly.json index 8f73cde60..982965ea4 100644 --- a/test/libsolidity/ASTJSON/placeholder_statement_parseOnly.json +++ b/test/libsolidity/ASTJSON/placeholder_statement_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 5, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/receive_ether.json b/test/libsolidity/ASTJSON/receive_ether.json index bfcb33f6c..4a00e3b71 100644 --- a/test/libsolidity/ASTJSON/receive_ether.json +++ b/test/libsolidity/ASTJSON/receive_ether.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 5, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/receive_ether_parseOnly.json b/test/libsolidity/ASTJSON/receive_ether_parseOnly.json index 413c10564..7b3309048 100644 --- a/test/libsolidity/ASTJSON/receive_ether_parseOnly.json +++ b/test/libsolidity/ASTJSON/receive_ether_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 5, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/short_type_name.json b/test/libsolidity/ASTJSON/short_type_name.json index b7409fbbc..087976e99 100644 --- a/test/libsolidity/ASTJSON/short_type_name.json +++ b/test/libsolidity/ASTJSON/short_type_name.json @@ -17,6 +17,7 @@ "canonicalName": "c", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 11, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/short_type_name_parseOnly.json b/test/libsolidity/ASTJSON/short_type_name_parseOnly.json index 02590363a..0681f5822 100644 --- a/test/libsolidity/ASTJSON/short_type_name_parseOnly.json +++ b/test/libsolidity/ASTJSON/short_type_name_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 11, "name": "c", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/short_type_name_ref.json b/test/libsolidity/ASTJSON/short_type_name_ref.json index 6a0f249f8..9d474fd73 100644 --- a/test/libsolidity/ASTJSON/short_type_name_ref.json +++ b/test/libsolidity/ASTJSON/short_type_name_ref.json @@ -17,6 +17,7 @@ "canonicalName": "c", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 12, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/short_type_name_ref_parseOnly.json b/test/libsolidity/ASTJSON/short_type_name_ref_parseOnly.json index 00799a212..3fc088afc 100644 --- a/test/libsolidity/ASTJSON/short_type_name_ref_parseOnly.json +++ b/test/libsolidity/ASTJSON/short_type_name_ref_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 12, "name": "c", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/smoke.json b/test/libsolidity/ASTJSON/smoke.json index 4d4a02e24..b18d97fb4 100644 --- a/test/libsolidity/ASTJSON/smoke.json +++ b/test/libsolidity/ASTJSON/smoke.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 1, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/smoke_parseOnly.json b/test/libsolidity/ASTJSON/smoke_parseOnly.json index d03e98654..0b9ddb7f7 100644 --- a/test/libsolidity/ASTJSON/smoke_parseOnly.json +++ b/test/libsolidity/ASTJSON/smoke_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 1, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/source_location.json b/test/libsolidity/ASTJSON/source_location.json index df51e49c6..7df135fbd 100644 --- a/test/libsolidity/ASTJSON/source_location.json +++ b/test/libsolidity/ASTJSON/source_location.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 12, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/source_location_parseOnly.json b/test/libsolidity/ASTJSON/source_location_parseOnly.json index 88835788b..29e67e1a5 100644 --- a/test/libsolidity/ASTJSON/source_location_parseOnly.json +++ b/test/libsolidity/ASTJSON/source_location_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 12, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/string.json b/test/libsolidity/ASTJSON/string.json index 438f760c4..df0228e01 100644 --- a/test/libsolidity/ASTJSON/string.json +++ b/test/libsolidity/ASTJSON/string.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 9, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/string_parseOnly.json b/test/libsolidity/ASTJSON/string_parseOnly.json index 444a1f7b2..cb9799f6b 100644 --- a/test/libsolidity/ASTJSON/string_parseOnly.json +++ b/test/libsolidity/ASTJSON/string_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 9, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/two_base_functions.json b/test/libsolidity/ASTJSON/two_base_functions.json index 23bdf6efe..a12704653 100644 --- a/test/libsolidity/ASTJSON/two_base_functions.json +++ b/test/libsolidity/ASTJSON/two_base_functions.json @@ -25,6 +25,7 @@ "canonicalName": "A", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 5, "linearizedBaseContracts": @@ -83,6 +84,7 @@ "canonicalName": "B", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 10, "linearizedBaseContracts": @@ -177,6 +179,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 22, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/two_base_functions_parseOnly.json b/test/libsolidity/ASTJSON/two_base_functions_parseOnly.json index 078dc5daa..d4ca0d3da 100644 --- a/test/libsolidity/ASTJSON/two_base_functions_parseOnly.json +++ b/test/libsolidity/ASTJSON/two_base_functions_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 5, "name": "A", "nameLocation": "9:1:1", @@ -58,6 +59,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 10, "name": "B", "nameLocation": "59:1:1", @@ -141,6 +143,7 @@ ], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 22, "name": "C", "nameLocation": "109:1:1", diff --git a/test/libsolidity/ASTJSON/unicode.json b/test/libsolidity/ASTJSON/unicode.json index dcb267b3f..68bc1a109 100644 --- a/test/libsolidity/ASTJSON/unicode.json +++ b/test/libsolidity/ASTJSON/unicode.json @@ -17,6 +17,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 9, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/unicode_parseOnly.json b/test/libsolidity/ASTJSON/unicode_parseOnly.json index a6f52aa4a..c787d3c06 100644 --- a/test/libsolidity/ASTJSON/unicode_parseOnly.json +++ b/test/libsolidity/ASTJSON/unicode_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 9, "name": "C", "nameLocation": "9:1:1", diff --git a/test/libsolidity/ASTJSON/used_errors.json b/test/libsolidity/ASTJSON/used_errors.json index c59b4f530..70e72a3fe 100644 --- a/test/libsolidity/ASTJSON/used_errors.json +++ b/test/libsolidity/ASTJSON/used_errors.json @@ -117,6 +117,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 19, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/used_errors_parseOnly.json b/test/libsolidity/ASTJSON/used_errors_parseOnly.json index 7a4b24b3c..30e732125 100644 --- a/test/libsolidity/ASTJSON/used_errors_parseOnly.json +++ b/test/libsolidity/ASTJSON/used_errors_parseOnly.json @@ -84,6 +84,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 19, "name": "C", "nameLocation": "54:1:1", diff --git a/test/libsolidity/ASTJSON/userDefinedValueType.json b/test/libsolidity/ASTJSON/userDefinedValueType.json index eb4450946..c6362b86a 100644 --- a/test/libsolidity/ASTJSON/userDefinedValueType.json +++ b/test/libsolidity/ASTJSON/userDefinedValueType.json @@ -215,6 +215,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 27, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/userDefinedValueType_parseOnly.json b/test/libsolidity/ASTJSON/userDefinedValueType_parseOnly.json index 0dc95e13f..7bdc076ed 100644 --- a/test/libsolidity/ASTJSON/userDefinedValueType_parseOnly.json +++ b/test/libsolidity/ASTJSON/userDefinedValueType_parseOnly.json @@ -162,6 +162,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 27, "name": "C", "nameLocation": "105:1:1", diff --git a/test/libsolidity/ASTJSON/using_for_directive.json b/test/libsolidity/ASTJSON/using_for_directive.json index 57658134d..fd7a7884a 100644 --- a/test/libsolidity/ASTJSON/using_for_directive.json +++ b/test/libsolidity/ASTJSON/using_for_directive.json @@ -60,6 +60,7 @@ "canonicalName": "L", "contractDependencies": [], "contractKind": "library", + "emittedEvents": [], "fullyImplemented": true, "id": 4, "linearizedBaseContracts": @@ -147,6 +148,7 @@ "canonicalName": "C", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 13, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/using_for_directive_parseOnly.json b/test/libsolidity/ASTJSON/using_for_directive_parseOnly.json index 84de310c0..3b9e26b37 100644 --- a/test/libsolidity/ASTJSON/using_for_directive_parseOnly.json +++ b/test/libsolidity/ASTJSON/using_for_directive_parseOnly.json @@ -39,6 +39,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "library", + "emittedEvents": [], "id": 4, "name": "L", "nameLocation": "28:1:1", @@ -109,6 +110,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 13, "name": "C", "nameLocation": "62:1:1", diff --git a/test/libsolidity/ASTJSON/yul_hex_literal.json b/test/libsolidity/ASTJSON/yul_hex_literal.json index fc1cc39db..a585e6bf3 100644 --- a/test/libsolidity/ASTJSON/yul_hex_literal.json +++ b/test/libsolidity/ASTJSON/yul_hex_literal.json @@ -17,6 +17,7 @@ "canonicalName": "Sample", "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "fullyImplemented": true, "id": 6, "linearizedBaseContracts": diff --git a/test/libsolidity/ASTJSON/yul_hex_literal_parseOnly.json b/test/libsolidity/ASTJSON/yul_hex_literal_parseOnly.json index a6da7e778..8ea2c8c67 100644 --- a/test/libsolidity/ASTJSON/yul_hex_literal_parseOnly.json +++ b/test/libsolidity/ASTJSON/yul_hex_literal_parseOnly.json @@ -9,6 +9,7 @@ "baseContracts": [], "contractDependencies": [], "contractKind": "contract", + "emittedEvents": [], "id": 6, "name": "Sample", "nameLocation": "9:6:1", diff --git a/test/libsolidity/SolidityNatspecJSON.cpp b/test/libsolidity/SolidityNatspecJSON.cpp index 1a2c3af1f..04f841677 100644 --- a/test/libsolidity/SolidityNatspecJSON.cpp +++ b/test/libsolidity/SolidityNatspecJSON.cpp @@ -496,10 +496,8 @@ BOOST_AUTO_TEST_CASE(event_inheritance) /// @dev A test case! event Transfer(address indexed from, address indexed to, uint amount); } - contract A is ERC20 { } - contract B is A { } )"; diff --git a/test/libsolidity/StandardCompiler.cpp b/test/libsolidity/StandardCompiler.cpp index d2eeedd91..11542274c 100644 --- a/test/libsolidity/StandardCompiler.cpp +++ b/test/libsolidity/StandardCompiler.cpp @@ -485,7 +485,8 @@ BOOST_AUTO_TEST_CASE(basic_compilation) BOOST_CHECK_EQUAL( util::jsonCompactPrint(result["sources"]["fileA"]["ast"]), "{\"absolutePath\":\"fileA\",\"exportedSymbols\":{\"A\":[1]},\"id\":2,\"nodeType\":\"SourceUnit\",\"nodes\":[{\"abstract\":false," - "\"baseContracts\":[],\"canonicalName\":\"A\",\"contractDependencies\":[],\"contractKind\":\"contract\",\"fullyImplemented\":true,\"id\":1," + "\"baseContracts\":[],\"canonicalName\":\"A\",\"contractDependencies\":[]," + "\"contractKind\":\"contract\",\"emittedEvents\":[],\"fullyImplemented\":true,\"id\":1," "\"linearizedBaseContracts\":[1],\"name\":\"A\",\"nameLocation\":\"9:1:0\",\"nodeType\":\"ContractDefinition\",\"nodes\":[],\"scope\":2," "\"src\":\"0:14:0\",\"usedErrors\":[]}],\"src\":\"0:14:0\"}" );