aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-05-02 21:50:10 +0800
committerGitHub <noreply@github.com>2018-05-02 21:50:10 +0800
commit451e8edb1a095a8958eba96a0435ff9fb9ffb2a9 (patch)
tree8cd4db92d6d7b5aa7c31995ff9a5026c4e9312a3 /docs
parentdc18cde66f9dca1cfe93f04a376e9c20a4614328 (diff)
parentd72624ecb9d37bc60a170c48cc6a9cf9a0060184 (diff)
downloaddexon-solidity-451e8edb1a095a8958eba96a0435ff9fb9ffb2a9.tar.gz
dexon-solidity-451e8edb1a095a8958eba96a0435ff9fb9ffb2a9.tar.zst
dexon-solidity-451e8edb1a095a8958eba96a0435ff9fb9ffb2a9.zip
Merge pull request #3992 from davesque/improve-abi-spec
A couple of ABI spec improvements
Diffstat (limited to 'docs')
-rw-r--r--docs/abi-spec.rst8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/abi-spec.rst b/docs/abi-spec.rst
index 98301fdc..b0b16e28 100644
--- a/docs/abi-spec.rst
+++ b/docs/abi-spec.rst
@@ -77,7 +77,7 @@ of them inside parentheses, separated by commas:
- ``(T1,T2,...,Tn)``: tuple consisting of the types ``T1``, ..., ``Tn``, ``n >= 0``
-It is possible to form tuples of tuples, arrays of tuples and so on.
+It is possible to form tuples of tuples, arrays of tuples and so on. It is also possible to form zero-tuples (where ``n == 0``).
.. note::
Solidity supports all the types presented above with the same names with the exception of tuples. The ABI tuple type is utilised for encoding Solidity ``structs``.
@@ -117,7 +117,7 @@ on the type of ``X`` being
- ``(T1,...,Tk)`` for ``k >= 0`` and any types ``T1``, ..., ``Tk``
- ``enc(X) = head(X(1)) ... head(X(k-1)) tail(X(0)) ... tail(X(k-1))``
+ ``enc(X) = head(X(1)) ... head(X(k)) tail(X(1)) ... tail(X(k))``
where ``X(i)`` is the ``ith`` component of the value, and
``head`` and ``tail`` are defined for ``Ti`` being a static type as
@@ -126,7 +126,7 @@ on the type of ``X`` being
and as
- ``head(X(i)) = enc(len(head(X(0)) ... head(X(k-1)) tail(X(0)) ... tail(X(i-1))))``
+ ``head(X(i)) = enc(len( head(X(1)) ... head(X(k)) tail(X(1)) ... tail(X(i-1)) ))``
``tail(X(i)) = enc(X(i))``
otherwise, i.e. if ``Ti`` is a dynamic type.
@@ -137,7 +137,7 @@ on the type of ``X`` being
- ``T[k]`` for any ``T`` and ``k``:
- ``enc(X) = enc((X[0], ..., X[k-1]))``
+ ``enc(X) = enc((X[1], ..., X[k]))``
i.e. it is encoded as if it were a tuple with ``k`` elements
of the same type.