Solidity Global Variables

block methods:

  • block.coinbase
  • block.difficulty
  • block.gaslimit
  • block.number
  • block.timestamp
  • block.blockhash(uint blockNumber)

msg methods:

  • msg.data
  • msg.gas
  • msg.sender: immediate account that invoked the function
  • msg.sig
  • msg.value

tx methods:

  • tx.gasprice
  • tx.origin: external account that initiated the tx

contract methods:

  • contract.this
  • contract.selfdestruct
  • contract.suicide

address methods:

  • address.balance
  • address.transfer(): uint wei
  • address.send(): uint wei
  • address.call(): bytes4(sha3(“<FUNCTION>(params)”))
  • address.callcode()
  • address.delegatecall()

error handling:

  • require(<CONDITION>)
  • assert(<CONDITION>)
  • revert()

Others:

  • now
  • sha3 = keccak256()
  • sha2 = sha256()

How useful was this post?

Click on a star to rate it!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Leave a Reply