Local and State Variables, Scopes and Declarations Flashcards
1
Q
state vaiables
A
reside on the blockchain
2
Q
local variables
A
only used when contracts are executed, don’t reside on the blockchain
3
Q
assignment of state vaiables to local variables are
A
copies for elementary. types (static types that fit into 32 bytes)
4
Q
references for structs or arrays
A
2nd assignment to the local variable only changes the reference and doesn’t modify the state variable
assignments to members of the local vaiable do change the state
5
Q
a declared variable has an initial default value of zero
A
statically sized arrays will be populated with zeros
dynamically-sized arrays, bytes and string, the. default value is an empty array or string