Entities are not required to be initiated
Every entity (Planet, Comet, Operator) has a 3-step creation process:\\nCreation of the proposal.\\nApproval of the proposal.\\nInitiation of the entity.\\nThe last step is crucial, but it is never explicitly checked that the entity is initialized. The initiation always includes the `initiator` modifier that works with the `"initiated"` slot on DATASTORE:\\n```\\nmodifier initiator(\\n DataStoreUtils.DataStore storage DATASTORE,\\n uint256 \\_TYPE,\\n uint256 \\_id,\\n address \\_maintainer\\n) {\\n require(\\n msg.sender == DATASTORE.readAddressForId(\\_id, "CONTROLLER"),\\n "MaintainerUtils: sender NOT CONTROLLER"\\n );\\n require(\\n DATASTORE.readUintForId(\\_id, "TYPE") == \\_TYPE,\\n "MaintainerUtils: id NOT correct TYPE"\\n );\\n require(\\n DATASTORE.readUintForId(\\_id, "initiated") == 0,\\n "MaintainerUtils: already initiated"\\n );\\n\\n DATASTORE.writeAddressForId(\\_id, "maintainer", \\_maintainer);\\n\\n \\_;\\n\\n DATASTORE.writeUintForId(\\_id, "initiated", block.timestamp);\\n\\n emit IdInitiated(\\_id, \\_TYPE);\\n}\\n```\\n\\nBut this slot is never actually checked when the entities are used. While we did not find any profitable attack vector using uninitiated entities, the code will be upgraded, which may allow for possible attack vectors related to this issue.
Make sure the entities are initiated before they are used.
```\\nmodifier initiator(\\n DataStoreUtils.DataStore storage DATASTORE,\\n uint256 \\_TYPE,\\n uint256 \\_id,\\n address \\_maintainer\\n) {\\n require(\\n msg.sender == DATASTORE.readAddressForId(\\_id, "CONTROLLER"),\\n "MaintainerUtils: sender NOT CONTROLLER"\\n );\\n require(\\n DATASTORE.readUintForId(\\_id, "TYPE") == \\_TYPE,\\n "MaintainerUtils: id NOT correct TYPE"\\n );\\n require(\\n DATASTORE.readUintForId(\\_id, "initiated") == 0,\\n "MaintainerUtils: already initiated"\\n );\\n\\n DATASTORE.writeAddressForId(\\_id, "maintainer", \\_maintainer);\\n\\n \\_;\\n\\n DATASTORE.writeUintForId(\\_id, "initiated", block.timestamp);\\n\\n emit IdInitiated(\\_id, \\_TYPE);\\n}\\n```\\n