aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-08-08 23:24:45 +0800
committerchriseth <chris@ethereum.org>2018-08-15 16:45:16 +0800
commit122cd6517caaf6523dfc28dddd49a1308f6c7dfb (patch)
tree0d189f47be46859d21042b8c25c916ce5547c2fd /docs
parent9328ea4c3c023950e59405941cfc25ec4c0ed1b4 (diff)
downloaddexon-solidity-122cd6517caaf6523dfc28dddd49a1308f6c7dfb.tar.gz
dexon-solidity-122cd6517caaf6523dfc28dddd49a1308f6c7dfb.tar.zst
dexon-solidity-122cd6517caaf6523dfc28dddd49a1308f6c7dfb.zip
Documentation.
Diffstat (limited to 'docs')
-rw-r--r--docs/miscellaneous.rst1
-rw-r--r--docs/units-and-global-variables.rst5
2 files changed, 4 insertions, 2 deletions
diff --git a/docs/miscellaneous.rst b/docs/miscellaneous.rst
index c0c7cb1b..e8631224 100644
--- a/docs/miscellaneous.rst
+++ b/docs/miscellaneous.rst
@@ -318,6 +318,7 @@ The following is the order of precedence for operators, listed in order of evalu
Global Variables
================
+- ``abi.decode(bytes encodedData, (...)) returns (...)``: :ref:`ABI <ABI>`-decodes the provided data. The types are given in parentheses as second argument. Example: ``(uint a, uint[2] memory b, bytes memory c) = abi.decode(data, (uint, uint[2], bytes))``
- ``abi.encode(...) returns (bytes)``: :ref:`ABI <ABI>`-encodes the given arguments
- ``abi.encodePacked(...) returns (bytes)``: Performs :ref:`packed encoding <abi_packed_mode>` of the given arguments
- ``abi.encodeWithSelector(bytes4 selector, ...) returns (bytes)``: :ref:`ABI <ABI>`-encodes the given arguments
diff --git a/docs/units-and-global-variables.rst b/docs/units-and-global-variables.rst
index 6eae2804..ceabee4e 100644
--- a/docs/units-and-global-variables.rst
+++ b/docs/units-and-global-variables.rst
@@ -96,9 +96,10 @@ Block and Transaction Properties
.. index:: abi, encoding, packed
-ABI Encoding Functions
-----------------------
+ABI Encoding and Decoding Functions
+-----------------------------------
+- ``abi.decode(bytes encodedData, (...)) returns (...)``: ABI-decodes the given data, while the types are given in parentheses as second argument. Example: ``(uint a, uint[2] memory b, bytes memory c) = abi.decode(data, (uint, uint[2], bytes))``
- ``abi.encode(...) returns (bytes)``: ABI-encodes the given arguments
- ``abi.encodePacked(...) returns (bytes)``: Performs :ref:`packed encoding <abi_packed_mode>` of the given arguments
- ``abi.encodeWithSelector(bytes4 selector, ...) returns (bytes)``: ABI-encodes the given arguments starting from the second and prepends the given four-byte selector