IOrchestrator_v1.sol

Git Source

Inherits: IModuleManagerBase_v1

Functions

init

Initialization function.

function init(
    uint orchestratorId,
    address moduleFactory_,
    address[] calldata modules,
    IFundingManager_v1 fundingManager,
    IAuthorizer_v1 authorizer,
    IPaymentProcessor_v1 paymentProcessor,
    IGovernor_v1 governor
) external;

Parameters

NameTypeDescription

orchestratorId

uint256

The id of the {Orchestrator_v1}.

moduleFactory_

address

The address of the module factory.

modules

address[]

The addresses of the modules used in the {Orchestrator_v1}.

fundingManager

IFundingManager_v1

The address of the {IFundingManager_v1} module.

authorizer

IAuthorizer_v1

The address of the {IAuthorizer_v1} module.

paymentProcessor

IPaymentProcessor_v1

The address of the {IPaymentProcessor_v1} module.

governor

IGovernor_v1

The address of the governor contract.

initiateSetAuthorizerWithTimelock

Initiates replacing the current authorizer with _authorizer on a timelock.

Only callable by authorized caller.

function initiateSetAuthorizerWithTimelock(IAuthorizer_v1 authorizer_)
    external;

Parameters

NameTypeDescription

authorizer_

IAuthorizer_v1

The address of the new {IAuthorizer_v1} module.

initiateSetFundingManagerWithTimelock

Initiates replaces the current funding manager with fundingManager_ on a timelock.

Only callable by authorized caller.

function initiateSetFundingManagerWithTimelock(
    IFundingManager_v1 fundingManager_
) external;

Parameters

NameTypeDescription

fundingManager_

IFundingManager_v1

The address of the new {IFundingManager_v1} module.

initiateSetPaymentProcessorWithTimelock

Initiates replaces the current payment processor with paymentProcessor_ on a timelock.

Only callable by authorized caller.

function initiateSetPaymentProcessorWithTimelock(
    IPaymentProcessor_v1 paymentProcessor_
) external;

Parameters

NameTypeDescription

paymentProcessor_

IPaymentProcessor_v1

The address of the new {PaymentProcessor_v1} module.

cancelAuthorizerUpdate

Cancels the replacement of the current authorizer with authorizer_.

Only callable by authorized caller.

function cancelAuthorizerUpdate(IAuthorizer_v1 authorizer_) external;

Parameters

NameTypeDescription

authorizer_

IAuthorizer_v1

The address of the new {IAuthorizer_v1} module, for which the update is canceled.

cancelFundingManagerUpdate

Cancels the replacement of the current funding manager with fundingManager_.

Only callable by authorized caller.

function cancelFundingManagerUpdate(IFundingManager_v1 fundingManager_)
    external;

Parameters

NameTypeDescription

fundingManager_

IFundingManager_v1

The address of the new {IFundingManager_v1} module, for which the update is canceled.

cancelPaymentProcessorUpdate

Cancels the replacement of the current payment processor with paymentProcessor_.

Only callable by authorized caller.

function cancelPaymentProcessorUpdate(IPaymentProcessor_v1 paymentProcessor_)
    external;

Parameters

NameTypeDescription

paymentProcessor_

IPaymentProcessor_v1

The address of the new {IPaymentProcessor_v1} module, for which the update is canceled.

executeSetAuthorizer

Executes replacing the current authorizer with _authorizer.

!!! IMPORTANT !!! When changing the Authorizer the current set of assigned addresses to Roles are lost. Make sure initial owners are set properly.

Only callable by authorized caller.

function executeSetAuthorizer(IAuthorizer_v1 authorizer_) external;

Parameters

NameTypeDescription

authorizer_

IAuthorizer_v1

The address of the new {IAuthorizer_v1} module.

executeSetFundingManager

Executes replaces the current funding manager with fundingManager_.

!!! IMPORTANT !!! When changing the FundingManager the current funds still contained in the module might not be retrievable. Make sure to clean the FundingManager properly beforehand.

Only callable by authorized caller.

function executeSetFundingManager(IFundingManager_v1 fundingManager_)
    external;

Parameters

NameTypeDescription

fundingManager_

IFundingManager_v1

The address of the new {IFundingManager_v1} module.

executeSetPaymentProcessor

Executes replaces the current payment processor with paymentProcessor_.

!!! IMPORTANT !!! When changing the PaymentProcessor the current ongoing payment orders are lost. Make sure to resolve those payments properly beforehand.

Only callable by authorized caller.

function executeSetPaymentProcessor(IPaymentProcessor_v1 paymentProcessor_)
    external;

Parameters

NameTypeDescription

paymentProcessor_

IPaymentProcessor_v1

The address of the new {IPaymentProcessor_v1} module.

initiateAddModuleWithTimelock

Initiates the adding of a module to the {Orchestrator_v1} on a timelock.

Only callable by authorized address.

Fails of adding module exeeds max modules limit.

Fails if address invalid or address already added as module.

function initiateAddModuleWithTimelock(address module) external;

Parameters

NameTypeDescription

module

address

The module address to add.

initiateRemoveModuleWithTimelock

Initiate the removal of a module from the {Orchestrator_v1} on a timelock.

