0

Here is my structure

struct userDetails{
  address wallAdd;
  uint32 isUser;
  uint32 isAdmin;
 }

I have to map records where isUser =1 only;

Ravikant
  • 5
  • 3
  • Can you explain with an example what's the purpose? – Ismael Sep 22 '21 at 02:46
  • In my struct I have to filter only those records which are users and then I will send some rewards to them – Ravikant Sep 22 '21 at 08:15
  • A mapping alone won't work for that, since they can't be iterated, having an index to the entries should help with that. – Ismael Sep 22 '21 at 14:37
  • Can you modify and post some code? – Ravikant Sep 22 '21 at 14:40
  • The first answer from this question https://ethereum.stackexchange.com/questions/13167/are-there-well-solved-and-simple-storage-patterns-for-solidity, has an example of mapping with index. – Ismael Sep 22 '21 at 16:32

0 Answers0