-
Notifications
You must be signed in to change notification settings - Fork 15
Orchestrator Factory
Rahul Saxena edited this page Aug 8, 2023
·
2 revisions
File: Orchestrator Factory
- The orchestrator factory is an immutable factory used for deploying orchestrator contracts.
- New orchestrator contracts are created using the function
createOrchestrator
which creates and initializes the compulsory and optional inverter modules passed to the function. - The
createOrchestrator
also supports late dependency injection to account for modules that require the deployment of other modules for their own initialization.
modifier validOrchestratorId(uint id)
Modifier to guarantee that the given id is valid (less than or equal to _orchestratorIdCounter
)
function target() external view returns (address);
Returns the {IOrchestrator} target implementation address.
- address: The Orchestrator implementation contract address. Contains the logic for all orchestrator contracts.
function moduleFactory() external view returns (address);
Returns the {IModuleFactory} implementation address.
- address: The address of the
ModuleFactory
that is used to deploy all the inverter modules.
function getOrchestratorByID(uint id) external view returns (address);
Returns the {IOrchestrator} address that corresponds to the given id.
- uint id: The requested orchestrator's id.
- address: Returns the address of the orchestrator contract associated with the supplied id.
function getOrchestratorIDCounter() external view returns (uint);
Returns the counter of the current orchestrator id
- uint: Value of the
_orchestratorIdCounter
variable used to assign IDs to different orchestrator deployments.
function decoder(bytes memory data)
public
pure
returns (bool requirement)
This function should have been an internal function, but is made public to enable the low-level call to abi.decode
from the function _dependencyInjectionRequired
. It is used to decode data of type bytes
in the form of (bool, string[])
and returns the bool.
- bytes data: The dependency data of types
bytes
of a module which contains information about whether a module requires late dependency or not and if yes, a string list of the required modules.
- bool: A boolean representing whether a module requires late dependency or not.
function createOrchestrator(
OrchestratorConfig memory orchestratorConfig,
ModuleConfig memory fundingManagerConfig,
ModuleConfig memory authorizerConfig,
ModuleConfig memory paymentProcessorConfig,
ModuleConfig[] memory moduleConfigs
) external returns (IOrchestrator);
Creates a new orchestrator with the caller being the orchestrator's owner.
-
orchestratorConfig
: The orchestrator's config data. -
fundingManagerConfig
: The config data for orchestrator's {IFundingManager} instance. -
authorizerConfig
: The config data for the orchestrator's {IAuthorizer} instance. -
paymentProcessorConfig
: The config data for the orchestrator's {IPaymentProcessor} instance. -
moduleConfigs
: Variable length set of optional module's config data.
- IOrchestrator: Instance of the {IOrchestrator} contract that is created after calling the
createOrchestrator
function.