Deploy a Delegation Using the Delegation Factory
An entire Delegation can be deployed using the Delegation Factory in a single transaction. You can use the Delegation Factory on the EthereansOS platform here (link coming soon).
The Delegation Factory, which is a custom Factory, allows you to clone (via the deploy
function) your Delegation, link Components and initialize everything at once.
A Delegation is cloned with the following Components:
Proposal Manager
Treasury Manager
Delegation Token Manager
Deploy the Delegation
The deploy method of the Factory takes as input the deployData
parameter:
The deployData
is the encoded value of the OrganizationDeployData
struct composed as follows:
string
uri
-> this uri parameter contains the Delegation's metadata. The Delegation contract implements theDynamicMetadataCapableElement
, so that you can set a traditional or a dynamic uri (see here to learn more).bytes[]
mandatoryComponentsDeployData
-> thisinit
data is used to initialize the Proposal Manager, Treasury Manager, and Delegation Tokens Manager that are mandatory Components of the Delegation.uint256[]
additionalComponents
-> this is an index of the additional Components that you want to link to the Delegation. Look below to find the Component indices.bytes[]
additionalComponentsDeployData
-> this init data is used to initialize the additional chosen Components. Each position in the bytes array corresponds to the sequentially equivalent position in theadditionalComponents
array.bytes[]
specialComponentsData
-> pass empty.bytes
specificOrganizationData
-> pass empty.
Propose to Attach
The proposeToAttach function can be used, after the Delegation deployment, to attach it to a Delegations Manager.
This function can be called only by the address that called the deploy function to deploy the Delegation.
The function takes as input:
address delegationAddress -> address of the Delegation to attach.
address delegationsManagerAddres -> address of the Delegations Manager to which the Delegation is going to be attached.
How to Pass the deployData
deployData
The deployData
to pass is composed as follows:
Use this example pattern to create your own deployData
.
Last updated