Is it possible to have a mapping where the values are a tuple?
mapping (address => (bool, uint)) participants;
mappingsolidity
Is it possible to have a mapping where the values are a tuple?
mapping (address => (bool, uint)) participants;
Best Answer
If you use a struct, eg
I don't think there's any way of using an actual Tuple eg
var (a, b)
in a mapping since the types ofa
andb
cannot be declared with the syntax available. With a struct the types can be declared, which is necessary to declare the mapping type.