OrchestratorFactory_v1.sol
Inherits: IOrchestratorFactory_v1, ERC2771ContextUpgradeable, Ownable2StepUpgradeable, ERC165Upgradeable
Author: Inverter Network
OrchestratorFactory_v1 facilitates the deployment of {Orchestrator_v1}s and their associated modules for the Inverter Network, ensuring seamless creation and configuration of various components in a single transaction.
Utilizes {ERC2771ContextUpgradeable} for meta-transaction capabilities and {ERC165Upgradeable} for interface detection. {Orchestrator_v1}s are deployed through EIP-1167 minimal proxies for efficiency. Integrates with the module factory to instantiate necessary modules with custom configurations, supporting complex setup with interdependencies among modules.
State Variables
beacon
Returns the {IOrchestrator_v1} {IInverterBeacon_v1} address.
moduleFactory
Returns the {IModuleFactory_v1} implementation address.
_orchestrators
Maps the id
to the {Orchestrator_v1}s.
_orchestratorIdCounter
The counter of the current {Orchestrator_v1} id
.
Starts counting from 1.
_deploymentNonces
Maps a users address to a nonce. Used for the create2-based deployment.
__gap
Storage gap for future upgrades.
Functions
supportsInterface
See {IERC165-supportsInterface}.
validOrchestratorId
Modifier to guarantee that the given id is valid.
constructor
init
The factories initializer function.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the {Governor_v1} contract. |
|
| The address of the {IInverterBeacon_v1} containing the {Orchestrator_v1} implementation. |
|
| The address of the {ModuleFactory_v1} contract. |
createOrchestrator
Creates a new {Orchestrator_v1}.
Parameters
Name | Type | Description |
---|---|---|
|
| The workflow's config data. |
|
| The config data for the orchestrator's {IFundingManager_v1} instance. |
|
| The config data for the {Orchestrator_v1}'s {IAuthorizer_v1} instance. |
|
| The config data for the orchestrator's {IPaymentProcessor_v1} instance. |
|
| Variable length set of optional module's config data. |
Returns
Name | Type | Description |
---|---|---|
|
| CreatedOrchestrator Returns the created orchestrator instance |
getOrchestratorByID
Returns the {IOrchestrator_v1} address that corresponds to the given id.
Parameters
Name | Type | Description |
---|---|---|
|
| The requested orchestrator's id. |
Returns
Name | Type | Description |
---|---|---|
|
| orchestratorAddress The address of the corresponding {Orchestrator_v1}. |
getOrchestratorIDCounter
Returns the counter of the current {Orchestrator_v1} id.
Returns
Name | Type | Description |
---|---|---|
|
| id The id of the next created {Orchestrator_v1}. |
_createModuleProxies
Creates the modules based on their `moduleConfigs`.
Parameters
Name | Type | Description |
---|---|---|
|
| The config data of the modules that will be created with this function call. |
|
| The address of the {Orchestrator_v1} Proxy that will be linked to the modules. |
|
| The workflow's config data. |
_initModules
Internal function to initialize the modules.
Parameters
Name | Type | Description |
---|---|---|
|
| The modules to initialize. |
|
| The config data of the modules that will be initialized. |
|
| The address of the {Orchestrator_v1} Proxy that will be linked to the modules. |
_createSalt
Internal function to generate salt for the create2-based deployment flow. This salt is the hash of (msgSender, nonce), where the nonce is an increasing number for each user.
_msgSender
Needs to be overridden, because they are imported via the Ownable2Step as well.
_msgData
Needs to be overridden, because they are imported via the Ownable2Step as well.
_contextSuffixLength
Last updated