Reverts if module to be removed is the current authorizer/fundingManager/paymentProcessor. The functions specific to updating these 3 module categories should be used instead.

Only callable by authorized address.

Fails if address not added as module.

function initiateRemoveModuleWithTimelock(address module) external;

Parameters

NameTypeDescription

module

address

The module address to remove.

executeAddModule

Adds address module as module.

Only callable by authorized address.

Fails if adding of module has not been initiated.

Fails if timelock has not been expired yet.

function executeAddModule(address module) external;

Parameters

NameTypeDescription

module

address

The module address to add.

executeRemoveModule

Removes address module as module.

Only callable by authorized address.

Fails if removing of module has not been initiated.

Fails if timelock has not been expired yet.

function executeRemoveModule(address module) external;

Parameters

NameTypeDescription

module

address

The module address to remove.

cancelModuleUpdate

Cancels an initiated update for a module. Can be adding or removing a module from the {Orchestrator_v1}.

Only callable by authorized address.

Fails if module update has not been initiated.

function cancelModuleUpdate(address module) external;

Parameters

NameTypeDescription

module

address

The module address to remove.

orchestratorId

Returns the {Orchestrator_v1}'s id.

Unique id set by the {OrchestratorFactory_v1} during initialization.

function orchestratorId() external view returns (uint);

Returns

NameTypeDescription

<none>

uint256

The {Orchestrator_v1}'s id.

fundingManager

The {IFundingManager_v1} implementation used to hold and distribute Funds.

function fundingManager() external view returns (IFundingManager_v1);

Returns

NameTypeDescription

<none>

IFundingManager_v1

The {IFundingManager_v1} implementation.

authorizer

The {IAuthorizer_v1} implementation used to authorize addresses.

function authorizer() external view returns (IAuthorizer_v1);

Returns

NameTypeDescription

<none>

IAuthorizer_v1

The {IAuthorizer_v1} implementation.

paymentProcessor

The {IPaymentProcessor_v1} implementation used to process module payments.

function paymentProcessor() external view returns (IPaymentProcessor_v1);

Returns

NameTypeDescription

<none>

IPaymentProcessor_v1

The {IPaymentProcessor_v1} implementation.

governor

The {IGovernor_v1} implementation used for protocol level interactions.

function governor() external view returns (IGovernor_v1);

Returns

NameTypeDescription

<none>

IGovernor_v1

The {IGovernor_v1} implementation.

Events

AuthorizerUpdated

Authorizer updated to new address.

event AuthorizerUpdated(address indexed _address);

Parameters

NameTypeDescription

_address

address

The new address.

FundingManagerUpdated

FundingManager updated to new address.

event FundingManagerUpdated(address indexed _address);

Parameters

NameTypeDescription

_address

address

The new address.

PaymentProcessorUpdated

PaymentProcessor updated to new address.

event PaymentProcessorUpdated(address indexed _address);

Parameters

NameTypeDescription

_address

address

The new address.

OrchestratorInitialized

{Orchestrator_v1} has been initialized with the corresponding modules.

event OrchestratorInitialized(
    uint indexed orchestratorId_,
    address fundingManager,
    address authorizer,
    address paymentProcessor,
    address[] modules,
    address governor
);

Parameters

NameTypeDescription

orchestratorId_

uint256

The id of the {Orchestrator_v1}.

fundingManager

address

The address of the {IFundingManager_v1} module.

authorizer

address

The address of the {IAuthorizer_v1} module.

paymentProcessor

address

The address of the {IPaymentProcessor_v1} module.

modules

address[]

The addresses of the other modules used in the {Orchestrator_v1}.

governor

address

The address of the {Governor_v1} contract used to reference protocol level interactions.

Errors

Orchestrator__CallerNotAuthorized

Function is only callable by authorized caller.

error Orchestrator__CallerNotAuthorized(bytes32 role, address caller);

Parameters

NameTypeDescription

role

bytes32

The role of the caller.

caller

address

The caller address.

Orchestrator__InvalidModuleType

The given module is not used in the {Orchestrator_v1}.

error Orchestrator__InvalidModuleType(address module);

Parameters

NameTypeDescription

module

address

The module address.

Orchestrator__MismatchedTokenForFundingManager

The token of the new funding manager is not the same as the current funding manager.

error Orchestrator__MismatchedTokenForFundingManager(
    address currentToken, address newToken
);

Parameters

NameTypeDescription

currentToken

address

The current token.

newToken

address

The new token.

Orchestrator__DependencyInjection__ModuleNotUsedInOrchestrator

The given module is not used in the {Orchestrator_v1}.

error Orchestrator__DependencyInjection__ModuleNotUsedInOrchestrator();

Orchestrator__InvalidRemovalOfAuthorizer

The Authorizer can not be removed through this function.

error Orchestrator__InvalidRemovalOfAuthorizer();

Orchestrator__InvalidRemovalOfFundingManager

The FundingManager can not be removed through this function.

error Orchestrator__InvalidRemovalOfFundingManager();

Orchestrator__InvalidRemovalOfPaymentProcessor

The PaymentProcessor can not be removed through this function.

error Orchestrator__InvalidRemovalOfPaymentProcessor();

Last updated