Skip to content

Latest commit

 

History

History
25 lines (19 loc) · 1.05 KB

Default Values.md

File metadata and controls

25 lines (19 loc) · 1.05 KB

A variable which is declared will have an initial default value whose byte-representation is all zeros.

The “default values” of variables are the typical “zero-state” of whatever the type is.

For example, the default value for a bool is false. The default value for the uint or int types is 0.

  • For statically-sized arrays and bytes1 to bytes32, each individual element will be initialized to the default value corresponding to its type.

  • For dynamically-sized arrays, bytes and string string , the default value is an empty array or string. For the enum type, the default value is its first member.


Slide Screenshot

039.jpg


Slide Deck

  • Variable: Declared, Not Initialized
  • Default: Zero-state of Type
  • Boolean: False, Integer: 0, Address 0, Enum: First Member
  • Security: Important
  • E.g. Address: Burn

References