aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-03-06 03:11:37 +0800
committerGitHub <noreply@github.com>2018-03-06 03:11:37 +0800
commit3793aa405b9326c7269ed001344d721ae05629e8 (patch)
tree2657e731bf0f2a6c608ffefcdb3d5731b3e77fe0 /docs
parentf190b274313131bbc939815a00d49dcd2c3de10d (diff)
parent2213f9946b34a6e8f5604a6b821d31788dcee08b (diff)
downloaddexon-solidity-3793aa405b9326c7269ed001344d721ae05629e8.tar
dexon-solidity-3793aa405b9326c7269ed001344d721ae05629e8.tar.gz
dexon-solidity-3793aa405b9326c7269ed001344d721ae05629e8.tar.bz2
dexon-solidity-3793aa405b9326c7269ed001344d721ae05629e8.tar.lz
dexon-solidity-3793aa405b9326c7269ed001344d721ae05629e8.tar.xz
dexon-solidity-3793aa405b9326c7269ed001344d721ae05629e8.tar.zst
dexon-solidity-3793aa405b9326c7269ed001344d721ae05629e8.zip
Merge pull request #3643 from ethereum/gasleft
Move msg.gas to global function gasleft(). Closes #2971.
Diffstat (limited to 'docs')
-rw-r--r--docs/contracts.rst2
-rw-r--r--docs/miscellaneous.rst3
-rw-r--r--docs/units-and-global-variables.rst3
3 files changed, 5 insertions, 3 deletions
diff --git a/docs/contracts.rst b/docs/contracts.rst
index 12b785d5..e61667dd 100644
--- a/docs/contracts.rst
+++ b/docs/contracts.rst
@@ -402,7 +402,7 @@ State variables can be declared as ``constant``. In this case, they have to be
assigned from an expression which is a constant at compile time. Any expression
that accesses storage, blockchain data (e.g. ``now``, ``this.balance`` or
``block.number``) or
-execution data (``msg.gas``) or make calls to external contracts are disallowed. Expressions
+execution data (``msg.value`` or ``gasleft()``) or make calls to external contracts are disallowed. Expressions
that might have a side-effect on memory allocation are allowed, but those that
might have a side-effect on other memory objects are not. The built-in functions
``keccak256``, ``sha256``, ``ripemd160``, ``ecrecover``, ``addmod`` and ``mulmod``
diff --git a/docs/miscellaneous.rst b/docs/miscellaneous.rst
index 70ed6201..7d3d058b 100644
--- a/docs/miscellaneous.rst
+++ b/docs/miscellaneous.rst
@@ -315,8 +315,9 @@ Global Variables
- ``block.gaslimit`` (``uint``): current block gaslimit
- ``block.number`` (``uint``): current block number
- ``block.timestamp`` (``uint``): current block timestamp
+- ``gasleft() returns (uint256)``: remaining gas
- ``msg.data`` (``bytes``): complete calldata
-- ``msg.gas`` (``uint``): remaining gas
+- ``msg.gas`` (``uint``): remaining gas - deprecated in version 0.4.21 and to be replaced by ``gasleft()``
- ``msg.sender`` (``address``): sender of the message (current call)
- ``msg.value`` (``uint``): number of wei sent with the message
- ``now`` (``uint``): current block timestamp (alias for ``block.timestamp``)
diff --git a/docs/units-and-global-variables.rst b/docs/units-and-global-variables.rst
index cc4d4446..1b58b1e8 100644
--- a/docs/units-and-global-variables.rst
+++ b/docs/units-and-global-variables.rst
@@ -58,8 +58,9 @@ Block and Transaction Properties
- ``block.gaslimit`` (``uint``): current block gaslimit
- ``block.number`` (``uint``): current block number
- ``block.timestamp`` (``uint``): current block timestamp as seconds since unix epoch
+- ``gasleft() returns (uint256)``: remaining gas
- ``msg.data`` (``bytes``): complete calldata
-- ``msg.gas`` (``uint``): remaining gas
+- ``msg.gas`` (``uint``): remaining gas - deprecated in version 0.4.21 and to be replaced by ``gasleft()``
- ``msg.sender`` (``address``): sender of the message (current call)
- ``msg.sig`` (``bytes4``): first four bytes of the calldata (i.e. function identifier)
- ``msg.value`` (``uint``): number of wei sent with the message