diff options
-rw-r--r-- | docs/contracts.rst | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/docs/contracts.rst b/docs/contracts.rst index c9553afe..f7ceb950 100644 --- a/docs/contracts.rst +++ b/docs/contracts.rst @@ -246,7 +246,7 @@ when they are declared. The getter functions have external visibility. If the symbol is accessed internally (i.e. without ``this.``), -evaluates to a state variable. If it is accessed externally +it evaluates to a state variable. If it is accessed externally (i.e. with ``this.``), it evaluates to a function. :: @@ -612,7 +612,7 @@ Like any function, the fallback function can execute complex operations as long .. warning:: The fallback function is also executed if the caller meant to call a function that is not available. If you want to implement the fallback - function merely for being able to receive ether, you should add a check + function only to receive ether, you should add a check like ``require(msg.data.length == 0)`` to prevent invalid calls. .. warning:: @@ -772,7 +772,7 @@ Frontier and Homestead, but this might change with Serenity). Log and event data is not accessible from within contracts (not even from the contract that created them). -"Simple payment verification" proofs for logs are possible, so if an external entity supplies +"Simple payment verification" (SPV) proofs for logs are possible, so if an external entity supplies a contract with such a proof, it can check that the log actually exists inside the blockchain. Be aware that block headers have to be supplied because the contract can only see the last 256 block hashes. @@ -1107,7 +1107,7 @@ derived contracts need to specify all of them. This can be done in two ways:: } One way is directly in the inheritance list (``is Base(7)``). The other is in -the way a modifier would be invoked as part of +the way a modifier is invoked as part of the derived constructor (``Base(_y * _y)``). The first way to do it is more convenient if the constructor argument is a constant and defines the behaviour of the contract or @@ -1294,7 +1294,7 @@ contract, and a regular ``JUMP`` call will be used instead of a ``DELEGATECALL`` .. index:: using for, set -The following example illustrates how to use libraries (but +The following example illustrates how to use libraries (butmanual method be sure to check out :ref:`using for <using-for>` for a more advanced example to implement a set). @@ -1439,10 +1439,14 @@ will contain placeholders of the form ``__Set______`` (where ``Set`` is the name of the library). The address can be filled manually by replacing all those 40 symbols by the hex encoding of the address of the library contract. -Note that this manual method is discouraged, because -it is restricted to 36 characters. Either use the ``--libraries`` -option of ``solc`` or the ``libraries`` key if you use -the standard-JSON interface to the compiler. + +.. note:: + Manually linking libraries on the generated bytecode is discouraged, because + it is restricted to 36 characters. + You should ask the compiler to link the libraries at the time + a contract is compiled by either using + the ``--libraries`` option of ``solc`` or the ``libraries`` key if you use + the standard-JSON interface to the compiler. Restrictions for libraries in comparison to contracts: |