diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-09-27 04:21:49 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-09-27 05:48:49 +0800 |
commit | a7592fa8016401b4674faa5059b0ae00dc7ece68 (patch) | |
tree | 617ed03221b04a649b7644ba7890cbfca9095663 /docs/abi-spec.rst | |
parent | 6db13311dd6d9e9ebb10f6f5b34c5b326f69b390 (diff) | |
download | dexon-solidity-a7592fa8016401b4674faa5059b0ae00dc7ece68.tar.gz dexon-solidity-a7592fa8016401b4674faa5059b0ae00dc7ece68.tar.zst dexon-solidity-a7592fa8016401b4674faa5059b0ae00dc7ece68.zip |
Document packed ABI
Diffstat (limited to 'docs/abi-spec.rst')
-rw-r--r-- | docs/abi-spec.rst | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/abi-spec.rst b/docs/abi-spec.rst index 29d98645..0361458f 100644 --- a/docs/abi-spec.rst +++ b/docs/abi-spec.rst @@ -442,3 +442,22 @@ would result in the JSON: "outputs": [] } ] + +.. _abi_packed_mode: + +Non-standard Packed Mode +======================== + +Solidity supports a non-standard packed mode where: + +- no :ref:`function selector <abi_function_selector>` is encoded, +- short types are not zero padded and +- dynamic types are encoded in-place and without the length. + +As an example encoding ``uint1, bytes1, uint8, string`` with values ``1, 0x42, 0x2424, "Hello, world!"`` results in :: + + 0x0142242448656c6c6f2c20776f726c6421 + ^^ uint1(1) + ^^ bytes1(0x42) + ^^^^ uint8(0x2424) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ string("Hello, world!") without a length field |