Mention all global aliases

This commit is contained in:
Alex Beregszaszi 2017-07-26 14:44:15 +01:00
parent 04582dd2cb
commit bf10cd6c95
2 changed files with 10 additions and 4 deletions

View File

@ -469,7 +469,7 @@ Global Variables
- ``require(bool condition)``: abort execution and revert state changes if condition is ``false`` (use for malformed input or error in external component)
- ``revert()``: abort execution and revert state changes
- ``keccak256(...) returns (bytes32)``: compute the Ethereum-SHA-3 (Keccak-256) hash of the (tightly packed) arguments
- ``sha3(...) returns (bytes32)``: an alias to `keccak256()`
- ``sha3(...) returns (bytes32)``: an alias to `keccak256`
- ``sha256(...) returns (bytes32)``: compute the SHA-256 hash of the (tightly packed) arguments
- ``ripemd160(...) returns (bytes20)``: compute the RIPEMD-160 hash of the (tightly packed) arguments
- ``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
@ -478,6 +478,7 @@ Global Variables
- ``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
- ``suicide(address recipieint)``: an alias to `selfdestruct``
- ``<address>.balance`` (``uint256``): balance of the :ref:`address` in Wei
- ``<address>.send(uint256 amount) returns (bool)``: send given amount of Wei to :ref:`address`, returns ``false`` on failure
- ``<address>.transfer(uint256 amount)``: send given amount of Wei to :ref:`address`, throws on failure

View File

@ -35,7 +35,9 @@ 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::
function f(uint start, uint daysAfter) {
if (now >= start + daysAfter * 1 days) { ... }
if (now >= start + daysAfter * 1 days) {
// ...
}
}
Special Variables and Functions
@ -103,10 +105,10 @@ Mathematical and Cryptographic Functions
compute ``(x * y) % k`` where the multiplication is performed with arbitrary precision and does not wrap around at ``2**256``.
``keccak256(...) returns (bytes32)``:
compute the Ethereum-SHA-3 (Keccak-256) hash of the (tightly packed) arguments
``sha3(...) returns (bytes32)``:
alias to ``keccak256()``
``sha256(...) returns (bytes32)``:
compute the SHA-256 hash of the (tightly packed) arguments
``sha3(...) returns (bytes32)``:
alias to ``keccak256``
``ripemd160(...) returns (bytes20)``:
compute RIPEMD-160 hash of the (tightly packed) arguments
``ecrecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) returns (address)``:
@ -172,5 +174,8 @@ Contract Related
``selfdestruct(address recipient)``:
destroy the current contract, sending its funds to the given :ref:`address`
``suicide(address recipient``:
alias to ``selfdestruct``
Furthermore, all functions of the current contract are callable directly including the current function.