Skip to content

Instantly share code, notes, and snippets.

@stella3d
Created July 11, 2023 18:26
Show Gist options
  • Save stella3d/438f78f50fb0fd0e89da50aaf93a0612 to your computer and use it in GitHub Desktop.
Save stella3d/438f78f50fb0fd0e89da50aaf93a0612 to your computer and use it in GitHub Desktop.
Solidity Datatypes List

value types and reference types don't need to be referred to as such in the UI.

We might want to support a backup UI that allows inputting encoded constructor args in cases where a constructor argument is a struct, as that makes the UI more complicated.

Value Types

  • uint

    • default is uint256, and can be specified in intervals of 8 like uint8, uint16, etc.
    • uint256 matches regex ^\d{0,79}$
  • int

    • default is int256, and can be specified in intervals of 8 like int8, int16, etc.
    • int256 matches regex ^-?\d{0,78}$
  • address

    • matches regex ^(0x)?[a-fA-F0-9]{40}$
  • bytes

    • matches regex ^(0x)?[a-fA-F0-9]*$
  • boolean

    • only true or false

Reference Types

these types are combinations or arrays of value types: please see this article for more information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment