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.

function identifier() external view returns (bytes32);

Returns

Name
Type
Description

<none>

bytes32

The module's identifier.

version

Returns the module's version.

function version() external view returns (uint, uint, uint);

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.

function url() external view returns (string memory);

Returns

Name
Type
Description

<none>

string

The module's URL.

title

Returns the module's title.

function title() external view returns (string memory);

Returns

Name
Type
Description

<none>

string

The module's title.

orchestrator

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

function orchestrator() external view returns (IOrchestrator_v1);

Returns

Name
Type
Description

<none>

IOrchestrator_v1

The module's {Orchestrator_1}.

grantModuleRole

Grants a module role to a target address.

function grantModuleRole(bytes32 role, address target) external;

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.

function grantModuleRoleBatched(bytes32 role, address[] calldata targets)
    external;

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.

function revokeModuleRole(bytes32 role, address target) external;

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.

function revokeModuleRoleBatched(bytes32 role, address[] calldata targets)
    external;

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.

event ModuleInitialized(address indexed parentOrchestrator, Metadata metadata);

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.

event ProtocolFeeTransferred(
    address indexed token, address indexed treasury, uint feeAmount
);

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.

error Module__CallerNotAuthorized(bytes32 role, address 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}.

error Module__OnlyCallableByOrchestrator();

Module__OnlyCallableByPaymentClient

Function is only callable by a {IERC20PaymentClientBase_v1}.

error Module__OnlyCallableByPaymentClient();

Module__InvalidOrchestratorAddress

Given {Orchestrator_v1} address invalid.

error Module__InvalidOrchestratorAddress();

Module__InvalidMetadata

Given metadata invalid.

error Module__InvalidMetadata();

Module_OrchestratorCallbackFailed

{Orchestrator_v1} callback triggered failed.

error Module_OrchestratorCallbackFailed(string funcSig);

Parameters

Name
Type
Description

funcSig

string

The signature of the function called.

Module__InvalidAddress

Invalid Address.

error Module__InvalidAddress();

Structs

Metadata

The module's metadata.

struct Metadata {
    uint majorVersion;
    uint minorVersion;
    uint patchVersion;
    string url;
    string title;
}

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