mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #3386 from nisdas/abi-spec-documentation
Fixed typos in abi-spec documentation
This commit is contained in:
commit
8d666e180d
@ -62,7 +62,7 @@ The following elementary types exist:
|
|||||||
|
|
||||||
The following (fixed-size) array type exists:
|
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:
|
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``
|
* ``bytes``
|
||||||
* ``string``
|
* ``string``
|
||||||
* ``T[]`` for any ``T``
|
* ``T[]`` for any ``T``
|
||||||
* ``T[k]`` for any dynamic ``T`` and any ``k > 0``
|
* ``T[k]`` for any dynamic ``T`` and any ``k >= 0``
|
||||||
* ``(T1,...,Tk)`` if any ``Ti`` is dynamic for ``1 <= i <= k``
|
* ``(T1,...,Tk)`` if ``Ti`` is dynamic for some ``1 <= i <= k``
|
||||||
|
|
||||||
All other types are called "static".
|
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))``
|
``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`` and ``tail`` are defined for ``Ti`` being a static type as
|
||||||
|
|
||||||
``head(X(i)) = enc(X(i))`` and ``tail(X(i)) = ""`` (the empty string)
|
``head(X(i)) = enc(X(i))`` and ``tail(X(i)) = ""`` (the empty string)
|
||||||
|
|
||||||
and as
|
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))``
|
``tail(X(i)) = enc(X(i))``
|
||||||
|
|
||||||
otherwise, i.e. if ``Ti`` is a dynamic type.
|
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``:
|
- ``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
|
i.e. it is encoded as if it were a tuple with ``k`` elements
|
||||||
of the same type.
|
of the same type.
|
||||||
|
|
||||||
- ``T[]`` where ``X`` has ``k`` elements (``k`` is assumed to be of type ``uint256``):
|
- ``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
|
i.e. it is encoded as if it were an array of static size ``k``, prefixed with
|
||||||
the number of elements.
|
the number of elements.
|
||||||
|
Loading…
Reference in New Issue
Block a user