Skip to content

Commit dccc06c

Browse files
authored
Merge pull request #13135 from ethereum/foreign-event-access-revert-and-selector-cleanup
Revert access to foreign events and clean up event/error selector tests/docs
2 parents b76c048 + f323cb2 commit dccc06c

18 files changed

+86
-110
lines changed

Changelog.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Important Bugfixes:
66

77
Language Features:
88
* Add `E.selector` for a non-anonymous event `E` to access the 32-byte selector topic.
9-
* Errors and Events allow qualified access from other contracts.
109

1110

1211
Compiler Features:

docs/abi-spec.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ We assume that all contracts will have the interface definitions of any contract
1919
This specification does not address contracts whose interface is dynamic or otherwise known only at run-time.
2020

2121
.. _abi_function_selector:
22-
.. index:: selector
22+
.. index:: ! selector; of a function
2323

2424
Function Selector
2525
=================
@@ -503,6 +503,7 @@ efficient search and arbitrary legibility by defining events with two arguments
503503
indexed, one not — intended to hold the same value.
504504

505505
.. _abi_errors:
506+
.. index:: error, selector; of an error
506507

507508
Errors
508509
======

docs/assembly.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ efficient code, for example:
116116
}
117117
}
118118
119-
119+
.. index:: selector; of a function
120120

121121
Access to External Variables, Functions and Libraries
122122
-----------------------------------------------------

docs/contracts/errors.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
.. index:: ! error, revert
2-
1+
.. index:: ! error, revert, ! selector; of an error
32
.. _errors:
43

54
*******************************
@@ -80,3 +79,8 @@ of the built-in type ``Panic(uint256)``.
8079
by default. This means that an inner call
8180
can "forge" revert data that looks like it could have come from the
8281
contract that called it.
82+
83+
Members of Errors
84+
=================
85+
86+
- ``error.selector``: A ``bytes4`` value containing the error selector.

docs/contracts/events.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. index:: ! event
1+
.. index:: ! event, ! event; anonymous, ! event; indexed, ! event; topic
22

33
.. _events:
44

@@ -73,6 +73,8 @@ four indexed arguments rather than three.
7373
In particular, it is possible to "fake" the signature of another event
7474
using an anonymous event.
7575

76+
.. index:: ! selector; of an event
77+
7678
Members of Events
7779
=================
7880

@@ -147,7 +149,7 @@ The output of the above looks like the following (trimmed):
147149
}
148150
149151
Additional Resources for Understanding Events
150-
==============================================
152+
=============================================
151153

152154
- `Javascript documentation <https://github.com/ethereum/web3.js/blob/1.x/docs/web3-eth-contract.rst#events>`_
153155
- `Example usage of events <https://github.com/ethchange/smart-exchange/blob/master/lib/contracts/SmartExchange.sol>`_

docs/contracts/libraries.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ In comparison to contracts, libraries are restricted in the following ways:
215215
(These might be lifted at a later point.)
216216

217217
.. _library-selectors:
218-
.. index:: selector
218+
.. index:: ! selector; of a library function
219219

220220
Function Signatures and Selectors in Libraries
221221
==============================================

docs/introduction-to-smart-contracts.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ these **create calls** and normal message calls is that the payload data is
548548
executed and the result stored as code and the caller / creator
549549
receives the address of the new contract on the stack.
550550

551-
.. index:: selfdestruct, self-destruct, deactivate
551+
.. index:: ! selfdestruct, deactivate
552552

553553
Deactivate and Self-destruct
554554
============================

libsolidity/ast/AST.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,7 @@ class EventDefinition: public CallableDeclaration, public StructurallyDocumented
12161216
FunctionTypePointer functionType(bool /*_internal*/) const override;
12171217

12181218
bool isVisibleInDerivedContracts() const override { return true; }
1219-
bool isVisibleViaContractTypeAccess() const override { return true; }
1219+
bool isVisibleViaContractTypeAccess() const override { return false; /* TODO */ }
12201220

12211221
EventDefinitionAnnotation& annotation() const override;
12221222

test/libsolidity/semanticTests/error/selector.sol

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)