I have a multisig contract where entities (represented by an address) can be activated or deactivated. These are the structures I created to represent an individual entity (_entityIdentity) and the list of entities (_entityStruct)
struct _entityIdentity{
bool _activated;
uint256 _addValidations;
mapping(address => bool) _AddValidated;
uint256 _removeValidations;
mapping(address => bool) _RemoveValidated;
}
struct _entityStruct{
mapping(address => _entityIdentity) _entities;
address[] _activatedEntities;
}
The idea is:
- in order to activate an entity "X" validations are required (from specific owners addresses).
- _AddValidated keeps track of the addresses that have already validated the entity activation
- _addvalidations keeps track of the number of validations received
- When X is reached _activated is set to TRUE
- Same idea for deactivating only using the other properties (_RemoveValidated, _removeValidations)
The problem I have is when I want to remove the entity, I simply do : delete(entity) (entity is of type _entityIdentity), and apparently that would properly set to false the boolean, to 0 the uint256, but the mappings will not be reset to false....
Is there a specific pattern/recommendation to deal with this?