aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/abi-spec.rst14
-rw-r--r--docs/installing-solidity.rst41
-rw-r--r--docs/units-and-global-variables.rst3
-rw-r--r--docs/using-the-compiler.rst11
4 files changed, 48 insertions, 21 deletions
diff --git a/docs/abi-spec.rst b/docs/abi-spec.rst
index b0b16e28..8591a07f 100644
--- a/docs/abi-spec.rst
+++ b/docs/abi-spec.rst
@@ -62,7 +62,7 @@ The following elementary types exist:
The following (fixed-size) array type exists:
-- ``<type>[M]``: a fixed-length array of ``M`` elements, ``M > 0``, of the given type.
+- ``<type>[M]``: a fixed-length array of ``M`` elements, ``M >= 0``, of the given type.
The following non-fixed-size types exist:
@@ -101,8 +101,8 @@ We distinguish static and dynamic types. Static types are encoded in-place and d
* ``bytes``
* ``string``
* ``T[]`` for any ``T``
-* ``T[k]`` for any dynamic ``T`` and any ``k > 0``
-* ``(T1,...,Tk)`` if any ``Ti`` is dynamic for ``1 <= i <= k``
+* ``T[k]`` for any dynamic ``T`` and any ``k >= 0``
+* ``(T1,...,Tk)`` if ``Ti`` is dynamic for some ``1 <= i <= k``
All other types are called "static".
@@ -119,14 +119,14 @@ on the type of ``X`` being
``enc(X) = head(X(1)) ... head(X(k)) tail(X(1)) ... tail(X(k))``
- where ``X(i)`` is the ``ith`` component of the value, and
+ where ``X = (X(1), ..., X(k))`` and
``head`` and ``tail`` are defined for ``Ti`` being a static type as
``head(X(i)) = enc(X(i))`` and ``tail(X(i)) = ""`` (the empty string)
and as
- ``head(X(i)) = enc(len( head(X(1)) ... head(X(k)) tail(X(1)) ... tail(X(i-1)) ))``
+ ``head(X(i)) = enc(len(head(X(1)) ... head(X(k)) tail(X(1)) ... tail(X(i-1)) ))``
``tail(X(i)) = enc(X(i))``
otherwise, i.e. if ``Ti`` is a dynamic type.
@@ -137,14 +137,14 @@ on the type of ``X`` being
- ``T[k]`` for any ``T`` and ``k``:
- ``enc(X) = enc((X[1], ..., X[k]))``
+ ``enc(X) = enc((X[0], ..., X[k-1]))``
i.e. it is encoded as if it were a tuple with ``k`` elements
of the same type.
- ``T[]`` where ``X`` has ``k`` elements (``k`` is assumed to be of type ``uint256``):
- ``enc(X) = enc(k) enc([X[1], ..., X[k]])``
+ ``enc(X) = enc(k) enc([X[0], ..., X[k-1]])``
i.e. it is encoded as if it were an array of static size ``k``, prefixed with
the number of elements.
diff --git a/docs/installing-solidity.rst b/docs/installing-solidity.rst
index 6726ded9..cba30ed3 100644
--- a/docs/installing-solidity.rst
+++ b/docs/installing-solidity.rst
@@ -203,19 +203,38 @@ Prerequisites - Windows
You will need to install the following dependencies for Windows builds of Solidity:
-+------------------------------+-------------------------------------------------------+
-| Software | Notes |
-+==============================+=======================================================+
-| `Git for Windows`_ | Command-line tool for retrieving source from Github. |
-+------------------------------+-------------------------------------------------------+
-| `CMake`_ | Cross-platform build file generator. |
-+------------------------------+-------------------------------------------------------+
-| `Visual Studio 2015`_ | C++ compiler and dev environment. |
-+------------------------------+-------------------------------------------------------+
++-----------------------------------+-------------------------------------------------------+
+| Software | Notes |
++===================================+=======================================================+
+| `Git for Windows`_ | Command-line tool for retrieving source from Github. |
++-----------------------------------+-------------------------------------------------------+
+| `CMake`_ | Cross-platform build file generator. |
++-----------------------------------+-------------------------------------------------------+
+| `Visual Studio 2017 Build Tools`_ | C++ compiler |
++-----------------------------------+-------------------------------------------------------+
+| `Visual Studio 2017`_ (Optional) | C++ compiler and dev environment. |
++-----------------------------------+-------------------------------------------------------+
+
+If you've already had one IDE and only need compiler and libraries,
+you could install Visual Studio 2017 Build Tools.
+
+Visual Studio 2017 provides both IDE and necessary compiler and libraries.
+So if you have not got an IDE and prefer to develop solidity, Visual Studio 2017
+may be an choice for you to get everything setup easily.
+
+Here is the list of components that should be installed
+in Visual Studio 2017 Build Tools or Visual Studio 2017:
+
+* Visual Studio C++ core features
+* VC++ 2017 v141 toolset (x86,x64)
+* Windows Universal CRT SDK
+* Windows 8.1 SDK
+* C++/CLI support
.. _Git for Windows: https://git-scm.com/download/win
.. _CMake: https://cmake.org/download/
-.. _Visual Studio 2015: https://www.visualstudio.com/products/vs-2015-product-editions
+.. _Visual Studio 2017: https://www.visualstudio.com/vs/
+.. _Visual Studio 2017 Build Tools: https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2017
External Dependencies
@@ -263,7 +282,7 @@ And even for Windows:
mkdir build
cd build
- cmake -G "Visual Studio 14 2015 Win64" ..
+ cmake -G "Visual Studio 15 2017 Win64" ..
This latter set of instructions should result in the creation of
**solidity.sln** in that build directory. Double-clicking on that file
diff --git a/docs/units-and-global-variables.rst b/docs/units-and-global-variables.rst
index 51f7b9f3..4cb34fbd 100644
--- a/docs/units-and-global-variables.rst
+++ b/docs/units-and-global-variables.rst
@@ -31,6 +31,9 @@ because of `leap seconds <https://en.wikipedia.org/wiki/Leap_second>`_.
Due to the fact that leap seconds cannot be predicted, an exact calendar
library has to be updated by an external oracle.
+.. note::
+ The suffix ``years`` has been deprecated due to the reasons above.
+
These suffixes cannot be applied to variables. If you want to
interpret some input variable in e.g. days, you can do it in the following way::
diff --git a/docs/using-the-compiler.rst b/docs/using-the-compiler.rst
index df30b6b4..1d7cb97b 100644
--- a/docs/using-the-compiler.rst
+++ b/docs/using-the-compiler.rst
@@ -14,7 +14,9 @@ Using the Commandline Compiler
One of the build targets of the Solidity repository is ``solc``, the solidity commandline compiler.
Using ``solc --help`` provides you with an explanation of all options. The compiler can produce various outputs, ranging from simple binaries and assembly over an abstract syntax tree (parse tree) to estimations of gas usage.
-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``.
+If you only want to compile a single file, you run it as ``solc --bin sourceFile.sol`` and it will print the binary. 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``.
+
+Before you deploy your contract, activate the optimizer while compiling using ``solc --optimize --bin sourceFile.sol``. By default, the optimizer will optimize the contract for 200 runs. If you want to optimize for initial contract deployment and get the smallest output, set it to ``--runs=1``. If you expect many transactions and don't care for higher deployment cost and output size, set ``--runs`` to a high number.
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:
@@ -96,10 +98,13 @@ Input Description
{
// Optional: Sorted list of remappings
remappings: [ ":g/dir" ],
- // Optional: Optimizer settings (enabled defaults to false)
+ // Optional: Optimizer settings
optimizer: {
+ // disabled by default
enabled: true,
- runs: 500
+ // Optimize for how many times you intend to run the code.
+ // Lower values will optimize more for initial deployment cost, higher values will optimize more for high-frequency usage.
+ runs: 200
},
evmVersion: "byzantium", // Version of the EVM to compile for. Affects type checking and code generation. Can be homestead, tangerineWhistle, spuriousDragon, byzantium or constantinople
// Metadata settings (optional)