aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-02-09 23:31:03 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-02-10 21:29:17 +0800
commit7f726de1cb861f4c7cb4e89e4ec56cd5712d0855 (patch)
treef03fc39d9b6d0b740a941d534d043063591446be /docs
parent8429c03f2ab81ad5fe077df6f69f6dbe88609779 (diff)
downloaddexon-solidity-7f726de1cb861f4c7cb4e89e4ec56cd5712d0855.tar
dexon-solidity-7f726de1cb861f4c7cb4e89e4ec56cd5712d0855.tar.gz
dexon-solidity-7f726de1cb861f4c7cb4e89e4ec56cd5712d0855.tar.bz2
dexon-solidity-7f726de1cb861f4c7cb4e89e4ec56cd5712d0855.tar.lz
dexon-solidity-7f726de1cb861f4c7cb4e89e4ec56cd5712d0855.tar.xz
dexon-solidity-7f726de1cb861f4c7cb4e89e4ec56cd5712d0855.tar.zst
dexon-solidity-7f726de1cb861f4c7cb4e89e4ec56cd5712d0855.zip
Document assert()
Diffstat (limited to 'docs')
-rw-r--r--docs/miscellaneous.rst3
-rw-r--r--docs/units-and-global-variables.rst4
2 files changed, 5 insertions, 2 deletions
diff --git a/docs/miscellaneous.rst b/docs/miscellaneous.rst
index 47650067..27289daf 100644
--- a/docs/miscellaneous.rst
+++ b/docs/miscellaneous.rst
@@ -435,7 +435,7 @@ The following is the order of precedence for operators, listed in order of evalu
| *16* | Comma operator | ``,`` |
+------------+-------------------------------------+--------------------------------------------+
-.. index:: block, coinbase, difficulty, number, block;number, timestamp, block;timestamp, msg, data, gas, sender, value, now, gas price, origin, keccak256, ripemd160, sha256, ecrecover, addmod, mulmod, cryptography, this, super, selfdestruct, balance, send
+.. index:: block, coinbase, difficulty, number, block;number, timestamp, block;timestamp, msg, data, gas, sender, value, now, gas price, origin, assert, keccak256, ripemd160, sha256, ecrecover, addmod, mulmod, cryptography, this, super, selfdestruct, balance, send
Global Variables
================
@@ -460,6 +460,7 @@ Global Variables
- ``ecrecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) returns (address)``: recover address associated with the public key from elliptic curve signature, return zero on error
- ``addmod(uint x, uint y, uint k) returns (uint)``: compute ``(x + y) % k`` where the addition is performed with arbitrary precision and does not wrap around at ``2**256``
- ``mulmod(uint x, uint y, uint k) returns (uint)``: compute ``(x * y) % k`` where the multiplication is performed with arbitrary precision and does not wrap around at ``2**256``
+- ``assert(bool condition)``: throws if the condition is not met
- ``this`` (current contract's type): the current contract, explicitly convertible to ``address``
- ``super``: the contract one level higher in the inheritance hierarchy
- ``selfdestruct(address recipient)``: destroy the current contract, sending its funds to the given address
diff --git a/docs/units-and-global-variables.rst b/docs/units-and-global-variables.rst
index dd3d4be8..a6f6613f 100644
--- a/docs/units-and-global-variables.rst
+++ b/docs/units-and-global-variables.rst
@@ -79,11 +79,13 @@ Block and Transaction Properties
You can only access the hashes of the most recent 256 blocks, all other
values will be zero.
-.. index:: keccak256, ripemd160, sha256, ecrecover, addmod, mulmod, cryptography, this, super, selfdestruct, balance, send
+.. index:: assert, keccak256, ripemd160, sha256, ecrecover, addmod, mulmod, cryptography, this, super, selfdestruct, balance, send
Mathematical and Cryptographic Functions
----------------------------------------
+``assert(bool condition)``:
+ throws if the condition is not met.
``addmod(uint x, uint y, uint k) returns (uint)``:
compute ``(x + y) % k`` where the addition is performed with arbitrary precision and does not wrap around at ``2**256``.
``mulmod(uint x, uint y, uint k) returns (uint)``: