subDAO Manager
Contract Name
GitHub
Deployed Contract Address
Contract Implemented
Initialization data
SubDAOManager
coming soon
coming soon
ISubDAOManager, LazyInitCapableElement
SubDAOEntry and LazyInitCapableElement init dataโ€‹

SubDAO Hosting Scheme

To have and manage one or more subDAOs, and thereby support the extra governance infrastructure they provide, a Root Layer requires a subDAO Manager component.The hosting scheme is composed as follows:
  • The subDAO Manager's host address, which is the Organization to which the subDAO Manager is linked
  • The host of all linked subDAOs; i.e the subDAO Manager itself
Both the subDAO Manager and all subDAOs are lazyInitCapableElement contracts, and thus each has a host parameter.The Organization to which the subDAOManager is linked, by interacting with the subDAO Manager itself, can link and un-link subDAOs according to the Root governance logic.

How a subDAO Is Represented

Each subDAO is represented by a SubDAOEntry struct, composed of the following parameters:
  • key -> this is a fixed, immutable and user-defined key (which is in bytes32 format) that serves as a reference for the subDAO in the subDAO Manager.
  • location -> this is the smart contract address of the subDAO; a subDAO must be a smart contract, not just a simple wallet address, and so the location must be a contract address.
  • address newHost -> this parameter is used only when replacing a subDAO. It represents the new host address of the replaced subDAO.
The subDAOEntry struct is provided by the ISubDAOsManager interface contract.The subDAO Manager allows a Root Layer to:
  • Keep track of all managed subDAOs. For example, to access a subDAO, you pass its key in the subDAO Manager, which returns the subDAO's address.
  • Add subDAOs.
  • Change the subDAO that corresponds to a specific key, so that the subDAO changes, but the key remains the same.
  • Remove subDAOs.
  • Return the history list of all subDAOs, organized by key. For example, if there have been five versions of a subDAO, passing the key that it corresponds or* did correspond to returns the history of the key; i.e, a list of the addresses of all versions of the subDAO.

SubDAOManager Initialization

The subDAOManager contract is initialized with the following data:
1
function _lazyInit(bytes memory lazyInitData) override internal virtual returns(bytes memory) {
2
if(lazyInitData.length > 0) {
3
SubDAOEntry[] memory subDaos = abi.decode(lazyInitData, (SubDAOEntry[]));
4
for(uint256 i = 0; i < subDaos.length; i++) {
5
_set(subDaos[i]);
6
}
7
}
8
return "";
9
}
Copied!
  • SubDAOEntry[] subDaos -> you can link multiple subDAOs passing multiple subDAOEntry structs.