aboutsummaryrefslogtreecommitdiffstats
path: root/docs/using-the-compiler.rst
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-10-08 21:08:12 +0800
committerchriseth <chris@ethereum.org>2018-10-12 21:15:02 +0800
commit26c693aa920ec1ea41ef7994a3dc8bb45b78f866 (patch)
treeaa95184ed3f52c80e216fc20706c22ddb71d6fc6 /docs/using-the-compiler.rst
parent4d6d224cf83195db8dcea1f5015a68d1ce2dca0f (diff)
downloaddexon-solidity-26c693aa920ec1ea41ef7994a3dc8bb45b78f866.tar.gz
dexon-solidity-26c693aa920ec1ea41ef7994a3dc8bb45b78f866.tar.zst
dexon-solidity-26c693aa920ec1ea41ef7994a3dc8bb45b78f866.zip
Change library placeholder to `__$<hash>$__`.
Diffstat (limited to 'docs/using-the-compiler.rst')
-rw-r--r--docs/using-the-compiler.rst11
1 files changed, 6 insertions, 5 deletions
diff --git a/docs/using-the-compiler.rst b/docs/using-the-compiler.rst
index ac744d08..9ba6caa5 100644
--- a/docs/using-the-compiler.rst
+++ b/docs/using-the-compiler.rst
@@ -41,15 +41,16 @@ If there are multiple matches due to remappings, the one with the longest common
For security reasons the compiler has restrictions what directories it can access. Paths (and their subdirectories) of source files specified on the commandline and paths defined by remappings are allowed for import statements, but everything else is rejected. Additional paths (and their subdirectories) can be allowed via the ``--allow-paths /sample/path,/another/sample/path`` switch.
-If your contracts use :ref:`libraries <libraries>`, you will notice that the bytecode contains substrings of the form ``__53aea86b7d70b31448b230b20ae141a537e5__``. These are placeholders for the actual library addresses.
-The placeholder is a 36 character prefix of the hex encoding of the keccak256 hash of the fully qualified library name.
-The bytecode file will also contain lines of the form ``// <placeholder> -> <library name>`` at the end to help
-identify which libraries the placeholders represent.
+If your contracts use :ref:`libraries <libraries>`, you will notice that the bytecode contains substrings of the form ``__$53aea86b7d70b31448b230b20ae141a537$__``. These are placeholders for the actual library addresses.
+The placeholder is a 34 character prefix of the hex encoding of the keccak256 hash of the fully qualified library name.
+The bytecode file will also contain lines of the form ``// <placeholder> -> <fq library name>`` at the end to help
+identify which libraries the placeholders represent. Note that the fully qualified library name
+is the path of its source file and the library name separated by ``:``.
You can use ``solc`` as a linker meaning that it will insert the library addresses for you at those points:
Either add ``--libraries "file.sol:Math:0x1234567890123456789012345678901234567890 file.sol:Heap:0xabCD567890123456789012345678901234567890"`` to your command to provide an address for each library or store the string in a file (one library per line) and run ``solc`` using ``--libraries fileName``.
-If ``solc`` is called with the option ``--link``, all input files are interpreted to be unlinked binaries (hex-encoded) in the ``__53aea86b7d70b31448b230b20ae141a537e5__``-format given above and are linked in-place (if the input is read from stdin, it is written to stdout). All options except ``--libraries`` are ignored (including ``-o``) in this case.
+If ``solc`` is called with the option ``--link``, all input files are interpreted to be unlinked binaries (hex-encoded) in the ``__$53aea86b7d70b31448b230b20ae141a537$__``-format given above and are linked in-place (if the input is read from stdin, it is written to stdout). All options except ``--libraries`` are ignored (including ``-o``) in this case.
If ``solc`` is called with the option ``--standard-json``, it will expect a JSON input (as explained below) on the standard input, and return a JSON output on the standard output. This is the recommended interface for more complex and especially automated uses.