The Knowledge Base #2 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_SPLITTER_MANAGER = 0x87a92f6bd20613c184485be8eadb46851dd4294a8359f902606085b8be6e7ae6;
bytes32 constant public COMPONENT_KEY_SUBDAOS_MANAGER = 0x5b87d6e94145c2e242653a71b7d439a3638a93c3f0d32e1ea876f9fb1feb53e2;
bytes32 constant public COMPONENT_KEY_DELEGATIONS_MANAGER = 0x49b87f4ee20613c184485be8eadb46851dd4294a8359f902606085b8be6e7ae6;
bytes32 constant public COMPONENT_KEY_INVESTMENTS_MANAGER = 0x4f3ad97a91794a00945c0ead3983f793d34044c6300048d8b4ef95636edd234b;
Delegations Grimoire Library
The Delegations Grimoire contains the Tokens Manager Component key that is stored in the organization's database:
bytes32 constant public COMPONENT_KEY_TOKENS_MANAGER = 0x62b56c3ab20613c184485be8eadb46851dd4294a8359f902606085b8be9f7dc5;
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.subDAOsManager()", which obtains the SubDAOManager address, rather than passing the key that corresponds to the SubDAOManager.
function treasurySplitterManager(IOrganization organization) internal view returns(ITreasurySplitterManager) {
return ITreasurySplitterManager(organization.get(Grimoire.COMPONENT_KEY_TREASURY_SPLITTER_MANAGER));
}
function subDAOsManager(IOrganization organization) internal view returns(ISubDAOsManager) {
return ISubDAOsManager(organization.get(Grimoire.COMPONENT_KEY_SUBDAOS_MANAGER));
}
function delegationsManager(IOrganization organization) internal view returns(IDelegationsManager) {
return IDelegationsManager(organization.get(Grimoire.COMPONENT_KEY_DELEGATIONS_MANAGER));
}
function investmentsManager(IOrganization organization) internal view returns(IInvestmentsManager) {
return IInvestmentsManager(organization.get(Grimoire.COMPONENT_KEY_INVESTMENTS_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.replaceTreasurySplitterManager(address)", which sets a new Treasury Splitter Manager.
It contains a specific getter to retrieve a Delegation Tokens Manager Component.
function tokensManager(IOrganization organization) internal view returns(IDelegationTokensManager) {
return IDelegationTokensManager(organization.get(DelegationGrimoire.COMPONENT_KEY_TOKENS_MANAGER));
}
Delegation Utilities
It contains the extractVotingTokens function. It is a fundamental utility function used by Delegations Proposals to be able to automatically retrieve the token that must be used to vote a specific Proposal. Remember that a Delegation can be attached to multiple Organizations at the same time and each Proposal must be voted using the Delegation token corresponding to the Proposal of the organization being voted on. Look here for more info.