DEV Community

kevin david cuadros
kevin david cuadros

Posted on

Variables and data types SOLIDITY

VARIABLES

Global variables

  • msg Every transaction is a signed message. In this object comes the data of said message (sender, value, etc.)
  • tx values related to the current transaction
  • block values related to the current block

Local variables

  • They are those that occur during execution. In the EVM it is the part corresponding to volatile memory

State variables

  • They are variables that are stored in the ROM portion of the EVM. It's persistent memory

Image description

DATA TYPES

Integers

  • uint nonnegative (8 - 256 bits)
  • int 8 - (256 bits)

Boolean

  • true
  • false

Address

  • address This type of data represents addresses of ETH (20 bytes)
  • contains methods like .transfer or .balance

String

  • string

Bytes

  • bytes

Top comments (0)