Skip to content

Commit c57a608

Browse files
authored
Merge pull request ethereum#4844 from ethereum/docs-1644-bytecode
Clean up metadata and clarify what small changes affect
2 parents 23ad225 + 9340fb9 commit c57a608

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

docs/metadata.rst

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,28 @@ Contract Metadata
44

55
.. index:: metadata, contract verification
66

7-
The Solidity compiler automatically generates a JSON file, the
8-
contract metadata, that contains information about the current contract.
9-
It can be used to query the compiler version, the sources used, the ABI
10-
and NatSpec documentation in order to more safely interact with the contract
11-
and to verify its source code.
7+
The Solidity compiler automatically generates a JSON file, the contract
8+
metadata, that contains information about the current contract. You can use
9+
this file to query the compiler version, the sources used, the ABI and NatSpec
10+
documentation to more safely interact with the contract and verify its source
11+
code.
1212

1313
The compiler appends a Swarm hash of the metadata file to the end of the
1414
bytecode (for details, see below) of each contract, so that you can retrieve
1515
the file in an authenticated way without having to resort to a centralized
1616
data provider.
1717

18-
Of course, you have to publish the metadata file to Swarm (or some other service)
19-
so that others can access it. The file can be output by using ``solc --metadata``
20-
and the file will be called ``ContractName_meta.json``.
21-
It will contain Swarm references to the source code, so you have to upload
22-
all source files and the metadata file.
18+
You have to publish the metadata file to Swarm (or another service) so that
19+
others can access it. You create the file by using the ``solc --metadata``
20+
command that generates a file called ``ContractName_meta.json``. It contains
21+
Swarm references to the source code, so you have to upload all source files and
22+
the metadata file.
2323

2424
The metadata file has the following format. The example below is presented in a
2525
human-readable way. Properly formatted metadata should use quotes correctly,
2626
reduce whitespace to a minimum and sort the keys of all objects to arrive at a
27-
unique formatting.
28-
Comments are of course also not permitted and used here only for explanatory purposes.
27+
unique formatting. Comments are not permitted and used here only for
28+
explanatory purposes.
2929

3030
.. code-block:: none
3131
@@ -96,11 +96,11 @@ Comments are of course also not permitted and used here only for explanatory pur
9696
.. note::
9797
Note the ABI definition above has no fixed order. It can change with compiler versions.
9898

99-
.. note::
100-
Since the bytecode of the resulting contract contains the metadata hash, any change to
101-
the metadata will result in a change of the bytecode. Furthermore, since the metadata
102-
includes a hash of all the sources used, a single whitespace change in any of the source
103-
codes will result in a different metadata, and subsequently a different bytecode.
99+
Since the bytecode of the resulting contract contains the metadata hash, any
100+
change to the metadata results in a change of the bytecode. This includes
101+
changes to a filename or path, and since the metadata includes a hash of all the
102+
sources used, a single whitespace change results in different metadata, and
103+
different bytecode.
104104

105105
Encoding of the Metadata Hash in the Bytecode
106106
=============================================

0 commit comments

Comments
 (0)