Ryder Thacker
Ryder Thacker

Reputation: 1482

what does "=>" mean in solidity?

For example what does this mean? I think it's just syntax for a hashMap but not sure.

address chairperson;
mapping(address => Voter) voters;
Proposal[] proposals;

Upvotes: 0

Views: 505

Answers (1)

Michael Kohl
Michael Kohl

Reputation: 66857

This is what solidity calls mappings. Depending on your programming background you may refer to them as hashes, dictionaries, associative arrays or similar.

This is the general form:

mapping(_KeyType => _ValueType)

So in your case you'll have a variable voters, which maps addresses to Voter instances.

Upvotes: 4

Related Questions