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
This commit is contained in:
Kamil Śliwak
2022-06-14 18:14:30 +02:00
committed by GitHub
18 changed files with 86 additions and 110 deletions
+2 -1
View File
@@ -19,7 +19,7 @@ We assume that all contracts will have the interface definitions of any contract
This specification does not address contracts whose interface is dynamic or otherwise known only at run-time.
.. _abi_function_selector:
.. index:: selector
.. index:: ! selector; of a function
Function Selector
=================
@@ -503,6 +503,7 @@ efficient search and arbitrary legibility by defining events with two arguments
indexed, one not — intended to hold the same value.
.. _abi_errors:
.. index:: error, selector; of an error
Errors
======
+1 -1
View File
@@ -116,7 +116,7 @@ efficient code, for example:
}
}
.. index:: selector; of a function
Access to External Variables, Functions and Libraries
-----------------------------------------------------
+6 -2
View File
@@ -1,5 +1,4 @@
.. index:: ! error, revert
.. index:: ! error, revert, ! selector; of an error
.. _errors:
*******************************
@@ -80,3 +79,8 @@ of the built-in type ``Panic(uint256)``.
by default. This means that an inner call
can "forge" revert data that looks like it could have come from the
contract that called it.
Members of Errors
=================
- ``error.selector``: A ``bytes4`` value containing the error selector.
+4 -2
View File
@@ -1,4 +1,4 @@
.. index:: ! event
.. index:: ! event, ! event; anonymous, ! event; indexed, ! event; topic
.. _events:
@@ -73,6 +73,8 @@ four indexed arguments rather than three.
In particular, it is possible to "fake" the signature of another event
using an anonymous event.
.. index:: ! selector; of an event
Members of Events
=================
@@ -147,7 +149,7 @@ The output of the above looks like the following (trimmed):
}
Additional Resources for Understanding Events
==============================================
=============================================
- `Javascript documentation <https://github.com/ethereum/web3.js/blob/1.x/docs/web3-eth-contract.rst#events>`_
- `Example usage of events <https://github.com/ethchange/smart-exchange/blob/master/lib/contracts/SmartExchange.sol>`_
+1 -1
View File
@@ -215,7 +215,7 @@ In comparison to contracts, libraries are restricted in the following ways:
(These might be lifted at a later point.)
.. _library-selectors:
.. index:: selector
.. index:: ! selector; of a library function
Function Signatures and Selectors in Libraries
==============================================
+1 -1
View File
@@ -548,7 +548,7 @@ these **create calls** and normal message calls is that the payload data is
executed and the result stored as code and the caller / creator
receives the address of the new contract on the stack.
.. index:: selfdestruct, self-destruct, deactivate
.. index:: ! selfdestruct, deactivate
Deactivate and Self-destruct
============================