diff options
author | Steve Waldman <swaldman@mchange.com> | 2017-12-19 17:44:33 +0800 |
---|---|---|
committer | Steve Waldman <swaldman@mchange.com> | 2017-12-19 17:51:57 +0800 |
commit | bae913368a438b2de7f3be93618feb21e155055e (patch) | |
tree | 1f528530e88c294b39de710f94b414ceaa1e4064 /docs | |
parent | b3fb73f53f69372754a7cb70b8589018d5bab5b6 (diff) | |
download | dexon-solidity-bae913368a438b2de7f3be93618feb21e155055e.tar dexon-solidity-bae913368a438b2de7f3be93618feb21e155055e.tar.gz dexon-solidity-bae913368a438b2de7f3be93618feb21e155055e.tar.bz2 dexon-solidity-bae913368a438b2de7f3be93618feb21e155055e.tar.lz dexon-solidity-bae913368a438b2de7f3be93618feb21e155055e.tar.xz dexon-solidity-bae913368a438b2de7f3be93618feb21e155055e.tar.zst dexon-solidity-bae913368a438b2de7f3be93618feb21e155055e.zip |
[Docs] Include explanation of how indexed dynamic-length event args are encoded
Diffstat (limited to 'docs')
-rw-r--r-- | docs/abi-spec.rst | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/docs/abi-spec.rst b/docs/abi-spec.rst index e106d98b..458c4ce0 100644 --- a/docs/abi-spec.rst +++ b/docs/abi-spec.rst @@ -288,6 +288,8 @@ In effect, a log entry using this ABI is described as: - ``topics[n]``: ``EVENT_INDEXED_ARGS[n - 1]`` (``EVENT_INDEXED_ARGS`` is the series of ``EVENT_ARGS`` that are indexed); - ``data``: ``abi_serialise(EVENT_NON_INDEXED_ARGS)`` (``EVENT_NON_INDEXED_ARGS`` is the series of ``EVENT_ARGS`` that are not indexed, ``abi_serialise`` is the ABI serialisation function used for returning a series of typed values from a function, as described above). +For all fixed-length Solidity types, the ``EVENT_INDEXED_ARGS`` array contains the 32-byte encoded value directly. However, for *types of dynamic length*, which include ``string``, ``bytes``, and arrays, ``EVENT_INDEXED_ARGS`` will contain the *Keccak hash* of the encoded value, rather than the encoded value directly. This allows applications to efficiently query for values of dynamic-length types (by setting the hash of the encoded value as the topic), but leaves applications unable to decode indexed values they have not queried for. For dynamic-length types, application developers face a trade-off between fast search for predetermined values (if the argument is indexed) and legibility of arbitrary values (which requires that the arguments not be indexed). + JSON ==== |