diff options
Diffstat (limited to 'docs/miscellaneous.rst')
-rw-r--r-- | docs/miscellaneous.rst | 6 |
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: |