aboutsummaryrefslogtreecommitdiffstats
path: root/docs/miscellaneous.rst
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-06-08 01:44:32 +0800
committerchriseth <c@ethdev.com>2016-06-09 00:16:46 +0800
commit3150ab2bcfe6ab66d426916fc1a003ae52799b72 (patch)
treeb7fc2c8c910c97c883816364bd62bb7c646dd75b /docs/miscellaneous.rst
parent63b63056893717a9ec4565ba6c1e7c746592054b (diff)
downloaddexon-solidity-3150ab2bcfe6ab66d426916fc1a003ae52799b72.tar.gz
dexon-solidity-3150ab2bcfe6ab66d426916fc1a003ae52799b72.tar.zst
dexon-solidity-3150ab2bcfe6ab66d426916fc1a003ae52799b72.zip
Allow remappings to change depending on the context.
Diffstat (limited to 'docs/miscellaneous.rst')
-rw-r--r--docs/miscellaneous.rst6
1 files changed, 5 insertions, 1 deletions
diff --git a/docs/miscellaneous.rst b/docs/miscellaneous.rst
index 4e61b283..c9a8890f 100644
--- a/docs/miscellaneous.rst
+++ b/docs/miscellaneous.rst
@@ -108,7 +108,7 @@ Using ``solc --help`` provides you with an explanation of all options. The compi
If you only want to compile a single file, you run it as ``solc --bin sourceFile.sol`` and it will print the binary. Before you deploy your contract, activate the optimizer while compiling using ``solc --optimize --bin sourceFile.sol``. If you want to get some of the more advanced output variants of ``solc``, it is probably better to tell it to output everything to separate files using ``solc -o outputDirectory --bin --ast --asm sourceFile.sol``.
The commandline compiler will automatically read imported files from the filesystem, but
-it is also possible to provide path redirects using ``prefix=path`` in the following way:
+it is also possible to provide path redirects using ``context:prefix=path`` in the following way:
::
@@ -121,6 +121,10 @@ always matches). ``solc`` will not read files from the filesystem that lie outsi
the remapping targets and outside of the directories where explicitly specified source
files reside, so things like ``import "/etc/passwd";`` only work if you add ``=/`` as a remapping.
+You can restrict remappings to only certain source files by prefixing a context.
+
+The section on :ref:`import` provides more details on remappings.
+
If there are multiple matches due to remappings, the one with the longest common prefix is selected.
If your contracts use :ref:`libraries <libraries>`, you will notice that the bytecode contains substrings of the form ``__LibraryName______``. You can use ``solc`` as a linker meaning that it will insert the library addresses for you at those points: