Hi, I’m trying to create mini social network with smart contracts and I need to store data about followers and followings of users. Does anyone know how to organise it in smart contract? It’s imposible with array of addresses, because if I want to unfollow someone I can’t delete it in array searching by address. And I can’t do it with mapping like mapping(address=>mapping(address=>bool)) where bool means follows or not, because I can’t output all the followers
Nov 27, 2017, 5:05 PM
How can I find this element if I don’t know index, and will this array resize itself after deletion?
So if I have array of address I can just find the address needed without index and without going through all array and it will resize with no problems?
delete user[address];
Is this about array or mapping?
Is this about array or mapping?
Once again I understand that the user data will be stored in struct, but where will be the information of followings stored, in array, mapping or smtg else?
Nov 27, 2017, 5:39 PM