mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Move msg.gas to global function gasleft(). Closes #2971.
This commit is contained in:
+1
-1
@@ -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 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``
|
||||
|
||||
@@ -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``)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user