diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/assembly.rst | 10 | ||||
-rw-r--r-- | docs/bugs_by_version.json | 4 | ||||
-rw-r--r-- | docs/contracts.rst | 4 | ||||
-rw-r--r-- | docs/types.rst | 4 |
4 files changed, 18 insertions, 4 deletions
diff --git a/docs/assembly.rst b/docs/assembly.rst index 705cd1b8..978e71e3 100644 --- a/docs/assembly.rst +++ b/docs/assembly.rst @@ -405,6 +405,16 @@ changes during the call, and thus references to local variables will be wrong. } } +.. note:: + If you access variables of a type that spans less than 256 bits + (for example ``uint64``, ``address``, ``bytes16`` or ``byte``), + you cannot make any assumptions about bits not part of the + encoding of the type. Especially, do not assume them to be zero. + To be safe, always clear the data properly before you use it + in a context where this is important: + ``uint32 x = f(); assembly { x := and(x, 0xffffffff) /* now use x */ }`` + To clean signed types, you can use the ``signextend`` opcode. + Labels ------ diff --git a/docs/bugs_by_version.json b/docs/bugs_by_version.json index 4c976a32..32f305c8 100644 --- a/docs/bugs_by_version.json +++ b/docs/bugs_by_version.json @@ -422,6 +422,10 @@ "bugs": [], "released": "2018-03-07" }, + "0.4.22": { + "bugs": [], + "released": "2018-04-16" + }, "0.4.3": { "bugs": [ "ZeroFunctionSelector", diff --git a/docs/contracts.rst b/docs/contracts.rst index dfd2e8a6..a1f2895c 100644 --- a/docs/contracts.rst +++ b/docs/contracts.rst @@ -40,7 +40,7 @@ This means that cyclic creation dependencies are impossible. :: - pragma solidity >0.4.21; + pragma solidity ^0.4.22; contract OwnedToken { // TokenCreator is a contract type that is defined below. @@ -989,7 +989,7 @@ default constructor: ``contructor() public {}``. :: - pragma solidity >0.4.21; + pragma solidity ^0.4.22; contract A { uint public a; diff --git a/docs/types.rst b/docs/types.rst index be8afe48..5c20dc67 100644 --- a/docs/types.rst +++ b/docs/types.rst @@ -179,8 +179,8 @@ All three functions ``call``, ``delegatecall`` and ``callcode`` are very low-lev The ``.gas()`` option is available on all three methods, while the ``.value()`` option is not supported for ``delegatecall``. .. note:: - All contracts inherit the members of address, so it is possible to query the balance of the - current contract using ``this.balance``. + All contracts can be converted to ``address`` type, so it is possible to query the balance of the + current contract using ``address(this).balance``. .. note:: The use of ``callcode`` is discouraged and will be removed in the future. |