Files
remix-viper/docs/tutorial_import.rst

36 lines
1.1 KiB
ReStructuredText
Raw Permalink Normal View History

2017-02-27 15:40:19 +01:00
Importing Source Files in Solidity
==================================
2017-02-27 15:08:08 +01:00
.. _tutorial-import:
2017-02-27 15:40:19 +01:00
This tutorial will show you how to import local and external files.
2017-02-27 15:08:08 +01:00
2017-02-27 15:40:19 +01:00
The compilation result will also contain contracts implemented in the imported files.
2017-02-27 15:08:08 +01:00
2017-02-27 15:40:19 +01:00
For a detailed explanation of the ``import`` keyword see the ``Solidity``
`documentation <http://solidity.readthedocs.io/en/develop/layout-of-source-files.html?highlight=import#importing-other-source-files>`_
2017-02-27 15:08:08 +01:00
Importing a local file
----------------------
2017-02-27 15:40:19 +01:00
Other files in Remix can be imported just by specifying their path.
Please use `./` for relative paths to increase portability.
2017-02-27 15:08:08 +01:00
.. image:: tuto_basicimport.png
Importing from Github
----------------------
2017-02-27 15:40:19 +01:00
It is possible to import files directly from github with URLs like
``http://github.com/<owner>/<repo>/<path to the file>``.
2017-02-27 15:08:08 +01:00
2017-02-27 15:40:19 +01:00
.. image:: tuto_importgit.png
2017-02-27 15:08:08 +01:00
Importing from Swarm
--------------------
2017-02-27 15:40:19 +01:00
Files can be imported using all URLs supported by swarm. If you do not have a swarm
node, swarm-gateways.net will be used instead.
2017-02-27 15:08:08 +01:00
.. image:: tuto_importswarm.png