Mappings and Solidity Contract Flashcards

1
Q

mapping(_KeyType => _ValueType)

A

defines a way to assign values to keys. Similar to arrays, but keys can be any. type and do not have a predefined range. Very flexible

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

_KeyType

A

can be almost any type except for a mapping, a dynamically sized array, a contract, an enum and a struct

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

_ValueType

A

can actually be any. type, including mappings

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

Contract

A

a collection of codes (fuctions) and data (states) located at a specific address on the Etherum blockchain

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

Contract is similar to

A

a class in object-oriented language

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