How subDAOs Work
Last updated
Last updated
The subDAO
contract implements the Organization
contract, and its address is represented by the location
parameter of a SubDAOEntry
struct of the subDAO Manager. As a type of organization, a subDAO is a factory-capable contract that follows the initialization modes below.
Write permissions within the subDAO follow the pattern explained here. As mentioned elsewhere, only active components linked to the subDAO (such as the subDAO Proposal Manager) and the host write on other components of the organization, and on the subDAO, as authorizedOnly
. The host of a subDAO is a SubDAO Manager which host is in turn the Root layer.
A subDAO can handle two types of Proposals:
Surveyless Proposals
Surveyless Proposals allow users to vote for a specific option among those provided by the Proposal.
For example, a surveyless Proposal to change the inflation rate of the governance token contains multiple options such as 1%, 4%, 8%, or 10%. Users can choose, by voting, the option to be used.
Survey Proposals
Survey Proposals allow users to propose and vote options of a well-defined Proposal; they don't present preset options to choose on.
Taking the same example as before, a survey Proposal to change the inflation rate of the governance token allows users to propose values to be voted. A user can propose 1%, another one can propose 3%, and then users can choose, by voting, the option to be used.
Both Surveyless and Survey Proposals automatically execute code without having any kind of action from the team or anyone else.
A subDAO contract is initialized with the following data:
bool
_initToBeFinalized
-> represents if the subDAO has to be finalized later(true) or not (false). Look below for more information.
presetArrayMaxSize
-> this is the maximum number of voting options that can be included in a survey (a maximum of 8 is recommended).
lazyInitResponse -> look below.
and:
models
-> Model Proposals that can possibly be created and voted on using the subDAO at hand.
lazyInitResponse can contain:
Component[]
-> in the initialization can also be passed multiple Component struct to directly link Components to the subDAO if needed.
The _initToBeFinalized
parameter is set at the time of subDAO Initialization. If set as false, a host address must be passed. If set as true, a host can be set later.
According to our approach, subDAOs should be hosted by a subDAO Manager. This means that when you create and initialize a subDAO, you can either:
set _initToBeFinalized
as false; and set the subDAO host as the subDAO Manager contract address
set _initToBeFinalized
as true; and don't set the subDAO host, passing it as address(0)
The second option is useful if you create a subDAO, but the subDAO Manager to which you would like it linked is not yet deployed. You configure the subDAO so that when the subDAO Manager is deployed, the initialization can be finalized and the host set as the subDAO Manager address, at which point _initToBeFinalized
is automatically set as false.
The finalization of the initialization is performed using the finalizeInit
function.
When linking a new subDAO to the subDAO Manager (using the set function), the subDAO Manager automatically calls the finalizeInit
function of the subDAO if the subDAO host is address(0)
and _initToBeFinalized
is true.
Once the host is set and _initToBeFinalized
is false, finalizeInit
can no longer be called.
Contract Name
GitHub
Deployed Contract Address
Contract Implemented
Initialization data
SubDAO
coming soon
coming soon
ISubDAO
, Organization
_initToBeFinalized
, presetArrayMaxSize
, models
, Components
and Organization
init data.