diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/_static/css/custom.css (renamed from docs/docs-css/custom.css) | 6 | ||||
-rw-r--r-- | docs/conf.py | 2 | ||||
-rw-r--r-- | docs/layout-of-source-files.rst | 11 | ||||
-rw-r--r-- | docs/types.rst | 33 | ||||
-rw-r--r-- | docs/using-the-compiler.rst | 11 |
5 files changed, 38 insertions, 25 deletions
diff --git a/docs/docs-css/custom.css b/docs/_static/css/custom.css index 970148ed..fd506203 100644 --- a/docs/docs-css/custom.css +++ b/docs/_static/css/custom.css @@ -7,8 +7,8 @@ pre { } .wy-table-responsive table td, .wy-table-responsive table th { - white-space: pre-wrap; + white-space: normal; } -.wy-table-responsive table td, .wy-table-responsive table th { - white-space: pre-wrap; +.rst-content table.docutils td { + vertical-align: top; } diff --git a/docs/conf.py b/docs/conf.py index 55f4f1a8..233ff7b6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -143,7 +143,7 @@ html_theme = 'sphinx_rtd_theme' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = [] +html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied diff --git a/docs/layout-of-source-files.rst b/docs/layout-of-source-files.rst index 46ef3d57..4bacd704 100644 --- a/docs/layout-of-source-files.rst +++ b/docs/layout-of-source-files.rst @@ -100,11 +100,10 @@ When the compiler is invoked, it is not only possible to specify how to discover the first element of a path, but it is possible to specify path prefix remappings so that e.g. ``github.com/ethereum/dapp-bin/library`` is remapped to ``/usr/local/dapp-bin/library`` and the compiler will read the files from there. -If multiple remappings can be applied, the one with the longest key is tried first. This -allows for a "fallback-remapping" with e.g. ``""`` maps to -``"/usr/local/include/solidity"``. Furthermore, these remappings can -depend on the context, which allows you to configure packages to -import e.g. different versions of a library of the same name. +If multiple remappings can be applied, the one with the longest key is tried first. +An empty prefix is not allowed. Furthermore, these remappings can depend on the context, +which allows you to configure packages to import e.g. different versions of a library +of the same name. **solc**: @@ -148,7 +147,7 @@ Note that solc only allows you to include files from certain directories: They have to be in the directory (or subdirectory) of one of the explicitly specified source files or in the directory (or subdirectory) of a remapping target. If you want to allow direct absolute includes, just add the -remapping ``=/``. +remapping ``/=/``. If there are multiple remappings that lead to a valid file, the remapping with the longest common prefix is chosen. diff --git a/docs/types.rst b/docs/types.rst index 5b726cb8..7e222bc1 100644 --- a/docs/types.rst +++ b/docs/types.rst @@ -200,25 +200,38 @@ The ``.gas()`` option is available on all three methods, while the ``.value()`` .. note:: The use of ``callcode`` is discouraged and will be removed in the future. +.. index:: ! contract type, ! type; contract + +.. _contract_types: + Contract Types -------------- -Every :ref:`contract<contracts>` defines its own type. Contracts can be implicitly converted -to contracts they inherit from. They can be explicitly converted from and to ``address`` types. +Every :ref:`contract<contracts>` defines its own type. +You can implicitly convert contracts to contracts they inherit from, +and explicitly convert them to and from the ``address`` type. -The data representation of a contract is identical to that of the ``address`` type and -this type is also used in the :ref:`ABI<ABI>`. +.. note:: + Starting with version 0.5.0 contracts do not derive from the address type, + but can still be explicitly converted to address. -Contracts do not support any operators. +If you declare a local variable of contract type (`MyContract c`), you can call +functions on that contract. Take care to assign it from somewhere that is the +same contract type. -The members of contract types are the external functions of the contract including -public state variables. +You can also instantiate contracts (which means they are newly created). You +can find more details in the :ref:`'Contracts via new'<creating-contracts>` +section. -.. note:: - Starting with version 0.5.0 contracts do not derive from the address type, but can still be explicitly converted to address. +The data representation of a contract is identical to that of the ``address`` +type and this type is also used in the :ref:`ABI<ABI>`. -.. index:: byte array, bytes32 +Contracts do not support any operators. +The members of contract types are the external functions of the contract +including public state variables. + +.. index:: byte array, bytes32 Fixed-size byte arrays ---------------------- diff --git a/docs/using-the-compiler.rst b/docs/using-the-compiler.rst index 1d7cb97b..b286e1a3 100644 --- a/docs/using-the-compiler.rst +++ b/docs/using-the-compiler.rst @@ -23,14 +23,15 @@ it is also possible to provide path redirects using ``prefix=path`` in the follo :: - solc github.com/ethereum/dapp-bin/=/usr/local/lib/dapp-bin/ =/usr/local/lib/fallback file.sol + solc github.com/ethereum/dapp-bin/=/usr/local/lib/dapp-bin/ file.sol This essentially instructs the compiler to search for anything starting with -``github.com/ethereum/dapp-bin/`` under ``/usr/local/lib/dapp-bin`` and if it does not -find the file there, it will look at ``/usr/local/lib/fallback`` (the empty prefix -always matches). ``solc`` will not read files from the filesystem that lie outside of +``github.com/ethereum/dapp-bin/`` under ``/usr/local/lib/dapp-bin``. +``solc`` will not read files from the filesystem that lie outside of 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. +files reside, so things like ``import "/etc/passwd";`` only work if you add ``/=/`` as a remapping. + +An empty remapping prefix is not allowed. If there are multiple matches due to remappings, the one with the longest common prefix is selected. |