I'm looking solidity help in storing a set of strings and checking for membership in that set. I have a concrete and an abstract question on that:
Concrete
What is the data structure in solidity that gives me a (potentially append-only) set that I can interrogate for membership? eg, I am looking specifically for something like:
myset = ["a", "b", "c"] # registers my set on-chain
"d" in myset # return True or False
Further, are there better or worse ways of using this data structure without a lot of data duplication?
Does the answer change if myset
is a million members long?
Abstract
How is such a thing implemented under the hood? Read access testing for membership seems possible, but since chains are immutable, how would such a list be practically updated?