Local and State Variables, Scopes and Declarations Flashcards

1
Q

state vaiables

A

reside on the blockchain

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

local variables

A

only used when contracts are executed, don’t reside on the blockchain

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

assignment of state vaiables to local variables are

A

copies for elementary. types (static types that fit into 32 bytes)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly