IModule_v1.sol

Git Source

Functions

init

The module's initializer function.

CAN be overridden by downstream contract.

MUST call __Module_init().

function init(
    IOrchestrator_v1 orchestrator,
    Metadata memory metadata,
    bytes memory configData
) external;

Parameters

Name
Type
Description

orchestrator

IOrchestrator_v1

The module's {Orchestrator_v1} instance.

metadata

Metadata

The module's metadata.

configData

bytes

Variable config data for specific module implementations.

identifier

Returns the module's identifier.

The identifier is defined as the keccak256 hash of the module's abi packed encoded major version, url and title.

Returns

Name
Type
Description

<none>

bytes32

The module's identifier.

version

Returns the module's version.

Returns

Name
Type
Description

<none>

uint256

The module's major version.

<none>

uint256

The module's minor version.

<none>

uint256

The module's patch version.

url

Returns the module's URL.

Returns

Name
Type
Description

<none>

string

The module's URL.

title

Returns the module's title.

Returns

Name
Type
Description

<none>

string

The module's title.

orchestrator

Returns the module's {Orchestrator_v1} interface, {IOrchestrator_v1}.

Returns

Name
Type
Description

<none>

IOrchestrator_v1

The module's {Orchestrator_1}.

grantModuleRole

Grants a module role to a target address.

Parameters

Name
Type
Description

role

bytes32

The role to grant.

target

address

The target address to grant the role to.

grantModuleRoleBatched

Grants a module role to multiple target addresses.

Parameters

Name
Type
Description

role

bytes32

The role to grant.

targets

address[]

The target addresses to grant the role to.

revokeModuleRole

Revokes a module role from a target address.

Parameters

Name
Type
Description

role

bytes32

The role to revoke.

target

address

The target address to revoke the role from.

revokeModuleRoleBatched

Revokes a module role from multiple target addresses.

Parameters

Name
Type
Description

role

bytes32

The role to revoke.

targets

address[]

The target addresses to revoke the role from.

Events

ModuleInitialized

Module has been initialized.

Parameters

Name
Type
Description

parentOrchestrator

address

The address of the {Orchestrator_v1} the module is linked to.

metadata

Metadata

The metadata of the module.

ProtocolFeeTransferred

Event emitted when protocol fee has been transferred to the treasury.

Parameters

Name
Type
Description

token

address

The token received as protocol fee.

treasury

address

The protocol treasury address receiving the token fee amount.

feeAmount

uint256

The fee amount transferred to the treasury.

Errors

Module__CallerNotAuthorized

Function is only callable by authorized caller.

Parameters

Name
Type
Description

role

bytes32

The role that is required.

caller

address

The address that is required to have the role.

Module__OnlyCallableByOrchestrator

Function is only callable by the {Orchestrator_v1}.

Module__OnlyCallableByPaymentClient

Function is only callable by a {IERC20PaymentClientBase_v1}.

Module__InvalidOrchestratorAddress

Given {Orchestrator_v1} address invalid.

Module__InvalidMetadata

Given metadata invalid.

Module_OrchestratorCallbackFailed

{Orchestrator_v1} callback triggered failed.

Parameters

Name
Type
Description

funcSig

string

The signature of the function called.

Module__InvalidAddress

Invalid Address.

Structs

Metadata

The module's metadata.

Properties

Name
Type
Description

majorVersion

uint256

The module's major version.

minorVersion

uint256

The module's minor version.

patchVersion

uint256

The module's patch version.

url

string

The module's URL.

title

string

The module's title.

Last updated