aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-09-26 00:49:49 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-09-27 01:01:13 +0800
commit9c2b809fc77bbd7b0e2eda4cc7153be484fb4c52 (patch)
treeffdddb07557a93f021e9b57056e147597ce05edc
parent8d99d26c7c21bd5c049be1f35d20eabcdddfee4e (diff)
downloaddexon-solidity-9c2b809fc77bbd7b0e2eda4cc7153be484fb4c52.tar.gz
dexon-solidity-9c2b809fc77bbd7b0e2eda4cc7153be484fb4c52.tar.zst
dexon-solidity-9c2b809fc77bbd7b0e2eda4cc7153be484fb4c52.zip
[DOCS] Update metadata.
-rw-r--r--docs/metadata.rst15
1 files changed, 12 insertions, 3 deletions
diff --git a/docs/metadata.rst b/docs/metadata.rst
index 9c4f2574..a9b5b7d4 100644
--- a/docs/metadata.rst
+++ b/docs/metadata.rst
@@ -117,19 +117,28 @@ to the end of the deployed bytecode::
So in order to retrieve the data, the end of the deployed bytecode can be checked
to match that pattern and use the Swarm hash to retrieve the file.
+.. note::
+ The compiler currently uses the "swarm version 0" hash of the metadata,
+ but this might change in the future, so do not rely on this sequence
+ to start with ``0xa1 0x65 'b' 'z' 'z' 'r' '0'``. We might also
+ add additional data to this CBOR structure, so the
+ best option is to use a proper CBOR parser.
+
+
Usage for Automatic Interface Generation and NatSpec
====================================================
The metadata is used in the following way: A component that wants to interact
-with a contract (e.g. Mist) retrieves the code of the contract, from that
+with a contract (e.g. Mist or any wallet) retrieves the code of the contract, from that
the Swarm hash of a file which is then retrieved.
That file is JSON-decoded into a structure like above.
The component can then use the ABI to automatically generate a rudimentary
user interface for the contract.
-Furthermore, Mist can use the userdoc to display a confirmation message to the user
-whenever they interact with the contract.
+Furthermore, the wallet can use the NatSpec user documentation to display a confirmation message to the user
+whenever they interact with the contract, together with requesting
+authorization for the transaction signature.
Additional information about Ethereum Natural Specification (NatSpec) can be found `here <https://github.com/ethereum/wiki/wiki/Ethereum-Natural-Specification-Format>`_.