Nexera-FiFactories

OrchestratorFactory

Git Source

Extends: Ownable

The OrchestratorFactory is utilized to deploy and configure instances of the Orchestrator implementation contract within a single transaction.

Events

OrchestratorDeployed

Emitted when a new Orchestrator owned by owner is deployed at orchestrator address.

event OrchestratorDeployed(address orchestrator, address owner);

State Variables

orchestratorImplementation

Holds the address of the Orchestrator implementation contract.

address public orchestratorImplementation;

executor

Holds the address of the default executor.

address public executor;

Functions

setOrchestratorImplementation

Sets the address of the Orchestrator implementation contract.

Only callable by the owner of this contract.

function setOrchestratorImplementation(address _orchestratorImplementation) external onlyOwner;

Parameters

NameTypeDescription
_orchestratorImplementationaddressThe address to set as the Orchestrator implementation contract

setExecutor

Sets the address of the default executor.

Only callable by the owner of this contract.

function setExecutor(address _executor) external onlyOwner;

Parameters

NameTypeDescription
_executoraddressThe address to set as the default executor

deployOrchestrator

Deploys, initializes and configures a minimal proxy of the Orchestrator implementation contract.

Notes:

  • Uses OZ Clones Library's clone function for deployment
  • Configures the deployed instance by setting the default executor, and the provided whitelisted adapters and tokens
  • Transfers ownership of the deployed instance to the caller of this function

Emitts an OrchestratorDeployed event.

function deployOrchestrator(
    address[] calldata whitelistedAdapters,
    address[] calldata whitelistedTokens
) external returns (address);

Parameters

NameTypeDescription
whitelistedAdaptersaddress[]An array of Adapters' addresses to be whitelisted in the deployed instance
whitelistedTokensaddress[]An array of tokens' addresses to be whitelisted in the deployed instance

Returns

NameTypeDescription
<none>addressThe address of the deployed Orchestrator instance

On this page