You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/abi-spec.rst
+12-6Lines changed: 12 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -190,9 +190,9 @@ Given the contract:
190
190
pragma solidity ^0.4.0;
191
191
192
192
contract Foo {
193
-
function bar(bytes3[2] xy) {}
194
-
function baz(uint32 x, bool y) returns (bool r) { r = x > 32 || y; }
195
-
function sam(bytes name, bool z, uint[] data) {}
193
+
function bar(bytes3[2] xy) public {}
194
+
function baz(uint32 x, bool y) public returns (bool r) { r = x > 32 || y; }
195
+
function sam(bytes name, bool z, uint[] data) public {}
196
196
}
197
197
198
198
@@ -288,6 +288,8 @@ In effect, a log entry using this ABI is described as:
288
288
- ``topics[n]``: ``EVENT_INDEXED_ARGS[n - 1]`` (``EVENT_INDEXED_ARGS`` is the series of ``EVENT_ARGS`` that are indexed);
289
289
- ``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).
290
290
291
+
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). Developers may overcome this tradeoff and achieve both efficient search and arbitrary legibility by defining events with two arguments — one indexed, one not — intended to hold the same value.
292
+
291
293
JSON
292
294
====
293
295
@@ -333,10 +335,10 @@ For example,
333
335
pragma solidity ^0.4.0;
334
336
335
337
contract Test {
336
-
function Test(){ b = 0x12345678901234567890123456789012; }
338
+
function Test() public { b = 0x12345678901234567890123456789012; }
0 commit comments