For block and transaction-related information, only two globally available functions are available:
- blockhash(uint blockNumber) returns (bytes32): This provides the hash of the given block number as bytes32. This function will only work for the most recent 256 blocks, excluding the current block. Hence, use this function carefully.
- gasleft() returns (uint256): This provides the remaining gas left in the transaction as a uint256 value.