Prepare for the Blockchain Developer Certification. Master blockchain concepts with flashcards and multiple choice questions. Explanation-based learning for your success!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


What type of variable is stored in the EVM Stack?

  1. Function arguments

  2. State variables

  3. Local variables of non-reference types

  4. Perpetual state data

The correct answer is: Local variables of non-reference types

The Ethereum Virtual Machine (EVM) Stack is designed to hold local variables and temporary data needed during contract execution. Local variables, particularly of non-reference types, are used for intermediate computations, function parameters, and for keeping track of state within the scope of a function. These variables are placed on the stack for efficient access and manipulation as they have a limited lifetime and relevance during the execution of a specific function call. Local variables of non-reference types include primitive data structures such as integers or booleans, which are directly stored in the stack. This contrasts with state variables and other data types which have a longer lifespan and are stored in storage or memory. The stack operates on a last-in-first-out (LIFO) basis, which is ideal for handling these temporary values that don't require persistent storage beyond the current function's execution.