OrchestratorFactory_v1.sol

Git Sourcearrow-up-right

Inherits: IOrchestratorFactory_v1, ERC2771ContextUpgradeablearrow-up-right, Ownable2StepUpgradeablearrow-up-right, ERC165Upgradeablearrow-up-right

Author: Inverter Network

OrchestratorFactory_v1 facilitates the deployment of {Orchestrator_v1}arrow-up-rights and their associated modules for the Inverter Network, ensuring seamless creation and configuration of various components in a single transaction.

Utilizes {ERC2771ContextUpgradeable}arrow-up-right for meta-transaction capabilities and {ERC165Upgradeable}arrow-up-right for interface detection. {Orchestrator_v1}arrow-up-rights 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}arrow-up-right {IInverterBeacon_v1}arrow-up-right address.

IInverterBeacon_v1 public override beacon;

moduleFactory

Returns the {IModuleFactory_v1}arrow-up-right implementation address.

address public override moduleFactory;

_orchestrators

Maps the id to the {Orchestrator_v1}arrow-up-rights.

mapping(uint => address) private _orchestrators;

_orchestratorIdCounter

The counter of the current {Orchestrator_v1}arrow-up-right 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}arrow-up-right.

validOrchestratorId

Modifier to guarantee that the given id is valid.

constructor

init

The factories initializer function.

Parameters

Name
Type
Description

governor_

address

The address of the {Governor_v1}arrow-up-right contract.

beacon_

IInverterBeacon_v1

The address of the {IInverterBeacon_v1}arrow-up-right containing the {Orchestrator_v1}arrow-up-right implementation.

moduleFactory_

address

The address of the {ModuleFactory_v1}arrow-up-right contract.

createOrchestrator

Creates a new {Orchestrator_v1}arrow-up-right.

Parameters

Name
Type
Description

workflowConfig

WorkflowConfig

The workflow's config data.

fundingManagerConfig

ModuleConfig

The config data for the orchestrator's {IFundingManager_v1} instance.

authorizerConfig

ModuleConfig

The config data for the {Orchestrator_v1}arrow-up-right's {IAuthorizer_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

Name
Type
Description

<none>

IOrchestrator_v1

CreatedOrchestrator Returns the created orchestrator instance

getOrchestratorByID

Returns the {IOrchestrator_v1}arrow-up-right address that corresponds to the given id.

Parameters

Name
Type
Description

id

uint256

The requested orchestrator's id.

Returns

Name
Type
Description

<none>

address

orchestratorAddress The address of the corresponding {Orchestrator_v1}arrow-up-right.

getOrchestratorIDCounter

Returns the counter of the current {Orchestrator_v1}arrow-up-right id.

Returns

Name
Type
Description

<none>

uint256

id The id of the next created {Orchestrator_v1}arrow-up-right.

_createModuleProxies

Creates the modules based on their `moduleConfigs`.

Parameters

Name
Type
Description

moduleConfigs

ModuleConfig[]

The config data of the modules that will be created with this function call.

orchestratorProxy

address

The address of the {Orchestrator_v1}arrow-up-right Proxy that will be linked to the modules.

workflowConfig

WorkflowConfig

The workflow's config data.

_initModules

Internal function to initialize the modules.

Parameters

Name
Type
Description

modules

address[]

The modules to initialize.

moduleConfigs

ModuleConfig[]

The config data of the modules that will be initialized.

proxy

address

The address of the {Orchestrator_v1}arrow-up-right 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