The Knowledge Base #1 is composed of the following:
Grimoire Library
The Grimoire contains some of the Component keys that are stored in the organization's database:
bytes32 constant public COMPONENT_KEY_TREASURY_MANAGER = 0xcfe1633df53a0649d88d788961f26058c5e7a0b5644675f19f67bb2975827ba2;
bytes32 constant public COMPONENT_KEY_STATE_MANAGER = 0xd1d09e8f5708558865b8acd5f13c69781ae600e42dbc7f52b8ef1b9e33dbcd36;
bytes32 constant public COMPONENT_KEY_MICROSERVICES_MANAGER = 0x0aef4c8f864010d3e1817691f51ade95a646fffafd7f3df9cb8200def342cfd7;
bytes32 constant public COMPONENT_KEY_PROPOSALS_MANAGER = 0xa504406933af7ca120d20b97dfc79ea9788beb3c4d3ac1ff9a2c292b2c28e0cc;
Getters & Setters
These contain the syntactic sugar required to give the organization its concrete shape at the state of art.
The Getters contain the functions for automatic retrieval of the component addresses (which have their keys saved in the Grimoire) to make calls like "organization.stateManager()", which obtains the StateManager address, rather than passing the key that corresponds to the StateManager.
function treasuryManager(IOrganization organization) internal view returns(ITreasuryManager) {
return ITreasuryManager(organization.get(Grimoire.COMPONENT_KEY_TREASURY_MANAGER));
}
function stateManager(IOrganization organization) internal view returns(IStateManager) {
return IStateManager(organization.get(Grimoire.COMPONENT_KEY_STATE_MANAGER));
}
function microservicesManager(IOrganization organization) internal view returns(IMicroservicesManager) {
return IMicroservicesManager(organization.get(Grimoire.COMPONENT_KEY_MICROSERVICES_MANAGER));
}
function proposalsManager(IOrganization organization) internal view returns(IProposalsManager) {
return IProposalsManager(organization.get(Grimoire.COMPONENT_KEY_PROPOSALS_MANAGER));
}
The Setters contain utility code that can be used in a Proposal to change a specific component; i.e, can be used to make calls like "organization.changeProposalsManager(address)", which sets a new Proposals Manager.
The treasury contains functions that the Treasury Manager provides to the Organization's other active Components for them to conduct financial transactions. For example, if someone calls a microservice and sends it money the MicroservicesManager tells the Organization "save this money", and the Organization calls the Treasury Manager's storeETH method.
The Statecontains utility functions usefull to retrieve saved information in the State Manager, and to easily interact with it (which is totally var-type-agnostic). You can code your own State library with your needed type. We provide the following: