diff options
-rw-r--r-- | docs/abi-spec.rst | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/docs/abi-spec.rst b/docs/abi-spec.rst index b0b16e28..8591a07f 100644 --- a/docs/abi-spec.rst +++ b/docs/abi-spec.rst @@ -62,7 +62,7 @@ The following elementary types exist: The following (fixed-size) array type exists: -- ``<type>[M]``: a fixed-length array of ``M`` elements, ``M > 0``, of the given type. +- ``<type>[M]``: a fixed-length array of ``M`` elements, ``M >= 0``, of the given type. The following non-fixed-size types exist: @@ -101,8 +101,8 @@ We distinguish static and dynamic types. Static types are encoded in-place and d * ``bytes`` * ``string`` * ``T[]`` for any ``T`` -* ``T[k]`` for any dynamic ``T`` and any ``k > 0`` -* ``(T1,...,Tk)`` if any ``Ti`` is dynamic for ``1 <= i <= k`` +* ``T[k]`` for any dynamic ``T`` and any ``k >= 0`` +* ``(T1,...,Tk)`` if ``Ti`` is dynamic for some ``1 <= i <= k`` All other types are called "static". @@ -119,14 +119,14 @@ on the type of ``X`` being ``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 + where ``X = (X(1), ..., X(k))`` and ``head`` and ``tail`` are defined for ``Ti`` being a static type as ``head(X(i)) = enc(X(i))`` and ``tail(X(i)) = ""`` (the empty string) and as - ``head(X(i)) = enc(len( head(X(1)) ... head(X(k)) tail(X(1)) ... 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,14 +137,14 @@ on the type of ``X`` being - ``T[k]`` for any ``T`` and ``k``: - ``enc(X) = enc((X[1], ..., X[k]))`` + ``enc(X) = enc((X[0], ..., X[k-1]))`` i.e. it is encoded as if it were a tuple with ``k`` elements of the same type. - ``T[]`` where ``X`` has ``k`` elements (``k`` is assumed to be of type ``uint256``): - ``enc(X) = enc(k) enc([X[1], ..., X[k]])`` + ``enc(X) = enc(k) enc([X[0], ..., X[k-1]])`` i.e. it is encoded as if it were an array of static size ``k``, prefixed with the number of elements. |