Global Variable Chart
Sr.No. Global Variable Description
1 blockhash(uint blockNumber) returns (bytes32) Hash of the given block - only works for 256 most recent, excluding current, blocks
2block.coinbase (address payable)Current block miner's address.
3block.difficulty (uint)current block difficulty.
4block.gaslimit (uint)Current block gaslimit.
5block.number (uint)Current block number.
6block.timestampCurrent block timestamp as seconds since unix epoch.
7gasleft() returns (uint256)Remaining gas.
8msg.data (bytes calldata)Complete calldata.
9msg.sender (address payable)Sender of the message (current call).
10msg.sig (bytes4)First four bytes of the calldata (i.e. function identifier)
11msg.value (uint)Number of wei sent with the message.
12now (uint)Current block timestamp (alias for block.timestamp).
13tx.gasprice (uint)Gas price of the transaction.
14tx.origin (address payable)Sender of the transaction (full call chain).
Question / Answer

  • Declare a Struct Inside a Contract
  • Declare a Struct outside a Contract qith Import Access
Bibliography/References
  • None