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
beacon_
IInverterBeacon_v1
The address of the {IInverterBeacon_v1} containing the {Orchestrator_v1} implementation.
createOrchestrator
Creates a new {Orchestrator_v1}.
Parameters
workflowConfig
WorkflowConfig
The workflow's config data.
fundingManagerConfig
ModuleConfig
The config data for the orchestrator's {IFundingManager_v1} instance.
paymentProcessorConfig
ModuleConfig
The config data for the orchestrator's {IPaymentProcessor_v1} instance.
moduleConfigs
ModuleConfig[]
Variable length set of optional module's config data.
Returns
<none>
IOrchestrator_v1
CreatedOrchestrator Returns the created orchestrator instance
getOrchestratorByID
Returns the {IOrchestrator_v1} address that corresponds to the given id.
Parameters
id
uint256
The requested orchestrator's id.
Returns
getOrchestratorIDCounter
Returns the counter of the current {Orchestrator_v1} id.
Returns
_createModuleProxies
Creates the modules based on their `moduleConfigs`.
Parameters
moduleConfigs
ModuleConfig[]
The config data of the modules that will be created with this function call.
orchestratorProxy
address
The address of the {Orchestrator_v1} Proxy that will be linked to the modules.
workflowConfig
WorkflowConfig
The workflow's config data.
_initModules
Internal function to initialize the modules.
Parameters
modules
address[]
The modules to initialize.
moduleConfigs
ModuleConfig[]
The config data of the modules that will be initialized.
_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